text
stringlengths
2
1.04M
meta
dict
<!DOCTYPE html> <html lang="pt"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="author" content=""> <link rel="icon" type="image/png" href="img/favicon-32x32.png" sizes="32x32" /> <link rel="icon" type="image/png" href="img/favicon-16x16.png" sizes="16x16" /> <link rel="icon" type="image/png" href="img/favicon-128.png" sizes="128x128" /> <title>A luta pela moradia</title> <link href="vendor/bootstrap/css/bootstrap.css" rel="stylesheet"> <link href="vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"> <link href="https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800" rel="stylesheet" type="text/css"> <link href="https://fonts.googleapis.com/css?family=Merriweather:400,300,300italic,400italic,700,700italic,900,900italic" rel="stylesheet" type="text/css"> <link href="https://fonts.googleapis.com/css?family=Shadows+Into+Light|Shadows+Into+Light+Two" rel="stylesheet"> <link href="https://fonts.googleapis.com/css?family=Bad+Script" rel="stylesheet"> <link href="https://fonts.googleapis.com/css?family=Bad+Script|Miltonian|Mr+Dafoe|Yellowtail" rel="stylesheet"> <link href="https://fonts.googleapis.com/css?family=Mr+Dafoe|Raleway" rel="stylesheet"> <link href="css/creative.css" rel="stylesheet"> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-109266252-1"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-109266252-1'); </script> </head> <body id="page-top"> <nav id="mainNav" class="navbar navbar-default navbar-fixed-top"> <div class="container-fluid"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">Toggle navigation</span><i class="fa fa-bars"></i> </button> <a class="navbar-brand page-scroll" href="index.html">Por dentro da ocupação</a> </div> <div class="hidden-lg hidden-md"> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav navbar-right"> <li> <a class="page-scroll" href="index.html">1. Por dentro da ocupação</a> </li> <li> <a class="page-scroll" href="capitulo2.html">2. A luta pela moradia</a> </li> <li> <a class="page-scroll" href="capitulo3.html">3. Por que as ocupações existem?</a> </li> <li> <a class="page-scroll" href="capitulo4.html">4. De volta à comunidade</a> </li> <li> <a class="page-scroll" href="capitulo5.html">5. Diário de Bordo</a> </li> </ul> </div> </div> <div class="hidden-xs hidden-sm"> <div class="dropdown"> <button class="btn btn-default dropdown-toggle pull-right" style="margin-top:10px" type="button" data-toggle="dropdown">Menu <span class="caret"></span></button> <ul class="dropdown-menu dropdown-menu-right" style="margin-top:35px;"> <li> <a class="page-scroll" href="index.html">1. Por dentro da ocupação</a> </li> <li> <a class="page-scroll" href="capitulo2.html">2. A luta pela moradia</a> </li> <li> <a class="page-scroll" href="capitulo3.html">3. Por que as ocupações existem?</a> </li> <li> <a class="page-scroll" href="capitulo4.html">4. De volta à comunidade</a> </li> <li> <a class="page-scroll" href="capitulo5.html">5. Diário de Bordo</a> </li> </ul> </div> </div> </div> </nav> <header> <div class="header-content"> <div class="header-content-inner"> <p id="homeHeading">A LUTA PELA</p> <p id="homeHeading2">moradia</p> <video class="video-2 img-responsive" id="bgvid" playsinline autoplay muted loop> <source src="video/drone4.mp4" type="video/mp4" media="only screen and (min-device-width: 568px)"> <source src="video/drone4_480.mp4" type="video/mp4" media="only screen and (max-device-width: 568px)"> <img src="img/aerea4.jpg"> </video> </div> </div> </header> <section class="bg-text" id="about"> <div class="container"> <div class="row"> <div class="col-lg-8 col-lg-offset-2 text-left"> <hr class="light"> <p class="text-faded" id="cap">A região onde está localizada Joinville, cidade do norte catarinense, pertencia à princesa Francisca Carolina – era o dote dado pelo casamento dela com o príncipe de Joinville, filho do rei francês Luís Filipe I. Depois de 1855, parte das terras foram vendidas aos alemães que, posteriormente, trouxeram imigrantes para colonizar a área. Inicialmente a economia era apenas para subsistência dos moradores da localidade, mas, com a construção de estradas e ferrovias e o consequente crescimento econômico, a população começou a aumentar. De acordo com dados do Plano Municipal de Habitação e Interesse Social de Joinville, a cidade passou de 353.231 habitantes em 1991, para uma estimativa de 569.645, segundo dados do IBGE Cidades, de 2016.<br/> </p> </div> </div> </div> </section> <section class="antenor_arte"> <img src="img/arte/crescimento hab 1920px.png" class="img-responsive"> </section> <section class="bg-text"> <div class="container"> <div class="row"> <div class="col-lg-12 text-center"> </div> </div> </div> <div class="container"> <div class="row"> <div class="col-lg-8 col-lg-offset-2 text-left"> <hr class="light"> <p class="text-faded">As ocupações irregulares são um problema social histórico no Brasil. Joinville, apesar de ser a cidade com o maior PIB de Santa Catarina (em 2014 a cidade gerou R$24,5 bilhões, 41% a mais que a capital Florianópolis) e com IDH 0,809 – considerado muito alto – não escapa desse aspecto de desigualdade social, presente na maioria das cidades brasileiras. O Instituto Brasileiro de Geografia e Estatística (IBGE) apontou, no censo de 2010, que existiam dez localidades consideradas como aglomerados subnormais – assentamentos irregulares com baixa ou nenhuma infraestrutura, geralmente associados às favelas. Esse dado não considerou a Ocupação Machado, no bairro Morro do Meio, formada há cerca de cinco anos.</p> <p>O Morro do Meio, que em 2016 estava com uma população de 10.859 habitantes, é um bairro afastado do restante da cidade, como pode ser verificado no mapa abaixo. A renda per capita de 49,8% dos moradores é de até um salário mínimo, e o percentual de pessoas que recebe de um a três salários é de 46,2%. O bairro conta com alguns serviços públicos: duas escolas municipais e um ensino médio noturno (que utiliza o espaço de uma das escolas), dois Centros de Educação Infantil, três unidades básicas de saúde, entre outros. Mas, apesar de estar crescendo em infraestrutura ao longo dos anos, ainda há muito a ser feito.</p> <p>Para o sociólogo Charles Henrique Voos, as áreas mais periféricas da cidade são as que mais sofrem com a falta de infraestrutura e lazer, além da dificuldade de mobilidade urbana. Os lugares onde há mais concentração de renda per capita são geralmente onde há mais condições de qualidade de vida. Esse problema se intensifica se o olhar se volta aos moradores de assentamentos irregulares, como a Ocupação Machado.</p> <br/> <h4>Confira no mapa de Joinville onde fica o bairro Morro do Meio</h4> </div> </div> </div> </section> <!-- aqui vai o mapa do morro do meio do google maps --> <section class="bg-dark"> <div class="container-fluid text-center"> <div class="row"> <div class="call-to-action"> <h2 class="section-heading" class="multi">Mapa do bairro</h2> <br> <div class="js-map map"></div> </div> </div> </div> </section> <section class="bg-text"> <div class="container"> <div class="row"> <div class="col-lg-12 text-center"> <h2 class="section-heading">De quem são os terrenos ocupados</h2> <hr class="primary"> </div> </div> </div> <div class="container"> <div class="row"> <div class="col-lg-8 col-lg-offset-2 text-left"> <hr class="light"> <p class="text-faded">Em Joinville, mais de oito mil pessoas aguardam na fila da Secretaria da Habitação (Sehab) para regularizar sua situação de moradia ou conseguir uma habitação popular. Enquanto isso, as quase 100 famílias que moram na Ocupação Machado vivem constantemente preocupadas com uma possível reintegração de posse. Os terrenos ocupados pela comunidade são propriedade do município e estão em área afetada – ou seja, pela lei, têm uma destinação específica. Sendo assim, para que a prefeitura possa regularizar os lotes naquele local, é necessário passar por um <b>processo de desafetação</b> junto ao Ministério Público. No caso da Ocupação Machado, os terrenos são destinados a Equipamento Público e Área Verde.</p> <p>O gerente de engenharia da Secretaria da Habitação, Maurício de Diniz Martins explica que, quando um loteamento é criado, a lei exige que o município deve receber 15% desse loteamento. Esses terrenos recebem uma destinação, como é o caso da área onde está a ocupação no bairro Morro do Meio. Os terrenos destinados a Equipamento Público devem ser utilizados para construção de escolas ou postos de saúde, por exemplo. Já os terrenos destinados à Área Verde precisam ser uma área verde ou uma praça.</p> <p>Para fazer uma desafetação, a Secretaria da Habitação faz uma audiência pública, com base nas fundamentações legais, e aprova (ou não) aquilo que é a pauta da vez. No caso de ocupações irregulares, a comunidade do entorno é consultada, mas, de acordo Martins, na maioria dos casos não há participação popular por falta de envolvimento dos moradores.</p> <p>As desafetações não estão acontecendo no momento por conta da Medida Provisória 759/2016, que altera as regras de regularização e está em tramitação no Congresso Nacional.</p> <br/> <h4>Confira no mapa os terrenos ocupados e quais são suas destinações:</h4> </div> </div> </div> </section> <section class="antenor_arte"> <div class="row"> <img src="img/arte/mapa ocupação.png" class="img-responsive"> </div> </section> <section class="bg-text"> <div class="container"> <div class="row"> <div class="col-lg-12 text-center"> <h2 class="section-heading">O que diz a legislação sobre moradia</h2> <hr class="primary"> </div> </div> </div> <div class="container"> <div class="row"> <div class="col-lg-8 col-lg-offset-2 text-left"> <hr class="light"> <p class="text-faded">A doutora em Arquitetura e Urbanismo pela USP e analista de infraestrutura do Ministério das Cidades, Ana Paula Bruno, acredita que nos últimos anos o país avançou muito em termos legais e institucionais acerca dessa temática de habitação. Ela destaca como um marco importante a criação do Estatuto da Cidade, em 2001, uma lei federal que estabelece as normas gerais de política urbana e que devem ser seguidas pelos municípios. O Estatuto, segundo ela, foi o precedente para um conjunto de legislações que veio em seguida, ao longo dos últimos 15 anos.</p> <p>Outro marco foi a criação do Ministério das Cidades, em 2003, a estrutura institucional que permitiu a formação de uma série de políticas, programas e ações voltadas a essa questão de ocupações irregulares. Ana Paula ressalta duas delas: o programa de urbanização de assentamentos precários e as ações de regularização fundiária. “Também houve, com o programa de aceleração do crescimento, um aumento muito expressivo dos investimentos dos recursos destinados a esse tipo de ação. Então a gente conseguiu, no Brasil, de uma certa forma, massificar essas ações”, afirma.</p> <p>Para ela, não é a falta de legislação que causa ou contribui para o crescimento de ocupações irregulares de baixa renda. “Não penso que é por falta de mecanismo legal. As políticas públicas estão desenhadas”, afirma. Atualmente existem leis que garantem o direito à moradia com mecanismos e políticas públicas como o programa Minha Casa, Minha Vida (Lei 12.424/2011). Esse é um exemplo de um mecanismo do governo que faz cumprir o que diz no artigo 6º da Constituição Federal: a moradia é um dos direitos fundamentais da população, lado a lado com a saúde, a educação, a segurança e outros.</p> </div> </div> </div> </section> <aside class="bg-dark"> <div class="container text-center"> <div class="call-to-action"> <h2>Ana Paula Bruno fala sobre Ministério das Cidades</h2> <br> <div class="col-lg-2 col-lg-offset-3 text-center"> <img src="img/ana-paula-bruno.png" class="img-circle img-responsive"> </div> <div class="col-lg-4 text-center"> <audio class="audio" src="audio/ministerio-cidades.mp3" controls></audio> </div> </div> </div> </aside> <section class="bg-text"> <div class="container"> <div class="row"> <div class="col-lg-8 col-lg-offset-2 text-left"> <hr class="light"> <p class="text-faded">O doutor em Sociologia pela Universidade Federal do Rio Grande do Sul Charles Henrique Voos, entretanto, problematiza a forma como esse mecanismo é utilizado pelos municípios. Ele ressalta que não é suficiente fazer moradia, é preciso fazer cidade. Além disso, existem os casos em que a família recebe o benefício, mas acaba vendendo e voltando para o seu local de origem, a ocupação. “Isso é um reflexo direto da cidade e da terra urbana como uma mercadoria. A partir do momento em que você ganha um apartamento para dizer que é seu, você tem uma quantidade de dinheiro que está embutida naquele produto (no caso, a moradia). Então se você revende aquilo, com certeza vai ganhar o dinheiro e vai voltar para algum lugar porque você volta à condição que você tinha anteriormente”, exemplifica.</p> <p>Outro problema apontado pelo sociólogo são os locais onde são construídas essas habitações populares. “Muitas vezes as pessoas que são contempladas com essas políticas públicas vão para lugares muito distantes do seu antigo local de moradia. Então rompem todos os seus laços sociais, familiares, inclusive culturais. Elas saem de uma esfera não oficial da cidade e vão para outra. Mesmo tendo a escritura, ainda continuam na cidade informal”, reflete.</p> <p>O condomínio residencial Trentino, maior conjunto habitacional da cidade, com mais de 700 apartamentos, é um exemplo citado por Voos. “É uma área periférica sem infraestrutura onde foram colocadas muitas famílias de uma vez só. Morando num lugar muito semelhante ao que estavam antes e agora com um negócio que pode valer milhares de reais, elas vendem e voltam a ocupar, porque a condição de moradia continua a mesma”, explica. Este é um reflexo da cidade como uma mercadoria, de acordo com ele.</p> <p>Em Joinville, os órgãos que defendem juridicamente a população que está em ocupações irregulares são a Defensoria Pública do Estado e a Defensoria Pública da União, além do Centro de Direitos Humanos (CDH) Maria da Graça Bráz. As duas primeiras instituições trabalham muitas vezes em conjunto com o CDH para garantir que as famílias não sejam despejadas, o que serviria apenas para aumentar o problema.</p> </div> </div> </div> </section> <section class="bg-text"> <div class="container"> <div class="row"> <div class="col-lg-12 text-center"> <h2 class="section-heading">O papel do CDH na luta pela moradia</h2> <hr class="primary"> </div> <div class="col-lg-8 col-lg-offset-2 text-left"> <hr class="light"> <p class="text-faded">Em Joinville, os órgãos que defendem juridicamente a população que está em ocupações irregulares são a Defensoria Pública do Estado e a Defensoria Pública da União, além do Centro de Direitos Humanos (CDH) Maria da Graça Bráz. As duas primeiras instituições trabalham muitas vezes em conjunto com o CDH para garantir que as famílias não sejam despejadas, o que serviria apenas para aumentar o problema.</p> </div> </div> </div> </section> <br/> <br/> <section class="bg-dark"> <div class="container-fluid text-center"> <div class="row"> <div class="call-to-action"> <h2 class="section-heading">O papel do CDH na luta pela moradia</h2> <div style="position:relative;height:0;padding-bottom:56.25%"><iframe src="https://www.youtube.com/embed/O9k8mC9Z8Jk?rel=0?ecver=2" width="640" height="360" frameborder="0" style="position:absolute;width:100%;height:100%;left:0" allowfullscreen></iframe></div> </div> </div> </div> </section> <br/> <br/> <section id="contact"> <div class="container"> <div class="row"> <div class="col-lg-8 col-lg-offset-2 text-center"> <a href="capitulo3.html" class="next-page"> Próximo capítulo</a> <hr class="primary"> </div> </div> </div> </section> <!-- jQuery --> <script src="vendor/jquery/jquery.min.js"></script> <script src="vendor/bootstrap/js/bootstrap.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js"></script> <script src="vendor/scrollreveal/scrollreveal.min.js"></script> <script src="vendor/iphone-inline-video.min.js"></script> <script src="js/creative.js"></script> <script async defer src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCFzuJCp7MhnDZRvobPMWx0bc_Ypkw0sUY&callback=initMap"></script> </body> </html>
{ "content_hash": "1d96863df01c26917bf58de4c66d56e2", "timestamp": "", "source": "github", "line_count": 292, "max_line_length": 839, "avg_line_length": 69.39383561643835, "alnum_prop": 0.6224645906331737, "repo_name": "jessicaweirich/pordentrodaocupacao", "id": "50571bd70e253d445bd95b7fcea25626f67edb95", "size": "20611", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "capitulo2.html", "mode": "33261", "license": "mit", "language": [ { "name": "CSS", "bytes": "11582" }, { "name": "HTML", "bytes": "90879" }, { "name": "JavaScript", "bytes": "42824" } ], "symlink_target": "" }
Book store site Downlaod files and run on your local server Not fully completed
{ "content_hash": "02363ac87d9d6c678e62f54d4c37c6b2", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 43, "avg_line_length": 26.666666666666668, "alnum_prop": 0.825, "repo_name": "rajeshedayangatt/shopping", "id": "82f2ae262aad3e58f8aaaec1adf7029b4f43109e", "size": "80", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "479" }, { "name": "PHP", "bytes": "18685" } ], "symlink_target": "" }
<!DOCTYPE html> <!--[if IE]><![endif]--> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title>Enum FrameworkLibraryType </title> <meta name="viewport" content="width=device-width"> <meta name="title" content="Enum FrameworkLibraryType "> <meta name="generator" content="docfx 2.28.2.0"> <link rel="shortcut icon" href="../favicon.ico"> <link rel="stylesheet" href="../styles/docfx.vendor.css"> <link rel="stylesheet" href="../styles/docfx.css"> <link rel="stylesheet" href="../styles/main.css"> <meta property="docfx:navrel" content="../toc.html"> <meta property="docfx:tocrel" content="toc.html"> </head> <body data-spy="scroll" data-target="#affix"> <div id="wrapper"> <header> <nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="../index.html"> <img id="logo" class="svg" src="../logo.svg" alt=""> </a> </div> <div class="collapse navbar-collapse" id="navbar"> <form class="navbar-form navbar-right" role="search" id="search"> <div class="form-group"> <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off"> </div> </form> </div> </div> </nav> <div class="subnav navbar navbar-default"> <div class="container hide-when-search" id="breadcrumb"> <ul class="breadcrumb"> <li></li> </ul> </div> </div> </header> <div role="main" class="container body-content hide-when-search"> <div class="sidenav hide-when-search"> <a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a> <div class="sidetoggle collapse" id="sidetoggle"> <div id="sidetoc"></div> </div> </div> <div class="article row grid-right"> <div class="col-md-10"> <article class="content wrap" id="_content" data-uid="Juhta.Net.Framework.FrameworkLibraryType"> <h1 id="Juhta_Net_Framework_FrameworkLibraryType" data-uid="Juhta.Net.Framework.FrameworkLibraryType" class="text-break">Enum FrameworkLibraryType </h1> <div class="markdown level0 summary"><p>Defines an enumeration for the framework library types.</p> </div> <div class="markdown level0 conceptual"></div> <h6><strong>Namespace</strong>: <a class="xref" href="Juhta.Net.Framework.html">Juhta.Net.Framework</a></h6> <h6><strong>Assembly</strong>: Juhta.Net.dll</h6> <h5 id="Juhta_Net_Framework_FrameworkLibraryType_syntax">Syntax</h5> <div class="codewrapper"> <pre><code class="lang-csharp hljs">public enum FrameworkLibraryType</code></pre> </div> <h3 id="fields">Fields </h3> <table class="table table-bordered table-striped table-condensed"> <thead> <tr> <th>Name</th> <th>Description</th> </tr> <thead> <tbody> <tr> <td id="Juhta_Net_Framework_FrameworkLibraryType_Console">Console</td> <td><p>Specifies the Console library.</p> </td> </tr> <tr> <td id="Juhta_Net_Framework_FrameworkLibraryType_Core">Core</td> <td><p>Specifies the Core library.</p> </td> </tr> <tr> <td id="Juhta_Net_Framework_FrameworkLibraryType_LibraryManagement">LibraryManagement</td> <td><p>Specifies the Library Management library.</p> </td> </tr> <tr> <td id="Juhta_Net_Framework_FrameworkLibraryType_Services">Services</td> <td><p>Specifies the Services library.</p> </td> </tr> <tr> <td id="Juhta_Net_Framework_FrameworkLibraryType_Startup">Startup</td> <td><p>Specifies the Startup library.</p> </td> </tr> <tr> <td id="Juhta_Net_Framework_FrameworkLibraryType_Validation">Validation</td> <td><p>Specifies the Validation library.</p> </td> </tr> </tbody> </thead></thead></table> </article> </div> <div class="hidden-sm col-md-2" role="complementary"> <div class="sideaffix"> <div class="contribution"> <ul class="nav"> <li> <a href="https://github.com/jlahteen/juhta.net/new/release/v1.0.0-rc2/apiSpec/new?filename=Juhta_Net_Framework_FrameworkLibraryType.md&amp;value=---%0Auid%3A%20Juhta.Net.Framework.FrameworkLibraryType%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A" class="contribution-link">Improve this Doc</a> </li> <li> <a href="https://github.com/jlahteen/juhta.net/blob/release/v1.0.0-rc2/src/Juhta.Net/Framework/Types.cs/#L16" class="contribution-link">View Source</a> </li> </ul> </div> <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix"> <!-- <p><a class="back-to-top" href="#top">Back to top</a><p> --> </nav> </div> </div> </div> </div> <footer> <div class="grad-bottom"></div> <div class="footer"> <div class="container"> <span class="pull-right"> <a href="#top">Back to top</a> </span> <span>Copyright © 2017-2018 Juha Lähteenmäki<br>Generated by <b>DocFX</b></span> </div> </div> </footer> </div> <script type="text/javascript" src="../styles/docfx.vendor.js"></script> <script type="text/javascript" src="../styles/docfx.js"></script> <script type="text/javascript" src="../styles/main.js"></script> </body> </html>
{ "content_hash": "f05a45d39807f378af88abbbf32ad1a4", "timestamp": "", "source": "github", "line_count": 168, "max_line_length": 458, "avg_line_length": 39.06547619047619, "alnum_prop": 0.5716897760170654, "repo_name": "jlahteen/Juhta.NET", "id": "27aee06e3cd478fee076057a683b077d4535ac5a", "size": "6568", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "docs/1.0.0-rc2/api/Juhta.Net.Framework.FrameworkLibraryType.html", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "76" }, { "name": "C#", "bytes": "825141" } ], "symlink_target": "" }
<!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.6.0_18) on Thu Dec 18 17:17:26 PST 2014 --> <title>SSLSessionBindingListener (Java Platform SE 7 )</title> <meta name="date" content="2014-12-18"> <meta name="keywords" content="javax.net.ssl.SSLSessionBindingListener interface"> <meta name="keywords" content="valueBound()"> <meta name="keywords" content="valueUnbound()"> <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="SSLSessionBindingListener (Java Platform SE 7 )"; } //--> </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><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/SSLSessionBindingListener.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 class="aboutLanguage"><em><strong>Java&trade;&nbsp;Platform<br>Standard&nbsp;Ed.&nbsp;7</strong></em></div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../javax/net/ssl/SSLSessionBindingEvent.html" title="class in javax.net.ssl"><span class="strong">Prev Class</span></a></li> <li><a href="../../../javax/net/ssl/SSLSessionContext.html" title="interface in javax.net.ssl"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../index.html?javax/net/ssl/SSLSessionBindingListener.html" target="_top">Frames</a></li> <li><a href="SSLSessionBindingListener.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> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method_detail">Method</a></li> </ul> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">javax.net.ssl</div> <h2 title="Interface SSLSessionBindingListener" class="title">Interface SSLSessionBindingListener</h2> </div> <div class="contentContainer"> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>All Superinterfaces:</dt> <dd><a href="../../../java/util/EventListener.html" title="interface in java.util">EventListener</a></dd> </dl> <hr> <br> <pre>public interface <span class="strong">SSLSessionBindingListener</span> extends <a href="../../../java/util/EventListener.html" title="interface in java.util">EventListener</a></pre> <div class="block">This interface is implemented by objects which want to know when they are being bound or unbound from a SSLSession. When either event occurs via <a href="../../../javax/net/ssl/SSLSession.html#putValue(java.lang.String,%20java.lang.Object)"><code>SSLSession.putValue(String, Object)</code></a> or <a href="../../../javax/net/ssl/SSLSession.html#removeValue(java.lang.String)"><code>SSLSession.removeValue(String)</code></a>, the event is communicated through a SSLSessionBindingEvent identifying the session.</div> <dl><dt><span class="strong">Since:</span></dt> <dd>1.4</dd> <dt><span class="strong">See Also:</span></dt><dd><a href="../../../javax/net/ssl/SSLSession.html" title="interface in javax.net.ssl"><code>SSLSession</code></a>, <a href="../../../javax/net/ssl/SSLSessionBindingEvent.html" title="class in javax.net.ssl"><code>SSLSessionBindingEvent</code></a></dd></dl> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method_summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../javax/net/ssl/SSLSessionBindingListener.html#valueBound(javax.net.ssl.SSLSessionBindingEvent)">valueBound</a></strong>(<a href="../../../javax/net/ssl/SSLSessionBindingEvent.html" title="class in javax.net.ssl">SSLSessionBindingEvent</a>&nbsp;event)</code> <div class="block">This is called to notify the listener that it is being bound into an SSLSession.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../javax/net/ssl/SSLSessionBindingListener.html#valueUnbound(javax.net.ssl.SSLSessionBindingEvent)">valueUnbound</a></strong>(<a href="../../../javax/net/ssl/SSLSessionBindingEvent.html" title="class in javax.net.ssl">SSLSessionBindingEvent</a>&nbsp;event)</code> <div class="block">This is called to notify the listener that it is being unbound from a SSLSession.</div> </td> </tr> </table> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method_detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="valueBound(javax.net.ssl.SSLSessionBindingEvent)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>valueBound</h4> <pre>void&nbsp;valueBound(<a href="../../../javax/net/ssl/SSLSessionBindingEvent.html" title="class in javax.net.ssl">SSLSessionBindingEvent</a>&nbsp;event)</pre> <div class="block">This is called to notify the listener that it is being bound into an SSLSession.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>event</code> - the event identifying the SSLSession into which the listener is being bound.</dd></dl> </li> </ul> <a name="valueUnbound(javax.net.ssl.SSLSessionBindingEvent)"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>valueUnbound</h4> <pre>void&nbsp;valueUnbound(<a href="../../../javax/net/ssl/SSLSessionBindingEvent.html" title="class in javax.net.ssl">SSLSessionBindingEvent</a>&nbsp;event)</pre> <div class="block">This is called to notify the listener that it is being unbound from a SSLSession.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>event</code> - the event identifying the SSLSession from which the listener is being unbound.</dd></dl> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><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><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/SSLSessionBindingListener.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 class="aboutLanguage"><em><strong>Java&trade;&nbsp;Platform<br>Standard&nbsp;Ed.&nbsp;7</strong></em></div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../javax/net/ssl/SSLSessionBindingEvent.html" title="class in javax.net.ssl"><span class="strong">Prev Class</span></a></li> <li><a href="../../../javax/net/ssl/SSLSessionContext.html" title="interface in javax.net.ssl"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../index.html?javax/net/ssl/SSLSessionBindingListener.html" target="_top">Frames</a></li> <li><a href="SSLSessionBindingListener.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> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method_detail">Method</a></li> </ul> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small><font size="-1"> <a href="http://bugreport.sun.com/bugreport/">Submit a bug or feature</a> <br>For further API reference and developer documentation, see <a href="http://docs.oracle.com/javase/7/docs/index.html" target="_blank">Java SE Documentation</a>. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.<br> <a href="../../../../legal/cpyr.html">Copyright</a> &#x00a9; 1993, 2015, Oracle and/or its affiliates. All rights reserved. </font></small></p> </body> </html>
{ "content_hash": "b56cec55f94dab61dfbc6b6b99c9b352", "timestamp": "", "source": "github", "line_count": 253, "max_line_length": 596, "avg_line_length": 42.03162055335969, "alnum_prop": 0.6651307128079744, "repo_name": "fbiville/annotation-processing-ftw", "id": "f6d2ac7ee972985432121ab3e8ef0894dd8a0241", "size": "10634", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "doc/java/jdk7/javax/net/ssl/SSLSessionBindingListener.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "191178" }, { "name": "HTML", "bytes": "63904" }, { "name": "Java", "bytes": "107042" }, { "name": "JavaScript", "bytes": "246677" } ], "symlink_target": "" }
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNet.Mvc.Rendering; namespace ASPCoreApp1.ViewModels.Account { public class SendCodeViewModel { public string SelectedProvider { get; set; } public ICollection<SelectListItem> Providers { get; set; } public string ReturnUrl { get; set; } public bool RememberMe { get; set; } } }
{ "content_hash": "c3b66fa29bde645d277f3002e19819cb", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 66, "avg_line_length": 23.31578947368421, "alnum_prop": 0.6997742663656885, "repo_name": "fernandolozer/CursoAspNetCore1", "id": "9ed10673b93f9df87ceac16bfef6fbdf8824a578", "size": "445", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ASPCoreApp1/src/ASPCoreApp1/ViewModels/Account/SendCodeViewModel.cs", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "105" }, { "name": "C#", "bytes": "651376" }, { "name": "CSS", "bytes": "3433" }, { "name": "HTML", "bytes": "53128" }, { "name": "JavaScript", "bytes": "19008" } ], "symlink_target": "" }
%% testcoefficient_senv % % This function tests the null hypothesis L * beta * R = A versus the % alternative hypothesis L * beta * R ~= A, where beta is estimated under % the scaled envelope model. %% Syntax % TestOutput = testcoefficient_senv(ModelOutput) % TestOutput = testcoefficient_senv(ModelOutput, TestInput) % %% Input % % *ModelOutput*: A list containing the maximum likelihood estimators and other % statistics inherited from senv. % % *TestInput*: A list that specifies the null hypothesis, including L, R, and % A. If not provided by the user, default values will be used. % % * TestInput.L: The matrix multiplied to $$\beta$ on the left. It is a d1 % by r matrix, while d1 is less than or equal to r. Default value: % identity matrix $$I_r$. % * TestInput.R: The matrix multiplied to $$\beta$ on the right. It is a p % by d2 matrix, while d2 is less than or equal to p. Default value: % identity matrix $$I_p$. % * TestInput.A: The matrix on the right hand side of the equation. It is a % d1 by d2 matrix. Default value: d1 by d2 zero matrix. % %% Output % % *TestOutput*: A list containing test statistics, degrees of freedom for the % reference chi-squared distribution, the p-value, and the covariance matrix % of vec(L$$\beta$R). At the same time, a table is printed out. % % * TestOutput.chisqStatistic: The test statistics. A real number. % * TestOutput.df: The degrees of freedom of the reference chi-squared % distribution. A positive integer. % * TestOutput.pValue: p-value of the test. A real number in [0, 1]. % * TestOutput.covMatrix: The covariance matrix of vec(L$$\beta$R). A d1 * % d2 by d1 * d2 matrix. %% Description % This function tests for hypothesis $$H_0: L\beta R = A$, versus $$H_\alpha: % L\beta R\neq A$. The $$\beta$ is estimated by the scaled envelope model. If % the user does not specify the values for L, R and A, then the test is % equivalent to the standard F test on if $$\beta = 0$. The test statistics % used is vec $$(L\beta R - A)$ $$\hat{\Sigma}^{-1}$ vec $$(L\beta R - A)^{T}$, % and the reference distribution is chi-squared distribution with degrees of % freedom d1 * d2. %% Example % load('sales.txt') % Y = sales(:,4:7); % X = sales(:,1:3); % u = bic_senv(X,Y) % ModelOutput = senv(X,Y,u); % TestOutout = testcoefficient_senv(ModelOutput); % r = size(Y, 2); % p = size(X, 2); % TestInput.L = rand(2, r); % TestInput.R = rand(p, 1); % TestInput.A = zeros(2, 1); % TestOutout = testcoefficient_senv(ModelOutput, TestInput); function TestOutput = testcoefficient_senv(ModelOutput, TestInput) if nargin < 1 error('Inputs: ModelOutput should be specified!'); elseif nargin == 1 u = size(ModelOutput.Gamma, 2); if u == 0 error('beta is a zero matrix, no test is interesting.'); end [r p] = size(ModelOutput.beta); TestInput.L = eye(r); TestInput.R = eye(p); TestInput.A = zeros(r, p); Ls1 = r; Rs2 = p; elseif nargin == 2 u = size(ModelOutput.Gamma, 2); if u == 0 error('beta is a zero matrix, no test is interesting.'); end [r p] = size(ModelOutput.beta); if isfield(TestInput, 'L') [Ls1 Ls2] = size(TestInput.L); if Ls1 > r || Ls2 ~= r error('The size of L is not supported.') end else TestInput.L = eye(r); Ls1 = r; end if isfield(TestInput, 'R') [Rs1 Rs2] = size(TestInput.R); if Rs1 ~= p || Rs2 > p error('The size of R is not supported.') end else TestInput.R = eye(p); Rs2 = p; end if isfield(TestInput, 'A') [As1 As2] = size(TestInput.A); if As1 ~= Ls1 || As2 ~= Rs2 error('The size of A should be the same as L * beta * R.') end else TestInput.A = zeros(Ls1, Rs2); end end L = TestInput.L; R = TestInput.R; A = TestInput.A; beta = ModelOutput.beta; covMatrix = ModelOutput.covMatrix; n = ModelOutput.n; Sigma = kron(R', L) * covMatrix * kron(R, L') / n; temp = reshape(L * beta * R - A, 1, Ls1 * Rs2); chisqStatistic = temp * inv(Sigma) * temp'; df = Ls1 * Rs2; pValue = 1 - chi2cdf(chisqStatistic, df); TestOutput.chisqStatistic = chisqStatistic; TestOutput.df = df; TestOutput.pValue = pValue; TestOutput.covMatrix = Sigma; fprintf('\n Test Hypothesis Chisq Statistic DF P-value\n') ; fprintf('-------------------------------------------------------\n') ; fprintf('%s %15.3f %6d %10.4f\n', 'L * beta * R = A', chisqStatistic, df, pValue); fprintf('-------------------------------------------------------\n') ;
{ "content_hash": "29182eabdfdb36b4a7b07f1f5452692c", "timestamp": "", "source": "github", "line_count": 148, "max_line_length": 85, "avg_line_length": 32.07432432432432, "alnum_prop": 0.6014324836738993, "repo_name": "shubhobm/8932-envelope", "id": "153025db69cfd40dee1588a872db68222427f586", "size": "4747", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "envlp/src/senv/testcoefficient_senv.m", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "C", "bytes": "73175" }, { "name": "C++", "bytes": "874" }, { "name": "M", "bytes": "77198" }, { "name": "Matlab", "bytes": "945707" }, { "name": "Mercury", "bytes": "4171" }, { "name": "R", "bytes": "8367" }, { "name": "Shell", "bytes": "802" }, { "name": "TeX", "bytes": "519399" } ], "symlink_target": "" }
<?php App::uses('AppController', 'Controller'); /** * Class MediaController * * @property Media $Media */ class MediaController extends AppController { /** * Array containing the names of components this controller uses. Component names * should not contain the "Component" portion of the class name. * * Example: `public $components = array('Session', 'RequestHandler', 'Acl');` * * @var array */ public $components = ['Paginator']; /** * Paginate settings * * @var array */ public $paginate = [ 'Media' => [ 'limit' => 25, 'order' => [ 'Media.created' => 'desc' ] ] ]; /** * Called before the controller action. You can use this method to configure and customize components * or perform logic that needs to happen before each controller action. * * @return void */ public function beforeFilter() { parent::beforeFilter(); if ($this->request->params['action'] == 'admin_add') { $this->Security->csrfCheck = false; } } /** * List of media */ public function admin_index() { $this->set('title_for_layout', __d('hurad', 'Media Library')); $this->Media->recursive = 0; $this->Paginator->settings = $this->paginate; $this->set('media', $this->Paginator->paginate('Media')); } /** * Add media file */ public function admin_add() { $this->set('title_for_layout', __d('hurad', 'Add Media')); if ($this->request->is('post')) { try { if ($this->Media->addMedia($this->request->data)) { $this->Session->setFlash( __d('hurad', 'File successfully uploaded.'), 'flash_message', ['class' => 'success'] ); } else { $this->Session->setFlash( __d('hurad', 'File could not be uploaded. Please, try again.'), 'flash_message', ['class' => 'danger'] ); } $this->redirect(['action' => 'index']); } catch (CakeBaseException $e) { $this->Session->setFlash($e->getMessage(), 'flash_message', ['class' => 'danger']); $this->redirect(['action' => 'index']); } } } /** * Edit media file * * @param int $mediaId Media id */ public function admin_edit($mediaId) { $this->set('title_for_layout', __d('hurad', 'Edit media')); if ($this->request->is('post') || $this->request->is('put')) { if ($this->Media->editMedia($mediaId, $this->request->data)) { $this->Session->setFlash( __d('hurad', 'The media has been saved'), 'flash_message', array('class' => 'success') ); $this->redirect(array('action' => 'index')); } else { $this->Session->setFlash( __d('hurad', 'The media could not be saved. Please, try again.'), 'flash_message', array('class' => 'danger') ); } } else { $this->request->data = $this->Media->read(null, $mediaId); } } /** * Delete media file * * @param int $id Media id * * @throws NotFoundException * @throws MethodNotAllowedException */ public function admin_delete($id) { if (!$this->request->is('post')) { throw new MethodNotAllowedException(); } if ($this->Media->deleteMedia($id)) { $this->Session->setFlash(__d('hurad', 'Media file deleted'), 'flash_message', ['class' => 'success']); $this->redirect($this->request->referer()); } else { $this->Session->setFlash( __d('hurad', 'Media file was not deleted'), 'flash_message', ['class' => 'danger'] ); $this->redirect($this->request->referer()); } } /** * Download media * * @param int $mediaId Media id * * @return CakeResponse */ public function admin_download($mediaId) { $file = $this->Media->getMedia($mediaId); $this->response->file( WWW_ROOT . 'files' . DS . $file['Media']['path'] . DS . $file['Media']['name'], ['download' => true, 'name' => $file['Media']['original_name']] ); return $this->response; } /** * Browse media file * * @param string $type Browse type: image, movie, ... * * @throws MethodNotAllowedException */ public function admin_browse($type) { $this->layout = 'browse'; $this->set('title_for_layout', __d('hurad', 'Media Library')); if ($type == 'images') { $this->Paginator->settings = Hash::merge( $this->paginate, [ 'Media' => [ 'conditions' => [ 'Media.mime_type' => ['image/jpeg', 'image/png', 'image/gif'], ] ] ] ); } else { throw new MethodNotAllowedException(); } $this->Media->recursive = 0; $this->set('media', $this->Paginator->paginate('Media')); } }
{ "content_hash": "0b2e0a220396f71ae9b0dd4d28f3b474", "timestamp": "", "source": "github", "line_count": 199, "max_line_length": 114, "avg_line_length": 28.487437185929647, "alnum_prop": 0.45986946551420005, "repo_name": "hurad/hurad", "id": "51199ae9b225f13ef328a499e0582167b9ae0b2c", "size": "6084", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Controller/MediaController.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "49123" }, { "name": "JavaScript", "bytes": "46163" }, { "name": "PHP", "bytes": "847812" }, { "name": "Shell", "bytes": "1997" } ], "symlink_target": "" }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.13"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <title>KlusterKite: Member List</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtreedata.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); </script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/searchdata.js"></script> <script type="text/javascript" src="search/search.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td id="projectalign" style="padding-left: 0.5em;"> <div id="projectname">KlusterKite &#160;<span id="projectnumber">0.0.0</span> </div> <div id="projectbrief">A framework to create scalable and redundant services based on awesome Akka.Net project.</div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.13 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <script type="text/javascript" src="menudata.js"></script> <script type="text/javascript" src="menu.js"></script> <script type="text/javascript"> $(function() { initMenu('',true,false,'search.php','Search'); $(document).ready(function() { init_search(); }); }); </script> <div id="main-nav"></div> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> $(document).ready(function(){initNavTree('class_kluster_kite_1_1_web_1_1_nginx_configurator_1_1_node_service_configuration.html','');}); </script> <div id="doc-content"> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> </div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div class="header"> <div class="headertitle"> <div class="title">KlusterKite.Web.NginxConfigurator.NodeServiceConfiguration Member List</div> </div> </div><!--header--> <div class="contents"> <p>This is the complete list of members for <a class="el" href="class_kluster_kite_1_1_web_1_1_nginx_configurator_1_1_node_service_configuration.html">KlusterKite.Web.NginxConfigurator.NodeServiceConfiguration</a>, including all inherited members.</p> <table class="directory"> <tr class="even"><td class="entry"><a class="el" href="class_kluster_kite_1_1_web_1_1_nginx_configurator_1_1_node_service_configuration.html#a023e3081ffd286559170430bb9b2f392">Equals</a>(object obj)</td><td class="entry"><a class="el" href="class_kluster_kite_1_1_web_1_1_nginx_configurator_1_1_node_service_configuration.html">KlusterKite.Web.NginxConfigurator.NodeServiceConfiguration</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="class_kluster_kite_1_1_web_1_1_nginx_configurator_1_1_node_service_configuration.html#adc36e205a67b549f9c5e036ef5c67db0">GetHashCode</a>()</td><td class="entry"><a class="el" href="class_kluster_kite_1_1_web_1_1_nginx_configurator_1_1_node_service_configuration.html">KlusterKite.Web.NginxConfigurator.NodeServiceConfiguration</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="class_kluster_kite_1_1_web_1_1_nginx_configurator_1_1_node_service_configuration.html#ac941a8189f42b91359ed0456e9106b32">NodeAddress</a></td><td class="entry"><a class="el" href="class_kluster_kite_1_1_web_1_1_nginx_configurator_1_1_node_service_configuration.html">KlusterKite.Web.NginxConfigurator.NodeServiceConfiguration</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="class_kluster_kite_1_1_web_1_1_nginx_configurator_1_1_node_service_configuration.html#a2e26ffc15a95054d75c4c33934243ffa">NodeUrl</a></td><td class="entry"><a class="el" href="class_kluster_kite_1_1_web_1_1_nginx_configurator_1_1_node_service_configuration.html">KlusterKite.Web.NginxConfigurator.NodeServiceConfiguration</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="class_kluster_kite_1_1_web_1_1_nginx_configurator_1_1_node_service_configuration.html#aba7e1f260c47f3db3dbbcb1fc427d00c">operator!=</a>(NodeServiceConfiguration left, NodeServiceConfiguration right)</td><td class="entry"><a class="el" href="class_kluster_kite_1_1_web_1_1_nginx_configurator_1_1_node_service_configuration.html">KlusterKite.Web.NginxConfigurator.NodeServiceConfiguration</a></td><td class="entry"><span class="mlabel">static</span></td></tr> <tr><td class="entry"><a class="el" href="class_kluster_kite_1_1_web_1_1_nginx_configurator_1_1_node_service_configuration.html#a35ff76191d0e579f9c93d8927bae2805">operator==</a>(NodeServiceConfiguration left, NodeServiceConfiguration right)</td><td class="entry"><a class="el" href="class_kluster_kite_1_1_web_1_1_nginx_configurator_1_1_node_service_configuration.html">KlusterKite.Web.NginxConfigurator.NodeServiceConfiguration</a></td><td class="entry"><span class="mlabel">static</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="class_kluster_kite_1_1_web_1_1_nginx_configurator_1_1_node_service_configuration.html#a4b4e4170b4d65fd1899987bccf5b6e6a">ServiceDescription</a></td><td class="entry"><a class="el" href="class_kluster_kite_1_1_web_1_1_nginx_configurator_1_1_node_service_configuration.html">KlusterKite.Web.NginxConfigurator.NodeServiceConfiguration</a></td><td class="entry"></td></tr> </table></div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="footer">Generated by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li> </ul> </div> </body> </html>
{ "content_hash": "934ac47ddb68317b7c533baad7bca404", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 514, "avg_line_length": 65, "alnum_prop": 0.7218066337332393, "repo_name": "KlusterKite/KlusterKite", "id": "2ede0c37a6467a8fde065d9ae3c088842d7e0af2", "size": "7085", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Docs/Doxygen/html/class_kluster_kite_1_1_web_1_1_nginx_configurator_1_1_node_service_configuration-members.html", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "1314" }, { "name": "C#", "bytes": "2352078" }, { "name": "CSS", "bytes": "6435" }, { "name": "F#", "bytes": "30981" }, { "name": "HTML", "bytes": "3955" }, { "name": "JavaScript", "bytes": "530537" }, { "name": "PHP", "bytes": "6921" }, { "name": "Shell", "bytes": "912" } ], "symlink_target": "" }
namespace google { namespace cloud { namespace osconfig_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN std::shared_ptr<OsConfigServiceStub> CreateDefaultOsConfigServiceStub( google::cloud::CompletionQueue cq, Options const& options) { auto auth = google::cloud::internal::CreateAuthenticationStrategy( std::move(cq), options); auto channel = auth->CreateChannel(options.get<EndpointOption>(), internal::MakeChannelArguments(options)); auto service_grpc_stub = google::cloud::osconfig::v1::OsConfigService::NewStub(channel); std::shared_ptr<OsConfigServiceStub> stub = std::make_shared<DefaultOsConfigServiceStub>( std::move(service_grpc_stub)); if (auth->RequiresConfigureContext()) { stub = std::make_shared<OsConfigServiceAuth>(std::move(auth), std::move(stub)); } stub = std::make_shared<OsConfigServiceMetadata>(std::move(stub)); if (internal::Contains(options.get<TracingComponentsOption>(), "rpc")) { GCP_LOG(INFO) << "Enabled logging for gRPC calls"; stub = std::make_shared<OsConfigServiceLogging>( std::move(stub), options.get<GrpcTracingOptionsOption>(), options.get<TracingComponentsOption>()); } return stub; } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace osconfig_internal } // namespace cloud } // namespace google
{ "content_hash": "f39371f88939c0ffb1b676387dc7682b", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 80, "avg_line_length": 39.2, "alnum_prop": 0.7018950437317785, "repo_name": "googleapis/google-cloud-cpp", "id": "0bb476baafa7f889a6e7fc966bea8215a2ec7295", "size": "2726", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "google/cloud/osconfig/internal/os_config_stub_factory.cc", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Awk", "bytes": "2387" }, { "name": "Batchfile", "bytes": "3052" }, { "name": "C", "bytes": "21004" }, { "name": "C++", "bytes": "41174129" }, { "name": "CMake", "bytes": "1350320" }, { "name": "Dockerfile", "bytes": "111570" }, { "name": "Makefile", "bytes": "138270" }, { "name": "PowerShell", "bytes": "41266" }, { "name": "Python", "bytes": "21338" }, { "name": "Shell", "bytes": "249894" }, { "name": "Starlark", "bytes": "722015" } ], "symlink_target": "" }
<!DOCTYPE html> <meta charset="utf-8"> <title>CSS Text Test: text-align-last - auto and text-align - end</title> <link rel="author" title="Intel" href="http://www.intel.com"> <link rel="author" title="Shiyou Tan" href="mailto:shiyoux.tan@intel.com"> <link rel="help" title="7.2. Last Line Alignment: the 'text-align-last' property" href="http://www.w3.org/TR/css-text-3/#text-align-last"> <meta name="flags" content=""> <meta name="assert" content="The 'text-align-last' property set to 'auto' on a block element aligns the last line text to the right when text-align set 'end'."> <style> div { border: 1px solid blue; text-align: end; text-align-last: auto; width: 200px; } </style> <body> <p>Test passes if the last line of "FillerText" below is aligned to the right, inside the blue box.</p> <div>FillerText FillerText FillerText FillerText FillerText</div> </body>
{ "content_hash": "a1d8754ce16c287daf02d91f09fcd375", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 138, "avg_line_length": 42.523809523809526, "alnum_prop": 0.6987681970884658, "repo_name": "ric2b/Vivaldi-browser", "id": "6288d5a6cca08b720de1282ea0848c2e9750df40", "size": "893", "binary": false, "copies": "74", "ref": "refs/heads/master", "path": "chromium/third_party/blink/web_tests/external/wpt/css/css-text/text-align/text-align-last-008.html", "mode": "33188", "license": "bsd-3-clause", "language": [], "symlink_target": "" }
package io.nodyn.buffer; import java.nio.charset.Charset; /** * @author Bob McWhirter */ public class Internal { private static final Charset UTF8 = Charset.forName( "utf8" ); public static int byteLength(String str, String encoding) { if ( encoding == null ) { encoding = "utf8"; } encoding = encoding.toLowerCase(); if ( encoding.equals( "utf8" ) ) { return str.getBytes(UTF8).length; } return str.getBytes().length; } }
{ "content_hash": "68b6e2ca7b353f931dc14e6af2b3f7eb", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 66, "avg_line_length": 20.64, "alnum_prop": 0.5852713178294574, "repo_name": "tony--/nodyn", "id": "8d714e8708004731e4c13594b4061b2b297bac4b", "size": "1113", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "src/main/java/io/nodyn/buffer/Internal.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "6537" }, { "name": "Java", "bytes": "350047" }, { "name": "JavaScript", "bytes": "378465" }, { "name": "Shell", "bytes": "817" } ], "symlink_target": "" }
<?php namespace Congredi\NotificationSystem\Exceptions; class GenericException extends \Exception { }
{ "content_hash": "7e08035c0618a142c83d7ad3deb242e9", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 55, "avg_line_length": 17.166666666666668, "alnum_prop": 0.8252427184466019, "repo_name": "andreikun/congredi-notification-system", "id": "b192f14b5c2fc4cc1c4b72d6463e35a4ca79af00", "size": "103", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Exceptions/GenericException.php", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "39815" } ], "symlink_target": "" }
var currentTime, fromTime, main, stage, cache; window.lwfkit = {}; window.lwfkit.handlers = {}; window.lwfkit.calcTick = function() { currentTime = Date.now() / 1000.0; var tick = currentTime - fromTime; fromTime = currentTime; return tick; }; main = function() { if (window.lwfkit.lwf != null) { var tick = window.lwfkit.calcTick(); window.lwfkit.lwf.exec(tick); window.lwfkit.lwf.render(); } window.requestAnimationFrame.call(window, main); }; main(); LWF.useCanvasRenderer(); stage = document.getElementById('canvas'); stage.width = window.innerWidth; stage.height = window.innerHeight; cache = LWF.ResourceCache.get(); cache.loadLWF({ lwf: '%@', prefix: '../%@/', stage: stage, onload: function(lwf) { window.lwfkit.lwf = lwf; lwf.scaleForWidth(window.innerWidth); new Ejecta.LKBridge().loadComplete(); } });
{ "content_hash": "796c9519cc43b97fa59d63cc3b58f925", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 50, "avg_line_length": 22.333333333333332, "alnum_prop": 0.6670493685419059, "repo_name": "yonekawa/lwfkit.objc", "id": "be3cfae33fbc1bf7c553c297e75e586a7885df9c", "size": "871", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "LWFKit/Scripts/main.js", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "120935" }, { "name": "C++", "bytes": "22778" }, { "name": "JavaScript", "bytes": "10758" }, { "name": "Objective-C", "bytes": "325724" }, { "name": "Ruby", "bytes": "1638" } ], "symlink_target": "" }
title: ajd14 type: products image: /img/Screen Shot 2017-05-09 at 11.56.54 AM.png heading: d14 description: lksadjf lkasdjf lksajdf lksdaj flksadj flksa fdj main: heading: Foo Bar BAz description: |- ***This is i a thing***kjh hjk kj # Blah Blah ## Blah![undefined](undefined) ### Baah image1: alt: kkkk ---
{ "content_hash": "2d3cbc5af49c38cb701143be73de23b4", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 61, "avg_line_length": 22.333333333333332, "alnum_prop": 0.6656716417910448, "repo_name": "pblack/kaldi-hugo-cms-template", "id": "60e8dff3c6163b0541bfb5accda5f9baaf83e214", "size": "339", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "site/content/pages2/ajd14.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "94394" }, { "name": "HTML", "bytes": "18889" }, { "name": "JavaScript", "bytes": "10014" } ], "symlink_target": "" }
std::string challenge2::fixed_xor(const std::string &input_hex, const std::string &key_hex) { auto data_binary = Botan::hex_decode(input_hex); auto key_binary = Botan::hex_decode(key_hex); std::transform(data_binary.begin(), data_binary.end(), key_binary.begin(), data_binary.begin(), [](auto e1, auto e2) { return e1 ^ e2; }); return Botan::hex_encode(data_binary, false); }
{ "content_hash": "46b4d7c70209ba0704d67bbc0b3a3c0b", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 80, "avg_line_length": 43.7, "alnum_prop": 0.6041189931350115, "repo_name": "LesnyRumcajs/matasano-cpp", "id": "3e33bf80a6704270ee9594ca0de7d37c3b7cc742", "size": "462", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "challenge2/challenge2.cpp", "mode": "33188", "license": "mit", "language": [ { "name": "C++", "bytes": "31953" }, { "name": "CMake", "bytes": "3600" }, { "name": "Shell", "bytes": "389" } ], "symlink_target": "" }
package org.apache.camel.cdi.sample.xml; import java.util.concurrent.TimeUnit; import javax.enterprise.event.Observes; import javax.inject.Inject; import javax.inject.Named; import org.apache.camel.CamelContext; import org.apache.camel.Endpoint; import org.apache.camel.ProducerTemplate; import org.apache.camel.ServiceStatus; import org.apache.camel.builder.AdviceWithRouteBuilder; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.cdi.CdiCamelExtension; import org.apache.camel.cdi.Uri; import org.apache.camel.component.mock.MockEndpoint; import org.apache.camel.management.event.CamelContextStartingEvent; import org.apache.camel.model.ModelCamelContext; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.arquillian.junit.InSequence; import org.jboss.shrinkwrap.api.Archive; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.junit.Test; import org.junit.runner.RunWith; import static org.apache.camel.component.mock.MockEndpoint.assertIsSatisfied; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertThat; @RunWith(Arquillian.class) public class XmlSampleTest { @Deployment public static Archive<?> deployment() { return ShrinkWrap.create(JavaArchive.class) // Camel CDI .addPackage(CdiCamelExtension.class.getPackage()) // Test classes .addPackage(XmlSampleTest.class.getPackage()) // Bean archive deployment descriptor .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); } void pipeMatrixStream(@Observes CamelContextStartingEvent event, ModelCamelContext context) throws Exception { context.getRouteDefinition("matrix") .adviceWith(context, new AdviceWithRouteBuilder() { @Override public void configure() { weaveAddLast().to("mock:matrix"); } }); } @Named @Inject private Endpoint neo; @Inject private ProducerTemplate prompt; static class RescueMission extends RouteBuilder { @Override public void configure() { from("seda:rescue?multipleConsumers=true").routeId("rescue mission").to("mock:zion"); } } @Test @InSequence(1) public void takeTheBluePill(@Uri("mock:matrix") MockEndpoint matrix) throws InterruptedException { matrix.expectedMessageCount(1); matrix.expectedBodiesReceived("Matrix » Take the blue pill!"); prompt.sendBody(neo, "Take the blue pill!"); assertIsSatisfied(2L, TimeUnit.SECONDS, matrix); } @Test @InSequence(2) public void takeTheRedPill(@Uri("mock:zion") MockEndpoint zion) throws InterruptedException { zion.expectedMessageCount(1); zion.expectedHeaderReceived("location", "matrix"); prompt.sendBody(neo, "Take the red pill!"); assertIsSatisfied(2L, TimeUnit.SECONDS, zion); } @Test @InSequence(3) public void verifyRescue(CamelContext context) { assertThat("Neo is still in the matrix!", context.getRouteStatus("terminal"), is(equalTo(ServiceStatus.Stopped))); } }
{ "content_hash": "1e2f8019b60c58d267e1623594d399cb", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 102, "avg_line_length": 33.13592233009709, "alnum_prop": 0.7070026369762672, "repo_name": "astefanutti/camel-cdi", "id": "55e2ea57e97489edda161158bbbb837115deacf1", "size": "4217", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "samples/xml/src/test/java/org/apache/camel/cdi/sample/xml/XmlSampleTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "698295" } ], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_45) on Fri Mar 06 22:11:32 CST 2015 --> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <TITLE> RpcHeaderProtos.RpcSaslProto.SaslAuthOrBuilder (Apache Hadoop Common 2.3.0 API) </TITLE> <META NAME="date" CONTENT="2015-03-06"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="RpcHeaderProtos.RpcSaslProto.SaslAuthOrBuilder (Apache Hadoop Common 2.3.0 API)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/RpcHeaderProtos.RpcSaslProto.SaslAuthOrBuilder.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../../../../org/apache/hadoop/ipc/protobuf/RpcHeaderProtos.RpcSaslProto.SaslAuth.Builder.html" title="class in org.apache.hadoop.ipc.protobuf"><B>PREV CLASS</B></A>&nbsp; &nbsp;<A HREF="../../../../../org/apache/hadoop/ipc/protobuf/RpcHeaderProtos.RpcSaslProto.SaslState.html" title="enum in org.apache.hadoop.ipc.protobuf"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?org/apache/hadoop/ipc/protobuf/RpcHeaderProtos.RpcSaslProto.SaslAuthOrBuilder.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="RpcHeaderProtos.RpcSaslProto.SaslAuthOrBuilder.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> org.apache.hadoop.ipc.protobuf</FONT> <BR> Interface RpcHeaderProtos.RpcSaslProto.SaslAuthOrBuilder</H2> <DL> <DT><B>All Superinterfaces:</B> <DD>com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder</DD> </DL> <DL> <DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../../../../org/apache/hadoop/ipc/protobuf/RpcHeaderProtos.RpcSaslProto.SaslAuth.html" title="class in org.apache.hadoop.ipc.protobuf">RpcHeaderProtos.RpcSaslProto.SaslAuth</A>, <A HREF="../../../../../org/apache/hadoop/ipc/protobuf/RpcHeaderProtos.RpcSaslProto.SaslAuth.Builder.html" title="class in org.apache.hadoop.ipc.protobuf">RpcHeaderProtos.RpcSaslProto.SaslAuth.Builder</A></DD> </DL> <DL> <DT><B>Enclosing class:</B><DD><A HREF="../../../../../org/apache/hadoop/ipc/protobuf/RpcHeaderProtos.RpcSaslProto.html" title="class in org.apache.hadoop.ipc.protobuf">RpcHeaderProtos.RpcSaslProto</A></DD> </DL> <HR> <DL> <DT><PRE>public static interface <A HREF="../../../../../src-html/org/apache/hadoop/ipc/protobuf/RpcHeaderProtos.RpcSaslProto.html#line.3387"><B>RpcHeaderProtos.RpcSaslProto.SaslAuthOrBuilder</B></A><DT>extends com.google.protobuf.MessageOrBuilder</DL> </PRE> <P> <HR> <P> <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Method Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;com.google.protobuf.ByteString</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/hadoop/ipc/protobuf/RpcHeaderProtos.RpcSaslProto.SaslAuthOrBuilder.html#getChallenge()">getChallenge</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<code>optional bytes challenge = 5;</code></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/hadoop/ipc/protobuf/RpcHeaderProtos.RpcSaslProto.SaslAuthOrBuilder.html#getMechanism()">getMechanism</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<code>required string mechanism = 2;</code></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;com.google.protobuf.ByteString</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/hadoop/ipc/protobuf/RpcHeaderProtos.RpcSaslProto.SaslAuthOrBuilder.html#getMechanismBytes()">getMechanismBytes</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<code>required string mechanism = 2;</code></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/hadoop/ipc/protobuf/RpcHeaderProtos.RpcSaslProto.SaslAuthOrBuilder.html#getMethod()">getMethod</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<code>required string method = 1;</code></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;com.google.protobuf.ByteString</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/hadoop/ipc/protobuf/RpcHeaderProtos.RpcSaslProto.SaslAuthOrBuilder.html#getMethodBytes()">getMethodBytes</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<code>required string method = 1;</code></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/hadoop/ipc/protobuf/RpcHeaderProtos.RpcSaslProto.SaslAuthOrBuilder.html#getProtocol()">getProtocol</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<code>optional string protocol = 3;</code></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;com.google.protobuf.ByteString</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/hadoop/ipc/protobuf/RpcHeaderProtos.RpcSaslProto.SaslAuthOrBuilder.html#getProtocolBytes()">getProtocolBytes</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<code>optional string protocol = 3;</code></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/hadoop/ipc/protobuf/RpcHeaderProtos.RpcSaslProto.SaslAuthOrBuilder.html#getServerId()">getServerId</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<code>optional string serverId = 4;</code></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;com.google.protobuf.ByteString</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/hadoop/ipc/protobuf/RpcHeaderProtos.RpcSaslProto.SaslAuthOrBuilder.html#getServerIdBytes()">getServerIdBytes</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<code>optional string serverId = 4;</code></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/hadoop/ipc/protobuf/RpcHeaderProtos.RpcSaslProto.SaslAuthOrBuilder.html#hasChallenge()">hasChallenge</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<code>optional bytes challenge = 5;</code></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/hadoop/ipc/protobuf/RpcHeaderProtos.RpcSaslProto.SaslAuthOrBuilder.html#hasMechanism()">hasMechanism</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<code>required string mechanism = 2;</code></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/hadoop/ipc/protobuf/RpcHeaderProtos.RpcSaslProto.SaslAuthOrBuilder.html#hasMethod()">hasMethod</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<code>required string method = 1;</code></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/hadoop/ipc/protobuf/RpcHeaderProtos.RpcSaslProto.SaslAuthOrBuilder.html#hasProtocol()">hasProtocol</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<code>optional string protocol = 3;</code></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/hadoop/ipc/protobuf/RpcHeaderProtos.RpcSaslProto.SaslAuthOrBuilder.html#hasServerId()">hasServerId</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<code>optional string serverId = 4;</code></TD> </TR> </TABLE> &nbsp;<A NAME="methods_inherited_from_class_com.google.protobuf.MessageOrBuilder"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from interface com.google.protobuf.MessageOrBuilder</B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE>findInitializationErrors, getAllFields, getDefaultInstanceForType, getDescriptorForType, getField, getInitializationErrorString, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField</CODE></TD> </TR> </TABLE> &nbsp;<A NAME="methods_inherited_from_class_com.google.protobuf.MessageLiteOrBuilder"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from interface com.google.protobuf.MessageLiteOrBuilder</B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE>isInitialized</CODE></TD> </TR> </TABLE> &nbsp; <P> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Method Detail</B></FONT></TH> </TR> </TABLE> <A NAME="hasMethod()"><!-- --></A><H3> hasMethod</H3> <PRE> boolean <A HREF="../../../../../src-html/org/apache/hadoop/ipc/protobuf/RpcHeaderProtos.RpcSaslProto.SaslAuthOrBuilder.html#line.3394"><B>hasMethod</B></A>()</PRE> <DL> <DD><code>required string method = 1;</code> <P> <DD><DL> </DL> </DD> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="getMethod()"><!-- --></A><H3> getMethod</H3> <PRE> <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <A HREF="../../../../../src-html/org/apache/hadoop/ipc/protobuf/RpcHeaderProtos.RpcSaslProto.SaslAuthOrBuilder.html#line.3398"><B>getMethod</B></A>()</PRE> <DL> <DD><code>required string method = 1;</code> <P> <DD><DL> </DL> </DD> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="getMethodBytes()"><!-- --></A><H3> getMethodBytes</H3> <PRE> com.google.protobuf.ByteString <A HREF="../../../../../src-html/org/apache/hadoop/ipc/protobuf/RpcHeaderProtos.RpcSaslProto.SaslAuthOrBuilder.html#line.3403"><B>getMethodBytes</B></A>()</PRE> <DL> <DD><code>required string method = 1;</code> <P> <DD><DL> </DL> </DD> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="hasMechanism()"><!-- --></A><H3> hasMechanism</H3> <PRE> boolean <A HREF="../../../../../src-html/org/apache/hadoop/ipc/protobuf/RpcHeaderProtos.RpcSaslProto.SaslAuthOrBuilder.html#line.3409"><B>hasMechanism</B></A>()</PRE> <DL> <DD><code>required string mechanism = 2;</code> <P> <DD><DL> </DL> </DD> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="getMechanism()"><!-- --></A><H3> getMechanism</H3> <PRE> <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <A HREF="../../../../../src-html/org/apache/hadoop/ipc/protobuf/RpcHeaderProtos.RpcSaslProto.SaslAuthOrBuilder.html#line.3413"><B>getMechanism</B></A>()</PRE> <DL> <DD><code>required string mechanism = 2;</code> <P> <DD><DL> </DL> </DD> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="getMechanismBytes()"><!-- --></A><H3> getMechanismBytes</H3> <PRE> com.google.protobuf.ByteString <A HREF="../../../../../src-html/org/apache/hadoop/ipc/protobuf/RpcHeaderProtos.RpcSaslProto.SaslAuthOrBuilder.html#line.3418"><B>getMechanismBytes</B></A>()</PRE> <DL> <DD><code>required string mechanism = 2;</code> <P> <DD><DL> </DL> </DD> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="hasProtocol()"><!-- --></A><H3> hasProtocol</H3> <PRE> boolean <A HREF="../../../../../src-html/org/apache/hadoop/ipc/protobuf/RpcHeaderProtos.RpcSaslProto.SaslAuthOrBuilder.html#line.3424"><B>hasProtocol</B></A>()</PRE> <DL> <DD><code>optional string protocol = 3;</code> <P> <DD><DL> </DL> </DD> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="getProtocol()"><!-- --></A><H3> getProtocol</H3> <PRE> <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <A HREF="../../../../../src-html/org/apache/hadoop/ipc/protobuf/RpcHeaderProtos.RpcSaslProto.SaslAuthOrBuilder.html#line.3428"><B>getProtocol</B></A>()</PRE> <DL> <DD><code>optional string protocol = 3;</code> <P> <DD><DL> </DL> </DD> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="getProtocolBytes()"><!-- --></A><H3> getProtocolBytes</H3> <PRE> com.google.protobuf.ByteString <A HREF="../../../../../src-html/org/apache/hadoop/ipc/protobuf/RpcHeaderProtos.RpcSaslProto.SaslAuthOrBuilder.html#line.3433"><B>getProtocolBytes</B></A>()</PRE> <DL> <DD><code>optional string protocol = 3;</code> <P> <DD><DL> </DL> </DD> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="hasServerId()"><!-- --></A><H3> hasServerId</H3> <PRE> boolean <A HREF="../../../../../src-html/org/apache/hadoop/ipc/protobuf/RpcHeaderProtos.RpcSaslProto.SaslAuthOrBuilder.html#line.3439"><B>hasServerId</B></A>()</PRE> <DL> <DD><code>optional string serverId = 4;</code> <P> <DD><DL> </DL> </DD> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="getServerId()"><!-- --></A><H3> getServerId</H3> <PRE> <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <A HREF="../../../../../src-html/org/apache/hadoop/ipc/protobuf/RpcHeaderProtos.RpcSaslProto.SaslAuthOrBuilder.html#line.3443"><B>getServerId</B></A>()</PRE> <DL> <DD><code>optional string serverId = 4;</code> <P> <DD><DL> </DL> </DD> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="getServerIdBytes()"><!-- --></A><H3> getServerIdBytes</H3> <PRE> com.google.protobuf.ByteString <A HREF="../../../../../src-html/org/apache/hadoop/ipc/protobuf/RpcHeaderProtos.RpcSaslProto.SaslAuthOrBuilder.html#line.3448"><B>getServerIdBytes</B></A>()</PRE> <DL> <DD><code>optional string serverId = 4;</code> <P> <DD><DL> </DL> </DD> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="hasChallenge()"><!-- --></A><H3> hasChallenge</H3> <PRE> boolean <A HREF="../../../../../src-html/org/apache/hadoop/ipc/protobuf/RpcHeaderProtos.RpcSaslProto.SaslAuthOrBuilder.html#line.3454"><B>hasChallenge</B></A>()</PRE> <DL> <DD><code>optional bytes challenge = 5;</code> <P> <DD><DL> </DL> </DD> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="getChallenge()"><!-- --></A><H3> getChallenge</H3> <PRE> com.google.protobuf.ByteString <A HREF="../../../../../src-html/org/apache/hadoop/ipc/protobuf/RpcHeaderProtos.RpcSaslProto.SaslAuthOrBuilder.html#line.3458"><B>getChallenge</B></A>()</PRE> <DL> <DD><code>optional bytes challenge = 5;</code> <P> <DD><DL> </DL> </DD> <DD><DL> </DL> </DD> </DL> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/RpcHeaderProtos.RpcSaslProto.SaslAuthOrBuilder.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../../../../org/apache/hadoop/ipc/protobuf/RpcHeaderProtos.RpcSaslProto.SaslAuth.Builder.html" title="class in org.apache.hadoop.ipc.protobuf"><B>PREV CLASS</B></A>&nbsp; &nbsp;<A HREF="../../../../../org/apache/hadoop/ipc/protobuf/RpcHeaderProtos.RpcSaslProto.SaslState.html" title="enum in org.apache.hadoop.ipc.protobuf"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?org/apache/hadoop/ipc/protobuf/RpcHeaderProtos.RpcSaslProto.SaslAuthOrBuilder.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="RpcHeaderProtos.RpcSaslProto.SaslAuthOrBuilder.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> Copyright &#169; 2015 <a href="http://www.apache.org">Apache Software Foundation</a>. All Rights Reserved. </BODY> </HTML>
{ "content_hash": "fc83a06bc1d31f63eb8e4afb865e961e", "timestamp": "", "source": "github", "line_count": 551, "max_line_length": 446, "avg_line_length": 40.7513611615245, "alnum_prop": 0.6583682194709183, "repo_name": "jsrudani/HadoopHDFSProject", "id": "0fb7548c355325b2b92dcb536552e0ef741749ae", "size": "22454", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "hadoop-common-project/hadoop-common/target/org/apache/hadoop/ipc/protobuf/RpcHeaderProtos.RpcSaslProto.SaslAuthOrBuilder.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "AspectJ", "bytes": "31146" }, { "name": "C", "bytes": "1198902" }, { "name": "C++", "bytes": "164551" }, { "name": "CMake", "bytes": "131069" }, { "name": "CSS", "bytes": "131494" }, { "name": "Erlang", "bytes": "464" }, { "name": "HTML", "bytes": "485534855" }, { "name": "Java", "bytes": "37974886" }, { "name": "JavaScript", "bytes": "80446" }, { "name": "Makefile", "bytes": "104088" }, { "name": "Perl", "bytes": "18992" }, { "name": "Protocol Buffer", "bytes": "159216" }, { "name": "Python", "bytes": "11309" }, { "name": "Shell", "bytes": "724779" }, { "name": "TeX", "bytes": "19322" }, { "name": "XSLT", "bytes": "91404" } ], "symlink_target": "" }
@implementation JotHighlighterBrushTexture #pragma mark - PlistSaving - (NSDictionary*)asDictionary { return [NSDictionary dictionaryWithObject:NSStringFromClass([self class]) forKey:@"class"]; } - (id)initFromDictionary:(NSDictionary*)dictionary { NSString* className = [dictionary objectForKey:@"class"]; Class clz = NSClassFromString(className); return [[clz alloc] init]; } #pragma mark - Singleton - (UIImage*)texture { return [[self brushTexture] texture]; } - (NSString*)name { return [[self brushTexture] name]; } - (BOOL)bind { return [[self brushTexture] bind]; } - (void)unbind { JotGLContext* currContext = (JotGLContext*)[JotGLContext currentContext]; if (!currContext) { @throw [NSException exceptionWithName:@"NilGLContextException" reason:@"Cannot bind texture to nil gl context" userInfo:nil]; } if (![currContext isKindOfClass:[JotGLContext class]]) { @throw [NSException exceptionWithName:@"JotGLContextException" reason:@"Current GL Context must be JotGLContext" userInfo:nil]; } JotBrushTexture* texture = [currContext.contextProperties objectForKey:@"highlighterTexture"]; if (!texture) { @throw [NSException exceptionWithName:@"JotGLContextException" reason:@"Cannot unbind unbuilt brush texture" userInfo:nil]; } [texture unbind]; } #pragma mark - Singleton static JotHighlighterBrushTexture* _instance = nil; - (id)init { if (_instance) return _instance; if ((_instance = [super init])) { // noop } return _instance; } + (JotBrushTexture*)sharedInstance { if (!_instance) { _instance = [[JotHighlighterBrushTexture alloc] init]; } return _instance; } #pragma mark - Private - (JotSharedBrushTexture*)brushTexture { JotGLContext* currContext = (JotGLContext*)[JotGLContext currentContext]; if (!currContext) { @throw [NSException exceptionWithName:@"NilGLContextException" reason:@"Cannot bind texture to nil gl context" userInfo:nil]; } if (![currContext isKindOfClass:[JotGLContext class]]) { @throw [NSException exceptionWithName:@"JotGLContextException" reason:@"Current GL Context must be JotGLContext" userInfo:nil]; } JotSharedBrushTexture* texture = [currContext.contextProperties objectForKey:@"highlighterTexture"]; if (!texture) { NSBundle* bundle = [NSBundle bundleForClass:[JotView class]]; UIImage* highlighter = [UIImage imageWithContentsOfFile:[bundle pathForResource:@"highlighter" ofType:@"png"]]; texture = [[JotSharedBrushTexture alloc] initWithImage:highlighter]; [currContext.contextProperties setObject:texture forKey:@"highlighterTexture"]; } return texture; } @end
{ "content_hash": "c568bda7537dfb98c7115d5cf2bad4c4", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 135, "avg_line_length": 32.03488372093023, "alnum_prop": 0.7049001814882032, "repo_name": "adamwulf/JotUI", "id": "00905318c5500c23be01ae1aba475b4e087fa255", "size": "3013", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "JotUI/JotUI/JotHighlighterBrushTexture.m", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "9931" }, { "name": "GLSL", "bytes": "12120" }, { "name": "Objective-C", "bytes": "416554" }, { "name": "Shell", "bytes": "101" } ], "symlink_target": "" }
using System; using System.Collections.Generic; using System.Diagnostics.Contracts; using System.Linq; using System.Text; using System.Threading.Tasks; namespace BloggPostsByAuthor.AuthorData { [ContractClass(typeof(ContractForIAuthenticate))] public interface IAuthenticate { Task<AuthenticationData> Authenticate(BlogLoginSettings loginSettings); } [ContractClassFor(typeof(IAuthenticate))] public abstract class ContractForIAuthenticate : IAuthenticate { public Task<AuthenticationData> Authenticate(BlogLoginSettings loginSettings) { Contract.Requires<ArgumentNullException>(loginSettings != null); Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(loginSettings.Url)); Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(loginSettings.UserName)); Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(loginSettings.Password)); Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(loginSettings.ClientSecret)); return Task.FromResult(new AuthenticationData()); } } }
{ "content_hash": "d284663a75008d1140bd3976c218f5f3", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 104, "avg_line_length": 36.125, "alnum_prop": 0.7448096885813149, "repo_name": "novanet/BlogPostsByAuthor", "id": "77807732c1b36e60d72b59fc3a32f38f9d9f7778", "size": "1158", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "BlogPostsByAuthor/AuthorData/IAuthenticate.cs", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "112" }, { "name": "C#", "bytes": "23274" }, { "name": "CSS", "bytes": "315" }, { "name": "HTML", "bytes": "5125" }, { "name": "JavaScript", "bytes": "18932" } ], "symlink_target": "" }
module.exports = { title: "Static", description: "Static site resources.", tooltip: "Jump to static site resources.", providers: { StaticFiles: { test: "This is data fed to the static files provider" } } };
{ "content_hash": "a85b30dc6194326dadd5e10ddc24fff1", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 65, "avg_line_length": 25.5, "alnum_prop": 0.5764705882352941, "repo_name": "Encapsule/snapsite", "id": "c595982685616273ded5b8c8076f1da83cec802a", "size": "255", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/input/testsite/static/route-config.js", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "8490" }, { "name": "JavaScript", "bytes": "119222" } ], "symlink_target": "" }
using System.Runtime.Serialization; using System; namespace EspaceClient.FrontOffice.Domaine { public partial class ContactDto { [DataMember] public long ID { get; set; } [DataMember] public string Code { get; set; } [DataMember] public Nullable<int> Ordre { get; set; } [DataMember] public string Description { get; set; } [DataMember] public bool VisibleListeContact { get; set; } [DataMember] public long CategorieContactID { get; set; } [DataMember] public string LibelleSujetFrancais { get; set; } [DataMember] public string LibelleSujetAnglais { get; set; } [DataMember] public string LibelleComboFrancais { get; set; } [DataMember] public string LibelleComboAnglais { get; set; } [DataMember] public string SignatureMailFrancais { get; set; } [DataMember] public string SignatureMailAnglais { get; set; } [DataMember] public string ContenuMailDefautFrancais { get; set; } [DataMember] public string ContenuMailDefautAnglais { get; set; } } }
{ "content_hash": "d4bb2f875136b96b85e4ac0e59e034f4", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 61, "avg_line_length": 23.529411764705884, "alnum_prop": 0.6058333333333333, "repo_name": "apo-j/Projects_Working", "id": "ace13630d454e17f6c75dc4ee84cceb4c630c9bd", "size": "1678", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "EC/espace-client-dot-net/EspaceClient.FrontOffice.Domaine/Dtos/ContactDto.Generated.cs", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "16118" }, { "name": "Batchfile", "bytes": "1096" }, { "name": "C#", "bytes": "27262375" }, { "name": "CSS", "bytes": "8474090" }, { "name": "Groff", "bytes": "2101703" }, { "name": "HTML", "bytes": "4910101" }, { "name": "JavaScript", "bytes": "20716565" }, { "name": "PHP", "bytes": "9283" }, { "name": "XSLT", "bytes": "930531" } ], "symlink_target": "" }
ACCEPTED #### According to The Catalogue of Life, 3rd January 2011 #### Published in Fl. atacam. 24. 1860 #### Original name null ### Remarks null
{ "content_hash": "5e02c7ff79e416faf59592f2eb326a04", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 11.538461538461538, "alnum_prop": 0.6866666666666666, "repo_name": "mdoering/backbone", "id": "904d0d0c8329501c3d9f8060bbcd3cb1caf8fb4f", "size": "200", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Apiales/Apiaceae/Gymnophyton/Gymnophyton foliosum/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
namespace AE { struct UniformBufferData_Camera { FMat4 view_matrix; FMat4 projection_matrix; // Todo }; struct UniformBufferData_Mesh { FMat4 model_matrix; // Todo }; struct UniformBufferData_Pipeline { // Todo }; }
{ "content_hash": "4e6b5c0cd8ee224a5103fd628ec7df01", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 33, "avg_line_length": 10.409090909090908, "alnum_prop": 0.7074235807860262, "repo_name": "Niko40/AE-Engine", "id": "71d272377ca4fe6cd8e0b75ac615f8865c3f44da", "size": "335", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "AE/Engine/Renderer/Buffer/UniformBufferTypes.h", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "18" }, { "name": "C", "bytes": "3835345" }, { "name": "C++", "bytes": "2841035" }, { "name": "CMake", "bytes": "21523" }, { "name": "CSS", "bytes": "51494" }, { "name": "GLSL", "bytes": "1123" }, { "name": "HTML", "bytes": "9040093" }, { "name": "JavaScript", "bytes": "47117" }, { "name": "Makefile", "bytes": "10698" }, { "name": "Objective-C", "bytes": "39969" }, { "name": "Python", "bytes": "2980" }, { "name": "Roff", "bytes": "5263" } ], "symlink_target": "" }
// Copyright (c) 2011-2020 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #if defined(HAVE_CONFIG_H) #include "config/unobtanium-config.h" #endif #include "bitcoingui.h" #include "clientmodel.h" #include "guiconstants.h" #include "guiutil.h" #include "intro.h" #include "networkstyle.h" #include "optionsmodel.h" #include "splashscreen.h" #include "utilitydialog.h" #include "winshutdownmonitor.h" #ifdef ENABLE_WALLET #include "paymentserver.h" #include "walletmodel.h" #endif #include "init.h" #include "main.h" #include "rpcserver.h" #include "ui_interface.h" #include "util.h" #ifdef ENABLE_WALLET #include "wallet/wallet.h" #endif #include <stdint.h> #include <boost/filesystem/operations.hpp> #include <boost/thread.hpp> #include <QApplication> #include <QDebug> #include <QLibraryInfo> #include <QLocale> #include <QMessageBox> #include <QSettings> #include <QThread> #include <QTimer> #include <QTranslator> #if defined(QT_STATICPLUGIN) #include <QtPlugin> #if QT_VERSION < 0x050000 Q_IMPORT_PLUGIN(qcncodecs) Q_IMPORT_PLUGIN(qjpcodecs) Q_IMPORT_PLUGIN(qtwcodecs) Q_IMPORT_PLUGIN(qkrcodecs) Q_IMPORT_PLUGIN(qtaccessiblewidgets) #else Q_IMPORT_PLUGIN(AccessibleFactory) #if defined(QT_QPA_PLATFORM_XCB) Q_IMPORT_PLUGIN(QXcbIntegrationPlugin); #elif defined(QT_QPA_PLATFORM_WINDOWS) Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin); #elif defined(QT_QPA_PLATFORM_COCOA) Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin); #endif #endif #endif #if QT_VERSION < 0x050000 #include <QTextCodec> #endif // Declare meta types used for QMetaObject::invokeMethod Q_DECLARE_METATYPE(bool*) Q_DECLARE_METATYPE(CAmount) static void InitMessage(const std::string &message) { LogPrintf("init message: %s\n", message); } /* Translate string to current locale using Qt. */ static std::string Translate(const char* psz) { return QCoreApplication::translate("bitcoin-core", psz).toStdString(); } static QString GetLangTerritory() { QSettings settings; // Get desired locale (e.g. "de_DE") // 1) System default language QString lang_territory = QLocale::system().name(); // 2) Language from QSettings QString lang_territory_qsettings = settings.value("language", "").toString(); if(!lang_territory_qsettings.isEmpty()) lang_territory = lang_territory_qsettings; // 3) -lang command line argument lang_territory = QString::fromStdString(GetArg("-lang", lang_territory.toStdString())); return lang_territory; } /** Set up translations */ static void initTranslations(QTranslator &qtTranslatorBase, QTranslator &qtTranslator, QTranslator &translatorBase, QTranslator &translator) { // Remove old translators QApplication::removeTranslator(&qtTranslatorBase); QApplication::removeTranslator(&qtTranslator); QApplication::removeTranslator(&translatorBase); QApplication::removeTranslator(&translator); // Get desired locale (e.g. "de_DE") // 1) System default language QString lang_territory = GetLangTerritory(); // Convert to "de" only by truncating "_DE" QString lang = lang_territory; lang.truncate(lang_territory.lastIndexOf('_')); // Load language files for configured locale: // - First load the translator for the base language, without territory // - Then load the more specific locale translator // Load e.g. qt_de.qm if (qtTranslatorBase.load("qt_" + lang, QLibraryInfo::location(QLibraryInfo::TranslationsPath))) QApplication::installTranslator(&qtTranslatorBase); // Load e.g. qt_de_DE.qm if (qtTranslator.load("qt_" + lang_territory, QLibraryInfo::location(QLibraryInfo::TranslationsPath))) QApplication::installTranslator(&qtTranslator); // Load e.g. bitcoin_de.qm (shortcut "de" needs to be defined in bitcoin.qrc) if (translatorBase.load(lang, ":/translations/")) QApplication::installTranslator(&translatorBase); // Load e.g. bitcoin_de_DE.qm (shortcut "de_DE" needs to be defined in bitcoin.qrc) if (translator.load(lang_territory, ":/translations/")) QApplication::installTranslator(&translator); } /* qDebug() message handler --> debug.log */ #if QT_VERSION < 0x050000 void DebugMessageHandler(QtMsgType type, const char *msg) { const char *category = (type == QtDebugMsg) ? "qt" : NULL; LogPrint(category, "GUI: %s\n", msg); } #else void DebugMessageHandler(QtMsgType type, const QMessageLogContext& context, const QString &msg) { Q_UNUSED(context); const char *category = (type == QtDebugMsg) ? "qt" : NULL; LogPrint(category, "GUI: %s\n", msg.toStdString()); } #endif /** Class encapsulating Bitcoin Core startup and shutdown. * Allows running startup and shutdown in a different thread from the UI thread. */ class BitcoinCore: public QObject { Q_OBJECT public: explicit BitcoinCore(); public slots: void initialize(); void shutdown(); signals: void initializeResult(int retval); void shutdownResult(int retval); void runawayException(const QString &message); private: boost::thread_group threadGroup; /// Pass fatal exception message to UI thread void handleRunawayException(const std::exception *e); }; /** Main Bitcoin application object */ class BitcoinApplication: public QApplication { Q_OBJECT public: explicit BitcoinApplication(int &argc, char **argv); ~BitcoinApplication(); #ifdef ENABLE_WALLET /// Create payment server void createPaymentServer(); #endif /// Create options model void createOptionsModel(); /// Create main window void createWindow(const NetworkStyle *networkStyle); /// Create splash screen void createSplashScreen(const NetworkStyle *networkStyle); /// Request core initialization void requestInitialize(); /// Request core shutdown void requestShutdown(); /// Get process return value int getReturnValue() { return returnValue; } /// Get window identifier of QMainWindow (BitcoinGUI) WId getMainWinId() const; public slots: void initializeResult(int retval); void shutdownResult(int retval); /// Handle runaway exceptions. Shows a message box with the problem and quits the program. void handleRunawayException(const QString &message); signals: void requestedInitialize(); void requestedShutdown(); void stopThread(); void splashFinished(QWidget *window); private: QThread *coreThread; OptionsModel *optionsModel; ClientModel *clientModel; BitcoinGUI *window; QTimer *pollShutdownTimer; #ifdef ENABLE_WALLET PaymentServer* paymentServer; WalletModel *walletModel; #endif int returnValue; void startThread(); }; #include "bitcoin.moc" BitcoinCore::BitcoinCore(): QObject() { } void BitcoinCore::handleRunawayException(const std::exception *e) { PrintExceptionContinue(e, "Runaway exception"); emit runawayException(QString::fromStdString(strMiscWarning)); } void BitcoinCore::initialize() { try { qDebug() << __func__ << ": Running AppInit2 in thread"; int rv = AppInit2(threadGroup); if(rv) { /* Start a dummy RPC thread if no RPC thread is active yet * to handle timeouts. */ StartDummyRPCThread(); } emit initializeResult(rv); } catch (const std::exception& e) { handleRunawayException(&e); } catch (...) { handleRunawayException(NULL); } } void BitcoinCore::shutdown() { try { qDebug() << __func__ << ": Running Shutdown in thread"; threadGroup.interrupt_all(); threadGroup.join_all(); Shutdown(); qDebug() << __func__ << ": Shutdown finished"; emit shutdownResult(1); } catch (const std::exception& e) { handleRunawayException(&e); } catch (...) { handleRunawayException(NULL); } } BitcoinApplication::BitcoinApplication(int &argc, char **argv): QApplication(argc, argv), coreThread(0), optionsModel(0), clientModel(0), window(0), pollShutdownTimer(0), #ifdef ENABLE_WALLET paymentServer(0), walletModel(0), #endif returnValue(0) { setQuitOnLastWindowClosed(false); } BitcoinApplication::~BitcoinApplication() { if(coreThread) { qDebug() << __func__ << ": Stopping thread"; emit stopThread(); coreThread->wait(); qDebug() << __func__ << ": Stopped thread"; } delete window; window = 0; #ifdef ENABLE_WALLET delete paymentServer; paymentServer = 0; #endif delete optionsModel; optionsModel = 0; } #ifdef ENABLE_WALLET void BitcoinApplication::createPaymentServer() { paymentServer = new PaymentServer(this); } #endif void BitcoinApplication::createOptionsModel() { optionsModel = new OptionsModel(); } void BitcoinApplication::createWindow(const NetworkStyle *networkStyle) { window = new BitcoinGUI(networkStyle, 0); pollShutdownTimer = new QTimer(window); connect(pollShutdownTimer, SIGNAL(timeout()), window, SLOT(detectShutdown())); pollShutdownTimer->start(200); } void BitcoinApplication::createSplashScreen(const NetworkStyle *networkStyle) { SplashScreen *splash = new SplashScreen(0, networkStyle); // We don't hold a direct pointer to the splash screen after creation, so use // Qt::WA_DeleteOnClose to make sure that the window will be deleted eventually. splash->setAttribute(Qt::WA_DeleteOnClose); splash->show(); connect(this, SIGNAL(splashFinished(QWidget*)), splash, SLOT(slotFinish(QWidget*))); } void BitcoinApplication::startThread() { if(coreThread) return; coreThread = new QThread(this); BitcoinCore *executor = new BitcoinCore(); executor->moveToThread(coreThread); /* communication to and from thread */ connect(executor, SIGNAL(initializeResult(int)), this, SLOT(initializeResult(int))); connect(executor, SIGNAL(shutdownResult(int)), this, SLOT(shutdownResult(int))); connect(executor, SIGNAL(runawayException(QString)), this, SLOT(handleRunawayException(QString))); connect(this, SIGNAL(requestedInitialize()), executor, SLOT(initialize())); connect(this, SIGNAL(requestedShutdown()), executor, SLOT(shutdown())); /* make sure executor object is deleted in its own thread */ connect(this, SIGNAL(stopThread()), executor, SLOT(deleteLater())); connect(this, SIGNAL(stopThread()), coreThread, SLOT(quit())); coreThread->start(); } void BitcoinApplication::requestInitialize() { qDebug() << __func__ << ": Requesting initialize"; startThread(); emit requestedInitialize(); } void BitcoinApplication::requestShutdown() { qDebug() << __func__ << ": Requesting shutdown"; startThread(); window->hide(); window->setClientModel(0); pollShutdownTimer->stop(); #ifdef ENABLE_WALLET window->removeAllWallets(); delete walletModel; walletModel = 0; #endif delete clientModel; clientModel = 0; // Show a simple window indicating shutdown status ShutdownWindow::showShutdownWindow(window); // Request shutdown from core thread emit requestedShutdown(); } void BitcoinApplication::initializeResult(int retval) { qDebug() << __func__ << ": Initialization result: " << retval; // Set exit result: 0 if successful, 1 if failure returnValue = retval ? 0 : 1; if(retval) { #ifdef ENABLE_WALLET PaymentServer::LoadRootCAs(); paymentServer->setOptionsModel(optionsModel); #endif clientModel = new ClientModel(optionsModel); window->setClientModel(clientModel); #ifdef ENABLE_WALLET if(pwalletMain) { walletModel = new WalletModel(pwalletMain, optionsModel); window->addWallet(BitcoinGUI::DEFAULT_WALLET, walletModel); window->setCurrentWallet(BitcoinGUI::DEFAULT_WALLET); connect(walletModel, SIGNAL(coinsSent(CWallet*,SendCoinsRecipient,QByteArray)), paymentServer, SLOT(fetchPaymentACK(CWallet*,const SendCoinsRecipient&,QByteArray))); } #endif // If -min option passed, start window minimized. if(GetBoolArg("-min", false)) { window->showMinimized(); } else { window->show(); } emit splashFinished(window); #ifdef ENABLE_WALLET // Now that initialization/startup is done, process any command-line // bitcoin: URIs or payment requests: connect(paymentServer, SIGNAL(receivedPaymentRequest(SendCoinsRecipient)), window, SLOT(handlePaymentRequest(SendCoinsRecipient))); connect(window, SIGNAL(receivedURI(QString)), paymentServer, SLOT(handleURIOrFile(QString))); connect(paymentServer, SIGNAL(message(QString,QString,unsigned int)), window, SLOT(message(QString,QString,unsigned int))); QTimer::singleShot(100, paymentServer, SLOT(uiReady())); #endif } else { quit(); // Exit main loop } } void BitcoinApplication::shutdownResult(int retval) { qDebug() << __func__ << ": Shutdown result: " << retval; quit(); // Exit main loop after shutdown finished } void BitcoinApplication::handleRunawayException(const QString &message) { QMessageBox::critical(0, "Runaway exception", BitcoinGUI::tr("A fatal error occurred. Unobtanium can no longer continue safely and will quit.") + QString("\n\n") + message); ::exit(1); } WId BitcoinApplication::getMainWinId() const { if (!window) return 0; return window->winId(); } #ifndef BITCOIN_QT_TEST int main(int argc, char *argv[]) { SetupEnvironment(); /// 1. Parse command-line options. These take precedence over anything else. // Command-line options take precedence: ParseParameters(argc, argv); // Do not refer to data directory yet, this can be overridden by Intro::pickDataDirectory /// 2. Basic Qt initialization (not dependent on parameters or configuration) #if QT_VERSION < 0x050000 // Internal string conversion is all UTF-8 QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8")); QTextCodec::setCodecForCStrings(QTextCodec::codecForTr()); #endif Q_INIT_RESOURCE(unobtanium); Q_INIT_RESOURCE(bitcoin_locale); BitcoinApplication app(argc, argv); #if QT_VERSION > 0x050100 // Generate high-dpi pixmaps QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); #endif #ifdef Q_OS_MAC QApplication::setAttribute(Qt::AA_DontShowIconsInMenus); #endif // Register meta types used for QMetaObject::invokeMethod qRegisterMetaType< bool* >(); // Need to pass name here as CAmount is a typedef (see http://qt-project.org/doc/qt-5/qmetatype.html#qRegisterMetaType) // IMPORTANT if it is no longer a typedef use the normal variant above qRegisterMetaType< CAmount >("CAmount"); /// 3. Application identification // must be set before OptionsModel is initialized or translations are loaded, // as it is used to locate QSettings QApplication::setOrganizationName(QAPP_ORG_NAME); QApplication::setOrganizationDomain(QAPP_ORG_DOMAIN); QApplication::setApplicationName(QAPP_APP_NAME_DEFAULT); GUIUtil::SubstituteFonts(GetLangTerritory()); /// 4. Initialization of translations, so that intro dialog is in user's language // Now that QSettings are accessible, initialize translations QTranslator qtTranslatorBase, qtTranslator, translatorBase, translator; initTranslations(qtTranslatorBase, qtTranslator, translatorBase, translator); uiInterface.Translate.connect(Translate); // Show help message immediately after parsing command-line options (for "-lang") and setting locale, // but before showing splash screen. if (mapArgs.count("-?") || mapArgs.count("-help") || mapArgs.count("-version")) { HelpMessageDialog help(NULL, mapArgs.count("-version")); help.showOrPrint(); return 1; } /// 5. Now that settings and translations are available, ask user for data directory // User language is set up: pick a data directory Intro::pickDataDirectory(); /// 6. Determine availability of data directory and parse bitcoin.conf /// - Do not call GetDataDir(true) before this step finishes if (!boost::filesystem::is_directory(GetDataDir(false))) { QMessageBox::critical(0, QObject::tr("Unobtanium"), QObject::tr("Error: Specified data directory \"%1\" does not exist.").arg(QString::fromStdString(mapArgs["-datadir"]))); return 1; } try { ReadConfigFile(mapArgs, mapMultiArgs); } catch (const std::exception& e) { QMessageBox::critical(0, QObject::tr("Unobtanium"), QObject::tr("Error: Cannot parse configuration file: %1. Only use key=value syntax.").arg(e.what())); return false; } /// 7. Determine network (and switch to network specific options) // - Do not call Params() before this step // - Do this after parsing the configuration file, as the network can be switched there // - QSettings() will use the new application name after this, resulting in network-specific settings // - Needs to be done before createOptionsModel // Check for -testnet or -regtest parameter (Params() calls are only valid after this clause) if (!SelectParamsFromCommandLine()) { QMessageBox::critical(0, QObject::tr("Unobtanium"), QObject::tr("Error: Invalid combination of -regtest and -testnet.")); return 1; } #ifdef ENABLE_WALLET // Parse URIs on command line -- this can affect Params() PaymentServer::ipcParseCommandLine(argc, argv); #endif QScopedPointer<const NetworkStyle> networkStyle(NetworkStyle::instantiate(QString::fromStdString(Params().NetworkIDString()))); assert(!networkStyle.isNull()); // Allow for separate UI settings for testnets QApplication::setApplicationName(networkStyle->getAppName()); // Re-initialize translations after changing application name (language in network-specific settings can be different) initTranslations(qtTranslatorBase, qtTranslator, translatorBase, translator); #ifdef ENABLE_WALLET /// 8. URI IPC sending // - Do this early as we don't want to bother initializing if we are just calling IPC // - Do this *after* setting up the data directory, as the data directory hash is used in the name // of the server. // - Do this after creating app and setting up translations, so errors are // translated properly. if (PaymentServer::ipcSendCommandLine()) exit(0); // Start up the payment server early, too, so impatient users that click on // bitcoin: links repeatedly have their payment requests routed to this process: app.createPaymentServer(); #endif /// 9. Main GUI initialization // Install global event filter that makes sure that long tooltips can be word-wrapped app.installEventFilter(new GUIUtil::ToolTipToRichTextFilter(TOOLTIP_WRAP_THRESHOLD, &app)); #if QT_VERSION < 0x050000 // Install qDebug() message handler to route to debug.log qInstallMsgHandler(DebugMessageHandler); #else #if defined(Q_OS_WIN) // Install global event filter for processing Windows session related Windows messages (WM_QUERYENDSESSION and WM_ENDSESSION) qApp->installNativeEventFilter(new WinShutdownMonitor()); #endif // Install qDebug() message handler to route to debug.log qInstallMessageHandler(DebugMessageHandler); #endif // Load GUI settings from QSettings app.createOptionsModel(); // Subscribe to global signals from core uiInterface.InitMessage.connect(InitMessage); if (GetBoolArg("-splash", true) && !GetBoolArg("-min", false)) app.createSplashScreen(networkStyle.data()); try { app.createWindow(networkStyle.data()); app.requestInitialize(); #if defined(Q_OS_WIN) && QT_VERSION >= 0x050000 WinShutdownMonitor::registerShutdownBlockReason(QObject::tr("Unobtanium didn't yet exit safely..."), (HWND)app.getMainWinId()); #endif app.exec(); app.requestShutdown(); app.exec(); } catch (const std::exception& e) { PrintExceptionContinue(&e, "Runaway exception"); app.handleRunawayException(QString::fromStdString(strMiscWarning)); } catch (...) { PrintExceptionContinue(NULL, "Runaway exception"); app.handleRunawayException(QString::fromStdString(strMiscWarning)); } return app.getReturnValue(); } #endif // BITCOIN_QT_TEST
{ "content_hash": "8548d94cfe3629571743af9b16cd2ebb", "timestamp": "", "source": "github", "line_count": 647, "max_line_length": 177, "avg_line_length": 32.074188562596596, "alnum_prop": 0.6926079414032382, "repo_name": "unobtanium-official/Unobtanium", "id": "668232385cb61993be8b20156a0daa656afa9abe", "size": "20752", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/qt/bitcoin.cpp", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "422052" }, { "name": "C++", "bytes": "3575430" }, { "name": "CSS", "bytes": "1127" }, { "name": "HTML", "bytes": "50621" }, { "name": "Java", "bytes": "2100" }, { "name": "M4", "bytes": "148717" }, { "name": "Makefile", "bytes": "92533" }, { "name": "Objective-C", "bytes": "1081" }, { "name": "Objective-C++", "bytes": "7180" }, { "name": "Python", "bytes": "254663" }, { "name": "QMake", "bytes": "2019" }, { "name": "Roff", "bytes": "18190" }, { "name": "Shell", "bytes": "433620" } ], "symlink_target": "" }
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "sandbox/linux/seccomp-bpf/trap.h" #include <errno.h> #include <signal.h> #include <string.h> #include <sys/prctl.h> #include <sys/syscall.h> #include <limits> #include "base/logging.h" #include "sandbox/linux/seccomp-bpf/codegen.h" #include "sandbox/linux/seccomp-bpf/die.h" #include "sandbox/linux/seccomp-bpf/syscall.h" // Android's signal.h doesn't define ucontext etc. #if defined(OS_ANDROID) #include "sandbox/linux/services/android_ucontext.h" #endif namespace { const int kCapacityIncrement = 20; // Unsafe traps can only be turned on, if the user explicitly allowed them // by setting the CHROME_SANDBOX_DEBUGGING environment variable. const char kSandboxDebuggingEnv[] = "CHROME_SANDBOX_DEBUGGING"; // We need to tell whether we are performing a "normal" callback, or // whether we were called recursively from within a UnsafeTrap() callback. // This is a little tricky to do, because we need to somehow get access to // per-thread data from within a signal context. Normal TLS storage is not // safely accessible at this time. We could roll our own, but that involves // a lot of complexity. Instead, we co-opt one bit in the signal mask. // If BUS is blocked, we assume that we have been called recursively. // There is a possibility for collision with other code that needs to do // this, but in practice the risks are low. // If SIGBUS turns out to be a problem, we could instead co-opt one of the // realtime signals. There are plenty of them. Unfortunately, there is no // way to mark a signal as allocated. So, the potential for collision is // possibly even worse. bool GetIsInSigHandler(const ucontext_t* ctx) { // Note: on Android, sigismember does not take a pointer to const. return sigismember(const_cast<sigset_t*>(&ctx->uc_sigmask), SIGBUS); } void SetIsInSigHandler() { sigset_t mask; if (sigemptyset(&mask) || sigaddset(&mask, SIGBUS) || sigprocmask(SIG_BLOCK, &mask, NULL)) { SANDBOX_DIE("Failed to block SIGBUS"); } } bool IsDefaultSignalAction(const struct sigaction& sa) { if (sa.sa_flags & SA_SIGINFO || sa.sa_handler != SIG_DFL) { return false; } return true; } } // namespace namespace sandbox { Trap::Trap() : trap_array_(NULL), trap_array_size_(0), trap_array_capacity_(0), has_unsafe_traps_(false) { // Set new SIGSYS handler struct sigaction sa = {}; sa.sa_sigaction = SigSysAction; sa.sa_flags = SA_SIGINFO | SA_NODEFER; struct sigaction old_sa; if (sigaction(SIGSYS, &sa, &old_sa) < 0) { SANDBOX_DIE("Failed to configure SIGSYS handler"); } if (!IsDefaultSignalAction(old_sa)) { static const char kExistingSIGSYSMsg[] = "Existing signal handler when trying to install SIGSYS. SIGSYS needs " "to be reserved for seccomp-bpf."; DLOG(FATAL) << kExistingSIGSYSMsg; LOG(ERROR) << kExistingSIGSYSMsg; } // Unmask SIGSYS sigset_t mask; if (sigemptyset(&mask) || sigaddset(&mask, SIGSYS) || sigprocmask(SIG_UNBLOCK, &mask, NULL)) { SANDBOX_DIE("Failed to configure SIGSYS handler"); } } Trap* Trap::GetInstance() { // Note: This class is not thread safe. It is the caller's responsibility // to avoid race conditions. Normally, this is a non-issue as the sandbox // can only be initialized if there are no other threads present. // Also, this is not a normal singleton. Once created, the global trap // object must never be destroyed again. if (!global_trap_) { global_trap_ = new Trap(); if (!global_trap_) { SANDBOX_DIE("Failed to allocate global trap handler"); } } return global_trap_; } void Trap::SigSysAction(int nr, siginfo_t* info, void* void_context) { if (!global_trap_) { RAW_SANDBOX_DIE( "This can't happen. Found no global singleton instance " "for Trap() handling."); } global_trap_->SigSys(nr, info, void_context); } void Trap::SigSys(int nr, siginfo_t* info, void* void_context) { // Signal handlers should always preserve "errno". Otherwise, we could // trigger really subtle bugs. const int old_errno = errno; // Various sanity checks to make sure we actually received a signal // triggered by a BPF filter. If something else triggered SIGSYS // (e.g. kill()), there is really nothing we can do with this signal. if (nr != SIGSYS || info->si_code != SYS_SECCOMP || !void_context || info->si_errno <= 0 || static_cast<size_t>(info->si_errno) > trap_array_size_) { // ATI drivers seem to send SIGSYS, so this cannot be FATAL. // See crbug.com/178166. // TODO(jln): add a DCHECK or move back to FATAL. RAW_LOG(ERROR, "Unexpected SIGSYS received."); errno = old_errno; return; } // Obtain the signal context. This, most notably, gives us access to // all CPU registers at the time of the signal. ucontext_t* ctx = reinterpret_cast<ucontext_t*>(void_context); // Obtain the siginfo information that is specific to SIGSYS. Unfortunately, // most versions of glibc don't include this information in siginfo_t. So, // we need to explicitly copy it into a arch_sigsys structure. struct arch_sigsys sigsys; memcpy(&sigsys, &info->_sifields, sizeof(sigsys)); #if defined(__mips__) // When indirect syscall (syscall(__NR_foo, ...)) is made on Mips, the // number in register SECCOMP_SYSCALL(ctx) is always __NR_syscall and the // real number of a syscall (__NR_foo) is in SECCOMP_PARM1(ctx) bool sigsys_nr_is_bad = sigsys.nr != static_cast<int>(SECCOMP_SYSCALL(ctx)) && sigsys.nr != static_cast<int>(SECCOMP_PARM1(ctx)); #else bool sigsys_nr_is_bad = sigsys.nr != static_cast<int>(SECCOMP_SYSCALL(ctx)); #endif // Some more sanity checks. if (sigsys.ip != reinterpret_cast<void*>(SECCOMP_IP(ctx)) || sigsys_nr_is_bad || sigsys.arch != SECCOMP_ARCH) { // TODO(markus): // SANDBOX_DIE() can call LOG(FATAL). This is not normally async-signal // safe and can lead to bugs. We should eventually implement a different // logging and reporting mechanism that is safe to be called from // the sigSys() handler. RAW_SANDBOX_DIE("Sanity checks are failing after receiving SIGSYS."); } intptr_t rc; if (has_unsafe_traps_ && GetIsInSigHandler(ctx)) { errno = old_errno; if (sigsys.nr == __NR_clone) { RAW_SANDBOX_DIE("Cannot call clone() from an UnsafeTrap() handler."); } #if defined(__mips__) // Mips supports up to eight arguments for syscall. // However, seccomp bpf can filter only up to six arguments, so using eight // arguments has sense only when using UnsafeTrap() handler. rc = Syscall::Call(SECCOMP_SYSCALL(ctx), SECCOMP_PARM1(ctx), SECCOMP_PARM2(ctx), SECCOMP_PARM3(ctx), SECCOMP_PARM4(ctx), SECCOMP_PARM5(ctx), SECCOMP_PARM6(ctx), SECCOMP_PARM7(ctx), SECCOMP_PARM8(ctx)); #else rc = Syscall::Call(SECCOMP_SYSCALL(ctx), SECCOMP_PARM1(ctx), SECCOMP_PARM2(ctx), SECCOMP_PARM3(ctx), SECCOMP_PARM4(ctx), SECCOMP_PARM5(ctx), SECCOMP_PARM6(ctx)); #endif // defined(__mips__) } else { const ErrorCode& err = trap_array_[info->si_errno - 1]; if (!err.safe_) { SetIsInSigHandler(); } // Copy the seccomp-specific data into a arch_seccomp_data structure. This // is what we are showing to TrapFnc callbacks that the system call // evaluator registered with the sandbox. struct arch_seccomp_data data = { static_cast<int>(SECCOMP_SYSCALL(ctx)), SECCOMP_ARCH, reinterpret_cast<uint64_t>(sigsys.ip), {static_cast<uint64_t>(SECCOMP_PARM1(ctx)), static_cast<uint64_t>(SECCOMP_PARM2(ctx)), static_cast<uint64_t>(SECCOMP_PARM3(ctx)), static_cast<uint64_t>(SECCOMP_PARM4(ctx)), static_cast<uint64_t>(SECCOMP_PARM5(ctx)), static_cast<uint64_t>(SECCOMP_PARM6(ctx))}}; // Now call the TrapFnc callback associated with this particular instance // of SECCOMP_RET_TRAP. rc = err.fnc_(data, err.aux_); } // Update the CPU register that stores the return code of the system call // that we just handled, and restore "errno" to the value that it had // before entering the signal handler. Syscall::PutValueInUcontext(rc, ctx); errno = old_errno; return; } bool Trap::TrapKey::operator<(const TrapKey& o) const { if (fnc != o.fnc) { return fnc < o.fnc; } else if (aux != o.aux) { return aux < o.aux; } else { return safe < o.safe; } } ErrorCode Trap::MakeTrap(TrapFnc fnc, const void* aux, bool safe) { return GetInstance()->MakeTrapImpl(fnc, aux, safe); } ErrorCode Trap::MakeTrapImpl(TrapFnc fnc, const void* aux, bool safe) { if (!safe && !SandboxDebuggingAllowedByUser()) { // Unless the user set the CHROME_SANDBOX_DEBUGGING environment variable, // we never return an ErrorCode that is marked as "unsafe". This also // means, the BPF compiler will never emit code that allow unsafe system // calls to by-pass the filter (because they use the magic return address // from Syscall::Call(-1)). // This SANDBOX_DIE() can optionally be removed. It won't break security, // but it might make error messages from the BPF compiler a little harder // to understand. Removing the SANDBOX_DIE() allows callers to easyly check // whether unsafe traps are supported (by checking whether the returned // ErrorCode is ET_INVALID). SANDBOX_DIE( "Cannot use unsafe traps unless CHROME_SANDBOX_DEBUGGING " "is enabled"); return ErrorCode(); } // Each unique pair of TrapFnc and auxiliary data make up a distinct instance // of a SECCOMP_RET_TRAP. TrapKey key(fnc, aux, safe); TrapIds::const_iterator iter = trap_ids_.find(key); // We return unique identifiers together with SECCOMP_RET_TRAP. This allows // us to associate trap with the appropriate handler. The kernel allows us // identifiers in the range from 0 to SECCOMP_RET_DATA (0xFFFF). We want to // avoid 0, as it could be confused for a trap without any specific id. // The nice thing about sequentially numbered identifiers is that we can also // trivially look them up from our signal handler without making any system // calls that might be async-signal-unsafe. // In order to do so, we store all of our traps in a C-style trap_array_. uint16_t id; if (iter != trap_ids_.end()) { // We have seen this pair before. Return the same id that we assigned // earlier. id = iter->second; } else { // This is a new pair. Remember it and assign a new id. if (trap_array_size_ >= SECCOMP_RET_DATA /* 0xFFFF */ || trap_array_size_ >= std::numeric_limits<typeof(id)>::max()) { // In practice, this is pretty much impossible to trigger, as there // are other kernel limitations that restrict overall BPF program sizes. SANDBOX_DIE("Too many SECCOMP_RET_TRAP callback instances"); } id = trap_array_size_ + 1; // Our callers ensure that there are no other threads accessing trap_array_ // concurrently (typically this is done by ensuring that we are single- // threaded while the sandbox is being set up). But we nonetheless are // modifying a life data structure that could be accessed any time a // system call is made; as system calls could be triggering SIGSYS. // So, we have to be extra careful that we update trap_array_ atomically. // In particular, this means we shouldn't be using realloc() to resize it. // Instead, we allocate a new array, copy the values, and then switch the // pointer. We only really care about the pointer being updated atomically // and the data that is pointed to being valid, as these are the only // values accessed from the signal handler. It is OK if trap_array_size_ // is inconsistent with the pointer, as it is monotonously increasing. // Also, we only care about compiler barriers, as the signal handler is // triggered synchronously from a system call. We don't have to protect // against issues with the memory model or with completely asynchronous // events. if (trap_array_size_ >= trap_array_capacity_) { trap_array_capacity_ += kCapacityIncrement; ErrorCode* old_trap_array = trap_array_; ErrorCode* new_trap_array = new ErrorCode[trap_array_capacity_]; // Language specs are unclear on whether the compiler is allowed to move // the "delete[]" above our preceding assignments and/or memory moves, // iff the compiler believes that "delete[]" doesn't have any other // global side-effects. // We insert optimization barriers to prevent this from happening. // The first barrier is probably not needed, but better be explicit in // what we want to tell the compiler. // The clang developer mailing list couldn't answer whether this is a // legitimate worry; but they at least thought that the barrier is // sufficient to prevent the (so far hypothetical) problem of re-ordering // of instructions by the compiler. memcpy(new_trap_array, trap_array_, trap_array_size_ * sizeof(ErrorCode)); asm volatile("" : "=r"(new_trap_array) : "0"(new_trap_array) : "memory"); trap_array_ = new_trap_array; asm volatile("" : "=r"(trap_array_) : "0"(trap_array_) : "memory"); delete[] old_trap_array; } trap_ids_[key] = id; trap_array_[trap_array_size_] = ErrorCode(fnc, aux, safe, id); return trap_array_[trap_array_size_++]; } return ErrorCode(fnc, aux, safe, id); } bool Trap::SandboxDebuggingAllowedByUser() const { const char* debug_flag = getenv(kSandboxDebuggingEnv); return debug_flag && *debug_flag; } bool Trap::EnableUnsafeTrapsInSigSysHandler() { Trap* trap = GetInstance(); if (!trap->has_unsafe_traps_) { // Unsafe traps are a one-way fuse. Once enabled, they can never be turned // off again. // We only allow enabling unsafe traps, if the user explicitly set an // appropriate environment variable. This prevents bugs that accidentally // disable all sandboxing for all users. if (trap->SandboxDebuggingAllowedByUser()) { // We only ever print this message once, when we enable unsafe traps the // first time. SANDBOX_INFO("WARNING! Disabling sandbox for debugging purposes"); trap->has_unsafe_traps_ = true; } else { SANDBOX_INFO( "Cannot disable sandbox and use unsafe traps unless " "CHROME_SANDBOX_DEBUGGING is turned on first"); } } // Returns the, possibly updated, value of has_unsafe_traps_. return trap->has_unsafe_traps_; } ErrorCode Trap::ErrorCodeFromTrapId(uint16_t id) { if (global_trap_ && id > 0 && id <= global_trap_->trap_array_size_) { return global_trap_->trap_array_[id - 1]; } else { return ErrorCode(); } } Trap* Trap::global_trap_; } // namespace sandbox
{ "content_hash": "c2e358b067bef5eba18997dbe51af98f", "timestamp": "", "source": "github", "line_count": 383, "max_line_length": 80, "avg_line_length": 39.98172323759791, "alnum_prop": 0.6691046822960883, "repo_name": "bright-sparks/chromium-spacewalk", "id": "ce906fcb2e7be45d9da985871b5b61fba82fdfc2", "size": "15313", "binary": false, "copies": "7", "ref": "refs/heads/master", "path": "sandbox/linux/seccomp-bpf/trap.cc", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "AppleScript", "bytes": "6973" }, { "name": "Arduino", "bytes": "464" }, { "name": "Assembly", "bytes": "35318" }, { "name": "Batchfile", "bytes": "7621" }, { "name": "C", "bytes": "8695871" }, { "name": "C++", "bytes": "206827052" }, { "name": "CSS", "bytes": "871444" }, { "name": "HTML", "bytes": "24541148" }, { "name": "Java", "bytes": "5463539" }, { "name": "JavaScript", "bytes": "17790298" }, { "name": "Makefile", "bytes": "92563" }, { "name": "Objective-C", "bytes": "1140820" }, { "name": "Objective-C++", "bytes": "7095881" }, { "name": "PHP", "bytes": "97817" }, { "name": "PLpgSQL", "bytes": "218379" }, { "name": "Perl", "bytes": "69392" }, { "name": "Protocol Buffer", "bytes": "387183" }, { "name": "Python", "bytes": "6929545" }, { "name": "Shell", "bytes": "473581" }, { "name": "Standard ML", "bytes": "4131" }, { "name": "XSLT", "bytes": "418" }, { "name": "nesC", "bytes": "15206" } ], "symlink_target": "" }
module Awspec::Generator module Doc module Type class Route53HostedZone < Base def initialize super @type = Awspec::Type::Route53HostedZone.new('example.com.') @ret = @type.resource_via_client @matchers = [] @ignore_matchers = [] @describes = [] end end end end end
{ "content_hash": "a0cf27898da765ea42d08d806af0cfd8", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 69, "avg_line_length": 22.875, "alnum_prop": 0.5409836065573771, "repo_name": "AgarFu/awspec", "id": "8ec5162c380d3eaae5d426d21246dcb08dfcc4d3", "size": "366", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/awspec/generator/doc/type/route53_hosted_zone.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "378761" }, { "name": "Shell", "bytes": "58" } ], "symlink_target": "" }
""" Example 1: A simple combination logic block example. This example declares a block of hardware with three one-bit inputs, (a,b,c) and two one-bit outputs (sum, cout). The logic declared is a simple one-bit adder and the definition uses some of the most common parts of PyRTL. The adder is then simulated on random data, the wave form is printed to the screen, and the resulting trace is compared to a "correct" addition. If the result is correct then a 0 is returned, else 1. """ import random import pyrtl # The basic idea of PyRTL is to specify the component of a some hardware block # through the declaration of wires and operations on those wires. The current # working block, an instance of a class devilishly named "Block", is implicit # in all of the below code -- it is easiest to start with the way wires work. # --- Step 1: Define Logic ------------------------------------------------- # One of the most fundamental types in PyRTL is the "WireVector" which is acts # very much like a python list of 1-bit wires. Unlike a normal list though the # number of bits is explicitly declared. temp1 = pyrtl.WireVector(bitwidth=1, name='temp1') # Both arguments are in fact optional and default to a bitwidth of 1 and a unique # name generated by pyrtl starting with 'tmp' temp2 = pyrtl.WireVector() # Two special types of WireVectors are Input and Output, which are used to specify # an interface to the hardware block. a, b, c = pyrtl.Input(1, 'a'), pyrtl.Input(1, 'b'), pyrtl.Input(1, 'c') sum, carry_out = pyrtl.Output(1, 'sum'), pyrtl.Output(1, 'carry_out') # Okay, let's build a one-bit adder. To do this we need to use the assignment # operator, which is '<<='. This takes an already declared wire and "connects" # it to some other already declared wire. Let's start with the sum bit, which is # of course just the xor of the three inputs sum <<= a ^ b ^ c # The carry_out bit would just be "carry_out <<= a & b | a & c | b & c" but let's break # than down a bit to see what is really happening. What if we want to give names # to the partial signals in the middle of that computation. When you take # "a & b" in PyRTL what that really means is "make an AND gate, connect one input # to 'a' and the other to 'b' and return the result of the gate". The result of # that AND gate can then be assigned to temp1 or it can be used like any other # python variable. temp1 <<= a & b # connect the result of a & b to the pre-allocated wirevector temp2 <<= a & c temp3 = b & c # temp3 IS the result of b & c (this is the first mention of temp3) carry_out <<= temp1 | temp2 | temp3 # You can access the working block through pyrt.working_block(), and for most # things one block is all you will need. Example 2 discusses this in more detail, # but for now we can just bring the block to see that in fact it looks like the # hardware we described. The format is a bit weird, but roughly translates to # a list of gates (the 'w' gates are just wires). The ins and outs of the gates # are printed 'name'/'bitwidth''WireVectorType' print('--- One Bit Adder Implementation ---') print(pyrtl.working_block()) print() # --- Step 2: Simulate Design ----------------------------------------------- # Okay, let's get simulate our one-bit adder. To keep track of the output of # the simulation we need to make a new "SimulationTrace" and a "Simulation" # that then uses that trace. sim_trace = pyrtl.SimulationTrace() sim = pyrtl.Simulation(tracer=sim_trace) # Now all we need to do is call "sim.step" to simulate each clock cycle of our # design. We just need to pass in some input each cycle which is a dictionary # mapping Inputs (the actual class instances of Input not the *names* of the # inputs) and a value for that signal each cycle. In this simple example we # can just specify a random value of 0 or 1 with python's random module. We # call step 15 times to simulate 15 cycles. for cycle in range(15): sim.step({ a: random.choice([0, 1]), b: random.choice([0, 1]), c: random.choice([0, 1]) }) # Now all we need to do is print the trace results to the screen. Here we use # "render_trace" with some size information. print('--- One Bit Adder Simulation ---') sim_trace.render_trace(symbol_len=5, segment_size=5) # --- Verification of Simulated Design --------------------------------------- # Now finally, let's check the trace to make sure that sum and carry_out are actually # the right values when compared to a python's addition operation. Note that # all the simulation is done at this point and we are just checking the wave form # but there is no reason you could not do this at simulation time if you had a # really long running design. for cycle in range(15): # Note that we are doing all arithmetic on values NOT wirevectors here. # We can add the inputs together to get a value for the result add_result = (sim_trace.trace[a][cycle] + sim_trace.trace[b][cycle] + sim_trace.trace[c][cycle]) # We can select off the bits and compare python_sum = add_result & 0x1 python_cout = (add_result >> 1) & 0x1 if (python_sum != sim_trace.trace[sum][cycle] or python_cout != sim_trace.trace[carry_out][cycle]): print('This Example is Broken!!!') exit(1) # You made it to the end! exit(0)
{ "content_hash": "e1b0debaa169147e1d6de4cf4a04d69f", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 87, "avg_line_length": 46.01709401709402, "alnum_prop": 0.686849925705795, "repo_name": "deekshadangwal/PyRTL", "id": "1a257b2931ba2b21224a6e6f557ee163b1caaf7f", "size": "5384", "binary": false, "copies": "1", "ref": "refs/heads/development", "path": "examples/example1-combologic.py", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Python", "bytes": "347120" }, { "name": "Shell", "bytes": "1554" } ], "symlink_target": "" }
define({ "_widgetLabel": "Modelador d'idoneïtat", "general": { "clear": "Esborra", "cancel": "Cancel·la", "save": "Executa", "saveAs": "Exporta" }, "saveModel": { "save": "Exporta", "title": "Títol: ", "summary": "Resum: ", "description": "Descripció: ", "tags": "Etiquetes: ", "folder": "Carpeta: ", "homeFolderPattern": "{username} (Inici)", "failed": "Error en exportar." }, "util": { "colorRamp": { "1": "Excessivament baix", "2": "Molt baix", "3": "Baix", "4": "Baix-mitjà", "5": "Mitjà", "6": "Alt-mitjà", "7": "Alt", "8": "Molt alt", "9": "Excessivament alt", "low": "Baixa", "high": "Alta", "tipPattern": "{label} ({value})", "flipCaption": "Inverteix" } }, "wro": { "caption": "Modelador d'idoneïtat", "browsePrompt": "Servei de superposició ponderada", "selectLayersCaption": "Seleccioneu les capes", "selectLayers": "Capes", "designModelCaption": "Model de disseny", "designModel": "Model de disseny", "transparency": "Transparència", "visible": "Visible", "total": "Total", "unableToLoad": "No es pot carregar el model.", "projectNotOpen": "No hi ha cap projecte obert.", "readMore": "Més informació", "validation": { "validating": "S'està validant...", "invalidItemCaption": "Avís sobre el servei de superposició ponderada", "notAnImageService": "Aquest element no és un servei d'imatges.", "notAWroService": "Aquest element no és un servei de superposició ponderada.", "undefinedUrl": "No s'ha definit l'adreça URL d'aquest element.", "inaccessible": "No es pot accedir al servei.", "generalError": "No es pot obrir l'element.", "missingFieldPattern": "{field} és un camp obligatori", "notAllowRasterFunction": "allowRasterFunction s'ha de definir en Cert", "notNearestResampling": "defaultResamplingMethod ha de ser Més proper", "notIsWeightedOverlayProp": "La propietat clau IsWeightedOverlay ha d'estar definida en Cert", "invalidLink": "L'adreça URL no és vàlida. No s'ha pogut obrir el lloc de la capa seleccionada.", "unexpectedError": "S'ha produït un estat inesperat.", "rangeMessage": "El valor ha d'estar comprès entre ${0} i ${1}", "rangeMessage100": "El valor ha d'estar comprès entre 0 i 100", "maxLayers": "Es permet un màxim de ${0} capes per servei i s'ha d'eliminar una capa abans d'afegir-ne una de nova.", "notFound": "No s'ha trobat la capa ${0} al servei de superposició ponderada", "wroServiceNotDefined": "No hi ha cap servei de superposició ponderada definit per al model.", "overlayLayerOutputInvalid": "Falta el valor de sortida dels intervals de nova representació cartogràfica [${1}] de la capa de superposició [${0}] o no és vàlid", "overlayLayerInputInvalid": "Falta el valor mínim/màxim d'entrada dels intervals de nova representació cartogràfica [${1}] de la capa de superposició [${0}] o no és vàlid", "overlayLayerRangesMissing": "Falten els intervals de nova representació cartogràfica de la capa de superposició [${0}]", "overlayLayerWeight": "Les ponderacions de la capa de superposició han de sumar 100 com a màxim", "overlayLayerRequired": "És necessària almenys una capa de superposició", "overlayLayerNotDefined": "No s'han definit les capes de superposició", "requiresColormap": "Aquesta funció de ràster requereix un mapa de color, però el model no té una definició de mapa de color vàlida", "createModelError": "Error en crear el model", "invalidModel": "El model no és vàlid", "imageServiceNotDefined": "No s'ha definit la capa del servei d'imatges", "imageLayerNotDefined": "No s'ha definit la capa del servei d'imatges", "histogramNotDefined": "No s'ha definit cap funció d'histograma de superposició ponderada." }, "colorRampLabel": { "Green Yellow Red": "Verd Groc Vermell", "Red Yellow Green": "Vermell Groc Verd", "Yellow to Dark Red": "De groc a vermell fosc", "Dark Red to Yellow": "De vermell fosc a groc", "Light Gray to Dark Gray": "De gris clar a gris fosc", "Dark Gray to Light Gray": "De gris fosc a gris clar", "Light Brown to Dark Brown": "De marró clar a marró fosc", "Dark Brown to Light Brown": "De marró fosc a marró clar", "Full Spectrum - Bright Red to Blue": "Espectre complet: de vermell brillant a blau", "Full Spectrum - Bright Blue to Red": "Espectre complet: de blau brillant a vermell", "Partial Spectrum - Yellow to Blue": "Espectre parcial: de groc a blau", "Partial Spectrum - Blue to Yellow": "Espectre parcial: de blau a groc", "Yellow-Green to Dark Blue": "De groc-verd a blau fosc", "Dark Blue to Yellow-Green": "De blau fosc a groc-verd", "Cold to Hot Diverging": "De fred a càlid divergent", "Hot to Cold Diverging": "De calent a fred divergent", "Surface - Low to High": "Superfície: de menys a més", "Surface - High to Low": "Superfície: de més a menys" } }, "tabs": { "layers": "Capes", "model": "Model", "chart": "Gràfic" }, "chart": { "prompt": "Entitats", "working": "S'està actualitzant...", "polygonTool": "Dibuixa un polígon", "freehandPolygonTool": "Dibuixa un polígon a mà alçada", "selectTool": "Seleccioneu-ne d'una capa", "panTool": "Panoràmica", "clearButton": "Esborra", "noModelLayer": "No hi ha cap model.", "noSubjectLayers": "El mapa no té capes de polígon.", "tipPattern": "${category} - ${label}: ${percent} %", "tipPattern2": "${category}: ${percent} %", "labelPattern": "${category} - ${label}" } });
{ "content_hash": "710cb21025bef9a77ba2c14349c7020e", "timestamp": "", "source": "github", "line_count": 121, "max_line_length": 178, "avg_line_length": 47.87603305785124, "alnum_prop": 0.6406007250129466, "repo_name": "tmcgee/cmv-wab-widgets", "id": "066df037096032b293dfd3160c540f6cfa8a7edc", "size": "5872", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "wab/2.13/widgets/SuitabilityModeler/nls/ca/strings.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "1198579" }, { "name": "HTML", "bytes": "946685" }, { "name": "JavaScript", "bytes": "22190423" }, { "name": "Pascal", "bytes": "4207" }, { "name": "TypeScript", "bytes": "102918" } ], "symlink_target": "" }
[![GoDoc](https://godoc.org/github.com/setekhid/gosh?status.svg)](https://godoc.org/github.com/setekhid/gosh) [![Go Report Card](https://goreportcard.com/badge/github.com/setekhid/gosh)](https://goreportcard.com/report/github.com/setekhid/gosh) helping you while you wanna use golang to call shell
{ "content_hash": "471bb79de28132c96859a4f2699811db", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 244, "avg_line_length": 99.66666666666667, "alnum_prop": 0.7692307692307693, "repo_name": "setekhid/gosh", "id": "5b5711b5ed1adbe097731f03e23ff2cdf7bce817", "size": "307", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "bsd-3-clause", "language": [], "symlink_target": "" }
package org.copperengine.core.persistent.adapter; import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Timestamp; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.Iterator; import java.util.List; import org.copperengine.core.batcher.AbstractBatchCommand; import org.copperengine.core.batcher.BatchCommand; import org.copperengine.core.batcher.BatchExecutor; import org.copperengine.core.batcher.CommandCallback; import org.copperengine.core.batcher.NullCallback; import org.copperengine.core.persistent.DefaultEntityPersister; import org.copperengine.core.persistent.DefaultEntityPersisterFactory; import org.copperengine.core.persistent.DefaultPersistenceWorker; import org.copperengine.core.persistent.DefaultPersisterSharedRessources; import org.copperengine.core.persistent.PersistentWorkflow; import org.copperengine.core.persistent.Serializer; import org.objectweb.asm.Type; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public abstract class AdapterCallPersisterFactory implements DefaultEntityPersisterFactory<AdapterCall, DefaultEntityPersister<AdapterCall>> { final Serializer serializer; public AdapterCallPersisterFactory(Serializer serializer) { this.serializer = serializer; } @Override public Class<AdapterCall> getEntityClass() { return AdapterCall.class; } @Override public Class<?> getPersisterClass() { return DefaultEntityPersister.class; } @Override public DefaultEntityPersister<AdapterCall> createPersister(PersistentWorkflow<?> workflow, DefaultPersisterSharedRessources<AdapterCall, DefaultEntityPersister<AdapterCall>> sharedRessources) { return new DefaultEntityPersister<AdapterCall>(workflow, null, ((SharedRessources<AdapterCall, DefaultEntityPersister<AdapterCall>>) sharedRessources).insertWorker, null, null); } static class EntityIdentity implements Comparable<EntityIdentity> { DefaultPersistenceWorker.WorkflowAndEntity<AdapterCall> entry; String workflowId; String entityId; public EntityIdentity(DefaultPersistenceWorker.WorkflowAndEntity<AdapterCall> entry) { this.entry = entry; this.workflowId = entry.workflow.getId(); this.entityId = entry.entity.getEntityId(); } public EntityIdentity(String workflowId, String entityId) { this.workflowId = workflowId; this.entityId = entityId; } @Override public int compareTo(EntityIdentity o) { return compare(this, o); } static int compare( EntityIdentity o1, EntityIdentity o2) { int cmp = o1.workflowId.compareTo(o2.workflowId); if (cmp != 0) return cmp; String entityId1 = o1.entityId; String entityId2 = o2.entityId; if (entityId1 == null) { if (entityId2 != null) return -1; return 1; } return entityId1.compareTo(entityId2); } public int findLeftmostOccurrence(EntityIdentity[] sortedEntities) { int idx = Arrays.binarySearch(sortedEntities, this); if (idx < 0) return idx; while (idx > 0 && compare(sortedEntities[idx - 1], this) == 0) { --idx; } return idx; } } public abstract Selector createSelector(); static final class Selector { private static final Logger logger = LoggerFactory.getLogger(Selector.class); final Serializer serializer; final boolean oracle; public Selector(Serializer serializer, boolean oracle) { this.oracle = oracle; this.serializer = serializer; } public List<AdapterCall> dequeue(Connection connection, Collection<String> adapterIds, int maxRows) throws SQLException { StringBuilder asterisks = new StringBuilder(); for (int i = 0; i < adapterIds.size(); ++i) { asterisks.append("?,"); } asterisks.setLength(asterisks.length() - 1); String sql = "SELECT \"WORKFLOWID\", \"ENTITYID\", \"ADAPTERID\", \"PRIORITY\", \"METHODDECLARINGCLASS\", \"METHODNAME\", \"METHODSIGNATURE\", \"ARGS\" " + "FROM \"COP_ADAPTERCALL\" " + "WHERE DEQUEUE_TS is null AND ADAPTERID in (" + asterisks + ") AND DEFUNCT <> '1' " + "ORDER BY PRIORITY"; if (oracle) { sql = "SELECT * FROM (" + sql + ") WHERE ROWNUM <= " + maxRows; } final String sqlUpdate = "UPDATE \"COP_ADAPTERCALL\" " + "SET DEQUEUE_TS = ? " + "WHERE \"WORKFLOWID\" = ? and \"ENTITYID\" = ? and \"ADAPTERID\" = ?"; final String sqlUpdateDefunct = "UPDATE \"COP_ADAPTERCALL\" " + "SET DEFUNCT = '1' " + "WHERE \"WORKFLOWID\" = ? and \"ENTITYID\" = ? and \"ADAPTERID\" = ?"; PreparedStatement stmt = null; PreparedStatement stmtUpdate = null; PreparedStatement stmtUpdateDefunct = null; ArrayList<AdapterCall> ret = new ArrayList<AdapterCall>(Math.min(maxRows, 100)); try { stmt = connection.prepareStatement(sql.toString()); stmtUpdate = connection.prepareStatement(sqlUpdate.toString()); stmtUpdateDefunct = connection.prepareStatement(sqlUpdateDefunct.toString()); Iterator<String> it = adapterIds.iterator(); int i = 0; while (it.hasNext()) { stmt.setString(++i, it.next()); } ResultSet rs = stmt.executeQuery(); while (rs.next() && ret.size() < maxRows) { String workflowId = rs.getString(1); String entityId = rs.getString(2); String adapterId = rs.getString(3); long priority = rs.getLong(4); String methodDeclaringClass = rs.getString(5); String methodName = rs.getString(6); String methodSignature = rs.getString(7); Method m = resolveMethod(methodDeclaringClass, methodName, methodSignature); Object[] args; try { args = (Object[]) serializer.deserializeObject(rs.getString(8)); AdapterCall entity = new AdapterCall(adapterId, entityId, m, args); entity.setWorkflowData(workflowId, priority); stmtUpdate.setTimestamp(1, new Timestamp(System.currentTimeMillis())); stmtUpdate.setString(2, workflowId); stmtUpdate.setString(3, entityId); stmtUpdate.setString(4, adapterId); stmtUpdate.addBatch(); ret.add(entity); } catch (Exception e) { logger.error("Cannot dequeue adapterCall, adapterId/workflowId/entityId='" + adapterId + "'/'" + workflowId + "'/'" + entityId, e); stmtUpdateDefunct.setString(1, workflowId); stmtUpdateDefunct.setString(2, entityId); stmtUpdateDefunct.setString(3, adapterId); stmtUpdateDefunct.addBatch(); } } rs.close(); stmtUpdate.executeBatch(); stmtUpdateDefunct.executeBatch(); return ret; } finally { if (stmt != null) stmt.close(); if (stmtUpdate != null) stmtUpdate.close(); if (stmtUpdateDefunct != null) stmtUpdateDefunct.close(); } } } static final class InsertionWorker extends DefaultPersistenceWorker<AdapterCall, DefaultEntityPersister<AdapterCall>> { final Serializer serializer; public InsertionWorker(Serializer serializer) { super(OperationType.INSERT); this.serializer = serializer; } static final String sql = "INSERT INTO \"COP_ADAPTERCALL\"" + " (\"WORKFLOWID\", \"ENTITYID\", \"ADAPTERID\", \"PRIORITY\", \"METHODDECLARINGCLASS\", \"METHODNAME\", \"METHODSIGNATURE\", \"ARGS\")" + " VALUES(?,?,?,?,?,?,?,?)"; @Override public void doExec(Connection connection, List<WorkflowAndEntity<AdapterCall>> theWork) throws SQLException { if (theWork.isEmpty()) return; final PreparedStatement stmt = connection.prepareStatement(sql); try { for (WorkflowAndEntity<AdapterCall> en : theWork) { AdapterCall entity = en.entity; stmt.setString(1, en.workflow.getId()); stmt.setString(2, entity.getEntityId()); stmt.setString(1, en.workflow.getId()); stmt.setString(2, entity.getEntityId()); stmt.setString(3, entity.getAdapterId()); stmt.setLong(4, entity.getPriority()); stmt.setString(5, entity.getMethod().getDeclaringClass().getName()); stmt.setString(6, entity.getMethod().getName()); stmt.setString(7, Type.getMethodDescriptor(entity.getMethod())); try { stmt.setString(8, serializer.serializeObject(entity.getArgs())); } catch (Exception e) { throw new RuntimeException(e); } stmt.addBatch(); } stmt.executeBatch(); } finally { stmt.close(); } } } static final class Deletor { static final String sql = "DELETE FROM \"COP_ADAPTERCALL\"" + " WHERE \"WORKFLOWID\"=? AND \"ENTITYID\" = ? AND \"ADAPTERID\"=?"; public void doExec(Connection connection, List<AdapterCall> theWork) throws SQLException { if (theWork.isEmpty()) return; final PreparedStatement stmt = connection.prepareStatement(sql); try { for (AdapterCall en : theWork) { stmt.setString(1, en.getWorkflowId()); stmt.setString(2, en.getEntityId()); stmt.setString(3, en.getAdapterId()); stmt.addBatch(); } stmt.executeBatch(); } finally { stmt.close(); } } } @SuppressWarnings("unchecked") @Override public Collection<Class<?>> getEntityClassesDependingOn() { return Collections.EMPTY_LIST; } @Override public DefaultPersisterSharedRessources<AdapterCall, DefaultEntityPersister<AdapterCall>> createSharedRessources() { return new SharedRessources<AdapterCall, DefaultEntityPersister<AdapterCall>>( new InsertionWorker(serializer)); } public AbstractBatchCommand<?, ?> createDeleteCommand(AdapterCall c) { return new Command(c, new NullCallback<AdapterCallPersisterFactory.Command>()); } static final class Command extends AbstractBatchCommand<Executor, Command> { final AdapterCall data; public Command(AdapterCall data, CommandCallback<Command> callback) { super(callback, System.currentTimeMillis()); if (data == null) throw new NullPointerException(); this.data = data; } @Override public Executor executor() { return Executor.INSTANCE; } } static final class Executor extends BatchExecutor<Executor, Command> { static Executor INSTANCE = new Executor(); @Override public int preferredBatchSize() { return 50; } @Override public int maximumBatchSize() { return 100; } @Override public void doExec( Collection<BatchCommand<Executor, Command>> commands, Connection connection) throws Exception { Deletor deletor = new Deletor(); ArrayList<AdapterCall> calls = new ArrayList<AdapterCall>(); for (BatchCommand<Executor, Command> cmd : commands) { calls.add(((Command) cmd).data); } deletor.doExec(connection, calls); } } public static class Oracle extends AdapterCallPersisterFactory { public Oracle(Serializer serializer) { super(serializer); } @Override public Selector createSelector() { return new Selector(serializer, true); } } public static class Common extends AdapterCallPersisterFactory { public Common(Serializer serializer) { super(serializer); } @Override public Selector createSelector() { return new Selector(serializer, false); } } public class SharedRessources<E, P extends DefaultEntityPersister<E>> extends DefaultPersisterSharedRessources<E, P> { final DefaultPersistenceWorker<E, P> insertWorker; public SharedRessources( DefaultPersistenceWorker<E, P> insertWorker) { this.insertWorker = insertWorker; } @SuppressWarnings("unchecked") @Override public Iterable<DefaultPersistenceWorker<E, P>> getWorkers() { return Arrays.<DefaultPersistenceWorker<E, P>>asList(new DefaultPersistenceWorker[] { insertWorker }); } } static HashMap<String, HashMap<String, HashMap<String, Method>>> methodCache = new HashMap<String, HashMap<String, HashMap<String, Method>>>(); static Method resolveMethod(String declaringClass, String methodName, String signature) throws NoSuchMethodError { synchronized (methodCache) { Method mr = null; try { HashMap<String, HashMap<String, Method>> subCache1 = methodCache.get(declaringClass); if (subCache1 == null) { subCache1 = new HashMap<String, HashMap<String, Method>>(); methodCache.put(declaringClass, subCache1); Class<?> c = Class.forName(declaringClass); for (Method m : c.getDeclaredMethods()) { if (Modifier.isStatic(m.getModifiers())) continue; HashMap<String, Method> subCache2 = subCache1.get(m.getName()); if (subCache2 == null) { subCache2 = new HashMap<String, Method>(); subCache1.put(m.getName(), subCache2); } subCache2.put(Type.getMethodDescriptor(m), m); } } HashMap<String, Method> subCache2 = subCache1.get(methodName); mr = subCache2 == null ? null : subCache2.get(signature); } catch (ClassNotFoundException e) { e.printStackTrace(); } if (mr == null) throw new NoSuchMethodError("Method '" + methodName + "' with signature '" + signature + "' of class '" + declaringClass + " not found "); return mr; } } }
{ "content_hash": "a2078697b8d0d93cacfc640648a2bcbf", "timestamp": "", "source": "github", "line_count": 417, "max_line_length": 162, "avg_line_length": 39.83693045563549, "alnum_prop": 0.5533951360462317, "repo_name": "benfortuna/copper-engine", "id": "5c50da95b1ddc18745c3c733ff6b5a39970242be", "size": "17234", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "projects/copper-coreengine/src/main/java/org/copperengine/core/persistent/adapter/AdapterCallPersisterFactory.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "11273" }, { "name": "HTML", "bytes": "19139" }, { "name": "Java", "bytes": "2609392" }, { "name": "PLSQL", "bytes": "12599" }, { "name": "SQLPL", "bytes": "1383" } ], "symlink_target": "" }
.entry .gist { background: #eee; border: 1px solid #fff; margin: 15px 0px; padding: 7px 15px; border-radius: 2px; text-shadow: 0 0 1px #fff; line-height: 1.6; overflow: auto; color: #666; } .entry .gist .gist-file { border: none; font-family: inherit; margin: 0; font-size: 0.9em; } .entry .gist .gist-file .gist-data { background: none; border-bottom: none; } .entry .gist .gist-file .gist-data pre { padding: 0 !important; font-family: font-mono; } .entry .gist .gist-file .gist-meta { background: none; color: color-meta; margin-top: 5px; padding: 0; text-shadow: 0 0 1px #fff; font-size: 100%; } .entry .gist .gist-file .gist-meta a { color: color-link; } .entry .gist .gist-file .gist-meta a:visited { color: color-link; } figure.highlight { background: #eee; border: 1px solid color-border; margin: 1em 0; padding: 1em; border-radius: 2px; text-shadow: 0 0 1px #fff; line-height: 1.6; overflow: auto; position: relative; font-size: 0.9em; } figure.highlight figcaption { color: color-meta; margin-bottom: 5px; text-shadow: 0 0 1px #fff; } figure.highlight figcaption a { position: absolute; right: 15px; } figure.highlight pre { border: none; padding: 0; margin: 0; } figure.highlight table { margin-top: 0; border-spacing: 0; } figure.highlight .gutter { color: color-meta; width: 20px; padding-right: 15px; border-right: 1px solid color-border; text-align: right; } figure.highlight .code { padding-left: 15px; border-left: 1px solid #fff; color: #666; } figure.highlight .line { height: 20px; } pre .comment, pre .template_comment, pre .diff .header, pre .doctype, pre .pi, pre .lisp .string, pre .javadoc { color: #93a1a1; font-style: italic; } pre .keyword, pre .winutils, pre .method, pre .addition, pre .css .tag, pre .request, pre .status, pre .nginx .title { color: #859900; } pre .number, pre .command, pre .string, pre .tag .value, pre .phpdoc, pre .tex .formula, pre .regexp, pre .hexcolor { color: #2aa198; } pre .title, pre .localvars, pre .chunk, pre .decorator, pre .built_in, pre .identifier, pre .vhdl, pre .literal, pre .id { color: #268bd2; } pre .attribute, pre .variable, pre .lisp .body, pre .smalltalk .number, pre .constant, pre .class .title, pre .parent, pre .haskell .type { color: #b58900; } pre .preprocessor, pre .preprocessor .keyword, pre .shebang, pre .symbol, pre .symbol .string, pre .diff .change, pre .special, pre .attr_selector, pre .important, pre .subst, pre .cdata, pre .clojure .title { color: #cb4b16; } pre .deletion { color: #dc322f; } @media (prefers-color-scheme: dark) { .entry .gist { background: #222; border: 1px solid #000; text-shadow: 0 0 1px #000; color: #fff; } .entry .gist .gist-file .gist-meta { text-shadow: 0 0 1px #000; } figure.highlight { background: #222; text-shadow: 0 0 1px #000; } figure.highlight figcaption { text-shadow: 0 0 1px #000; } figure.highlight .code { border-left: 1px solid #000; color: #fff; } pre .comment, pre .template_comment, pre .diff .header, pre .doctype, pre .pi, pre .lisp .string, pre .javadoc { color: #586e75; } }
{ "content_hash": "431732b4bba8ed34dc75ed0297471e9a", "timestamp": "", "source": "github", "line_count": 183, "max_line_length": 46, "avg_line_length": 17.612021857923498, "alnum_prop": 0.6540490226497052, "repo_name": "yyj4399/yyj4399.github.io", "id": "bce2e2ba2f761bc02fe01f2729d5f5073498db6c", "size": "3223", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "css/components/syntax.css", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "2448" }, { "name": "JavaScript", "bytes": "26098" } ], "symlink_target": "" }
 CKEDITOR.plugins.setLang( 'a11yhelp', 'ar', { title: 'Accessibility Instructions', // MISSING contents: 'Help Contents. To close this dialog press ESC.', // MISSING legend: [ { name: 'عام', items: [ { name: 'Editor Toolbar', // MISSING legend: 'Press ${toolbarFocus} to navigate to the toolbar. Move to the next and previous toolbar group with TAB and SHIFT-TAB. Move to the next and previous toolbar button with RIGHT ARROW or LEFT ARROW. Press SPACE or ENTER to activate the toolbar button.' // MISSING }, { name: 'Editor Dialog', // MISSING legend: 'Inside a dialog, press TAB to navigate to next dialog field, press SHIFT + TAB to move to previous field, press ENTER to submit dialog, press ESC to cancel dialog. For dialogs that have multiple tab pages, press ALT + F10 to navigate to tab-list. Then move to next tab with TAB OR RIGTH ARROW. Move to previous tab with SHIFT + TAB or LEFT ARROW. Press SPACE or ENTER to select the tab page.' // MISSING }, { name: 'Editor Context Menu', // MISSING legend: 'Press ${contextMenu} or APPLICATION KEY to open context-menu. Then move to next menu option with TAB or DOWN ARROW. Move to previous option with SHIFT+TAB or UP ARROW. Press SPACE or ENTER to select the menu option. Open sub-menu of current option with SPACE or ENTER or RIGHT ARROW. Go back to parent menu item with ESC or LEFT ARROW. Close context menu with ESC.' // MISSING }, { name: 'Editor List Box', // MISSING legend: 'Inside a list-box, move to next list item with TAB OR DOWN ARROW. Move to previous list item with SHIFT + TAB or UP ARROW. Press SPACE or ENTER to select the list option. Press ESC to close the list-box.' // MISSING }, { name: 'Editor Element Path Bar', // MISSING legend: 'Press ${elementsPathFocus} to navigate to the elements path bar. Move to next element button with TAB or RIGHT ARROW. Move to previous button with SHIFT+TAB or LEFT ARROW. Press SPACE or ENTER to select the element in editor.' // MISSING } ] }, { name: 'Commands', // MISSING items: [ { name: ' Undo command', // MISSING legend: 'Press ${undo}' // MISSING }, { name: ' Redo command', // MISSING legend: 'Press ${redo}' // MISSING }, { name: ' Bold command', // MISSING legend: 'Press ${bold}' // MISSING }, { name: ' Italic command', // MISSING legend: 'Press ${italic}' // MISSING }, { name: ' Underline command', // MISSING legend: 'Press ${underline}' // MISSING }, { name: ' Link command', // MISSING legend: 'Press ${link}' // MISSING }, { name: ' Toolbar Collapse command', // MISSING legend: 'Press ${toolbarCollapse}' // MISSING }, { name: ' Access previous focus space command', // MISSING legend: 'Press ${accessPreviousSpace} to access the closest unreachable focus space before the caret, for example: two adjacent HR elements. Repeat the key combination to reach distant focus spaces.' // MISSING }, { name: ' Access next focus space command', // MISSING legend: 'Press ${accessNextSpace} to access the closest unreachable focus space after the caret, for example: two adjacent HR elements. Repeat the key combination to reach distant focus spaces.' // MISSING }, { name: ' Accessibility Help', // MISSING legend: 'Press ${a11yHelp}' // MISSING } ] } ], backspace: 'Backspace', // MISSING tab: 'Tab', // MISSING enter: 'Enter', // MISSING shift: 'Shift', // MISSING ctrl: 'Ctrl', // MISSING alt: 'Alt', // MISSING pause: 'Pause', // MISSING capslock: 'Caps Lock', // MISSING escape: 'Escape', // MISSING pageUp: 'Page Up', // MISSING pageDown: 'Page Down', // MISSING end: 'End', // MISSING home: 'Home', // MISSING leftArrow: 'Left Arrow', // MISSING upArrow: 'Up Arrow', // MISSING rightArrow: 'Right Arrow', // MISSING downArrow: 'Down Arrow', // MISSING insert: 'Insert', // MISSING 'delete': 'Delete', // MISSING leftWindowKey: 'Left Windows key', // MISSING rightWindowKey: 'Right Windows key', // MISSING selectKey: 'Select key', // MISSING numpad0: 'Numpad 0', // MISSING numpad1: 'Numpad 1', // MISSING numpad2: 'Numpad 2', // MISSING numpad3: 'Numpad 3', // MISSING numpad4: 'Numpad 4', // MISSING numpad5: 'Numpad 5', // MISSING numpad6: 'Numpad 6', // MISSING numpad7: 'Numpad 7', // MISSING numpad8: 'Numpad 8', // MISSING numpad9: 'Numpad 9', // MISSING multiply: 'Multiply', // MISSING add: 'إضافة', subtract: 'Subtract', // MISSING decimalPoint: 'Decimal Point', // MISSING divide: 'تقسيم', f1: 'F1', // MISSING f2: 'F2', // MISSING f3: 'F3', // MISSING f4: 'F4', // MISSING f5: 'F5', // MISSING f6: 'F6', // MISSING f7: 'F7', // MISSING f8: 'F8', // MISSING f9: 'F9', // MISSING f10: 'F10', // MISSING f11: 'F11', // MISSING f12: 'F12', // MISSING numLock: 'Num Lock', // MISSING scrollLock: 'Scroll Lock', // MISSING semiColon: 'Semicolon', // MISSING equalSign: 'Equal Sign', // MISSING comma: 'فاصلة', dash: 'Dash', // MISSING period: 'نقطة', forwardSlash: 'Forward Slash', // MISSING graveAccent: 'Grave Accent', // MISSING openBracket: 'Open Bracket', // MISSING backSlash: 'Backslash', // MISSING closeBracket: 'Close Bracket', // MISSING singleQuote: 'Single Quote' // MISSING } );
{ "content_hash": "6c5c9e55ab7094eb911acc2d916df26f", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 415, "avg_line_length": 37.72222222222222, "alnum_prop": 0.6450662739322534, "repo_name": "swenker/studio", "id": "915ae029d68707b69306b8b0140aecf04d212359", "size": "5618", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "shijing_img/www/ckeditor-std/plugins/a11yhelp/dialogs/lang/ar.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "483" }, { "name": "CSS", "bytes": "467694" }, { "name": "HTML", "bytes": "1298588" }, { "name": "Java", "bytes": "30371" }, { "name": "JavaScript", "bytes": "4682277" }, { "name": "PHP", "bytes": "4431" }, { "name": "Perl", "bytes": "107992" }, { "name": "PowerShell", "bytes": "6661" }, { "name": "Python", "bytes": "209488" }, { "name": "Shell", "bytes": "80342" } ], "symlink_target": "" }
<?xml version="1.0"?> <ruleset name="Banovo"> <rule ref="./SlevomatCodingStandard/ruleset.xml"> <exclude name="SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing"/> <exclude name="SlevomatCodingStandard.Namespaces.UseOnlyWhitelistedNamespaces.NonFullyQualified"/> <exclude name="SlevomatCodingStandard.Namespaces.FullyQualifiedGlobalFunctions.NonFullyQualified"/> <exclude name="SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameInAnnotation.NonFullyQualifiedClassName"/> <exclude name="SlevomatCodingStandard.Files.TypeNameMatchesFileName.NoMatchBetweenTypeNameAndFileName"/> <exclude name="SlevomatCodingStandard.Types.EmptyLinesAroundTypeBraces.NoEmptyLineAfterOpeningBrace"/> <exclude name="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly.ReferenceViaFullyQualifiedName"/> <exclude name="SlevomatCodingStandard.Namespaces.FullyQualifiedExceptions.NonFullyQualifiedException"/> <exclude name="SlevomatCodingStandard.Namespaces.FullyQualifiedGlobalConstants.NonFullyQualified"/> <exclude name="SlevomatCodingStandard.Types.EmptyLinesAroundTypeBraces.NoEmptyLineBeforeClosingBrace"/> <exclude name="SlevomatCodingStandard.Namespaces.UnusedUses.UnusedUse"/> <exclude name="SlevomatCodingStandard.Classes.ClassConstantVisibility.MissingConstantVisibility"/> <exclude name="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingTraversableReturnTypeHintSpecification"/> <exclude name="SlevomatCodingStandard.ControlStructures.DisallowYodaComparison.DisallowedYodaComparison"/> <exclude name="SlevomatCodingStandard.ControlStructures.RequireYodaComparison.RequiredYodaComparison"/> <exclude name="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.UselessDocComment"/> <exclude name="SlevomatCodingStandard.Classes.UnusedPrivateElements.UnusedMethod"/> <exclude name="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingTraversablePropertyTypeHintSpecification"/> <exclude name="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingTraversableParameterTypeHintSpecification"/> </rule> <rule ref="./php5.xml"/> </ruleset>
{ "content_hash": "550075e2b98920833fce92e36b975997", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 127, "avg_line_length": 89.92, "alnum_prop": 0.8131672597864769, "repo_name": "banovo/coding-standards", "id": "3a930118f4db3068764e6f04f46fcc5cea6d650d", "size": "2248", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "rulesets/php7.xml", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "324122" }, { "name": "Shell", "bytes": "6755" } ], "symlink_target": "" }
require 'google/protobuf' require 'google/ads/google_ads/v11/enums/access_role_pb' require 'google/api/field_behavior_pb' require 'google/api/resource_pb' Google::Protobuf::DescriptorPool.generated_pool.build do add_file("google/ads/googleads/v11/resources/customer_user_access.proto", :syntax => :proto3) do add_message "google.ads.googleads.v11.resources.CustomerUserAccess" do optional :resource_name, :string, 1 optional :user_id, :int64, 2 proto3_optional :email_address, :string, 3 optional :access_role, :enum, 4, "google.ads.googleads.v11.enums.AccessRoleEnum.AccessRole" proto3_optional :access_creation_date_time, :string, 6 proto3_optional :inviter_user_email_address, :string, 7 end end end module Google module Ads module GoogleAds module V11 module Resources CustomerUserAccess = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v11.resources.CustomerUserAccess").msgclass end end end end end
{ "content_hash": "6c2c88e948f0ed5bf2e451cb519af894", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 153, "avg_line_length": 34.6, "alnum_prop": 0.7225433526011561, "repo_name": "googleads/google-ads-ruby", "id": "9c1ff74a1d1f39decd61bf5008c230753b955492", "size": "1170", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "lib/google/ads/google_ads/v11/resources/customer_user_access_pb.rb", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "12358" }, { "name": "Ruby", "bytes": "10304247" }, { "name": "Shell", "bytes": "1082" } ], "symlink_target": "" }
Deploy [Rocket.Chat](https://github.com/RocketChat/Rocket.Chat) to Linux that run on systemd (RedHat, Centos, Ubuntu, CoreOS and so on). ## Prerequisite You need to have [docker](https://docs.docker.com/linux/started/) installed. ## How to run Rocket.Chat on systemd 1. Create a docker network `docker network create rocketchat_default` 2. Create two service files: mongo.service and rocketchat.service 3. Enable the service files 4. Run the mongo.service 5. Create the mongo-init-replica to enable opolog 6. Run the rocketchat.service If you reboot the server, the services will start automatically in the right order. ## Service Files mongo.service: ``` [Unit] Description=mongo Requires=docker.service After=docker.service [Service] EnvironmentFile=/etc/environment User=dockeruser Restart=always TimeoutStartSec=0 ExecStartPre=-/usr/bin/docker kill mongo ExecStartPre=-/usr/bin/docker rm mongo ExecStartPre=-/usr/bin/docker pull mongo:3.2 ExecStart=/usr/bin/docker run \ --name mongo \ -v .../path/to/data/db:/data/db \ -v .../path/to/data/dump:/data/dump \ <--optional --net=rocketchat_default \ mongo:3.2 \ mongod --smallfiles --oplogSize 128 --replSet rs0 --storageEngine=mmapv1 ExecStop=-/usr/bin/docker kill mongo ExecStop=-/usr/bin/docker rm mongo ``` rocketchat.service: ``` [Unit] Description=rocketchat Requires=docker.service Requires=mongo.service After=docker.service After=mongo.service [Service] EnvironmentFile=/etc/environment User=dockeruser Restart=always TimeoutStartSec=0 ExecStartPre=-/usr/bin/docker kill rocketchat ExecStartPre=-/usr/bin/docker rm rocketchat ExecStartPre=-/usr/bin/docker pull rocketchat/rocket.chat:latest ExecStart=/usr/bin/docker run \ --name rocketchat \ -v .../path/to/uploads:/app/uploads \ -e MONGO_OPLOG_URL=mongodb://mongo:27017/local \ -e MONGO_URL=mongodb://mongo:27017/rocketchat \ -e ROOT_URL=https://sub.domain.xx \ --link mongo:mongo \ --net=rocketchat_default \ --expose 3000 \ rocketchat/rocket.chat:latest ExecStop=-/usr/bin/docker kill rocketchat ExecStop=-/usr/bin/docker rm rocketchat ``` ## Build the mongo-init-replica container (only run once) Execute: ``` docker run \ --name mongo-init-replica \ --link mongo:mongo \ --rm \ --net=rocketchat_default \ mongo:3.2 \ mongo mongo/rocketchat --eval "rs.initiate({ _id: 'rs0', members: [ { _id: 0, host: 'localhost:27017' } ]})" ``` ## Reverse Proxy If you are running a reverse proxy make sure it is joining the rocketchat_default network. Add `ExecStartPre=-/usr/bin/docker network connect rocketchat_default Nginx` to the rocketchat.service if you Proxy container is named `Nginx` and be sure to configure it correctly. If you choose to use a non-dockerized nginx as a reverse proxy, please not that you then have to add `-p your-host-port:3000` to the `ExecStart` command of `rocketchat.service` and then configure your vhost to pass to `your-host-port`. ## Backup All data will be hourly backed up to `/data/domains/example.org/data` folder. We advise to copy this folder to a remote location in case of hardware failure. ## Questions If you have any questions, don't hesitate to open issues.
{ "content_hash": "902cd8479b07d1236c507fab522f6b52", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 235, "avg_line_length": 29.135135135135137, "alnum_prop": 0.7346938775510204, "repo_name": "RocketChat/Rocket.Chat.Docs", "id": "901d4c31416864375f8b20ea81e384eb6926d8d8", "size": "3249", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "installation/docker-containers/systemd/README.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "6066" }, { "name": "HTML", "bytes": "6879" }, { "name": "JavaScript", "bytes": "7173" }, { "name": "Ruby", "bytes": "7462" }, { "name": "Shell", "bytes": "360" } ], "symlink_target": "" }
package bufplugindocker import ( "encoding/json" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestRegistryAuthMarshalJSON(t *testing.T) { t.Parallel() auth := RegistryAuthConfig{ Username: "someuser", Password: "somepass", Email: "someemail@buf.build", ServerAddress: "plugins.buf.build", } encoded, err := json.Marshal(auth) require.NoError(t, err) var decoded RegistryAuthConfig err = json.Unmarshal(encoded, &decoded) require.NoError(t, err) assert.Equal(t, auth, decoded) } func TestRegistryAuthToFromHeader(t *testing.T) { t.Parallel() auth := RegistryAuthConfig{ Username: "someuser", Password: "somepass", Email: "someemail@buf.build", ServerAddress: "plugins.buf.build", } encoded, err := auth.ToHeader() require.NoError(t, err) var decoded RegistryAuthConfig err = decoded.fromHeader(encoded) require.NoError(t, err) assert.Equal(t, auth, decoded) }
{ "content_hash": "208bf92c0529cd3401e74f2693ac557d", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 49, "avg_line_length": 24, "alnum_prop": 0.7042682926829268, "repo_name": "bufbuild/buf", "id": "65fd157f9b714f20abcb60653dd8d96a5e8c31cf", "size": "1590", "binary": false, "copies": "2", "ref": "refs/heads/main", "path": "private/bufpkg/bufplugin/bufplugindocker/registry_auth_config_test.go", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Go", "bytes": "3243568" }, { "name": "Makefile", "bytes": "29816" }, { "name": "Shell", "bytes": "10085" } ], "symlink_target": "" }
MANILA_SERVICE_SECGROUP="manila-service" NET_ID=$(neutron net-list | grep private | awk '{print $2}') nova --os-username manila --os-tenant-name service --os-password Passw0rd \ boot ws2012r2 --image=ws2012r2_kvm \ --flavor=100 \ --nic net-id=$NET_ID \ --user-data=/home/ubuntu/ssl/winrm_client_cert.pem \ --security-groups $MANILA_SERVICE_SECGROUP \ --poll
{ "content_hash": "6f0245e2d58a8a68d36c32c062dcdea8", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 75, "avg_line_length": 45.9, "alnum_prop": 0.5620915032679739, "repo_name": "herciunichita/manila-ci", "id": "92022a1e03080ee24dee4e44c525af1e4f705d54", "size": "512", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "devstack_vm/bin/create_share_server.sh", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "Python", "bytes": "21784" }, { "name": "Shell", "bytes": "27863" } ], "symlink_target": "" }
using System; using Xamarin.Forms.Platform.iOS; using UIKit; using MediaPlayer; using Xamarin.Forms; using VideoPlayback.Forms; using VideoPlayback.Forms.iOS; using System.ComponentModel; using Foundation; using System.Diagnostics; using CoreGraphics; using AVKit; using AVFoundation; [assembly:ExportRenderer (typeof(MediaView), typeof(MediaViewRenderer))] namespace VideoPlayback.Forms.iOS { /// <summary> /// iOS renderer for the MediaView. Uses AVPlayerViewController. /// </summary> public class MediaViewRenderer : ViewRenderer<MediaView, UIView> { /// <summary> /// Initializes a new instance of the <see cref="VideoPlayback.Forms.iOS.MediaViewRenderer"/> class. /// </summary> public MediaViewRenderer () { } // Used to observe the current player status. IDisposable playerLoadingStateObserver; // The movie player instance. AVPlayerViewController moviePlayer; // A label that shows the loading message. UIView loadingView; // Prevents double-disposing. bool isDisposed = false; /// <summary> /// Gets called if a Xamarin.Forms view wants to use this renderer. /// </summary> /// <param name="e">information about the view that just got connected</param> protected override void OnElementChanged (ElementChangedEventArgs<MediaView> e) { base.OnElementChanged (e); this.RecreateMoviePlayer(null); if (e.OldElement != null) { // Unsubscribe any events and perform other teardown operation from the Forms view if neccessary. It is possible that the same renderer gets reused for a new view. e.OldElement.SizeChanged -= this.OnElementSizeChanged; } if (e.NewElement != null) { // The new Forms view that will be using this renderer. Subscribe events or whatever has to be done. e.NewElement.SizeChanged += this.OnElementSizeChanged; } } /// <summary> /// Gets called by Forms if the size of the view changes. Adjusts the native view's frame. /// </summary> /// <param name="sender">Sender.</param> /// <param name="e">E.</param> void OnElementSizeChanged (object sender, EventArgs e) { var mediaView = sender as MediaView; if(sender != null) { base.Frame = new CGRect(this.Frame.Location, new CGSize(Convert.ToSingle(mediaView.Width), Convert.ToSingle(mediaView.Height))); this.moviePlayer.View.Frame = this.Bounds; this.loadingView.Frame = this.Bounds; } } /// <summary> /// Recreates the movie player instance. /// </summary> void RecreateMoviePlayer(NSUrl contentUrl) { if(this.moviePlayer == null) { this.moviePlayer = new AVPlayerViewController { ShowsPlaybackControls = true }; } if(this.moviePlayer.Player != null) { if(this.playerLoadingStateObserver != null) { this.playerLoadingStateObserver.Dispose(); } this.moviePlayer.Player.Dispose(); this.moviePlayer.Player = null; } if(contentUrl != null) { this.moviePlayer.Player = new AVPlayer(contentUrl); this.playerLoadingStateObserver = this.moviePlayer.Player.AddObserver("status", NSKeyValueObservingOptions.New, change => { Debug.WriteLine("Player state: " + this.moviePlayer.Player.Status); if(this.moviePlayer.Player.Status == AVPlayerStatus.ReadyToPlay) { this.SetNativeControl(this.moviePlayer.View); } }); } // Add the loading view to the movie player's view. this.loadingView = new UILabel(this.moviePlayer.View.Bounds) { AutoresizingMask = UIViewAutoresizing.All, Text = this.Element.Message, Font = UIFont.SystemFontOfSize(40), TextColor = UIColor.Black, BackgroundColor = UIColor.Clear, TextAlignment = UITextAlignment.Center, Hidden = true }; this.SetNativeControl (this.loadingView); // Adjust the size of the native view. this.OnElementSizeChanged(this.Element, null); } /// <summary> /// Gets called if a (bindable) property in the MediaView changes. /// </summary> /// <param name="sender">the MediaView instance</param> /// <param name="e">event arguments</param> protected override void OnElementPropertyChanged (object sender, PropertyChangedEventArgs e) { base.OnElementPropertyChanged (sender, e); // Always update the message - does not hurt. ((UILabel)this.loadingView).Text = this.Element.Message; // If the content URL changes, recreate the player. if (e.PropertyName == "Url") { try { // We must tell the player if it is supposed to play a local file or stream from the web. // Attention: when streaming from the web, the URL must contain an extension or the response header must have a propert content type set, otherwise it won't play. var contentUrl = this.Element.Url.Trim(); Debug.WriteLine("Playing file/url: " + contentUrl); if(contentUrl.ToLower ().StartsWith ("http://", StringComparison.Ordinal) || contentUrl.ToLower ().StartsWith ("https://", StringComparison.Ordinal)) { this.RecreateMoviePlayer( NSUrl.FromString (contentUrl)); } else { this.RecreateMoviePlayer(NSUrl.FromFilename (contentUrl)); } this.loadingView.Hidden = false; if(this.Element.AutoPlay) { this.moviePlayer.Player.Play(); } } catch (Exception ex) { Debug.WriteLine ("Failed to set new media URL to '{0}'. Exception: {1}", this.Element.Url, ex); } } } protected override void Dispose (bool disposing) { if (!this.isDisposed) { if (disposing) { if(this.playerLoadingStateObserver != null) { this.playerLoadingStateObserver.Dispose(); } if (this.moviePlayer != null) { if(this.moviePlayer.Player != null) { this.moviePlayer.Player.Pause (); this.moviePlayer.Player.Dispose(); } this.moviePlayer.Dispose (); this.moviePlayer = null; } if(this.loadingView != null) { this.loadingView.RemoveFromSuperview(); this.loadingView.Dispose(); this.loadingView = null; } } } this.isDisposed = true; base.Dispose (disposing); } } }
{ "content_hash": "5469cfab74b82e4df7ad3ad4f950e91d", "timestamp": "", "source": "github", "line_count": 214, "max_line_length": 167, "avg_line_length": 28.565420560747665, "alnum_prop": 0.6818256175363978, "repo_name": "Krumelur/FormsVideoPlayer", "id": "6437cd8a2de1e198fd24062a6881e30718ce7766", "size": "6115", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "iOS/MediaViewRenderer.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "17846" } ], "symlink_target": "" }
<html> <head> <title>User agent detail - Mozilla/5.0 (NokiaC5-03)UC AppleWebkit(like Gecko) Safari/530</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/css/materialize.min.css"> <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> </head> <body> <div class="container"> <div class="section"> <h1 class="header center orange-text">User agent detail</h1> <div class="row center"> <h5 class="header light"> Mozilla/5.0 (NokiaC5-03)UC AppleWebkit(like Gecko) Safari/530 </h5> </div> </div> <div class="section"> <table class="striped"><tr><th></th><th colspan="3">General</th><th colspan="5">Device</th><th colspan="3">Bot</th><th colspan="2"></th></tr><tr><th>Provider</th><th>Browser</th><th>Engine</th><th>OS</th><th>Brand</th><th>Model</th><th>Type</th><th>Is mobile</th><th>Is touch</th><th>Is bot</th><th>Name</th><th>Type</th><th>Parse time</th><th>Actions</th></tr><tr><th colspan="14" class="green lighten-3">Source result (test suite)</th></tr><tr><td>ua-parser/uap-core<br /><small>vendor/thadafinser/uap-core/tests/test_device.yaml</small></td><td> </td><td> </td><td> </td><td style="border-left: 1px solid #555">Nokia</td><td>C5-03</td><td></td><td></td><td></td><td style="border-left: 1px solid #555"></td><td></td><td></td><td></td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-test">Detail</a> <!-- Modal Structure --> <div id="modal-test" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>Testsuite result detail</h4> <p><pre><code class="php">Array ( [user_agent_string] => Mozilla/5.0 (NokiaC5-03)UC AppleWebkit(like Gecko) Safari/530 [family] => Nokia C5-03 [brand] => Nokia [model] => C5-03 ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><th colspan="14" class="green lighten-3">Providers</th></tr><tr><td>BrowscapPhp<br /><small>6012</small></td><td>Nokia </td><td> </td><td> </td><td style="border-left: 1px solid #555">Nokia</td><td></td><td>Mobile Phone</td><td>yes</td><td></td><td style="border-left: 1px solid #555"></td><td></td><td></td><td>0.03</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-215ac98d-ccf8-4615-916e-5a819d6a59c9">Detail</a> <!-- Modal Structure --> <div id="modal-215ac98d-ccf8-4615-916e-5a819d6a59c9" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>BrowscapPhp result detail</h4> <p><pre><code class="php">stdClass Object ( [browser_name_regex] => /^.*nokia.*$/ [browser_name_pattern] => *nokia* [parent] => Nokia [comment] => Nokia [browser] => Nokia [browser_type] => Browser [browser_bits] => 0 [browser_maker] => Nokia [browser_modus] => unknown [version] => 0.0 [majorver] => 0 [minorver] => 0 [platform] => unknown [platform_version] => unknown [platform_description] => unknown [platform_bits] => 0 [platform_maker] => unknown [alpha] => [beta] => [win16] => [win32] => [win64] => [frames] => 1 [iframes] => 1 [tables] => 1 [cookies] => 1 [backgroundsounds] => [javascript] => 1 [vbscript] => [javaapplets] => [activexcontrols] => [ismobiledevice] => 1 [istablet] => [issyndicationreader] => [crawler] => [cssversion] => 0 [aolversion] => 0 [device_name] => general Mobile Device [device_maker] => Nokia [device_type] => Mobile Phone [device_pointing_method] => unknown [device_code_name] => general Mobile Device [device_brand_name] => Nokia [renderingengine_name] => unknown [renderingengine_version] => unknown [renderingengine_description] => unknown [renderingengine_maker] => unknown ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>DonatjUAParser<br /><small>v0.5.0</small></td><td>Safari 530</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-f1436016-fdf1-4aea-b4be-1d7c99ab0661">Detail</a> <!-- Modal Structure --> <div id="modal-f1436016-fdf1-4aea-b4be-1d7c99ab0661" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>DonatjUAParser result detail</h4> <p><pre><code class="php">Array ( [platform] => [browser] => Safari [version] => 530 ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>NeutrinoApiCom<br /><small></small></td><td>UC Browser </td><td><i class="material-icons">close</i></td><td>Series60 </td><td style="border-left: 1px solid #555">Nokia</td><td>C5-03</td><td>mobile-browser</td><td>yes</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.19902</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-9b0fa449-ec1b-40c8-8b1c-9486eb3b9cbc">Detail</a> <!-- Modal Structure --> <div id="modal-9b0fa449-ec1b-40c8-8b1c-9486eb3b9cbc" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>NeutrinoApiCom result detail</h4> <p><pre><code class="php">stdClass Object ( [mobile_screen_height] => 0 [is_mobile] => 1 [type] => mobile-browser [mobile_brand] => Nokia [mobile_model] => C5-03 [version] => [is_android] => [browser_name] => UC Browser [operating_system_family] => Series60 [operating_system_version] => [is_ios] => [producer] => Nokia [operating_system] => Series60 [mobile_screen_width] => 0 [mobile_browser] => ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>PiwikDeviceDetector<br /><small>3.5.2</small></td><td>Safari </td><td>WebKit </td><td>Symbian </td><td style="border-left: 1px solid #555">Nokia</td><td>C5-03</td><td>smartphone</td><td>yes</td><td></td><td style="border-left: 1px solid #555"></td><td></td><td></td><td>0.004</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-21638055-738d-46ba-a1b1-f5114bc26475">Detail</a> <!-- Modal Structure --> <div id="modal-21638055-738d-46ba-a1b1-f5114bc26475" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>PiwikDeviceDetector result detail</h4> <p><pre><code class="php">Array ( [client] => Array ( [type] => browser [name] => Safari [short_name] => SF [version] => [engine] => WebKit ) [operatingSystem] => Array ( [name] => Symbian [short_name] => SYM [version] => [platform] => ) [device] => Array ( [brand] => NK [brandName] => Nokia [model] => C5-03 [device] => 1 [deviceName] => smartphone ) [bot] => [extra] => Array ( [isBot] => [isBrowser] => 1 [isFeedReader] => [isMobileApp] => [isPIM] => [isLibrary] => [isMediaPlayer] => [isCamera] => [isCarBrowser] => [isConsole] => [isFeaturePhone] => [isPhablet] => [isPortableMediaPlayer] => [isSmartDisplay] => [isSmartphone] => 1 [isTablet] => [isTV] => [isDesktop] => [isMobile] => 1 [isTouchEnabled] => ) ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>SinergiBrowserDetector<br /><small>6.0.0</small></td><td>Nokia Browser 530</td><td><i class="material-icons">close</i></td><td>Nokia </td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td></td><td><i class="material-icons">close</i></td><td>yes</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0.001</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-5415e7f2-ef7b-434c-abe0-b71ba9f6707c">Detail</a> <!-- Modal Structure --> <div id="modal-5415e7f2-ef7b-434c-abe0-b71ba9f6707c" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>SinergiBrowserDetector result detail</h4> <p><pre><code class="php">Array ( [browser] => Sinergi\BrowserDetector\Browser Object ( [userAgent:Sinergi\BrowserDetector\Browser:private] => Sinergi\BrowserDetector\UserAgent Object ( [userAgentString:Sinergi\BrowserDetector\UserAgent:private] => Mozilla/5.0 (NokiaC5-03)UC AppleWebkit(like Gecko) Safari/530 ) [name:Sinergi\BrowserDetector\Browser:private] => Nokia Browser [version:Sinergi\BrowserDetector\Browser:private] => 530 [isRobot:Sinergi\BrowserDetector\Browser:private] => [isChromeFrame:Sinergi\BrowserDetector\Browser:private] => ) [operatingSystem] => Sinergi\BrowserDetector\Os Object ( [name:Sinergi\BrowserDetector\Os:private] => Nokia [version:Sinergi\BrowserDetector\Os:private] => unknown [isMobile:Sinergi\BrowserDetector\Os:private] => 1 [userAgent:Sinergi\BrowserDetector\Os:private] => Sinergi\BrowserDetector\UserAgent Object ( [userAgentString:Sinergi\BrowserDetector\UserAgent:private] => Mozilla/5.0 (NokiaC5-03)UC AppleWebkit(like Gecko) Safari/530 ) ) [device] => Sinergi\BrowserDetector\Device Object ( [name:Sinergi\BrowserDetector\Device:private] => unknown [userAgent:Sinergi\BrowserDetector\Device:private] => Sinergi\BrowserDetector\UserAgent Object ( [userAgentString:Sinergi\BrowserDetector\UserAgent:private] => Mozilla/5.0 (NokiaC5-03)UC AppleWebkit(like Gecko) Safari/530 ) ) ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>UAParser<br /><small>v3.4.5</small></td><td>Safari </td><td><i class="material-icons">close</i></td><td> </td><td style="border-left: 1px solid #555">Nokia</td><td>C5-03</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.003</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-346c1a98-5fd3-454f-b6c8-350f2f505d8b">Detail</a> <!-- Modal Structure --> <div id="modal-346c1a98-5fd3-454f-b6c8-350f2f505d8b" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>UAParser result detail</h4> <p><pre><code class="php">UAParser\Result\Client Object ( [ua] => UAParser\Result\UserAgent Object ( [major] => [minor] => [patch] => [family] => Safari ) [os] => UAParser\Result\OperatingSystem Object ( [major] => [minor] => [patch] => [patchMinor] => [family] => Other ) [device] => UAParser\Result\Device Object ( [brand] => Nokia [model] => C5-03 [family] => Nokia C5-03 ) [originalUserAgent] => Mozilla/5.0 (NokiaC5-03)UC AppleWebkit(like Gecko) Safari/530 ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>UserAgentStringCom<br /><small></small></td><td>Safari </td><td><i class="material-icons">close</i></td><td> </td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td></td><td>0.043</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-9cdd8b45-a2eb-406b-bd27-7e48af38ffd4">Detail</a> <!-- Modal Structure --> <div id="modal-9cdd8b45-a2eb-406b-bd27-7e48af38ffd4" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>UserAgentStringCom result detail</h4> <p><pre><code class="php">stdClass Object ( [agent_type] => Browser [agent_name] => Safari [agent_version] => -- [os_type] => unknown [os_name] => unknown [os_versionName] => [os_versionNumber] => [os_producer] => [os_producerURL] => [linux_distibution] => Null [agent_language] => [agent_languageTag] => ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>WhatIsMyBrowserCom<br /><small></small></td><td>Safari </td><td>WebKit </td><td>NokiaOS </td><td style="border-left: 1px solid #555">Nokia</td><td>Nokia C5-03</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0.40404</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-9795f66f-7271-430e-973a-a5c0e14dc35a">Detail</a> <!-- Modal Structure --> <div id="modal-9795f66f-7271-430e-973a-a5c0e14dc35a" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>WhatIsMyBrowserCom result detail</h4> <p><pre><code class="php">stdClass Object ( [operating_system_name] => NokiaOS [simple_sub_description_string] => [simple_browser_string] => Safari on NokiaOS [browser_version] => [extra_info] => Array ( ) [operating_platform] => Nokia C5-03 [extra_info_table] => Array ( ) [layout_engine_name] => WebKit [detected_addons] => Array ( ) [operating_system_flavour_code] => [hardware_architecture] => [operating_system_flavour] => [operating_system_frameworks] => Array ( ) [browser_name_code] => safari [operating_system_version] => [simple_operating_platform_string] => Nokia C5-03 [is_abusive] => [layout_engine_version] => [browser_capabilities] => Array ( ) [operating_platform_vendor_name] => Nokia [operating_system] => NokiaOS [operating_system_version_full] => [operating_platform_code] => C5-03 [browser_name] => Safari [operating_system_name_code] => nokiaos [user_agent] => Mozilla/5.0 (NokiaC5-03)UC AppleWebkit(like Gecko) Safari/530 [browser_version_full] => [browser] => Safari ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>WhichBrowser<br /><small>2.0.10</small></td><td>UC Browser </td><td>Gecko </td><td>Series60 </td><td style="border-left: 1px solid #555">Nokia</td><td>C5-03</td><td>mobile:smart</td><td>yes</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.005</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-342c8d32-4765-40a8-8a5c-af3a38d19ae4">Detail</a> <!-- Modal Structure --> <div id="modal-342c8d32-4765-40a8-8a5c-af3a38d19ae4" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>WhichBrowser result detail</h4> <p><pre><code class="php">Array ( [browser] => Array ( [name] => UC Browser [type] => browser ) [engine] => Array ( [name] => Gecko ) [os] => Array ( [name] => Series60 [family] => Symbian ) [device] => Array ( [type] => mobile [subtype] => smart [manufacturer] => Nokia [model] => C5-03 ) ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>Woothee<br /><small>v1.2.0</small></td><td>Safari </td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-3f285ff5-314b-4db4-9948-54572e92e7b6">Detail</a> <!-- Modal Structure --> <div id="modal-3f285ff5-314b-4db4-9948-54572e92e7b6" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>Woothee result detail</h4> <p><pre><code class="php">Array ( [name] => Safari [vendor] => Apple [version] => UNKNOWN [category] => UNKNOWN [os] => UNKNOWN [os_version] => UNKNOWN ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>Wurfl<br /><small>1.6.4</small></td><td>Opera 11.10</td><td><i class="material-icons">close</i></td><td>Linux armv6l </td><td style="border-left: 1px solid #555"></td><td></td><td>Feature Phone</td><td>yes</td><td></td><td style="border-left: 1px solid #555"></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0.014</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-1a1aee36-7ce7-4111-a391-8e2c501f1532">Detail</a> <!-- Modal Structure --> <div id="modal-1a1aee36-7ce7-4111-a391-8e2c501f1532" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>Wurfl result detail</h4> <p><pre><code class="php">Array ( [virtual] => Array ( [is_android] => false [is_ios] => false [is_windows_phone] => false [is_app] => false [is_full_desktop] => false [is_largescreen] => false [is_mobile] => true [is_robot] => false [is_smartphone] => false [is_touchscreen] => false [is_wml_preferred] => false [is_xhtmlmp_preferred] => true [is_html_preferred] => false [advertised_device_os] => Linux armv6l [advertised_device_os_version] => [advertised_browser] => Opera [advertised_browser_version] => 11.10 [complete_device_name] => [form_factor] => Feature Phone [is_phone] => true [is_app_webview] => false ) [all] => Array ( [brand_name] => [model_name] => [unique] => true [ununiqueness_handler] => [is_wireless_device] => true [device_claims_web_support] => false [has_qwerty_keyboard] => false [can_skip_aligned_link_row] => false [uaprof] => [uaprof2] => [uaprof3] => [nokia_series] => 0 [nokia_edition] => 0 [device_os] => [mobile_browser] => [mobile_browser_version] => [device_os_version] => [pointing_method] => [release_date] => 2002_january [marketing_name] => [model_extra_info] => [nokia_feature_pack] => 0 [can_assign_phone_number] => true [is_tablet] => false [manufacturer_name] => [is_bot] => false [is_google_glass] => false [proportional_font] => false [built_in_back_button_support] => false [card_title_support] => true [softkey_support] => false [table_support] => true [numbered_menus] => false [menu_with_select_element_recommended] => false [menu_with_list_of_links_recommended] => true [icons_on_menu_items_support] => false [break_list_of_links_with_br_element_recommended] => true [access_key_support] => false [wrap_mode_support] => false [times_square_mode_support] => false [deck_prefetch_support] => false [elective_forms_recommended] => true [wizards_recommended] => false [image_as_link_support] => false [insert_br_element_after_widget_recommended] => false [wml_can_display_images_and_text_on_same_line] => false [wml_displays_image_in_center] => false [opwv_wml_extensions_support] => false [wml_make_phone_call_string] => wtai://wp/mc; [chtml_display_accesskey] => false [emoji] => false [chtml_can_display_images_and_text_on_same_line] => false [chtml_displays_image_in_center] => false [imode_region] => none [chtml_make_phone_call_string] => tel: [chtml_table_support] => false [xhtml_honors_bgcolor] => false [xhtml_supports_forms_in_table] => false [xhtml_support_wml2_namespace] => false [xhtml_autoexpand_select] => false [xhtml_select_as_dropdown] => false [xhtml_select_as_radiobutton] => false [xhtml_select_as_popup] => false [xhtml_display_accesskey] => false [xhtml_supports_invisible_text] => false [xhtml_supports_inline_input] => false [xhtml_supports_monospace_font] => false [xhtml_supports_table_for_layout] => false [xhtml_supports_css_cell_table_coloring] => false [xhtml_format_as_css_property] => false [xhtml_format_as_attribute] => false [xhtml_nowrap_mode] => false [xhtml_marquee_as_css_property] => false [xhtml_readable_background_color1] => #FFFFFF [xhtml_readable_background_color2] => #FFFFFF [xhtml_allows_disabled_form_elements] => false [xhtml_document_title_support] => true [xhtml_preferred_charset] => utf8 [opwv_xhtml_extensions_support] => false [xhtml_make_phone_call_string] => tel: [xhtmlmp_preferred_mime_type] => application/vnd.wap.xhtml+xml [xhtml_table_support] => false [xhtml_send_sms_string] => none [xhtml_send_mms_string] => none [xhtml_file_upload] => not_supported [cookie_support] => true [accept_third_party_cookie] => true [xhtml_supports_iframe] => none [xhtml_avoid_accesskeys] => false [xhtml_can_embed_video] => none [ajax_support_javascript] => false [ajax_manipulate_css] => false [ajax_support_getelementbyid] => false [ajax_support_inner_html] => false [ajax_xhr_type] => none [ajax_manipulate_dom] => false [ajax_support_events] => false [ajax_support_event_listener] => false [ajax_preferred_geoloc_api] => none [xhtml_support_level] => 1 [preferred_markup] => html_wi_oma_xhtmlmp_1_0 [wml_1_1] => true [wml_1_2] => false [wml_1_3] => false [html_wi_w3_xhtmlbasic] => true [html_wi_oma_xhtmlmp_1_0] => true [html_wi_imode_html_1] => false [html_wi_imode_html_2] => false [html_wi_imode_html_3] => false [html_wi_imode_html_4] => false [html_wi_imode_html_5] => false [html_wi_imode_htmlx_1] => false [html_wi_imode_htmlx_1_1] => false [html_wi_imode_compact_generic] => false [html_web_3_2] => false [html_web_4_0] => false [voicexml] => false [multipart_support] => false [total_cache_disable_support] => false [time_to_live_support] => false [resolution_width] => 90 [resolution_height] => 90 [columns] => 11 [max_image_width] => 90 [max_image_height] => 35 [rows] => 6 [physical_screen_width] => 27 [physical_screen_height] => 27 [dual_orientation] => false [density_class] => 1.0 [wbmp] => true [bmp] => false [epoc_bmp] => false [gif_animated] => false [jpg] => false [png] => false [tiff] => false [transparent_png_alpha] => false [transparent_png_index] => false [svgt_1_1] => false [svgt_1_1_plus] => false [greyscale] => false [gif] => true [colors] => 256 [webp_lossy_support] => false [webp_lossless_support] => false [post_method_support] => true [basic_authentication_support] => true [empty_option_value_support] => true [emptyok] => false [nokia_voice_call] => false [wta_voice_call] => false [wta_phonebook] => false [wta_misc] => false [wta_pdc] => false [https_support] => true [phone_id_provided] => false [max_data_rate] => 9 [wifi] => false [sdio] => false [vpn] => false [has_cellular_radio] => true [max_deck_size] => 4000 [max_url_length_in_requests] => 128 [max_url_length_homepage] => 0 [max_url_length_bookmark] => 0 [max_url_length_cached_page] => 0 [max_no_of_connection_settings] => 0 [max_no_of_bookmarks] => 0 [max_length_of_username] => 0 [max_length_of_password] => 0 [max_object_size] => 0 [downloadfun_support] => false [directdownload_support] => false [inline_support] => false [oma_support] => false [ringtone] => false [ringtone_3gpp] => false [ringtone_midi_monophonic] => false [ringtone_midi_polyphonic] => false [ringtone_imelody] => false [ringtone_digiplug] => false [ringtone_compactmidi] => false [ringtone_mmf] => false [ringtone_rmf] => false [ringtone_xmf] => false [ringtone_amr] => false [ringtone_awb] => false [ringtone_aac] => false [ringtone_wav] => false [ringtone_mp3] => false [ringtone_spmidi] => false [ringtone_qcelp] => false [ringtone_voices] => 1 [ringtone_df_size_limit] => 0 [ringtone_directdownload_size_limit] => 0 [ringtone_inline_size_limit] => 0 [ringtone_oma_size_limit] => 0 [wallpaper] => false [wallpaper_max_width] => 0 [wallpaper_max_height] => 0 [wallpaper_preferred_width] => 0 [wallpaper_preferred_height] => 0 [wallpaper_resize] => none [wallpaper_wbmp] => false [wallpaper_bmp] => false [wallpaper_gif] => false [wallpaper_jpg] => false [wallpaper_png] => false [wallpaper_tiff] => false [wallpaper_greyscale] => false [wallpaper_colors] => 2 [wallpaper_df_size_limit] => 0 [wallpaper_directdownload_size_limit] => 0 [wallpaper_inline_size_limit] => 0 [wallpaper_oma_size_limit] => 0 [screensaver] => false [screensaver_max_width] => 0 [screensaver_max_height] => 0 [screensaver_preferred_width] => 0 [screensaver_preferred_height] => 0 [screensaver_resize] => none [screensaver_wbmp] => false [screensaver_bmp] => false [screensaver_gif] => false [screensaver_jpg] => false [screensaver_png] => false [screensaver_greyscale] => false [screensaver_colors] => 2 [screensaver_df_size_limit] => 0 [screensaver_directdownload_size_limit] => 0 [screensaver_inline_size_limit] => 0 [screensaver_oma_size_limit] => 0 [picture] => false [picture_max_width] => 0 [picture_max_height] => 0 [picture_preferred_width] => 0 [picture_preferred_height] => 0 [picture_resize] => none [picture_wbmp] => false [picture_bmp] => false [picture_gif] => false [picture_jpg] => false [picture_png] => false [picture_greyscale] => false [picture_colors] => 2 [picture_df_size_limit] => 0 [picture_directdownload_size_limit] => 0 [picture_inline_size_limit] => 0 [picture_oma_size_limit] => 0 [video] => false [oma_v_1_0_forwardlock] => false [oma_v_1_0_combined_delivery] => false [oma_v_1_0_separate_delivery] => false [streaming_video] => false [streaming_3gpp] => false [streaming_mp4] => false [streaming_mov] => false [streaming_video_size_limit] => 0 [streaming_real_media] => none [streaming_flv] => false [streaming_3g2] => false [streaming_vcodec_h263_0] => -1 [streaming_vcodec_h263_3] => -1 [streaming_vcodec_mpeg4_sp] => -1 [streaming_vcodec_mpeg4_asp] => -1 [streaming_vcodec_h264_bp] => -1 [streaming_acodec_amr] => none [streaming_acodec_aac] => none [streaming_wmv] => none [streaming_preferred_protocol] => rtsp [streaming_preferred_http_protocol] => none [wap_push_support] => false [connectionless_service_indication] => false [connectionless_service_load] => false [connectionless_cache_operation] => false [connectionoriented_unconfirmed_service_indication] => false [connectionoriented_unconfirmed_service_load] => false [connectionoriented_unconfirmed_cache_operation] => false [connectionoriented_confirmed_service_indication] => false [connectionoriented_confirmed_service_load] => false [connectionoriented_confirmed_cache_operation] => false [utf8_support] => false [ascii_support] => false [iso8859_support] => false [expiration_date] => false [j2me_cldc_1_0] => false [j2me_cldc_1_1] => false [j2me_midp_1_0] => false [j2me_midp_2_0] => false [doja_1_0] => false [doja_1_5] => false [doja_2_0] => false [doja_2_1] => false [doja_2_2] => false [doja_3_0] => false [doja_3_5] => false [doja_4_0] => false [j2me_jtwi] => false [j2me_mmapi_1_0] => false [j2me_mmapi_1_1] => false [j2me_wmapi_1_0] => false [j2me_wmapi_1_1] => false [j2me_wmapi_2_0] => false [j2me_btapi] => false [j2me_3dapi] => false [j2me_locapi] => false [j2me_nokia_ui] => false [j2me_motorola_lwt] => false [j2me_siemens_color_game] => false [j2me_siemens_extension] => false [j2me_heap_size] => 0 [j2me_max_jar_size] => 0 [j2me_storage_size] => 0 [j2me_max_record_store_size] => 0 [j2me_screen_width] => 0 [j2me_screen_height] => 0 [j2me_canvas_width] => 0 [j2me_canvas_height] => 0 [j2me_bits_per_pixel] => 0 [j2me_audio_capture_enabled] => false [j2me_video_capture_enabled] => false [j2me_photo_capture_enabled] => false [j2me_capture_image_formats] => none [j2me_http] => false [j2me_https] => false [j2me_socket] => false [j2me_udp] => false [j2me_serial] => false [j2me_gif] => false [j2me_gif89a] => false [j2me_jpg] => false [j2me_png] => false [j2me_bmp] => false [j2me_bmp3] => false [j2me_wbmp] => false [j2me_midi] => false [j2me_wav] => false [j2me_amr] => false [j2me_mp3] => false [j2me_mp4] => false [j2me_imelody] => false [j2me_rmf] => false [j2me_au] => false [j2me_aac] => false [j2me_realaudio] => false [j2me_xmf] => false [j2me_wma] => false [j2me_3gpp] => false [j2me_h263] => false [j2me_svgt] => false [j2me_mpeg4] => false [j2me_realvideo] => false [j2me_real8] => false [j2me_realmedia] => false [j2me_left_softkey_code] => 0 [j2me_right_softkey_code] => 0 [j2me_middle_softkey_code] => 0 [j2me_select_key_code] => 0 [j2me_return_key_code] => 0 [j2me_clear_key_code] => 0 [j2me_datefield_no_accepts_null_date] => false [j2me_datefield_broken] => false [receiver] => false [sender] => false [mms_max_size] => 0 [mms_max_height] => 0 [mms_max_width] => 0 [built_in_recorder] => false [built_in_camera] => false [mms_jpeg_baseline] => false [mms_jpeg_progressive] => false [mms_gif_static] => false [mms_gif_animated] => false [mms_png] => false [mms_bmp] => false [mms_wbmp] => false [mms_amr] => false [mms_wav] => false [mms_midi_monophonic] => false [mms_midi_polyphonic] => false [mms_midi_polyphonic_voices] => 0 [mms_spmidi] => false [mms_mmf] => false [mms_mp3] => false [mms_evrc] => false [mms_qcelp] => false [mms_ota_bitmap] => false [mms_nokia_wallpaper] => false [mms_nokia_operatorlogo] => false [mms_nokia_3dscreensaver] => false [mms_nokia_ringingtone] => false [mms_rmf] => false [mms_xmf] => false [mms_symbian_install] => false [mms_jar] => false [mms_jad] => false [mms_vcard] => false [mms_vcalendar] => false [mms_wml] => false [mms_wbxml] => false [mms_wmlc] => false [mms_video] => false [mms_mp4] => false [mms_3gpp] => false [mms_3gpp2] => false [mms_max_frame_rate] => 0 [nokiaring] => false [picturemessage] => false [operatorlogo] => false [largeoperatorlogo] => false [callericon] => false [nokiavcard] => false [nokiavcal] => false [sckl_ringtone] => false [sckl_operatorlogo] => false [sckl_groupgraphic] => false [sckl_vcard] => false [sckl_vcalendar] => false [text_imelody] => false [ems] => false [ems_variablesizedpictures] => false [ems_imelody] => false [ems_odi] => false [ems_upi] => false [ems_version] => 0 [siemens_ota] => false [siemens_logo_width] => 101 [siemens_logo_height] => 29 [siemens_screensaver_width] => 101 [siemens_screensaver_height] => 50 [gprtf] => false [sagem_v1] => false [sagem_v2] => false [panasonic] => false [sms_enabled] => true [wav] => false [mmf] => false [smf] => false [mld] => false [midi_monophonic] => false [midi_polyphonic] => false [sp_midi] => false [rmf] => false [xmf] => false [compactmidi] => false [digiplug] => false [nokia_ringtone] => false [imelody] => false [au] => false [amr] => false [awb] => false [aac] => false [mp3] => false [voices] => 1 [qcelp] => false [evrc] => false [flash_lite_version] => [fl_wallpaper] => false [fl_screensaver] => false [fl_standalone] => false [fl_browser] => false [fl_sub_lcd] => false [full_flash_support] => false [css_supports_width_as_percentage] => true [css_border_image] => none [css_rounded_corners] => none [css_gradient] => none [css_spriting] => false [css_gradient_linear] => none [is_transcoder] => false [transcoder_ua_header] => user-agent [rss_support] => false [pdf_support] => false [progressive_download] => false [playback_vcodec_h263_0] => -1 [playback_vcodec_h263_3] => -1 [playback_vcodec_mpeg4_sp] => -1 [playback_vcodec_mpeg4_asp] => -1 [playback_vcodec_h264_bp] => -1 [playback_real_media] => none [playback_3gpp] => false [playback_3g2] => false [playback_mp4] => false [playback_mov] => false [playback_acodec_amr] => none [playback_acodec_aac] => none [playback_df_size_limit] => 0 [playback_directdownload_size_limit] => 0 [playback_inline_size_limit] => 0 [playback_oma_size_limit] => 0 [playback_acodec_qcelp] => false [playback_wmv] => none [hinted_progressive_download] => false [html_preferred_dtd] => xhtml_mp1 [viewport_supported] => false [viewport_width] => [viewport_userscalable] => [viewport_initial_scale] => [viewport_maximum_scale] => [viewport_minimum_scale] => [mobileoptimized] => false [handheldfriendly] => false [canvas_support] => none [image_inlining] => false [is_smarttv] => false [is_console] => false [nfc_support] => false [ux_full_desktop] => false [jqm_grade] => none [is_sencha_touch_ok] => false [controlcap_is_smartphone] => default [controlcap_is_ios] => default [controlcap_is_android] => default [controlcap_is_robot] => default [controlcap_is_app] => default [controlcap_advertised_device_os] => default [controlcap_advertised_device_os_version] => default [controlcap_advertised_browser] => default [controlcap_advertised_browser_version] => default [controlcap_is_windows_phone] => default [controlcap_is_full_desktop] => default [controlcap_is_largescreen] => default [controlcap_is_mobile] => default [controlcap_is_touchscreen] => default [controlcap_is_wml_preferred] => default [controlcap_is_xhtmlmp_preferred] => default [controlcap_is_html_preferred] => default [controlcap_form_factor] => default [controlcap_complete_device_name] => default ) ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr></table> </div> <div class="section"> <h1 class="header center orange-text">About this comparison</h1> <div class="row center"> <h5 class="header light"> The primary goal of this project is simple<br /> I wanted to know which user agent parser is the most accurate in each part - device detection, bot detection and so on...<br /> <br /> The secondary goal is to provide a source for all user agent parsers to improve their detection based on this results.<br /> <br /> You can also improve this further, by suggesting ideas at <a href="https://github.com/ThaDafinser/UserAgentParserComparison">ThaDafinser/UserAgentParserComparison</a><br /> <br /> The comparison is based on the abstraction by <a href="https://github.com/ThaDafinser/UserAgentParser">ThaDafinser/UserAgentParser</a> </h5> </div> </div> <div class="card"> <div class="card-content"> Comparison created <i>2016-02-13 13:28:40</i> | by <a href="https://github.com/ThaDafinser">ThaDafinser</a> </div> </div> </div> <script src="https://code.jquery.com/jquery-2.1.4.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/js/materialize.min.js"></script> <script src="http://cdnjs.cloudflare.com/ajax/libs/list.js/1.1.1/list.min.js"></script> <script> $(document).ready(function(){ // the "href" attribute of .modal-trigger must specify the modal ID that wants to be triggered $('.modal-trigger').leanModal(); }); </script> </body> </html>
{ "content_hash": "c9853d4a0f0c64e9b6e62a1454b326fd", "timestamp": "", "source": "github", "line_count": 1121, "max_line_length": 745, "avg_line_length": 40.08206958073149, "alnum_prop": 0.5317591026439954, "repo_name": "ThaDafinser/UserAgentParserComparison", "id": "a93795c9e0f6acd5117004bca3b48c33cd257ba3", "size": "44933", "binary": false, "copies": "1", "ref": "refs/heads/gh-pages", "path": "v4/user-agent-detail/31/09/31095e75-214f-447d-acdf-78f5fd30c33f.html", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "2060859160" } ], "symlink_target": "" }
<?php /** * actions on an individual site * */ use Terminus\Utils; class Site_Command extends Terminus_Command { protected $_headers = array( "environments" => array("Environment","Created", "Locked") ); /** * Invoke `drush` commands on a Pantheon development site * * <commands>... * : The Drush commands you intend to run. * [--<flag>=<value>] * : Additional Drush flag(s) to pass in to the command. */ function __invoke(array $args, array $assoc_args ) { if (empty($args)) { Terminus::error("You need to specify a task to perform and a site on which to perform it."); } else { $this->_handleFuncArg($args, $assoc_args); $this->_handleSiteArg($args, $assoc_args); } $this->_execute($args, $assoc_args); } public function info($args, $assoc_args) { return $this->terminus_request("site", $this->_siteInfo->site_uuid, "", "GET"); } /** * get site state * * @param string $args * @param string $assoc_args * @return array * @author stovak */ public function state($args, $assoc_args) { return $this->terminus_request("site", $this->_siteInfo->site_uuid, "state", "GET"); } /** * List enviroments for a site */ function environments($args, $assoc_args) { $results = $this->terminus_request("site", $this->_siteInfo->site_uuid, "environments", "GET"); $toReturn = array(); foreach ($results['data'] as $key => $value) { $toReturn['data'][] = array( $key, date('jS F Y h:i:s A (T)', $value->environment_created), ( $value->lock->locked ? "Locked" : "Not Locked" ) ); } return $toReturn; } } Terminus::add_command( 'site', 'Site_Command' );
{ "content_hash": "6300a2ea73cc57f065d919c8688cb2a0", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 99, "avg_line_length": 25.63235294117647, "alnum_prop": 0.5840504876649455, "repo_name": "danielbachhuber/cli", "id": "243416e4b97133a9b5d1315e81e46034a8f0093c", "size": "1743", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "php/commands/site.php", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
import os.path as op import numpy as np from numpy.testing import assert_array_equal import pytest from mne import pick_types from mne.utils import run_tests_if_main from mne.datasets import testing from mne.io.tests.test_raw import _test_raw_reader from mne.io.cnt import read_raw_cnt from mne.annotations import read_annotations data_path = testing.data_path(download=False) fname = op.join(data_path, 'CNT', 'scan41_short.cnt') @testing.requires_testing_data def test_data(): """Test reading raw cnt files.""" with pytest.warns(RuntimeWarning, match='number of bytes'): raw = _test_raw_reader(read_raw_cnt, input_fname=fname, eog='auto', misc=['NA1', 'LEFT_EAR']) # make sure we use annotations event if we synthesized stim assert len(raw.annotations) == 6 eog_chs = pick_types(raw.info, eog=True, exclude=[]) assert len(eog_chs) == 2 # test eog='auto' assert raw.info['bads'] == ['LEFT_EAR', 'VEOGR'] # test bads # XXX: the data has "05/10/200 17:35:31" so it is set to None assert raw.info['meas_date'] is None @testing.requires_testing_data def test_compare_events_and_annotations(): """Test comparing annotations and events.""" with pytest.warns(RuntimeWarning, match='Could not parse meas date'): raw = read_raw_cnt(fname) events = np.array([[333, 0, 7], [1010, 0, 7], [1664, 0, 109], [2324, 0, 7], [2984, 0, 109]]) annot = read_annotations(fname) assert len(annot) == 6 assert_array_equal(annot.onset[:-1], events[:, 0] / raw.info['sfreq']) assert 'STI 014' not in raw.info['ch_names'] run_tests_if_main()
{ "content_hash": "08237db17347769fba0b8ab92a02b2e2", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 74, "avg_line_length": 32.698113207547166, "alnum_prop": 0.6306982111944605, "repo_name": "kambysese/mne-python", "id": "c93552fffe99d0974f7a0e8e36e97ef7f7b1f939", "size": "1861", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "mne/io/cnt/tests/test_cnt.py", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Csound Document", "bytes": "69806" }, { "name": "Makefile", "bytes": "3912" }, { "name": "Python", "bytes": "5978369" }, { "name": "Shell", "bytes": "936" } ], "symlink_target": "" }
using System; using System.Collections.Generic; using System.Linq; namespace _03Camel_sBack { class Program { static void Main() { var buildings = Console.ReadLine().Split().Select(int.Parse).ToList(); var camelBack = int.Parse(Console.ReadLine()); int rounds = 0; while (buildings.Count > camelBack) { buildings.RemoveAt(0); buildings.RemoveAt(buildings.Count - 1); rounds++; } if (rounds <= 0) { Console.WriteLine("already stable: {0}", string.Join(" ", buildings)); } if (rounds > 0) { Console.WriteLine("{0} rounds", rounds); Console.WriteLine("remaining: {0}", string.Join(" ", buildings)); } } } }
{ "content_hash": "7dec8e6b0460f931ccc1a8c3051148bf", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 86, "avg_line_length": 28.451612903225808, "alnum_prop": 0.48072562358276644, "repo_name": "Avarea/Programming-Fundamentals", "id": "4de5787f25dc31becb84a7b7a981c54c0c4817f9", "size": "884", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "MoreExercises-Lists/03Camel’sBack/Program.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "811771" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/GreenApp" android:orientation="vertical" > <EditText android:id="@+id/UserEditText" android:layout_width="match_parent" android:layout_height="wrap_content" android:ems="10" android:hint="User" android:lines="1" android:singleLine="true" android:textSize="40sp" > <requestFocus /> </EditText> <RelativeLayout android:id="@+id/RelativeLayout1" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" > <Button android:id="@+id/ExitButton" android:layout_width="390dp" android:layout_height="60dp" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:layout_marginLeft="10dp" android:background="@drawable/button_config" android:text="Exit" android:textColor="@drawable/button_text_color2" android:textSize="30sp" /> <Button android:id="@+id/SendButton" android:layout_width="390dp" android:layout_height="60dp" android:layout_alignParentRight="true" android:layout_alignParentTop="true" android:layout_marginRight="10dp" android:background="@drawable/button_config" android:text="Send" android:textColor="@drawable/button_text_color2" android:textSize="30sp" /> </RelativeLayout> </LinearLayout>
{ "content_hash": "2cc4d5e8558dfe03c06192d975b3cb65", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 72, "avg_line_length": 34.698113207547166, "alnum_prop": 0.5927134312126155, "repo_name": "EverywhereHouseControl/Android-App", "id": "a0f2e0c19ad3e06ee73d334ded8f340bb96d2f5b", "size": "1839", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "EverywhereHouseController/res/layout-xlarge/forgot_password_dialog.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Groovy", "bytes": "816" }, { "name": "Java", "bytes": "1495303" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="generator" content="rustdoc"> <meta name="description" content="API documentation for the Rust `getlogin` fn in crate `libc`."> <meta name="keywords" content="rust, rustlang, rust-lang, getlogin"> <title>libc::getlogin - Rust</title> <link rel="stylesheet" type="text/css" href="../rustdoc.css"> <link rel="stylesheet" type="text/css" href="../main.css"> <link rel="shortcut icon" href="https://doc.rust-lang.org/favicon.ico"> </head> <body class="rustdoc"> <!--[if lte IE 8]> <div class="warning"> This old browser is unsupported and will most likely display funky things. </div> <![endif]--> <nav class="sidebar"> <a href='../libc/index.html'><img src='https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png' alt='logo' width='100'></a> <p class='location'><a href='index.html'>libc</a></p><script>window.sidebarCurrent = {name: 'getlogin', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script> </nav> <nav class="sub"> <form class="search-form js-only"> <div class="search-container"> <input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"> </div> </form> </nav> <section id='main' class="content fn"> <h1 class='fqn'><span class='in-band'><a href='index.html'>libc</a>::<wbr><a class='fn' href=''>getlogin</a></span><span class='out-of-band'><span id='render-detail'> <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> [<span class='inner'>&#x2212;</span>] </a> </span><a id='src-634' class='srclink' href='../src/libc/unix/mod.rs.html#379' title='goto source code'>[src]</a></span></h1> <pre class='rust fn'>pub unsafe extern fn getlogin() -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.pointer.html'>*mut </a><a class='type' href='../libc/type.c_char.html' title='libc::c_char'>c_char</a></pre></section> <section id='search' class="content hidden"></section> <section class="footer"></section> <aside id="help" class="hidden"> <div> <h1 class="hidden">Help</h1> <div class="shortcuts"> <h2>Keyboard Shortcuts</h2> <dl> <dt>?</dt> <dd>Show this help dialog</dd> <dt>S</dt> <dd>Focus the search field</dd> <dt>&larrb;</dt> <dd>Move up in search results</dd> <dt>&rarrb;</dt> <dd>Move down in search results</dd> <dt>&#9166;</dt> <dd>Go to active search result</dd> <dt>+</dt> <dd>Collapse/expand all sections</dd> </dl> </div> <div class="infos"> <h2>Search Tricks</h2> <p> Prefix searches with a type followed by a colon (e.g. <code>fn:</code>) to restrict the search to a given type. </p> <p> Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>. </p> <p> Search functions by type signature (e.g. <code>vec -> usize</code> or <code>* -> vec</code>) </p> </div> </div> </aside> <script> window.rootPath = "../"; window.currentCrate = "libc"; window.playgroundUrl = ""; </script> <script src="../jquery.js"></script> <script src="../main.js"></script> <script defer src="../search-index.js"></script> </body> </html>
{ "content_hash": "6a730ac14e44b8d9add9f3fd7bc901cb", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 252, "avg_line_length": 37.81578947368421, "alnum_prop": 0.5082347483182557, "repo_name": "rxse/rust-markov-text", "id": "5d44942e9632beec6281e472dcdab8f264b84e64", "size": "4321", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/libc/fn.getlogin.html", "mode": "33188", "license": "mit", "language": [ { "name": "Rust", "bytes": "3915" } ], "symlink_target": "" }
"""TestSuite""" import sys from . import case from . import util __unittest = True class BaseTestSuite(object): """A simple test suite that doesn't provide class or module shared fixtures. """ def __init__(self, tests=()): self._tests = [] self.addTests(tests) def __repr__(self): return "<%s tests=%s>" % (util.strclass(self.__class__), list(self)) def __eq__(self, other): if not isinstance(other, self.__class__): return NotImplemented return list(self) == list(other) def __ne__(self, other): return not self == other def __iter__(self): return iter(self._tests) def countTestCases(self): cases = 0 for test in self: cases += test.countTestCases() return cases def addTest(self, test): # sanity checks if not hasattr(test, '__call__'): raise TypeError("{} is not callable".format(repr(test))) if isinstance(test, type) and issubclass(test, (case.TestCase, TestSuite)): raise TypeError("TestCases and TestSuites must be instantiated " "before passing them to addTest()") self._tests.append(test) def addTests(self, tests): if isinstance(tests, str): raise TypeError("tests must be an iterable of tests, not a string") for test in tests: self.addTest(test) def run(self, result): for test in self: if result.shouldStop: break test(result) return result def __call__(self, *args, **kwds): return self.run(*args, **kwds) def debug(self): """Run the tests without collecting errors in a TestResult""" for test in self: test.debug() class TestSuite(BaseTestSuite): """A test suite is a composite test consisting of a number of TestCases. For use, create an instance of TestSuite, then add test case instances. When all tests have been added, the suite can be passed to a test runner, such as TextTestRunner. It will run the individual test cases in the order in which they were added, aggregating the results. When subclassing, do not forget to call the base class constructor. """ def run(self, result, debug=False): topLevel = False if getattr(result, '_testRunEntered', False) is False: result._testRunEntered = topLevel = True for test in self: if result.shouldStop: break if _isnotsuite(test): self._tearDownPreviousClass(test, result) self._handleModuleFixture(test, result) self._handleClassSetUp(test, result) result._previousTestClass = test.__class__ if (getattr(test.__class__, '_classSetupFailed', False) or getattr(result, '_moduleSetUpFailed', False)): continue if not debug: test(result) else: test.debug() if topLevel: self._tearDownPreviousClass(None, result) self._handleModuleTearDown(result) result._testRunEntered = False return result def debug(self): """Run the tests without collecting errors in a TestResult""" debug = _DebugResult() self.run(debug, True) ################################ def _handleClassSetUp(self, test, result): previousClass = getattr(result, '_previousTestClass', None) currentClass = test.__class__ if currentClass == previousClass: return if result._moduleSetUpFailed: return if getattr(currentClass, "__unittest_skip__", False): return try: currentClass._classSetupFailed = False except TypeError: # test may actually be a function # so its class will be a builtin-type pass setUpClass = getattr(currentClass, 'setUpClass', None) if setUpClass is not None: try: setUpClass() except Exception as e: if isinstance(result, _DebugResult): raise currentClass._classSetupFailed = True className = util.strclass(currentClass) errorName = 'setUpClass (%s)' % className self._addClassOrModuleLevelException(result, e, errorName) def _get_previous_module(self, result): previousModule = None previousClass = getattr(result, '_previousTestClass', None) if previousClass is not None: previousModule = previousClass.__module__ return previousModule def _handleModuleFixture(self, test, result): previousModule = self._get_previous_module(result) currentModule = test.__class__.__module__ if currentModule == previousModule: return self._handleModuleTearDown(result) result._moduleSetUpFailed = False try: module = sys.modules[currentModule] except KeyError: return setUpModule = getattr(module, 'setUpModule', None) if setUpModule is not None: try: setUpModule() except Exception as e: if isinstance(result, _DebugResult): raise result._moduleSetUpFailed = True errorName = 'setUpModule (%s)' % currentModule self._addClassOrModuleLevelException(result, e, errorName) def _addClassOrModuleLevelException(self, result, exception, errorName): error = _ErrorHolder(errorName) addSkip = getattr(result, 'addSkip', None) if addSkip is not None and isinstance(exception, case.SkipTest): addSkip(error, str(exception)) else: result.addError(error, sys.exc_info()) def _handleModuleTearDown(self, result): previousModule = self._get_previous_module(result) if previousModule is None: return if result._moduleSetUpFailed: return try: module = sys.modules[previousModule] except KeyError: return tearDownModule = getattr(module, 'tearDownModule', None) if tearDownModule is not None: try: tearDownModule() except Exception as e: if isinstance(result, _DebugResult): raise errorName = 'tearDownModule (%s)' % previousModule self._addClassOrModuleLevelException(result, e, errorName) def _tearDownPreviousClass(self, test, result): previousClass = getattr(result, '_previousTestClass', None) currentClass = test.__class__ if currentClass == previousClass: return if getattr(previousClass, '_classSetupFailed', False): return if getattr(result, '_moduleSetUpFailed', False): return if getattr(previousClass, "__unittest_skip__", False): return tearDownClass = getattr(previousClass, 'tearDownClass', None) if tearDownClass is not None: try: tearDownClass() except Exception as e: if isinstance(result, _DebugResult): raise className = util.strclass(previousClass) errorName = 'tearDownClass (%s)' % className self._addClassOrModuleLevelException(result, e, errorName) class _ErrorHolder(object): """ Placeholder for a TestCase inside a result. As far as a TestResult is concerned, this looks exactly like a unit test. Used to insert arbitrary errors into a test suite run. """ # Inspired by the ErrorHolder from Twisted: # http://twistedmatrix.com/trac/browser/trunk/twisted/trial/runner.py # attribute used by TestResult._exc_info_to_string failureException = None def __init__(self, description): self.description = description def id(self): return self.description def shortDescription(self): return None def __repr__(self): return "<ErrorHolder description=%r>" % (self.description,) def __str__(self): return self.id() def run(self, result): # could call result.addError(...) - but this test-like object # shouldn't be run anyway pass def __call__(self, result): return self.run(result) def countTestCases(self): return 0 def _isnotsuite(test): "A crude way to tell apart testcases and suites with duck-typing" try: iter(test) except TypeError: return True return False class _DebugResult(object): "Used by the TestSuite to hold previous class when running in debug." _previousTestClass = None _moduleSetUpFailed = False shouldStop = False
{ "content_hash": "2635d21720fee1922941228079e19861", "timestamp": "", "source": "github", "line_count": 285, "max_line_length": 80, "avg_line_length": 31.957894736842107, "alnum_prop": 0.5832235397452789, "repo_name": "MalloyPower/parsing-python", "id": "77ce089187305b74630d40b7a0ce75e80ae54aa0", "size": "9108", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "front-end/testsuite-python-lib/Python-3.2/Lib/unittest/suite.py", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "1963" }, { "name": "Lex", "bytes": "238458" }, { "name": "Makefile", "bytes": "4513" }, { "name": "OCaml", "bytes": "412695" }, { "name": "Python", "bytes": "17319" }, { "name": "Rascal", "bytes": "523063" }, { "name": "Yacc", "bytes": "429659" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>mathcomp-real-closed: Not compatible 👼</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.5.0~camlp4 / mathcomp-real-closed - 1.1.2</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> mathcomp-real-closed <small> 1.1.2 <span class="label label-info">Not compatible 👼</span> </small> </h1> <p>📅 <em><script>document.write(moment("2022-06-22 03:35:28 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-06-22 03:35:28 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-num base Num library distributed with the OCaml compiler base-threads base base-unix base camlp4 4.05+1 Camlp4 is a system for writing extensible parsers for programming languages conf-findutils 1 Virtual package relying on findutils coq 8.5.0~camlp4 Formal proof management system num 0 The Num library for arbitrary-precision integer and rational arithmetic ocaml 4.05.0 The OCaml compiler (virtual package) ocaml-base-compiler 4.05.0 Official 4.05.0 release ocaml-config 1 OCaml Switch Configuration ocamlbuild 0.14.1 OCamlbuild is a build system with builtin rules to easily build most OCaml projects # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;Cyril Cohen &lt;cyril.cohen@inria.fr&gt;&quot; homepage: &quot;https://github.com/math-comp/real-closed&quot; dev-repo: &quot;git+https://github.com/math-comp/real-closed.git&quot; bug-reports: &quot;https://github.com/math-comp/real-closed/issues&quot; license: &quot;CECILL-B&quot; synopsis: &quot;Mathematical Components Library on real closed fields&quot; description: &quot;&quot;&quot; This library contains definitions and theorems about real closed fields, with a construction of the real closure and the algebraic closure (including a proof of the fundamental theorem of algebra). It also contains a proof of decidability of the first order theory of real closed field, through quantifier elimination.&quot;&quot;&quot; build: [make &quot;-j%{jobs}%&quot; ] install: [make &quot;install&quot;] depends: [ &quot;coq&quot; { (&gt;= &quot;8.10&quot; &amp; &lt; &quot;8.16~&quot;) | (= &quot;dev&quot;) } &quot;coq-mathcomp-ssreflect&quot; { (&gt;= &quot;1.12.0&quot; &amp; &lt; &quot;1.15~&quot;) | (= &quot;dev&quot;) } &quot;coq-mathcomp-algebra&quot; { (&gt;= &quot;1.12.0&quot; &amp; &lt; &quot;1.15~&quot;) | (= &quot;dev&quot;) } &quot;coq-mathcomp-field&quot; { (&gt;= &quot;1.12.0&quot; &amp; &lt; &quot;1.15~&quot;) | (= &quot;dev&quot;) } &quot;coq-mathcomp-bigenough&quot; {&gt;= &quot;1.0.0&quot;} ] tags: [ &quot;keyword:real closed field&quot; &quot;logpath:mathcomp.real_closed&quot; ] authors: [ &quot;Cyril Cohen&quot; &quot;Assia Mahboubi&quot; ] url { src: &quot;https://github.com/math-comp/real-closed/archive/1.1.2.tar.gz&quot; checksum: &quot;sha256=84e0ddf33dbbc249287dfc8fc7874d433c79cee2b335f32b6476a46a71376892&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install 🏜️</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-mathcomp-real-closed.1.1.2 coq.8.5.0~camlp4</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.5.0~camlp4). The following dependencies couldn&#39;t be met: - coq-mathcomp-real-closed -&gt; coq &gt;= dev no matching version Your request can&#39;t be satisfied: - No available version of coq satisfies the constraints No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-mathcomp-real-closed.1.1.2</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install 🚀</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall 🧹</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣 </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
{ "content_hash": "59e4788023dbacd10c8f1b14fd56d26e", "timestamp": "", "source": "github", "line_count": 176, "max_line_length": 159, "avg_line_length": 43.34090909090909, "alnum_prop": 0.5576822233875197, "repo_name": "coq-bench/coq-bench.github.io", "id": "cecd23cd91f95537a0648f50bd6e67a6aca06b5b", "size": "7653", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clean/Linux-x86_64-4.05.0-2.0.1/released/8.5.0~camlp4/mathcomp-real-closed/1.1.2.html", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
package com.rdecky.asmcalc.lookup; import android.app.SearchManager; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.support.design.widget.FloatingActionButton; import android.support.v4.app.Fragment; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.SearchView; import android.util.Log; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Adapter; import android.widget.CheckBox; import android.widget.FrameLayout; import com.rdecky.asmcalc.R; import com.rdecky.asmcalc.data.DatabaseHelper; import java.util.ArrayList; import java.util.Comparator; import java.util.List; public class LookupFragment extends Fragment implements SearchView.OnQueryTextListener{ private static List<LookupItem> lookupItemList; static RecyclerViewAdapter rvAdapter; private RecyclerView rv; private static DatabaseHelper databaseHelper; private static final Comparator<LookupItem> LOOKUP_ITEM_COMPARATOR = new Comparator<LookupItem>() { @Override public int compare(LookupItem lhs, LookupItem rhs) { return lhs.getText().compareTo(rhs.getText()); } }; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v = inflater.inflate(R.layout.lookup_fragment, container, false); super.onCreate(savedInstanceState); setHasOptionsMenu(true); rv = (RecyclerView) v.findViewById(R.id.my_recycler_view); //RecyclerView should never change size rv.setHasFixedSize(true); //set up a linear LayoutManager for the RecyclerView RecyclerView.LayoutManager rvLayoutManager = new LinearLayoutManager(v.getContext()); rv.setLayoutManager(rvLayoutManager); //set up an adapter for the RecyclerView rvAdapter = new RecyclerViewAdapter(getContext(), LOOKUP_ITEM_COMPARATOR, rv, databaseHelper); rv.setAdapter(rvAdapter); FloatingActionButton fab = (FloatingActionButton) v.findViewById(R.id.new_button); fab.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent intent = new Intent(getActivity(), ItemActivity.class); startActivity(intent); } }); refresh(); return v; } /** * Refresh the list in the RecyclerViewAdapter to mirror what is in the database. */ public static void refresh(){ //ArrayList of objects for the RecyclerView lookupItemList = new ArrayList<>(); List<String[]> items = databaseHelper.selectAll(); Log.d("LookupFragment", "Size: " + items.size()); //clear whatever is currently in the list rvAdapter.clear(); for (int i = 0; i < items.size(); i++){ String[] row = items.get(i); lookupItemList.add(new LookupItem(Integer.parseInt(row[0]), row[1], row[2], row[3], row[4])); } rvAdapter.add(lookupItemList); } public static LookupFragment newInstance(DatabaseHelper dbHelper) { LookupFragment f = new LookupFragment(); databaseHelper = dbHelper; Bundle b = new Bundle(); f.setArguments(b); return f; } @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { // Inflate the menu; this adds items to the action bar if it is present. inflater.inflate(R.menu.lookup_fragment_menu, menu); super.onCreateOptionsMenu(menu, inflater); // Associate searchable configuration with the SearchView SearchManager searchManager = (SearchManager) getActivity().getSystemService(Context.SEARCH_SERVICE); SearchView searchView = (SearchView) menu.findItem(R.id.search).getActionView(); searchView.setSearchableInfo(searchManager.getSearchableInfo(getActivity().getComponentName())); searchView.setOnQueryTextListener(this); } @Override public boolean onQueryTextSubmit(String query) { return false; } @Override public boolean onQueryTextChange(String newText) { refresh(); final List<LookupItem> filteredList = filter(lookupItemList, newText); rvAdapter.replaceAll(filteredList); rv.scrollToPosition(0); return true; } private static List<LookupItem> filter(List<LookupItem> models, String query) { final String lowerCaseQuery = query.toLowerCase(); final List<LookupItem> filteredModelList = new ArrayList<>(); for (LookupItem model : models) { final String text = model.getText().toLowerCase(); if (text.contains(lowerCaseQuery)) { filteredModelList.add(model); } } return filteredModelList; } }
{ "content_hash": "a63a1eafacde8e9159aa98769bfe5713", "timestamp": "", "source": "github", "line_count": 134, "max_line_length": 113, "avg_line_length": 40.42537313432836, "alnum_prop": 0.6413143806534982, "repo_name": "rdeckj/mainframeCalc", "id": "74411c0b5c820db101e4353895275fe166a666f8", "size": "5417", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "app/src/main/java/com/rdecky/asmcalc/lookup/LookupFragment.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "512786" } ], "symlink_target": "" }
#include "libavutil/avassert.h" #include "libavutil/audioconvert.h" #include "audio.h" #include "avfilter.h" #include "internal.h" AVFilterBufferRef *ff_null_get_audio_buffer(AVFilterLink *link, int perms, int nb_samples) { return ff_get_audio_buffer(link->dst->outputs[0], perms, nb_samples); } AVFilterBufferRef *ff_default_get_audio_buffer(AVFilterLink *link, int perms, int nb_samples) { AVFilterBufferRef *samplesref = NULL; uint8_t **data; int planar = av_sample_fmt_is_planar(link->format); int nb_channels = av_get_channel_layout_nb_channels(link->channel_layout); int planes = planar ? nb_channels : 1; int linesize; if (!(data = av_mallocz(sizeof(*data) * planes))) goto fail; if (av_samples_alloc(data, &linesize, nb_channels, nb_samples, link->format, 0) < 0) goto fail; samplesref = avfilter_get_audio_buffer_ref_from_arrays(data, linesize, perms, nb_samples, link->format, link->channel_layout); if (!samplesref) goto fail; av_freep(&data); fail: if (data) av_freep(&data[0]); av_freep(&data); return samplesref; } AVFilterBufferRef *ff_get_audio_buffer(AVFilterLink *link, int perms, int nb_samples) { AVFilterBufferRef *ret = NULL; if (link->dstpad->get_audio_buffer) ret = link->dstpad->get_audio_buffer(link, perms, nb_samples); if (!ret) ret = ff_default_get_audio_buffer(link, perms, nb_samples); if (ret) ret->type = AVMEDIA_TYPE_AUDIO; return ret; } AVFilterBufferRef* avfilter_get_audio_buffer_ref_from_arrays(uint8_t **data, int linesize,int perms, int nb_samples, enum AVSampleFormat sample_fmt, uint64_t channel_layout) { int planes; AVFilterBuffer *samples = av_mallocz(sizeof(*samples)); AVFilterBufferRef *samplesref = av_mallocz(sizeof(*samplesref)); if (!samples || !samplesref) goto fail; samplesref->buf = samples; samplesref->buf->free = ff_avfilter_default_free_buffer; if (!(samplesref->audio = av_mallocz(sizeof(*samplesref->audio)))) goto fail; samplesref->audio->nb_samples = nb_samples; samplesref->audio->channel_layout = channel_layout; planes = av_sample_fmt_is_planar(sample_fmt) ? av_get_channel_layout_nb_channels(channel_layout) : 1; /* make sure the buffer gets read permission or it's useless for output */ samplesref->perms = perms | AV_PERM_READ; samples->refcount = 1; samplesref->type = AVMEDIA_TYPE_AUDIO; samplesref->format = sample_fmt; memcpy(samples->data, data, FFMIN(FF_ARRAY_ELEMS(samples->data), planes)*sizeof(samples->data[0])); memcpy(samplesref->data, samples->data, sizeof(samples->data)); samples->linesize[0] = samplesref->linesize[0] = linesize; if (planes > FF_ARRAY_ELEMS(samples->data)) { samples-> extended_data = av_mallocz(sizeof(*samples->extended_data) * planes); samplesref->extended_data = av_mallocz(sizeof(*samplesref->extended_data) * planes); if (!samples->extended_data || !samplesref->extended_data) goto fail; memcpy(samples-> extended_data, data, sizeof(*data)*planes); memcpy(samplesref->extended_data, data, sizeof(*data)*planes); } else { samples->extended_data = samples->data; samplesref->extended_data = samplesref->data; } samplesref->pts = AV_NOPTS_VALUE; return samplesref; fail: if (samples && samples->extended_data != samples->data) av_freep(&samples->extended_data); if (samplesref) { av_freep(&samplesref->audio); if (samplesref->extended_data != samplesref->data) av_freep(&samplesref->extended_data); } av_freep(&samplesref); av_freep(&samples); return NULL; } void ff_null_filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref) { ff_filter_samples(link->dst->outputs[0], samplesref); } /* FIXME: samplesref is same as link->cur_buf. Need to consider removing the redundant parameter. */ void ff_default_filter_samples(AVFilterLink *inlink, AVFilterBufferRef *samplesref) { AVFilterLink *outlink = NULL; if (inlink->dst->output_count) outlink = inlink->dst->outputs[0]; if (outlink) { outlink->out_buf = ff_default_get_audio_buffer(inlink, AV_PERM_WRITE, samplesref->audio->nb_samples); outlink->out_buf->pts = samplesref->pts; outlink->out_buf->audio->sample_rate = samplesref->audio->sample_rate; ff_filter_samples(outlink, avfilter_ref_buffer(outlink->out_buf, ~0)); avfilter_unref_buffer(outlink->out_buf); outlink->out_buf = NULL; } avfilter_unref_buffer(samplesref); inlink->cur_buf = NULL; } void ff_filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref) { void (*filter_samples)(AVFilterLink *, AVFilterBufferRef *); AVFilterPad *dst = link->dstpad; int64_t pts; FF_DPRINTF_START(NULL, filter_samples); ff_dlog_link(NULL, link, 1); if (!(filter_samples = dst->filter_samples)) filter_samples = ff_default_filter_samples; /* prepare to copy the samples if the buffer has insufficient permissions */ if ((dst->min_perms & samplesref->perms) != dst->min_perms || dst->rej_perms & samplesref->perms) { int i, planar = av_sample_fmt_is_planar(samplesref->format); int planes = !planar ? 1: av_get_channel_layout_nb_channels(samplesref->audio->channel_layout); av_log(link->dst, AV_LOG_DEBUG, "Copying audio data in avfilter (have perms %x, need %x, reject %x)\n", samplesref->perms, link->dstpad->min_perms, link->dstpad->rej_perms); link->cur_buf = ff_default_get_audio_buffer(link, dst->min_perms, samplesref->audio->nb_samples); link->cur_buf->pts = samplesref->pts; link->cur_buf->audio->sample_rate = samplesref->audio->sample_rate; /* Copy actual data into new samples buffer */ for (i = 0; samplesref->data[i] && i < 8; i++) memcpy(link->cur_buf->data[i], samplesref->data[i], samplesref->linesize[0]); for (i = 0; i < planes; i++) memcpy(link->cur_buf->extended_data[i], samplesref->extended_data[i], samplesref->linesize[0]); avfilter_unref_buffer(samplesref); } else link->cur_buf = samplesref; pts = link->cur_buf->pts; filter_samples(link, link->cur_buf); ff_update_link_current_pts(link, pts); }
{ "content_hash": "1fa315f1e45c442df6bbba42024dae30", "timestamp": "", "source": "github", "line_count": 200, "max_line_length": 107, "avg_line_length": 36.215, "alnum_prop": 0.5820792489300014, "repo_name": "stainberg/android_FFMPEG", "id": "0616f97551622d190be059670a6412b81601ae82", "size": "8137", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "jni/libffmpeg/libavfilter/audio.c", "mode": "33188", "license": "mit", "language": [ { "name": "Assembly", "bytes": "1349647" }, { "name": "C", "bytes": "23354469" }, { "name": "C++", "bytes": "1072041" }, { "name": "CSS", "bytes": "18642" }, { "name": "Java", "bytes": "12732" }, { "name": "Objective-C", "bytes": "74127" }, { "name": "Perl", "bytes": "12611" }, { "name": "Shell", "bytes": "38067" }, { "name": "Verilog", "bytes": "2917" } ], "symlink_target": "" }
$: << File.expand_path(File.dirname(__FILE__)) # The Rack main module, serving as a namespace for all core Rack # modules and classes. # # All modules meant for use in your application are <tt>autoload</tt>ed here, # so it should be enough just to <tt>require rack.rb</tt> in your code. module Rack # The Rack protocol version number implemented. VERSION = [0,1] # Return the Rack protocol version as a dotted string. def self.version VERSION.join(".") end # Return the Rack release as a dotted string. def self.release "0.3" end autoload :Builder, "rack/builder" autoload :Cascade, "rack/cascade" autoload :CommonLogger, "rack/commonlogger" autoload :File, "rack/file" autoload :ForwardRequest, "rack/recursive" autoload :Handler, "rack/handler" autoload :Lint, "rack/lint" autoload :Recursive, "rack/recursive" autoload :Reloader, "rack/reloader" autoload :ShowExceptions, "rack/showexceptions" autoload :ShowStatus, "rack/showstatus" autoload :Static, "rack/static" autoload :URLMap, "rack/urlmap" autoload :Utils, "rack/utils" autoload :MockRequest, "rack/mock" autoload :MockResponse, "rack/mock" autoload :Request, "rack/request" autoload :Response, "rack/response" module Auth autoload :Basic, "rack/auth/basic" autoload :AbstractRequest, "rack/auth/abstract/request" autoload :AbstractHandler, "rack/auth/abstract/handler" autoload :OpenID, "rack/auth/openid" module Digest autoload :MD5, "rack/auth/digest/md5" autoload :Nonce, "rack/auth/digest/nonce" autoload :Params, "rack/auth/digest/params" autoload :Request, "rack/auth/digest/request" end end module Session autoload :Cookie, "rack/session/cookie" autoload :Pool, "rack/session/pool" autoload :Memcache, "rack/session/memcache" end # *Adapters* connect Rack with third party web frameworks. # # Rack includes an adapter for Camping, see README for other # frameworks supporting Rack in their code bases. # # Refer to the submodules for framework-specific calling details. module Adapter autoload :Camping, "rack/adapter/camping" end end
{ "content_hash": "56913456aa880ccba87bbe9b678c80ce", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 77, "avg_line_length": 29.243243243243242, "alnum_prop": 0.711645101663586, "repo_name": "chneukirchen/rack-mirror", "id": "2bb483947432813c3b27715a0bdfbb4174e87e0e", "size": "2384", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/rack.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "184716" } ], "symlink_target": "" }
#include "config.h" #include "MainThread.h" #include <wtf/RunLoop.h> namespace WTF { void initializeMainThreadPlatform() { } void scheduleDispatchFunctionsOnMainThread() { RunLoop::main().dispatch(Function<void()>(&dispatchFunctionsFromMainThread)); } }
{ "content_hash": "60f34d9e0b674ba2e378dfb60592ccaf", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 81, "avg_line_length": 13.947368421052632, "alnum_prop": 0.7433962264150943, "repo_name": "gubaojian/trylearn", "id": "b9f33f3da5be3ddca64c10cb2f1b8a253b53812f", "size": "1662", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "WebCore/Source/WTF/wtf/generic/MainThreadGeneric.cpp", "mode": "33188", "license": "mit", "language": [ { "name": "AspectJ", "bytes": "623" }, { "name": "Assembly", "bytes": "1942" }, { "name": "Batchfile", "bytes": "6632" }, { "name": "C", "bytes": "6629351" }, { "name": "C++", "bytes": "57418677" }, { "name": "CMake", "bytes": "1269316" }, { "name": "CSS", "bytes": "99559" }, { "name": "HTML", "bytes": "283332" }, { "name": "Java", "bytes": "267448" }, { "name": "JavaScript", "bytes": "282026" }, { "name": "Makefile", "bytes": "164797" }, { "name": "Objective-C", "bytes": "956074" }, { "name": "Objective-C++", "bytes": "3645713" }, { "name": "Perl", "bytes": "192119" }, { "name": "Python", "bytes": "39191" }, { "name": "Ragel", "bytes": "128173" }, { "name": "Roff", "bytes": "26536" }, { "name": "Ruby", "bytes": "32784" }, { "name": "Shell", "bytes": "7177" }, { "name": "Vue", "bytes": "1776" }, { "name": "Yacc", "bytes": "11866" } ], "symlink_target": "" }
#include "ch.h" #include "hal.h" #include "ch_test.h" /* * This is a periodic thread that does absolutely nothing except flashing LEDs. */ static THD_WORKING_AREA(waThread1, 128); static THD_FUNCTION(Thread1, arg) { (void)arg; chRegSetThreadName("blinker"); while (true) { palClearPad(GPIOC, GPIOC_LED1); chThdSleepMilliseconds(250); palSetPad(GPIOC, GPIOC_LED1); palClearPad(GPIOC, GPIOC_LED2); chThdSleepMilliseconds(250); palSetPad(GPIOC, GPIOC_LED2); palClearPad(GPIOC, GPIOC_LED3); chThdSleepMilliseconds(250); palSetPad(GPIOC, GPIOC_LED3); palClearPad(GPIOC, GPIOC_LED4); chThdSleepMilliseconds(250); palSetPad(GPIOC, GPIOC_LED4); } } /* * Application entry point. */ int main(void) { /* * System initializations. * - HAL initialization, this also initializes the configured device drivers * and performs the board-specific initializations. * - Kernel initialization, the main() function becomes a thread and the * RTOS is active. */ halInit(); chSysInit(); /* * Activates the serial driver 2 using the default configuration, pins * are pre-configured in board.h. */ sdStart(&SD2, NULL); /* * Creates the example thread. */ chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL); /* * Normal main() thread activity, in this demo it does nothing except * sleeping in a loop and check the button state, when the button is * pressed the test procedure is launched. */ while (true) { if (palReadPad(GPIOA, GPIOA_WKUP_BUTTON)) test_execute((BaseSequentialStream *)&SD2); chThdSleepMilliseconds(500); } }
{ "content_hash": "8c2d5cc1d513d3d2ec0d7251d0c4aa76", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 79, "avg_line_length": 24.676470588235293, "alnum_prop": 0.6847437425506555, "repo_name": "netik/dc26_spqr_badge", "id": "fa4572a124298116374c76b7050722dc492b46e9", "size": "2301", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "sw/firmware/ChibiOS/demos/STM32/RT-STM32F373-STM32373C_EVAL/main.c", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "Assembly", "bytes": "479057" }, { "name": "Batchfile", "bytes": "882" }, { "name": "C", "bytes": "109460715" }, { "name": "C++", "bytes": "12411644" }, { "name": "CSS", "bytes": "65072" }, { "name": "Emacs Lisp", "bytes": "1440" }, { "name": "FreeMarker", "bytes": "492261" }, { "name": "HTML", "bytes": "238797" }, { "name": "Makefile", "bytes": "2126450" }, { "name": "Objective-C", "bytes": "7886832" }, { "name": "Perl", "bytes": "10398" }, { "name": "Python", "bytes": "12105" }, { "name": "Roff", "bytes": "3100" }, { "name": "Shell", "bytes": "23449" }, { "name": "Smarty", "bytes": "916" } ], "symlink_target": "" }
package org.zstack.network.service.virtualrouter; import org.zstack.header.query.APIQueryMessage; import org.zstack.header.query.AutoQuery; /** */ @AutoQuery(replyClass = APIQueryVirtualRouterVmReply.class, inventoryClass = VirtualRouterVmInventory.class) public class APIQueryVirtualRouterVmMsg extends APIQueryMessage { }
{ "content_hash": "d35d10d08f8251657b2b482dda80871e", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 108, "avg_line_length": 33.7, "alnum_prop": 0.8100890207715133, "repo_name": "SoftwareKing/zstack", "id": "5324a74c63851d34eda7958c136c5f01f3cd5abd", "size": "337", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "plugin/virtualRouterProvider/src/main/java/org/zstack/network/service/virtualrouter/APIQueryVirtualRouterVmMsg.java", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "AspectJ", "bytes": "49265" }, { "name": "Groovy", "bytes": "16605" }, { "name": "Java", "bytes": "8041121" }, { "name": "Shell", "bytes": "146403" } ], "symlink_target": "" }
// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. /** * PlacementServiceSoapBindingStub.java * * This file was auto-generated from WSDL * by the Apache Axis 1.4 Mar 02, 2009 (07:08:06 PST) WSDL2Java emitter. */ package com.google.api.ads.admanager.axis.v202208; public class PlacementServiceSoapBindingStub extends org.apache.axis.client.Stub implements com.google.api.ads.admanager.axis.v202208.PlacementServiceInterface { private java.util.Vector cachedSerClasses = new java.util.Vector(); private java.util.Vector cachedSerQNames = new java.util.Vector(); private java.util.Vector cachedSerFactories = new java.util.Vector(); private java.util.Vector cachedDeserFactories = new java.util.Vector(); static org.apache.axis.description.OperationDesc [] _operations; static { _operations = new org.apache.axis.description.OperationDesc[4]; _initOperationDesc1(); } private static void _initOperationDesc1(){ org.apache.axis.description.OperationDesc oper; org.apache.axis.description.ParameterDesc param; oper = new org.apache.axis.description.OperationDesc(); oper.setName("createPlacements"); param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "placements"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "Placement"), com.google.api.ads.admanager.axis.v202208.Placement[].class, false, false); param.setOmittable(true); oper.addParameter(param); oper.setReturnType(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "Placement")); oper.setReturnClass(com.google.api.ads.admanager.axis.v202208.Placement[].class); oper.setReturnQName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "rval")); oper.setStyle(org.apache.axis.constants.Style.WRAPPED); oper.setUse(org.apache.axis.constants.Use.LITERAL); oper.addFault(new org.apache.axis.description.FaultDesc( new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "ApiExceptionFault"), "com.google.api.ads.admanager.axis.v202208.ApiException", new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "ApiException"), true )); _operations[0] = oper; oper = new org.apache.axis.description.OperationDesc(); oper.setName("getPlacementsByStatement"); param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "filterStatement"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "Statement"), com.google.api.ads.admanager.axis.v202208.Statement.class, false, false); param.setOmittable(true); oper.addParameter(param); oper.setReturnType(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "PlacementPage")); oper.setReturnClass(com.google.api.ads.admanager.axis.v202208.PlacementPage.class); oper.setReturnQName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "rval")); oper.setStyle(org.apache.axis.constants.Style.WRAPPED); oper.setUse(org.apache.axis.constants.Use.LITERAL); oper.addFault(new org.apache.axis.description.FaultDesc( new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "ApiExceptionFault"), "com.google.api.ads.admanager.axis.v202208.ApiException", new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "ApiException"), true )); _operations[1] = oper; oper = new org.apache.axis.description.OperationDesc(); oper.setName("performPlacementAction"); param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "placementAction"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "PlacementAction"), com.google.api.ads.admanager.axis.v202208.PlacementAction.class, false, false); param.setOmittable(true); oper.addParameter(param); param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "filterStatement"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "Statement"), com.google.api.ads.admanager.axis.v202208.Statement.class, false, false); param.setOmittable(true); oper.addParameter(param); oper.setReturnType(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "UpdateResult")); oper.setReturnClass(com.google.api.ads.admanager.axis.v202208.UpdateResult.class); oper.setReturnQName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "rval")); oper.setStyle(org.apache.axis.constants.Style.WRAPPED); oper.setUse(org.apache.axis.constants.Use.LITERAL); oper.addFault(new org.apache.axis.description.FaultDesc( new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "ApiExceptionFault"), "com.google.api.ads.admanager.axis.v202208.ApiException", new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "ApiException"), true )); _operations[2] = oper; oper = new org.apache.axis.description.OperationDesc(); oper.setName("updatePlacements"); param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "placements"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "Placement"), com.google.api.ads.admanager.axis.v202208.Placement[].class, false, false); param.setOmittable(true); oper.addParameter(param); oper.setReturnType(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "Placement")); oper.setReturnClass(com.google.api.ads.admanager.axis.v202208.Placement[].class); oper.setReturnQName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "rval")); oper.setStyle(org.apache.axis.constants.Style.WRAPPED); oper.setUse(org.apache.axis.constants.Use.LITERAL); oper.addFault(new org.apache.axis.description.FaultDesc( new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "ApiExceptionFault"), "com.google.api.ads.admanager.axis.v202208.ApiException", new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "ApiException"), true )); _operations[3] = oper; } public PlacementServiceSoapBindingStub() throws org.apache.axis.AxisFault { this(null); } public PlacementServiceSoapBindingStub(java.net.URL endpointURL, javax.xml.rpc.Service service) throws org.apache.axis.AxisFault { this(service); super.cachedEndpoint = endpointURL; } public PlacementServiceSoapBindingStub(javax.xml.rpc.Service service) throws org.apache.axis.AxisFault { if (service == null) { super.service = new org.apache.axis.client.Service(); } else { super.service = service; } ((org.apache.axis.client.Service)super.service).setTypeMappingVersion("1.2"); java.lang.Class cls; javax.xml.namespace.QName qName; javax.xml.namespace.QName qName2; java.lang.Class beansf = org.apache.axis.encoding.ser.BeanSerializerFactory.class; java.lang.Class beandf = org.apache.axis.encoding.ser.BeanDeserializerFactory.class; java.lang.Class enumsf = org.apache.axis.encoding.ser.EnumSerializerFactory.class; java.lang.Class enumdf = org.apache.axis.encoding.ser.EnumDeserializerFactory.class; java.lang.Class arraysf = org.apache.axis.encoding.ser.ArraySerializerFactory.class; java.lang.Class arraydf = org.apache.axis.encoding.ser.ArrayDeserializerFactory.class; java.lang.Class simplesf = org.apache.axis.encoding.ser.SimpleSerializerFactory.class; java.lang.Class simpledf = org.apache.axis.encoding.ser.SimpleDeserializerFactory.class; java.lang.Class simplelistsf = org.apache.axis.encoding.ser.SimpleListSerializerFactory.class; java.lang.Class simplelistdf = org.apache.axis.encoding.ser.SimpleListDeserializerFactory.class; qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "ActivatePlacements"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.ActivatePlacements.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "ApiError"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.ApiError.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "ApiException"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.ApiException.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "ApiVersionError"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.ApiVersionError.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "ApiVersionError.Reason"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.ApiVersionErrorReason.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "ApplicationException"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.ApplicationException.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "ArchivePlacements"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.ArchivePlacements.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "AuthenticationError"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.AuthenticationError.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "AuthenticationError.Reason"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.AuthenticationErrorReason.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "BooleanValue"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.BooleanValue.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "CollectionSizeError"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.CollectionSizeError.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "CollectionSizeError.Reason"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.CollectionSizeErrorReason.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "CommonError"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.CommonError.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "CommonError.Reason"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.CommonErrorReason.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "Date"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.Date.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "DateTime"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.DateTime.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "DateTimeValue"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.DateTimeValue.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "DateValue"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.DateValue.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "DeactivatePlacements"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.DeactivatePlacements.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "EntityChildrenLimitReachedError"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.EntityChildrenLimitReachedError.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "EntityChildrenLimitReachedError.Reason"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.EntityChildrenLimitReachedErrorReason.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "EntityLimitReachedError"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.EntityLimitReachedError.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "EntityLimitReachedError.Reason"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.EntityLimitReachedErrorReason.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "FeatureError"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.FeatureError.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "FeatureError.Reason"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.FeatureErrorReason.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "FieldPathElement"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.FieldPathElement.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "InternalApiError"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.InternalApiError.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "InternalApiError.Reason"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.InternalApiErrorReason.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "InventoryStatus"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.InventoryStatus.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "NotNullError"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.NotNullError.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "NotNullError.Reason"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.NotNullErrorReason.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "NullError"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.NullError.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "NullError.Reason"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.NullErrorReason.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "NumberValue"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.NumberValue.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "ObjectValue"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.ObjectValue.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "ParseError"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.ParseError.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "ParseError.Reason"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.ParseErrorReason.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "PermissionError"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.PermissionError.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "PermissionError.Reason"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.PermissionErrorReason.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "Placement"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.Placement.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "PlacementAction"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.PlacementAction.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "PlacementError"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.PlacementError.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "PlacementError.Reason"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.PlacementErrorReason.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "PlacementPage"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.PlacementPage.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "PublisherQueryLanguageContextError"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.PublisherQueryLanguageContextError.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "PublisherQueryLanguageContextError.Reason"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.PublisherQueryLanguageContextErrorReason.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "PublisherQueryLanguageSyntaxError"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.PublisherQueryLanguageSyntaxError.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "PublisherQueryLanguageSyntaxError.Reason"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.PublisherQueryLanguageSyntaxErrorReason.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "QuotaError"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.QuotaError.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "QuotaError.Reason"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.QuotaErrorReason.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "RangeError"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.RangeError.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "RangeError.Reason"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.RangeErrorReason.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "RegExError"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.RegExError.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "RegExError.Reason"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.RegExErrorReason.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "RequiredCollectionError"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.RequiredCollectionError.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "RequiredCollectionError.Reason"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.RequiredCollectionErrorReason.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "RequiredError"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.RequiredError.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "RequiredError.Reason"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.RequiredErrorReason.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "ServerError"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.ServerError.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "ServerError.Reason"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.ServerErrorReason.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "SetValue"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.SetValue.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "SiteTargetingInfo"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.SiteTargetingInfo.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "SoapRequestHeader"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.SoapRequestHeader.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "SoapResponseHeader"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.SoapResponseHeader.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "Statement"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.Statement.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "StatementError"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.StatementError.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "StatementError.Reason"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.StatementErrorReason.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "String_ValueMapEntry"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.String_ValueMapEntry.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "StringFormatError"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.StringFormatError.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "StringFormatError.Reason"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.StringFormatErrorReason.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "StringLengthError"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.StringLengthError.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "StringLengthError.Reason"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.StringLengthErrorReason.class; cachedSerClasses.add(cls); cachedSerFactories.add(enumsf); cachedDeserFactories.add(enumdf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "TextValue"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.TextValue.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "TypeError"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.TypeError.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "UniqueError"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.UniqueError.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "UpdateResult"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.UpdateResult.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "Value"); cachedSerQNames.add(qName); cls = com.google.api.ads.admanager.axis.v202208.Value.class; cachedSerClasses.add(cls); cachedSerFactories.add(beansf); cachedDeserFactories.add(beandf); } protected org.apache.axis.client.Call createCall() throws java.rmi.RemoteException { try { org.apache.axis.client.Call _call = super._createCall(); if (super.maintainSessionSet) { _call.setMaintainSession(super.maintainSession); } if (super.cachedUsername != null) { _call.setUsername(super.cachedUsername); } if (super.cachedPassword != null) { _call.setPassword(super.cachedPassword); } if (super.cachedEndpoint != null) { _call.setTargetEndpointAddress(super.cachedEndpoint); } if (super.cachedTimeout != null) { _call.setTimeout(super.cachedTimeout); } if (super.cachedPortName != null) { _call.setPortName(super.cachedPortName); } java.util.Enumeration keys = super.cachedProperties.keys(); while (keys.hasMoreElements()) { java.lang.String key = (java.lang.String) keys.nextElement(); _call.setProperty(key, super.cachedProperties.get(key)); } // All the type mapping information is registered // when the first call is made. // The type mapping information is actually registered in // the TypeMappingRegistry of the service, which // is the reason why registration is only needed for the first call. synchronized (this) { if (firstCall()) { // must set encoding style before registering serializers _call.setEncodingStyle(null); for (int i = 0; i < cachedSerFactories.size(); ++i) { java.lang.Class cls = (java.lang.Class) cachedSerClasses.get(i); javax.xml.namespace.QName qName = (javax.xml.namespace.QName) cachedSerQNames.get(i); java.lang.Object x = cachedSerFactories.get(i); if (x instanceof Class) { java.lang.Class sf = (java.lang.Class) cachedSerFactories.get(i); java.lang.Class df = (java.lang.Class) cachedDeserFactories.get(i); _call.registerTypeMapping(cls, qName, sf, df, false); } else if (x instanceof javax.xml.rpc.encoding.SerializerFactory) { org.apache.axis.encoding.SerializerFactory sf = (org.apache.axis.encoding.SerializerFactory) cachedSerFactories.get(i); org.apache.axis.encoding.DeserializerFactory df = (org.apache.axis.encoding.DeserializerFactory) cachedDeserFactories.get(i); _call.registerTypeMapping(cls, qName, sf, df, false); } } } } return _call; } catch (java.lang.Throwable _t) { throw new org.apache.axis.AxisFault("Failure trying to get the Call object", _t); } } public com.google.api.ads.admanager.axis.v202208.Placement[] createPlacements(com.google.api.ads.admanager.axis.v202208.Placement[] placements) throws java.rmi.RemoteException, com.google.api.ads.admanager.axis.v202208.ApiException { if (super.cachedEndpoint == null) { throw new org.apache.axis.NoEndPointException(); } org.apache.axis.client.Call _call = createCall(); _call.setOperation(_operations[0]); _call.setUseSOAPAction(true); _call.setSOAPActionURI(""); _call.setEncodingStyle(null); _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); _call.setOperationName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "createPlacements")); setRequestHeaders(_call); setAttachments(_call); try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {placements}); if (_resp instanceof java.rmi.RemoteException) { throw (java.rmi.RemoteException)_resp; } else { extractAttachments(_call); try { return (com.google.api.ads.admanager.axis.v202208.Placement[]) _resp; } catch (java.lang.Exception _exception) { return (com.google.api.ads.admanager.axis.v202208.Placement[]) org.apache.axis.utils.JavaUtils.convert(_resp, com.google.api.ads.admanager.axis.v202208.Placement[].class); } } } catch (org.apache.axis.AxisFault axisFaultException) { if (axisFaultException.detail != null) { if (axisFaultException.detail instanceof java.rmi.RemoteException) { throw (java.rmi.RemoteException) axisFaultException.detail; } if (axisFaultException.detail instanceof com.google.api.ads.admanager.axis.v202208.ApiException) { throw (com.google.api.ads.admanager.axis.v202208.ApiException) axisFaultException.detail; } } throw axisFaultException; } } public com.google.api.ads.admanager.axis.v202208.PlacementPage getPlacementsByStatement(com.google.api.ads.admanager.axis.v202208.Statement filterStatement) throws java.rmi.RemoteException, com.google.api.ads.admanager.axis.v202208.ApiException { if (super.cachedEndpoint == null) { throw new org.apache.axis.NoEndPointException(); } org.apache.axis.client.Call _call = createCall(); _call.setOperation(_operations[1]); _call.setUseSOAPAction(true); _call.setSOAPActionURI(""); _call.setEncodingStyle(null); _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); _call.setOperationName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "getPlacementsByStatement")); setRequestHeaders(_call); setAttachments(_call); try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {filterStatement}); if (_resp instanceof java.rmi.RemoteException) { throw (java.rmi.RemoteException)_resp; } else { extractAttachments(_call); try { return (com.google.api.ads.admanager.axis.v202208.PlacementPage) _resp; } catch (java.lang.Exception _exception) { return (com.google.api.ads.admanager.axis.v202208.PlacementPage) org.apache.axis.utils.JavaUtils.convert(_resp, com.google.api.ads.admanager.axis.v202208.PlacementPage.class); } } } catch (org.apache.axis.AxisFault axisFaultException) { if (axisFaultException.detail != null) { if (axisFaultException.detail instanceof java.rmi.RemoteException) { throw (java.rmi.RemoteException) axisFaultException.detail; } if (axisFaultException.detail instanceof com.google.api.ads.admanager.axis.v202208.ApiException) { throw (com.google.api.ads.admanager.axis.v202208.ApiException) axisFaultException.detail; } } throw axisFaultException; } } public com.google.api.ads.admanager.axis.v202208.UpdateResult performPlacementAction(com.google.api.ads.admanager.axis.v202208.PlacementAction placementAction, com.google.api.ads.admanager.axis.v202208.Statement filterStatement) throws java.rmi.RemoteException, com.google.api.ads.admanager.axis.v202208.ApiException { if (super.cachedEndpoint == null) { throw new org.apache.axis.NoEndPointException(); } org.apache.axis.client.Call _call = createCall(); _call.setOperation(_operations[2]); _call.setUseSOAPAction(true); _call.setSOAPActionURI(""); _call.setEncodingStyle(null); _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); _call.setOperationName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "performPlacementAction")); setRequestHeaders(_call); setAttachments(_call); try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {placementAction, filterStatement}); if (_resp instanceof java.rmi.RemoteException) { throw (java.rmi.RemoteException)_resp; } else { extractAttachments(_call); try { return (com.google.api.ads.admanager.axis.v202208.UpdateResult) _resp; } catch (java.lang.Exception _exception) { return (com.google.api.ads.admanager.axis.v202208.UpdateResult) org.apache.axis.utils.JavaUtils.convert(_resp, com.google.api.ads.admanager.axis.v202208.UpdateResult.class); } } } catch (org.apache.axis.AxisFault axisFaultException) { if (axisFaultException.detail != null) { if (axisFaultException.detail instanceof java.rmi.RemoteException) { throw (java.rmi.RemoteException) axisFaultException.detail; } if (axisFaultException.detail instanceof com.google.api.ads.admanager.axis.v202208.ApiException) { throw (com.google.api.ads.admanager.axis.v202208.ApiException) axisFaultException.detail; } } throw axisFaultException; } } public com.google.api.ads.admanager.axis.v202208.Placement[] updatePlacements(com.google.api.ads.admanager.axis.v202208.Placement[] placements) throws java.rmi.RemoteException, com.google.api.ads.admanager.axis.v202208.ApiException { if (super.cachedEndpoint == null) { throw new org.apache.axis.NoEndPointException(); } org.apache.axis.client.Call _call = createCall(); _call.setOperation(_operations[3]); _call.setUseSOAPAction(true); _call.setSOAPActionURI(""); _call.setEncodingStyle(null); _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); _call.setOperationName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "updatePlacements")); setRequestHeaders(_call); setAttachments(_call); try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {placements}); if (_resp instanceof java.rmi.RemoteException) { throw (java.rmi.RemoteException)_resp; } else { extractAttachments(_call); try { return (com.google.api.ads.admanager.axis.v202208.Placement[]) _resp; } catch (java.lang.Exception _exception) { return (com.google.api.ads.admanager.axis.v202208.Placement[]) org.apache.axis.utils.JavaUtils.convert(_resp, com.google.api.ads.admanager.axis.v202208.Placement[].class); } } } catch (org.apache.axis.AxisFault axisFaultException) { if (axisFaultException.detail != null) { if (axisFaultException.detail instanceof java.rmi.RemoteException) { throw (java.rmi.RemoteException) axisFaultException.detail; } if (axisFaultException.detail instanceof com.google.api.ads.admanager.axis.v202208.ApiException) { throw (com.google.api.ads.admanager.axis.v202208.ApiException) axisFaultException.detail; } } throw axisFaultException; } } }
{ "content_hash": "0b856d86b836a6480d6b6b3089cc0f3f", "timestamp": "", "source": "github", "line_count": 919, "max_line_length": 393, "avg_line_length": 55.88792165397171, "alnum_prop": 0.6561009326142404, "repo_name": "googleads/googleads-java-lib", "id": "26e10fbd166072253c6941abf4cd4b112c4743ae", "size": "51361", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "modules/dfp_axis/src/main/java/com/google/api/ads/admanager/axis/v202208/PlacementServiceSoapBindingStub.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "81068791" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>DocStrap Module: mixins/bussable</title> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/sunlight.default.css"> <link type="text/css" rel="stylesheet" href="styles/site.paper.css"> </head> <body> <div class="navbar navbar-default navbar-fixed-top navbar-inverse"> <div class="container"> <div class="navbar-header"> <a class="navbar-brand" href="index.html">DocStrap</a> </div> <div class="navbar-collapse"> <ul class="nav navbar-nav"> <li class="dropdown"> <a href="modules.list.html" class="dropdown-toggle" data-toggle="dropdown">Modules<b class="caret"></b></a> <ul class="dropdown-menu "> <li><a href="module-base.html">base</a></li><li><a href="module-base_chains.html">base/chains</a></li><li><a href="module-documents_binder.html">documents/binder</a></li><li><a href="module-documents_model.html">documents/model</a></li><li><a href="module-documents_probe.html">documents/probe</a></li><li><a href="module-documents_schema.html">documents/schema</a></li><li><a href="module-ink_collector.html">ink/collector</a></li><li><a href="module-mixins_bussable.html">mixins/bussable</a></li><li><a href="module-mixins_signalable.html">mixins/signalable</a></li><li><a href="module-strings_format.html">strings/format</a></li><li><a href="module-utils_logger.html">utils/logger</a></li> </ul> </li> <li class="dropdown"> <a href="classes.list.html" class="dropdown-toggle" data-toggle="dropdown">Classes<b class="caret"></b></a> <ul class="dropdown-menu "> <li><a href="base.html">base</a></li><li><a href="base_chains.html">base/chains</a></li><li><a href="documents_model.html">documents/model</a></li><li><a href="module-documents_probe.This%252520is%252520not%252520actually%252520a%252520class,%252520but%252520an%252520artifact%252520of%252520the%252520documentation%252520system.html">documents/probe.This is not actually a class, but an artifact of the documentation system</a></li><li><a href="module-ink_collector-ACollector.html">ink/collector~ACollector</a></li><li><a href="module-ink_collector-CollectorBase.html">ink/collector~CollectorBase</a></li><li><a href="module-ink_collector-OCollector.html">ink/collector~OCollector</a></li><li><a href="module-mixins_signalable-Signal.html">mixins/signalable~Signal</a></li><li><a href="utils_logger.Logger.html">utils/logger.Logger</a></li> </ul> </li> <li class="dropdown"> <a href="mixins.list.html" class="dropdown-toggle" data-toggle="dropdown">Mixins<b class="caret"></b></a> <ul class="dropdown-menu "> <li><a href="documents_schema.html">documents/schema</a></li><li><a href="mixins_bussable.html">mixins/bussable</a></li><li><a href="mixins_signalable.html">mixins/signalable</a></li> </ul> </li> <li class="dropdown"> <a href="tutorials.list.html" class="dropdown-toggle" data-toggle="dropdown">Tutorials<b class="caret"></b></a> <ul class="dropdown-menu "> <li><a href="tutorial-Brush Teeth.html">Brush Teeth</a></li><li><a href="tutorial-Drive Car.html">Drive Car</a></li><li><a href="tutorial-Fence Test.html">Fence Test</a></li> </ul> </li> </ul> </div> </div> </div> <div class="container"> <div class="row"> <div class="col-md-8"> <div id="main"> <h1 class="page-title">Module: mixins/bussable</h1> <h1 class="page-title">Module: mixins/bussable</h1> <section> <header> </header> <article> <div class="container-overview"> <div class="description"><p>Provides easy access to the system bus and provides some helper methods for doing so</p></div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="mixins_bussable.js.html">mixins/bussable.js</a>, <a href="mixins_bussable.js.html#sunlight-1-line-2">line 2</a> </li> </ul> </dd> </dl> </div> <h3 class="subsection-title">Requires</h3> <ul> <li>module:postal</li> <li>module:lodash</li> <li><a href="module-base.html">module:base</a></li> </ul> </article> </section> </div> </div> <div class="clearfix"></div> <div class="col-md-3"> <div id="toc" class="col-md-3"></div> </div> </div> </div> <footer> <span class="copyright"> DocStrap Copyright © 2012-2013 The contributors to the JSDoc3 and DocStrap projects. </span> <br /> <span class="jsdoc-message"> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-beta1</a> on Thu Feb 5th 2015 using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. </span> </footer> <!--<script src="scripts/sunlight.js"></script>--> <script src="scripts/docstrap.lib.js"></script> <script src="scripts/bootstrap-dropdown.js"></script> <script src="scripts/toc.js"></script> <script> $( function () { $( "[id*='$']" ).each( function () { var $this = $( this ); $this.attr( "id", $this.attr( "id" ).replace( "$", "__" ) ); } ); $( "#toc" ).toc( { anchorName : function ( i, heading, prefix ) { return $( heading ).attr( "id" ) || ( prefix + i ); }, selectors : "h1,h2,h3,h4", showAndHide : false, scrollTo : "100px" } ); $( "#toc>ul" ).addClass( "nav nav-pills nav-stacked" ); $( "#main span[id^='toc']" ).addClass( "toc-shim" ); $( '.dropdown-toggle' ).dropdown(); // $( ".tutorial-section pre, .readme-section pre" ).addClass( "sunlight-highlight-javascript" ).addClass( "linenums" ); $( ".tutorial-section pre, .readme-section pre" ).each( function () { var $this = $( this ); var example = $this.find( "code" ); exampleText = example.html(); var lang = /{@lang (.*?)}/.exec( exampleText ); if ( lang && lang[1] ) { exampleText = exampleText.replace( lang[0], "" ); example.html( exampleText ); lang = lang[1]; } else { lang = "javascript"; } if ( lang ) { $this .addClass( "sunlight-highlight-" + lang ) .addClass( "linenums" ) .html( example.html() ); } } ); Sunlight.highlightAll( { lineNumbers : true, showMenu : true, enableDoclinks : true } ); } ); </script> <!--Navigation and Symbol Display--> <!--Google Analytics--> </body> </html>
{ "content_hash": "af4e77ed30d6ea1f616dca9d246e05a6", "timestamp": "", "source": "github", "line_count": 272, "max_line_length": 847, "avg_line_length": 24.584558823529413, "alnum_prop": 0.6116345147300732, "repo_name": "labertasch/awesome", "id": "532712bb209a12d410f3a6449ee0822effdaf00a", "size": "6688", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "stream/node_modules/grunt-jsdoc/node_modules/ink-docstrap/themes/paper/module-mixins_bussable.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "2579331" }, { "name": "HTML", "bytes": "172677" }, { "name": "Java", "bytes": "26469" }, { "name": "JavaScript", "bytes": "2286722" }, { "name": "TypeScript", "bytes": "1118" } ], "symlink_target": "" }
""" nlri.py Created by Thomas Mangin on 2012-07-08. Copyright (c) 2009-2015 Exa Networks. All rights reserved. """ from struct import unpack from exabgp.protocol.family import AFI from exabgp.protocol.family import SAFI from exabgp.protocol.ip.address import Address from exabgp.protocol.ip import IP from exabgp.bgp.message import IN from exabgp.bgp.message.notification import Notify from exabgp.bgp.message.update.nlri.cidr import CIDR from exabgp.util.od import od from exabgp.logger import Logger from exabgp.logger import LazyFormat class NLRI (Address): __slots__ = [] EOR = False registered_nlri = dict() logger = None def index (self): return '%s%s%s' % (self.afi,self.safi,self.pack()) # remove this when code restructure is finished def pack (self,addpath=None): raise Exception('unimplemented') @classmethod def register_nlri (cls,afi,safi): cls.registered_nlri['%d/%d' % (afi,safi)] = cls @classmethod def unpack (cls,afi,safi,data,addpath,nexthop,action): if not cls.logger: cls.logger = Logger() cls.logger.parser(LazyFormat("parsing %s/%s nlri payload " % (afi,safi),od,data)) key = '%d/%d' % (afi,safi) if key in cls.registered_nlri: return cls.registered_nlri[key].unpack(afi,safi,data,addpath,nexthop,action) raise Notify(3,0,'trying to decode unknown family %s/%s' % (AFI(afi),SAFI(safi))) @staticmethod def _nlri (afi,safi,bgp,action,addpath): labels = [] rd = '' if addpath: path_identifier = bgp[:4] bgp = bgp[4:] else: path_identifier = None mask = ord(bgp[0]) bgp = bgp[1:] if SAFI(safi).has_label(): while bgp and mask >= 8: label = int(unpack('!L',chr(0) + bgp[:3])[0]) bgp = bgp[3:] mask -= 24 # 3 bytes # The last 4 bits are the bottom of Stack # The last bit is set for the last label labels.append(label>>4) # This is a route withdrawal if label == 0x800000 and action == IN.withdrawn: break # This is a next-hop if label == 0x000000: break if label & 1: break if SAFI(safi).has_rd(): mask -= 8*8 # the 8 bytes of the route distinguisher rd = bgp[:8] bgp = bgp[8:] if mask < 0: raise Notify(3,10,'invalid length in NLRI prefix') if not bgp and mask: raise Notify(3,10,'not enough data for the mask provided to decode the NLRI') size = CIDR.size(mask) if len(bgp) < size: raise Notify(3,10,'could not decode route with AFI %d sand SAFI %d' % (afi,safi)) network,bgp = bgp[:size],bgp[size:] padding = '\0'*(IP.length(afi)-size) prefix = network + padding return labels,rd,path_identifier,mask,size,prefix,bgp
{ "content_hash": "ad294da11a17301e612d11e573834ee3", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 84, "avg_line_length": 25.201923076923077, "alnum_prop": 0.6726440289965662, "repo_name": "lochiiconnectivity/exabgp", "id": "d93cc2cf17e68e38f07c3bc886b555119815eec6", "size": "2639", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/exabgp/bgp/message/update/nlri/nlri.py", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Perl", "bytes": "1516" }, { "name": "Python", "bytes": "1203596" }, { "name": "Shell", "bytes": "17662" } ], "symlink_target": "" }
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE364_Signal_Handler_Race_Condition__basic_01.c Label Definition File: CWE364_Signal_Handler_Race_Condition__basic.label.xml Template File: point-flaw-01.tmpl.c */ /* * @description * CWE: 364 Signal Handler Race Condition * Sinks: * GoodSink: Disable the signal handler while performing non-atomic operations * BadSink : Do not disable the signal handler while performing non-atomic operations * Flow Variant: 01 Baseline * * */ #include "std_testcase.h" #include <signal.h> typedef struct _structSigAtomic { sig_atomic_t val; } structSigAtomic; structSigAtomic *CWE364_Signal_Handler_Race_Condition__basic_01StructSigAtomicBad = NULL; structSigAtomic *CWE364_Signal_Handler_Race_Condition__basic_01StructSigAtomicGood = NULL; static void helperBad(int sig) { if (CWE364_Signal_Handler_Race_Condition__basic_01StructSigAtomicBad != NULL) { CWE364_Signal_Handler_Race_Condition__basic_01StructSigAtomicBad->val = 2; } } static void helperGood(int sig) { if (CWE364_Signal_Handler_Race_Condition__basic_01StructSigAtomicGood != NULL) { CWE364_Signal_Handler_Race_Condition__basic_01StructSigAtomicGood->val = 2; } } #ifndef OMITBAD void CWE364_Signal_Handler_Race_Condition__basic_01_bad() { { structSigAtomic *gStructSigAtomic = NULL; signal(SIGINT, SIG_DFL); if (CWE364_Signal_Handler_Race_Condition__basic_01StructSigAtomicBad != NULL) { free(CWE364_Signal_Handler_Race_Condition__basic_01StructSigAtomicBad); CWE364_Signal_Handler_Race_Condition__basic_01StructSigAtomicBad = NULL; } gStructSigAtomic = (structSigAtomic*)malloc(sizeof(structSigAtomic)); /* INCIDENTAL - No check for NULL on malloc() */ CWE364_Signal_Handler_Race_Condition__basic_01StructSigAtomicBad = gStructSigAtomic; CWE364_Signal_Handler_Race_Condition__basic_01StructSigAtomicBad->val = 1; /* Assign CWE364_Signal_Handler_Race_Condition__basic_01StructSigAtomicBad BEFORE * calling 'signal', because pointer types are not (according to spec), atomic * with respect to signals. * * In practice they are on most (all?) POSIX-y computers, but thems the * rules */ signal(SIGINT, helperBad); /* FLAW: This test, free, and set operation is not atomic, so if signal * delivery occurs (for example) between the free and setting to NULL, * the signal handler could corrupt the heap, cause an access violation, * etc * * Technically, "CWE364_Signal_Handler_Race_Condition__basic_01StructSigAtomicBad = 0" is not atomic on certain theoretical computer * systems that don't actually exist, but this should trigger on * theoretical as well as actual computer systems. */ if (CWE364_Signal_Handler_Race_Condition__basic_01StructSigAtomicBad != NULL) { free(CWE364_Signal_Handler_Race_Condition__basic_01StructSigAtomicBad); CWE364_Signal_Handler_Race_Condition__basic_01StructSigAtomicBad = NULL; } } } #endif /* OMITBAD */ #ifndef OMITGOOD static void good1() { { structSigAtomic *gStructSigAtomic = NULL; signal(SIGINT, SIG_DFL); if (CWE364_Signal_Handler_Race_Condition__basic_01StructSigAtomicGood != NULL) { free(CWE364_Signal_Handler_Race_Condition__basic_01StructSigAtomicGood); CWE364_Signal_Handler_Race_Condition__basic_01StructSigAtomicGood = 0; } gStructSigAtomic = (structSigAtomic*)malloc(sizeof(structSigAtomic)); /* INCIDENTAL - No check for NULL on malloc() */ CWE364_Signal_Handler_Race_Condition__basic_01StructSigAtomicGood = gStructSigAtomic; CWE364_Signal_Handler_Race_Condition__basic_01StructSigAtomicGood->val = 1; /* Assign CWE364_Signal_Handler_Race_Condition__basic_01StructSigAtomicGood BEFORE * calling 'signal', because pointer types are not (according to spec), atomic * with respect to signals. * * In practice they are on most (all?) POSIX-y computers, but thems the * rules */ signal(SIGINT, helperGood); /* FIX: In this instance, the fix is to temporarily disable the signal * handler while performing non-atomic operations. Another way would * be to use sigprocmask or sigvec, or to restructure the signal handler * to operate in a safe manner. */ signal(SIGINT, SIG_DFL); if (CWE364_Signal_Handler_Race_Condition__basic_01StructSigAtomicGood != NULL) { free(CWE364_Signal_Handler_Race_Condition__basic_01StructSigAtomicGood); CWE364_Signal_Handler_Race_Condition__basic_01StructSigAtomicGood = NULL; } signal(SIGINT, helperGood); } } void CWE364_Signal_Handler_Race_Condition__basic_01_good() { good1(); } #endif /* OMITGOOD */ /* Below is the main(). It is only used when building this testcase on its own for testing or for building a binary to use in testing binary analysis tools. It is not used when compiling all the testcases as one application, which is how source code analysis tools are tested. */ #ifdef INCLUDEMAIN int main(int argc, char * argv[]) { /* seed randomness */ srand( (unsigned)time(NULL) ); #ifndef OMITGOOD printLine("Calling good()..."); CWE364_Signal_Handler_Race_Condition__basic_01_good(); printLine("Finished good()"); #endif /* OMITGOOD */ #ifndef OMITBAD printLine("Calling bad()..."); CWE364_Signal_Handler_Race_Condition__basic_01_bad(); printLine("Finished bad()"); #endif /* OMITBAD */ return 0; } #endif
{ "content_hash": "3d72e72265d7c355988023d5a2a69da5", "timestamp": "", "source": "github", "line_count": 157, "max_line_length": 140, "avg_line_length": 37.94904458598726, "alnum_prop": 0.6623027861698556, "repo_name": "maurer/tiamat", "id": "7c6e16d2cc13590c9ae6a21b9ce1b055336f5cc5", "size": "5958", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "samples/Juliet/testcases/CWE364_Signal_Handler_Race_Condition/CWE364_Signal_Handler_Race_Condition__basic_01.c", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
// coding: utf-8 // ---------------------------------------------------------------------------- #include "view_stack.hpp" #include "view.hpp" #include "types.hpp" // ---------------------------------------------------------------------------- xpcc::gui::View::View(xpcc::gui::GuiViewStack* stack, uint8_t identifier, xpcc::gui::Dimension dimension) : AbstractView(stack, identifier), stack(stack), dimension(dimension) { this->display().clear(); } // ---------------------------------------------------------------------------- xpcc::gui::View::~View() { } // ---------------------------------------------------------------------------- void xpcc::gui::View::update() { preUpdate(); InputEvent* ev; xpcc::gui::inputQueue* input_queue = this->stack->getInputQueue(); while(!input_queue->isEmpty()) { // pop input event ev = input_queue->get(); input_queue->pop(); /* Start event handling, go through array in reverse order because * later added (higher index) widgets will be rendered on top of * the other widgets, so they will also catch the input event with * higher precedence. */ for(int16_t i = widgets.getSize()-1; i >= 0; i--) { /* * TODO: implement efficient algorithm here (note: segment tree) */ if((widgets[i])->handleInputEvent(ev)) { /* we found the widget that this event was meant for*/ break; } } // delete InputEvent, we don't need it anymore delete ev; } postUpdate(); } // ---------------------------------------------------------------------------- bool xpcc::gui::View::pack(Widget *w, const xpcc::glcd::Point &coord) { if(coord.x >= this->dimension.width || coord.y >= this->dimension.height || coord.x < 0 || coord.y < 0) { return false; } w->setPosition(coord); // w->setColorPalette(this->colorpalette); this->widgets.append(w); /* Check if there are other widgets on top of this one, 'on top' means * that they were 'packed' later, so they are located at an higher index * in the WidgetContainer this->widgets * */ for(auto iter = widgets.begin(); iter != widgets.end(); ++iter) { // TODO: // this is really ugly and may have quite some perfomance impact when // there are a lot of widgets (*iter)->updateIntersections(&(this->widgets)); } return true; } // ---------------------------------------------------------------------------- void xpcc::gui::View::remove() { this->alive = false; } // ---------------------------------------------------------------------------- void xpcc::gui::View::draw() { // auto display = &this->stack->getDisplay(); for(auto iter = widgets.begin(); iter != widgets.end(); ++iter) { /* Only redraw when widget is dirty */ if((*iter)->isDirty()) { /* draw widget * redrawing widgets on top, that would be overdrawn, is handled * inside Widget::draw() * */ (*iter)->draw(this); } } } // ---------------------------------------------------------------------------- void xpcc::gui::View::setColorPalette(ColorPalette& cp) { this->colorpalette = cp; this->display().setBackgroundColor(cp.getColor(Color::BACKGROUND)); /* * widget specific color palette disabled for now, so this isn't really needed */ this->display().clear(); for(auto iter = widgets.begin(); iter != widgets.end(); ++iter) { (*iter)->setColorPalette(cp); (*iter)->markDirty(); } } void xpcc::gui::View::markDirty() { for(auto iter = widgets.begin(); iter != widgets.end(); ++iter) { (*iter)->markDirty(); } } void xpcc::gui::View::markDrawn() { for(auto iter = widgets.begin(); iter != widgets.end(); ++iter) { (*iter)->markDrawn(); } }
{ "content_hash": "d0710e329ec3256be4f9ab93d5e5b791", "timestamp": "", "source": "github", "line_count": 153, "max_line_length": 107, "avg_line_length": 23.790849673202615, "alnum_prop": 0.528021978021978, "repo_name": "chrism333/xpcc", "id": "2bc054eff483cf6e8abdb0361cc19e6d49a56155", "size": "3873", "binary": false, "copies": "6", "ref": "refs/heads/develop", "path": "src/xpcc/ui/gui/view.cpp", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C", "bytes": "30882959" }, { "name": "C++", "bytes": "3321062" }, { "name": "Gnuplot", "bytes": "823" }, { "name": "Python", "bytes": "175242" }, { "name": "Shell", "bytes": "51" } ], "symlink_target": "" }
package com.blazebit.persistence.view.testsuite.update.entity.mutableonly; import com.blazebit.persistence.testsuite.base.jpa.assertion.AssertStatementBuilder; import com.blazebit.persistence.testsuite.base.jpa.category.NoDatanucleus; import com.blazebit.persistence.testsuite.base.jpa.category.NoEclipselink; import com.blazebit.persistence.testsuite.entity.Document; import com.blazebit.persistence.testsuite.entity.Person; import com.blazebit.persistence.view.FlushMode; import com.blazebit.persistence.view.FlushStrategy; import com.blazebit.persistence.view.testsuite.update.entity.AbstractEntityViewUpdateEntityMapsTest; import com.blazebit.persistence.view.testsuite.update.entity.mutableonly.model.UpdatableDocumentEntityWithMapsView; import org.junit.Test; import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; /** * * @author Christian Beikov * @since 1.2.0 */ @RunWith(Parameterized.class) // NOTE: No Datanucleus support yet @Category({ NoDatanucleus.class, NoEclipselink.class}) public class EntityViewUpdateMutableOnlyEntityMapsTest extends AbstractEntityViewUpdateEntityMapsTest<UpdatableDocumentEntityWithMapsView> { public EntityViewUpdateMutableOnlyEntityMapsTest(FlushMode mode, FlushStrategy strategy, boolean version) { super(mode, strategy, version, UpdatableDocumentEntityWithMapsView.class); } @Test public void testUpdateReplaceCollection() { // Given & When & Then try { replaceCollection(); fail("Expected the setter of a mutable only field to fail!"); } catch (IllegalArgumentException ex) { assertTrue(ex.getMessage().contains("Updating the mutable-only attribute 'contacts'")); } } @Test public void testUpdateAddToCollection() { // Given & When & Then try { addToCollection(); fail("Expected mutating collection operations to fail!"); } catch (UnsupportedOperationException ex) { assertTrue(ex.getMessage().contains("Collection is not updatable")); } } @Test public void testUpdateModifyEntityInCollection() { // Given & When final UpdatableDocumentEntityWithMapsView docView = modifyEntityInCollection(); // Then // Assert that the document and the people are loaded i.e. a full fetch // Since only an existing person was update, only a single update is generated AssertStatementBuilder builder = assertUnorderedQuerySequence(); if (isQueryStrategy()) { builder.select(Person.class); } else { fullFetch(builder); } if (version || isQueryStrategy() && isFullMode()) { versionUpdate(builder); } builder.update(Person.class) .validate(); // Unfortunately, even after an update, we have to reload the entity to merge again AssertStatementBuilder afterBuilder = assertQueriesAfterUpdate(docView); if (isQueryStrategy()) { afterBuilder.select(Person.class); } else { fullFetch(afterBuilder); } if (version || isQueryStrategy() && isFullMode()) { versionUpdate(afterBuilder); } afterBuilder.validate(); assertEquals(doc1.getContacts(), docView.getContacts()); assertEquals("newPerson", p1.getName()); } @Test public void testUpdateSetCollectionToNull() { // Given & When & Then try { setCollectionToNull(); fail("Expected the setter of a mutable only field to fail!"); } catch (IllegalArgumentException ex) { assertTrue(ex.getMessage().contains("Updating the mutable-only attribute 'contacts'")); } } @Test public void testUpdateAddNewEntityToCollection() { // Given & When & Then try { addNewEntityToCollection(); fail("Expected mutating collection operations to fail!"); } catch (UnsupportedOperationException ex) { assertTrue(ex.getMessage().contains("Collection is not updatable")); } } @Override protected AssertStatementBuilder fullFetch(AssertStatementBuilder builder) { return builder.assertSelect() .fetching(Document.class) .fetching(Document.class, "contacts") .fetching(Person.class) .and(); } @Override protected AssertStatementBuilder versionUpdate(AssertStatementBuilder builder) { return builder.update(Document.class); } }
{ "content_hash": "58d1b39d321a756ae2a5fe9e38e8331a", "timestamp": "", "source": "github", "line_count": 130, "max_line_length": 140, "avg_line_length": 36.89230769230769, "alnum_prop": 0.6801501251042535, "repo_name": "Blazebit/blaze-persistence", "id": "ca4e7efd1360e40f34f678da6522580007883f2e", "size": "5396", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "entity-view/testsuite/src/test/java/com/blazebit/persistence/view/testsuite/update/entity/mutableonly/EntityViewUpdateMutableOnlyEntityMapsTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ANTLR", "bytes": "44368" }, { "name": "Batchfile", "bytes": "727" }, { "name": "CSS", "bytes": "85149" }, { "name": "FreeMarker", "bytes": "16964" }, { "name": "HTML", "bytes": "8988" }, { "name": "Java", "bytes": "20068561" }, { "name": "JavaScript", "bytes": "7022" }, { "name": "Shell", "bytes": "12643" } ], "symlink_target": "" }
#include "av1/encoder/encodeframe.h" #include "av1/encoder/encoder.h" #include "av1/encoder/ethread.h" #include "aom_dsp/aom_dsp_common.h" static void accumulate_rd_opt(ThreadData *td, ThreadData *td_t) { for (int i = 0; i < REFERENCE_MODES; i++) td->rd_counts.comp_pred_diff[i] += td_t->rd_counts.comp_pred_diff[i]; for (int i = 0; i < REF_FRAMES; i++) td->rd_counts.global_motion_used[i] += td_t->rd_counts.global_motion_used[i]; td->rd_counts.compound_ref_used_flag |= td_t->rd_counts.compound_ref_used_flag; td->rd_counts.skip_mode_used_flag |= td_t->rd_counts.skip_mode_used_flag; } static int enc_worker_hook(void *arg1, void *unused) { EncWorkerData *const thread_data = (EncWorkerData *)arg1; AV1_COMP *const cpi = thread_data->cpi; const AV1_COMMON *const cm = &cpi->common; const int tile_cols = cm->tile_cols; const int tile_rows = cm->tile_rows; int t; (void)unused; for (t = thread_data->start; t < tile_rows * tile_cols; t += cpi->num_workers) { int tile_row = t / tile_cols; int tile_col = t % tile_cols; av1_encode_tile(cpi, thread_data->td, tile_row, tile_col); } return 1; } static void create_enc_workers(AV1_COMP *cpi, int num_workers) { AV1_COMMON *const cm = &cpi->common; const AVxWorkerInterface *const winterface = aom_get_worker_interface(); CHECK_MEM_ERROR(cm, cpi->workers, aom_malloc(num_workers * sizeof(*cpi->workers))); CHECK_MEM_ERROR(cm, cpi->tile_thr_data, aom_calloc(num_workers, sizeof(*cpi->tile_thr_data))); for (int i = 0; i < num_workers; i++) { AVxWorker *const worker = &cpi->workers[i]; EncWorkerData *const thread_data = &cpi->tile_thr_data[i]; ++cpi->num_workers; winterface->init(worker); worker->thread_name = "aom enc worker"; thread_data->cpi = cpi; if (i < num_workers - 1) { // Allocate thread data. CHECK_MEM_ERROR(cm, thread_data->td, aom_memalign(32, sizeof(*thread_data->td))); av1_zero(*thread_data->td); // Set up pc_tree. thread_data->td->pc_tree = NULL; av1_setup_pc_tree(cm, thread_data->td); CHECK_MEM_ERROR(cm, thread_data->td->above_pred_buf, (uint8_t *)aom_memalign( 16, MAX_MB_PLANE * MAX_SB_SQUARE * sizeof(*thread_data->td->above_pred_buf))); CHECK_MEM_ERROR(cm, thread_data->td->left_pred_buf, (uint8_t *)aom_memalign( 16, MAX_MB_PLANE * MAX_SB_SQUARE * sizeof(*thread_data->td->left_pred_buf))); CHECK_MEM_ERROR( cm, thread_data->td->wsrc_buf, (int32_t *)aom_memalign( 16, MAX_SB_SQUARE * sizeof(*thread_data->td->wsrc_buf))); for (int x = 0; x < 2; x++) for (int y = 0; y < 2; y++) CHECK_MEM_ERROR( cm, thread_data->td->hash_value_buffer[x][y], (uint32_t *)aom_malloc( AOM_BUFFER_SIZE_FOR_BLOCK_HASH * sizeof(*thread_data->td->hash_value_buffer[0][0]))); CHECK_MEM_ERROR( cm, thread_data->td->mask_buf, (int32_t *)aom_memalign( 16, MAX_SB_SQUARE * sizeof(*thread_data->td->mask_buf))); // Allocate frame counters in thread data. CHECK_MEM_ERROR(cm, thread_data->td->counts, aom_calloc(1, sizeof(*thread_data->td->counts))); // Allocate buffers used by palette coding mode. CHECK_MEM_ERROR( cm, thread_data->td->palette_buffer, aom_memalign(16, sizeof(*thread_data->td->palette_buffer))); CHECK_MEM_ERROR( cm, thread_data->td->tmp_conv_dst, aom_memalign(32, MAX_SB_SIZE * MAX_SB_SIZE * sizeof(*thread_data->td->tmp_conv_dst))); for (int j = 0; j < 2; ++j) { CHECK_MEM_ERROR( cm, thread_data->td->tmp_obmc_bufs[j], aom_memalign(16, 2 * MAX_MB_PLANE * MAX_SB_SQUARE * sizeof(*thread_data->td->tmp_obmc_bufs[j]))); } // Create threads if (!winterface->reset(worker)) aom_internal_error(&cm->error, AOM_CODEC_ERROR, "Tile encoder thread creation failed"); } else { // Main thread acts as a worker and uses the thread data in cpi. thread_data->td = &cpi->td; } winterface->sync(worker); } } static void launch_enc_workers(AV1_COMP *cpi, int num_workers) { const AVxWorkerInterface *const winterface = aom_get_worker_interface(); // Encode a frame for (int i = 0; i < num_workers; i++) { AVxWorker *const worker = &cpi->workers[i]; EncWorkerData *const thread_data = (EncWorkerData *)worker->data1; // Set the starting tile for each thread. thread_data->start = i; if (i == cpi->num_workers - 1) winterface->execute(worker); else winterface->launch(worker); } } static void sync_enc_workers(AV1_COMP *cpi, int num_workers) { const AVxWorkerInterface *const winterface = aom_get_worker_interface(); // Encoding ends. for (int i = 0; i < num_workers; i++) { AVxWorker *const worker = &cpi->workers[i]; winterface->sync(worker); } } static void accumulate_counters_enc_workers(AV1_COMP *cpi, int num_workers) { for (int i = 0; i < num_workers; i++) { AVxWorker *const worker = &cpi->workers[i]; EncWorkerData *const thread_data = (EncWorkerData *)worker->data1; cpi->intrabc_used |= thread_data->td->intrabc_used_this_tile; // Accumulate counters. if (i < cpi->num_workers - 1) { av1_accumulate_frame_counts(&cpi->counts, thread_data->td->counts); accumulate_rd_opt(&cpi->td, thread_data->td); cpi->td.mb.txb_split_count += thread_data->td->mb.txb_split_count; } } } static void prepare_enc_workers(AV1_COMP *cpi, AVxWorkerHook hook, int num_workers) { for (int i = 0; i < num_workers; i++) { AVxWorker *const worker = &cpi->workers[i]; EncWorkerData *const thread_data = &cpi->tile_thr_data[i]; worker->hook = hook; worker->data1 = thread_data; worker->data2 = NULL; // Before encoding a frame, copy the thread data from cpi. if (thread_data->td != &cpi->td) { thread_data->td->mb = cpi->td.mb; thread_data->td->rd_counts = cpi->td.rd_counts; thread_data->td->mb.above_pred_buf = thread_data->td->above_pred_buf; thread_data->td->mb.left_pred_buf = thread_data->td->left_pred_buf; thread_data->td->mb.wsrc_buf = thread_data->td->wsrc_buf; for (int x = 0; x < 2; x++) { for (int y = 0; y < 2; y++) { memcpy(thread_data->td->hash_value_buffer[x][y], cpi->td.mb.hash_value_buffer[x][y], AOM_BUFFER_SIZE_FOR_BLOCK_HASH * sizeof(*thread_data->td->hash_value_buffer[0][0])); thread_data->td->mb.hash_value_buffer[x][y] = thread_data->td->hash_value_buffer[x][y]; } } thread_data->td->mb.mask_buf = thread_data->td->mask_buf; } if (thread_data->td->counts != &cpi->counts) { memcpy(thread_data->td->counts, &cpi->counts, sizeof(cpi->counts)); } if (i < num_workers - 1) { thread_data->td->mb.palette_buffer = thread_data->td->palette_buffer; thread_data->td->mb.tmp_conv_dst = thread_data->td->tmp_conv_dst; for (int j = 0; j < 2; ++j) { thread_data->td->mb.tmp_obmc_bufs[j] = thread_data->td->tmp_obmc_bufs[j]; } thread_data->td->mb.e_mbd.tmp_conv_dst = thread_data->td->mb.tmp_conv_dst; for (int j = 0; j < 2; ++j) { thread_data->td->mb.e_mbd.tmp_obmc_bufs[j] = thread_data->td->mb.tmp_obmc_bufs[j]; } } } } void av1_encode_tiles_mt(AV1_COMP *cpi) { AV1_COMMON *const cm = &cpi->common; const int tile_cols = cm->tile_cols; const int tile_rows = cm->tile_rows; int num_workers = AOMMIN(cpi->oxcf.max_threads, tile_cols * tile_rows); if (cpi->tile_data == NULL || cpi->allocated_tiles < tile_cols * tile_rows) av1_alloc_tile_data(cpi); av1_init_tile_data(cpi); // Only run once to create threads and allocate thread data. if (cpi->num_workers == 0) { create_enc_workers(cpi, num_workers); } else { num_workers = AOMMIN(num_workers, cpi->num_workers); } prepare_enc_workers(cpi, enc_worker_hook, num_workers); launch_enc_workers(cpi, num_workers); sync_enc_workers(cpi, num_workers); accumulate_counters_enc_workers(cpi, num_workers); } // Accumulate frame counts. FRAME_COUNTS consist solely of 'unsigned int' // members, so we treat it as an array, and sum over the whole length. void av1_accumulate_frame_counts(FRAME_COUNTS *acc_counts, const FRAME_COUNTS *counts) { unsigned int *const acc = (unsigned int *)acc_counts; const unsigned int *const cnt = (const unsigned int *)counts; const unsigned int n_counts = sizeof(FRAME_COUNTS) / sizeof(unsigned int); for (unsigned int i = 0; i < n_counts; i++) acc[i] += cnt[i]; }
{ "content_hash": "a4175913b400a8dc8c271d04eb0f2c7e", "timestamp": "", "source": "github", "line_count": 253, "max_line_length": 80, "avg_line_length": 36.17786561264822, "alnum_prop": 0.5868021413744128, "repo_name": "GrokImageCompression/aom", "id": "4aae86815e0e0a4c5c3aba65905a547e20e64d8e", "size": "9681", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "av1/encoder/ethread.c", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "Assembly", "bytes": "663387" }, { "name": "C", "bytes": "11856562" }, { "name": "C++", "bytes": "1731046" }, { "name": "CMake", "bytes": "203322" }, { "name": "Makefile", "bytes": "122220" }, { "name": "Objective-C", "bytes": "398959" }, { "name": "Perl", "bytes": "73243" }, { "name": "Perl 6", "bytes": "101675" }, { "name": "Python", "bytes": "5034" }, { "name": "Shell", "bytes": "128937" } ], "symlink_target": "" }
package com.google.cloud.pubsublite.flink.internal.reader; import com.google.auto.value.AutoValue; import com.google.cloud.pubsublite.Offset; import java.time.Instant; import java.util.Optional; @AutoValue public abstract class Record<T> { public abstract Optional<T> value(); public abstract Offset offset(); public abstract Instant timestamp(); public static <T> Record<T> create(Optional<T> value, Offset offset, Instant timestamp) { return new AutoValue_Record<>(value, offset, timestamp); } }
{ "content_hash": "9b689faae25ac2e57133eae788c9ea28", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 91, "avg_line_length": 25.9, "alnum_prop": 0.7586872586872587, "repo_name": "googleapis/java-pubsublite-flink", "id": "288c5ceb7c1fb402180373465c96f5d3a283474d", "size": "1113", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "src/main/java/com/google/cloud/pubsublite/flink/internal/reader/Record.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "801" }, { "name": "Java", "bytes": "197376" }, { "name": "Python", "bytes": "817" }, { "name": "Shell", "bytes": "22054" } ], "symlink_target": "" }
using System; using System.Threading.Tasks; using System.Windows.Input; namespace Prism { /// <summary> /// An <see cref="ICommand"/> whose delegates can be attached for <see cref="Execute"/> and <see cref="CanExecute"/>. /// </summary> /// <typeparam name="T">Parameter type.</typeparam> /// <remarks> /// The constructor deliberately prevents the use of value types. /// Because ICommand takes an object, having a value type for T would cause unexpected behavior when CanExecute(null) is called during XAML initialization for command bindings. /// Using default(T) was considered and rejected as a solution because the implementor would not be able to distinguish between a valid and defaulted values. /// <para/> /// Instead, callers should support a value type by using a nullable value type and checking the HasValue property before using the Value property. /// <example> /// <code> /// public MyClass() /// { /// this.submitCommand = new DelegateCommand&lt;int?&gt;(this.Submit, this.CanSubmit); /// } /// /// private bool CanSubmit(int? customerId) /// { /// return (customerId.HasValue &amp;&amp; customers.Contains(customerId.Value)); /// } /// </code> /// </example> /// </remarks> public class DelegateCommand<T> : DelegateCommandBase { /// <summary> /// Initializes a new instance of <see cref="DelegateCommand{T}"/>. /// </summary> /// <param name="executeMethod">Delegate to execute when Execute is called on the command. This can be null to just hook up a CanExecute delegate.</param> /// <remarks><seealso cref="CanExecute"/> will always return true.</remarks> public DelegateCommand(Action<T> executeMethod) : this(executeMethod, (o) => true) { } /// <summary> /// Initializes a new instance of <see cref="DelegateCommand{T}"/>. /// </summary> /// <param name="executeMethod">Delegate to execute when Execute is called on the command. This can be null to just hook up a CanExecute delegate.</param> /// <param name="canExecuteMethod">Delegate to execute when CanExecute is called on the command. This can be null.</param> /// <exception cref="ArgumentNullException">When both <paramref name="executeMethod"/> and <paramref name="canExecuteMethod"/> ar <see langword="null" />.</exception> public DelegateCommand(Action<T> executeMethod, Func<T, bool> canExecuteMethod) : base((o) => executeMethod((T)o), (o) => canExecuteMethod((T)o)) { if (executeMethod == null || canExecuteMethod == null) throw new ArgumentNullException("executeMethod"); } /// <summary> /// Factory method to create a new instance of <see cref="DelegateCommand{T}"/> from an awaitable handler method. /// </summary> /// <param name="executeMethod">Delegate to execute when Execute is called on the command.</param> /// <returns>Constructed instance of <see cref="DelegateCommand{T}"/></returns> public static DelegateCommand<T> FromAsyncHandler(Func<T, Task> executeMethod) { return new DelegateCommand<T>(executeMethod); } /// <summary> /// Factory method to create a new instance of <see cref="DelegateCommand{T}"/> from an awaitable handler method. /// </summary> /// <param name="executeMethod">Delegate to execute when Execute is called on the command. This can be null to just hook up a CanExecute delegate.</param> /// <param name="canExecuteMethod">Delegate to execute when CanExecute is called on the command. This can be null.</param> /// <returns>Constructed instance of <see cref="DelegateCommand{T}"/></returns> public static DelegateCommand<T> FromAsyncHandler(Func<T, Task> executeMethod, Func<T, bool> canExecuteMethod) { return new DelegateCommand<T>(executeMethod, canExecuteMethod); } ///<summary> ///Determines if the command can execute by invoked the <see cref="Func{T,Bool}"/> provided during construction. ///</summary> ///<param name="parameter">Data used by the command to determine if it can execute.</param> ///<returns> ///<see langword="true" /> if this command can be executed; otherwise, <see langword="false" />. ///</returns> public bool CanExecute(T parameter) { return base.CanExecute(parameter); } ///<summary> ///Executes the command and invokes the <see cref="Action{T}"/> provided during construction. ///</summary> ///<param name="parameter">Data used by the command.</param> public async Task Execute(T parameter) { await base.Execute(parameter); } private DelegateCommand(Func<T, Task> executeMethod) : this(executeMethod, (o) => true) { } private DelegateCommand(Func<T, Task> executeMethod, Func<T, bool> canExecuteMethod) : base((o) => executeMethod((T)o), (o) => canExecuteMethod((T)o)) { if (executeMethod == null || canExecuteMethod == null) throw new ArgumentNullException("executeMethod"); } } /// <summary> /// An <see cref="ICommand"/> whose delegates do not take any parameters for <see cref="Execute"/> and <see cref="CanExecute"/>. /// </summary> /// <seealso cref="DelegateCommandBase"/> /// <seealso cref="DelegateCommand{T}"/> public class DelegateCommand : DelegateCommandBase { /// <summary> /// Creates a new instance of <see cref="DelegateCommand"/> with the <see cref="Action"/> to invoke on execution. /// </summary> /// <param name="executeMethod">The <see cref="Action"/> to invoke when <see cref="ICommand.Execute"/> is called.</param> public DelegateCommand(Action executeMethod) : this(executeMethod, () => true) { } /// <summary> /// Creates a new instance of <see cref="DelegateCommand"/> with the <see cref="Action"/> to invoke on execution /// and a <see langword="Func" /> to query for determining if the command can execute. /// </summary> /// <param name="executeMethod">The <see cref="Action"/> to invoke when <see cref="ICommand.Execute"/> is called.</param> /// <param name="canExecuteMethod">The <see cref="Func{TResult}"/> to invoke when <see cref="ICommand.CanExecute"/> is called</param> public DelegateCommand(Action executeMethod, Func<bool> canExecuteMethod) : base((o) => executeMethod(), (o) => canExecuteMethod()) { if (executeMethod == null || canExecuteMethod == null) throw new ArgumentNullException("executeMethod"); } /// <summary> /// Factory method to create a new instance of <see cref="DelegateCommand"/> from an awaitable handler method. /// </summary> /// <param name="executeMethod">Delegate to execute when Execute is called on the command.</param> /// <returns>Constructed instance of <see cref="DelegateCommand"/></returns> public static DelegateCommand FromAsyncHandler(Func<Task> executeMethod) { return new DelegateCommand(executeMethod); } /// <summary> /// Factory method to create a new instance of <see cref="DelegateCommand"/> from an awaitable handler method. /// </summary> /// <param name="executeMethod">Delegate to execute when Execute is called on the command. This can be null to just hook up a CanExecute delegate.</param> /// <param name="canExecuteMethod">Delegate to execute when CanExecute is called on the command. This can be null.</param> /// <returns>Constructed instance of <see cref="DelegateCommand"/></returns> public static DelegateCommand FromAsyncHandler(Func<Task> executeMethod, Func<bool> canExecuteMethod) { return new DelegateCommand(executeMethod, canExecuteMethod); } ///<summary> /// Executes the command. ///</summary> public async Task Execute() { await Execute(null); } /// <summary> /// Determines if the command can be executed. /// </summary> /// <returns>Returns <see langword="true"/> if the command can execute, otherwise returns <see langword="false"/>.</returns> public bool CanExecute() { return CanExecute(null); } private DelegateCommand(Func<Task> executeMethod) : this(executeMethod, () => true) { } private DelegateCommand(Func<Task> executeMethod, Func<bool> canExecuteMethod) : base((o) => executeMethod(), (o) => canExecuteMethod()) { if (executeMethod == null || canExecuteMethod == null) throw new ArgumentNullException("executeMethod"); } } }
{ "content_hash": "2d2372786aa42554914f10faf11b8e03", "timestamp": "", "source": "github", "line_count": 193, "max_line_length": 180, "avg_line_length": 47.41450777202073, "alnum_prop": 0.6222270790077588, "repo_name": "KSSDevelopment/Prism", "id": "882e3afb7cd9a9ed7562278790d0bf6bc0ca47ab", "size": "9445", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Source/WindowsStore/Prism.WindowsStore (81)/DelegateCommand.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C#", "bytes": "1762844" } ], "symlink_target": "" }
/* Define to prevent recursive inclusion -------------------------------------*/ #ifndef STM32H7xx_HAL_RTC_EX_H #define STM32H7xx_HAL_RTC_EX_H #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /* Includes ------------------------------------------------------------------*/ #include "stm32h7xx_hal_def.h" /** @addtogroup STM32H7xx_HAL_Driver * @{ */ /** @defgroup RTCEx RTCEx * @{ */ /* Exported types ------------------------------------------------------------*/ /** @defgroup RTCEx_Exported_Types RTCEx Exported Types * @{ */ /** @defgroup RTCEx_Tamper_structure_definition RTC Tamper structure definition * @{ */ typedef struct { uint32_t Tamper; /*!< Specifies the Tamper Pin. This parameter can be a value of @ref RTCEx_Tamper_Pins_Definitions */ uint32_t Interrupt; /*!< Specifies the Tamper Interrupt. This parameter can be a value of @ref RTCEx_Tamper_Interrupt_Definitions */ uint32_t Trigger; /*!< Specifies the Tamper Trigger. This parameter can be a value of @ref RTCEx_Tamper_Trigger_Definitions */ uint32_t NoErase; /*!< Specifies the Tamper no erase mode. This parameter can be a value of @ref RTCEx_Tamper_EraseBackUp_Definitions */ uint32_t MaskFlag; /*!< Specifies the Tamper Flag masking. This parameter can be a value of @ref RTCEx_Tamper_MaskFlag_Definitions */ uint32_t Filter; /*!< Specifies the TAMP Filter Tamper. This parameter can be a value of @ref RTCEx_Tamper_Filter_Definitions */ uint32_t SamplingFrequency; /*!< Specifies the sampling frequency. This parameter can be a value of @ref RTCEx_Tamper_Sampling_Frequencies_Definitions */ uint32_t PrechargeDuration; /*!< Specifies the Precharge Duration . This parameter can be a value of @ref RTCEx_Tamper_Pin_Precharge_Duration_Definitions */ uint32_t TamperPullUp; /*!< Specifies the Tamper PullUp . This parameter can be a value of @ref RTCEx_Tamper_Pull_UP_Definitions */ uint32_t TimeStampOnTamperDetection; /*!< Specifies the TimeStampOnTamperDetection. This parameter can be a value of @ref RTCEx_Tamper_TimeStampOnTamperDetection_Definitions */ } RTC_TamperTypeDef; /** * @} */ #if defined(TAMP_CR1_ITAMP1E) /** @defgroup RTCEx_Internal_Tamper_structure_definition RTCEx Internal Tamper structure definition * @{ */ typedef struct { uint32_t IntTamper; /*!< Specifies the Internal Tamper Pin. This parameter can be a value of @ref RTCEx_Internal_Tamper_Pins */ uint32_t TimeStampOnTamperDetection; /*!< Specifies the TimeStampOnTamperDetection. This parameter can be a value of @ref RTCEx_Tamper_TimeStampOnTamperDetection */ } RTC_InternalTamperTypeDef; /** * @} */ #endif /* TAMP_CR1_ITAMP1E */ #if defined(TAMP_ATCR1_TAMP1AM) /** @defgroup RTCEx_Active_Seed_Size Seed size Definitions * @{ */ #define RTC_ATAMP_SEED_NB_UINT32 4U /** * @} */ /** @defgroup RTCEx_Active_Tampers_Number Active Tampers number Definitions * @{ */ #define RTC_TAMP_NB 3u /** * @} */ /** @defgroup RTCEx_ActiveTamper_structures_definition RTC Active Tamper structures definitions * @{ */ typedef struct { uint32_t Enable; /*!< Specifies the Tamper input is active. This parameter can be a value of @ref RTCEx_ActiveTamper_Enable */ uint32_t Interrupt; /*!< Specifies the interrupt mode This parameter can be a value of @ref RTCEx_ActiveTamper_Interrupt */ uint32_t Output; /*!< Specifies the TAMP output to be compared with. The same output can be used for several tamper inputs. This parameter can be a value of @ref RTCEx_ActiveTamper_Sel */ uint32_t NoErase; /*!< Specifies the Tamper no erase mode. This parameter can be a value of @ref RTCEx_Tamper_EraseBackUp */ uint32_t MaskFlag; /*!< Specifies the Tamper Flag masking. This parameter can be a value of @ref RTCEx_Tamper_MaskFlag */ } RTC_ATampInputTypeDef; typedef struct { uint32_t ActiveFilter; /*!< Specifies the Active tamper filter enable. This parameter can be a value of @ref RTCEx_ActiveTamper_Filter */ uint32_t ActiveAsyncPrescaler; /*!< Specifies the Active Tamper asynchronous Prescaler clock. This parameter can be a value of @ref RTCEx_ActiveTamper_Async_prescaler */ uint32_t TimeStampOnTamperDetection; /*!< Specifies the timeStamp on tamper detection. This parameter can be a value of @ref RTCEx_Tamper_TimeStampOnTamperDetection */ uint32_t ActiveOutputChangePeriod; /*!< Specifies the Active Tamper output change period . This parameter can be a value from 0 to 7. */ uint32_t Seed[RTC_ATAMP_SEED_NB_UINT32]; /*!< Specifies the Active Tamper RNG Seed value . This parameter can be a value from 0 to (2^32-1) */ RTC_ATampInputTypeDef TampInput[RTC_TAMP_NB]; /*!< Specifies configuration of all active tampers. The index of TampInput[RTC_TAMP_NB] can be a value of RTCEx_ActiveTamper_Sel */ } RTC_ActiveTampersTypeDef; /** * @} */ #endif /* TAMP_ATCR1_TAMP1AM */ /** * @} */ /* Exported constants --------------------------------------------------------*/ /** @defgroup RTCEx_Exported_Constants RTC Exported Constants * @{ */ /* ========================================================================== */ /* ##### Extended RTC Backup registers exported constants ##### */ /* ========================================================================== */ /** @defgroup RTCEx_Backup_Registers_Number_Definitions RTC Backup Registers Number Definitions * @{ */ #if defined(RTC_BKP_NUMBER) #define BKP_REG_NUMBER RTC_BKP_NUMBER #endif /* RTC_BKP_NUMBER */ #if defined(TAMP_BKP_NUMBER) #define BKP_REG_NUMBER TAMP_BKP_NUMBER #endif /* TAMP_BKP_NUMBER */ /** * @} */ /** @defgroup RTCEx_Backup_Registers_Definitions RTC Backup Registers Definitions * @{ */ #define RTC_BKP_DR0 0x00u #define RTC_BKP_DR1 0x01u #define RTC_BKP_DR2 0x02u #define RTC_BKP_DR3 0x03u #define RTC_BKP_DR4 0x04u #define RTC_BKP_DR5 0x05u #define RTC_BKP_DR6 0x06u #define RTC_BKP_DR7 0x07u #define RTC_BKP_DR8 0x08u #define RTC_BKP_DR9 0x09u #define RTC_BKP_DR10 0x0Au #define RTC_BKP_DR11 0x0Bu #define RTC_BKP_DR12 0x0Cu #define RTC_BKP_DR13 0x0Du #define RTC_BKP_DR14 0x0Eu #define RTC_BKP_DR15 0x0Fu #define RTC_BKP_DR16 0x10u #define RTC_BKP_DR17 0x11u #define RTC_BKP_DR18 0x12u #define RTC_BKP_DR19 0x13u #define RTC_BKP_DR20 0x14u #define RTC_BKP_DR21 0x15u #define RTC_BKP_DR22 0x16u #define RTC_BKP_DR23 0x17u #define RTC_BKP_DR24 0x18u #define RTC_BKP_DR25 0x19u #define RTC_BKP_DR26 0x1Au #define RTC_BKP_DR27 0x1Bu #define RTC_BKP_DR28 0x1Cu #define RTC_BKP_DR29 0x1Du #define RTC_BKP_DR30 0x1Eu #define RTC_BKP_DR31 0x1Fu /** * @} */ /* ========================================================================== */ /* ##### RTC TimeStamp exported constants ##### */ /* ========================================================================== */ /** @defgroup RTCEx_TimeStamp_Edges_definitions RTC TimeStamp Edges Definitions * * @{ */ #define RTC_TIMESTAMPEDGE_RISING 0x00000000u #define RTC_TIMESTAMPEDGE_FALLING RTC_CR_TSEDGE /** * @} */ /** @defgroup RTCEx_TimeStamp_Pin_Selection RTC TimeStamp Pin Selection * @{ */ #define RTC_TIMESTAMPPIN_DEFAULT 0x00000000u /** * @} */ /* ========================================================================== */ /* ##### RTC Tamper exported constants ##### */ /* ========================================================================== */ /** @defgroup RTCEx_Tamper_Pins_Definitions RTC Tamper Pins Definitions * @{ */ #if defined(TAMP_CR1_TAMP1E) #define RTC_TAMPER_1 TAMP_CR1_TAMP1E #endif /* TAMP_CR1_TAMP1E */ #if defined(TAMP_CR1_TAMP2E) #define RTC_TAMPER_2 TAMP_CR1_TAMP2E #endif /* TAMP_CR1_TAMP2E */ #if defined(TAMP_CR1_TAMP3E) #define RTC_TAMPER_3 TAMP_CR1_TAMP3E #endif /* TAMP_CR1_TAMP3E */ #if defined(RTC_TAMPCR_TAMP1E) #define RTC_TAMPER_1 RTC_TAMPCR_TAMP1E #endif /* RTC_TAMPCR_TAMP1E */ #if defined(RTC_TAMPCR_TAMP2E) #define RTC_TAMPER_2 RTC_TAMPCR_TAMP2E #endif /* RTC_TAMPCR_TAMP2E */ #if defined(RTC_TAMPCR_TAMP3E) #define RTC_TAMPER_3 RTC_TAMPCR_TAMP3E #endif /* RTC_TAMPCR_TAMP3E */ #define RTC_TAMPER_ALL (RTC_TAMPER_1 | RTC_TAMPER_2 | RTC_TAMPER_3) /** * @} */ /** @defgroup RTCEx_Tamper_Interrupt_Definitions RTC Tamper Interrupts Definitions * @{ */ #if defined(TAMP_IER_TAMP1IE) #define RTC_IT_TAMP1 TAMP_IER_TAMP1IE /*!< Enable Tamper 1 Interrupt */ #endif /* TAMP_IER_TAMP1IE */ #if defined(TAMP_IER_TAMP2IE) #define RTC_IT_TAMP2 TAMP_IER_TAMP2IE /*!< Enable Tamper 2 Interrupt */ #endif /* TAMP_IER_TAMP2IE */ #if defined(TAMP_IER_TAMP3IE) #define RTC_IT_TAMP3 TAMP_IER_TAMP3IE /*!< Enable Tamper 3 Interrupt */ #endif /* TAMP_IER_TAMP3IE */ #if defined(RTC_TAMPCR_TAMP1IE) #define RTC_IT_TAMP1 RTC_TAMPCR_TAMP1IE /*!< Enable Tamper 1 Interrupt */ #endif /* RTC_TAMPCR_TAMP1IE */ #if defined(RTC_TAMPCR_TAMP2IE) #define RTC_IT_TAMP2 RTC_TAMPCR_TAMP2IE /*!< Enable Tamper 2 Interrupt */ #endif /* RTC_TAMPCR_TAMP2IE */ #if defined(RTC_TAMPCR_TAMP3IE) #define RTC_IT_TAMP3 RTC_TAMPCR_TAMP3IE /*!< Enable Tamper 3 Interrupt */ #endif /* RTC_TAMPCR_TAMP3IE */ #if defined(RTC_TAMPCR_TAMPIE) #define RTC_IT_TAMP RTC_TAMPCR_TAMPIE /*!< Enable all Tamper Interrupts */ #define RTC_IT_TAMPALL RTC_IT_TAMP #else /* RTC_TAMPCR_TAMPIE not defined */ #define RTC_IT_TAMP 0x00000000u /*!< No such feature in RTC3 */ #define RTC_IT_TAMPALL (RTC_IT_TAMP1 | RTC_IT_TAMP2 | RTC_IT_TAMP3) #endif /* RTC_TAMPCR_TAMPIE */ /** * @} */ /** @defgroup RTCEx_Internal_Tamper_Pins_Definitions RTCEx Internal Tamper Pins Definition * @{ */ #if defined(TAMP_CR1_ITAMP1E) #define RTC_INT_TAMPER_1 TAMP_CR1_ITAMP1E #endif /* TAMP_CR1_ITAMP1E */ #if defined(TAMP_CR1_ITAMP2E) #define RTC_INT_TAMPER_2 TAMP_CR1_ITAMP2E #endif /* TAMP_CR1_ITAMP2E */ #if defined(TAMP_CR1_ITAMP3E) #define RTC_INT_TAMPER_3 TAMP_CR1_ITAMP3E #endif /* TAMP_CR1_ITAMP3E */ #if defined(TAMP_CR1_ITAMP4E) #define RTC_INT_TAMPER_4 TAMP_CR1_ITAMP4E #endif /* TAMP_CR1_ITAMP4E */ #if defined(TAMP_CR1_ITAMP5E) #define RTC_INT_TAMPER_5 TAMP_CR1_ITAMP5E #endif /* TAMP_CR1_ITAMP5E */ #if defined(TAMP_CR1_ITAMP6E) #define RTC_INT_TAMPER_6 TAMP_CR1_ITAMP6E #endif /* TAMP_CR1_ITAMP6E */ #if defined(TAMP_CR1_ITAMP8E) #define RTC_INT_TAMPER_8 TAMP_CR1_ITAMP8E #define RTC_INT_TAMPER_ALL (RTC_INT_TAMPER_1 | RTC_INT_TAMPER_2 |\ RTC_INT_TAMPER_3 | RTC_INT_TAMPER_4 |\ RTC_INT_TAMPER_5 | RTC_INT_TAMPER_6 |\ RTC_INT_TAMPER_8) #endif /* TAMP_CR1_ITAMP8E */ /** * @} */ /** @defgroup RTCEx_Internal_Tamper_Interrupt_Definitions RTC Internal Tamper Interrupt * @{ */ #if defined(TAMP_IER_ITAMP1IE) #define RTC_INTERNAL_TAMPER1_INTERRUPT TAMP_IER_ITAMP1IE /*!< Enable Internal Tamper 1 Interrupt */ #endif /* TAMP_IER_ITAMP1IE */ #if defined(TAMP_IER_ITAMP2IE) #define RTC_INTERNAL_TAMPER2_INTERRUPT TAMP_IER_ITAMP2IE /*!< Enable Internal Tamper 2 Interrupt */ #endif /* TAMP_IER_ITAMP2IE */ #if defined(TAMP_IER_ITAMP3IE) #define RTC_INTERNAL_TAMPER3_INTERRUPT TAMP_IER_ITAMP3IE /*!< Enable Internal Tamper 3 Interrupt */ #endif /* TAMP_IER_ITAMP3IE */ #if defined(TAMP_IER_ITAMP4IE) #define RTC_INTERNAL_TAMPER4_INTERRUPT TAMP_IER_ITAMP4IE /*!< Enable Internal Tamper 4 Interrupt */ #endif /* TAMP_IER_ITAMP4IE */ #if defined(TAMP_IER_ITAMP5IE) #define RTC_INTERNAL_TAMPER5_INTERRUPT TAMP_IER_ITAMP5IE /*!< Enable Internal Tamper 5 Interrupt */ #endif /* TAMP_IER_ITAMP5IE */ #if defined(TAMP_IER_ITAMP6IE) #define RTC_INTERNAL_TAMPER6_INTERRUPT TAMP_IER_ITAMP6IE /*!< Enable Internal Tamper 6 Interrupt */ #endif /* TAMP_IER_ITAMP6IE */ #if defined(TAMP_IER_ITAMP8IE) #define RTC_INTERNAL_TAMPER8_INTERRUPT TAMP_IER_ITAMP8IE /*!< Enable Internal Tamper 8 Interrupt */ #endif /* TAMP_IER_ITAMP8IE */ /** * @} */ /** @defgroup RTCEx_Tamper_Trigger_Definitions RTC Tamper Triggers Definitions * @{ */ #define RTC_TAMPERTRIGGER_RISINGEDGE 0x01u /*!< Warning : Filter must be RTC_TAMPERFILTER_DISABLE */ #define RTC_TAMPERTRIGGER_FALLINGEDGE 0x02u /*!< Warning : Filter must be RTC_TAMPERFILTER_DISABLE */ #define RTC_TAMPERTRIGGER_LOWLEVEL 0x04u /*!< Warning : Filter must not be RTC_TAMPERFILTER_DISABLE */ #define RTC_TAMPERTRIGGER_HIGHLEVEL 0x08u /*!< Warning : Filter must not be RTC_TAMPERFILTER_DISABLE */ #if defined(TAMP_CR2_TAMP1TRG) #define RTC_TAMPER_1_TRIGGER TAMP_CR2_TAMP1TRG #endif /* TAMP_CR2_TAMP1TRG */ #if defined(TAMP_CR2_TAMP2TRG) #define RTC_TAMPER_2_TRIGGER TAMP_CR2_TAMP2TRG #endif /* TAMP_CR2_TAMP2TRG */ #if defined(TAMP_CR2_TAMP3TRG) #define RTC_TAMPER_3_TRIGGER TAMP_CR2_TAMP3TRG #endif /* TAMP_CR2_TAMP3TRG */ #if defined(RTC_TAMPCR_TAMP1TRG) #define RTC_TAMPER_1_TRIGGER RTC_TAMPCR_TAMP1TRG #endif /* RTC_TAMPCR_TAMP1TRG */ #if defined(RTC_TAMPCR_TAMP2TRG) #define RTC_TAMPER_2_TRIGGER RTC_TAMPCR_TAMP2TRG #endif /* RTC_TAMPCR_TAMP2TRG */ #if defined(RTC_TAMPCR_TAMP3TRG) #define RTC_TAMPER_3_TRIGGER RTC_TAMPCR_TAMP3TRG #endif /* RTC_TAMPCR_TAMP3TRG */ #define RTC_TAMPER_X_TRIGGER (RTC_TAMPER_1_TRIGGER |\ RTC_TAMPER_2_TRIGGER |\ RTC_TAMPER_3_TRIGGER) /** * @} */ /** @defgroup RTCEx_Tamper_EraseBackUp_Definitions RTC Tamper EraseBackUp Definitions * @{ */ #if defined(TAMP_CR2_TAMP1NOERASE) #define RTC_TAMPER_ERASE_BACKUP_ENABLE 0x00u #define RTC_TAMPER_ERASE_BACKUP_DISABLE 0x01u #endif /* TAMP_CR2_TAMP1NOERASE */ #if defined(RTC_TAMPCR_TAMP1NOERASE) #define RTC_TAMPER_ERASE_BACKUP_ENABLE 0x00000000u #define RTC_TAMPER_ERASE_BACKUP_DISABLE RTC_TAMPCR_TAMP1NOERASE #endif /* RTC_TAMPCR_TAMP1NOERASE */ #if defined(TAMP_CR2_TAMP1NOERASE) #define RTC_DISABLE_BKP_ERASE_ON_TAMPER_1 TAMP_CR2_TAMP1NOERASE #endif /* TAMP_CR2_TAMP1NOERASE */ #if defined(TAMP_CR2_TAMP2NOERASE) #define RTC_DISABLE_BKP_ERASE_ON_TAMPER_2 TAMP_CR2_TAMP2NOERASE #endif /* TAMP_CR2_TAMP2NOERASE */ #if defined(TAMP_CR2_TAMP3NOERASE) #define RTC_DISABLE_BKP_ERASE_ON_TAMPER_3 TAMP_CR2_TAMP3NOERASE #endif /* TAMP_CR2_TAMP3NOERASE */ #if defined(RTC_TAMPCR_TAMP1NOERASE) #define RTC_DISABLE_BKP_ERASE_ON_TAMPER_1 RTC_TAMPCR_TAMP1NOERASE #endif /* RTC_TAMPCR_TAMP1NOERASE */ #if defined(RTC_TAMPCR_TAMP2NOERASE) #define RTC_DISABLE_BKP_ERASE_ON_TAMPER_2 RTC_TAMPCR_TAMP2NOERASE #endif /* RTC_TAMPCR_TAMP2NOERASE */ #if defined(RTC_TAMPCR_TAMP3NOERASE) #define RTC_DISABLE_BKP_ERASE_ON_TAMPER_3 RTC_TAMPCR_TAMP3NOERASE #endif /* RTC_TAMPCR_TAMP3NOERASE */ #define RTC_DISABLE_BKP_ERASE_ON_TAMPER_MASK (RTC_DISABLE_BKP_ERASE_ON_TAMPER_1 |\ RTC_DISABLE_BKP_ERASE_ON_TAMPER_2 |\ RTC_DISABLE_BKP_ERASE_ON_TAMPER_3) /** * @} */ /** @defgroup RTCEx_Tamper_MaskFlag_Definitions RTC Tamper Mask Flag Definitions * @{ */ #if defined(TAMP_CR2_TAMP1MSK) #define RTC_TAMPERMASK_FLAG_DISABLE 0x00u #define RTC_TAMPERMASK_FLAG_ENABLE 0x01u #endif /* TAMP_CR2_TAMP1MSK */ #if defined(RTC_TAMPCR_TAMP1MF) #define RTC_TAMPERMASK_FLAG_DISABLE 0x00000000u #define RTC_TAMPERMASK_FLAG_ENABLE RTC_TAMPCR_TAMP1MF #endif /* RTC_TAMPCR_TAMP1MF */ #if defined(TAMP_CR2_TAMP1MSK) #define RTC_TAMPER_1_MASK_FLAG TAMP_CR2_TAMP1MSK #endif /* TAMP_CR2_TAMP1MSK */ #if defined(TAMP_CR2_TAMP2MSK) #define RTC_TAMPER_2_MASK_FLAG TAMP_CR2_TAMP2MSK #endif /* TAMP_CR2_TAMP2MSK */ #if defined(TAMP_CR2_TAMP3MSK) #define RTC_TAMPER_3_MASK_FLAG TAMP_CR2_TAMP3MSK #endif /* TAMP_CR2_TAMP3MSK */ #if defined(RTC_TAMPCR_TAMP1MF) #define RTC_TAMPER_1_MASK_FLAG RTC_TAMPCR_TAMP1MF #endif /* RTC_TAMPCR_TAMP1MF */ #if defined(RTC_TAMPCR_TAMP2MF) #define RTC_TAMPER_2_MASK_FLAG RTC_TAMPCR_TAMP2MF #endif /* RTC_TAMPCR_TAMP2MF */ #if defined(RTC_TAMPCR_TAMP3MF) #define RTC_TAMPER_3_MASK_FLAG RTC_TAMPCR_TAMP3MF #endif /* RTC_TAMPCR_TAMP3MF */ #define RTC_TAMPER_X_MASK_FLAG (RTC_TAMPER_1_MASK_FLAG |\ RTC_TAMPER_2_MASK_FLAG |\ RTC_TAMPER_3_MASK_FLAG) /** * @} */ /** @defgroup RTCEx_Tamper_Filter_Definitions RTC Tamper Filter Definitions * @{ */ #if defined(TAMP_FLTCR_TAMPFLT) #define RTC_TAMPERFILTER_DISABLE 0x00000000U /*!< Tamper filter is disabled */ #define RTC_TAMPERFILTER_2SAMPLE TAMP_FLTCR_TAMPFLT_0 /*!< Tamper is activated after 2 consecutive samples at the active level */ #define RTC_TAMPERFILTER_4SAMPLE TAMP_FLTCR_TAMPFLT_1 /*!< Tamper is activated after 4 consecutive samples at the active level */ #define RTC_TAMPERFILTER_8SAMPLE TAMP_FLTCR_TAMPFLT /*!< Tamper is activated after 8 consecutive samples at the active level */ #define RTC_TAMPERFILTER_MASK TAMP_FLTCR_TAMPFLT /*!< Masking all bits except those of field TAMPFLT[1:0]. */ #endif /* TAMP_FLTCR_TAMPFLT */ #if defined(RTC_TAMPCR_TAMPFLT) #define RTC_TAMPERFILTER_DISABLE 0x00000000u /*!< Tamper filter is disabled */ #define RTC_TAMPERFILTER_2SAMPLE RTC_TAMPCR_TAMPFLT_0 /*!< Tamper is activated after 2 consecutive samples at the active level */ #define RTC_TAMPERFILTER_4SAMPLE RTC_TAMPCR_TAMPFLT_1 /*!< Tamper is activated after 4 consecutive samples at the active level */ #define RTC_TAMPERFILTER_8SAMPLE RTC_TAMPCR_TAMPFLT /*!< Tamper is activated after 8 consecutive samples at the active level. */ #define RTC_TAMPERFILTER_MASK RTC_TAMPCR_TAMPFLT /*!< Masking all bits except those of field TAMPFLT[1:0]. */ #endif /* RTC_TAMPCR_TAMPFLT */ /** * @} */ /** @defgroup RTCEx_Tamper_Sampling_Frequencies_Definitions RTC Tamper Sampling Frequencies Definitions * @{ */ #if defined(TAMP_FLTCR_TAMPFREQ) #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV32768 0x00000000U /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 32768 */ #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV16384 TAMP_FLTCR_TAMPFREQ_0 /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 16384 */ #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV8192 TAMP_FLTCR_TAMPFREQ_1 /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 8192 */ #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV4096 (TAMP_FLTCR_TAMPFREQ_0 | TAMP_FLTCR_TAMPFREQ_1) /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 4096 */ #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV2048 TAMP_FLTCR_TAMPFREQ_2 /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 2048 */ #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV1024 (TAMP_FLTCR_TAMPFREQ_0 | TAMP_FLTCR_TAMPFREQ_2) /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 1024 */ #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV512 (TAMP_FLTCR_TAMPFREQ_1 | TAMP_FLTCR_TAMPFREQ_2) /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 512 */ #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV256 TAMP_FLTCR_TAMPFREQ /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 256 */ #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_MASK TAMP_FLTCR_TAMPFREQ /*!< Masking all bits except those of field TAMPFREQ[2:0]*/ #endif /* TAMP_FLTCR_TAMPFREQ */ #if defined(RTC_TAMPCR_TAMPFREQ) #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV32768 0x00000000u /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 32768 */ #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV16384 RTC_TAMPCR_TAMPFREQ_0 /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 16384 */ #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV8192 RTC_TAMPCR_TAMPFREQ_1 /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 8192 */ #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV4096 (RTC_TAMPCR_TAMPFREQ_0 | RTC_TAMPCR_TAMPFREQ_1) /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 4096 */ #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV2048 RTC_TAMPCR_TAMPFREQ_2 /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 2048 */ #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV1024 (RTC_TAMPCR_TAMPFREQ_0 | RTC_TAMPCR_TAMPFREQ_2) /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 1024 */ #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV512 (RTC_TAMPCR_TAMPFREQ_1 | RTC_TAMPCR_TAMPFREQ_2) /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 512 */ #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV256 RTC_TAMPCR_TAMPFREQ /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 256 */ #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_MASK RTC_TAMPCR_TAMPFREQ /*!< Masking all bits except those of field TAMPFREQ[2:0]*/ #endif /* RTC_TAMPCR_TAMPFREQ */ /** * @} */ /** @defgroup RTCEx_Tamper_Pin_Precharge_Duration_Definitions RTC Tamper Pin Precharge Duration Definitions * @{ */ #if defined(TAMP_FLTCR_TAMPPRCH) #define RTC_TAMPERPRECHARGEDURATION_1RTCCLK 0x00000000U /*!< Tamper pins are pre-charged before sampling during 1 RTCCLK cycle */ #define RTC_TAMPERPRECHARGEDURATION_2RTCCLK TAMP_FLTCR_TAMPPRCH_0 /*!< Tamper pins are pre-charged before sampling during 2 RTCCLK cycles */ #define RTC_TAMPERPRECHARGEDURATION_4RTCCLK TAMP_FLTCR_TAMPPRCH_1 /*!< Tamper pins are pre-charged before sampling during 4 RTCCLK cycles */ #define RTC_TAMPERPRECHARGEDURATION_8RTCCLK TAMP_FLTCR_TAMPPRCH /*!< Tamper pins are pre-charged before sampling during 8 RTCCLK cycles */ #define RTC_TAMPERPRECHARGEDURATION_MASK TAMP_FLTCR_TAMPPRCH /*!< Masking all bits except those of field TAMPPRCH[1:0] */ #endif /* TAMP_FLTCR_TAMPPRCH */ #if defined(RTC_TAMPCR_TAMPPRCH) #define RTC_TAMPERPRECHARGEDURATION_1RTCCLK 0x00000000u /*!< Tamper pins are pre-charged before sampling during 1 RTCCLK cycle */ #define RTC_TAMPERPRECHARGEDURATION_2RTCCLK RTC_TAMPCR_TAMPPRCH_0 /*!< Tamper pins are pre-charged before sampling during 2 RTCCLK cycles */ #define RTC_TAMPERPRECHARGEDURATION_4RTCCLK RTC_TAMPCR_TAMPPRCH_1 /*!< Tamper pins are pre-charged before sampling during 4 RTCCLK cycles */ #define RTC_TAMPERPRECHARGEDURATION_8RTCCLK RTC_TAMPCR_TAMPPRCH /*!< Tamper pins are pre-charged before sampling during 8 RTCCLK cycles */ #define RTC_TAMPERPRECHARGEDURATION_MASK RTC_TAMPCR_TAMPPRCH /*!< Masking all bits except those of field TAMPPRCH[1:0] */ #endif /* RTC_TAMPCR_TAMPPRCH */ /** * @} */ /** @defgroup RTCEx_Tamper_TimeStampOnTamperDetection_Definitions RTC Tamper TimeStamp On Tamper Detection Definitions * @{ */ #if defined(RTC_CR_TAMPTS) #define RTC_TIMESTAMPONTAMPERDETECTION_DISABLE 0x00000000u /*!< TimeStamp on Tamper Detection event is not saved */ #define RTC_TIMESTAMPONTAMPERDETECTION_ENABLE RTC_CR_TAMPTS /*!< TimeStamp on Tamper Detection event saved */ #define RTC_TIMESTAMPONTAMPERDETECTION_MASK RTC_CR_TAMPTS /*!< Masking all bits except bit TAMPTS */ #endif /* RTC_CR_TAMPTS */ #if defined(RTC_TAMPCR_TAMPTS) #define RTC_TIMESTAMPONTAMPERDETECTION_DISABLE 0x00000000u /*!< TimeStamp on Tamper Detection event is not saved */ #define RTC_TIMESTAMPONTAMPERDETECTION_ENABLE RTC_TAMPCR_TAMPTS /*!< TimeStamp on Tamper Detection event saved */ #define RTC_TIMESTAMPONTAMPERDETECTION_MASK RTC_TAMPCR_TAMPTS /*!< Masking all bits except bit TAMPTS */ #endif /* RTC_TAMPCR_TAMPTS */ /** * @} */ /** @defgroup RTCEx_Tamper_Pull_UP_Definitions RTC Tamper Pull Up Definitions * @{ */ #if defined(TAMP_FLTCR_TAMPPUDIS) #define RTC_TAMPER_PULLUP_ENABLE 0x00000000u /*!< Tamper pins are pre-charged before sampling */ #define RTC_TAMPER_PULLUP_DISABLE TAMP_FLTCR_TAMPPUDIS /*!< Tamper pins pre-charge is disabled */ #define RTC_TAMPER_PULLUP_MASK TAMP_FLTCR_TAMPPUDIS /*!< Maskin all bits except bit TAMPPUDIS */ #endif /* TAMP_FLTCR_TAMPPUDIS */ #if defined(RTC_TAMPCR_TAMPPUDIS) #define RTC_TAMPER_PULLUP_ENABLE 0x00000000u /*!< TimeStamp on Tamper Detection event saved */ #define RTC_TAMPER_PULLUP_DISABLE RTC_TAMPCR_TAMPPUDIS /*!< TimeStamp on Tamper Detection event is not saved */ #define RTC_TAMPER_PULLUP_MASK RTC_TAMPCR_TAMPPUDIS /*!< Maskin all bits except bit TAMPPUDIS */ #endif /* RTC_TAMPCR_TAMPPUDIS */ /** * @} */ /** @defgroup RTCEx_Tamper_DetectionOutput_Definitions RTC Tamper Detection Output Definitions * @{ */ #if defined(RTC_CR_TAMPOE) #define RTC_TAMPERDETECTIONOUTPUT_DISABLE 0x00000000u /*!< The tamper flag is not routed on TAMPALRM */ #define RTC_TAMPERDETECTIONOUTPUT_ENABLE RTC_CR_TAMPOE /*!< The tamper flag is routed on TAMPALRM combined with the signal provided by OSEL and with the polarity provided by POL */ #endif /* RTC_CR_TAMPOE */ /** * @} */ /** @defgroup RTC_Tamper_Flags_Definitions RTC Tamper Flags Definitions * @{ */ #if defined(TAMP_SR_TAMP1F) #define RTC_FLAG_TAMP1F TAMP_SR_TAMP1F #endif /* TAMP_SR_TAMP1F */ #if defined(TAMP_SR_TAMP2F) #define RTC_FLAG_TAMP2F TAMP_SR_TAMP2F #endif /* TAMP_SR_TAMP2F */ #if defined(TAMP_SR_TAMP3F) #define RTC_FLAG_TAMP3F TAMP_SR_TAMP3F #endif /* TAMP_SR_TAMP3F */ #if defined(RTC_ISR_TAMP1F) #define RTC_FLAG_TAMP1F RTC_ISR_TAMP1F #endif /* RTC_ISR_TAMP1F */ #if defined(RTC_ISR_TAMP2F) #define RTC_FLAG_TAMP2F RTC_ISR_TAMP2F #endif /* RTC_ISR_TAMP2F */ #if defined(RTC_ISR_TAMP3F) #define RTC_FLAG_TAMP3F RTC_ISR_TAMP3F #endif /* RTC_ISR_TAMP3F */ /** * @} */ /** @defgroup RTCEx_ActiveTamper_Enable RTCEx_ActiveTamper_Enable Definitions * @{ */ #define RTC_ATAMP_ENABLE 1u #define RTC_ATAMP_DISABLE 0u /** * @} */ /** @defgroup RTCEx_ActiveTamper_Interrupt RTCEx_ActiveTamper_Interrupt Definitions * @{ */ #define RTC_ATAMP_INTERRUPT_ENABLE 1u #define RTC_ATAMP_INTERRUPT_DISABLE 0u /** * @} */ /** @defgroup RTCEx_ActiveTamper_Filter RTCEx_ActiveTamper_Filter Definitions * @{ */ #define RTC_ATAMP_FILTER_ENABLE TAMP_ATCR1_FLTEN #define RTC_ATAMP_FILTER_DISABLE 0u /** * @} */ /** @defgroup RTCEx_ActiveTamper_Async_prescaler RTC Active_Tamper_Asynchronous_Prescaler clock Definitions * @{ */ #define RTC_ATAMP_ASYNCPRES_RTCCLK 0u /*!< RTCCLK */ #define RTC_ATAMP_ASYNCPRES_RTCCLK_2 TAMP_ATCR1_ATCKSEL_0 /*!< RTCCLK/2 */ #define RTC_ATAMP_ASYNCPRES_RTCCLK_4 TAMP_ATCR1_ATCKSEL_1 /*!< RTCCLK/4 */ #define RTC_ATAMP_ASYNCPRES_RTCCLK_8 (TAMP_ATCR1_ATCKSEL_1 | TAMP_ATCR1_ATCKSEL_0) /*!< RTCCLK/8 */ #define RTC_ATAMP_ASYNCPRES_RTCCLK_16 TAMP_ATCR1_ATCKSEL_2 /*!< RTCCLK/16 */ #define RTC_ATAMP_ASYNCPRES_RTCCLK_32 (TAMP_ATCR1_ATCKSEL_2 | TAMP_ATCR1_ATCKSEL_0) /*!< RTCCLK/32 */ #define RTC_ATAMP_ASYNCPRES_RTCCLK_64 (TAMP_ATCR1_ATCKSEL_2 | TAMP_ATCR1_ATCKSEL_1) /*!< RTCCLK/64 */ #define RTC_ATAMP_ASYNCPRES_RTCCLK_128 (TAMP_ATCR1_ATCKSEL_2 | TAMP_ATCR1_ATCKSEL_1 | TAMP_ATCR1_ATCKSEL_0) /*!< RTCCLK/128 */ /** * @} */ /** @defgroup RTCEx_ActiveTamper_Sel RTC Active Tamper selection Definition * @{ */ #define RTC_ATAMP_1 0u /*!< Tamper 1 */ #define RTC_ATAMP_2 1u /*!< Tamper 2 */ #define RTC_ATAMP_3 2u /*!< Tamper 3 */ #define RTC_ATAMP_4 3u /*!< Tamper 4 */ #define RTC_ATAMP_5 4u /*!< Tamper 5 */ #define RTC_ATAMP_6 5u /*!< Tamper 6 */ #define RTC_ATAMP_7 6u /*!< Tamper 7 */ #define RTC_ATAMP_8 7u /*!< Tamper 8 */ /** * @} */ /** @defgroup RTCEx_MonotonicCounter_Instance RTCEx Monotonic Counter Instance Definition * @{ */ #define RTC_MONOTONIC_COUNTER_1 0u /*!< Monotonic counter 1 */ /** * @} */ /** @defgroup RTCEx_Tamper_Registers_Offset RTC Tamper Registers Offset * @{ */ #if defined (TAMP_CR1_TAMP1E) /* Add this offset to RTC registers base address to reach TAMP registers base address. */ #define TAMP_OFFSET (TAMP_BASE - RTC_BASE) #endif /* TAMP_CR1_TAMP1E */ /** * @} */ /* ========================================================================== */ /* ##### RTC Wake-up exported constants ##### */ /* ========================================================================== */ /** @defgroup RTCEx_Wakeup_Timer_Definitions RTC Wakeup Timer Definitions * @{ */ #define RTC_WAKEUPCLOCK_RTCCLK_DIV16 0x00000000u #define RTC_WAKEUPCLOCK_RTCCLK_DIV8 RTC_CR_WUCKSEL_0 #define RTC_WAKEUPCLOCK_RTCCLK_DIV4 RTC_CR_WUCKSEL_1 #define RTC_WAKEUPCLOCK_RTCCLK_DIV2 (RTC_CR_WUCKSEL_0 | RTC_CR_WUCKSEL_1) #define RTC_WAKEUPCLOCK_CK_SPRE_16BITS RTC_CR_WUCKSEL_2 #define RTC_WAKEUPCLOCK_CK_SPRE_17BITS (RTC_CR_WUCKSEL_1 | RTC_CR_WUCKSEL_2) /** * @} */ /* ========================================================================== */ /* ##### Extended RTC Peripheral Control exported constants ##### */ /* ========================================================================== */ /** @defgroup RTCEx_Smooth_calib_period_Definitions RTC Smooth Calib Period Definitions * @{ */ #define RTC_SMOOTHCALIB_PERIOD_32SEC 0x00000000u /*!< If RTCCLK = 32768 Hz, Smooth calibration period is 32s, else 2exp20 RTCCLK pulses */ #define RTC_SMOOTHCALIB_PERIOD_16SEC RTC_CALR_CALW16 /*!< If RTCCLK = 32768 Hz, Smooth calibration period is 16s, else 2exp19 RTCCLK pulses */ #define RTC_SMOOTHCALIB_PERIOD_8SEC RTC_CALR_CALW8 /*!< If RTCCLK = 32768 Hz, Smooth calibration period is 8s, else 2exp18 RTCCLK pulses */ /** * @} */ /** @defgroup RTCEx_Smooth_calib_Plus_pulses_Definitions RTC Smooth Calib Plus pulses Definitions * @{ */ #define RTC_SMOOTHCALIB_PLUSPULSES_SET RTC_CALR_CALP /*!< The number of RTCCLK pulses added during a X -second window = Y - CALM[8:0] with Y = 512, 256, 128 when X = 32, 16, 8 */ #define RTC_SMOOTHCALIB_PLUSPULSES_RESET 0x00000000u /*!< The number of RTCCLK pulses subbstited during a 32-second window = CALM[8:0] */ /** * @} */ /** @defgroup RTCEx_Calib_Output_selection_Definitions RTC Calib Output Selection Definitions * @{ */ #define RTC_CALIBOUTPUT_512HZ 0x00000000u #define RTC_CALIBOUTPUT_1HZ RTC_CR_COSEL /** * @} */ /** @defgroup RTCEx_Add_1_Second_Parameter_Definitions RTC Add 1 Second Parameter Definitions * @{ */ #define RTC_SHIFTADD1S_RESET 0x00000000u #define RTC_SHIFTADD1S_SET RTC_SHIFTR_ADD1S /** * @} */ /** * @} */ /* Exported macros -----------------------------------------------------------*/ /** @defgroup RTCEx_Exported_Macros RTC Exported Macros * @{ */ /* ========================================================================== */ /* ##### RTC Wake-up exported macros ##### */ /* ========================================================================== */ /** * @brief Enable the RTC WakeUp Timer peripheral. * @param __HANDLE__ specifies the RTC handle. * @retval None */ #define __HAL_RTC_WAKEUPTIMER_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_WUTE)) /** * @brief Disable the RTC WakeUp Timer peripheral. * @param __HANDLE__ specifies the RTC handle. * @retval None */ #define __HAL_RTC_WAKEUPTIMER_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_WUTE)) /** * @brief Enable the RTC WakeUpTimer interrupt. * @param __HANDLE__ specifies the RTC handle. * @param __INTERRUPT__ specifies the RTC WakeUpTimer interrupt sources to be enabled. * This parameter can be: * @arg @ref RTC_IT_WUT WakeUpTimer interrupt * @retval None */ #define __HAL_RTC_WAKEUPTIMER_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__)) /** * @brief Disable the RTC WakeUpTimer interrupt. * @param __HANDLE__ specifies the RTC handle. * @param __INTERRUPT__ specifies the RTC WakeUpTimer interrupt sources to be disabled. * This parameter can be: * @arg @ref RTC_IT_WUT WakeUpTimer interrupt * @retval None */ #define __HAL_RTC_WAKEUPTIMER_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__)) /** * @brief Check whether the specified RTC WakeUpTimer interrupt has occurred or not. * @param __HANDLE__ specifies the RTC handle. * @param __INTERRUPT__ specifies the RTC WakeUpTimer interrupt sources to check. * This parameter can be: * @arg RTC_FLAG_WUTF WakeUpTimer interrupt flag * @retval None */ #if defined(RTC_SR_WUTF) #define __HAL_RTC_WAKEUPTIMER_GET_IT(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->SR) & (__INTERRUPT__)) != 0U) ? 1U : 0U) #endif /* RTC_SR_WUTF */ #if defined(RTC_ISR_WUTF) #define __HAL_RTC_WAKEUPTIMER_GET_IT(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->ISR) & (__INTERRUPT__)) != 0U) ? 1U : 0U) #endif /* RTC_ISR_WUTF */ /** * @brief Check whether the specified RTC Wake Up timer interrupt has been enabled or not. * @param __HANDLE__ specifies the RTC handle. * @param __INTERRUPT__ specifies the RTC Wake Up timer interrupt sources to check. * This parameter can be: * @arg @ref RTC_IT_WUT WakeUpTimer interrupt * @retval None */ #define __HAL_RTC_WAKEUPTIMER_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->CR) & (__INTERRUPT__)) != 0U) ? 1U : 0U) #if defined(RTC_SR_WUTF) /** * @brief Get the selected RTC WakeUpTimer's flag status. * @param __HANDLE__ specifies the RTC handle. * @param __FLAG__ specifies the RTC WakeUpTimer Flag sources to check. * This parameter can be: * @arg @ref RTC_FLAG_WUTF * @retval Flag status */ #define __HAL_RTC_WAKEUPTIMER_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->SR) & (__FLAG__)) != 0U) ? 1U : 0U) #endif /* RTC_SR_WUTF */ #if defined(RTC_ISR_WUTF) /** * @brief Get the selected RTC WakeUpTimer's flag status. * @param __HANDLE__ specifies the RTC handle. * @param __FLAG__ specifies the RTC WakeUpTimer Flag sources to check. * This parameter can be: * @arg @ref RTC_FLAG_WUTF * @arg @ref RTC_FLAG_WUTWF * @retval Flag status */ #define __HAL_RTC_WAKEUPTIMER_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != 0U) ? 1U : 0U) #endif /* RTC_ISR_WUTF */ /** * @brief Clear the RTC Wake Up timer's pending flags. * @param __HANDLE__ specifies the RTC handle. * @param __FLAG__ specifies the RTC WakeUpTimer Flag to clear. * This parameter can be: * @arg @ref RTC_FLAG_WUTF * @retval None */ #if defined(RTC_SCR_CWUTF) #define __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->SCR |= __FLAG__) #endif /* RTC_SCR_CWUTF */ #if defined(RTC_ISR_WUTF) #define __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~((__FLAG__) | RTC_ISR_INIT)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT)) #endif /* RTC_ISR_WUTF */ /* ========================================================================== */ /* ##### RTC Tamper exported macros ##### */ /* ========================================================================== */ /** * @brief Enable the RTC Tamper1 input detection. * @param __HANDLE__ specifies the RTC handle. * @retval None */ #if defined(TAMP_CR1_TAMP1E) #define __HAL_RTC_TAMPER1_ENABLE(__HANDLE__) (((TAMP_TypeDef *)((uint32_t)((__HANDLE__)->Instance) + TAMP_OFFSET))->CR1 |= (TAMP_CR1_TAMP1E)) #endif /* TAMP_CR1_TAMP1E */ #if defined(RTC_TAMPCR_TAMP1E) #define __HAL_RTC_TAMPER1_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->TAMPCR |= (RTC_TAMPCR_TAMP1E)) #endif /* RTC_TAMPCR_TAMP1E */ /** * @brief Disable the RTC Tamper1 input detection. * @param __HANDLE__ specifies the RTC handle. * @retval None */ #if defined(TAMP_CR1_TAMP1E) #define __HAL_RTC_TAMPER1_DISABLE(__HANDLE__) (((TAMP_TypeDef *)((uint32_t)((__HANDLE__)->Instance) + TAMP_OFFSET))->CR1 &= ~(RTC_TAMPCR_TAMP1E)) #endif /* TAMP_CR1_TAMP1E */ #if defined(RTC_TAMPCR_TAMP1E) #define __HAL_RTC_TAMPER1_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->TAMPCR &= ~(RTC_TAMPCR_TAMP1E)) #endif /* RTC_TAMPCR_TAMP1E */ /** * @brief Enable the RTC Tamper2 input detection. * @param __HANDLE__ specifies the RTC handle. * @retval None */ #if defined(TAMP_CR1_TAMP2E) #define __HAL_RTC_TAMPER2_ENABLE(__HANDLE__) (((TAMP_TypeDef *)((uint32_t)((__HANDLE__)->Instance) + TAMP_OFFSET))->CR1 |= (TAMP_CR1_TAMP2E)) #endif /* TAMP_CR1_TAMP2E */ #if defined(RTC_TAMPCR_TAMP2E) #define __HAL_RTC_TAMPER2_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->TAMPCR |= (RTC_TAMPCR_TAMP2E)) #endif /* RTC_TAMPCR_TAMP2E */ /** * @brief Disable the RTC Tamper2 input detection. * @param __HANDLE__ specifies the RTC handle. * @retval None */ #if defined(TAMP_CR1_TAMP2E) #define __HAL_RTC_TAMPER2_DISABLE(__HANDLE__) (((TAMP_TypeDef *)((uint32_t)((__HANDLE__)->Instance) + (TAMP_OFFSET))->CR1 &= ~(RTC_TAMPCR_TAMP2E)) #endif /* TAMP_CR1_TAMP2E */ #if defined(RTC_TAMPCR_TAMP2E) #define __HAL_RTC_TAMPER2_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->TAMPCR &= ~(RTC_TAMPCR_TAMP2E)) #endif /* RTC_TAMPCR_TAMP2E */ /** * @brief Enable the RTC Tamper3 input detection. * @param __HANDLE__ specifies the RTC handle. * @retval None */ #if defined(TAMP_CR1_TAMP3E) #define __HAL_RTC_TAMPER3_ENABLE(__HANDLE__) (((TAMP_TypeDef *)((uint32_t)((__HANDLE__)->Instance) + TAMP_OFFSET))->CR1 |= (TAMP_CR1_TAMP3E)) #endif /* TAMP_CR1_TAMP3E */ #if defined(RTC_TAMPCR_TAMP3E) #define __HAL_RTC_TAMPER3_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->TAMPCR |= (RTC_TAMPCR_TAMP3E)) #endif /* RTC_TAMPCR_TAMP3E */ /** * @brief Disable the RTC Tamper3 input detection. * @param __HANDLE__ specifies the RTC handle. * @retval None */ #if defined(TAMP_CR1_TAMP3E) #define __HAL_RTC_TAMPER3_DISABLE(__HANDLE__) (((TAMP_TypeDef *)((uint32_t)((__HANDLE__)->Instance) + TAMP_OFFSET))->CR1 &= ~(RTC_TAMPCR_TAMP3E)) #endif /* TAMP_CR1_TAMP3E */ #if defined(RTC_TAMPCR_TAMP3E) #define __HAL_RTC_TAMPER3_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->TAMPCR &= ~(RTC_TAMPCR_TAMP3E)) #endif /* RTC_TAMPCR_TAMP3E */ /** * @brief Enable the RTC Tamper interrupt. * @param __HANDLE__ specifies the RTC handle. * @param __INTERRUPT__ specifies the RTC Tamper interrupt sources to be enabled. * This parameter can be any combination of the following values: * @arg RTC_IT_TAMPALL: All tampers interrupts * @arg RTC_IT_TAMP1: Tamper1 interrupt * @arg RTC_IT_TAMP2: Tamper2 interrupt * @arg RTC_IT_TAMP3: Tamper3 interrupt * @retval None */ #if defined(TAMP_IER_TAMP1IE) #define __HAL_RTC_TAMPER_ENABLE_IT(__HANDLE__, __INTERRUPT__) (((TAMP_TypeDef *)((uint32_t)((__HANDLE__)->Instance) + TAMP_OFFSET))->IER |= (__INTERRUPT__)) #endif /* TAMP_IER_TAMP1IE */ #if defined(RTC_TAMPCR_TAMP1IE) #define __HAL_RTC_TAMPER_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->TAMPCR |= (__INTERRUPT__)) #endif /* RTC_TAMPCR_TAMP1IE */ /** * @brief Disable the RTC Tamper interrupt. * @param __HANDLE__ specifies the RTC handle. * @param __INTERRUPT__ specifies the RTC Tamper interrupt sources to be disabled. * This parameter can be any combination of the following values: * @arg RTC_IT_TAMP: All tampers interrupts * @arg RTC_IT_TAMP1: Tamper1 interrupt * @arg RTC_IT_TAMP2: Tamper2 interrupt * @arg RTC_IT_TAMP3: Tamper3 interrupt * @retval None */ #if defined(TAMP_IER_TAMP1IE) #define __HAL_RTC_TAMPER_DISABLE_IT(__HANDLE__, __INTERRUPT__) (((TAMP_TypeDef *)((uint32_t)((__HANDLE__)->Instance) + TAMP_OFFSET))->IER &= ~(__INTERRUPT__)) #endif /* TAMP_IER_TAMP1IE */ #if defined(RTC_TAMPCR_TAMP1IE) #define __HAL_RTC_TAMPER_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->TAMPCR &= ~(__INTERRUPT__)) #endif /* RTC_TAMPCR_TAMP1IE */ /** * @brief Check whether the specified RTC Tamper interrupt has occurred or not. * @param __HANDLE__ specifies the RTC handle. * @param __INTERRUPT__ specifies the RTC Tamper interrupt to check. * This parameter can be: * @arg RTC_FLAG_TAMP1F: Tamper1 interrupt flag * @arg RTC_FLAG_TAMP2F: Tamper2 interrupt flag * @arg RTC_FLAG_TAMP3F: Tamper3 interrupt flag * @retval Flag status */ #if defined(TAMP_SR_TAMP1F) #define __HAL_RTC_TAMPER_GET_IT(__HANDLE__, __INTERRUPT__) ((((((TAMP_TypeDef *)((uint32_t)((__HANDLE__)->Instance) + TAMP_OFFSET))->SR) & (__INTERRUPT__)) != 0U) ? 1U : 0U) #endif /* TAMP_SR_TAMP1F */ #if defined(RTC_ISR_TAMP1F) #define __HAL_RTC_TAMPER_GET_IT(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->ISR) & (__INTERRUPT__)) != 0U) ? 1U : 0U) #endif /* RTC_ISR_TAMP1F */ /** * @brief Check whether the specified RTC Tamper interrupt has been enabled or not. * @param __HANDLE__ specifies the RTC handle. * @param __INTERRUPT__ specifies the RTC Tamper interrupt source to check. * This parameter can be: * @arg RTC_IT_TAMPALL: All tampers interrupts * @arg RTC_IT_TAMP1: Tamper1 interrupt * @arg RTC_IT_TAMP2: Tamper2 interrupt * @arg RTC_IT_TAMP3: Tamper3 interrupt * @retval Flag status */ #if defined(TAMP_IER_TAMP1IE) #define __HAL_RTC_TAMPER_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((((((TAMP_TypeDef *)((uint32_t)((__HANDLE__)->Instance) + TAMP_OFFSET))->IER) & (__INTERRUPT__)) != 0U) ? 1U : 0U) #endif /* TAMP_IER_TAMP1IE */ #if defined(RTC_TAMPCR_TAMP1IE) #define __HAL_RTC_TAMPER_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->TAMPCR) & (__INTERRUPT__)) != 0U) ? 1U : 0U) #endif /* RTC_TAMPCR_TAMP1IE */ /** * @brief Get the selected RTC Tamper's flag status. * @param __HANDLE__ specifies the RTC handle. * @param __FLAG__ specifies the RTC Tamper Flag is pending or not. * This parameter can be: * @arg RTC_FLAG_TAMP1F: Tamper1 flag * @arg RTC_FLAG_TAMP2F: Tamper2 flag * @arg RTC_FLAG_TAMP3F: Tamper3 flag * @retval Flag status */ #if defined(TAMP_SR_TAMP1F) #define __HAL_RTC_TAMPER_GET_FLAG(__HANDLE__, __FLAG__) ((((((TAMP_TypeDef *)((uint32_t)((__HANDLE__)->Instance) + TAMP_OFFSET))->SR) & (__FLAG__)) != 0U) ? 1U : 0U) #endif /* TAMP_SR_TAMP1F */ #if defined(RTC_ISR_TAMP1F) #define __HAL_RTC_TAMPER_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != 0U) ? 1U : 0U) #endif /* RTC_ISR_TAMP1F */ /** * @brief Clear the RTC Tamper's pending flags. * @param __HANDLE__ specifies the RTC handle. * @param __FLAG__ specifies the RTC Tamper Flag to clear. * This parameter can be: * @arg RTC_FLAG_TAMP1F: Tamper1 flag * @arg RTC_FLAG_TAMP2F: Tamper2 flag * @arg RTC_FLAG_TAMP3F: Tamper3 flag * @retval None */ #if defined(TAMP_SCR_CTAMP1F) #define __HAL_RTC_TAMPER_CLEAR_FLAG(__HANDLE__, __FLAG__) ((((TAMP_TypeDef *)((uint32_t)((__HANDLE__)->Instance) + TAMP_OFFSET))->SCR) |= (__FLAG__)) #endif /* TAMP_SCR_CTAMP1F */ #if defined(RTC_ISR_TAMP1F) #define __HAL_RTC_TAMPER_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~((__FLAG__) | RTC_ISR_INIT)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT)) #endif /* RTC_ISR_TAMP1F */ /** * @brief Get the frequency at which each of the Tamper inputs are sampled. * @param __HANDLE__ specifies the RTC handle. * @retval Sampling frequency * This value can be: * @arg RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV32768 * @arg RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV16384 * @arg RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV8192 * @arg RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV4096 * @arg RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV2048 * @arg RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV512 * @arg RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV256 */ #if defined(TAMP_FLTCR_TAMPFREQ) #define __HAL_RTC_TAMPER_GET_SAMPLING_FREQ(__HANDLE__) ((uint32_t)((((TAMP_TypeDef *)((uint32_t)((__HANDLE__)->Instance) + TAMP_OFFSET))->FLTCR) & (RTC_TAMPERSAMPLINGFREQ_RTCCLK_MASK))) #endif /* TAMP_FLTCR_TAMPFREQ */ #if defined(RTC_TAMPCR_TAMPFREQ) #define __HAL_RTC_TAMPER_GET_SAMPLING_FREQ(__HANDLE__) ((uint32_t)(((__HANDLE__)->Instance->TAMPCR) & (RTC_TAMPERSAMPLINGFREQ_RTCCLK_MASK))) #endif /* RTC_TAMPCR_TAMPFREQ */ /** * @brief Get the number of consecutive samples at the specified level needed * to activate a Tamper event. * @param __HANDLE__ specifies the RTC handle. * @retval Number of consecutive samples * This value can be: * @arg RTC_TAMPERFILTER_DISABLE * @arg RTC_TAMPERFILTER_2SAMPLE * @arg RTC_TAMPERFILTER_4SAMPLE * @arg RTC_TAMPERFILTER_8SAMPLE */ #if defined(TAMP_FLTCR_TAMPFLT) #define __HAL_RTC_TAMPER_GET_SAMPLES_COUNT(__HANDLE__) ((uint32_t)((((TAMP_TypeDef *)((uint32_t)((__HANDLE__)->Instance) + TAMP_OFFSET))->FLTCR) & (RTC_TAMPERFILTER_MASK))) #endif /* TAMP_FLTCR_TAMPFLT */ #if defined(RTC_TAMPCR_TAMPFLT) #define __HAL_RTC_TAMPER_GET_SAMPLES_COUNT(__HANDLE__) ((uint32_t)(((__HANDLE__)->Instance->TAMPCR) & (RTC_TAMPERFILTER_MASK))) #endif /* RTC_TAMPCR_TAMPFLT */ /** * @brief Get the pull-up resistors precharge duration. * @param __HANDLE__ specifies the RTC handle. * @retval Number of consecutive samples * This value can be: * @arg RTC_TAMPERPRECHARGEDURATION_1RTCCLK * @arg RTC_TAMPERPRECHARGEDURATION_2RTCCLK * @arg RTC_TAMPERPRECHARGEDURATION_4RTCCLK * @arg RTC_TAMPERPRECHARGEDURATION_8RTCCLK */ #if defined(TAMP_FLTCR_TAMPPRCH) #define __HAL_RTC_TAMPER_GET_PRCHRG_DURATION(__HANDLE__) ((uint32_t)((((TAMP_TypeDef *)((uint32_t)((__HANDLE__)->Instance) + TAMP_OFFSET))->FLTCR) & (RTC_TAMPERPRECHARGEDURATION_MASK))) #endif /* TAMP_FLTCR_TAMPPRCH */ #if defined(RTC_TAMPCR_TAMPPRCH) #define __HAL_RTC_TAMPER_GET_PRCHRG_DURATION(__HANDLE__) ((uint32_t)(((__HANDLE__)->Instance->TAMPCR) & (RTC_TAMPERPRECHARGEDURATION_MASK))) #endif /* RTC_TAMPCR_TAMPPRCH */ /** * @brief Get the pull-up resistors status. * @param __HANDLE__ specifies the RTC handle. * @retval Pull-up resistors status * This value can be: * @arg RTC_TAMPER_PULLUP_ENABLE * @arg RTC_TAMPER_PULLUP_DISABLE */ #if defined(TAMP_FLTCR_TAMPPUDIS) #define __HAL_RTC_TAMPER_GET_PULLUP_STATUS(__HANDLE__) ((uint32_t)((((TAMP_TypeDef *)((uint32_t)((__HANDLE__)->Instance) + TAMP_OFFSET))->FLTCR) & (RTC_TAMPER_PULLUP_MASK))) #endif /* TAMP_FLTCR_TAMPPUDIS */ #if defined(RTC_TAMPCR_TAMPPUDIS) #define __HAL_RTC_TAMPER_GET_PULLUP_STATUS(__HANDLE__) ((uint32_t)(((__HANDLE__)->Instance->TAMPCR) & (RTC_TAMPER_PULLUP_MASK))) #endif /* RTC_TAMPCR_TAMPPUDIS */ /* ========================================================================== */ /* ##### RTC TimeStamp exported macros ##### */ /* ========================================================================== */ /** * @brief Enable the RTC TimeStamp peripheral. * @param __HANDLE__ specifies the RTC handle. * @retval None */ #define __HAL_RTC_TIMESTAMP_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_TSE)) /** * @brief Disable the RTC TimeStamp peripheral. * @param __HANDLE__ specifies the RTC handle. * @retval None */ #define __HAL_RTC_TIMESTAMP_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_TSE)) /** * @brief Enable the RTC TimeStamp interrupt. * @param __HANDLE__ specifies the RTC handle. * @param __INTERRUPT__ specifies the RTC TimeStamp interrupt source to be enabled. * This parameter can be: * @arg @ref RTC_IT_TS TimeStamp interrupt * @retval None */ #define __HAL_RTC_TIMESTAMP_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__)) /** * @brief Disable the RTC TimeStamp interrupt. * @param __HANDLE__ specifies the RTC handle. * @param __INTERRUPT__ specifies the RTC TimeStamp interrupt source to be disabled. * This parameter can be: * @arg @ref RTC_IT_TS TimeStamp interrupt * @retval None */ #define __HAL_RTC_TIMESTAMP_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__)) /** * @brief Check whether the specified RTC TimeStamp interrupt has occurred or not. * @param __HANDLE__ specifies the RTC handle. * @param __INTERRUPT__ specifies the RTC TimeStamp interrupt source to check. * This parameter can be: * @arg @ref RTC_IT_TS TimeStamp interrupt * @retval None */ #if defined(RTC_SR_TSF) #define __HAL_RTC_TIMESTAMP_GET_IT(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->MISR) & ((__INTERRUPT__) >> 12)) != 0U) ? 1U : 0U) #endif /* RTC_SR_TSF */ #if defined(RTC_ISR_TSF) #define __HAL_RTC_TIMESTAMP_GET_IT(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->ISR) & (__INTERRUPT__)) != 0U) ? 1U : 0U) #endif /* RTC_ISR_TSF */ /** * @brief Check whether the specified RTC Time Stamp interrupt has been enabled or not. * @param __HANDLE__ specifies the RTC handle. * @param __INTERRUPT__ specifies the RTC Time Stamp interrupt source to check. * This parameter can be: * @arg @ref RTC_IT_TS TimeStamp interrupt * @retval None */ #define __HAL_RTC_TIMESTAMP_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->CR) & (__INTERRUPT__)) != 0U) ? 1U : 0U) /** * @brief Get the selected RTC TimeStamp's flag status. * @param __HANDLE__ specifies the RTC handle. * @param __FLAG__ specifies the RTC TimeStamp Flag is pending or not. * This parameter can be: * @arg RTC_FLAG_TSF * @arg RTC_FLAG_TSOVF * @retval Flag status */ #if defined(RTC_SR_TSF) #define __HAL_RTC_TIMESTAMP_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->SR) & (__FLAG__)) != 0U) ? 1U : 0U) #endif /* RTC_SR_TSF */ #if defined(RTC_ISR_TSF) #define __HAL_RTC_TIMESTAMP_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != 0U) ? 1U : 0U) #endif /* RTC_ISR_TSF */ /** * @brief Clear the RTC Time Stamp's pending flags. * @param __HANDLE__ specifies the RTC handle. * @param __FLAG__ specifies the RTC Alarm Flag sources to clear. * This parameter can be: * @arg RTC_FLAG_TSF * @arg RTC_FLAG_TSOVF * @retval None */ #if defined(RTC_SCR_CTSF) #define __HAL_RTC_TIMESTAMP_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->SCR |= __FLAG__) #endif /* RTC_SCR_CTSF */ #if defined(RTC_ISR_TSF) #define __HAL_RTC_TIMESTAMP_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR = (~((__FLAG__) | RTC_ISR_INIT)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT))) #endif /* RTC_ISR_TSF */ /** * @brief Enable the RTC internal TimeStamp peripheral. * @param __HANDLE__ specifies the RTC handle. * @retval None */ #define __HAL_RTC_INTERNAL_TIMESTAMP_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_ITSE)) /** * @brief Disable the RTC internal TimeStamp peripheral. * @param __HANDLE__ specifies the RTC handle. * @retval None */ #define __HAL_RTC_INTERNAL_TIMESTAMP_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_ITSE)) /** * @brief Get the selected RTC Internal Time Stamp's flag status. * @param __HANDLE__ specifies the RTC handle. * @param __FLAG__ specifies the RTC Internal Time Stamp Flag is pending or not. * This parameter can be: * @arg RTC_FLAG_ITSF * @retval Flag status */ #if defined(RTC_SR_ITSF) #define __HAL_RTC_INTERNAL_TIMESTAMP_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->SR) & (__FLAG__)) != 0U) ? 1U : 0U) #endif /* RTC_SR_ITSF */ #if defined(RTC_ISR_ITSF) #define __HAL_RTC_INTERNAL_TIMESTAMP_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != 0U) ? 1U : 0U) #endif /* RTC_ISR_ITSF */ /** * @brief Clear the RTC Internal Time Stamp's pending flags. * @param __HANDLE__ specifies the RTC handle. * @param __FLAG__ specifies the RTC Internal Time Stamp Flag source to clear. * This parameter can be: * @arg RTC_FLAG_ITSF * @note This flag must be cleared together with TSF flag. * @retval None */ #if defined(RTC_SCR_CITSF) #define __HAL_RTC_INTERNAL_TIMESTAMP_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->SCR |= __FLAG__) #endif /* RTC_SCR_CITSF */ #if defined(RTC_ISR_ITSF) #define __HAL_RTC_INTERNAL_TIMESTAMP_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR = (~((__FLAG__) | RTC_ISR_INIT)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT))) #endif /* RTC_ISR_ITSF */ /** * @brief Enable the RTC TimeStamp on Tamper detection. * @param __HANDLE__ specifies the RTC handle. * @retval None */ #if defined(RTC_CR_TAMPTS) #define __HAL_RTC_TAMPTS_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_TIMESTAMPONTAMPERDETECTION_MASK)) #endif /* RTC_CR_TAMPTS */ #if defined(RTC_TAMPCR_TAMPTS) #define __HAL_RTC_TAMPTS_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->TAMPCR |= (RTC_TIMESTAMPONTAMPERDETECTION_MASK)) #endif /* RTC_TAMPCR_TAMPTS */ /** * @brief Disable the RTC TimeStamp on Tamper detection. * @param __HANDLE__ specifies the RTC handle. * @retval None */ #if defined(RTC_CR_TAMPTS) #define __HAL_RTC_TAMPTS_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_TIMESTAMPONTAMPERDETECTION_MASK)) #endif /* RTC_CR_TAMPTS */ #if defined(RTC_TAMPCR_TAMPTS) #define __HAL_RTC_TAMPTS_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->TAMPCR &= ~(RTC_TIMESTAMPONTAMPERDETECTION_MASK)) #endif /* RTC_TAMPCR_TAMPTS */ /** * @brief Get activation status of the RTC TimeStamp on Tamper detection. * @param __HANDLE__ specifies the RTC handle. * @retval Activation status of TimeStamp on Tamper detection * This value can be: * @arg RTC_TIMESTAMPONTAMPERDETECTION_ENABLE * @arg RTC_TIMESTAMPONTAMPERDETECTION_DISABLE */ #if defined(RTC_CR_TAMPTS) #define __HAL_RTC_TAMPTS_GET_STATUS(__HANDLE__) ((__HANDLE__)->Instance->CR &= RTC_TIMESTAMPONTAMPERDETECTION_MASK) #endif /* RTC_CR_TAMPTS */ #if defined(RTC_TAMPCR_TAMPTS) #define __HAL_RTC_TAMPTS_GET_STATUS(__HANDLE__) ((__HANDLE__)->Instance->TAMPCR &= RTC_TIMESTAMPONTAMPERDETECTION_MASK) #endif /* RTC_TAMPCR_TAMPTS */ #if defined(RTC_CR_TAMPOE) /** * @brief Enable the RTC Tamper detection output. * @param __HANDLE__ specifies the RTC handle. * @retval None */ #define __HAL_RTC_TAMPOE_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_TAMPOE)) /** * @brief Disable the RTC Tamper detection output. * @param __HANDLE__ specifies the RTC handle. * @retval None */ #define __HAL_RTC_TAMPOE_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_TAMPOE)) #endif /* RTC_CR_TAMPOE */ /* ========================================================================== */ /* ##### Extended RTC Peripheral Control exported macros ##### */ /* ========================================================================== */ /** * @brief Enable the RTC calibration output. * @param __HANDLE__ specifies the RTC handle. * @retval None */ #define __HAL_RTC_CALIBRATION_OUTPUT_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_COE)) /** * @brief Disable the calibration output. * @param __HANDLE__ specifies the RTC handle. * @retval None */ #define __HAL_RTC_CALIBRATION_OUTPUT_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_COE)) /** * @brief Enable the clock reference detection. * @param __HANDLE__ specifies the RTC handle. * @retval None */ #define __HAL_RTC_CLOCKREF_DETECTION_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_REFCKON)) /** * @brief Disable the clock reference detection. * @param __HANDLE__ specifies the RTC handle. * @retval None */ #define __HAL_RTC_CLOCKREF_DETECTION_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_REFCKON)) /** * @brief Get the selected RTC shift operation's flag status. * @param __HANDLE__ specifies the RTC handle. * @param __FLAG__ specifies the RTC shift operation Flag is pending or not. * This parameter can be: * @arg RTC_FLAG_SHPF * @retval Flag status */ #if defined(RTC_ICSR_SHPF) #define __HAL_RTC_SHIFT_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ICSR) & (__FLAG__)) != 0U) ? 1U : 0U) #endif /* RTC_ICSR_SHPF */ #if defined(RTC_ISR_SHPF) #define __HAL_RTC_SHIFT_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != 0U) ? 1U : 0U) #endif /* RTC_ISR_SHPF */ /* ========================================================================== */ /* ##### RTC Wake-up Interrupt exported macros ##### */ /* ========================================================================== */ /** * @brief Enable interrupt on the RTC WakeUp Timer associated Exti line. * @retval None */ #if defined(EXTI_D1) #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_IT() (EXTI_D1->IMR1 |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT) #else /* EXTI */ #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_IT() (EXTI->IMR1 |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT) #endif /* EXTI_D1 */ /** * @brief Disable interrupt on the RTC WakeUp Timer associated Exti line. * @retval None */ #if defined(EXTI_D1) #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_IT() (EXTI_D1->IMR1 &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT)) #else /* EXTI */ #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_IT() (EXTI->IMR1 &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT)) #endif /* EXTI_D1 */ /** * @brief Enable event on the RTC WakeUp Timer associated Exti line. * @retval None */ #if defined(EXTI_D1) #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_EVENT() (EXTI_D1->EMR1 |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT) #else /* EXTI */ #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_EVENT() (EXTI->EMR1 |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT) #endif /* EXTI_D1 */ /** * @brief Disable event on the RTC WakeUp Timer associated Exti line. * @retval None */ #if defined(EXTI_D1) #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_EVENT() (EXTI_D1->EMR1 &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT)) #else /* EXTI */ #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_EVENT() (EXTI->EMR1 &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT)) #endif /* EXTI_D1 */ /** * @brief Enable event on the RTC WakeUp Timer associated D3 Exti line. * @retval None */ #define __HAL_RTC_WAKEUPTIMER_EXTID3_ENABLE_EVENT() (EXTI->D3PMR1 |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT) /** * @brief Disable event on the RTC WakeUp Timer associated D3 Exti line. * @retval None */ #define __HAL_RTC_WAKEUPTIMER_EXTID3_DISABLE_EVENT() (EXTI->D3PMR1 &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT)) #if defined(DUAL_CORE) /** * @brief Enable interrupt on the RTC WakeUp Timer associated D2 Exti line. * @retval None */ #define __HAL_RTC_WAKEUPTIMER_EXTID2_ENABLE_IT() (EXTI_D2->IMR1 |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT) /** * @brief Disable interrupt on the RTC WakeUp Timer associated D2 Exti line. * @retval None */ #define __HAL_RTC_WAKEUPTIMER_EXTID2_DISABLE_IT() (EXTI_D2->IMR1 &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT)) /** * @brief Enable event on the RTC WakeUp Timer associated D2 Exti line. * @retval None */ #define __HAL_RTC_WAKEUPTIMER_EXTID2_ENABLE_EVENT() (EXTI_D2->EMR1 |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT) /** * @brief Disable event on the RTC WakeUp Timer associated D2 Exti line. * @retval None */ #define __HAL_RTC_WAKEUPTIMER_EXTID2_DISABLE_EVENT() (EXTI_D2->EMR1 &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT)) #endif /* DUAL_CORE */ /** * @brief Enable falling edge trigger on the RTC WakeUp Timer associated Exti line. * @retval None */ #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_FALLING_EDGE() (EXTI->FTSR1 |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT) /** * @brief Disable falling edge trigger on the RTC WakeUp Timer associated Exti line. * @retval None */ #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_FALLING_EDGE() (EXTI->FTSR1 &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT)) /** * @brief Enable rising edge trigger on the RTC WakeUp Timer associated Exti line. * @retval None */ #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_RISING_EDGE() (EXTI->RTSR1 |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT) /** * @brief Disable rising edge trigger on the RTC WakeUp Timer associated Exti line. * @retval None */ #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_RISING_EDGE() (EXTI->RTSR1 &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT)) /** * @brief Enable rising & falling edge trigger on the RTC WakeUp Timer associated Exti line. * @retval None */ #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_RISING_FALLING_EDGE() do { \ __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_RISING_EDGE(); \ __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_FALLING_EDGE(); \ } while(0) /** * @brief Disable rising & falling edge trigger on the RTC WakeUp Timer associated Exti line. * This parameter can be: * @retval None */ #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_RISING_FALLING_EDGE() do { \ __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_RISING_EDGE(); \ __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_FALLING_EDGE(); \ } while(0) /** * @brief Check whether the RTC WakeUp Timer associated Exti line interrupt flag is set or not. * @retval Line Status. */ #if defined(EXTI_D1) #define __HAL_RTC_WAKEUPTIMER_EXTI_GET_FLAG() (EXTI_D1->PR1 & RTC_EXTI_LINE_WAKEUPTIMER_EVENT) #else /* EXTI */ #define __HAL_RTC_WAKEUPTIMER_EXTI_GET_FLAG() (EXTI->PR1 & RTC_EXTI_LINE_WAKEUPTIMER_EVENT) #endif /* EXTI_D1 */ /** * @brief Clear the RTC WakeUp Timer associated Exti line flag. * @retval None */ #if defined(EXTI_D1) #define __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG() (EXTI_D1->PR1 = RTC_EXTI_LINE_WAKEUPTIMER_EVENT) #else /* EXTI */ #define __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG() (EXTI->PR1 = RTC_EXTI_LINE_WAKEUPTIMER_EVENT) #endif /* EXTI_D1 */ /** * @brief Check whether the RTC WakeUp Timer associated D3 Exti line interrupt flag is set or not. * @retval Line Status */ #define __HAL_RTC_WAKEUPTIMER_EXTID3_GET_FLAG() (EXTI_D3->PR1 & RTC_EXTI_LINE_WAKEUPTIMER_EVENT) /** * @brief Clear the RTC WakeUp Timer associated D3 Exti line flag. * @retval None. */ #define __HAL_RTC_WAKEUPTIMER_EXTID3_CLEAR_FLAG() (EXTI_D3->PR1 = RTC_EXTI_LINE_WAKEUPTIMER_EVENT) /** * @brief Generate a Software interrupt on the RTC WakeUp Timer associated Exti line. * @retval None. */ #define __HAL_RTC_WAKEUPTIMER_EXTI_GENERATE_SWIT() (EXTI->SWIER1 |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT) #if defined(DUAL_CORE) /** * @brief Check whether the RTC WakeUp Timer associated D2 Exti line interrupt flag is set or not. * @retval Line Status. */ #define __HAL_RTC_WAKEUPTIMER_EXTID2_GET_FLAG() (EXTI_D2->PR1 & RTC_EXTI_LINE_WAKEUPTIMER_EVENT) /** * @brief Clear the RTC WakeUp Timer associated D2 Exti line flag. * @retval None. */ #define __HAL_RTC_WAKEUPTIMER_EXTID2_CLEAR_FLAG() (EXTI_D2->PR1 = RTC_EXTI_LINE_WAKEUPTIMER_EVENT) #endif /* DUAL_CORE */ /* ========================================================================== */ /* ##### RTC TimeStamp and Tamper Interrupt exported macros ##### */ /* ========================================================================== */ /** * @brief Enable interrupt on the RTC Tamper and Timestamp associated Exti line. * @retval None */ #if defined(EXTI_D1) #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_IT() (EXTI_D1->IMR1 |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT) #else /* EXTI */ #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_IT() (EXTI->IMR1 |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT) #endif /* EXTI_D1 */ /** * @brief Disable interrupt on the RTC Tamper and Timestamp associated Exti line. * @retval None */ #if defined(EXTI_D1) #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_IT() (EXTI_D1->IMR1 &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)) #else /* EXTI */ #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_IT() (EXTI->IMR1 &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)) #endif /* EXTI_D1 */ /** * @brief Enable event on the RTC Tamper and Timestamp associated Exti line. * @retval None */ #if defined(EXTI_D1) #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_EVENT() (EXTI_D1->EMR1 |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT) #else /* EXTI */ #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_EVENT() (EXTI->EMR1 |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT) #endif /* EXTI_D1 */ /** * @brief Disable event on the RTC Tamper and Timestamp associated Exti line. * @retval None */ #if defined(EXTI_D1) #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_EVENT() (EXTI_D1->EMR1 &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)) #else /* EXTI */ #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_EVENT() (EXTI->EMR1 &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)) #endif /* EXTI_D1 */ #if defined(DUAL_CORE) /** * @brief Enable interrupt on the RTC Tamper and Timestamp associated D2 Exti line. * @retval None */ #define __HAL_RTC_TAMPER_TIMESTAMP_EXTID2_ENABLE_IT() (EXTI_D2->IMR1 |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT) /** * @brief Disable interrupt on the RTC Tamper and Timestamp associated D2 Exti line. * @retval None */ #define __HAL_RTC_TAMPER_TIMESTAMP_EXTID2_DISABLE_IT() (EXTI_D2->IMR1 &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)) /** * @brief Enable event on the RTC Tamper and Timestamp associated D2 Exti line. * @retval None */ #define __HAL_RTC_TAMPER_TIMESTAMP_EXTID2_ENABLE_EVENT() (EXTI_D2->EMR1 |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT) /** * @brief Disable event on the RTC Tamper and Timestamp associated D2 Exti line. * @retval None */ #define __HAL_RTC_TAMPER_TIMESTAMP_EXTID2_DISABLE_EVENT() (EXTI_D2->EMR1 &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)) #endif /* DUAL_CORE */ /** * @brief Enable falling edge trigger on the RTC Tamper and Timestamp associated Exti line. * @retval None */ #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_FALLING_EDGE() (EXTI->FTSR1 |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT) /** * @brief Disable falling edge trigger on the RTC Tamper and Timestamp associated Exti line. * @retval None */ #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_FALLING_EDGE() (EXTI->FTSR1 &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)) /** * @brief Enable rising edge trigger on the RTC Tamper and Timestamp associated Exti line. * @retval None */ #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_RISING_EDGE() (EXTI->RTSR1 |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT) /** * @brief Disable rising edge trigger on the RTC Tamper and Timestamp associated Exti line. * @retval None */ #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_RISING_EDGE() (EXTI->RTSR1 &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)) /** * @brief Enable rising & falling edge trigger on the RTC Tamper and Timestamp associated Exti line. * @retval None */ #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_RISING_FALLING_EDGE() do { \ __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_RISING_EDGE(); \ __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_FALLING_EDGE(); \ } while(0) /** * @brief Disable rising & falling edge trigger on the RTC Tamper and Timestamp associated Exti line. * @retval None */ #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_RISING_FALLING_EDGE() do { \ __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_RISING_EDGE(); \ __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_FALLING_EDGE(); \ } while(0) /** * @brief Check whether the RTC Tamper and Timestamp associated Exti line interrupt flag is set or not. * @retval Line Status */ #if defined(EXTI_D1) #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_GET_FLAG() (EXTI_D1->PR1 & RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT) #else /* EXTI */ #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_GET_FLAG() (EXTI->PR1 & RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT) #endif /* EXTI_D1 */ /** * @brief Clear the RTC Tamper and Timestamp associated Exti line flag. * @retval None */ #if defined(EXTI_D1) #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_CLEAR_FLAG() (EXTI_D1->PR1 = RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT) #else /* EXTI */ #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_CLEAR_FLAG() (EXTI->PR1 = RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT) #endif /* EXTI_D1 */ #if defined(DUAL_CORE) /** * @brief Check whether the RTC Tamper and Timestamp associated D2 Exti line interrupt flag is set or not. * @retval Line Status */ #define __HAL_RTC_TAMPER_TIMESTAMP_EXTID2_GET_FLAG() (EXTI_D2->PR1 & RTC_EXTI_LINE_WAKEUPTIMER_EVENT) /** * @brief Clear the RTC Tamper and Timestamp associated D2 Exti line flag. * @retval None */ #define __HAL_RTC_TAMPER_TIMESTAMP_EXTID2_CLEAR_FLAG() (EXTI_D2->PR1 = RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT) #endif /* DUAL_CORE */ /** * @brief Generate a Software interrupt on the RTC Tamper and Timestamp associated Exti line * @retval None */ #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_GENERATE_SWIT() (EXTI->SWIER1 |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT) /** * @} */ /* Exported functions --------------------------------------------------------*/ /** @defgroup RTCEx_Exported_Functions RTC Exported Functions * @{ */ /* ========================================================================== */ /* ##### RTC TimeStamp exported functions ##### */ /* ========================================================================== */ /* RTC TimeStamp functions ****************************************************/ /** @defgroup RTCEx_Exported_Functions_Group1 Extended RTC TimeStamp functions * @{ */ HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp(RTC_HandleTypeDef *hrtc, uint32_t TimeStampEdge, uint32_t RTC_TimeStampPin); HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp_IT(RTC_HandleTypeDef *hrtc, uint32_t TimeStampEdge, uint32_t RTC_TimeStampPin); HAL_StatusTypeDef HAL_RTCEx_DeactivateTimeStamp(RTC_HandleTypeDef *hrtc); HAL_StatusTypeDef HAL_RTCEx_SetInternalTimeStamp(RTC_HandleTypeDef *hrtc); HAL_StatusTypeDef HAL_RTCEx_DeactivateInternalTimeStamp(RTC_HandleTypeDef *hrtc); HAL_StatusTypeDef HAL_RTCEx_GetTimeStamp(RTC_HandleTypeDef *hrtc, RTC_TimeTypeDef *sTimeStamp, RTC_DateTypeDef *sTimeStampDate, uint32_t Format); void HAL_RTCEx_TamperTimeStampIRQHandler(RTC_HandleTypeDef *hrtc); void HAL_RTCEx_TimeStampEventCallback(RTC_HandleTypeDef *hrtc); HAL_StatusTypeDef HAL_RTCEx_PollForTimeStampEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout); /** * @} */ /* ========================================================================== */ /* ##### RTC Tamper exported functions ##### */ /* ========================================================================== */ /* RTC Tamper functions *******************************************************/ /** @defgroup RTCEx_Exported_Functions_Group5 Extended RTC Tamper functions * @{ */ HAL_StatusTypeDef HAL_RTCEx_SetTamper(RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef *sTamper); HAL_StatusTypeDef HAL_RTCEx_SetTamper_IT(RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef *sTamper); HAL_StatusTypeDef HAL_RTCEx_DeactivateTamper(RTC_HandleTypeDef *hrtc, uint32_t Tamper); #if defined(RTC_TAMPER_1) HAL_StatusTypeDef HAL_RTCEx_PollForTamper1Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout); #endif /* RTC_TAMPER_1 */ #if defined(RTC_TAMPER_2) HAL_StatusTypeDef HAL_RTCEx_PollForTamper2Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout); #endif /* RTC_TAMPER_2 */ #if defined(RTC_TAMPER_3) HAL_StatusTypeDef HAL_RTCEx_PollForTamper3Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout); #endif /* RTC_TAMPER_3 */ #if defined(RTC_TAMPER_1) void HAL_RTCEx_Tamper1EventCallback(RTC_HandleTypeDef *hrtc); #endif /* RTC_TAMPER_1 */ #if defined(RTC_TAMPER_2) void HAL_RTCEx_Tamper2EventCallback(RTC_HandleTypeDef *hrtc); #endif /* RTC_TAMPER_2 */ #if defined(RTC_TAMPER_3) void HAL_RTCEx_Tamper3EventCallback(RTC_HandleTypeDef *hrtc); #endif /* RTC_TAMPER_3 */ #if defined(TAMP_CR1_ITAMP1E) HAL_StatusTypeDef HAL_RTCEx_SetInternalTamper(RTC_HandleTypeDef *hrtc, RTC_InternalTamperTypeDef *sIntTamper); HAL_StatusTypeDef HAL_RTCEx_SetInternalTamper_IT(RTC_HandleTypeDef *hrtc, RTC_InternalTamperTypeDef *sIntTamper); HAL_StatusTypeDef HAL_RTCEx_DeactivateInternalTamper(RTC_HandleTypeDef *hrtc, uint32_t IntTamper); HAL_StatusTypeDef HAL_RTCEx_PollForInternalTamperEvent(RTC_HandleTypeDef *hrtc, uint32_t IntTamper, uint32_t Timeout); #endif /* TAMP_CR1_ITAMP1E */ void HAL_RTCEx_InternalTamper1EventCallback(RTC_HandleTypeDef *hrtc); void HAL_RTCEx_InternalTamper2EventCallback(RTC_HandleTypeDef *hrtc); void HAL_RTCEx_InternalTamper3EventCallback(RTC_HandleTypeDef *hrtc); void HAL_RTCEx_InternalTamper4EventCallback(RTC_HandleTypeDef *hrtc); void HAL_RTCEx_InternalTamper5EventCallback(RTC_HandleTypeDef *hrtc); void HAL_RTCEx_InternalTamper6EventCallback(RTC_HandleTypeDef *hrtc); void HAL_RTCEx_InternalTamper8EventCallback(RTC_HandleTypeDef *hrtc); #if defined(TAMP_ATCR1_TAMP1AM) HAL_StatusTypeDef HAL_RTCEx_SetActiveTampers(RTC_HandleTypeDef *hrtc, RTC_ActiveTampersTypeDef *sAllTamper); #endif /* TAMP_ATCR1_TAMP1AM */ #if defined(TAMP_ATSEEDR_SEED) HAL_StatusTypeDef HAL_RTCEx_SetActiveSeed(RTC_HandleTypeDef *hrtc, uint32_t *pSeed); #endif /* TAMP_ATSEEDR_SEED */ #if defined(TAMP_ATCR1_TAMP1AM) HAL_StatusTypeDef HAL_RTCEx_DeactivateActiveTampers(RTC_HandleTypeDef *hrtc); #endif /* TAMP_ATCR1_TAMP1AM */ /** * @} */ /* ========================================================================== */ /* ##### RTC Wake-up exported functions ##### */ /* ========================================================================== */ /* RTC Wake-up functions ******************************************************/ /** @defgroup RTCEx_Exported_Functions_Group2 Extended RTC Wake-up functions * @{ */ HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock); HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer_IT(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock); HAL_StatusTypeDef HAL_RTCEx_DeactivateWakeUpTimer(RTC_HandleTypeDef *hrtc); uint32_t HAL_RTCEx_GetWakeUpTimer(RTC_HandleTypeDef *hrtc); void HAL_RTCEx_WakeUpTimerIRQHandler(RTC_HandleTypeDef *hrtc); void HAL_RTCEx_WakeUpTimerEventCallback(RTC_HandleTypeDef *hrtc); HAL_StatusTypeDef HAL_RTCEx_PollForWakeUpTimerEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout); /** * @} */ /* ========================================================================== */ /* ##### Extended RTC Backup registers exported functions ##### */ /* ========================================================================== */ /* Extended RTC Backup registers functions ************************************/ /** @defgroup RTCEx_Exported_Functions_Group6 Extended RTC Backup register functions * @{ */ void HAL_RTCEx_BKUPWrite(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister, uint32_t Data); uint32_t HAL_RTCEx_BKUPRead(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister); /** * @} */ /* ========================================================================== */ /* ##### Extended RTC Peripheral Control exported functions ##### */ /* ========================================================================== */ /* Extended RTC Peripheral Control functions **********************************/ /** @defgroup RTCEx_Exported_Functions_Group3 Extended Peripheral Control functions * @{ */ HAL_StatusTypeDef HAL_RTCEx_SetSmoothCalib(RTC_HandleTypeDef *hrtc, uint32_t SmoothCalibPeriod, uint32_t SmoothCalibPlusPulses, uint32_t SmoothCalibMinusPulsesValue); HAL_StatusTypeDef HAL_RTCEx_SetSynchroShift(RTC_HandleTypeDef *hrtc, uint32_t ShiftAdd1S, uint32_t ShiftSubFS); HAL_StatusTypeDef HAL_RTCEx_SetCalibrationOutPut(RTC_HandleTypeDef *hrtc, uint32_t CalibOutput); HAL_StatusTypeDef HAL_RTCEx_DeactivateCalibrationOutPut(RTC_HandleTypeDef *hrtc); HAL_StatusTypeDef HAL_RTCEx_SetRefClock(RTC_HandleTypeDef *hrtc); HAL_StatusTypeDef HAL_RTCEx_DeactivateRefClock(RTC_HandleTypeDef *hrtc); HAL_StatusTypeDef HAL_RTCEx_EnableBypassShadow(RTC_HandleTypeDef *hrtc); HAL_StatusTypeDef HAL_RTCEx_DisableBypassShadow(RTC_HandleTypeDef *hrtc); #if defined(TAMP_COUNTR) HAL_StatusTypeDef HAL_RTCEx_MonotonicCounterIncrement(RTC_HandleTypeDef *hrtc, uint32_t Instance); HAL_StatusTypeDef HAL_RTCEx_MonotonicCounterGet(RTC_HandleTypeDef *hrtc, uint32_t *Counter, uint32_t Instance); #endif /* TAMP_COUNTR */ /** * @} */ /* Extended RTC features functions *******************************************/ /** @defgroup RTCEx_Exported_Functions_Group4 Extended features functions * @{ */ void HAL_RTCEx_AlarmBEventCallback(RTC_HandleTypeDef *hrtc); HAL_StatusTypeDef HAL_RTCEx_PollForAlarmBEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout); /** * @} */ /** * @} */ /* Private types -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ /* Private constants ---------------------------------------------------------*/ /** @defgroup RTCEx_Private_Constants RTC Private Constants * @{ */ #define RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT EXTI_IMR1_IM18 /*!< External interrupt line 18 Connected to the RTC Tamper and Time Stamp events */ #define RTC_EXTI_LINE_WAKEUPTIMER_EVENT EXTI_IMR1_IM19 /*!< External interrupt line 19 Connected to the RTC Wakeup event */ /* Masks Definition */ #define RTC_TAMPER_X ((uint32_t) (RTC_TAMPER_1 | RTC_TAMPER_2 | RTC_TAMPER_3)) #define RTC_TAMPER_X_INTERRUPT ((uint32_t) (RTC_IT_TAMP1 | RTC_IT_TAMP2 | RTC_IT_TAMP3)) /** * @} */ /* Private macros ------------------------------------------------------------*/ /** @defgroup RTCEx_Private_Macros RTC Private Macros * @{ */ /** @defgroup RTCEx_IS_RTC_Definitions Private macros to check input parameters * @{ */ /* ========================================================================== */ /* ##### Extended RTC Backup registers private macros ##### */ /* ========================================================================== */ #define IS_RTC_BKP(__BKP__) ((__BKP__) < BKP_REG_NUMBER) /* ========================================================================== */ /* ##### RTC TimeStamp private macros ##### */ /* ========================================================================== */ #define IS_TIMESTAMP_EDGE(EDGE) (((EDGE) == RTC_TIMESTAMPEDGE_RISING) || \ ((EDGE) == RTC_TIMESTAMPEDGE_FALLING)) #define IS_RTC_TIMESTAMP_PIN(PIN) (((PIN) == RTC_TIMESTAMPPIN_DEFAULT)) /* ========================================================================== */ /* ##### RTC Wake-up private macros ##### */ /* ========================================================================== */ #define IS_RTC_WAKEUP_CLOCK(CLOCK) (((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV16) || \ ((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV8) || \ ((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV4) || \ ((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV2) || \ ((CLOCK) == RTC_WAKEUPCLOCK_CK_SPRE_16BITS) || \ ((CLOCK) == RTC_WAKEUPCLOCK_CK_SPRE_17BITS)) #define IS_RTC_WAKEUP_COUNTER(COUNTER) ((COUNTER) <= RTC_WUTR_WUT) /* ========================================================================== */ /* ##### RTC Smooth Calibration private macros ##### */ /* ========================================================================== */ #define IS_RTC_SMOOTH_CALIB_PERIOD(PERIOD) (((PERIOD) == RTC_SMOOTHCALIB_PERIOD_32SEC) || \ ((PERIOD) == RTC_SMOOTHCALIB_PERIOD_16SEC) || \ ((PERIOD) == RTC_SMOOTHCALIB_PERIOD_8SEC)) #define IS_RTC_SMOOTH_CALIB_PLUS(PLUS) (((PLUS) == RTC_SMOOTHCALIB_PLUSPULSES_SET) || \ ((PLUS) == RTC_SMOOTHCALIB_PLUSPULSES_RESET)) #define IS_RTC_SMOOTH_CALIB_MINUS(VALUE) ((VALUE) <= RTC_CALR_CALM) /* ========================================================================== */ /* ##### Extended RTC Peripheral Control private macros ##### */ /* ========================================================================== */ #define IS_RTC_SHIFT_ADD1S(SEL) (((SEL) == RTC_SHIFTADD1S_RESET) || \ ((SEL) == RTC_SHIFTADD1S_SET)) #define IS_RTC_SHIFT_SUBFS(FS) ((FS) <= RTC_SHIFTR_SUBFS) #define IS_RTC_CALIB_OUTPUT(OUTPUT) (((OUTPUT) == RTC_CALIBOUTPUT_512HZ) || \ ((OUTPUT) == RTC_CALIBOUTPUT_1HZ)) /* ========================================================================== */ /* ##### RTC Tamper private macros ##### */ /* ========================================================================== */ #define IS_RTC_TAMPER(__TAMPER__) ((((__TAMPER__) & RTC_TAMPER_X) != 0x00U) && \ (((__TAMPER__) & ~RTC_TAMPER_X) == 0x00U)) #if defined(RTC_ALL_TAMPER_INTERRUPT) #define IS_RTC_TAMPER_INTERRUPT(__INTERRUPT__) \ ((((__INTERRUPT__) & ( RTC_TAMPER_X_INTERRUPT | RTC_ALL_TAMPER_INTERRUPT )) != 0x00U) && \ (((__INTERRUPT__) & (~(RTC_TAMPER_X_INTERRUPT | RTC_ALL_TAMPER_INTERRUPT))) == 0x00U)) #else /* RTC_ALL_TAMPER_INTERRUPT not defined */ #define IS_RTC_TAMPER_INTERRUPT(__INTERRUPT__) \ ((((__INTERRUPT__) & RTC_TAMPER_X_INTERRUPT ) != 0x00U) && \ (((__INTERRUPT__) & (~RTC_TAMPER_X_INTERRUPT)) == 0x00U)) #endif /* RTC_ALL_TAMPER_INTERRUPT */ #define IS_RTC_TAMPER_TRIGGER(__TRIGGER__) (((__TRIGGER__) == RTC_TAMPERTRIGGER_RISINGEDGE) || \ ((__TRIGGER__) == RTC_TAMPERTRIGGER_FALLINGEDGE) || \ ((__TRIGGER__) == RTC_TAMPERTRIGGER_LOWLEVEL) || \ ((__TRIGGER__) == RTC_TAMPERTRIGGER_HIGHLEVEL)) #define IS_RTC_TAMPER_ERASE_MODE(__MODE__) (((__MODE__) == RTC_TAMPER_ERASE_BACKUP_ENABLE) || \ ((__MODE__) == RTC_TAMPER_ERASE_BACKUP_DISABLE)) #define IS_RTC_TAMPER_MASKFLAG_STATE(__STATE__) (((__STATE__) == RTC_TAMPERMASK_FLAG_ENABLE) || \ ((__STATE__) == RTC_TAMPERMASK_FLAG_DISABLE)) #define IS_RTC_TAMPER_FILTER(__FILTER__) (((__FILTER__) == RTC_TAMPERFILTER_DISABLE) || \ ((__FILTER__) == RTC_TAMPERFILTER_2SAMPLE) || \ ((__FILTER__) == RTC_TAMPERFILTER_4SAMPLE) || \ ((__FILTER__) == RTC_TAMPERFILTER_8SAMPLE)) #define IS_RTC_TAMPER_SAMPLING_FREQ(__FREQ__) (((__FREQ__) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV32768)|| \ ((__FREQ__) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV16384)|| \ ((__FREQ__) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV8192) || \ ((__FREQ__) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV4096) || \ ((__FREQ__) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV2048) || \ ((__FREQ__) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV1024) || \ ((__FREQ__) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV512) || \ ((__FREQ__) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV256)) #define IS_RTC_TAMPER_PRECHARGE_DURATION(__DURATION__) (((__DURATION__) == RTC_TAMPERPRECHARGEDURATION_1RTCCLK) || \ ((__DURATION__) == RTC_TAMPERPRECHARGEDURATION_2RTCCLK) || \ ((__DURATION__) == RTC_TAMPERPRECHARGEDURATION_4RTCCLK) || \ ((__DURATION__) == RTC_TAMPERPRECHARGEDURATION_8RTCCLK)) #define IS_RTC_TAMPER_PULLUP_STATE(__STATE__) (((__STATE__) == RTC_TAMPER_PULLUP_ENABLE) || \ ((__STATE__) == RTC_TAMPER_PULLUP_DISABLE)) #define IS_RTC_TAMPER_TIMESTAMPONTAMPER_DETECTION(__DETECTION__) (((__DETECTION__) == RTC_TIMESTAMPONTAMPERDETECTION_ENABLE) || \ ((__DETECTION__) == RTC_TIMESTAMPONTAMPERDETECTION_DISABLE)) #if defined(RTC_CR_TAMPOE) #define IS_RTC_TAMPER_TAMPERDETECTIONOUTPUT(__MODE__) (((__MODE__) == RTC_TAMPERDETECTIONOUTPUT_ENABLE) || \ ((__MODE__) == RTC_TAMPERDETECTIONOUTPUT_DISABLE)) #endif /* RTC_CR_TAMPOE */ #define IS_RTC_TAMPER_FILTER_CONFIG_CORRECT(FILTER, TRIGGER) \ ( ( ((FILTER) != RTC_TAMPERFILTER_DISABLE) \ && ( ((TRIGGER) == RTC_TAMPERTRIGGER_LOWLEVEL) \ || ((TRIGGER) == RTC_TAMPERTRIGGER_HIGHLEVEL))) \ || ( ((FILTER) == RTC_TAMPERFILTER_DISABLE) \ && ( ((TRIGGER) == RTC_TAMPERTRIGGER_RISINGEDGE) \ || ((TRIGGER) == RTC_TAMPERTRIGGER_FALLINGEDGE)))) #define IS_RTC_INTERNAL_TAMPER(__INT_TAMPER__) ((((__INT_TAMPER__) & RTC_INT_TAMPER_ALL) != 0x00U) && \ (((__INT_TAMPER__) & ~RTC_INT_TAMPER_ALL) == 0x00U)) /** * @} */ /** * @} */ /** * @} */ /** * @} */ #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* STM32H7xx_HAL_RTC_EX_H */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
{ "content_hash": "84f00b91221d2d49ab375e67f2da0e04", "timestamp": "", "source": "github", "line_count": 2076, "max_line_length": 187, "avg_line_length": 46.08911368015414, "alnum_prop": 0.561438530115697, "repo_name": "nongxiaoming/rt-thread", "id": "833ae6f9c7f035f63fbf9f4a1fe2e90a0677e965", "size": "96451", "binary": false, "copies": "15", "ref": "refs/heads/master", "path": "bsp/stm32/libraries/STM32H7xx_HAL/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_rtc_ex.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Assembly", "bytes": "17092924" }, { "name": "Batchfile", "bytes": "188371" }, { "name": "C", "bytes": "941229651" }, { "name": "C++", "bytes": "754131" }, { "name": "CMake", "bytes": "250384" }, { "name": "CSS", "bytes": "138218" }, { "name": "GDB", "bytes": "11796" }, { "name": "HTML", "bytes": "4763477" }, { "name": "JavaScript", "bytes": "637" }, { "name": "LLVM", "bytes": "10344" }, { "name": "Lex", "bytes": "7026" }, { "name": "Logos", "bytes": "7238" }, { "name": "M4", "bytes": "17515" }, { "name": "Makefile", "bytes": "444829" }, { "name": "Pawn", "bytes": "1250" }, { "name": "Perl", "bytes": "16728" }, { "name": "Python", "bytes": "2665973" }, { "name": "RPC", "bytes": "14162" }, { "name": "Shell", "bytes": "416898" }, { "name": "Tcl", "bytes": "179" }, { "name": "Yacc", "bytes": "30555" } ], "symlink_target": "" }
<html> <head> <meta http-equiv="Content-Language" content="zh-CN" /> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <meta name="generator" content="oblog" /> <meta name="author" content="homestay-test," /> <meta name="keyword" content="µÚһƪס¼ÒÎÄÕ¡ª¡ª²âÊÔ" /> <meta name="description" content="´ËÎÄÕÂÐèÒª¹ÜÀíÉóºËºó²Å¿É¼û¡£" /> <title>µÚһƪס¼ÒÎÄÕ¡ª¡ª²âÊÔ--ס¼Ò-²âÊÔÓû§homestay-test</title> <link rel="alternate" href="/homestay/homestay-test/rss2.xml" type="application/rss+xml" title="RSS" /> <link href="/OblogStyle/OblogUserDefault31.css" rel="stylesheet" type="text/css" /> <script src="/inc/main.js" type="text/javascript"></script> </head> <body> <script src="/ad/ad_usertopjs.htm"></script><STYLE> a { color: #003366; text-decoration: none; } a:visited { color: #003366; } a:hover { color: #CC0000; text-decoration: underline; } Div,P,body,td{FONT-SIZE: 11px; font-family: Verdana,tahoma, Arial, Helvetica, sans-serif; color:#000000} SELECT {BACKGROUND-COLOR: f3f3f3; height: 20px; COLOR: #000000; FONT-FAMILY: Verdana,Tahoma, sans-serif; FONT-SIZE: 11px ; border: 0px #CCCCCC double} INPUT {color: #333333; height: 21px; FONT-FAMILY: Verdana,MS Shell Dlg,Tahoma, sans-serif; FONT-SIZE: 11px} FONT.code{FONT-FAMILY: Monaco, Courier, Courier New;} code {font-family: "Courier" ; font-size: 11px} textarea {font:12px,Courier New;border: 1px double #999999;background:#FFFFFF} body, textarea { FONT-FAMILY: Verdana,Tahoma;margin:0px } .arrow { font-family:webdings} #calendar th{ font: normal 12px; } </STYLE> <META content="MSHTML 6.00.2745.2800" name=GENERATOR> <DIV align=center> <TABLE border=0 cellPadding=0 cellSpacing=0 width=778> <TBODY> <TR> <TD background="/skin/weiqi/linebg.gif" height=688 width=11>&nbsp;</TD> <TD vAlign=top width=756> <TABLE border=0 cellPadding=0 cellSpacing=0 width=756> <TBODY> <TR> <TD><IMG height=189 src="/skin/weiqi/top.jpg" width=756></TD></TR></TBODY></TABLE> <TABLE background="/skin/weiqi/line.gif" border=0 cellPadding=0 cellSpacing=0 height=1 width=756> <TBODY> <TR background="/skin/weiqi/line.gif"> <TD height=1></TD></TR></TBODY></TABLE> <TABLE border=0 cellPadding=0 cellSpacing=0 height=35 width=756> <TBODY> <TR bgColor=#f4efdc> <TD height=30> <DIV align=center> <TABLE border=0 cellPadding=0 cellSpacing=1 class=font width="95%"> <TBODY> <TR> <TD width="14%"> <DIV align=center><FONT color=#a4704b>¡ì</FONT><span id="blogname">homestay :-) loading ... ...</span><FONT color=#a4704b>¡ì</FONT></DIV></TD></TR></TBODY></TABLE></DIV></TD></TR></TBODY></TABLE> <TABLE background="/skin/weiqi/line.gif" border=0 cellPadding=0 cellSpacing=0 height=1 width=756> <TBODY> <TR background="/skin/weiqi/line.gif"> <TD height=1></TD></TR></TBODY></TABLE> <TABLE background="/skin/weiqi/linebg2.gif" border=0 cellPadding=0 cellSpacing=0 height=18 width=756> <TBODY> <TR background="/skin/weiqi/linebg2.gif"> <TD height=18>&nbsp;</TD></TR></TBODY></TABLE> <TABLE border=0 cellPadding=0 cellSpacing=0 height=681 width=756> <TBODY> <TR> <TD background="/skin/weiqi/bg.gif" height=681 vAlign=top width=190> <TABLE border=0 cellPadding=0 cellSpacing=0 height=1 width=190> <TBODY> <TR> <TD background="/skin/weiqi/linebg4.gif" class=font height=1></TD></TR></TBODY></TABLE> <TABLE border=0 width=190> <TBODY> <TR> <TD> <DIV> <DIV align=center><IMG height=216 src="/skin/weiqi/dianpin.gif" width=175><BR><FONT size=2><div id="calendar">homestay :-) loading ... ...</div> </FONT></DIV> <center><div id="ob_login"></div></center> <P><FONT size=2>¡ù<STRONG>¹«¸æ </STRONG><BR><div id="placard">homestay :-) loading ... ...</div> </FONT></P> <P><FONT size=2>¡ù<STRONG>ÎҵķÖÀࣨרÌ⣩</STRONG> <BR><div id="subject">homestay :-) loading ... ...</div> </FONT></P> <P><FONT size=2>¡ù<STRONG>ÎÄÕ¸üР</STRONG><BR><div id="newblog">homestay :-) loading ... ...</div> </FONT></P> <P><FONT size=2>¡ù<STRONG>×îÐÂÆÀÂÛ</STRONG> <BR><div id="comment">homestay :-) loading ... ...</div> </FONT></P> <P><FONT size=2>¡ù<STRONG>ÁôÑÔ°å </STRONG><BR><div id="newmessage">homestay :-) loading ... ...</div></FONT></P> <P><FONT size=2>¡ù<STRONG>ËÑË÷</STRONG> <BR><div id="search">homestay :-) loading ... ...</div></FONT></P> <P><FONT size=2>¡ù<STRONG>Á´½Ó</STRONG> <BR><div id="links">homestay :-) loading ... ...</div><script src="/ad/ad_userlinksjs.htm"></script> </FONT></P> <P><FONT size=2>¡ù<STRONG>BlogÐÅÏ¢</STRONG> <BR><div id="info">homestay :-) loading ... ...</div> </FONT></P> <P><FONT size=2><div id="xml"><a href="/homestay/homestay-test/rss2.xml" target="_blank"><img src='/images/xml.gif' width='36' height='14' border='0' /></a></div></FONT><BR></P></DIV></TD></TR></TBODY></TABLE> <DIV align=center><BR></DIV></TD> <TD background="/skin/weiqi/linebg3.gif" width=1></TD> <TD class=font vAlign=top><BR> <TABLE border=0 cellPadding=0 cellSpacing=0 width="100%"> <TBODY> <TR> <TD width="34%"> <DIV align=center><IMG height=25 src="/skin/weiqi/bt3.gif" width=123></DIV></TD> <TD width="66%">&nbsp;</TD></TR></TBODY></TABLE> <DIV align=center><BR> <TABLE bgColor=#666666 border=0 cellPadding=0 cellSpacing=1 width="95%"> <TBODY> <TR> <TD bgColor=#ebf2e6> <DIV align=center> <TABLE border=0 cellPadding=0 cellSpacing=0 class=font width="95%"> <TBODY> <TR> <TD vAlign=top> <P><TABLE bgColor=#cccccc border=0 cellPadding=3 cellSpacing=1 style="TABLE-LAYOUT: fixed; WORD-BREAK: break-all" width="98%"> <TBODY> <TR bgColor=#f8f8f8> <TD><FONT size=4><STRONG>µÚһƪס¼ÒÎÄÕ¡ª¡ª²âÊÔ</STRONG></FONT><BR>homestay-test ·¢²¼ÓÚ 2007-6-15 0:56:00 </TD></TR> <TR bgColor=#ffffff> <TD height=0> <TABLE border=0 cellPadding=0 cellSpacing=0 width="100%"> <TBODY> <TR> <TD>´ËÎÄÕÂÐèÒª¹ÜÀíÉóºËºó²Å¿É¼û¡£</TD></TR></TBODY></TABLE><BR> <TABLE align=center border=0 cellPadding=0 cellSpacing=0 width="100%"> <TBODY> <TR> <TD width="74%"><a href="#" >ÔĶÁÈ«ÎÄ<span id="ob_logreaded"></span></a> | <a href="#cmt">»Ø¸´(0)</a> | <a href="/showtb.asp?id=3" target="_blank">ÒýÓÃͨ¸æ<span id="ob_tbnum"></span></a> | <a href="/user_post.asp?logid=3" target="_blank">±à¼­</a></TD> <TD width="26%"> <DIV align=right>&nbsp;</DIV></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE><BR><BR><div id="morelog"><ul><li>ÏÂһƪ£º<a href="/homestay/homestay-test/archives/2007/27.html">¶ÔÓÚhomestayµÄ¾ßÌåÁ÷³Ì£¬ÎÒÃÇ·ÖÎöÈçÏÂ~</a></li></ul></div><BR><BR><FONT size=5><BR></FONT><BR></P></TD></TR></TBODY></TABLE></DIV></TD></TR></TBODY></TABLE><BR></DIV></TD></TR></TBODY></TABLE> <TABLE background="/skin/weiqi/bg1.gif" border=0 cellPadding=0 cellSpacing=0 height=3 width=756> <TBODY> <TR background="/skin/weiqi/bg1.gif"> <TD height=3></TD></TR></TBODY></TABLE> <TABLE background="/skin/weiqi/bg2.gif" border=0 cellPadding=0 cellSpacing=0 height=56 width=756> <TBODY> <TR> <TD height=56> <DIV align=center> <P class=font><FONT color=#ffffff><STRONG>&copy; COPYRIGHT 2005 ALL RIGHTS RESERVED <span id="blogname">homestay :-) loading ... ...</span></STRONG></FONT></P></DIV></TD></TR></TBODY></TABLE></TD> <TD background="/skin/weiqi/linebg1.gif" width=11>&nbsp;</TD></TR></TBODY></TABLE></DIV><script src="/ad/ad_userbotjs.htm"></script><div id="powered"><a href="http://www.myhomestay.com.cn" target="_blank"><img src="/images/meiqee.com.gif" border="0" alt="Powered by meiqee.com" /></a></div> </body> </html><script src="/homestay/homestay-test/inc/show_subject.htm"></script> <script src="/homestay/homestay-test/inc/show_placard.htm"></script> <script src="/homestay/homestay-test/calendar/200706.htm"></script> <script src="/homestay/homestay-test/inc/show_search.htm"></script> <script src="/homestay/homestay-test/inc/show_newblog.htm"></script> <script src="/homestay/homestay-test/inc/show_comment.htm"></script> <script src="/homestay/homestay-test/inc/show_newmessage.htm"></script> <script src="/homestay/homestay-test/inc/show_info.htm"></script> <script src="/homestay/homestay-test/inc/show_links.htm"></script> <script src="/homestay/homestay-test/inc/show_blogname.htm"></script> <Script src="/count.asp?action=logtb31&id=3"></Script><script src="/count.asp?action=site&id=3"></script> <script src="/login.asp?action=showindexlogin"></script>
{ "content_hash": "64480e7b8dd63ce2fdc73bfa2c0fb814", "timestamp": "", "source": "github", "line_count": 160, "max_line_length": 370, "avg_line_length": 50.9375, "alnum_prop": 0.6788957055214724, "repo_name": "wl6179/MyHomestay", "id": "e935a046f13459a0c4436331bc01d01f981081b9", "size": "8150", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "homestay/homestay-test/archives/2007/3.html", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "3075173" }, { "name": "C++", "bytes": "9805" }, { "name": "CSS", "bytes": "341301" }, { "name": "HTML", "bytes": "5708923" }, { "name": "JavaScript", "bytes": "228098" } ], "symlink_target": "" }
"use strict"; var config = require('./config').config; var irc = require('irc'); var bot = new irc.Client(config.server, config.botName, { channels: config.channels }); bot.addListener('join', function (channel, who) { bot.say(channel, who + ', welcome!'); }); bot.addListener('message', function (from, to, text, message) { bot.say(from, 'Hello'); console.log(to) console.log(message) }); console.log(config.botName + ' started on ' + new Date());
{ "content_hash": "1a8125719dffd50035360ee7760342c3", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 63, "avg_line_length": 23.65, "alnum_prop": 0.6469344608879493, "repo_name": "riverspirit/mdnbot", "id": "43f2b0a618ff9e232f65ae868b2ff4a984b4384f", "size": "473", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "index.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "599" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <TableRow xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingBottom="8dp" android:paddingTop="8dp"> <TextView android:id="@+id/label" android:layout_column="1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical|right" tools:text="22000 hz" /> <SeekBar android:id="@+id/seekbar" android:layout_column="2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:max="40" /> <TextView android:id="@+id/value" android:layout_column="3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical" tools:text="0.0 dB"/> </TableRow>
{ "content_hash": "d6544debbc641c4e5ab32bdae7e34e26", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 68, "avg_line_length": 32.470588235294116, "alnum_prop": 0.6413043478260869, "repo_name": "onnerby/musikcube", "id": "b16aaaf5aecc4c2161f34baab191b6856f531157", "size": "1104", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/musikdroid/app/src/main/res/layout/eq_band_row.xml", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Batchfile", "bytes": "1025" }, { "name": "C", "bytes": "3983072" }, { "name": "C++", "bytes": "4635120" }, { "name": "CMake", "bytes": "56752" }, { "name": "CSS", "bytes": "9169" }, { "name": "HTML", "bytes": "1512" }, { "name": "M4", "bytes": "7003" }, { "name": "Makefile", "bytes": "150277" }, { "name": "Objective-C", "bytes": "86364" }, { "name": "Perl", "bytes": "3982" }, { "name": "Shell", "bytes": "219091" }, { "name": "XSLT", "bytes": "12276" } ], "symlink_target": "" }
export * from './weather.interfaces'; export * from './unsplash.interfaces'; export * from './twitter.interfaces'; export * from './news.interfaces'; export * from './vasttrafik.interfaces';
{ "content_hash": "51d7bd0388d62092945058627af8b611", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 40, "avg_line_length": 38.2, "alnum_prop": 0.7120418848167539, "repo_name": "Levis92/InfoHub", "id": "1735f401f638bad0643e2213fd7908a18ca94d5a", "size": "191", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "infohub/interfaces/index.ts", "mode": "33188", "license": "mit", "language": [ { "name": "Dockerfile", "bytes": "163" }, { "name": "JavaScript", "bytes": "1250" }, { "name": "SCSS", "bytes": "7225" }, { "name": "Shell", "bytes": "264" }, { "name": "TypeScript", "bytes": "37084" } ], "symlink_target": "" }
#ifndef _ASM_POWERPC_SIGCONTEXT_H #define _ASM_POWERPC_SIGCONTEXT_H /* * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ #include <linux/compiler.h> #include <asm/ptrace.h> #ifdef __powerpc64__ #include <asm/elf.h> #endif struct sigcontext { unsigned long _unused[4]; int signal; #ifdef __powerpc64__ int _pad0; #endif unsigned long handler; unsigned long oldmask; struct pt_regs __user *regs; #ifdef __powerpc64__ elf_gregset_t gp_regs; elf_fpregset_t fp_regs; /* * To maintain compatibility with current implementations the sigcontext is * extended by appending a pointer (v_regs) to a quadword type (elf_vrreg_t) * followed by an unstructured (vmx_reserve) field of 69 doublewords. This * allows the array of vector registers to be quadword aligned independent of * the alignment of the containing sigcontext or ucontext. It is the * responsibility of the code setting the sigcontext to set this pointer to * either NULL (if this processor does not support the VMX feature) or the * address of the first quadword within the allocated (vmx_reserve) area. * * The pointer (v_regs) of vector type (elf_vrreg_t) is type compatible with * an array of 34 quadword entries (elf_vrregset_t). The entries with * indexes 0-31 contain the corresponding vector registers. The entry with * index 32 contains the vscr as the last word (offset 12) within the * quadword. This allows the vscr to be stored as either a quadword (since * it must be copied via a vector register to/from storage) or as a word. * The entry with index 33 contains the vrsave as the first word (offset 0) * within the quadword. */ elf_vrreg_t __user *v_regs; long vmx_reserve[ELF_NVRREG+ELF_NVRREG+1]; #endif }; #endif /* _ASM_POWERPC_SIGCONTEXT_H */
{ "content_hash": "00a336b1d0370ef9b6fcd3b9470a91fc", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 77, "avg_line_length": 37.67307692307692, "alnum_prop": 0.740684022460439, "repo_name": "ut-osa/syncchar", "id": "165d630e1cf340d4f3fa386af6bd8070f1b8546d", "size": "1959", "binary": false, "copies": "101", "ref": "refs/heads/master", "path": "linux-2.6.16-unmod/include/asm-powerpc/sigcontext.h", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "ASP", "bytes": "4526" }, { "name": "Assembly", "bytes": "7269561" }, { "name": "C", "bytes": "191363313" }, { "name": "C++", "bytes": "2703790" }, { "name": "Objective-C", "bytes": "515305" }, { "name": "Perl", "bytes": "118289" }, { "name": "Python", "bytes": "160654" }, { "name": "Scala", "bytes": "12158" }, { "name": "Shell", "bytes": "48243" }, { "name": "TeX", "bytes": "51367" }, { "name": "UnrealScript", "bytes": "20822" }, { "name": "XSLT", "bytes": "310" } ], "symlink_target": "" }
//---------------------------------------------------------------------------- // // License: LGPL // // See LICENSE.txt file in the top level directory for more details. // // Description: Wrapper class to compress whole tiles using OpenJPEG code. // //---------------------------------------------------------------------------- // $Id$ #ifndef ossimOpjCompressor_HEADER #define ossimOpjCompressor_HEADER 1 #include <ossim/base/ossimConstants.h> #include <ossim/base/ossimIrect.h> #include <ossim/base/ossimProperty.h> #include <ossim/base/ossimRefPtr.h> #include <ossim/base/ossimString.h> #include <opj_config.h> #include <openjpeg.h> #include <iosfwd> class ossimFilename; class ossimImageData; class ossimImageGeometry; class ossimIpt; class ossimOpjCompressor { public: // Matches static "COMPRESSION_QUALITY" string array in .cpp. enum ossimOpjCompressionQuality { OPJ_UNKNOWN = 0, OPJ_USER_DEFINED = 1, OPJ_NUMERICALLY_LOSSLESS = 2, OPJ_VISUALLY_LOSSLESS = 3, OPJ_LOSSY = 4 }; /** default constructor */ ossimOpjCompressor(); /** destructor */ ~ossimOpjCompressor(); /** * @brief Create method. * @param os Stream to write to. * @param scalar Scalar type of source tiles to be fed to compressor. * @param bands Number of bands in source tiles to be fed to compressor. * @param imageRect The image rectangle. * @param tileSize The size of a tile. * @param jp2 If true jp2 header and jp2 geotiff block will be written out. * @note Throws ossimException on error. */ void create(std::ostream* os, ossimScalarType scalar, ossim_uint32 bands, const ossimIrect& imageRect, const ossimIpt& tileSize, bool jp2); /** * @brief Calls "open_codestream" on the m_jp2Target. * * Note: Only valid if create method was called with jp2 = true. */ void openJp2Codestream(); /** * @brief Write tile method. * * Writes tiles stream provided to create method. Note that tiles should * be fed to compressor in left to right, top to bottom order. * * @param srcTile The source tile to write. * @param tileIndex Index starting at 0. Currently must be sequential. * @return true on success, false on error. */ bool writeTile(ossimImageData* srcTile, ossim_uint32 tileIndex); /** * @brief Finish method. Every call to "create" should be matched by a * "finish". Note the destructor calls finish. */ void finish(); /** * @brief Sets the quality type. * @param type See enumeration for types. */ void setQualityType(ossimOpjCompressionQuality type); /** @return The quality type setting. */ ossimOpjCompressionQuality getQualityType() const; /** * @brief Sets the m_reversible flag. * * If set to true the compression will be lossless; if not, lossy. * Default is lossless. * * @param reversible Flag to set. */ void setReversibleFlag(bool reversible); /** @return The reversible flag. */ bool getReversibleFlag() const; /** * Set the writer to add an alpha channel to the output png image. * * @param flag true to create an alpha channel. */ void setAlphaChannelFlag( bool flag ); /** * Retrieve the writer's setting for whether or not to add an * alpha channel to the output png image. * * @return true if the writer is configured to create an alpha channel. */ bool getAlphaChannelFlag() const; /** * @brief Sets the number of levels. * * This must be positive and at least 1. * Default = 6 ( r0 - r5 ) * * @param levels Levels to set. */ void setLevels(ossim_int32 levels); /** @return The number of levels. */ ossim_int32 getLevels() const; /** * @brief Sets the number of threads. * * This must be positive and at least 1. Default = 1 thread. * * @param threads The number of threads. */ void setThreads(ossim_int32 threads); /** @return The number of threads. */ ossim_int32 getThreads() const; /** * @brief Sets the options array. * * These get passed to the generic kdu_params::parse_string method. Note * this adds options to the list. Does not zero out existing options. * * @param options Array of options to add. */ void setOptions(const std::vector<ossimString>& options); /** * @brief Get the array of options. * @param options Array to initialize. */ void getOptions(std::vector<ossimString>& options) const; /** * saves the state of the object. */ bool saveState(ossimKeywordlist& kwl, const char* prefix=0)const; /** * Method to the load (recreate) the state of an object from a keyword * list. Return true if ok or false on error. */ bool loadState(const ossimKeywordlist& kwl, const char* prefix=0); /** * Will set the property whose name matches the argument * "property->getName()". * * @param property Object containing property to set. * * @return true if property was consumed, false if not. */ bool setProperty(ossimRefPtr<ossimProperty> property); /** * @param name Name of property to return. * * @returns A pointer to a property object which matches "name". */ ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const; /** * Pushes this's names onto the list of property names. * * @param propertyNames array to add this's property names to. */ void getPropertyNames(std::vector<ossimString>& propertyNames)const; /** * @brief Writes the geotiff box to the jp2 * @param stream The stream to write to. * @param geom Output image geometry. * @param rect Output rectangle (view rect). * @param tmpFile Temp file written out. * @param pixelType OSSIM_PIXEL_IS_POINT(0) or OSSIM_PIXEL_IS_AREA(1) */ bool writeGeotiffBox(std::ostream* stream, const ossimImageGeometry* geom, const ossimIrect& rect, const ossimFilename& tmpFile, ossimPixelType pixelType); /** * @brief Writes the gml box to the jp2 * @param stream The stream to write to. * @param geom Output image geometry. * @param rect Output rectangle (view rect). */ bool writeGmlBox( std::ostream* stream, const ossimImageGeometry* geom, const ossimIrect& rect ); private: void initOpjCodingParams( bool jp2, const ossimIpt& tileSize, const ossimIrect& imageRect ); int getNumberOfLayers() const; ossimString getQualityTypeString() const; void setQualityTypeString(const ossimString& s); /** * @brief Set levels, class attribute m_levels and * m_parameters->numresolution. * * Number of wavelet decomposition levels, or stages. May not exceed 32. * Opj Default is 6 (0 - 5) * * @param imageRect The image rectangle. */ void initLevels( const ossimIrect& imageRect ); /** * @brief Set code block size. * * Nominal code-block dimensions (must be powers of 2 no less than 4 and * no greater than 1024). * Opj Default block dimensions are {64,64} * * @param xSize * @param ySize */ void setCodeBlockSize( ossim_int32 xSize, ossim_int32 ySize); /** * @brief Sets progression order. * * Default progression order (may be overridden by Porder). * The four character identifiers have the following interpretation: * L=layer; R=resolution; C=component; P=position. * The first character in the identifier refers to the index which * progresses most slowly, while the last refers to the index which * progresses most quickly. [Default is LRCP] * Enumerations: (LRCP=0,RLCP=1,RPCL=2,PCRL=3,CPRL=4) * * @param corder The progression order which should be one of the above * enumerations. */ void setProgressionOrder( OPJ_PROG_ORDER progressionOrder ); void setTlmTileCount(ossim_uint32 tilesToWrite); opj_cparameters_t* createOpjCodingParameters( bool jp2, const ossimIpt& tileSize, const ossimIrect& imageRect ) const; opj_codec_t* createOpjCodec( bool jp2 ) const; opj_stream_t* createOpjStream( std::ostream* os ) const; opj_image_t* createOpjImage( ossimScalarType scalar, ossim_uint32 bands, const ossimIrect& imageRect ) const; opj_cparameters_t* m_params; opj_codec_t* m_codec; opj_stream_t* m_stream; opj_image_t* m_image; // opj_codec* m_stream; // opj_image_t* m_image = 0; /** Image rectangle. Used for clip in writeTile. */ ossimIrect m_imageRect; /** Lossless or lossy */ bool m_reversible; /** If true write alpha channel. */ bool m_alpha; /** Reduced resolution levels. */ ossim_int32 m_levels; /** Number of threads. */ ossim_int32 m_threads; /** Container for Opj options. */ std::vector<ossimString> m_options; ossimOpjCompressionQuality m_qualityType; }; #endif /* matches: #ifndef ossimOpjCompressor_HEADER */
{ "content_hash": "795d1f325b83b375f3e8ce006cb21580", "timestamp": "", "source": "github", "line_count": 327, "max_line_length": 78, "avg_line_length": 29.2782874617737, "alnum_prop": 0.615521203258826, "repo_name": "ossimlabs/ossim-plugins", "id": "8457e87078a34c5704143717e1d903183434ad77", "size": "9574", "binary": false, "copies": "1", "ref": "refs/heads/dev", "path": "openjpeg/src/ossimOpjCompressor.h", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "158984" }, { "name": "C++", "bytes": "4436079" }, { "name": "CMake", "bytes": "56205" } ], "symlink_target": "" }
layout: article title: "Mastering Paper by FiftyThree: Drawing Outer Space" modified: 2015-01-28T11:18:25-05:00 categories: mastering-paper excerpt: "Learn how I draw outer space scenes filled with stars, galaxies, planets, black holes and more with Paper by FiftyThree and Pencil." tags: [paper by 53, tutorial, outer space, blend, pencil, stylus, ipad] image: feature: paper-53-space-feature.jpg teaser: paper-53-space-teaser.jpg comments: true --- Drawing the *night sky*, *stars*, *galaxies*, *planets*, and other *celestial bodies* is a ton of fun with Paper, the iPad app by FiftyThree. Much like [drawing blue skies and clouds]({{ site.url }}{% post_url /mastering-paper/2013-09-05-drawing-clouds %}), it is very hard to screw them up if you follow a few simple guidelines. {% include toc.html %} In this Paper by FiftyThree tutorial I'll start by walking you through my process of painting an outer space scene using only a finger. Then, I'll demonstrate how to paint another one using [FiftyThree's Pencil stylus]({{ site.url }}{% post_url mastering-paper/2014-11-28-pencil-53-review %}) instead. Taking advantage of **Surface Pressure** and [**Blend**]({{ site.url }}{% post_url /mastering-paper/2013-11-20-pencil-first-look %}) I find the effects are easier and faster to pull off with Pencil. Oh and I'm trying something different with this guide. I've toyed around with short videos before, but this time I'm including two that can stand on their own as full blown tutorials. Editing together footage shown from two different angles, each video documents the entire drawing process from start to finish. Both videos are fully annotated[^annotated] with notes and tips throughout, so be sure to watch directly on [Youtube.com](https://www.youtube.com/user/anotherjpeg/) for the best experience. Don't worry, for those of you who learn better with pictures and text I'm still including all that detail below --- just scroll past the videos that begin each section to jump ahead. [^annotated]: As far as I know YouTube annotations only appear on the actual YouTube.com website and not on mobile devices or from within the YouTube app. And with that let's get started. ## Painting outer space with your finger <figure> <iframe width="560" height="315" src="//www.youtube.com/embed/myAwO2k23q4" frameborder="0"> </iframe> <figcaption><i class="fa fa-video-camera"></i> How to draw and paint an outer space scene with only your finger and Paper by 53.</figcaption> </figure> ### Cover the canvas Start by covering the canvas with a dark color. For this technique to work properly you need to draw it in manually. The page fill "shortcut" has some limitations with how colors are applied to it that won't give the effect we need. To learn more about why that is, be sure to check out my guide on [Paper's Color Picker]({{ site.url }}{% post_url /mastering-paper/2014-12-18-color-picker %}). <figure> <img src="{{ site.url }}/images/paper-53-space-canvas-fill.jpg" alt="using your fingers to ink in the canvas with black"> <figcaption>Stroke size increases with speed allowing you to fill in the background faster in you swipe fast.</figcaption> </figure> ### Star clusters and flow Use white or a tint to lighten the dark background and lay the ground work for the composition. Using a photographic reference helps, but you can free-form things and just let things unfold organically as you glide your fingers across the canvas. <figure> <img src="{{ site.url }}/images/paper-53-space-lighten-bg-color.jpg" alt="screenshot of light blue color"> <figcaption>Mixing up a bright blue tint to lighten the black background.</figcaption> </figure> To create smooth tones keep your finger on the screen and use circular motions to soften the edges. The goal is to avoid leaving harsh edges as much as possible. <figure> <img src="{{ site.url }}/images/paper-53-space-lighten-bg.jpg" alt="lightening the background with a finger and white"> <figcaption>Move slowly to define the shapes and faster around the edges to blur them.</figcaption> </figure> <figure> <img src="{{ site.url }}/images/paper-53-space-lighten-bg-2.jpg" alt="screenshot of zoomed in lightened background"> <figcaption>For areas that are dense with stars apply multiple layers of white to brighten them up.</figcaption> </figure> <div class="notice-info" markdown="1"> #### ProTip: Smaller Brush Sizes When using the zoom loupe the watercolor brush's size scales down. Use this to your advantage to paint thinner strokes and fill smaller shapes. </div> #### Blue glazes Starting with a light blue color, apply a watercolor glaze to the left side of the composition. You don't have to worry about being precise since it will only show on the lighten areas painted with white. Because we filled in the background with black earlier, any color that happens to bleed won't be visible. <figure> <img src="{{ site.url }}/images/paper-53-space-blue-glaze-1.jpg" alt="screenshot of painting a blue glaze"> </figure> When glazing with the blue color, the same technique used when painting with white should be observed. Keep your strokes controlled and smooth. Move your finger slowly across the screen making sure not to [lift it off the screen]({{ site.url }}{% post_url /mastering-paper/2014-09-16-watercolor-brush-update %}) for more than a second. Doing so will indicate to Paper that a new stroke was made and you will see a visible seam between the values. <figure> <img src="{{ site.url }}/images/paper-53-space-blue-glaze-2.jpg" alt="screenshot of darkening blue with layered watercolor strokes"> <figcaption>Building up the blues with many layers (or glazes) of watercolor.</figcaption> </figure> To create the illusions of depth, add more glaze layers towards the outsides of the shapes. This will aid in creating clusters of stars later by leaving bright pockets of light near the centers. Feel free to adjust the blue color's darkness by moving the color sliders around. Don't go too far with it though. Multiple layers of lights generally look better than a single dark layer. #### Fuchsia glazes Repeat the exact same process on the right half of the composition now, this time using a fuchsia or violet hue. When you finish you should have something that vaguely resembles the following. <figure class="half"> <img src="{{ site.url }}/images/paper-53-space-violet-glaze-1.jpg" alt="screenshot of mixing a fuchsia color"> <img src="{{ site.url }}/images/paper-53-space-violet-glaze-3.jpg" alt="screenshot of finished fuchsia glazes"> </figure> If things went too dark mix a tint of blue or fuchsia (depending on where you want to lighten) and dab your finger quickly to recover some brightness. Use your best judgment and correct as needed. There may be some back and forth needed between tints and darks to get the gradients looking just right. <figure> <img src="{{ site.url }}/images/paper-53-space-lightening-glazes.jpg" alt="lightening the blue and violet glazes with white and your finger"> <figcaption>Quickly dab in strokes of watercolor filled with a white color to bring up the brightness.</figcaption> </figure> <div class="notice-info" markdown="1"> #### ProTip: Paint Fast with White Move quickly when using a watercolor brush loaded with white. Go too slow and it'll turn pure white way too fast. </div> ### Placing stars with your fingers Now begins the tedious process of placing stars one by one. I like to start with a medium to dark color that is in the family of the area I'm placing them. Starting on the blue side first we'll want to mix up a star color that is... bluish --- what a shocker! Using Paper's Color Picker makes things so much easier. Just sample a blue spot you painted earlier and then manipulate the sliders to get the intensity right. <figure> <img src="{{ site.url }}/images/paper-53-space-blue-stars.jpg" alt="screenshot of blue star color"> <figcaption>Mixing a medium-dark blue to lay down some stars with.</figcaption> </figure> Try to use your fingertip with a controlled tapping motion. If you strike the screen and drag your finger at all, a small streak will appear instead of a dot. If this happens use the [Rewind gesture to undo](http://support.fiftythree.com/customer/portal/articles/892210-basic-features#undo) any mistakes. <figure> <img src="{{ site.url }}/images/paper-53-space-blue-stars-finger.jpg" alt="using a fingertip to create stars"> </figure> The more stars you add the more pronounced the effect. Varying the size of the stars and bumping up the brightness as you work helps as well. I strongly suggest using just the pencil tool and avoiding the pens and marker. The pencil is semi-transparent and in my opinion looks more natural than the others. Tapping in the same spot a few times is an effective way of brightening a star. Using your finger tip isn't that accurate so it can take a few Rewinds to get the placement just right. <figure> <img src="{{ site.url }}/images/paper-53-space-bright-star.jpg" alt="screenshot of zoomed pencil stars"> <figcaption>Increase the size or brightness of a star by placing more dots closing to each other.</figcaption> </figure> As before, when you move over to the fuchsia and violet half of the space scene, select matching star colors. Glazes can be applied to darken clusters of stars further adding to the realism --- the same goes for using white to lighten. There really is no right or wrong way to approach it, so feel free to experiment and find what works best for you. <figure> <img src="{{ site.url }}/images/paper-53-space-violet-star-glaze.jpg" alt="screenshot of stars glazed with violet watercolor"> <figcaption>Stars that may have gone too bright can be harmonized by painting over with matching watercolor glazes.</figcaption> </figure> ### Two worlds An outer space scene wouldn't be complete without a planet or two, so let's remedy that shall we? <figure> <img src="{{ site.url }}/images/paper-53-space-planet-placement.jpg" alt="screenshot of planet placement"> </figure> The hardest part of world building is deciding where to place the planet(s). Since I've cut the composition in half, it would seem to make the most sense placing a planet on each side. Pick a white or tint color and switch to the fountain pen tool. Then place your finger on the canvas where you'd like the planet to appear and hold it for a few seconds. The longer you press the bigger the dot gets. <figure class="half"> <img src="{{ site.url }}/images/paper-53-space-mix-planet-color.jpg" alt="mixing a light color to create a planet with"> <img src="{{ site.url }}/images/paper-53-space-dot-planet.jpg" alt="tap and hold with the fountain pen to create a large dot"> <figcaption>After mixing a light color press and hold with the fountain pen to create a large dot.</figcaption> </figure> I'm placing my first planet off in the violet portion of space so I'll want to mix up a similar hue. Using the watercolor brush, paint glazes over the white dot, gradually moving further and further away from one of the edges. In this example I'm moving towards the left to leave a highlight on the right side. <figure class="third"> <img src="{{ site.url }}/images/paper-53-space-f-planet-1.jpg" alt="screenshot of glazing a planet with violet watercolor"> <img src="{{ site.url }}/images/paper-53-space-f-planet-2.jpg" alt="screenshot of glazing a planet with violet watercolor"> <img src="{{ site.url }}/images/paper-53-space-f-planet-3.jpg" alt="screenshot of glazing a planet with violet watercolor"> </figure> Continue adding glazes until one side fades completely into the blackness of space. To speed up the process increase the darkness of the color you're painting with. Once satisfied with the results repeat the process for as many other planets as you want. <figure> <a href="https://mix.fiftythree.com/11098-Michael-Rose/1575972" target="_blank"><img src="{{ site.url }}/images/paper-53-space-scene-1-f.jpg" alt="finished space scene painted with just a finger"></a> <figcaption><a href="https://mix.fiftythree.com/11098-Michael-Rose/1575972" target="_blank"><strong>Two Worlds Apart</strong></a> is available on Mix for downloading and remixing. Feel free to add more stars, planets, or whatever else you'd like.</figcaption> </figure> --- ## Painting outer space with Pencil (stylus) Building on the same techniques used in the first half of this guide, I'm going to now show you how Pencil can be used to enhance and speed things up. For the most part you follow the exact same steps with a few embellishments to ratchet up the realism. <figure> <iframe width="560" height="315" src="//www.youtube.com/embed/pdSp4Y4GOQs" frameborder="0"> </iframe> <figcaption><i class="fa fa-video-camera"></i> How to draw and paint an outer space scene with Pencil and Paper by 53.</figcaption> </figure> If you haven't already paired Pencil with Paper do so now. I find it helpful to go into Pencil's settings and turn off Blend[^blend-off] until I need it. This avoids any unwanted smudges from appearing when not applying enough pressure with Pencil's tip. [^blend-off]: To turn off the Blend feature tap the icon in the upper right corner of Paper while in the journal view. Then tap **Pencil** > **Finger** and change the default behavior from Blend to **Nothing**. ### Covering the canvas part 2 <figure> <img src="{{ site.url }}/images/paper-53-space-2-bg-fill-pencil.jpg" alt="using Pencil to fill in a blank canvas"> </figure> Just like with the first outer space scene, you will want to cover the canvas in a dark color using the fountain pen or marker tools. By using the wide side of Pencil's tip you can cover the screen much faster. The rubber here is more durable and doesn't tear as quickly at the tip. Anytime you have the opportunity to draw with the broad side versus the tip --- take it. ### Building a background and star clusters part 2 I'm going to speed through these next set of steps since they're exactly the same as before. The only difference being they will be done with the Pencil stylus instead of your finger. <figure> <img src="{{ site.url }}/images/paper-53-space-2-bg-lighten.jpg" alt="lightening the black background with white and Pencil"> <figcaption>Lighten the black using the watercolor brush and a white or tint color.</figcaption> </figure> <div class="notice-info" markdown="1"> #### ProTip: Turn Pencil on Its Side for a Different Drawing Experience Hold Pencil on its side to move more quickly and organically through the composition. </div> <figure> <img src="{{ site.url }}/images/paper-53-space-2-lightening-bg-2.jpg" alt="screenshot of lightening the black background with white"> <figcaption>Add extra layers of white to brighten an area. The centers of the cloud like shapes are good locations for these highlights.</figcaption> </figure> After you've lightened the background and are happy with the shapes created, decide on what color or colors you want the background to be. For this scene I think a rainbow-ish gradient with a bunch of colors might look interesting. <figure> <img src="{{ site.url }}/images/paper-53-space-2-light-blue-glaze.jpg" alt="screenshot of light blue glaze"> <figcaption>Starting with a light blue, apply glazes on top of each other to create smooth transitions from light to dark.</figcaption> </figure> Remember to take your time with the watercolor brush and don't be tempted to use too dark of a color. This isn't a race! <figure> <img src="{{ site.url }}/images/paper-53-space-2-yellow-glazes.jpg" alt="screenshot of yellow glaze"> <figcaption>With the blue portion of the space scene laid down move into the yellow and orange colors towards the middle of the composition.</figcaption> </figure> <figure> <img src="{{ site.url }}/images/paper-53-space-2-finished-bg-glazes.jpg" alt="screenshot of finished background glazes"> <figcaption>Finishing with red glazes towards the right half that blend seamlessly from blue to yellow to red.</figcaption> </figure> ### Dropping in a planet I've decided to place a medium sized planet towards the upper left corner. Because I'm opting for something larger the "tap and hold dot trick" used in the first drawing won't work this time --- it caps out at around an inch in diameter. Since it's pretty difficult to draw a perfect circle freehand I'm going to trace a cylinder. I just so happen to have part of a rotary cutter that is the size I need, so that's what I'm using. The box that Pencil ships in is a good alternative if you don't have anything else to trace. <figure class="half"> <img src="{{ site.url }}/images/paper-53-space-2-circle-trace.jpg" alt="tracing around a rotary cutter with Pencil stylus"> <img src="{{ site.url }}/images/paper-53-space-2-circle.jpg" alt="screenshot of a circle outline"> </figure> Placing the object directly on the iPad's screen, carefully trace around its edge. It may be hard to match up the lines exactly on your first go so just Rewind to undo until you get it right. With the outline complete, use the watercolor brush with a white (or tint) to fill it in. It's ok if your strokes bleed outside of the lines some, it adds to the glowing effect we're trying to accomplish. Plus we're going to lightly blend the edges anyways so any mistakes made now will be down played later. <figure> <img src="{{ site.url }}/images/paper-53-space-2-filled-circle.jpg" alt="screenshot of filled circle"> </figure> Next decide on what color you want your planet to be and begin painting over the white fill. For my scene I choose to paint with a dull red, being careful to stay within the lines as not to distort the circle's shape too much. <figure> <img src="{{ site.url }}/images/paper-53-space-2-planet-color.jpg" alt="screenshot of painting a planet"> <figcaption>Build up layers of color to create a smooth gradation throughout the planet's surface.</figcaption> </figure> Using the same process as before, leave one of the planet's edges exposed as you darken it. This will make it appear more three-dimensional as the tones are built up from light to dark. <figure> <img src="{{ site.url }}/images/paper-53-space-2-planet-shadow.jpg" alt="screenshot of painting a dark shadow across a planet"> </figure> I started to lose the shape of the circle because I was painting pretty fast. To correct it I darkened the lower left corner until it merged with the rest of the scene. Depending on what color the background is, these sorts of mistakes may be harder to cover-up. <div class="notice-info" markdown="1"> #### ProTip: Use a Stencil if You're a Messy Painter To help stay in the lines a [stencil](http://www.amazon.com/gp/product/B000FPYQ14/ref=as_li_tl?ie=UTF8&camp=1789&creative=390957&creativeASIN=B000FPYQ14&linkCode=as2&tag=mademist-20&linkId=GLP5SABXVPYTF7PT) can be used. Simply hold it steady on the iPad's screen as you paint glazes with Pencil inside of it. </div> #### Refining a planet After you finish filling in the planet, now is a good time to modify Pencil's settings and turn Blend[^blend-off] back on (if you previously turned it off like I did). <figure class="half"> <img src="{{ site.url }}/images/paper-53-space-2-planet-blend-1.jpg" alt="blending the planet's edge with a finger"> <img src="{{ site.url }}/images/paper-53-space-2-planet-blend-2.jpg" alt="screenshot of a planet with the edges smudged"> </figure> Using the tip of your finger, quickly swipe along the planet's edge in an arc like motion. This will blur strokes and colors at the edge while retaining the circle's shape. With the right amount of speed you should end up with a something that resembles a glowing orb. <figure> <img src="{{ site.url }}/images/paper-53-space-2-planet-lightening.jpg" alt="screenshot of lightening a planet with white watercolor"> </figure> To correct any shape distortions that occur from smudging too much, paint in bursts of whites and darks over the problem areas. Repeating the painting and blending steps as many times as necessary. It helps to think of the colors on screen as pixels of sand that can be pushed around with your finger tips. <figure> <img src="{{ site.url }}/images/paper-53-space-2-planet-edge.jpg" alt="screenshot of penciling in highlights"> </figure> <div class="notice-info" markdown="1"> #### ProTip: Smoothen Edges with a Pencil Stroke Fine pencil lines along the sides work well to redefine a bumpy or irregular shaped curve. </div> #### Detailing a planet Because this planet is larger than the first set I painted, there's plenty of room to sketch in craters and other textures. Use the Color Picker to sample the planet and mix up a lighter variation of it. With a color selected use the pencil tool to scribble in craters and holes, giving the planet detail. By flipping Pencil on its side you can use Surface Pressure to add even more detail with a grainy charcoal like texture. <figure> <img src="{{ site.url }}/images/paper-53-space-2-planet-details.jpg" alt="screenshot of planet details drawn with pencil"> </figure> I didn't spend too much time detailing my planet, but that's not to say you shouldn't. Building off of the techniques used in my other guides, painting glazes on top of the [penciled textures]({{ site.url }}{% post_url mastering-paper/2013-11-25-drawing-textures %}) will further enhance the realism. ### Tapping stars with Pencil You guessed it, time to tap in a ton of stars again. Using a stylus like Pencil instead of your finger makes it much easier to accurately place hundreds of stars. <figure class="half"> <img src="{{ site.url }}/images/paper-53-space-2-stars-pencil.jpg" alt="tapping Pencil to create dots that look like stars"> <img src="{{ site.url }}/images/paper-53-space-2-stars-pencil-2.jpg" alt="screenshot of blue stars drawn with Pencil"> <figcaption>This first pass of stars is hard to see but that's ok. As you add more stars, increase their brightness to help make them sparkle.</figcaption> </figure> Just like before pick a star color that relates to your background. Start with a medium tone first and cover the canvas in stars before gradually using a lighter one. Save the bright star clusters for those light center spots --- it will look more natural that way. <figure> <img src="{{ site.url }}/images/paper-53-space-2-blue-stars-detail.jpg" alt="detail screenshot of blue stars drawn with Pencil"> <figcaption>Detail of stars that have been slightly glazed with blue watercolor.</figcaption> </figure> #### Star variations Methods used earlier to vary the stars size and brightness are still fair game. If you're using Pencil and have blending enabled, there's a new trick available to you. You may remember in the first part of this guide I cautioned against using the ink tools for making stars. Well if you blend ink dots with fast smudges they turn into glowing orbs. It's a great effect that can add interest to the composition. <figure> <img src="{{ site.url }}/images/paper-53-space-2-blended-stars.jpg" alt="screenshot of blended stars"> <figcaption>Swiping your finger quickly over a large white star will create a glow orb. You can even make trails by pulling your strokes slowly and smearing the star.</figcaption> </figure> <div class="notice-info" markdown="1"> #### ProTip: Simulate Glow with White Paint If you don't have a Pencil stylus, glowing orbs can also be created by dabbing a star with white watercolor. </div> Just like earlier, star clusters can be lightened or darkened by glazing over them with the appropriate colors. If you do decide to lighten sections be sure to move fast as you risk going too white when lingering in one spot. <figure> <a href="https://mix.fiftythree.com/11098-Michael-Rose/1534984" target="_blank"><img src="{{ site.url }}/images/paper-53-space-2-finished.jpg" alt="finished space scene drawn with a Pencil stylus"></a> <figcaption><a href="https://mix.fiftythree.com/11098-Michael-Rose/1534984" target="_blank"><strong>One Dying Star</strong></a> is available on Mix for download and remixing. Do as you please with my painting.</figcaption> </figure> --- ## Two more things There are two other techniques I wanted to share that felt out of place above so I'm dropping them here. These both require you to have FiftyThree's Pencil stylus and the Blend feature enabled. If you place strokes of colors on top of a dark background and then slowly smudge upwards, an effect that mimics the aurora borealis can be achieved. <figure> <a href="https://mix.fiftythree.com/11098-Michael-Rose/1576095" target="_blank"><img src="{{ site.url }}/images/paper-53-space-aurora-blend.jpg" alt="a blended aurora in space"></a> <figcaption>Direction and speed really matter here. The slower you move the further the color can be "pulled."</figcaption> </figure> A slightly modified approach to this technique can be used to create black holes. Instead of using slow upward smudges, you pull in a circular motion. <figure class="third"> <a href="{{ site.url }}/images/paper-53-space-blackhole-1-lg.jpg"><img src="{{ site.url }}/images/paper-53-space-blackhole-1-600.jpg" alt="screenshot of drawing a black hole step 1"></a> <a href="{{ site.url }}/images/paper-53-space-blackhole-2-lg.jpg"><img src="{{ site.url }}/images/paper-53-space-blackhole-2-600.jpg" alt="screenshot of drawing a black hole step 2"></a> <a href="{{ site.url }}/images/paper-53-space-blackhole-3-lg.jpg"><img src="{{ site.url }}/images/paper-53-space-blackhole-3-600.jpg" alt="screenshot of drawing a black hole step 3"></a> <figcaption>Obviously further refinement and the addition of stars needs to happen, but for five minutes of blend work it's not bad.</figcaption> </figure> --- Well I guess that's about it. Since doing video tutorials is fairly new for me (and super time intensive) let me know what works and what doesn't. The best way you can do that is by liking the videos, subscribing to [my YouTube channel](https://www.youtube.com/user/anotherjpeg), and leaving comments. Thanks!
{ "content_hash": "b9bc37155448ef1a4ea242f113fd7ab2", "timestamp": "", "source": "github", "line_count": 375, "max_line_length": 500, "avg_line_length": 69.63466666666666, "alnum_prop": 0.7574005284724084, "repo_name": "U-MH/U-MH.github.io", "id": "09d4163f83edf18b273d7457e4d5b212b055b166", "size": "26117", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "_posts/mastering-paper/2015-01-02-drawing-outer-space.md", "mode": "33261", "license": "mit", "language": [ { "name": "CSS", "bytes": "126757" }, { "name": "HTML", "bytes": "71359" }, { "name": "JavaScript", "bytes": "82451" }, { "name": "PHP", "bytes": "535" }, { "name": "Ruby", "bytes": "4652" } ], "symlink_target": "" }
package hbase.admin; import java.io.IOException; /** * Created by kamir on 20.06.17. */ public class ImageStorePing { /** * * A sanity check for our ImageStore. * * @param args the command line arguments */ public static void main(String[] args) throws IOException { // HBaseTester.main(args); HBaseImageAdapter.init( false ); } }
{ "content_hash": "5ab7d84d442aa18934777a9993c490c5", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 63, "avg_line_length": 15.72, "alnum_prop": 0.6081424936386769, "repo_name": "kamir/cdsw-dl4j-mvdp-on-cdh", "id": "09fc4a338abd07e875a8d2ccc1041fdb03f84956", "size": "393", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/hbase/admin/ImageStorePing.java", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
@page-background: #F5F5F6; @track-width: 500px; @track-height: 0; @track-border-width: 1px; @track-color: #9E9E9E; // base color 500 @track-disabled-color: #B6B6B6; // #000000, Opacity 26% @track-off-color: #B6B6B6; // #000000, Opacity 26% @track-off-focused-color: #9A9A9A; // #000000, Opacity 38% @thumb-width: 12px; @thumb-height: @thumb-width; @thumb-disabled-width: 0.7*@thumb-width; @thumb-disabled-height: @thumb-disabled-width; @thumb-color: #FF9800; // base color 500 @thumb-focused-color: #FBD499; // base color 500, Opacity 38% @thumb-focused-shadow-height: 10px; @thumb-focused-shadow: 0px 0px 0px @thumb-focused-shadow-height rgba(255,152,0,0.38); @thumb-radius: 50%; @thumb-disabled-color: @track-disabled-color; @thumb-off-color: @track-off-color; @thumb-off-focused-color: @track-off-focused-color; @thumb-off-focused-shadow: 0px 0px 0px @thumb-focused-shadow-height rgba(0,0,0,0.38); html, body { margin: 0; padding: 0; background: @page-background; font-family: "Open Sans", sans-serif; } .page { margin: 50px; text-align: center; } .introduction { margin: 0 auto 50px auto; width: @track-width + 100px; font-size: 1.2em; } h3 { margin-top: 50px; } a { color: @thumb-color; } .range-wrapper { margin: 20px 0; } input[type="range"] { margin: 0; -webkit-appearance: none; width: @track-width; height: auto; padding: 0; border: none; z-index: 10; position: relative; background: transparent; &:focus { outline: none; } &::-webkit-slider-runnable-track { width: @track-width; height: 0; cursor: pointer; box-shadow: none; } &::-webkit-slider-thumb::before { background: @thumb-color; } &::-webkit-slider-thumb { -webkit-appearance: none; margin-top: -1/2*@thumb-height; box-sizing: border-box; width: @thumb-width; height: @thumb-height; box-shadow: none; border-width: 0; border-radius: @thumb-radius; background: @thumb-color; cursor: pointer; } &.off::-webkit-slider-thumb { background: @page-background; border: 2px @thumb-off-color solid; } &:focus:enabled::-webkit-slider-thumb, &:active:enabled::-webkit-slider-thumb { -webkit-appearance: none; box-shadow: @thumb-focused-shadow; -webkit-box-shadow: @thumb-focused-shadow; } &.off:focus:enabled::-webkit-slider-thumb, &.off:active:enabled::-webkit-slider-thumb { border-color: @thumb-off-focused-color; box-shadow: @thumb-off-focused-shadow; -webkit-box-shadow: @thumb-off-focused-shadow; } &.off:focus:enabled::-webkit-slider-runnable-track { background: @track-off-focused-color; } &:focus::-webkit-slider-runnable-track { background: @track-color; } &:disabled::-webkit-slider-runnable-track { background: @track-disabled-color; } &:disabled::-webkit-slider-thumb::before { background: @track-disabled-color; } &:disabled::-webkit-slider-thumb { margin-top: -1/2*@thumb-disabled-height; width: @thumb-disabled-width; height: @thumb-disabled-height; background: @thumb-disabled-color; border: 2px @thumb-disabled-color solid; box-shadow: 0px 0px 0px 2px @page-background; -webkit-box-shadow: 0px 0px 0px 2px @thumb-focused-shadow-height @page-background; } &.off:disabled::-webkit-slider-thumb { background: @page-background; } &::-moz-range-track { width: @track-width; height: 0; box-shadow: none; border: @track-border-width solid @track-color; cursor: pointer; } &.off:focus::-moz-range-track { border-color: @track-off-focused-color; } &::-moz-range-progress { background: @thumb-color; } &::-moz-range-thumb { width: @thumb-width; height: @thumb-height; box-sizing: border-box; box-shadow: none; border-width: 0; border-radius: @thumb-radius; background: @thumb-color; cursor: pointer; } &.off::-moz-range-thumb { background: @page-background; border: 2px @thumb-color solid; } &:focus:enabled::-moz-range-thumb, &:active:enabled::-moz-range-thumb { box-shadow: @thumb-focused-shadow; -moz-box-shadow: @thumb-focused-shadow; } &.off:focus:enabled::moz-range-thumb, &.off:active:enabled::moz-range-thumb { border-color: @thumb-off-focused-color; box-shadow: @thumb-off-focused-shadow; -webkit-box-shadow: @thumb-off-focused-shadow; } &.off:focus:enabled::-webkit-slider-runnable-track { background: @track-off-focused-color; } &:disabled::-moz-range-progress { background: @track-disabled-color; } &:disabled::-moz-range-thumb { width: @thumb-disabled-width; height: @thumb-disabled-height; background: @thumb-disabled-color; border: 2px @thumb-disabled-color solid; box-shadow: 0px 0px 0px 2px @page-background; -webkit-box-shadow: 0px 0px 0px 2px @thumb-focused-shadow-height @page-background; } &.off:disabled::-moz-range-thumb { background: @page-background; } &::-ms-track { width: @track-width; height: 1px; cursor: pointer; background: transparent; border-color: transparent; border-style: solid; border-width: (@thumb-width + @thumb-focused-shadow-height/2) 0; color: transparent; z-index: 20; } &::-ms-fill-lower { box-shadow: none; background: @thumb-color; } &::-ms-fill-upper { box-shadow: none; background: @track-color; } &:focus::-ms-fill-lower { background: @thumb-color; } &:focus::-ms-fill-upper { background: @track-color; } &::-ms-thumb { width: @thumb-width; height: @thumb-height; box-sizing: border-box; box-shadow: none; border-width: 0; border-radius: @thumb-radius; background: @thumb-color; cursor: pointer; z-index: 50; } &.zero::-ms-thumb { background: @page-background; border: 2px @thumb-color solid; } &:focus:enabled::-ms-thumb { /*box-shadow: @thumb-focused-shadow; -ms-box-shadow: @thumb-focused-shadow;*/ } &:disabled::-ms-fill-lower { background: @track-color; } &:disabled::-ms-thumb { width: @thumb-disabled-width; height: @thumb-disabled-height; background: @track-color; border: 2px @page-background solid; } &.off:disabled::-ms-thumb { background: @page-background; border: 2px @track-color solid; } } /* hack for webkit browsers */ @media screen and (-webkit-min-device-pixel-ratio:0) { input[type="range"] { height: @track-border-width*2; background: @track-color; &:disabled { background: @track-disabled-color; } &.zero:enabled { background: @track-off-color; } &.zero:focus { background: @track-off-focused-color; } } }
{ "content_hash": "835c9f57e20dc9d1eebf4556d88fa183", "timestamp": "", "source": "github", "line_count": 298, "max_line_length": 86, "avg_line_length": 23.268456375838927, "alnum_prop": 0.6293625612921835, "repo_name": "Sufflavus/CodepenExamples", "id": "c8753db9bc6537e900ad0163000fd12ea85114cb", "size": "6934", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "33_MaterialRangeInput/style.css", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "36268" }, { "name": "JavaScript", "bytes": "148493" } ], "symlink_target": "" }
/*****************************************************************************/ /** * @file WorldCoordinate.cpp * @author Naohisa Sakamoto */ /*****************************************************************************/ #include "WorldCoordinate.h" #include "CameraCoordinate.h" #include "ObjectCoordinate.h" #include <kvs/Camera> #include <kvs/ObjectBase> #include <kvs/Xform> namespace kvs { /*===========================================================================*/ /** * @brief Constructs a new WorldCoordinate class. * @param position [in] position in world coordinates */ /*===========================================================================*/ WorldCoordinate::WorldCoordinate( const kvs::Vec3& position ): m_position( position ) { } /*===========================================================================*/ /** * @brief Transforms world coordinates to camera coordinates. * @param camera [in] pointer to a camera defines camera coordiantes * @return transformed position in camera coordinates */ /*===========================================================================*/ const CameraCoordinate WorldCoordinate::toCameraCoordinate( const kvs::Camera* camera ) const { const kvs::Vec3 position = kvs::Xform( camera->viewingMatrix() ).transform( m_position ); return CameraCoordinate( position, camera ); } /*===========================================================================*/ /** * @brief Transforms the world coordinates to the object coordinates. * @param object [in] pointer to an object defines object coordiantes * @return transformed position in object coordinates */ /*===========================================================================*/ const ObjectCoordinate WorldCoordinate::toObjectCoordinate( const kvs::ObjectBase* object ) const { const kvs::Vec3 position = object->xform().inverse().transform( m_position ); return ObjectCoordinate( position, object ); } } // end of namespace kvs
{ "content_hash": "df8de90d9c450e5e7a10ba147c1b7c99", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 97, "avg_line_length": 36.43636363636364, "alnum_prop": 0.49750499001996007, "repo_name": "naohisas/KVS", "id": "afc46ac031571facece1b2b702a874f7069b4c61", "size": "2004", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "Source/Core/Visualization/Viewer/WorldCoordinate.cpp", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C", "bytes": "1226831" }, { "name": "C++", "bytes": "7219103" }, { "name": "CMake", "bytes": "16176" }, { "name": "GLSL", "bytes": "169334" }, { "name": "Makefile", "bytes": "145951" }, { "name": "Python", "bytes": "14182" }, { "name": "QMake", "bytes": "5029" }, { "name": "Shell", "bytes": "3023" } ], "symlink_target": "" }
/* JAMS * (c) 2014 Justin Gottula * The source code of this project is distributed under the terms of the * simplified BSD license. See the LICENSE file for details. */ #ifndef JAMS_MCU_MEM_H #define JAMS_MCU_MEM_H #include "std.h" void *safe_malloc(size_t size) __attribute__((__malloc__)); #define malloc safe_malloc void *safe_calloc(size_t nele, size_t size) __attribute__((__malloc__)); #define calloc safe_calloc #endif
{ "content_hash": "c335b4632ef804f39be710ac26c16422", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 72, "avg_line_length": 19.954545454545453, "alnum_prop": 0.6947608200455581, "repo_name": "jgottula/JAMS", "id": "84bd8b1b356b91c8465925d8761ae83dff7d1534", "size": "439", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/mcu/mem.h", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "C", "bytes": "23616" }, { "name": "C++", "bytes": "1966" }, { "name": "Stata", "bytes": "3554" } ], "symlink_target": "" }
import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "etc.settings") try: from django.core.management import execute_from_command_line except ImportError: # The above import may fail for some other reason. Ensure that the # issue is really that Django is missing to avoid masking other # exceptions on Python 2. try: import django except ImportError: raise ImportError( "Couldn't import Django. Are you sure it's installed and " "available on your PYTHONPATH environment variable? Did you " "forget to activate a virtual environment?" ) raise execute_from_command_line(sys.argv)
{ "content_hash": "9a38e07f2cd16fe0279b285a8b60b1a9", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 77, "avg_line_length": 37.095238095238095, "alnum_prop": 0.6187419768934531, "repo_name": "sinner/testing-djrf", "id": "87c2041c4542d4593639bfbc7203ffcd88cfac60", "size": "801", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tutorial/manage.py", "mode": "33261", "license": "mit", "language": [ { "name": "Python", "bytes": "31378" } ], "symlink_target": "" }
rmTech.github.io ================
{ "content_hash": "877a564f6ea8153b8d8913bde8ba5bd4", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 16, "avg_line_length": 17, "alnum_prop": 0.4117647058823529, "repo_name": "rmTech/rmTech.github.io", "id": "ef85878a6abee180a3f28a13e6aee0dff449b18e", "size": "34", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "15027" }, { "name": "JavaScript", "bytes": "48" } ], "symlink_target": "" }
List of all the rules for the QA blackjack games. The list is in **rules.txt**. To add your own changes follow the steps below (This is simplified workflow, with no branches, etc): 1. Click the fork button in the top right. 2. In your terminal/command prompt enter ```git clone git@github.com:YOURUSERNAME/FORKED-PROJECT.git``` To push the changes to your repository: 1. ```git init``` 2. ```git add .``` 3. ```git commit -m "Your message here"``` 4. ```git remote add origin https://github.com/YOURUSERNAME/PROJECTNAME``` 5. ```git push origin master``` Once you've committed and pushed all of your changes to GitHub, go to the page for your fork on GitHub, select your development branch, and click the pull request button. If you need to make any adjustments to your pull request, just push the updates to GitHub. Your pull request will automatically track the changes on your development branch and update. Sources https://gist.github.com/Chaser324/ce0505fbed06b947d962
{ "content_hash": "09f05c9258fa99cd86f358805c52a399", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 355, "avg_line_length": 49.05, "alnum_prop": 0.7543323139653415, "repo_name": "Brad94/QA-Blackjack-Rules", "id": "ac218f713dd5494c1a7e27541ce9cd547ecf6db7", "size": "1002", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
package org.unbescape.javascript; import org.junit.Test; import static org.unbescape.javascript.JavaScriptEscapeTestUtil.testUnescape; /** * * @author Daniel Fern&aacute;ndez * * @since 1.0 * */ public class JavaScriptEscape09Test { private static final String TEXT_ESC = "\\0"; private static final String TEXT_UNESC = "\u0000"; @Test public void testUnescape01() throws Exception { testUnescape(TEXT_ESC, TEXT_UNESC); } public JavaScriptEscape09Test() { super(); } }
{ "content_hash": "3cd69a779c3d5cc413223de07e6d23cf", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 77, "avg_line_length": 13.5, "alnum_prop": 0.6611111111111111, "repo_name": "unbescape/unbescape-tests", "id": "a70c6cc78c224ba26b8cb0e872135847362669dd", "size": "1371", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/test/java/org/unbescape/javascript/JavaScriptEscape09Test.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "1205351" }, { "name": "Shell", "bytes": "1048" } ], "symlink_target": "" }
const {GraphQLObjectType, GraphQLSchema, GraphQLInt} = require('graphql/type') let count = 0 let schema = new GraphQLSchema({ query: new GraphQLObjectType({ name: 'RootQueryType', fields: { count: { type: GraphQLInt, resolve: function() { return count } } } }) }) module.export = schema
{ "content_hash": "1a1e2e7ae1628e8dc65adb6d49d0ce7b", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 79, "avg_line_length": 18.833333333333332, "alnum_prop": 0.6135693215339233, "repo_name": "Arguiwu/code-snippet", "id": "fc952ee7201a642858ca72efbfe62025256f186a", "size": "339", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "graphql-demo/schema.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "9409" }, { "name": "Go", "bytes": "14561" }, { "name": "HTML", "bytes": "29072" }, { "name": "JavaScript", "bytes": "5567969" }, { "name": "TypeScript", "bytes": "17072" }, { "name": "Vue", "bytes": "3519" } ], "symlink_target": "" }
package com.google.cloud.networkmanagement.v1beta1.samples; // [START networkmanagement_v1beta1_generated_ReachabilityService_CreateConnectivityTest_async] import com.google.api.core.ApiFuture; import com.google.cloud.networkmanagement.v1beta1.ConnectivityTest; import com.google.cloud.networkmanagement.v1beta1.CreateConnectivityTestRequest; import com.google.cloud.networkmanagement.v1beta1.ReachabilityServiceClient; import com.google.longrunning.Operation; public class AsyncCreateConnectivityTest { public static void main(String[] args) throws Exception { asyncCreateConnectivityTest(); } public static void asyncCreateConnectivityTest() throws Exception { // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ReachabilityServiceClient reachabilityServiceClient = ReachabilityServiceClient.create()) { CreateConnectivityTestRequest request = CreateConnectivityTestRequest.newBuilder() .setParent("parent-995424086") .setTestId("testId-877170355") .setResource(ConnectivityTest.newBuilder().build()) .build(); ApiFuture<Operation> future = reachabilityServiceClient.createConnectivityTestCallable().futureCall(request); // Do something. Operation response = future.get(); } } } // [END networkmanagement_v1beta1_generated_ReachabilityService_CreateConnectivityTest_async]
{ "content_hash": "1b2d44e5774c54f914917ed5693196f0", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 100, "avg_line_length": 46.526315789473685, "alnum_prop": 0.7647058823529411, "repo_name": "googleapis/google-cloud-java", "id": "cda03afb6fa2ca7dd8a3373e7aaed8f1571e8820", "size": "2363", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "java-network-management/samples/snippets/generated/com/google/cloud/networkmanagement/v1beta1/reachabilityservice/createconnectivitytest/AsyncCreateConnectivityTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Dockerfile", "bytes": "2614" }, { "name": "HCL", "bytes": "28592" }, { "name": "Java", "bytes": "826434232" }, { "name": "Jinja", "bytes": "2292" }, { "name": "Python", "bytes": "200408" }, { "name": "Shell", "bytes": "97954" } ], "symlink_target": "" }
require "vagrant" module VagrantPlugins module XenServer module Errors class VagrantXenServerError < Vagrant::Errors::VagrantError error_namespace("vagrant_xenserver.errors") end class LoginError < VagrantXenServerError error_key(:login_error) end class UploaderInterrupted < VagrantXenServerError error_key(:uploader_interrupted) end class UploaderError < VagrantXenServerError error_key(:uploader_error) end class APIError < VagrantXenServerError error_key(:api_error) end class UnknownOS < VagrantXenServerError error_key(:unknown_os) end class QemuImgError < VagrantXenServerError error_key(:qemuimg_error) end class NoDefaultSR < VagrantXenServerError error_key(:nodefaultsr_error) end class NoHostsAvailable < VagrantXenServerError error_key(:nohostsavailable_error) end class Import404 < VagrantXenServerError error_key(:import404) end class InvalidNetwork < VagrantXenServerError error_key(:invalid_network) end class InvalidInterface < VagrantXenServerError error_key(:invalid_interface) end class InsufficientSpace < VagrantXenServerError error_key(:insufficientspace) end class ConnectionError < VagrantXenServerError error_key(:connection_error) end class HIMNCommunicatorError < VagrantXenServerError error_key(:himn_communicator_error) end class CannotAllocateAddress < VagrantXenServerError error_key(:allocate_address_error) end class ReadIPError < VagrantXenServerError error_key(:read_ip_error) end end end end
{ "content_hash": "896fb7c6ecedd8fd375afeafb865cd1e", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 65, "avg_line_length": 24.053333333333335, "alnum_prop": 0.667960088691796, "repo_name": "jogjacamp/vagrant-xenserver-jc", "id": "e306461a9245fc9f4cfd395fa4e89658834e441e", "size": "1804", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/vagrant-xenserver/errors.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "77649" }, { "name": "Shell", "bytes": "4829" } ], "symlink_target": "" }
package org.apache.hadoop.hbase.themis.index.cp; import java.io.IOException; import java.util.HashMap; import java.util.Map; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.KeyValue.Type; import org.apache.hadoop.hbase.client.Result; import org.apache.hadoop.hbase.client.ResultScanner; import org.apache.hadoop.hbase.themis.ThemisDelete; import org.apache.hadoop.hbase.themis.ThemisGet; import org.apache.hadoop.hbase.themis.ThemisPut; import org.apache.hadoop.hbase.themis.ThemisScan; import org.apache.hadoop.hbase.themis.cache.ColumnMutationCache; import org.apache.hadoop.hbase.themis.columns.ColumnCoordinate; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.Pair; import org.junit.Assert; import org.junit.Test; public class TestDefaultIndexer extends IndexTestBase { @Test public void testLoadSecondaryIndexesForTable() throws IOException { Map<IndexColumn, String> columnIndexes = new HashMap<IndexColumn, String>(); DefaultIndexer indexer = new DefaultIndexer(conf); indexer.loadSecondaryIndexesForTable(admin.getTableDescriptor(MAIN_TABLE), columnIndexes); Assert.assertEquals(1, columnIndexes.size()); IndexColumn indexColumn = new IndexColumn(MAIN_TABLE, INDEX_FAMILY, INDEX_QUALIFIER); Assert.assertTrue(columnIndexes.containsKey(indexColumn)); Assert.assertEquals(Bytes.toString(INDEX_TABLE), columnIndexes.get(indexColumn)); } @Test public void testAddIndexMutations() throws IOException { ColumnMutationCache mutationCache = new ColumnMutationCache(); mutationCache.addMutation(TABLENAME, KEYVALUE); mutationCache.addMutation(MAIN_TABLE, new KeyValue(ROW, ANOTHER_FAMILY, INDEX_QUALIFIER, Long.MAX_VALUE, Type.Put, VALUE)); mutationCache.addMutation(MAIN_TABLE, new KeyValue(ROW, INDEX_FAMILY, ANOTHER_QUALIFIER, Long.MAX_VALUE, Type.Put, VALUE)); mutationCache.addMutation(MAIN_TABLE, new KeyValue(ROW, INDEX_FAMILY, INDEX_QUALIFIER, Long.MAX_VALUE, Type.DeleteColumn, VALUE)); DefaultIndexer indexer = new DefaultIndexer(conf); indexer.addIndexMutations(mutationCache); Assert.assertEquals(4, mutationCache.size()); mutationCache.addMutation(MAIN_TABLE, new KeyValue(ROW, INDEX_FAMILY, INDEX_QUALIFIER, Long.MAX_VALUE, Type.Put, VALUE)); indexer.addIndexMutations(mutationCache); Assert.assertEquals(5, mutationCache.size()); ColumnCoordinate columnCoordinate = new ColumnCoordinate(INDEX_TABLE, VALUE, IndexMasterObserver.THEMIS_SECONDARY_INDEX_TABLE_FAMILY_BYTES, ROW); Pair<Type, byte[]> typeAndValue = mutationCache.getMutation(columnCoordinate); Assert.assertNotNull(typeAndValue); Assert.assertEquals(Type.Put, typeAndValue.getFirst()); Assert.assertArrayEquals(HConstants.EMPTY_BYTE_ARRAY, typeAndValue.getSecond()); } protected void mockTsAndCommitTransaction() throws IOException { mockTimestamp(commitTs); transaction.commit(); } protected void nextTsAndCreateTransaction() throws IOException { nextTransactionTs(); createTransactionWithMock(); } protected void checkReadResult(byte[] value, ColumnCoordinate column, Result result) throws IOException { checkReadResults(new byte[][]{value}, new ColumnCoordinate[]{column}, result); } protected void checkReadResults(byte[][] values, ColumnCoordinate[] columns, Result result) { Assert.assertEquals(values.length, result.size()); for (int i = 0; i < values.length; ++i) { ColumnCoordinate column = columns[i]; Assert.assertArrayEquals(values[i], result.getValue(column.getFamily(), column.getQualifier())); } } @Test public void testWriteTransactionWithIndex() throws IOException { nextTsAndCreateTransaction(); ThemisPut put = new ThemisPut(ROW); put.add(INDEX_FAMILY, INDEX_QUALIFIER, VALUE); transaction.put(MAIN_TABLE, put); mockTsAndCommitTransaction(); nextTsAndCreateTransaction(); Result result = transaction.get(MAIN_TABLE, new ThemisGet(ROW).addColumn( INDEX_FAMILY, INDEX_QUALIFIER)); checkReadResult(VALUE, COLUMN, result); result = transaction.get(INDEX_TABLE, new ThemisGet(VALUE).addColumn( IndexMasterObserver.THEMIS_SECONDARY_INDEX_TABLE_FAMILY_BYTES, ROW)); Assert.assertEquals(1, result.size()); Assert.assertArrayEquals(HConstants.EMPTY_BYTE_ARRAY, result.list().get(0).getValue()); nextTsAndCreateTransaction(); ThemisDelete delete = new ThemisDelete(ROW); delete.deleteColumn(INDEX_FAMILY, INDEX_QUALIFIER); transaction.delete(MAIN_TABLE, delete); mockTimestamp(commitTs); transaction.commit(); nextTsAndCreateTransaction(); result = transaction.get(MAIN_TABLE, new ThemisGet(ROW).addColumn( INDEX_FAMILY, INDEX_QUALIFIER)); Assert.assertTrue(result.isEmpty()); result = transaction.get(INDEX_TABLE, new ThemisGet(VALUE).addColumn( IndexMasterObserver.THEMIS_SECONDARY_INDEX_TABLE_FAMILY_BYTES, ROW)); Assert.assertEquals(1, result.size()); Assert.assertArrayEquals(HConstants.EMPTY_BYTE_ARRAY, result.list().get(0).getValue()); } @Test public void testIndexGet() throws IOException { Result result = null; nextTsAndCreateTransaction(); transaction.put(MAIN_TABLE, new ThemisPut(ROW).add(FAMILY, QUALIFIER, VALUE)); mockTsAndCommitTransaction(); nextTsAndCreateTransaction(); // no-index scan ResultScanner scanner = transaction.getScanner(MAIN_TABLE, new ThemisScan().addColumn(FAMILY, QUALIFIER)); Assert.assertFalse(scanner instanceof IndexScanner); checkReadResult(VALUE, COLUMN, scanner.next()); scanner.close(); // index get column IndexGet indexGet = new IndexGet(INDEX_COLUMN, VALUE, new DataGet().addColumn(FAMILY, QUALIFIER)); scanner = transaction.getScanner(MAIN_TABLE, indexGet); Assert.assertTrue(scanner instanceof IndexScanner); checkReadResult(VALUE, COLUMN, scanner.next()); checkAndCloseScanner(scanner); // write other qualifier and family nextTsAndCreateTransaction(); transaction.delete(MAIN_TABLE, new ThemisDelete(ROW).deleteColumn(FAMILY, ANOTHER_QUALIFIER)); transaction.put(MAIN_TABLE, new ThemisPut(ROW).add(ANOTHER_FAMILY, QUALIFIER, ANOTHER_VALUE)); mockTsAndCommitTransaction(); nextTsAndCreateTransaction(); // index get family and column indexGet = new IndexGet(INDEX_COLUMN, VALUE, new DataGet().addColumn(FAMILY, QUALIFIER).addFamily(ANOTHER_FAMILY)); scanner = transaction.getScanner(MAIN_TABLE, indexGet); checkReadResults(new byte[][] { VALUE, ANOTHER_VALUE }, new ColumnCoordinate[] { COLUMN, COLUMN_WITH_ANOTHER_FAMILY }, scanner.next()); checkAndCloseScanner(scanner); // index get whole row indexGet = new IndexGet(INDEX_COLUMN, VALUE, new DataGet()); scanner = transaction.getScanner(MAIN_TABLE, indexGet); checkReadResults(new byte[][] { VALUE, ANOTHER_VALUE }, new ColumnCoordinate[] { COLUMN, COLUMN_WITH_ANOTHER_FAMILY }, scanner.next()); checkAndCloseScanner(scanner); // write another value in index column transaction.put(MAIN_TABLE, new ThemisPut(ROW).add(FAMILY, QUALIFIER, ANOTHER_VALUE)); mockTsAndCommitTransaction(); // also get old value because timestamp is not updated indexGet = new IndexGet(INDEX_COLUMN, VALUE, new DataGet().addColumn(FAMILY, QUALIFIER)); scanner = transaction.getScanner(MAIN_TABLE, indexGet); Assert.assertTrue(scanner instanceof IndexScanner); checkReadResult(VALUE, COLUMN, scanner.next()); checkAndCloseScanner(scanner); // can not read the old value nextTransactionTs(); createTransactionWithMock(); indexGet = new IndexGet(INDEX_COLUMN, VALUE, new DataGet().addColumn(FAMILY, QUALIFIER)); scanner = transaction.getScanner(MAIN_TABLE, indexGet); Assert.assertTrue(scanner instanceof IndexScanner); checkAndCloseScanner(scanner); // can read the new value nextTsAndCreateTransaction(); indexGet = new IndexGet(INDEX_COLUMN, ANOTHER_VALUE, new DataGet().addColumn(FAMILY, QUALIFIER) .addFamily(ANOTHER_FAMILY)); scanner = transaction.getScanner(MAIN_TABLE, indexGet); Assert.assertTrue(scanner instanceof IndexScanner); checkReadResults(new byte[][] { ANOTHER_VALUE, ANOTHER_VALUE }, new ColumnCoordinate[] { COLUMN, COLUMN_WITH_ANOTHER_FAMILY }, scanner.next()); checkAndCloseScanner(scanner); // delete value // write another value in index column transaction.delete(MAIN_TABLE, new ThemisDelete(ROW).deleteColumn(FAMILY, QUALIFIER)); mockTsAndCommitTransaction(); // still read old value indexGet = new IndexGet(INDEX_COLUMN, ANOTHER_VALUE, new DataGet().addColumn(FAMILY, QUALIFIER)); scanner = transaction.getScanner(MAIN_TABLE, indexGet); Assert.assertTrue(scanner instanceof IndexScanner); checkReadResult(ANOTHER_VALUE, COLUMN, scanner.next()); checkAndCloseScanner(scanner); // can not read value after timestamp updated nextTsAndCreateTransaction(); indexGet = new IndexGet(INDEX_COLUMN, ANOTHER_VALUE, new DataGet().addColumn(FAMILY, QUALIFIER)); scanner = transaction.getScanner(MAIN_TABLE, indexGet); Assert.assertTrue(scanner instanceof IndexScanner); checkAndCloseScanner(scanner); // two rows with the same index column value nextTsAndCreateTransaction(); transaction.put(MAIN_TABLE, new ThemisPut(ANOTHER_ROW).add(FAMILY, QUALIFIER, VALUE)); transaction.put(MAIN_TABLE, new ThemisPut(ROW).add(FAMILY, QUALIFIER, VALUE)); mockTsAndCommitTransaction(); nextTsAndCreateTransaction(); indexGet = new IndexGet(INDEX_COLUMN, VALUE, new DataGet().addColumn(FAMILY, QUALIFIER)); scanner = transaction.getScanner(MAIN_TABLE, indexGet); Assert.assertTrue(scanner instanceof IndexScanner); result = scanner.next(); Assert.assertArrayEquals(ANOTHER_ROW, result.getRow()); checkReadResult(VALUE, COLUMN, result); result = scanner.next(); Assert.assertArrayEquals(ROW, result.getRow()); checkReadResult(VALUE, COLUMN, result); checkAndCloseScanner(scanner); } @Test public void testIndexScan() throws IOException { nextTsAndCreateTransaction(); transaction.put(MAIN_TABLE, new ThemisPut(ANOTHER_ROW).add(FAMILY, QUALIFIER, ANOTHER_VALUE)); transaction.put(MAIN_TABLE, new ThemisPut(ROW).add(FAMILY, QUALIFIER, VALUE)); transaction.put(MAIN_TABLE, new ThemisPut(ROW).add(FAMILY, ANOTHER_QUALIFIER, VALUE)); transaction.put(MAIN_TABLE, new ThemisPut(ROW).add(ANOTHER_FAMILY, QUALIFIER, VALUE)); mockTsAndCommitTransaction(); nextTsAndCreateTransaction(); IndexScan indexScan = new IndexScan(INDEX_COLUMN); ResultScanner scanner = transaction.getScanner(MAIN_TABLE, indexScan); Assert.assertTrue(scanner instanceof IndexScanner); checkReadResult(ANOTHER_VALUE, COLUMN, scanner.next()); checkReadResults(new byte[][] { VALUE, VALUE, VALUE }, new ColumnCoordinate[] { COLUMN, COLUMN_WITH_ANOTHER_QUALIFIER, COLUMN_WITH_ANOTHER_FAMILY }, scanner.next()); checkAndCloseScanner(scanner); // start/stop row for index scan indexScan = new IndexScan(INDEX_COLUMN, ANOTHER_VALUE, ANOTHER_VALUE); scanner = transaction.getScanner(MAIN_TABLE, indexScan); Assert.assertTrue(scanner instanceof IndexScanner); checkReadResult(ANOTHER_VALUE, COLUMN, scanner.next()); checkAndCloseScanner(scanner); // Delete/Update transaction.delete(MAIN_TABLE, new ThemisDelete(ROW).deleteColumn(FAMILY, ANOTHER_QUALIFIER)); transaction.put(MAIN_TABLE, new ThemisPut(ROW).add(ANOTHER_FAMILY, QUALIFIER, ANOTHER_VALUE)); mockTsAndCommitTransaction(); // won't get new result before update timestamp indexScan = new IndexScan(INDEX_COLUMN); scanner = transaction.getScanner(MAIN_TABLE, indexScan); Assert.assertTrue(scanner instanceof IndexScanner); checkReadResult(ANOTHER_VALUE, COLUMN, scanner.next()); checkReadResults(new byte[][] { VALUE, VALUE, VALUE }, new ColumnCoordinate[] { COLUMN, COLUMN_WITH_ANOTHER_QUALIFIER, COLUMN_WITH_ANOTHER_FAMILY }, scanner.next()); checkAndCloseScanner(scanner); nextTsAndCreateTransaction(); indexScan = new IndexScan(INDEX_COLUMN); scanner = transaction.getScanner(MAIN_TABLE, indexScan); Assert.assertTrue(scanner instanceof IndexScanner); checkReadResult(ANOTHER_VALUE, COLUMN, scanner.next()); checkReadResults(new byte[][] { VALUE, ANOTHER_VALUE }, new ColumnCoordinate[] { COLUMN, COLUMN_WITH_ANOTHER_FAMILY }, scanner.next()); checkAndCloseScanner(scanner); // update value to make tow rows have the same index column value transaction.put(MAIN_TABLE, new ThemisPut(ANOTHER_ROW).add(FAMILY, QUALIFIER, VALUE)); mockTsAndCommitTransaction(); nextTsAndCreateTransaction(); indexScan = new IndexScan(INDEX_COLUMN); scanner = transaction.getScanner(MAIN_TABLE, indexScan); Assert.assertTrue(scanner instanceof IndexScanner); checkReadResult(VALUE, COLUMN, scanner.next()); checkReadResults(new byte[][] { VALUE, ANOTHER_VALUE }, new ColumnCoordinate[] { COLUMN, COLUMN_WITH_ANOTHER_FAMILY }, scanner.next()); checkAndCloseScanner(scanner); } }
{ "content_hash": "5288cfb52136eb43edf9c97a488efc67", "timestamp": "", "source": "github", "line_count": 295, "max_line_length": 102, "avg_line_length": 45.664406779661014, "alnum_prop": 0.7337985301759334, "repo_name": "YanjieGao/themis", "id": "1f0bc01f69dd2460c842e97d64aebee64ade5a99", "size": "13471", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "themis-index/src/test/java/org/apache/hadoop/hbase/themis/index/cp/TestDefaultIndexer.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "551864" } ], "symlink_target": "" }
license: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --- ContactName =========== Contains name properties of a `Contact` object. Properties ---------- - __formatted:__ The complete name of the contact. _(DOMString)_ - __familyName:__ The contacts family name. _(DOMString)_ - __givenName:__ The contacts given name. _(DOMString)_ - __middleName:__ The contacts middle name. _(DOMString)_ - __honorificPrefix:__ The contacts prefix (example Mr. or Dr.) _(DOMString)_ - __honorificSuffix:__ The contacts suffix (example Esq.). _(DOMString)_ Details ------- The `ContactName` object stores name properties of a contact. Supported Platforms ------------------- - Android 2.X - BlackBerry WebWorks (OS 5.0 and higher) - iOS - Bada 1.2 & 2.0 - Windows Phone 7 - Windows 8 Quick Example ------------- function onSuccess(contacts) { for (var i=0; i<contacts.length; i++) { alert("Formatted: " + contacts[i].name.formatted + "\n" + "Family Name: " + contacts[i].name.familyName + "\n" + "Given Name: " + contacts[i].name.givenName + "\n" + "Middle Name: " + contacts[i].name.middleName + "\n" + "Suffix: " + contacts[i].name.honorificSuffix + "\n" + "Prefix: " + contacts[i].name.honorificSuffix); } }; function onError(contactError) { alert('onError!'); }; var options = new ContactFindOptions(); options.filter=""; filter = ["displayName","name"]; navigator.contacts.find(filter, onSuccess, onError, options); Full Example ------------ <!DOCTYPE html> <html> <head> <title>Contact Example</title> <script type="text/javascript" charset="utf-8" src="cordova-2.3.0.js"></script> <script type="text/javascript" charset="utf-8"> // Wait for Cordova to load // document.addEventListener("deviceready", onDeviceReady, false); // Cordova is ready // function onDeviceReady() { var options = new ContactFindOptions(); options.filter=""; filter = ["displayName","name"]; navigator.contacts.find(filter, onSuccess, onError, options); } // onSuccess: Get a snapshot of the current contacts // function onSuccess(contacts) { for (var i=0; i<contacts.length; i++) { alert("Formatted: " + contacts[i].name.formatted + "\n" + "Family Name: " + contacts[i].name.familyName + "\n" + "Given Name: " + contacts[i].name.givenName + "\n" + "Middle Name: " + contacts[i].name.middleName + "\n" + "Suffix: " + contacts[i].name.honorificSuffix + "\n" + "Prefix: " + contacts[i].name.honorificPrefix); } }; // onError: Failed to get the contacts // function onError(contactError) { alert('onError!'); } </script> </head> <body> <h1>Example</h1> <p>Find Contacts</p> </body> </html> Android Quirks ------------ - __formatted:__ Partially supported. Will return the concatenation of honorificPrefix, givenName, middleName, familyName and honorificSuffix but will not store. BlackBerry WebWorks (OS 5.0 and higher) Quirks --------------------------------------------- - __formatted:__ Partially supported. Will return concatenation of BlackBerry __firstName__ and __lastName__ fields. - __familyName:__ Supported. Stored in BlackBerry __lastName__ field. - __givenName:__ Supported. Stored in BlackBerry __firstName__ field. - __middleName:__ This property is not supported, and will always return `null`. - __honorificPrefix:__ This property is not supported, and will always return `null`. - __honorificSuffix:__ This property is not supported, and will always return `null`. iOS Quirks ------------ - __formatted:__ Partially supported. Will return iOS Composite Name but will not store. Bada Quirks ----------- - __formatted:__ Property not supported - __middleName:__ Property not supported _ __honorificPrefix:__ Property not supported - __honorificSuffix:__ Property not supported
{ "content_hash": "8a086da5e8a95ffe16e235469fa70b1d", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 162, "avg_line_length": 33.294520547945204, "alnum_prop": 0.6297058218473565, "repo_name": "maveriklko9719/Coffee-Spills", "id": "5ab46257cbad5e3bbe189d0c22520778e2ec4bc6", "size": "4865", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "docs/en/2.3.0rc1/cordova/contacts/ContactName/contactname.md", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "10947" }, { "name": "JavaScript", "bytes": "2656" }, { "name": "Ruby", "bytes": "53938" }, { "name": "Shell", "bytes": "643" } ], "symlink_target": "" }
<?php namespace Celtric\Fixtures; use Celtric\Fixtures\FixtureTypes\CacheableDefinition; class CachedDefinitionFactory extends FixtureDefinitionFactory { /** @var \ArrayObject */ private $cache; /** @var FixtureDefinitionFactory */ private $wrappedFactory; /** @var bool */ private $cloneObjects; /** * @param \ArrayObject $cache * @param FixtureDefinitionFactory $wrappedFactory * @param bool $cloneObjects */ public function __construct(\ArrayObject $cache, FixtureDefinitionFactory $wrappedFactory, $cloneObjects) { $this->cache = $cache; $this->wrappedFactory = $wrappedFactory; $this->cloneObjects = $cloneObjects; } /** * @inheritDoc */ public function null() { return $this->wrappedFactory->null(); } /** * @inheritDoc */ public function scalar($value) { return $this->wrappedFactory->scalar($value); } /** * @inheritDoc */ public function arr(array $data) { return $this->cache($this->hash($data), $this->wrappedFactory->arr($data)); } /** * @inheritDoc */ public function object($className, array $properties) { return $this->cache($this->hash([$className, $properties]), $this->wrappedFactory->object($className, $properties)); } /** * @inheritDoc */ public function reference($reference, DefinitionLocator $definitionLocator) { return $this->cache($reference, $this->wrappedFactory->reference($reference, $definitionLocator)); } /** * @param string $hash * @param FixtureDefinition $definition * @return FixtureDefinition */ private function cache($hash, FixtureDefinition $definition) { if (empty($this->cache[$hash])) { $this->cache[$hash] = new CacheableDefinition($definition, $this->cloneObjects); } return $this->cache[$hash]; } /** * @param mixed $data * @return string */ private function hash($data) { return md5(serialize($data)); } }
{ "content_hash": "8ca1d2bf4e0161c6e3aa69387f1405cd", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 124, "avg_line_length": 23.45054945054945, "alnum_prop": 0.6002811621368322, "repo_name": "celtric/fixtures-php", "id": "359727dc9bb450ed34ae50cd40ae3b79eeef0c6d", "size": "2134", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Celtric/Fixtures/CachedDefinitionFactory.php", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "67969" } ], "symlink_target": "" }
#import "CC3ParametricMeshes.h" #import "CC3CC2Extensions.h" #import "CGPointExtension.h" #pragma mark - #pragma mark CC3Mesh parametric shapes extension @implementation CC3Mesh (ParametricShapes) #pragma mark Utility methods -(void) ensureVertexContent { if (self.vertexContentTypes == kCC3VertexContentNone) { self.vertexContentTypes = (kCC3VertexContentLocation | kCC3VertexContentNormal | kCC3VertexContentTextureCoordinates); } } #pragma mark Populating parametric triangles -(void) populateAsTriangle: (CC3Face) face withTexCoords: (ccTex2F*) tc andTessellation: (GLuint) divsPerSide { // Must have at least one division per side divsPerSide = MAX(divsPerSide, 1); // The fraction of each side that each division represents. // This is the barycentric coordinate division increment. GLfloat divFrac = 1.0f / divsPerSide; // Derive the normal. All vertices on the triangle will have the same normal. CC3Vector vtxNml = CC3FaceNormal(face); GLuint vertexCount = (divsPerSide + 2) * (divsPerSide + 1) / 2.0f; GLuint triangleCount = divsPerSide * divsPerSide; // Prepare the vertex content and allocate space for vertices and indices. [self ensureVertexContent]; self.allocatedVertexCapacity = vertexCount; self.allocatedVertexIndexCapacity = (triangleCount * 3); GLuint vIdx = 0; GLuint iIdx = 0; // Denoting the three corners of the main triangle as c0, c1 & c2, and denoting the side // extending from c0 to c1 as s1, and the side extending from c0 to c2 as s2, we can work // in barycentric coordinates by starting at c0, iterating the divisions on the s2, and for // each divison on that side, iterating the divisions on the side of the internal similar // triangle that is parallel to s1. for (GLuint i2 = 0; i2 <= divsPerSide; i2++) { // Calculate the barycentric weight for the current division along s2 and hold it constant // as we iterate through divisions along s1 of the resulting internal similar triangle. // The number of divisions on the side of the internal similar triangle is found by subtracting // the current division index of s2 from the total divisions per side. GLfloat bw2 = divFrac * i2; GLuint divsSimSide1 = divsPerSide - i2; for (GLuint i1 = 0; i1 <= divsSimSide1; i1++) { // Calculate the barycentric weight for the current division along s1 of the internal // similar triangle. The third barycentric weight falls out automatically. GLfloat bw1 = divFrac * i1; GLfloat bw0 = 1.0f - bw1 - bw2; CC3BarycentricWeights bcw = CC3BarycentricWeightsMake(bw0, bw1, bw2); // Vertex location from barycentric coordinates on the main face CC3Vector vtxLoc = CC3FaceLocationFromBarycentricWeights(face, bcw); [self setVertexLocation: vtxLoc at: vIdx]; // Vertex normal is constant. Will do nothing if this mesh does not include normals. [self setVertexNormal: vtxNml at: vIdx]; // Vertex texture coordinates derived from the barycentric coordinates. // Will do nothing if this mesh does not include texture coordinates. GLfloat u = bw0 * tc[0].u + bw1 * tc[1].u + bw2 * tc[2].u; GLfloat v = bw0 * tc[0].v + bw1 * tc[1].v + bw2 * tc[2].v; [self setVertexTexCoord2F: cc3tc(u, v) at: vIdx]; // First tessellated triangle starting at the vertex and opening away from corner 0. if (i1 < divsSimSide1) { [self setVertexIndex: vIdx at: iIdx++]; [self setVertexIndex: (vIdx + 1) at: iIdx++]; [self setVertexIndex: (vIdx + divsSimSide1 + 1) at: iIdx++]; } // Second tessellated triangle starting at the vertex and opening towards corner 0. if (i1 > 0 && i2 > 0) { [self setVertexIndex: vIdx at: iIdx++]; [self setVertexIndex: (vIdx - 1) at: iIdx++]; [self setVertexIndex: (vIdx - divsSimSide1 - 2) at: iIdx++]; } vIdx++; // Move on to the next vertex } } } #pragma mark Populating parametric planes -(void) populateAsCenteredRectangleWithSize: (CGSize) rectSize { [self populateAsRectangleWithSize: rectSize andRelativeOrigin: ccp(0.5f, 0.5f)]; } -(void) populateAsCenteredRectangleWithSize: (CGSize) rectSize andTessellation: (CC3Tessellation) divsPerAxis { [self populateAsRectangleWithSize: rectSize andRelativeOrigin: ccp(0.5f, 0.5f) andTessellation: divsPerAxis]; } -(void) populateAsRectangleWithSize: (CGSize) rectSize andRelativeOrigin: (CGPoint) origin { [self populateAsRectangleWithSize: rectSize andRelativeOrigin: origin andTessellation: CC3TessellationMake(1, 1)]; } -(void) populateAsRectangleWithSize: (CGSize) rectSize andRelativeOrigin: (CGPoint) origin andTessellation: (CC3Tessellation) divsPerAxis { // Must be at least one tessellation face per side of the rectangle. divsPerAxis.x = MAX(divsPerAxis.x, 1); divsPerAxis.y = MAX(divsPerAxis.y, 1); // Move the origin of the rectangle to the specified origin CGPoint rectExtent = ccpFromSize(rectSize); origin = ccpCompMult(rectExtent, origin); CGPoint botLeft = ccpSub(CGPointZero, origin); CGPoint topRight = ccpSub(rectExtent, origin); // The size and texture span of each face in the tessellated grid CGSize divSize = CGSizeMake((topRight.x - botLeft.x) / divsPerAxis.x, (topRight.y - botLeft.y) / divsPerAxis.y); CGSize divTexSpan = CGSizeMake((1.0 / divsPerAxis.x), (1.0 / divsPerAxis.y)); // Get vertices per side. CC3Tessellation verticesPerAxis; verticesPerAxis.x = divsPerAxis.x + 1; verticesPerAxis.y = divsPerAxis.y + 1; GLuint vertexCount = verticesPerAxis.x * verticesPerAxis.y; GLuint triangleCount = divsPerAxis.x * divsPerAxis.y * 2; // Prepare the vertex content and allocate space for vertices and indices. [self ensureVertexContent]; self.allocatedVertexCapacity = vertexCount; self.allocatedVertexIndexCapacity = (triangleCount * 3); // Populate vertex locations, normals & texture coordinates in the X-Y plane // Iterate through the rows and columns of the vertex grid, from the bottom left corner, // and set the location of each vertex to be proportional to its position in the grid, // and set the normal of each vertex to point up the Z-axis. for (int iy = 0; iy < verticesPerAxis.y; iy++) { for (int ix = 0; ix < verticesPerAxis.x; ix++) { int vIndx = iy * verticesPerAxis.x + ix; // Vertex location GLfloat vx = botLeft.x + (divSize.width * ix); GLfloat vy = botLeft.y + (divSize.height * iy); [self setVertexLocation: cc3v(vx, vy, 0.0) at: vIndx]; // Vertex normal. Will do nothing if this mesh does not include normals. [self setVertexNormal: kCC3VectorUnitZPositive at: vIndx]; // Vertex texture coordinates. // Will do nothing if this mesh does not include texture coordinates. GLfloat u = divTexSpan.width * ix; GLfloat v = divTexSpan.height * iy; [self setVertexTexCoord2F: cc3tc(u, v) at: vIndx]; } } // Since the index array is a simple array, just access the array directly. // Iterate through the rows and columns of the faces in the grid, from the bottom left corner, // and specify the indexes of the three vertices in each of the two triangles of each face. GLushort* indices = self.vertexIndices.vertices; int iIndx = 0; for (int iy = 0; iy < divsPerAxis.y; iy++) { for (int ix = 0; ix < divsPerAxis.x; ix++) { GLushort botLeftOfFace; // First triangle of face wound counter-clockwise botLeftOfFace = iy * verticesPerAxis.x + ix; indices[iIndx++] = botLeftOfFace; // Bot left indices[iIndx++] = botLeftOfFace + 1; // Bot right indices[iIndx++] = botLeftOfFace + verticesPerAxis.x + 1; // Top right // Second triangle of face wound counter-clockwise indices[iIndx++] = botLeftOfFace + verticesPerAxis.x + 1; // Top right indices[iIndx++] = botLeftOfFace + verticesPerAxis.x; // Top left indices[iIndx++] = botLeftOfFace; // Bot left } } } #pragma mark Populating parametric circular disk -(void) populateAsDiskWithRadius: (GLfloat) radius andTessellation: (CC3Tessellation) radialAndAngleDivs { // Must be at least one radial tessellation, and three angular tessellation. GLuint numRadialDivs = MAX(radialAndAngleDivs.x, 1); GLuint numAngularDivs = MAX(radialAndAngleDivs.y, 3); // Calculate the spans of each radial and angular division. GLfloat angularDivSpan = kCC3TwoPi / numAngularDivs; // Zero to 2Pi GLfloat radialDivSpan = radius / numRadialDivs; // Zero to radius GLfloat radialTexDivSpan = 0.5 / numRadialDivs; // Zero to 0.5 // Calculate number of vertices, triangles and indices. GLuint vertexCount = (numRadialDivs * (numAngularDivs + 1)) + 1; GLuint triangleCount = ((2 * numRadialDivs) - 1) * numAngularDivs; // Prepare the vertex content and allocate space for vertices and indices. [self ensureVertexContent]; self.allocatedVertexCapacity = vertexCount; self.allocatedVertexIndexCapacity = (triangleCount * 3); GLushort* indices = self.vertexIndices.vertices; // Pointer to the indices LogTrace(@"%@ populating as disk with radius: %.3f, %i radial divs, %i angular divs, %i vertices, and %i triangles", self, radius, numRadialDivs, numAngularDivs, vertexCount, triangleCount); // Populate vertex locations, normals & texture coordinates. GLuint vIndx = 0; // Vertex index GLuint iIndx = 0; // Index index // Add the center vertex Vertex location from unit radial scaled by the radial span and ring number // Setters for any content that is not defined by the vertexContentTypes property will do nothing. [self setVertexLocation: kCC3VectorZero at: vIndx]; [self setVertexNormal: kCC3VectorUnitZPositive at: vIndx]; [self setVertexTexCoord2F: cc3tc(0.5f, 0.5f) at: vIndx]; for (GLuint ia = 0; ia <= numAngularDivs; ia++) { GLfloat angle = angularDivSpan * ia; CGPoint unitRadial = ccp(cosf(angle), sinf(angle)); for (GLuint ir = 1; ir <= numRadialDivs; ir++) { vIndx++; // Move on to the next vertex // Vertex location from unit radial scaled by the radial span and ring number CGPoint locPt = ccpMult(unitRadial, (radialDivSpan * ir)); [self setVertexLocation: cc3v(locPt.x, locPt.y, 0.0f) at: vIndx]; // Vertex normal always points along positive Z-axis // Will do nothing if this mesh does not include normals. [self setVertexNormal: kCC3VectorUnitZPositive at: vIndx]; // Vertex tex coords from unit radial scaled by the radial texture span and ring // number, then shifted to move range from (-0.5 <-> +0.5) to (0.0 <-> +1.0). // Will do nothing if this mesh does not include texture coordinates. CGPoint texPt = ccpAdd(ccpMult(unitRadial, (radialTexDivSpan * ir)), ccp(0.5f, 0.5f)); [self setVertexTexCoord2F: cc3tc(texPt.x, texPt.y) at: vIndx]; // Since the index array is a simple array, just access the array directly. // For the first ring, add one triangle rooted at the origin. // For all but the first ring, add two triangles to cover division trapezoid. // We don't create triangles for the last set of radial vertices, since they // overlap the first. if (ia < numAngularDivs) { if (ir == 1) { indices[iIndx++] = 0; // Center vertex indices[iIndx++] = vIndx; // Current vertex indices[iIndx++] = vIndx + numRadialDivs; // Next angular div, same ring } else { indices[iIndx++] = vIndx; // Current vertex indices[iIndx++] = vIndx + numRadialDivs; // Next angular div, same ring indices[iIndx++] = vIndx + numRadialDivs - 1; // Next angular div, prev ring indices[iIndx++] = vIndx; // Current vertex indices[iIndx++] = vIndx + numRadialDivs - 1; // Next angular div, prev ring indices[iIndx++] = vIndx - 1; // Same angular div, prev ring } } } } } #pragma mark Populating parametric boxes -(void) populateAsSolidBox: (CC3Box) box { GLfloat w = box.maximum.x - box.minimum.x; // Width of the box GLfloat h = box.maximum.y - box.minimum.y; // Height of the box GLfloat d = box.maximum.z - box.minimum.z; // Depth of the box GLfloat ufw = d + w + d + w; // Total width of unfolded flattened box GLfloat ufh = d + h + d; // Total height of unfolded flattened box [self populateAsSolidBox: box withCorner: ccp((d / ufw), (d / ufh))]; } -(void) populateAsCubeMappedSolidBox: (CC3Box) box { [self populateAsSolidBox: box withCorner: ccp((1.0 / 4.0), (1.0 / 3.0))]; } // Thanks to Cocos3D user andyman for contributing the prototype code and texture // template file for this method. -(void) populateAsSolidBox: (CC3Box) box withCorner: (CGPoint) corner { CC3Vector boxMin = box.minimum; CC3Vector boxMax = box.maximum; GLuint vertexCount = 24; GLuint triangleCount = 12; // Prepare the vertex content and allocate space for vertices and indices. [self ensureVertexContent]; self.allocatedVertexCapacity = vertexCount; self.allocatedVertexIndexCapacity = (triangleCount * 3); GLushort* indices = self.vertexIndices.vertices; // Populate all six sides. // Setters for any content that is not defined by the vertexContentTypes property will do nothing. // Front face, CCW winding: [self setVertexLocation: cc3v(boxMin.x, boxMin.y, boxMax.z) at: 0]; [self setVertexNormal: kCC3VectorUnitZPositive at: 0]; [self setVertexTexCoord2F: cc3tc(corner.x, corner.y) at: 0]; [self setVertexLocation: cc3v(boxMax.x, boxMin.y, boxMax.z) at: 1]; [self setVertexNormal: kCC3VectorUnitZPositive at: 1]; [self setVertexTexCoord2F: cc3tc(0.5f, corner.y) at: 1]; [self setVertexLocation: cc3v(boxMax.x, boxMax.y, boxMax.z) at: 2]; [self setVertexNormal: kCC3VectorUnitZPositive at: 2]; [self setVertexTexCoord2F: cc3tc(0.5f, (1.0f - corner.y)) at: 2]; [self setVertexLocation: cc3v(boxMin.x, boxMax.y, boxMax.z) at: 3]; [self setVertexNormal: kCC3VectorUnitZPositive at: 3]; [self setVertexTexCoord2F: cc3tc(corner.x, (1.0f - corner.y)) at: 3]; // Right face, CCW winding: [self setVertexLocation: cc3v(boxMax.x, boxMin.y, boxMax.z) at: 4]; [self setVertexNormal: kCC3VectorUnitXPositive at: 4]; [self setVertexTexCoord2F: cc3tc(0.5f, corner.y) at: 4]; [self setVertexLocation: cc3v(boxMax.x, boxMin.y, boxMin.z) at: 5]; [self setVertexNormal: kCC3VectorUnitXPositive at: 5]; [self setVertexTexCoord2F: cc3tc((0.5f + corner.x), corner.y) at: 5]; [self setVertexLocation: cc3v(boxMax.x, boxMax.y, boxMin.z) at: 6]; [self setVertexNormal: kCC3VectorUnitXPositive at: 6]; [self setVertexTexCoord2F: cc3tc((0.5f + corner.x), (1.0f - corner.y)) at: 6]; [self setVertexLocation: cc3v(boxMax.x, boxMax.y, boxMax.z) at: 7]; [self setVertexNormal: kCC3VectorUnitXPositive at: 7]; [self setVertexTexCoord2F: cc3tc(0.5f, (1.0f - corner.y)) at: 7]; // Back face, CCW winding: [self setVertexLocation: cc3v(boxMax.x, boxMin.y, boxMin.z) at: 8]; [self setVertexNormal: kCC3VectorUnitZNegative at: 8]; [self setVertexTexCoord2F: cc3tc((0.5f + corner.x), corner.y) at: 8]; [self setVertexLocation: cc3v(boxMin.x, boxMin.y, boxMin.z) at: 9]; [self setVertexNormal: kCC3VectorUnitZNegative at: 9]; [self setVertexTexCoord2F: cc3tc(1.0f, corner.y) at: 9]; [self setVertexLocation: cc3v(boxMin.x, boxMax.y, boxMin.z) at: 10]; [self setVertexNormal: kCC3VectorUnitZNegative at: 10]; [self setVertexTexCoord2F: cc3tc(1.0f, (1.0f - corner.y)) at: 10]; [self setVertexLocation: cc3v(boxMax.x, boxMax.y, boxMin.z) at: 11]; [self setVertexNormal: kCC3VectorUnitZNegative at: 11]; [self setVertexTexCoord2F: cc3tc((0.5f + corner.x), (1.0f - corner.y)) at: 11]; // Left face, CCW winding: [self setVertexLocation: cc3v(boxMin.x, boxMin.y, boxMin.z) at: 12]; [self setVertexNormal: kCC3VectorUnitXNegative at: 12]; [self setVertexTexCoord2F: cc3tc(0.0f, corner.y) at: 12]; [self setVertexLocation: cc3v(boxMin.x, boxMin.y, boxMax.z) at: 13]; [self setVertexNormal: kCC3VectorUnitXNegative at: 13]; [self setVertexTexCoord2F: cc3tc(corner.x, corner.y) at: 13]; [self setVertexLocation: cc3v(boxMin.x, boxMax.y, boxMax.z) at: 14]; [self setVertexNormal: kCC3VectorUnitXNegative at: 14]; [self setVertexTexCoord2F: cc3tc(corner.x, (1.0f - corner.y)) at: 14]; [self setVertexLocation: cc3v(boxMin.x, boxMax.y, boxMin.z) at: 15]; [self setVertexNormal: kCC3VectorUnitXNegative at: 15]; [self setVertexTexCoord2F: cc3tc(0.0f, (1.0f - corner.y)) at: 15]; // Top face, CCW winding: [self setVertexLocation: cc3v(boxMin.x, boxMax.y, boxMin.z) at: 16]; [self setVertexNormal: kCC3VectorUnitYPositive at: 16]; [self setVertexTexCoord2F: cc3tc(corner.x, 1.0f) at: 16]; [self setVertexLocation: cc3v(boxMin.x, boxMax.y, boxMax.z) at: 17]; [self setVertexNormal: kCC3VectorUnitYPositive at: 17]; [self setVertexTexCoord2F: cc3tc(corner.x, (1.0f - corner.y)) at: 17]; [self setVertexLocation: cc3v(boxMax.x, boxMax.y, boxMax.z) at: 18]; [self setVertexNormal: kCC3VectorUnitYPositive at: 18]; [self setVertexTexCoord2F: cc3tc(0.5f, (1.0f - corner.y)) at: 18]; [self setVertexLocation: cc3v(boxMax.x, boxMax.y, boxMin.z) at: 19]; [self setVertexNormal: kCC3VectorUnitYPositive at: 19]; [self setVertexTexCoord2F: cc3tc(0.5f, 1.0f) at: 19]; // Bottom face, CCW winding: [self setVertexLocation: cc3v(boxMin.x, boxMin.y, boxMax.z) at: 20]; [self setVertexNormal: kCC3VectorUnitYNegative at: 20]; [self setVertexTexCoord2F: cc3tc(corner.x, corner.y) at: 20]; [self setVertexLocation: cc3v(boxMin.x, boxMin.y, boxMin.z) at: 21]; [self setVertexNormal: kCC3VectorUnitYNegative at: 21]; [self setVertexTexCoord2F: cc3tc(corner.x, 0.0f) at: 21]; [self setVertexLocation: cc3v(boxMax.x, boxMin.y, boxMin.z) at: 22]; [self setVertexNormal: kCC3VectorUnitYNegative at: 22]; [self setVertexTexCoord2F: cc3tc(0.5f, 0.0f) at: 22]; [self setVertexLocation: cc3v(boxMax.x, boxMin.y, boxMax.z) at: 23]; [self setVertexNormal: kCC3VectorUnitYNegative at: 23]; [self setVertexTexCoord2F: cc3tc(0.5f, corner.y) at: 23]; // Populate the vertex indices // Since the index array is a simple array, just access the array directly. GLubyte indxIndx = 0; GLubyte vtxIndx = 0; for (int side = 0; side < 6; side++) { // First trangle of side - CCW from bottom left indices[indxIndx++] = vtxIndx++; // vertex 0 indices[indxIndx++] = vtxIndx++; // vertex 1 indices[indxIndx++] = vtxIndx; // vertex 2 // Second triangle of side - CCW from bottom left indices[indxIndx++] = vtxIndx++; // vertex 2 indices[indxIndx++] = vtxIndx++; // vertex 3 indices[indxIndx++] = (vtxIndx - 4); // vertex 0 } } // Vertex index data for the 12 lines of a wire box. static const GLubyte wireBoxIndexData[] = { 0, 1, 1, 3, 3, 2, 2, 0, 4, 5, 5, 7, 7, 6, 6, 4, 0, 4, 1, 5, 2, 6, 3, 7, }; -(void) populateAsWireBox: (CC3Box) box { CC3Vector boxMin = box.minimum; CC3Vector boxMax = box.maximum; GLuint vertexCount = 8; // Create vertexLocation array. CC3VertexLocations* locArray = [CC3VertexLocations vertexArray]; locArray.allocatedVertexCapacity = vertexCount; CC3Vector* vertices = locArray.vertices; // Extract all 8 corner vertices from the box. vertices[0] = cc3v(boxMin.x, boxMin.y, boxMin.z); vertices[1] = cc3v(boxMin.x, boxMin.y, boxMax.z); vertices[2] = cc3v(boxMin.x, boxMax.y, boxMin.z); vertices[3] = cc3v(boxMin.x, boxMax.y, boxMax.z); vertices[4] = cc3v(boxMax.x, boxMin.y, boxMin.z); vertices[5] = cc3v(boxMax.x, boxMin.y, boxMax.z); vertices[6] = cc3v(boxMax.x, boxMax.y, boxMin.z); vertices[7] = cc3v(boxMax.x, boxMax.y, boxMax.z); GLuint lineCount = 12; GLuint indexCount = lineCount * 2; CC3VertexIndices* indexArray = [CC3VertexIndices vertexArray]; indexArray.drawingMode = GL_LINES; indexArray.elementType = GL_UNSIGNED_BYTE; indexArray.vertexCount = indexCount; indexArray.vertices = (GLvoid*)wireBoxIndexData; self.vertexLocations = locArray; self.vertexIndices = indexArray; } #pragma mark Populating parametric sphere -(void) populateAsSphereWithRadius: (GLfloat) radius andTessellation: (CC3Tessellation) divsPerAxis { // Must be at least one tessellation face per side of the rectangle. divsPerAxis.x = MAX(divsPerAxis.x, 3); divsPerAxis.y = MAX(divsPerAxis.y, 2); // The division span and texture span of each face in the tessellated grid. CGSize divSpan = CGSizeMake( (kCC3TwoPi / divsPerAxis.x), (kCC3Pi / divsPerAxis.y) ); CGSize divTexSpan = CGSizeMake((1.0 / divsPerAxis.x), (1.0 / divsPerAxis.y)); GLfloat halfDivTexSpanWidth = divTexSpan.width * 0.5f; // Calculate number of vertices, triangles and indices. CC3Tessellation verticesPerAxis; verticesPerAxis.x = divsPerAxis.x + 1; verticesPerAxis.y = divsPerAxis.y + 1; GLuint vertexCount = verticesPerAxis.x * verticesPerAxis.y; GLuint triangleCount = divsPerAxis.x * (divsPerAxis.y - 1) * 2; // Prepare the vertex content and allocate space for vertices and indices. [self ensureVertexContent]; self.allocatedVertexCapacity = vertexCount; self.allocatedVertexIndexCapacity = (triangleCount * 3); GLushort* indices = self.vertexIndices.vertices; LogTrace(@"%@ populating as sphere with radius %.3f, (%i, %i) divisions, %i vertices, and %i triangles", self, radius, divsPerAxis.x, divsPerAxis.y, vertexCount, triangleCount); // Populate vertex locations, normals & texture coordinates. // The parametric X-axis represents the longtitude (0 to 2PI). // The parametric Y-axis represents the latitude (0 to PI), starting at the north pole. GLuint vIndx = 0; // Vertex index GLuint iIndx = 0; // Index index for (GLuint iy = 0; iy < verticesPerAxis.y; iy++) { // Latitude (Y): 0 to PI GLfloat y = divSpan.height * iy; GLfloat sy = sinf(y); GLfloat cy = cosf(y); for (GLuint ix = 0; ix < verticesPerAxis.x; ix++) { // Longtitude (X): 0 to 2PI GLfloat x = divSpan.width * ix; GLfloat sx = sinf(x); GLfloat cx = cosf(x); // Vertex location, starting at negative-Z axis, // and right-hand rotating towards negative-X axis. CC3Vector unitRadial = cc3v( -(sy * sx), cy, -(sy * cx) ); [self setVertexLocation: CC3VectorScaleUniform(unitRadial, radius) at: vIndx]; // Vertex normal - same as location on unit sphere // Will do nothing if this mesh does not include normals. [self setVertexNormal: unitRadial at: vIndx]; // Calculate vertex texture coordinate. Offset the texture coordinates at // each vertex at the poles by half of the division span (so triangle is // symetrical. The tex coord at the north pole is moved right and that at // the south pole is moved to the left. // Will do nothing if this mesh does not include texture coordinates. GLfloat uOffset = 0.0f; if (iy == 0) uOffset = halfDivTexSpanWidth; // North pole if (iy == (verticesPerAxis.y - 1)) uOffset = -halfDivTexSpanWidth; // South pole GLfloat u = divTexSpan.width * ix + uOffset; GLfloat v = divTexSpan.height * iy; [self setVertexTexCoord2F: cc3tc(u, (1.0f - v)) at: vIndx]; // Since the index array is a simple array, just access the array directly. // For each vertex that is at the bottom-right corner of a division, add triangles. if (iy > 0 && ix > 0) { // For all but the first division row, add the triangle that has apex pointing south. if (iy > 1) { indices[iIndx++] = vIndx; // Bottom right indices[iIndx++] = vIndx - verticesPerAxis.x; // Top right indices[iIndx++] = vIndx - verticesPerAxis.x - 1; // Top left } // For all but the last division row, add the triangle that has apex pointing north. if (iy < (verticesPerAxis.y - 1)) { indices[iIndx++] = vIndx - verticesPerAxis.x - 1; // Top left indices[iIndx++] = vIndx - 1; // Bottom left indices[iIndx++] = vIndx; // Bottom right } } vIndx++; // Move on to the next vertex } } } #pragma mark Populating parametric cone -(void) populateAsHollowConeWithRadius: (GLfloat) radius height: (GLfloat) height andTessellation: (CC3Tessellation) angleAndHeightDivs { // Must be at least one height tessellation, and three angular tessellation. GLuint numAngularDivs = MAX(angleAndHeightDivs.x, 3); GLuint numHeightDivs = MAX(angleAndHeightDivs.y, 1); // Calculate the spans of each angular and height division. GLfloat radiusHeightRatio = radius / height; GLfloat angularDivSpan = kCC3TwoPi / numAngularDivs; // Zero to 2Pi GLfloat heightDivSpan = height / numHeightDivs; // Zero to height GLfloat radialDivSpan = radius / numHeightDivs; // Zero to radius GLfloat texAngularDivSpan = 1.0f / numAngularDivs; // Zero to one GLfloat texHeightDivSpan = 1.0f / numHeightDivs; // Zero to one // Calculate number of vertices, triangles and indices. GLuint vertexCount = (numAngularDivs + 1) * (numHeightDivs + 1); GLuint triangleCount = 2 * numAngularDivs * numHeightDivs - numAngularDivs; // Prepare the vertex content and allocate space for vertices and indices. [self ensureVertexContent]; self.allocatedVertexCapacity = vertexCount; self.allocatedVertexIndexCapacity = (triangleCount * 3); // Populate vertex locations, normals & texture coordinates. GLuint vIdx = 0; // Vertex index GLuint iIdx = 0; // Index index for (GLuint ia = 0; ia <= numAngularDivs; ia++) { GLfloat angle = angularDivSpan * ia; GLfloat ca = -cosf(angle); // Put seam on Z-minus axis and proceed CCW GLfloat sa = -sinf(angle); // Put seam on Z-minus axis and proceed CCW CC3Vector vtxNormal = CC3VectorNormalize(cc3v(sa, radiusHeightRatio, ca)); for (GLuint ih = 0; ih <= numHeightDivs; ih++, vIdx++) { GLfloat vtxRadius = radius - (radialDivSpan * ih); GLfloat vtxHt = heightDivSpan * ih; CC3Vector vtxLoc = cc3v(vtxRadius * sa, vtxHt, vtxRadius * ca); [self setVertexLocation: vtxLoc at: vIdx]; // All vertex normals for one angular division point in the same direction // Will do nothing if this mesh does not include normals. [self setVertexNormal: vtxNormal at: vIdx]; // Vertex tex coords wrapped around and projected horizontally to the cone surface. // Will do nothing if this mesh does not include texture coordinates. ccTex2F texCoord = cc3tc(texAngularDivSpan * ia, texHeightDivSpan * ih); [self setVertexTexCoord2F: texCoord at: vIdx]; // First triangular face if (ia < numAngularDivs && ih < numHeightDivs) { [self setVertexIndex: vIdx at: iIdx++]; // Current vertex [self setVertexIndex: (vIdx + numHeightDivs + 1) at: iIdx++]; // Next angular div, same height [self setVertexIndex: (vIdx + numHeightDivs + 2) at: iIdx++]; // Next angular div, next height // Only one triangular face at ring below apex if (ih < numHeightDivs - 1) { [self setVertexIndex: (vIdx + numHeightDivs + 2) at: iIdx++]; // Next angular div, next height [self setVertexIndex: (vIdx + 1) at: iIdx++]; // Same angular div, next height [self setVertexIndex: vIdx at: iIdx++]; // Current vertex } } } } } #pragma mark Populating parametric lines -(void) populateAsLineStripWith: (GLuint) vertexCount vertices: (CC3Vector*) vertices andRetain: (BOOL) shouldRetainVertices { // Create vertexLocation array. CC3VertexLocations* locArray = [CC3VertexLocations vertexArray]; locArray.drawingMode = GL_LINE_STRIP; if (shouldRetainVertices) { locArray.allocatedVertexCapacity = vertexCount; memcpy(locArray.vertices, vertices, vertexCount * sizeof(CC3Vector)); } else { locArray.vertexCount = vertexCount; locArray.vertices = vertices; } self.vertexLocations = locArray; } #pragma mark - #pragma mark Deprecated methods // Deprecated -(CC3TexturedVertex*) allocateTexturedVertices: (GLuint) vertexCount { self.vertexContentTypes = (kCC3VertexContentLocation | kCC3VertexContentNormal | kCC3VertexContentTextureCoordinates); self.allocatedVertexCapacity = vertexCount; return self.interleavedVertices; } // Deprecated -(GLushort*) allocateIndexedTriangles: (GLuint) triangleCount { self.allocatedVertexIndexCapacity = (triangleCount * 3); return _vertexIndices.vertices; } @end
{ "content_hash": "beca66f7984e427f147b79786219f8c3", "timestamp": "", "source": "github", "line_count": 684, "max_line_length": 117, "avg_line_length": 41.030701754385966, "alnum_prop": 0.7085337609121681, "repo_name": "cocos3d/cocos3d", "id": "7eb74b68d0be490ddd9c1bf16e9f8983077b5a76", "size": "29440", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "cocos3d/cocos3d/Meshes/CC3ParametricMeshes.m", "mode": "33261", "license": "mit", "language": [ { "name": "C", "bytes": "704192" }, { "name": "C++", "bytes": "643553" }, { "name": "CSS", "bytes": "361" }, { "name": "Matlab", "bytes": "14669" }, { "name": "Objective-C", "bytes": "4861617" }, { "name": "Objective-C++", "bytes": "117329" }, { "name": "Perl", "bytes": "2207" }, { "name": "Python", "bytes": "8959" }, { "name": "Shell", "bytes": "22023" } ], "symlink_target": "" }
import rospy from trajectory_msgs.msg import JointTrajectory, JointTrajectoryPoint '''Docstring''' class RobotFunctions(object): '''docstring''' def __init__(self): print('The RobotFunctions class is not meant to be instantiated!') @staticmethod def gen_trajectory_from_joint_configuration(sides, joints, joint_config, time = 5.0): resulting_trajectory = dict() for arm in sides: trajectory = JointTrajectory() trajectory.joint_names = joints[arm] point = JointTrajectoryPoint() point.positions = joint_config[arm] point.time_from_start = rospy.Duration.from_sec(time) trajectory.points.append(point) resulting_trajectory[arm] = trajectory return resulting_trajectory
{ "content_hash": "1812ae4fb84a5364f26bf65a967a4881", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 86, "avg_line_length": 23.06451612903226, "alnum_prop": 0.737062937062937, "repo_name": "team-vigir/vigir_behaviors", "id": "5a7d54694341540b987880646cacdddea59b074d", "size": "715", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "vigir_flexbe_behaviors/src/vigir_flexbe_behaviors/robot_functions.py", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "CMake", "bytes": "36163" }, { "name": "Python", "bytes": "914028" } ], "symlink_target": "" }
<?php namespace Cake\Database; /** * Represents a database statement. Concrete implementations * can either use PDOStatement or a native driver */ interface StatementInterface { /** * Assign a value to an positional or named variable in prepared query. If using * positional variables you need to start with index one, if using named params then * just use the name in any order. * * It is not allowed to combine positional and named variables in the same statement * * ## Examples: * * `$statement->bindValue(1, 'a title');` * `$statement->bindValue('active', true, 'boolean');` * `$statement->bindValue(5, new \DateTime(), 'date');` * * @param string|int $column name or param position to be bound * @param mixed $value The value to bind to variable in query * @param string $type name of configured Type class * @return void */ public function bindValue($column, $value, $type = 'string'); /** * Closes a cursor in the database, freeing up any resources and memory * allocated to it. In most cases you don't need to call this method, as it is * automatically called after fetching all results from the result set. * * @return void */ public function closeCursor(); /** * Returns the number of columns this statement's results will contain * * ## Example: * * {{{ * $statement = $connection->prepare('SELECT id, title from articles'); * $statement->execute(); * echo $statement->columnCount(); // outputs 2 * }}} * * @return int */ public function columnCount(); /** * Returns the error code for the last error that occurred when executing this statement * * @return int|string */ public function errorCode(); /** * Returns the error information for the last error that occurred when executing * this statement * * @return array */ public function errorInfo(); /** * Executes the statement by sending the SQL query to the database. It can optionally * take an array or arguments to be bound to the query variables. Please note * that binding parameters from this method will not perform any custom type conversion * as it would normally happen when calling `bindValue` * * @param array $params list of values to be bound to query * @return bool true on success, false otherwise */ public function execute($params = null); /** * Returns the next row for the result set after executing this statement. * Rows can be fetched to contain columns as names or positions. If no * rows are left in result set, this method will return false * * ## Example: * * {{{ * $statement = $connection->prepare('SELECT id, title from articles'); * $statement->execute(); * print_r($statement->fetch('assoc')); // will show array('id' => 1, 'title' => 'a title') * }}} * * @param string $type 'num' for positional columns, assoc for named columns * @return mixed Result array containing columns and values or false if no results * are left */ public function fetch($type = 'num'); /** * Returns an array with all rows resulting from executing this statement * * ## Example: * * {{{ * $statement = $connection->prepare('SELECT id, title from articles'); * $statement->execute(); * print_r($statement->fetchAll('assoc')); // will show [0 => ['id' => 1, 'title' => 'a title']] * }}} * * @param string $type num for fetching columns as positional keys or assoc for column names as keys * @return array list of all results from database for this statement */ public function fetchAll($type = 'num'); /** * Returns the number of rows affected by this SQL statement * * ## Example: * * {{{ * $statement = $connection->prepare('SELECT id, title from articles'); * $statement->execute(); * print_r($statement->rowCount()); // will show 1 * }}} * * @return int */ public function rowCount(); /** * Statements can be passed as argument for count() * to return the number for affected rows from last execution * * @return int */ public function count(); /** * Binds a set of values to statement object with corresponding type * * @param array $params list of values to be bound * @param array $types list of types to be used, keys should match those in $params * @return void */ public function bind($params, $types); /** * Returns the latest primary inserted using this statement * * @param string $table table name or sequence to get last insert value from * @param string $column the name of the column representing the primary key * @return string */ public function lastInsertId($table = null, $column = null); }
{ "content_hash": "e357f077aed5db3a3f3ac105f831032c", "timestamp": "", "source": "github", "line_count": 157, "max_line_length": 100, "avg_line_length": 28.8343949044586, "alnum_prop": 0.6944996686547382, "repo_name": "Numerico-Informatic-Systems-Pvt-Ltd/gsmpoly", "id": "f2b1a2ff45de66a35aac6c9fc76fd6a1a0058284", "size": "5111", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Database/StatementInterface.php", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "1111" }, { "name": "Batchfile", "bytes": "2888" }, { "name": "CSS", "bytes": "104301" }, { "name": "HTML", "bytes": "4567" }, { "name": "JavaScript", "bytes": "28277" }, { "name": "PHP", "bytes": "15497518" }, { "name": "Shell", "bytes": "4170" } ], "symlink_target": "" }
""" flask.cli ~~~~~~~~~ A simple command line application to run flask apps. :copyright: (c) 2015 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import ast import inspect import os import re import sys import traceback from functools import update_wrapper from operator import attrgetter from threading import Lock, Thread import click from . import __version__ from ._compat import iteritems, reraise from .globals import current_app from .helpers import get_debug_flag from ._compat import getargspec class NoAppException(click.UsageError): """Raised if an application cannot be found or loaded.""" def find_best_app(script_info, module): """Given a module instance this tries to find the best possible application in the module or raises an exception. """ from . import Flask # Search for the most common names first. for attr_name in ('app', 'application'): app = getattr(module, attr_name, None) if isinstance(app, Flask): return app # Otherwise find the only object that is a Flask instance. matches = [ v for k, v in iteritems(module.__dict__) if isinstance(v, Flask) ] if len(matches) == 1: return matches[0] elif len(matches) > 1: raise NoAppException( 'Auto-detected multiple Flask applications in module "{module}".' ' Use "FLASK_APP={module}:name" to specify the correct' ' one.'.format(module=module.__name__) ) # Search for app factory functions. for attr_name in ('create_app', 'make_app'): app_factory = getattr(module, attr_name, None) if inspect.isfunction(app_factory): try: app = call_factory(app_factory, script_info) if isinstance(app, Flask): return app except TypeError: raise NoAppException( 'Auto-detected "{function}()" in module "{module}", but ' 'could not call it without specifying arguments.'.format( function=attr_name, module=module.__name__ ) ) raise NoAppException( 'Failed to find application in module "{module}". Are you sure ' 'it contains a Flask application? Maybe you wrapped it in a WSGI ' 'middleware.'.format(module=module.__name__) ) def call_factory(app_factory, script_info, arguments=()): """Takes an app factory, a ``script_info` object and optionally a tuple of arguments. Checks for the existence of a script_info argument and calls the app_factory depending on that and the arguments provided. """ args_spec = getargspec(app_factory) arg_names = args_spec.args arg_defaults = args_spec.defaults if 'script_info' in arg_names: return app_factory(*arguments, script_info=script_info) elif arguments: return app_factory(*arguments) elif not arguments and len(arg_names) == 1 and arg_defaults is None: return app_factory(script_info) return app_factory() def find_app_by_string(string, script_info, module): """Checks if the given string is a variable name or a function. If it is a function, it checks for specified arguments and whether it takes a ``script_info`` argument and calls the function with the appropriate arguments.""" from . import Flask function_regex = r'^(?P<name>\w+)(?:\((?P<args>.*)\))?$' match = re.match(function_regex, string) if match: name, args = match.groups() try: if args is not None: args = args.rstrip(' ,') if args: args = ast.literal_eval( "({args}, )".format(args=args)) else: args = () app_factory = getattr(module, name, None) app = call_factory(app_factory, script_info, args) else: attr = getattr(module, name, None) if inspect.isfunction(attr): app = call_factory(attr, script_info) else: app = attr if isinstance(app, Flask): return app else: raise RuntimeError('Failed to find application in module ' '"{name}"'.format(name=module)) except TypeError as e: new_error = NoAppException( '{e}\nThe app factory "{factory}" in module "{module}" could' ' not be called with the specified arguments (and a' ' script_info argument automatically added if applicable).' ' Did you make sure to use the right number of arguments as' ' well as not using keyword arguments or' ' non-literals?'.format(e=e, factory=string, module=module)) reraise(NoAppException, new_error, sys.exc_info()[2]) else: raise NoAppException( 'The provided string "{string}" is not a valid variable name' 'or function expression.'.format(string=string)) def prepare_exec_for_file(filename): """Given a filename this will try to calculate the python path, add it to the search path and return the actual module name that is expected. """ module = [] # Chop off file extensions or package markers if os.path.split(filename)[1] == '__init__.py': filename = os.path.dirname(filename) elif filename.endswith('.py'): filename = filename[:-3] else: raise NoAppException('The file provided (%s) does exist but is not a ' 'valid Python file. This means that it cannot ' 'be used as application. Please change the ' 'extension to .py' % filename) filename = os.path.realpath(filename) dirpath = filename while 1: dirpath, extra = os.path.split(dirpath) module.append(extra) if not os.path.isfile(os.path.join(dirpath, '__init__.py')): break sys.path.insert(0, dirpath) return '.'.join(module[::-1]) def locate_app(script_info, app_id): """Attempts to locate the application.""" __traceback_hide__ = True if ':' in app_id: module, app_obj = app_id.split(':', 1) else: module = app_id app_obj = None try: __import__(module) except ImportError: # Reraise the ImportError if it occurred within the imported module. # Determine this by checking whether the trace has a depth > 1. if sys.exc_info()[-1].tb_next: stack_trace = traceback.format_exc() raise NoAppException('There was an error trying to import' ' the app (%s):\n%s' % (module, stack_trace)) else: raise NoAppException('The file/path provided (%s) does not appear' ' to exist. Please verify the path is ' 'correct. If app is not on PYTHONPATH, ' 'ensure the extension is .py' % module) mod = sys.modules[module] if app_obj is None: return find_best_app(script_info, mod) else: return find_app_by_string(app_obj, script_info, mod) def find_default_import_path(): app = os.environ.get('FLASK_APP') if app is None: return if os.path.isfile(app): return prepare_exec_for_file(app) return app def get_version(ctx, param, value): if not value or ctx.resilient_parsing: return message = 'Flask %(version)s\nPython %(python_version)s' click.echo(message % { 'version': __version__, 'python_version': sys.version, }, color=ctx.color) ctx.exit() version_option = click.Option(['--version'], help='Show the flask version', expose_value=False, callback=get_version, is_flag=True, is_eager=True) class DispatchingApp(object): """Special application that dispatches to a Flask application which is imported by name in a background thread. If an error happens it is recorded and shown as part of the WSGI handling which in case of the Werkzeug debugger means that it shows up in the browser. """ def __init__(self, loader, use_eager_loading=False): self.loader = loader self._app = None self._lock = Lock() self._bg_loading_exc_info = None if use_eager_loading: self._load_unlocked() else: self._load_in_background() def _load_in_background(self): def _load_app(): __traceback_hide__ = True with self._lock: try: self._load_unlocked() except Exception: self._bg_loading_exc_info = sys.exc_info() t = Thread(target=_load_app, args=()) t.start() def _flush_bg_loading_exception(self): __traceback_hide__ = True exc_info = self._bg_loading_exc_info if exc_info is not None: self._bg_loading_exc_info = None reraise(*exc_info) def _load_unlocked(self): __traceback_hide__ = True self._app = rv = self.loader() self._bg_loading_exc_info = None return rv def __call__(self, environ, start_response): __traceback_hide__ = True if self._app is not None: return self._app(environ, start_response) self._flush_bg_loading_exception() with self._lock: if self._app is not None: rv = self._app else: rv = self._load_unlocked() return rv(environ, start_response) class ScriptInfo(object): """Help object to deal with Flask applications. This is usually not necessary to interface with as it's used internally in the dispatching to click. In future versions of Flask this object will most likely play a bigger role. Typically it's created automatically by the :class:`FlaskGroup` but you can also manually create it and pass it onwards as click object. """ def __init__(self, app_import_path=None, create_app=None): if create_app is None: if app_import_path is None: app_import_path = find_default_import_path() self.app_import_path = app_import_path else: app_import_path = None #: Optionally the import path for the Flask application. self.app_import_path = app_import_path #: Optionally a function that is passed the script info to create #: the instance of the application. self.create_app = create_app #: A dictionary with arbitrary data that can be associated with #: this script info. self.data = {} self._loaded_app = None def load_app(self): """Loads the Flask app (if not yet loaded) and returns it. Calling this multiple times will just result in the already loaded app to be returned. """ __traceback_hide__ = True if self._loaded_app is not None: return self._loaded_app if self.create_app is not None: rv = call_factory(self.create_app, self) else: if not self.app_import_path: raise NoAppException( 'Could not locate Flask application. You did not provide ' 'the FLASK_APP environment variable.\n\nFor more ' 'information see ' 'http://flask.pocoo.org/docs/latest/quickstart/') rv = locate_app(self, self.app_import_path) debug = get_debug_flag() if debug is not None: rv.debug = debug self._loaded_app = rv return rv pass_script_info = click.make_pass_decorator(ScriptInfo, ensure=True) def with_appcontext(f): """Wraps a callback so that it's guaranteed to be executed with the script's application context. If callbacks are registered directly to the ``app.cli`` object then they are wrapped with this function by default unless it's disabled. """ @click.pass_context def decorator(__ctx, *args, **kwargs): with __ctx.ensure_object(ScriptInfo).load_app().app_context(): return __ctx.invoke(f, *args, **kwargs) return update_wrapper(decorator, f) class AppGroup(click.Group): """This works similar to a regular click :class:`~click.Group` but it changes the behavior of the :meth:`command` decorator so that it automatically wraps the functions in :func:`with_appcontext`. Not to be confused with :class:`FlaskGroup`. """ def command(self, *args, **kwargs): """This works exactly like the method of the same name on a regular :class:`click.Group` but it wraps callbacks in :func:`with_appcontext` unless it's disabled by passing ``with_appcontext=False``. """ wrap_for_ctx = kwargs.pop('with_appcontext', True) def decorator(f): if wrap_for_ctx: f = with_appcontext(f) return click.Group.command(self, *args, **kwargs)(f) return decorator def group(self, *args, **kwargs): """This works exactly like the method of the same name on a regular :class:`click.Group` but it defaults the group class to :class:`AppGroup`. """ kwargs.setdefault('cls', AppGroup) return click.Group.group(self, *args, **kwargs) class FlaskGroup(AppGroup): """Special subclass of the :class:`AppGroup` group that supports loading more commands from the configured Flask app. Normally a developer does not have to interface with this class but there are some very advanced use cases for which it makes sense to create an instance of this. For information as of why this is useful see :ref:`custom-scripts`. :param add_default_commands: if this is True then the default run and shell commands wil be added. :param add_version_option: adds the ``--version`` option. :param create_app: an optional callback that is passed the script info and returns the loaded app. """ def __init__(self, add_default_commands=True, create_app=None, add_version_option=True, **extra): params = list(extra.pop('params', None) or ()) if add_version_option: params.append(version_option) AppGroup.__init__(self, params=params, **extra) self.create_app = create_app if add_default_commands: self.add_command(run_command) self.add_command(shell_command) self.add_command(routes_command) self._loaded_plugin_commands = False def _load_plugin_commands(self): if self._loaded_plugin_commands: return try: import pkg_resources except ImportError: self._loaded_plugin_commands = True return for ep in pkg_resources.iter_entry_points('flask.commands'): self.add_command(ep.load(), ep.name) self._loaded_plugin_commands = True def get_command(self, ctx, name): self._load_plugin_commands() # We load built-in commands first as these should always be the # same no matter what the app does. If the app does want to # override this it needs to make a custom instance of this group # and not attach the default commands. # # This also means that the script stays functional in case the # application completely fails. rv = AppGroup.get_command(self, ctx, name) if rv is not None: return rv info = ctx.ensure_object(ScriptInfo) try: rv = info.load_app().cli.get_command(ctx, name) if rv is not None: return rv except NoAppException: pass def list_commands(self, ctx): self._load_plugin_commands() # The commands available is the list of both the application (if # available) plus the builtin commands. rv = set(click.Group.list_commands(self, ctx)) info = ctx.ensure_object(ScriptInfo) try: rv.update(info.load_app().cli.list_commands(ctx)) except Exception: # Here we intentionally swallow all exceptions as we don't # want the help page to break if the app does not exist. # If someone attempts to use the command we try to create # the app again and this will give us the error. # However, we will not do so silently because that would confuse # users. traceback.print_exc() return sorted(rv) def main(self, *args, **kwargs): obj = kwargs.get('obj') if obj is None: obj = ScriptInfo(create_app=self.create_app) kwargs['obj'] = obj kwargs.setdefault('auto_envvar_prefix', 'FLASK') return AppGroup.main(self, *args, **kwargs) @click.command('run', short_help='Runs a development server.') @click.option('--host', '-h', default='127.0.0.1', help='The interface to bind to.') @click.option('--port', '-p', default=5000, help='The port to bind to.') @click.option('--reload/--no-reload', default=None, help='Enable or disable the reloader. By default the reloader ' 'is active if debug is enabled.') @click.option('--debugger/--no-debugger', default=None, help='Enable or disable the debugger. By default the debugger ' 'is active if debug is enabled.') @click.option('--eager-loading/--lazy-loader', default=None, help='Enable or disable eager loading. By default eager ' 'loading is enabled if the reloader is disabled.') @click.option('--with-threads/--without-threads', default=False, help='Enable or disable multithreading.') @pass_script_info def run_command(info, host, port, reload, debugger, eager_loading, with_threads): """Runs a local development server for the Flask application. This local server is recommended for development purposes only but it can also be used for simple intranet deployments. By default it will not support any sort of concurrency at all to simplify debugging. This can be changed with the --with-threads option which will enable basic multithreading. The reloader and debugger are by default enabled if the debug flag of Flask is enabled and disabled otherwise. """ from werkzeug.serving import run_simple # Set a global flag that indicates that we were invoked from the # command line interface provided server command. This is detected # by Flask.run to make the call into a no-op. This is necessary to # avoid ugly errors when the script that is loaded here also attempts # to start a server. os.environ['FLASK_RUN_FROM_CLI_SERVER'] = '1' debug = get_debug_flag() if reload is None: reload = bool(debug) if debugger is None: debugger = bool(debug) if eager_loading is None: eager_loading = not reload app = DispatchingApp(info.load_app, use_eager_loading=eager_loading) # Extra startup messages. This depends a bit on Werkzeug internals to # not double execute when the reloader kicks in. if os.environ.get('WERKZEUG_RUN_MAIN') != 'true': # If we have an import path we can print it out now which can help # people understand what's being served. If we do not have an # import path because the app was loaded through a callback then # we won't print anything. if info.app_import_path is not None: print(' * Serving Flask app "%s"' % info.app_import_path) if debug is not None: print(' * Forcing debug mode %s' % (debug and 'on' or 'off')) run_simple(host, port, app, use_reloader=reload, use_debugger=debugger, threaded=with_threads) @click.command('shell', short_help='Runs a shell in the app context.') @with_appcontext def shell_command(): """Runs an interactive Python shell in the context of a given Flask application. The application will populate the default namespace of this shell according to it's configuration. This is useful for executing small snippets of management code without having to manually configuring the application. """ import code from flask.globals import _app_ctx_stack app = _app_ctx_stack.top.app banner = 'Python %s on %s\nApp: %s%s\nInstance: %s' % ( sys.version, sys.platform, app.import_name, app.debug and ' [debug]' or '', app.instance_path, ) ctx = {} # Support the regular Python interpreter startup script if someone # is using it. startup = os.environ.get('PYTHONSTARTUP') if startup and os.path.isfile(startup): with open(startup, 'r') as f: eval(compile(f.read(), startup, 'exec'), ctx) ctx.update(app.make_shell_context()) code.interact(banner=banner, local=ctx) @click.command('routes', short_help='Show the routes for the app.') @click.option( '--sort', '-s', type=click.Choice(('endpoint', 'methods', 'rule', 'match')), default='endpoint', help=( 'Method to sort routes by. "match" is the order that Flask will match ' 'routes when dispatching a request.' ) ) @click.option( '--all-methods', is_flag=True, help="Show HEAD and OPTIONS methods." ) @with_appcontext def routes_command(sort, all_methods): """Show all registered routes with endpoints and methods.""" rules = list(current_app.url_map.iter_rules()) ignored_methods = set(() if all_methods else ('HEAD', 'OPTIONS')) if sort in ('endpoint', 'rule'): rules = sorted(rules, key=attrgetter(sort)) elif sort == 'methods': rules = sorted(rules, key=lambda rule: sorted(rule.methods)) rule_methods = [ ', '.join(sorted(rule.methods - ignored_methods)) for rule in rules ] headers = ('Endpoint', 'Methods', 'Rule') widths = ( max(len(rule.endpoint) for rule in rules), max(len(methods) for methods in rule_methods), max(len(rule.rule) for rule in rules), ) widths = [max(len(h), w) for h, w in zip(headers, widths)] row = '{{0:<{0}}} {{1:<{1}}} {{2:<{2}}}'.format(*widths) click.echo(row.format(*headers).strip()) click.echo(row.format(*('-' * width for width in widths))) for rule, methods in zip(rules, rule_methods): click.echo(row.format(rule.endpoint, methods, rule.rule).rstrip()) cli = FlaskGroup(help="""\ This shell command acts as general utility script for Flask applications. It loads the application configured (through the FLASK_APP environment variable) and then provides commands either provided by the application or Flask itself. The most useful commands are the "run" and "shell" command. Example usage: \b %(prefix)s%(cmd)s FLASK_APP=hello.py %(prefix)s%(cmd)s FLASK_DEBUG=1 %(prefix)sflask run """ % { 'cmd': os.name == 'posix' and 'export' or 'set', 'prefix': os.name == 'posix' and '$ ' or '', }) def main(as_module=False): args = sys.argv[1:] if as_module: this_module = 'flask' if sys.version_info < (2, 7): this_module += '.cli' name = 'python -m ' + this_module # Python rewrites "python -m flask" to the path to the file in argv. # Restore the original command so that the reloader works. sys.argv = ['-m', this_module] + args else: name = None cli.main(args=args, prog_name=name) if __name__ == '__main__': main(as_module=True)
{ "content_hash": "2fe89749417bb69953a7f2758e628ced", "timestamp": "", "source": "github", "line_count": 669, "max_line_length": 79, "avg_line_length": 36.04783258594918, "alnum_prop": 0.6050754685685852, "repo_name": "tristanfisher/flask", "id": "0982aa1c56da880b52db5b0801f2ab2aabf31694", "size": "24140", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "flask/cli.py", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "18" }, { "name": "HTML", "bytes": "404" }, { "name": "Makefile", "bytes": "1775" }, { "name": "Python", "bytes": "498703" } ], "symlink_target": "" }
@interface ABI42_0_0AIRGoogleMapOverlayManager : ABI42_0_0RCTViewManager @end
{ "content_hash": "93c48a69bb6bfb9a62121bce40d599f5", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 72, "avg_line_length": 39, "alnum_prop": 0.8461538461538461, "repo_name": "exponent/exponent", "id": "e9bba34220262785f9c1085ccfeada4306898936", "size": "254", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "ios/versioned-react-native/ABI42_0_0/Expo/ExpoKit/Core/Api/Components/GoogleMaps/ABI42_0_0AIRGoogleMapOverlayManager.h", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Assembly", "bytes": "113276" }, { "name": "Batchfile", "bytes": "127" }, { "name": "C", "bytes": "1744836" }, { "name": "C++", "bytes": "1801159" }, { "name": "CSS", "bytes": "7854" }, { "name": "HTML", "bytes": "176329" }, { "name": "IDL", "bytes": "897" }, { "name": "Java", "bytes": "6251130" }, { "name": "JavaScript", "bytes": "4416558" }, { "name": "Makefile", "bytes": "18061" }, { "name": "Objective-C", "bytes": "13971362" }, { "name": "Objective-C++", "bytes": "725480" }, { "name": "Perl", "bytes": "5860" }, { "name": "Prolog", "bytes": "287" }, { "name": "Python", "bytes": "125673" }, { "name": "Ruby", "bytes": "61190" }, { "name": "Shell", "bytes": "4441" } ], "symlink_target": "" }
#ifndef QSCRIPTGLOBALOBJECT_P_H #define QSCRIPTGLOBALOBJECT_P_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include <QtCore/qobjectdefs.h> #include "JSGlobalObject.h" QT_BEGIN_NAMESPACE namespace QScript { class GlobalObject : public JSC::JSGlobalObject { public: GlobalObject(); virtual ~GlobalObject(); virtual JSC::UString className() const { return "global"; } virtual void markChildren(JSC::MarkStack&); virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&); virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&); virtual void put(JSC::ExecState* exec, const JSC::Identifier& propertyName, JSC::JSValue, JSC::PutPropertySlot&); virtual void putWithAttributes(JSC::ExecState* exec, const JSC::Identifier& propertyName, JSC::JSValue value, unsigned attributes); virtual bool deleteProperty(JSC::ExecState*, const JSC::Identifier& propertyName); virtual void getOwnPropertyNames(JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode mode = JSC::ExcludeDontEnumProperties); virtual void defineGetter(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSObject* getterFunction, unsigned attributes = 0); virtual void defineSetter(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSObject* setterFunction, unsigned attributes = 0); virtual JSC::JSValue lookupGetter(JSC::ExecState*, const JSC::Identifier& propertyName); virtual JSC::JSValue lookupSetter(JSC::ExecState*, const JSC::Identifier& propertyName); public: JSC::JSObject *customGlobalObject; }; class OriginalGlobalObjectProxy : public JSC::JSObject { public: explicit OriginalGlobalObjectProxy(WTF::PassRefPtr<JSC::Structure> sid, JSC::JSGlobalObject *object) : JSC::JSObject(sid), originalGlobalObject(object) {} virtual ~OriginalGlobalObjectProxy() {} virtual JSC::UString className() const { return originalGlobalObject->className(); } virtual void markChildren(JSC::MarkStack& markStack) { markStack.append(originalGlobalObject); JSC::JSObject::markChildren(markStack); } virtual bool getOwnPropertySlot(JSC::ExecState* exec, const JSC::Identifier& propertyName, JSC::PropertySlot& slot) { return originalGlobalObject->JSC::JSGlobalObject::getOwnPropertySlot(exec, propertyName, slot); } virtual bool getOwnPropertyDescriptor(JSC::ExecState* exec, const JSC::Identifier& propertyName, JSC::PropertyDescriptor& descriptor) { return originalGlobalObject->JSC::JSGlobalObject::getOwnPropertyDescriptor(exec, propertyName, descriptor); } virtual void put(JSC::ExecState* exec, const JSC::Identifier& propertyName, JSC::JSValue value, JSC::PutPropertySlot& slot) { originalGlobalObject->JSC::JSGlobalObject::put(exec, propertyName, value, slot); } virtual void putWithAttributes(JSC::ExecState* exec, const JSC::Identifier& propertyName, JSC::JSValue value, unsigned attributes) { originalGlobalObject->JSC::JSGlobalObject::putWithAttributes(exec, propertyName, value, attributes); } virtual bool deleteProperty(JSC::ExecState* exec, const JSC::Identifier& propertyName) { return originalGlobalObject->JSC::JSGlobalObject::deleteProperty(exec, propertyName); } virtual void getOwnPropertyNames(JSC::ExecState* exec, JSC::PropertyNameArray& propertyNames, JSC::EnumerationMode mode = JSC::ExcludeDontEnumProperties) { originalGlobalObject->JSC::JSGlobalObject::getOwnPropertyNames(exec, propertyNames, mode); } virtual void defineGetter(JSC::ExecState* exec, const JSC::Identifier& propertyName, JSC::JSObject* getterFunction, unsigned attributes) { originalGlobalObject->JSC::JSGlobalObject::defineGetter(exec, propertyName, getterFunction, attributes); } virtual void defineSetter(JSC::ExecState* exec, const JSC::Identifier& propertyName, JSC::JSObject* setterFunction, unsigned attributes) { originalGlobalObject->JSC::JSGlobalObject::defineSetter(exec, propertyName, setterFunction, attributes); } virtual JSC::JSValue lookupGetter(JSC::ExecState* exec, const JSC::Identifier& propertyName) { return originalGlobalObject->JSC::JSGlobalObject::lookupGetter(exec, propertyName); } virtual JSC::JSValue lookupSetter(JSC::ExecState* exec, const JSC::Identifier& propertyName) { return originalGlobalObject->JSC::JSGlobalObject::lookupSetter(exec, propertyName); } private: JSC::JSGlobalObject *originalGlobalObject; }; } // namespace QScript QT_END_NAMESPACE #endif
{ "content_hash": "a11c94522c05f5aa4ac0ae2d1e83b1e0", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 157, "avg_line_length": 50.160377358490564, "alnum_prop": 0.6836561971036299, "repo_name": "ilangal-amd/CodeXL", "id": "a919c6cab935cdea8332eb5789d9dacb191f8978", "size": "6257", "binary": false, "copies": "6", "ref": "refs/heads/master", "path": "Common/Lib/Ext/Qt/5.5/include/QtScript/5.5.1/QtScript/private/qscriptglobalobject_p.h", "mode": "33188", "license": "mit", "language": [ { "name": "AutoIt", "bytes": "1717" }, { "name": "Batchfile", "bytes": "153761" }, { "name": "C", "bytes": "26807731" }, { "name": "C#", "bytes": "82169" }, { "name": "C++", "bytes": "190144939" }, { "name": "CMake", "bytes": "415367" }, { "name": "CSS", "bytes": "9343" }, { "name": "GLSL", "bytes": "368361" }, { "name": "Groff", "bytes": "54" }, { "name": "HLSL", "bytes": "14823" }, { "name": "HTML", "bytes": "4808344" }, { "name": "JavaScript", "bytes": "58859" }, { "name": "Lua", "bytes": "22593" }, { "name": "M4", "bytes": "75125" }, { "name": "Makefile", "bytes": "774619" }, { "name": "Objective-C", "bytes": "1008522" }, { "name": "Objective-C++", "bytes": "25122" }, { "name": "PHP", "bytes": "3065" }, { "name": "Perl", "bytes": "171205" }, { "name": "PowerShell", "bytes": "10405" }, { "name": "Python", "bytes": "299498" }, { "name": "QMake", "bytes": "9443" }, { "name": "Shell", "bytes": "448554" }, { "name": "Visual Basic", "bytes": "860" }, { "name": "Yacc", "bytes": "93875" } ], "symlink_target": "" }
import BoardService from "../../service/board-service"; import CardService from "../../service/card-service"; import ColumnService from "../../service/column-service"; import Connection from "../database/connection"; import BoardRepositoryDatabase from "../database/repository/board-repository-db"; import CardRepositoryDatabase from "../database/repository/card-repository-db"; import ColumnRepositoryDatabase from "../database/repository/column-repository-db"; import Http from "../http/http"; export default class BoardController { constructor(readonly http: Http, readonly connection: Connection) { http.route("get", "/boards", async function (params: any, body: any) { const boardRepository = new BoardRepositoryDatabase(connection); const columnRepository = new ColumnRepositoryDatabase(connection); const cardRepository = new CardRepositoryDatabase(connection); const boardService = new BoardService(boardRepository, columnRepository, cardRepository); const boards = await boardService.getBoards(); return boards; }); http.route("get", "/boards/:idBoard", async function (params: any, body: any) { const boardRepository = new BoardRepositoryDatabase(connection); const columnRepository = new ColumnRepositoryDatabase(connection); const cardRepository = new CardRepositoryDatabase(connection); const boardService = new BoardService(boardRepository, columnRepository, cardRepository); const board = await boardService.getBoard(params.idBoard); return board; }); http.route("get", "/boards/:idBoard/columns", async function (params: any, body: any) { const columnRepository = new ColumnRepositoryDatabase(connection); const columnService = new ColumnService(columnRepository); const columns = await columnService.getColumns(parseInt(params.idBoard)); return columns; }); http.route("get", "/boards/:idBoard/columns/:idColumn", async function (params: any, body: any) { const columnRepository = new ColumnRepositoryDatabase(connection); const columnService = new ColumnService(columnRepository); const column = await columnService.getColumn(parseInt(params.idColumn)); return column; }); http.route("post", "/boards/:idBoard/columns", async function (params: any, body: any) { const columnRepository = new ColumnRepositoryDatabase(connection); const columnService = new ColumnService(columnRepository); const idColumn = await columnService.saveColumn(body); return idColumn; }); http.route("delete", "/boards/:idBoard/columns/:idColumn", async function (params: any, body: any) { console.log(params); const columnRepository = new ColumnRepositoryDatabase(connection); const columnService = new ColumnService(columnRepository); await columnService.deleteColumn(parseInt(params.idColumn)); }); http.route("get", "/boards/:idBoard/columns/:idColumn/cards", async function (params: any, body: any) { const cardRepository = new CardRepositoryDatabase(connection); const cardService = new CardService(cardRepository); const cards = await cardService.getCards(parseInt(params.idColumn)); return cards; }); http.route("post", "/boards/:idBoard/columns/:idColumn/cards", async function (params: any, body: any) { const cardRepository = new CardRepositoryDatabase(connection); const cardService = new CardService(cardRepository); const cardId = await cardService.saveCard(body); return cardId; }); http.route("delete", "/boards/:idBoard/columns/:idColumn/cards/:idCard", async function (params: any, body: any) { const cardRepository = new CardRepositoryDatabase(connection); const cardService = new CardService(cardRepository); await cardService.deleteCard(parseInt(params.idCard)); }); http.route("put", "/boards/:idBoard/columns/:idColumn/cards/:idCard", async function (params: any, body: any) { const cardRepository = new CardRepositoryDatabase(connection); const cardService = new CardService(cardRepository); await cardService.updateCard(body); }); } }
{ "content_hash": "1da8a6d17fd483bd580427da7bed5ee0", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 122, "avg_line_length": 51.57954545454545, "alnum_prop": 0.669971359330249, "repo_name": "alexhausen/examples", "id": "f9e5918a370fb3dfa133133187fef16eae53e575", "size": "4539", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "fullstack/backend/src/infra/controller/board-controller.ts", "mode": "33188", "license": "mit", "language": [ { "name": "Assembly", "bytes": "438" }, { "name": "C", "bytes": "65855" }, { "name": "C++", "bytes": "398241" }, { "name": "CMake", "bytes": "191" }, { "name": "CSS", "bytes": "1340" }, { "name": "Dockerfile", "bytes": "53" }, { "name": "HTML", "bytes": "2987" }, { "name": "Haskell", "bytes": "6859" }, { "name": "Java", "bytes": "18001" }, { "name": "JavaScript", "bytes": "31587" }, { "name": "Lua", "bytes": "1460" }, { "name": "Makefile", "bytes": "3516" }, { "name": "Perl", "bytes": "1542" }, { "name": "Python", "bytes": "10472" }, { "name": "Ruby", "bytes": "171" }, { "name": "Rust", "bytes": "41124" }, { "name": "SWIG", "bytes": "17526" }, { "name": "Shell", "bytes": "5375" }, { "name": "TypeScript", "bytes": "39046" }, { "name": "Vue", "bytes": "6727" } ], "symlink_target": "" }
/* Generated automatically. DO NOT EDIT! */ #define SIMD_HEADER "simd-support/simd-neon.h" #include "../common/t1fv_4.c"
{ "content_hash": "d8a38f5bfe6806a61eb57460dc2a8da4", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 46, "avg_line_length": 40.666666666666664, "alnum_prop": 0.7049180327868853, "repo_name": "termoshtt/rust-fftw3", "id": "dc2f45cb7edca1163f1b7e658f8f4ba2714af9de", "size": "122", "binary": false, "copies": "6", "ref": "refs/heads/master", "path": "fftw-src/fftw-3.3.8/dft/simd/neon/t1fv_4.c", "mode": "33188", "license": "mit", "language": [ { "name": "Rust", "bytes": "55672" } ], "symlink_target": "" }
package us.higashiyama.george.SQTurrets.types; import org.bukkit.Bukkit; import org.bukkit.Color; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.entity.Entity; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.scheduler.BukkitRunnable; import org.bukkit.util.Vector; import org.inventivetalent.particle.ParticleEffect; import com.whirlwindgames.dibujaron.sqempire.database.object.EmpirePlayer; import net.countercraft.movecraft.craft.CraftManager; import us.higashiyama.george.SQTurrets.Ammo; import us.higashiyama.george.SQTurrets.SQTurrets; public class BeamTurret extends Turret { public BeamTurret(){ setName("beamturret"); } @Override public void shoot(Player p) { p.sendMessage("Beam turrets require ammo"); } @Override public void shoot(final Player p, Ammo ammo) { new BeamTask(p, ammo).runTaskTimer(SQTurrets.getInstance(), 0, 5); } private class BeamTask extends BukkitRunnable{ Player p; Ammo ammo; int counter = 0; public BeamTask(Player p, Ammo ammo){ this.p = p; this.ammo = ammo; } @Override public void run(){ if(!SQTurrets.isInTurret(p)){ if(CraftManager.getInstance().getCraftByPlayer(p) != null){ if(!CraftManager.getInstance().getCraftByPlayer(p).hasMovedInLastSecond()){ this.cancel(); } } else { this.cancel(); } } Location loc = p.getEyeLocation(); Vector vec = loc.getDirection(); loc.add(vec); for(int i = 0; i < (int) getVelocity(); i++){ if(!loc.getBlock().getType().equals(Material.AIR) && i > 0) i = (int) getVelocity(); ParticleEffect.REDSTONE.sendColor(Bukkit.getOnlinePlayers(), loc, Color.LIME); ParticleEffect.REDSTONE.sendColor(Bukkit.getOnlinePlayers(), loc.getX()+0.3, loc.getY(), loc.getZ(), Color.LIME); ParticleEffect.REDSTONE.sendColor(Bukkit.getOnlinePlayers(), loc.getX()-0.3, loc.getY(), loc.getZ(), Color.LIME); ParticleEffect.REDSTONE.sendColor(Bukkit.getOnlinePlayers(), loc.getX(), loc.getY(), loc.getZ()+0.3, Color.LIME); ParticleEffect.REDSTONE.sendColor(Bukkit.getOnlinePlayers(), loc.getX(), loc.getY(), loc.getZ()-0.3, Color.LIME); for (Entity entity : loc.getWorld().getNearbyEntities(loc, 1, 1, 1)) { if (entity instanceof LivingEntity && entity.getEntityId() != p.getEntityId()) { i = (int) getVelocity(); LivingEntity target = (LivingEntity) entity; if(target instanceof Player){ Player ptarget = (Player) target; if(EmpirePlayer.getOnlinePlayer(ptarget).getEmpire() != EmpirePlayer.getOnlinePlayer(p).getEmpire()){ if(!ptarget.isBlocking()){ ptarget.setHealth(Math.max(0, ptarget.getHealth() - ammo.getYield())); p.getWorld().playSound(p.getLocation(), Sound.ENTITY_GENERIC_HURT, 1.0F, 1.0F); ptarget.getWorld().playSound(ptarget.getLocation(), Sound.ENTITY_GENERIC_HURT, 1.0F, 1.0F); } if(counter % 2 == 0){ ptarget.setFoodLevel(Math.max(0, ptarget.getFoodLevel() - 1)); } } else { p.sendMessage(ptarget.getName() + " is a member of your empire, you cannot damage them."); } } else { target.setHealth(Math.max(0, target.getHealth() - ammo.getYield())); p.getWorld().playSound(p.getLocation(), Sound.ENTITY_GENERIC_HURT, 1.0F, 1.0F); target.getWorld().playSound(target.getLocation(), Sound.ENTITY_GENERIC_HURT, 1.0F, 1.0F); } } } loc.add(vec); } counter++; if(counter >= 20) this.cancel(); } } }
{ "content_hash": "3a22927304642ad2fd80c9167e32e223", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 117, "avg_line_length": 35.336633663366335, "alnum_prop": 0.6797422247128047, "repo_name": "zreed/StarQuestCode", "id": "23898069d9595906b163f2a57924dd27f0867f3d", "size": "3569", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Bukkit/SQTurrets/src/main/java/us/higashiyama/george/SQTurrets/types/BeamTurret.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "4600825" } ], "symlink_target": "" }
package alice.tuprolog; /** * @author Alex Benini * */ public class StateGoalSelection extends State { public StateGoalSelection(EngineRunner c) { this.c = c; stateName = "Call"; } /* (non-Javadoc) * @see alice.tuprolog.AbstractRunState#doJob() */ @Override void doJob(Engine e) { Term curGoal = null; while (curGoal == null) { curGoal = e.currentContext.goalsToEval.fetch(); if (curGoal == null) { // demo termination if (e.currentContext.fatherCtx == null) { //verify ChoicePoint e.nextState = (e.choicePointSelector.existChoicePoint()) ? c.END_TRUE_CP : c.END_TRUE; return; } // Caso di rimozione di un contesto di esecuzione e.currentContext = e.currentContext.fatherCtx; } else { // Caso di individuazione curGoal Term goal_app = curGoal.getTerm(); if (!(goal_app instanceof Struct)) { e.nextState = c.END_FALSE; return; } // Code inserted to allow evaluation of meta-clause // such as p(X) :- X. When evaluating directly terms, // they are converted to execution of a call/1 predicate. // This enables the dynamic linking of built-ins for // terms coming from outside the demonstration context. if (curGoal != goal_app) { curGoal = new Struct("call", goal_app); } e.currentContext.currentGoal = (Struct) curGoal; e.nextState = c.GOAL_EVALUATION; return; } } } }
{ "content_hash": "94ec8aa182848139cb95b4753fb6386c", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 126, "avg_line_length": 42, "alnum_prop": 0.39200680272108845, "repo_name": "adlange/IN2SEC", "id": "e5d989c02349b938fbc67b3bd3419b96fa684076", "size": "3164", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/dependencies/alice/tuprolog/StateGoalSelection.java", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Java", "bytes": "1171443" }, { "name": "Prolog", "bytes": "17694" } ], "symlink_target": "" }
ACCEPTED #### According to Integrated Taxonomic Information System #### Published in Sida 5:186. 1974 #### Original name null ### Remarks null
{ "content_hash": "f12c426edffdd7e3b04d996a5e30c60d", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 11.23076923076923, "alnum_prop": 0.7191780821917808, "repo_name": "mdoering/backbone", "id": "179ca6ab31150726f35433d20ce1e513c0a7204a", "size": "211", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Asterales/Asteraceae/Shinnersoseris/Shinnersoseris rostrata/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
ListGraph::ListGraph(int vertexCount) : neighbourLists(vertexCount) {} ListGraph::ListGraph(const vector<list<int> >& neighbourLists) : neighbourLists(neighbourLists) {} ListGraph::ListGraph(const MatrixGraph& matrixGraph) { int vertexCount = matrixGraph.vertexCount(); neighbourLists = vector<list<int> >(vertexCount, list<int>()); for (int j = 0, edgesCount = matrixGraph.edgesCount(); j < edgesCount; ++j) { int v1; int v2; for (int i = 0; i < vertexCount; ++i) { if (matrixGraph.getMatrix()[i][j] == -1) { v1 = i; } else if (matrixGraph.getMatrix()[i][j] == 1) { v2 = i; } } neighbourLists[v1].push_back(v2); } } ListGraph::ListGraph(const EdgeGraph& edgeGraph) { neighbourLists = vector<list<int> >(edgeGraph.vertexCount(), list<int>()); for (auto edge : edgeGraph.getEdges()) { neighbourLists[edge.first].push_back(edge.second); } } const vector<list<int> >& ListGraph::getLists() const { return neighbourLists; } int ListGraph::vertexCount() const { return neighbourLists.size(); } int ListGraph::edgesCount() const { int sum = 0; for (auto l : neighbourLists) { sum += l.size(); } return sum; } void ListGraph::addVertex(const list<int>& neighbourList) { neighbourLists.push_back(neighbourList); } void ListGraph::addEdge(int from, int to) { neighbourLists[from].push_back(to); } bool ListGraph::neighbour(int v1, int v2) const { for (auto v : neighbourLists[v1]) { if (v2 == v) { return true; } } return false; } bool ListGraph::isPath(const vector<int>& vertices) const { auto last = --(vertices.end()); auto it = vertices.begin(); while (it != last) { if (!neighbour(*it, *(++it))) { return false; } } return true; } ostream& operator<<(ostream& os, const ListGraph& listGraph) { for (int i = 0, len = listGraph.vertexCount(); i < len; ++i) { os << i << ": "; for (auto v : listGraph.getLists()[i]) { os << v << ' '; } os << '\n'; } return os; }
{ "content_hash": "e7f1774c0a7959b4688fd24831c85042", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 79, "avg_line_length": 23.686046511627907, "alnum_prop": 0.6205203730976927, "repo_name": "rgeorgiev583/dsp-practicum-2015-16", "id": "2932511a2aa235114f44eb484f8ef06265a5723c", "size": "2061", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "hw/1/81104/ListGraph.cpp", "mode": "33188", "license": "mit", "language": [ { "name": "C++", "bytes": "168283" }, { "name": "Python", "bytes": "761" }, { "name": "Shell", "bytes": "746" } ], "symlink_target": "" }
using System; using Twilio; using Twilio.Rest.Api.V2010.Account.Sip.Domain; class Example { static void Main(string[] args) { // Find your Account Sid and Auth Token at twilio.com/user/account string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; string authToken = "your_auth_token"; TwilioClient.Init(accountSid, authToken); var credentialListMappings = CredentialListMappingResource.Read( "SD32a3c49700934481addd5ce1659f04d2"); foreach (var credentialListMapping in credentialListMappings) { Console.WriteLine(credentialListMapping.FriendlyName); } } }
{ "content_hash": "c180105aa207ce686a782d9476ae51d9", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 74, "avg_line_length": 28.782608695652176, "alnum_prop": 0.6918429003021148, "repo_name": "teoreteetik/api-snippets", "id": "a5ea71eab69b96e9e790a437d9f878731b0fb3de", "size": "766", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "rest/sip-in/get-credential-list-mappings/get-credential-list-mappings.5.x.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "643369" }, { "name": "HTML", "bytes": "335" }, { "name": "Java", "bytes": "943336" }, { "name": "JavaScript", "bytes": "539577" }, { "name": "M", "bytes": "117" }, { "name": "Mathematica", "bytes": "93" }, { "name": "Objective-C", "bytes": "46198" }, { "name": "PHP", "bytes": "538312" }, { "name": "Python", "bytes": "467248" }, { "name": "Ruby", "bytes": "470316" }, { "name": "Shell", "bytes": "1564" }, { "name": "Swift", "bytes": "36563" } ], "symlink_target": "" }
function OpenModelObject(id,type,vr,cond,sup,inv,avcNot,dNot,cNot,passBR,opex,opid,ato,key,unit){ this.id=id; this.type=type; this.valueRange=vr; this.condition=cond; this.status; this.support=sup; this.isInvariant=inv; this.key=key; this.unit=unit; this.attributeValueChangeNotification=avcNot; this.objectDeletionNotification=dNot; this.objectCreationNotification=cNot; this.passedByReference=passBR; this["operation exceptions"]=opex; this["isOperationIdempotent"]=opid; this["isAtomic"]=ato; } module.exports=OpenModelObject;
{ "content_hash": "ef8665cba71add517815c5fdf23e2b9a", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 97, "avg_line_length": 29.7, "alnum_prop": 0.7272727272727273, "repo_name": "demx8as6/CENTENNIAL", "id": "063b87d2cbd9e9fb0004afb178c55fb9bbe078a6", "size": "1381", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "03-WTP-PoC/models/tools/src/xmi2yang tool-v1.3/model/OpenModelObject.js", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "11" }, { "name": "C", "bytes": "1010600" }, { "name": "C++", "bytes": "161503" }, { "name": "CSS", "bytes": "23366" }, { "name": "D", "bytes": "13421" }, { "name": "Groff", "bytes": "18564" }, { "name": "HTML", "bytes": "84126" }, { "name": "Java", "bytes": "262514" }, { "name": "JavaScript", "bytes": "847831" }, { "name": "Lua", "bytes": "2671087" }, { "name": "Makefile", "bytes": "46645" }, { "name": "Python", "bytes": "2556" }, { "name": "Shell", "bytes": "35117" }, { "name": "XSLT", "bytes": "27345" } ], "symlink_target": "" }
"""Support for the Mailgun mail notifications.""" import logging import voluptuous as vol from homeassistant.components.notify import ( ATTR_DATA, ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA, BaseNotificationService) from homeassistant.const import ( CONF_API_KEY, CONF_DOMAIN, CONF_RECIPIENT, CONF_SENDER) from . import CONF_SANDBOX, DOMAIN as MAILGUN_DOMAIN REQUIREMENTS = ['pymailgunner==1.4'] _LOGGER = logging.getLogger(__name__) DEPENDENCIES = ['mailgun'] # Images to attach to notification ATTR_IMAGES = 'images' DEFAULT_SENDER = 'hass@{domain}' DEFAULT_SANDBOX = False # pylint: disable=no-value-for-parameter PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({ vol.Required(CONF_RECIPIENT): vol.Email(), vol.Optional(CONF_SENDER): vol.Email(), }) def get_service(hass, config, discovery_info=None): """Get the Mailgun notification service.""" data = hass.data[MAILGUN_DOMAIN] mailgun_service = MailgunNotificationService( data.get(CONF_DOMAIN), data.get(CONF_SANDBOX), data.get(CONF_API_KEY), config.get(CONF_SENDER), config.get(CONF_RECIPIENT)) if mailgun_service.connection_is_valid(): return mailgun_service return None class MailgunNotificationService(BaseNotificationService): """Implement a notification service for the Mailgun mail service.""" def __init__(self, domain, sandbox, api_key, sender, recipient): """Initialize the service.""" self._client = None # Mailgun API client self._domain = domain self._sandbox = sandbox self._api_key = api_key self._sender = sender self._recipient = recipient def initialize_client(self): """Initialize the connection to Mailgun.""" from pymailgunner import Client self._client = Client(self._api_key, self._domain, self._sandbox) _LOGGER.debug("Mailgun domain: %s", self._client.domain) self._domain = self._client.domain if not self._sender: self._sender = DEFAULT_SENDER.format(domain=self._domain) def connection_is_valid(self): """Check whether the provided credentials are valid.""" from pymailgunner import (MailgunCredentialsError, MailgunDomainError) try: self.initialize_client() except MailgunCredentialsError: _LOGGER.exception("Invalid credentials") return False except MailgunDomainError as mailgun_error: _LOGGER.exception(mailgun_error) return False return True def send_message(self, message="", **kwargs): """Send a mail to the recipient.""" from pymailgunner import MailgunError subject = kwargs.get(ATTR_TITLE, ATTR_TITLE_DEFAULT) data = kwargs.get(ATTR_DATA) files = data.get(ATTR_IMAGES) if data else None try: # Initialize the client in case it was not. if self._client is None: self.initialize_client() resp = self._client.send_mail( sender=self._sender, to=self._recipient, subject=subject, text=message, files=files) _LOGGER.debug("Message sent: %s", resp) except MailgunError as mailgun_error: _LOGGER.exception("Failed to send message: %s", mailgun_error)
{ "content_hash": "e7bf36727535a3b1310ff0975a956b57", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 78, "avg_line_length": 34.739583333333336, "alnum_prop": 0.6542728635682159, "repo_name": "jamespcole/home-assistant", "id": "b9f5bf0b10000f4e16c25c7b9b33b003c3cbdef5", "size": "3335", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "homeassistant/components/mailgun/notify.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "1175" }, { "name": "Dockerfile", "bytes": "1081" }, { "name": "HCL", "bytes": "826" }, { "name": "Python", "bytes": "14822074" }, { "name": "Ruby", "bytes": "745" }, { "name": "Shell", "bytes": "17609" } ], "symlink_target": "" }
SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
{ "content_hash": "0c40f064e0f17bcad5f55413b799b66b", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 10.23076923076923, "alnum_prop": 0.6917293233082706, "repo_name": "mdoering/backbone", "id": "84724a1d5429b1ee43663224020e6a945d1f38c4", "size": "190", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Liliopsida/Poales/Poaceae/Ehrharta/Ehrharta setacea/ Syn. Ehrharta setacea scabra/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Runtime.Remoting.Lifetime; using System.Text; using System.Threading; using System.Threading.Tasks; namespace Tumbler.Addin.Core { /// <summary> /// 插件代理。用于插件与宿主之间的通信。 /// </summary> public class AddinProxy : MarshalByRefObject, IAddin { #region Fields /// <summary> /// 与该代理关联的插件。 /// </summary> private readonly IAddin _target; #endregion #region Constructors /// <summary> /// 初始化类型 Tumbler.Addin.Core.AddinProxy 实例。 /// </summary> /// <param name="target">插件。</param> protected AddinProxy(IAddin target) { if (target == null) throw new ArgumentNullException("target"); if (String.IsNullOrWhiteSpace(target.Id) || target.Id == MessageService.AddinHostId || target.Id == MessageService.AllTargetsId) { throw new ArgumentException("Invalid addin id"); } _target = target; Id = target.Id; MessageDispatcher = target.MessageDispatcher; } #endregion #region Properties /// <summary> /// 所关联插件的Id号。 /// </summary> public String Id { get; } /// <summary> /// 消息调度器。 /// </summary> public MessageDispatcher MessageDispatcher { get; } /// <summary> /// 消息服务。 /// </summary> internal MessageService MessageService { get; set; } /// <summary> /// 拥有此代理的应用程序域。 /// </summary> internal AppDomain Owner { get; set; } /// <summary> /// 代理关联的对象。 /// </summary> protected IMessageTarget Target => _target; #endregion #region Methods #region Public /// <summary> /// 获取宿主的真实Id。 /// </summary> /// <returns>宿主的真实Id。</returns> [LoaderOptimization(LoaderOptimization.MultiDomain)] public String GetHostActualId() { return MessageService?.GetHostActualId(); } /// <summary> /// 将消息转发给实际的对象。 /// </summary> /// <param name="message">消息。</param> [LoaderOptimization(LoaderOptimization.MultiDomain)] public void OnReceive(Message message) { MessageDispatcher?.Queue(message); } /// <summary> /// 当插件实例被创建时调用该方法。 /// </summary> [LoaderOptimization(LoaderOptimization.MultiDomain)] public void Initialize() { _target.Initialize(); } /// <summary> /// 当插件实例被卸载时调用该方法。 /// </summary> [LoaderOptimization(LoaderOptimization.MultiDomain)] public void Destroy() { _target.Destroy(); } /// <summary> /// 在租约管理器中,该对象永不过期,必须显示移除其根。 /// </summary> /// <returns>对象租约。</returns> [LoaderOptimization(LoaderOptimization.MultiDomain)] public override Object InitializeLifetimeService() { ILease lease = (ILease)base.InitializeLifetimeService(); lease.InitialLeaseTime = TimeSpan.FromMilliseconds(0); return lease; } /// <summary> /// 获取对象的字符串表示。 /// </summary> /// <returns>对象的字符串表示。</returns> [LoaderOptimization(LoaderOptimization.MultiDomain)] public override String ToString() { return Id; } #endregion #region Internal /// <summary> /// 将消息发送给消息中心让其调度。 /// </summary> /// <param name="message">消息。</param> [LoaderOptimization(LoaderOptimization.MultiDomain)] internal void Send(Message message) { MessageService?.Transmit(message); } #endregion #endregion } }
{ "content_hash": "fde2a4d14bb9b472cf0ae43004463778", "timestamp": "", "source": "github", "line_count": 160, "max_line_length": 74, "avg_line_length": 25.25, "alnum_prop": 0.5386138613861386, "repo_name": "paxhujing/Tumbler.Addin.v2", "id": "780f837d0d515e24ec232cfab990106d70d47f50", "size": "4452", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Tumbler.Addin/Tumbler.Addin.Core/AddinProxy.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "158132" }, { "name": "PowerShell", "bytes": "3737" } ], "symlink_target": "" }