text:
{
  "title": "😱 Clear Demonstration of Reinforcement Learning #theinsaneapp #ML #AI #MachineLearning #rstats #100DaysOfMLCode #javascript #reactjs #serverless #WomenWhoCode #Linux #100DaysOfCode #python #programming #deeplearning #Coding #ArtificialIntelligence Credits: @DrIsaPantami https://t.co/1aO1ZTRA4M",
  "date": "2020-09-23"
}

# #rstats

> **Insane** (@TheInsaneApp; 245/195): 😱 Clear Demonstration of Reinforcement Learning
> >
> #theinsaneapp #ML #AI
> #MachineLearning #rstats #100DaysOfMLCode #javascript #reactjs #serverless #WomenWhoCode #Linux #100DaysOfCode #python #programming #deeplearning #Coding #ArtificialIntelligence
> >
> Credits: @DrIsaPantami https://t.co/1aO1ZTRA4M  [↪](https://twitter.com/xieyihui/status/1308371019837485057)

<!-- -->

> **Garrick Aden-Buie** (@grrrck; 190/36): I saw @coolbutuseless's totally useful #rstats tip below for printing a calendar in the R console using a system util called `cal` and thought it'd be neat to recreate in R
> >
> https://t.co/I6qNZtCGPH https://t.co/k5b8HsJxZF https://t.co/zeoea1oJTn  [↪](https://twitter.com/xieyihui/status/1308243162624917506)

<!-- -->

> **Ahmadou Dicko** (@dickoah; 186/26): I'm so happy that my submission on humanitarian data science with #rstats was accepted for the next #rstudioconf
> Looking forward to discussing this topic and thanks @Shel_Kariuki
> for encouraging me  [↪](https://twitter.com/xieyihui/status/1308491683089219585)

<!-- -->

> **Andrew Heiss** (@andrewheiss; 180/31): Y'all, the {tidygeocoder} #rstats package by @JesseCambon makes geocoding addresses *jaw-droppingly* trivial! (h/t @asmae_toumi) (code here: https://t.co/LOv858tCbI) https://t.co/SR8Oy6VVrd  [↪](https://twitter.com/xieyihui/status/1308426881482608643)

<!-- -->

> **RStudio** (@rstudio; 166/54): R View's "Top 40" New CRAN Packages - August 2020
> 146 new #rstats packages joined CRAN in Aug
> Check out R View's top picks in Computational Methods, Genomics, Insurance, ML, Maths, Medicine, Time Series, Utilities, & Visualization
> https://t.co/yfc2juxrpS
> #rstats #DataScience https://t.co/dBnYsttlqx  [↪](https://twitter.com/xieyihui/status/1308480697712160771)

<!-- -->

> **Dr. Ganapathi Pulipaka** (@gp_pulipaka; 130/140): Bayesian Methods for Hackers. #BigData #Analytics #DataScience #AI #MachineLearning #CyberSecurity #IoT #IIoT #Python #RStats #JavaScript #ReactJS #CloudComputing #Serverless #DataScientist #Linux #Books #Mathematics #Programming #Coding #100DaysofCode
> https://t.co/9gzY1WqPWJ https://t.co/l3nhdc5cTW  [↪](https://twitter.com/xieyihui/status/1308418284442849280)

<!-- -->

> **Dr. Ganapathi Pulipaka** (@gp_pulipaka; 120/132): Multi-Core #MachineLearning in #Python With #ScikitLearn. #BigData #Analytics #DataScience #AI #IoT #IIoT #RStats #TensorFlow #Java #JavaScript #ReactJS #GoLang #CloudComputing #Serverless #DataScientist #Linux #Programming #Coding #100DaysofCode
> https://t.co/JyEYzfbhT2 https://t.co/mrk1ZMqpwS  [↪](https://twitter.com/xieyihui/status/1308292528991473666)

<!-- -->

> **Dr. Ganapathi Pulipaka** (@gp_pulipaka; 116/107): 5 Free Books To Take Your #DataScience Skills to The Next Level. #BigData #Analytics #IoT #IIoT #Python #RStats #TensorFlow #Java #JavaScript #ReactJS #CloudComputing #Serverless #DataScientist #Linux #Books #Programming #Coding #100DaysofCode
> https://t.co/KfH9fxU0Ex https://t.co/4L7UFrpLz7  [↪](https://twitter.com/xieyihui/status/1308270590030217216)

<!-- -->

> **Dr. Ganapathi Pulipaka** (@gp_pulipaka; 95/111): Computed Parameters in PyTorch - A Hack. #BigData #Analytics #DataScience #AI #MachineLearning #IoT #IIoT #PyTorch #Python #RStats #TensorFlow #Java #JavaScript #ReactJS #CloudComputing #Serverless #DataScientist #Linux #Programming #Coding #100DaysofCode
> https://t.co/CwjnuXBGeW https://t.co/7epvy59p0e  [↪](https://twitter.com/xieyihui/status/1308285161079939073)

<!-- -->

# blogdown

> **Alison Presmanes Hill** (@apreshill; 42/5): It is time to retire my favorite slide from teaching #blogdown.
> >
> https://t.co/lWcTtP57il (may be my favorite commit message by @xieyihui)
> >
> Currently, development version only, but RIP to one of my favorite gifs 🦜 https://t.co/LxIDEb4nSe  [↪](https://twitter.com/xieyihui/status/1308489660197408773)

<!-- -->

> **Brendan Cullen** (@_bcullen; 22/4): FYI, for #rstats folks who want to implement something similar to #rmarkdown tabsets in #blogdown .Rmd posts! @grrrck has provided an easy way to do just that with `xaringanExtra::panelset()`. Great way to make your posts more concise and interactive. Can't wait to use this! 🙌 https://t.co/Icq452PWyp  [↪](https://twitter.com/xieyihui/status/1308469576942776320)

<!-- -->

> **Alison Presmanes Hill** (@apreshill; 13/0): @minebocek @github great idea! I always build Hugo sites for Ada, too 😀 Florence has such a wonderful dataviz portfolio too
> >
> https://t.co/YC0zFJVoLJ https://t.co/eTvlqaCeKQ  [↪](https://twitter.com/xieyihui/status/1308719107920060417)

<!-- -->

> **Joanna Prout, PhD** (@joieprout; 10/1): About a week late to last week's #TidyTuesday.  Here is a bumpchart of ranked categories of spending on children in the state of MD between 2011-2016.  I am still figuring out the mystery of blogdown/Github/Netlify but one day I will post it there! https://t.co/cbOOr9vdyb  [↪](https://twitter.com/xieyihui/status/1308130717193437186)

<!-- -->

> **Matt Dray** (@mattdray; 7/2): 🐐🧮 I wrote a post about GoatCounter by @arp242_martin, which now replaces Google Analytics on my #rstats {blogdown} website.
> 📝 https://t.co/wKUi0nFhMe
> 🌐 https://t.co/fwMglhbRcg https://t.co/tMOaKjeaN2  [↪](https://twitter.com/xieyihui/status/1306353556706992128)

<!-- -->

> **Garrick Aden-Buie** (@grrrck; 6/1): @_bcullen @lisalendway @KellyBodwin Yes! It works nicely in blogdown posts 😊
> >
> Check out the Rmd section in the panelset docs https://t.co/WMKsh61MUV
> >
> Or an html_document() example https://t.co/MTMC279LFv  [↪](https://twitter.com/xieyihui/status/1308450215750402049)

<!-- -->

> **Yihui Xie** (@xieyihui; 3/0): @sedgeboy @ProQuesAsker In most cases, all you need is only one thing: blogdown::serve_site() https://t.co/iJ2uSnb1iQ You should never need build_site(), unless you want to recompile all Rmd files. serve_site() only compiles changed Rmd files. Then you run hugo_build() locally if you don't use Netlify.  [↪](https://twitter.com/xieyihui/status/1308770583769952256)

<!-- -->

> **Andrés Arau** (@AndresArau; 2/2): Intentando adaptarnos a la era COVID-19, hemos decidido empezar una vida nómada y continuar trabajando desde lugares con baja densidad de población donde la distancia social puede ser garantizada. Así empezamos este blog: https://t.co/FDFPGjFmZ8 #DataScientist #blogdown  [↪](https://twitter.com/xieyihui/status/1307994638901538817)

<!-- -->

> **Kristy Robledo** (@KristyRobledo; 2/0): @Kim_Fitter yes! maybe blogdown, or maybe xaringan ?  [↪](https://twitter.com/xieyihui/status/1308559824162938880)

<!-- -->

> **Data fitter Kim** (@Kim_Fitter; 2/0): @KristyRobledo Websites with Blogdown, GitHub https://t.co/hxOESDcC3Y ?  [↪](https://twitter.com/xieyihui/status/1308557363624857601)

<!-- -->

> **Joshua de la Bruere** (@delaBJL; 2/0): @AnnaHenschel @McAleerP If you do an rmd to guthub document it could be easily transitioned to a blogdown post at some point 👀  [↪](https://twitter.com/xieyihui/status/1307726837200584706)

<!-- -->

> **Sonja Winter** (@winterstat; 2/0): @MagdaMartinezG1 @dsquintana I found this tutorial https://t.co/fWJIZhUSgk and following those steps (little bit more complex, you need to clone something from github), and then also installing a program/language called "Go" (just google "install go") before I used blogdown::serve_site() finally worked!  [↪](https://twitter.com/xieyihui/status/1307034644294950913)

<!-- -->

> **João Pedro** (@KimJoaoUn; 2/0): @tiagopferraz Uma opção é usar o blogdown  [↪](https://twitter.com/xieyihui/status/1306593884714139656)

<!-- -->

> **Andrés Arau** (@AndresArau; 1/2): Trying to adapt to the COVID-19 era, we decided to start a nomad lifestyle and to continue working exclusively from low densely populated areas where social distancing can be guaranteed. This is how we started this blog: https://t.co/FDFPGjFmZ8 #DataScientist #rstats #blogdown  [↪](https://twitter.com/xieyihui/status/1307786176791744521)

<!-- -->

> **atusy** (@Atsushi776; 1/0): @niszet0 簡易的にはblogdown+viBookなんですけど、RStudio Serverとの相性が悪かった記憶です。
> https://t.co/HB8jfdvsWO  [↪](https://twitter.com/xieyihui/status/1308352767430258688)

<!-- -->

> **Daniel Krueger** (@DanielKrueger96; 1/0): @datarobbie1 @stadio Very nice use of #blogdown! I've been meaning to put something similar together  [↪](https://twitter.com/xieyihui/status/1306721926757277697)

<!-- -->

> **Tyler Smith** (@sedgeboy; 0/2): Is it possible to build a #rstats #blogdown site for deployment on a server (i.e., not local), only recompiling Rmd files that have changed? hugo_build doesn't compile any Rmd, but build_site compiles them all, I think? @ProQuesAsker @xieyihui  [↪](https://twitter.com/xieyihui/status/1308511453129908225)

<!-- -->

> **Peter 'Wear a Mask' Licari 📊** (@PRLPoliSci; 0/1): Hey #rstats and blogdown folk! Anyone else having problems making new blogdown sites with https://t.co/6wDMtS5yCP themes? Before, installing themes would give me something like A but now only gives me B. No content or public folder, no config toml. Pasting the ex. config gets C. https://t.co/bzpBmlfeZI  [↪](https://twitter.com/xieyihui/status/1307710446963654658)

<!-- -->

# bookdown

> **Solomon Kurz** (@SolomonKurz; 126/20): The 0.3.0 version of my #brms + #tidyverse translation of Kruschke's "Doing Bayesian data analysis" is up!
> >
> https://t.co/mEUFZXJgtn
> >
> 1/5  [↪](https://twitter.com/xieyihui/status/1308436344516022273)

<!-- -->

> **Animal Behavior Society** (@AnimBehSociety; 57/13): I love using #rstats! I recently developed an R package & R tutorials for teaching Intro to #Behavior @Cornell - my favorite activity used #openaccess camera trap #data to investigate animal activity patterns. #ABStakeover @BorneanGibbons
> https://t.co/NNwhdMmLgO https://t.co/hO5buZAaSd  [↪](https://twitter.com/xieyihui/status/1308118048667316225)

<!-- -->

> **yaniv brandvain** (@yanivbrandvain; 56/10): working on bookdown version of biostats notes to accompany whitlock and schluter.
> >
> adding a bonus chapter about dealing with data inspired by @kwbroman  & @kara_woo - "Data organization in spreadsheets"
> https://t.co/RlmEYbSZCw https://t.co/rnfojVENtt  [↪](https://twitter.com/xieyihui/status/1308284746514931712)

<!-- -->

> **✊🏻🌹🏥 John Flournoy Wears a Mask 🏥🌹✊🏻** (@flourneuro; 33/6): Really nice walkthrough of gaussian process regression by @SolomonKurz translating @rlmcelreath's "Rethinking" to brms. There's a mystery to be solved, too, if you're game... https://t.co/X0cgxVa9HQ
> >
> p.s. Solomon, clinical neuroimaging folks _are_ getting into GPR!  [↪](https://twitter.com/xieyihui/status/1306641811868319745)

<!-- -->

> **R posts you might have missed!** (@icymi_r; 27/4): ✍📚 "bookdown-template • Template for R bookdown books"
> >
> 👤 Joyce Robbins @jtrnyc
> >
> https://t.co/B7S8La7oix
> #rstats  [↪](https://twitter.com/xieyihui/status/1308143519526256640)

<!-- -->

> **ill-identified** (@ill_Identified; 19/7): 本日の #tokyoR で紹介した bookdown + rmdja のドキュメントです
> >
> 数学書としても技術文書としてももいろいろ使える機能があるので怪文書だけでなく教材づくりにもおすすめ!!
> >
> https://t.co/4z21v5uIAi https://t.co/KKLX8rh8ns  [↪](https://twitter.com/xieyihui/status/1307293920112463872)

<!-- -->

> **Tim Kaiser** (@tkaiser_science; 14/2): I've read a lot of praise for the #brms package, but it is rarely mentioned that you can do a Bayesian meta-analysis with it. Here is a nice tutorial by
> @MathiasHarrer
>  https://t.co/hpr0RHDkh5
> #RStats  [↪](https://twitter.com/xieyihui/status/1306487825551036419)

<!-- -->

> **Sharon Machlis** (@sharon000; 12/4): The knitr package's combine_words() function takes a vector of character strings and turns them into a human-readable phrase:
> "item 1" for 1 item
> "item 1 and item 2" for 2
> "item 1, item2, and item3" for 3, etc.
> https://t.co/5h8fLdjYNN
> #rstats https://t.co/2Id1xbBgMT  [↪](https://twitter.com/xieyihui/status/1308194475739619331)

<!-- -->

> **R-bloggers** (@Rbloggers; 11/6): Bookdown, Not Bookout  {https://t.co/lUHqJEeSGl} #rstats #DataScience  [↪](https://twitter.com/xieyihui/status/1306838938674507781)

<!-- -->

> **R posts you might have missed!** (@icymi_r; 5/5): 📚✍ "Bookdown, Not Bookout"
> >
> 👤 James Adams @jmablog
> >
> https://t.co/ByX38c0jpY
> #rstats  [↪](https://twitter.com/xieyihui/status/1306842462321807363)

<!-- -->

> **R Weekly Live** (@rweekly_live; 5/4): Bookdown, Not Bookout https://t.co/5qZx6WJzXE #rstats #datascience https://t.co/hF6QyPtkHl  [↪](https://twitter.com/xieyihui/status/1307253516751245312)

<!-- -->

> **Solomon Kurz** (@SolomonKurz; 5/0): Notable updates include:
> >
> * refitting all models with #brms 2.13.5;
> * adding Kruschke-style model diagrams based on my earlier blog workflow (https://t.co/mEUFZXJgtn)
> >
> 2/5 https://t.co/7ZPVBPx7Ub  [↪](https://twitter.com/xieyihui/status/1308436345350692865)

<!-- -->

> **Joyce Robbins** (@jtrnyc; 3/0): A template for creating a #bookdown book in 5 minutes 👇 https://t.co/nZLxGHjeQP  [↪](https://twitter.com/xieyihui/status/1308183572080201729)

<!-- -->

> **Phil Aldridge** (@wragbags; 3/0): That moment in your life you discover https://t.co/4q0xQgEUdJ @sjcockell @MattBashton #R  [↪](https://twitter.com/xieyihui/status/1308052252649758725)

<!-- -->

> **atusy** (@Atsushi776; 2/3): キャッシュは最小限にせよ、R Markdown Cookbookもそう言っている
> >
> > We do not recommend that you set the chunk option cache = TRUE globally in a document.
> https://t.co/Hy1KCKCZvP
> #TokyoR  [↪](https://twitter.com/xieyihui/status/1307198857646804995)

<!-- -->

> **tidyverse tweets** (@tidyversetweets; 2/2): Using bookdown, must one set number_sections: true in _output.yml for cross referencing sections? #tidyverse #rstats https://t.co/W74YB7rfcf  [↪](https://twitter.com/xieyihui/status/1307078327677652998)

<!-- -->

> **tidyverse tweets** (@tidyversetweets; 2/1): Providing translations for R Bookdown project #tidyverse #rstats https://t.co/Q44bfW23GO  [↪](https://twitter.com/xieyihui/status/1308258557352083456)

<!-- -->

> **tidyverse tweets** (@tidyversetweets; 2/1): Bookdown and rendering kable tables to a word document #tidyverse #rstats https://t.co/n1sxq9NlQN  [↪](https://twitter.com/xieyihui/status/1308341607540969479)

<!-- -->

> **Michael Clark** (@statsdatasci; 2/1): I've recently updated my mixed models doc with an additional section on Bayesian analysis and other upgrades. Along with this, I'll be having a workshop regarding the content on 10-21 for @Umich and @CscarUmich.
> >
> #Rstats #bookdown #mixedmodels #lme4 #brms
> >
> https://t.co/1p8xhbzO3d  [↪](https://twitter.com/xieyihui/status/1308397196363157506)

<!-- -->

> **Solomon Kurz** (@SolomonKurz; 2/0): @genomixgmailcom Both editions
> >
> first: https://t.co/U6SjLKPxiM
> second: https://t.co/8elgCVrhAA  [↪](https://twitter.com/xieyihui/status/1308492609841762306)

<!-- -->

> **Solomon Kurz** (@SolomonKurz; 2/0): * adding custom color palettes and plotting themes starting around chapter 9 (there's a transition period);
> * peppering in plotting conventions based on Wilke's work (https://t.co/mEUFZXJgtn);
> >
> 3/5 https://t.co/QBbVNVhgKz  [↪](https://twitter.com/xieyihui/status/1308436346877480962)

<!-- -->

> **Tyler Pritchard** (@PritchardPsych; 2/0): @CKVanPay Depending on time commitments, I am interested. Perhaps  developing an accompanying bookdown would be useful.  [↪](https://twitter.com/xieyihui/status/1308083268974247936)

<!-- -->

> **Phil McAleer** (@McAleerP; 2/0): @AnnaHenschel Yeah that would work. That said, you have so many cool things you could no doubt fill a book and use bookdown! But whatever works best for you. https://t.co/ztrXfnHGHW  [↪](https://twitter.com/xieyihui/status/1307713424609214466)

<!-- -->

> **Ben Stanley** (@BDStanley; 2/0): @PoliSciJack @jackethomp This is a great resource if you want to use Statistical Rethinking but find - as I do - brms more user-friendly. Basically all the code in the book translated into brms, and *he explains what he's doing for idiots like me*. https://t.co/KSomaNtGo1  [↪](https://twitter.com/xieyihui/status/1306884787873951747)

<!-- -->

> **Jens91** (@Jens9110; 2/0): Introduction to Econometrics with R https://t.co/BJ4KezT9qN #rmarkdown #bookdown  [↪](https://twitter.com/xieyihui/status/1306331556429135874)

<!-- -->

> **Michael Rubin** (@MRubin11; 2/0): @joeyhuddleston @EPerkoski @suboticjelena If you use RMarkdown/bookdown, you can write the file to a Word doc instead of pdf.  [↪](https://twitter.com/xieyihui/status/1306270689389928455)

<!-- -->

> **tidyverse tweets** (@tidyversetweets; 1/1): Building Bookdown to HTML loses styled formatting #tidyverse #rstats https://t.co/uQoHfGSvGD  [↪](https://twitter.com/xieyihui/status/1306332377422204932)

<!-- -->

> **tidyverse tweets** (@tidyversetweets; 1/1): r bookdown - dynamic custom link text reference chapter and table in link #tidyverse #rstats https://t.co/h7daCBucNj  [↪](https://twitter.com/xieyihui/status/1306676897242378241)

<!-- -->

> **🌐 ⚡🚲** (@ziromr; 1/1): @die_weberin https://t.co/f7oSmaLAud
> https://t.co/3klGno62Pq
> https://t.co/l52zOAT9ON
> https://t.co/7yyNsY27s2
> https://t.co/pkHFNhJiUO
> usw  [↪](https://twitter.com/xieyihui/status/1308470916565929984)

<!-- -->

> **tidyverse tweets** (@tidyversetweets; 1/0): How to create a R markdown/bookdown cross reference to a table that includes both text and the automatically generated table number? #tidyverse #rstats https://t.co/kR9ftOBYhm  [↪](https://twitter.com/xieyihui/status/1306727241586536453)

<!-- -->

> **Godwin Noah** (@godwinnoah; 1/0): My team and I just launched https://t.co/tTwgFhl0vi https://t.co/8c0TPyort0 via @YouTube #Nigeria #Foodie #BBNaijialockdown2020 Please Subscribe  [↪](https://twitter.com/xieyihui/status/1308526838327791617)

<!-- -->

> **Ken Bodnar** (@ArtofWarm; 1/0): R Markdown Cookbook
> >
> https://t.co/GQtfc97A48  [↪](https://twitter.com/xieyihui/status/1308360613828202498)

<!-- -->

> **yaniv brandvain** (@yanivbrandvain; 1/0): @zTiredScientist working on it! a little premature at the moment, but planning on getting them onto https://t.co/iqG4NiHPyF soon [well before they are ready for consumption]  [↪](https://twitter.com/xieyihui/status/1308288983781253125)

<!-- -->

> **TuQmano** (@TuQmano; 1/0): @martinmontane @vazquezbrust algún día lograré aprovecharme de todo lo que vengo absorbiendo de estos y otros recursos para armarme el bookdown de @pol_Ar_bot  [↪](https://twitter.com/xieyihui/status/1307131338571558912)

<!-- -->

> **Deemah 🇺🇦 🇳🇴 🇸🇪** (@dmi3k; 1/0): Good tips for {bookdown} worflow with Word output https://t.co/Om3t1abYMp  [↪](https://twitter.com/xieyihui/status/1306927096632152064)

<!-- -->

> **Beatriz Milz** (@BeaMilz; 1/0): @jtrecenti Eu sei que não é o foco do Tweet, mas eu achei esse bookdown tão caprichado! Bonito mesmo, capricharam no CSS  [↪](https://twitter.com/xieyihui/status/1306893272514691076)

<!-- -->

> **𝙳𝚊𝚟𝚒𝚍 𝚁𝚎𝚒𝚗𝚜𝚝𝚎𝚒𝚗** (@GivingTools; 1/0): https://t.co/J4l5gBtoxt Thanks @_MiguelHernan  and Jamie Robins for putting this great text online for open access. Thanks also to Sean Mcgrath and Joy Shi for putting up the #Rstats code as a @bookdown_io at https://t.co/BnsN2iTr5K  [↪](https://twitter.com/xieyihui/status/1306366776503078914)

<!-- -->

> **walidnegm** (@walidnegm; 0/2): 4.2 Logistic Regression | Interpretable Machine Learning https://t.co/P7vEFPLiUk #rmarkdown #bookdown  [↪](https://twitter.com/xieyihui/status/1307295973266411521)

<!-- -->

> **Big Data Analytics** (@BigData_Fr; 0/2): Bookdown, Not Bookout - https://t.co/8zHiwvdNtd - thanks @RichardEudes #DataScience #DS,#MachineLearning,#Statistics,#ArtificialIntelligence,#DataScience,#Analytics #DataScience  [↪](https://twitter.com/xieyihui/status/1306852826082140162)

<!-- -->

> **tidyverse tweets** (@tidyversetweets; 0/1): Error in compiling pdf in bookdown #tidyverse #rstats https://t.co/KaH0r0NirC  [↪](https://twitter.com/xieyihui/status/1308441021836079104)

<!-- -->

> **Thomas 'Fredo' Hütter** (@DerFredo; 0/1): Posted by » R, now on R-bloggers: Bookdown, Not Bookout #rstats https://t.co/QE9J7bv5dI  [↪](https://twitter.com/xieyihui/status/1306858542889082887)

<!-- -->

# knitr

> **Nischal Shrestha** (@nischaldesign; 7/5): Today I got mad at the default print of pandas.DataFrame in the middle of building a lesson in rmarkdown, so did some trickery to render a prettier version. It's a dirty hack using {knitr}, {reticulate}, and {kableExtra}. This will do for now! 🐍 🐼 #rstats #python https://t.co/dmMM2nG966  [↪](https://twitter.com/xieyihui/status/1308180087574081541)

<!-- -->

> **Data Science East Africa🧠** (@DataScience_Ea; 7/1): Top R libraries for Data Science
> 1) Ggplot2
> 2) Dplyr
> 3). Esquisse
> 4). BioConductor
> 5). Lubridate
> 6). Mlr
> 7). Knitr
> 8). DT
> 9). Caret
> 10). Quanteda.dictionaries
> 11). RCrawler
> 12). RMarkdown
> 13). Janitor
> #R #DataScience #100DaysOfCode  [↪](https://twitter.com/xieyihui/status/1307032540130181120)

<!-- -->

> **Manu Gonzalez Canche** (@manu_canche; 3/3): Super mind blown about #html customization with @rstudio and #rmarkdown.
> The tool is so cool that I'm using the HTML output instead of a #beamer presentation (access here https://t.co/kEMroK2xMP)
> Thank you Dr. @xieyihui
> #rstats #knitr #DataScience #rpubs
> #reproducibility #dataviz https://t.co/CiIij8BRtJ  [↪](https://twitter.com/xieyihui/status/1307870926680346624)

<!-- -->

> **Garrick Aden-Buie** (@grrrck; 2/1): @_bcullen @lisalendway @KellyBodwin There's a variety of panelset syntax options that work or don't work depending on the many interacting versions of knitr, pandoc, rmarkdown, etc.
> >
> Here's the syntax I used in a recent post
> https://t.co/dVC093rkOi  [↪](https://twitter.com/xieyihui/status/1308450828798300165)

<!-- -->

> **Do-ugh** (@adhdoug; 2/0): @calvinmdewilde Oh, never mind. It's not in the header. I just include it at the beginning of the rmd file after the header:
> >
> ```{r setup, include=FALSE}
> knitr::opts_chunk$set(echo = TRUE,fig.width=6, fig.height=2.5)
> ```  [↪](https://twitter.com/xieyihui/status/1308090151193784320)

<!-- -->

> **石井淳平** (@ishiijunpei; 2/0): Rmarkdwon+kableで、もうワンランク上の表をつくるときはkableExtraパッケージを使います。PDF出力にはとても有用なパッケージです。
> knitr to PDFでの複雑なテーブル(行グループのタイトルを追加する) https://t.co/rsJgiupHvL #Qiita  [↪](https://twitter.com/xieyihui/status/1306559342750048256)

<!-- -->

> **CRAN Package Updates** (@CRANberriesFeed; 1/2): CRAN updates: future knitr nat https://t.co/y5W2NTKSXT #rstats  [↪](https://twitter.com/xieyihui/status/1308451574302347264)

<!-- -->

> **Philipp Bayer** (@PhilippBayer; 1/0): I had fun digging into this with @jdblischak:
> Turns out, always use H:\ for your network mounted home directory on Windows, try to avoid \\https://t.co/dFJvJOXn5g\folder1\STAFFID when doing ANYTHING in R or Knitr. You'll avoid many errors.
> >
> https://t.co/1ykj32IsLW  [↪](https://twitter.com/xieyihui/status/1308598988103270400)

<!-- -->

> **bluebet** (@chaps_sgm; 1/0): @sprotzbettor @zicoisthegoat knitr::kable.matplotlib  [↪](https://twitter.com/xieyihui/status/1307891114112819200)

<!-- -->

> **leo** (@leo4luffy; 1/0): @_bcullen Hola doctor @_bcullen, buenos días. Muchas gracias por compartir todos estos tips tan buenos 😁. Doctor, yo intente colocar una learnr apps usando `knitr::include_app()`, sin embargo sale un cuadro vació ¿De pronto sabe que podría estar pasando? Muchísimas gracias!!!! https://t.co/879glmGcgc  [↪](https://twitter.com/xieyihui/status/1306319975947403269)

<!-- -->

# pagedown

> **Jess Chandler** (@jessachandler; 1/0): @ceptional The biggest problem that I have when I want a nice printout and I'm rendering html is the page breaks. Not sure if it helps, but `pagedown` gives a way around that. You can add a custom style to increase space for headers? https://t.co/fS5yqRuusX  [↪](https://twitter.com/xieyihui/status/1307458860018315266)

<!-- -->

> **overnight sensation** (@admiralnissen; 1/0): @queerurbanisto it was in front of your eyes the whole time - https://t.co/BDQ7sHtOGR  [↪](https://twitter.com/xieyihui/status/1306642732689977346)

<!-- -->

# tinytex

> **Mel Andrews** (@bayesianboy; 15/0): @JBeardsleyPhD What could you possibly pay money for with LaTeX? I highly recommend working with overleaf. I just started using r with tinytex last night, that's loads of fun.  [↪](https://twitter.com/xieyihui/status/1308501826531201024)

<!-- -->

> **Rylee Alanza Lyman** (@ryleealanza; 5/0): @JBeardsleyPhD ugh, it really is not for everyone, but I feel like everyone should use TinyTeX https://t.co/DwwsVmS6Ry  [↪](https://twitter.com/xieyihui/status/1308428399577362434)

<!-- -->

> **Mel Andrews** (@bayesianboy; 2/0): @EtheHerring oh are you having trouble loading tinytex in rstudio too  [↪](https://twitter.com/xieyihui/status/1308185102355234816)

<!-- -->

> **CRAN Package Updates** (@CRANberriesFeed; 1/1): CRAN updates: brant DRIP FHDI TestDimorph tinytex https://t.co/y5W2NU2tPr #rstats  [↪](https://twitter.com/xieyihui/status/1308300694793773056)

<!-- -->

> **Jared Lander** (@jaredlander; 1/0): @xieyihui @_ColinFay I need to delete MiKTeX and just go all in on TinyTeX  [↪](https://twitter.com/xieyihui/status/1308782966643003393)

<!-- -->

> **Yihui Xie** (@xieyihui; 1/0): @the_good_matty @ryleealanza @JBeardsleyPhD If I'm doing my math correctly, with the download speed 40Mb/s, it should take about 2 seconds to download TinyTeX, so don't blink your eye, or you'll miss the progress bar :)  [↪](https://twitter.com/xieyihui/status/1308768663298813953)

<!-- -->

> **Paul Pearson** (@paultpearson; 1/0): @JBeardsleyPhD Try TinyTeX.  It works beautifully on Linux for me and is billed as cross-platform.  [↪](https://twitter.com/xieyihui/status/1308578261744652288)

<!-- -->

> **Marianna Foos** (@MariannaFoos; 1/0): @_ColinFay that is what happened to me when I installed basictex instead of full mactex on my new computer. I think I fixed it by uninstalling, using {tinytex} and rebooting.  [↪](https://twitter.com/xieyihui/status/1308066131400437761)

<!-- -->

> **Jake** (@JungleJoosy; 1/0): @Lluis_Rev Damn, no, it's still blank. I'm gonna look more at how tinytex deals with nested functions, because (and I only just glanced at it) it only prints top-level expressions?  [↪](https://twitter.com/xieyihui/status/1306614449680330753)

<!-- -->

> **Deependra Dhakal** (@dd_rookie; 0/1): What are the recommended practices for continuous deployment of r projects (not exactly proj. but it involves tinytex distribution and several tex files) with Travis-CI? Is renv approach the best ? How do I cache most to build faster ? #rstats  [↪](https://twitter.com/xieyihui/status/1307282625518694406)

<!-- -->

# xaringan

> **R posts you might have missed!** (@icymi_r; 52/13): 📦 "xaringan-template • A template for making customisable slides in RMarkdown with Xaringan"
> >
> 👤 Sophie Hill @sophie_e_hill
> >
> https://t.co/wmchIo7wsF
> #rstats https://t.co/2jy7B7U4n5  [↪](https://twitter.com/xieyihui/status/1306536921666121729)

<!-- -->

> **R posts you might have missed!** (@icymi_r; 15/2): 📦⚔ "xaringan-themes • Xaringan themes for presentations in R"
> >
> 👤 David Schoch @schochastics
> >
> https://t.co/AemgxPTIWZ
> #rstats https://t.co/3Tp8gMNW8P  [↪](https://twitter.com/xieyihui/status/1307168094595371009)

<!-- -->

> **Chris Goodman** (@cbgoodman; 9/0): Still crazy to me that I can build this entire map slide (shoutout @urbaninstitute's `urbnmapr') from inside R markdown using xaringan. https://t.co/ReYWA5Bywg  [↪](https://twitter.com/xieyihui/status/1306766973221703683)

<!-- -->

> **ThinkR** (@thinkR_fr; 8/1): 📋 "A slideout menu plugin for Reveal.js to quickly jump to any slide by title"
> 👍 Interesting for any #rstats #xaringan user ! 👨🏫👩🏫
> 👉https://t.co/s06yCjwGVE https://t.co/bDpjZFnjOU  [↪](https://twitter.com/xieyihui/status/1308379290594144258)

<!-- -->

> **gabibentø** (@gabibento4; 6/0): @Corinthians hum hum cássio está precisando do seu xaringan de vorta  [↪](https://twitter.com/xieyihui/status/1306418238998315010)

<!-- -->

> **Silvia Canelón** (@spcanelon; 5/1): @_bcullen @allison_horst @RLadiesChicago @RLadiesGlobal @kbgorman_ecoevo @apreshill @grrrck Hello again! I updated the parent xaringan Rmd to make use of child docs! You'll now see 8 additional Rmds, one per package: https://t.co/s4LBu8d2A8
> >
> I'm hoping this setup will help you find some useful content a little faster in time for your upcoming workshop -- best of luck!  [↪](https://twitter.com/xieyihui/status/1307427310107340803)

<!-- -->

> **Federico Marini** (@FedeBioinfo; 2/0): @fellgernon @galactictorero @dataandme OMG. Guess I could just put an <iframe> in the xaringan slides and have that appear live as I speak 🍹🕶🤗  [↪](https://twitter.com/xieyihui/status/1307017740641808385)

<!-- -->

> **Ale H Segura** (@A_Sure_13; 2/0): @edwinveldhuizen @mzelst For me, the package from Hadley Wickham has worked in Rmarkdown xaringan presentations! https://t.co/D9EQEX04vd  [↪](https://twitter.com/xieyihui/status/1306332374268022786)

<!-- -->

> **lisa lendway** (@lisalendway; 1/0): @grrrck @_bcullen @KellyBodwin Thank you for the quick reply! Of course it was the one I didn't try because it was labeled as "less standard". Now I'm motivated to get with the cool kids and start using xaringan!  [↪](https://twitter.com/xieyihui/status/1308390036631629824)

<!-- -->

> **lisa lendway** (@lisalendway; 1/0): @_bcullen @grrrck @KellyBodwin I haven't started using xaringan yet. Have you ever tried this with ioslides? I think I tried all the different ways of doing it in @grrrck's documentation, but I'm probably missing something since I can't seem to get it to work. Thanks!  [↪](https://twitter.com/xieyihui/status/1308382960027078656)

<!-- -->

> **Mine Çetinkaya-Rundel** (@minebocek; 1/0): @dkrsharma3 Mostly xaringan nowadays: https://t.co/Qek7xrQMj5  [↪](https://twitter.com/xieyihui/status/1308155776108724230)

<!-- -->

> **André** (@andreviinis; 1/0): @HenriqueCanei É meu xaringan hahshhsd sla como escreve  [↪](https://twitter.com/xieyihui/status/1307037378238984192)

<!-- -->


text:
% SIGNAL SYNTHESIS
%
% Estimates the time-domain signal from a given time-frequency distribution.
%
%
% The signal synthesis routine is limited to the following
% time-frequency distributions:
%
%    (i)   Short-Time Fourier Transform (STFT)
%    (ii)  Spectrogram
%    (iii) Wigner-Ville Distribution
%
% PARAMETERS:
%
%   TIME-FREQUENCY MATRIX
%
%	Input matrix containing the time-frequency distribution.
%
%   SIGNAL
%
%       Output synthesised (complex) signal from given time-frequency distribution.
%
%   WINDOW LENGTH
%
%      Length of the smoothing window used in the given distribution (or in the case of
%      of the WVD the lag window length).
%
%   ANALYSIS TYPE
%
%      Specifies which type of signal synthesis will be applied to the given TFD
%      matrix. The following analysis types are valid:
%
%      (i) STFT:
%
%         (a) Inverse Discrete Fourier Transform method.
%         (b) Overlap-Add method.
%         (c) Modified Short-Time Fourier Transform method.
%
%      (ii) Spectrogram:
%
%         Modified Spectrogram method
%
%      (iii) Wigner Ville Distribution:
%
%         Wigner Ville Distribution method. The original signal can be
%         specified to correct the phase of the synthesised signal.
%
%
%
%  See Also:  wvd, spec

redpajama_set_name: RedPajamaGithub


text:
package com.javarush.test.level24.lesson06.home02;

import java.util.List;

/* Как избежать Copy+Paste
В классе Dog реализуйте логику метода toSayable, которая описана в джавадоке.
*/
class Solution {

  public static void main(String[] args) {
    List<Pet> pet = Util.getPets();
    List<Sayable> pets = Util.convertPetToSayable(pet);
    Util.printDialog(pets);
  }
}


text:
<?php
    require_once './library/config.php';

  ob_start();
   function dbCloseConnection($connName=null)
   {
       if ($connName)
       {
           $result=ibase_close($connName)
                or die("Eroare la inchiderea conexiunii Firebird. " .ibase_errmsg());
           return $result;
       }
        else
        {
            ibase_close() or die("Eroare la inchiderea conexiunii Firebird. " .ibase_errmsg());
        }
          // throw new Exception("Invalid connection!".  ibase_errmsg());
   }
   function dbSetTimeLimit($time)
   {
        set_time_limit($time);
   }
   function dbQuery($connection,$sql)
   {
       $result=  ibase_query($connection,$sql) or die(ibase_errmsg());
       return $result;
   }

   function dbAffectedRows($connection)
   {
       return ibase_affected_rows($connection);
   }

   function dbFetchArray($result,$resultType=IBASE_TEXT)
   {
       return ibase_fetch_row($result,$resultType);
   }
   function dbFetchAssoc($result,$resultType=IBASE_TEXT)
   {
       return ibase_fetch_assoc($result,$resultType);
   }
   function dbFetchObject($result,$resultType=IBASE_TEXT)
   {
       return ibase_fetch_object($result,$resultType);
   }

   function dbFreeResult($result)
   {
       return ibase_free_result($result);
   }

   function dbCommit($connection)
   {
       if ($connection)
        return ibase_commit($connection);
       else
           throw new Exception("Invalid connection!".  ibase_errmsg());
   }
   function dbTransaction($connection)
   {
       if ($connection)
        return ibase_trans();
       else
           throw new Exception("Invalid connection!".  ibase_errmsg());
   }
   function dbRollback($trans)
   {
       if ($trans)
        return ibase_rollback_ret($trans);
       else
           throw new Exception("Invalid transaction!".  ibase_errmsg());
   }

    function dbConnection(){
        $passwBaza=  base64_decode($GLOBALS["passwBaza"]);
        $result= ibase_connect($GLOBALS['path'],$GLOBALS['userBaza'], $passwBaza);
              // or die ('Eroare de conectare Firebird. '.  ibase_errmsg());
        if (!$result)
        {
            ob_end_clean();
           throw new Exception('Eroare de conectare Firebird. '.  ibase_errmsg());
        }
        return $result;
   }

   function dbLastErrorCode()
   {
       return ibase_errcode();
   }
   function dbLastErrorMsg()
   {
       return ibase_errmsg();
   }
     //---
   function dbColNum($result)
   {
       return ibase_num_fields($result);
   }
   function dbColInfo($result,$index)
   {
       return ibase_field_info($result, $index);
   }
   function dbColAttr($result,$index,$attrName='name')
   {
       $col_info = dbColInfo($result, $index);
       return $col_info[$attrName];
   }
   function dbColsAttr($result,$attrName='name')
   {
       /*$attrName - 'name'
        *          - 'alias'
        *          - 'relation'
        *          - 'length'
        *          - 'type'
        */
       $fieldData=  array();
       $coln = dbColNum($result);
       for ($i = 0; $i < $coln; $i++) {
           $col_info = dbColInfo($result, $i);
           array_push($fieldData, $col_info[$attrName]);
       }
       return $fieldData;
   }
   //---
?>


text:
function main(sources) {
  const click$ = sources.DOM;
  const sinks = {
    DOM: click$
    .startWith(null)
    .flatMapLatest(() =>
      Rx.Observable.timer(0, 1000)
      .map(i => `Seconds ${i}`)
    ),
    Log: Rx.Observable.timer(0, 2000).map(i => 2*i),
    Hot: click$
    .startWith(null)
  };
  return sinks;
}

function DOMDriver(text$) {
  text$.subscribe(text => {
    const container = document.querySelector('#app');
    container.textContent = text;
  });
  const DOMSource = Rx.Observable.fromEvent(document, 'click');
  return DOMSource;
}

function consoleLogDriver(msg$) {
  msg$.subscribe(msg => console.log(msg));
}

function HotDriver(data$) {
  data$.subscribe( temp => {
    var data1 = [
      ['', 'Tesla', 'Nissan', 'Toyota', 'Honda', 'Mazda', 'Ford'],
      ['2017', 10, 11, 12, 13, 15, 16],
    ];
    var container = document.getElementById('example');
    var hot = new Handsontable(container, {
      data: data1,
    });
  })
}

const drivers = {
  DOM: DOMDriver,
  Log: consoleLogDriver,
  Hot: HotDriver,
}

Cycle.run(main, drivers);


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<TITLE>
DigestPasswordHasher (ATG Java API)
</TITLE>

<META NAME="date" CONTENT="2013-04-01">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">

      Overview
      Package
    Class
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

atg.security

Class DigestPasswordHasher

java.lang.Object
  atg.security.DigestPasswordHasher

All Implemented Interfaces:
PasswordHasher, java.io.Serializable

public class DigestPasswordHasher
extends java.lang.Object
implements PasswordHasher

A password hasher that utilizes the java.security.MessageDigest
 mechanism for hashing passwords.

 After digestifying the password it is then encoded using the
 binary-to-text encoding scheme specified by the
 encoding property ("base16" by default).

 This hasher does not support one-time hashing (e.g. login passwords
 are encoded the same way every time).

See Also:
java.security.MessageDigest;,
Serialized Form

Field Summary

static java.lang.String
CLASS_VERSION

Constructor Summary

DigestPasswordHasher()

Method Summary

 boolean
checkPassword(java.lang.String pLoginPassword,
              java.lang.String pEncryptedPassword,
              java.lang.Object pHashKey)

          Returns true if the login password matches the encrypted password.

 java.lang.String
encryptPassword(java.lang.String pPassword)

          Encrypts a password suitable for long-term storage.

 java.lang.String
getAlgorithm()

          Returns the name of the digestifying algorithm used by this
 password hasher.

 java.lang.String
getEncoding()

          Returns the name of the encoding scheme used to convert the encrypted
 password into a string.

 PasswordHasher
getLoginPasswordHasher()

          Returns a password hasher instance useful for performing a login.

 java.lang.Object
getPasswordHashKey()

          Returns the hash key (if any) that was used for hashing the
 password for login.

 java.lang.String
hashPasswordForLogin(java.lang.String pPassword)

          Performs the appropriate hashing function for a login process.

 void
setAlgorithm(java.lang.String pAlgorithm)

          Changes the name of the digestifying algorithm used by this
 password hasher.

 void
setEncoding(java.lang.String pMethod)

          Changes the encoding scheme used to convert the encrypted password
 into a string.

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION

Constructor Detail

DigestPasswordHasher

public DigestPasswordHasher()

Method Detail

getAlgorithm

public java.lang.String getAlgorithm()

Returns the name of the digestifying algorithm used by this
 password hasher.

setAlgorithm

public void setAlgorithm(java.lang.String pAlgorithm)

Changes the name of the digestifying algorithm used by this
 password hasher.

getEncoding

public java.lang.String getEncoding()

Returns the name of the encoding scheme used to convert the encrypted
 password into a string.

See Also:
BinaryToTextEncoders

setEncoding

public void setEncoding(java.lang.String pMethod)

Changes the encoding scheme used to convert the encrypted password
 into a string.

See Also:
BinaryToTextEncoders

encryptPassword

public java.lang.String encryptPassword(java.lang.String pPassword)

Encrypts a password suitable for long-term storage.

Specified by:
encryptPassword in interface PasswordHasher

checkPassword

public boolean checkPassword(java.lang.String pLoginPassword,
                             java.lang.String pEncryptedPassword,
                             java.lang.Object pHashKey)

Returns true if the login password matches the encrypted password.

Specified by:
checkPassword in interface PasswordHasher

hashPasswordForLogin

public java.lang.String hashPasswordForLogin(java.lang.String pPassword)

Performs the appropriate hashing function for a login process.
 This value will later be passed to checkPassword().

Specified by:
hashPasswordForLogin in interface PasswordHasher

getPasswordHashKey

public java.lang.Object getPasswordHashKey()

Returns the hash key (if any) that was used for hashing the
 password for login.  This must be passed to checkPassword() to
 verify the validity of the hash.

Specified by:
getPasswordHashKey in interface PasswordHasher

getLoginPasswordHasher

public PasswordHasher getLoginPasswordHasher()

Returns a password hasher instance useful for performing a login.  This
 instance may have a unique password hash key so that each login attempt
 is hashed differently.

Specified by:
getLoginPasswordHasher in interface PasswordHasher

      Overview
      Package
    Class
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD


text:
//go:build e2e
// +build e2e

package e2e

import (
	"testing"

	"knative.dev/operator/test"
	"knative.dev/operator/test/client"
	"knative.dev/operator/test/resources"
)

// TestKnativeServingDeployment verifies the KnativeServing creation, deployment recreation, and KnativeServing deletion.
func TestKnativeServingDeployment(t *testing.T) {
	clients := client.Setup(t)

	names := test.ResourceNames{
		KnativeServing: test.OperatorName,
		Namespace:      test.ServingOperatorNamespace,
	}

	test.CleanupOnInterrupt(func() { test.TearDown(clients, names) })
	defer test.TearDown(clients, names)

	// Create a KnativeServing
	if _, err := resources.EnsureKnativeServingExists(clients.KnativeServing(), names); err != nil {
		t.Fatalf("KnativeService %q failed to create: %v", names.KnativeServing, err)
	}

	// Test if KnativeServing can reach the READY status
	t.Run("create", func(t *testing.T) {
		resources.AssertKSOperatorCRReadyStatus(t, clients, names)
	})

	t.Run("configure", func(t *testing.T) {
		resources.AssertKSOperatorCRReadyStatus(t, clients, names)
		resources.KSOperatorCRVerifyConfiguration(t, clients, names)
	})

	// Delete the deployments one by one to see if they will be recreated.
	t.Run("restore", func(t *testing.T) {
		resources.AssertKSOperatorCRReadyStatus(t, clients, names)
		resources.DeleteAndVerifyDeployments(t, clients, names)
	})

	// Delete the KnativeServing to see if all resources will be removed
	t.Run("delete", func(t *testing.T) {
		resources.AssertKSOperatorCRReadyStatus(t, clients, names)
		resources.KSOperatorCRDelete(t, clients, names)
	})
}


text:
package packp

import (
	"bytes"
	"io"
	"sort"

	"srcd.works/go-git.v4/plumbing"
	"srcd.works/go-git.v4/plumbing/format/pktline"
	"srcd.works/go-git.v4/plumbing/protocol/packp/capability"
)

// Encode writes the AdvRefs encoding to a writer.
//
// All the payloads will end with a newline character. Capabilities,
// references and shallows are written in alphabetical order, except for
// peeled references that always follow their corresponding references.
func (a *AdvRefs) Encode(w io.Writer) error {
	e := newAdvRefsEncoder(w)
	return e.Encode(a)
}

type advRefsEncoder struct {
	data *AdvRefs         // data to encode
	pe   *pktline.Encoder // where to write the encoded data
	err  error            // sticky error
}

func newAdvRefsEncoder(w io.Writer) *advRefsEncoder {
	return &advRefsEncoder{
		pe: pktline.NewEncoder(w),
	}
}

func (e *advRefsEncoder) Encode(v *AdvRefs) error {
	e.data = v

	for state := encodePrefix; state != nil; {
		state = state(e)
	}

	return e.err
}

type encoderStateFn func(*advRefsEncoder) encoderStateFn

func encodePrefix(e *advRefsEncoder) encoderStateFn {
	for _, p := range e.data.Prefix {
		if bytes.Equal(p, pktline.Flush) {
			if e.err = e.pe.Flush(); e.err != nil {
				return nil
			}
			continue
		}
		if e.err = e.pe.Encodef("%s\n", string(p)); e.err != nil {
			return nil
		}
	}

	return encodeFirstLine
}

// Adds the first pkt-line payload: head hash, head ref and capabilities.
// Also handle the special case when no HEAD ref is found.
func encodeFirstLine(e *advRefsEncoder) encoderStateFn {
	head := formatHead(e.data.Head)
	separator := formatSeparator(e.data.Head)
	capabilities := formatCaps(e.data.Capabilities)

	if e.err = e.pe.Encodef("%s %s\x00%s\n", head, separator, capabilities); e.err != nil {
		return nil
	}

	return encodeRefs
}

func formatHead(h *plumbing.Hash) string {
	if h == nil {
		return plumbing.ZeroHash.String()
	}

	return h.String()
}

func formatSeparator(h *plumbing.Hash) string {
	if h == nil {
		return noHead
	}

	return head
}

func formatCaps(c *capability.List) string {
	if c == nil {
		return ""
	}

	return c.String()
}

// Adds the (sorted) refs: hash SP refname EOL
// and their peeled refs if any.
func encodeRefs(e *advRefsEncoder) encoderStateFn {
	refs := sortRefs(e.data.References)
	for _, r := range refs {
		hash, _ := e.data.References[r]
		if e.err = e.pe.Encodef("%s %s\n", hash.String(), r); e.err != nil {
			return nil
		}

		if hash, ok := e.data.Peeled[r]; ok {
			if e.err = e.pe.Encodef("%s %s^{}\n", hash.String(), r); e.err != nil {
				return nil
			}
		}
	}

	return encodeShallow
}

func sortRefs(m map[string]plumbing.Hash) []string {
	ret := make([]string, 0, len(m))
	for k := range m {
		ret = append(ret, k)
	}
	sort.Strings(ret)

	return ret
}

// Adds the (sorted) shallows: "shallow" SP hash EOL
func encodeShallow(e *advRefsEncoder) encoderStateFn {
	sorted := sortShallows(e.data.Shallows)
	for _, hash := range sorted {
		if e.err = e.pe.Encodef("shallow %s\n", hash); e.err != nil {
			return nil
		}
	}

	return encodeFlush
}

func sortShallows(c []plumbing.Hash) []string {
	ret := []string{}
	for _, h := range c {
		ret = append(ret, h.String())
	}
	sort.Strings(ret)

	return ret
}

func encodeFlush(e *advRefsEncoder) encoderStateFn {
	e.err = e.pe.Flush()
	return nil
}


text:
import unittest
import json

class TestBase(unittest.TestCase):
    def setUp(self):
        pass

    def print_dict(self, value):
        print json.dumps(value.symbol_table, indent=2)


text:
static const char *DEFAULT_ROOT_DIRECTORY = ".";

int accept_socket_fd;
int request_socket_fd;

void sigint_handler() {
  if (accept_socket_fd) {
    close(accept_socket_fd);
  }

  if (request_socket_fd) {
    close(request_socket_fd);
  }

  exit(0);
}

void init_signal() {
  struct sigaction sa_sigint;
  memset(&sa_sigint, 0, sizeof(sa_sigint));
  sa_sigint.sa_handler = sigint_handler;
  sa_sigint.sa_flags = SA_RESTART;
  if (sigaction(SIGINT, &sa_sigint, NULL) < 0) {
    perror("Failed to bind sigaction\n");
    exit(1);
  }
  signal(SIGPIPE, SIG_IGN);
}

int main(int argc, char **argv) {
  if (argc < 2) {
    puts("Usage: /path/to/binary *port root_file_directory");
    exit(1);
  }
  char *root_directory =
      (char *)calloc(ROOT_DIRECTORY_STRING_LENGTH, sizeof(char));
  if (argc == 3) {
    strcpy(root_directory, argv[2]);
  } else {
    strcpy(root_directory, DEFAULT_ROOT_DIRECTORY);
  }

  init_signal();

  request_socket_fd = socket(PF_INET, SOCK_STREAM, 0);
  if (request_socket_fd < 0) {
    perror("Failed to create socket\n");
    exit(1);
  }

  struct sockaddr_in server_address;
  memset(&server_address, 0, sizeof(server_address));
  server_address.sin_family = PF_INET;
  server_address.sin_port = htons(atoi(argv[1]));

  int bind_result = bind(request_socket_fd, (struct sockaddr *)&server_address,
                         sizeof(struct sockaddr_in));
  if (bind_result < 0) {
    perror("Failed to bind\n");
    exit(1);
  }

  int listen_result = listen(request_socket_fd, 5);
  if (listen_result < 0) {
    perror("Failed to listen\n");
    exit(1);
  }

  struct sockaddr_in client_address;
  memset(&client_address, 0, sizeof(client_address));

  socklen_t len = sizeof(client_address);
  char *raw_message =
      (char *)calloc(REQUEST_MESSAGE_STRING_LENGTH, sizeof(char));

  int raw_message_size = 0;
  while (1) {
    int accept_socket_fd =
        accept(request_socket_fd, (struct sockaddr *)&client_address, &len);
    if (accept_socket_fd < 0) {
      close(request_socket_fd);
      perror("Failed to accept\n");
      exit(1);
    }

    while (1) {
      raw_message_size = recv(accept_socket_fd, raw_message, 1024, 0);
      if (!raw_message_size || raw_message_size < 0) {
        close(accept_socket_fd);
        break;
      }

      respond(raw_message, root_directory, accept_socket_fd);
    }
    memset(raw_message, 0, REQUEST_MESSAGE_STRING_LENGTH);
  }

  free(root_directory);
  free(raw_message);
  return (0);
}


text:
package org.omarket.trading;

import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import lombok.extern.slf4j.Slf4j;
import org.omarket.quotes.Security;
import rx.Observable;

import java.io.BufferedWriter;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.FileSystems;
import java.nio.file.FileVisitResult;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.PathMatcher;
import java.nio.file.SimpleFileVisitor;
import java.nio.file.StandardOpenOption;
import java.nio.file.attribute.BasicFileAttributes;
import java.util.LinkedList;
import java.util.List;
import java.util.stream.Collectors;

@Slf4j
public class ContractDBServiceImpl implements ContractDBService {

    @Override
    public final ContractFilter filterCurrency(String currencyCode) {
        return new ContractFilter() {
            @Override
            protected boolean accept(String content) {
                return getCurrency().equals(currencyCode);
            }
        };
    }

    @Override
    public final ContractFilter filterExchange(String exchangeCode) {
        return new ContractFilter() {
            @Override
            protected boolean accept(String content) {
                return getPrimaryExchange().equals(exchangeCode);
            }
        };
    }

    @Override
    public final ContractFilter filterSecurityType(String securityType) {
        return new ContractFilter() {
            @Override
            protected boolean accept(String content) {
                return getSecurityType().equals(securityType);
            }
        };
    }

    @Override
    public ContractFilter composeFilter(ContractFilter... filters) {
        return new ContractFilter() {

            @Override
            protected String prepare(Path path) throws IOException {
                int count = path.getNameCount();
                for (ContractFilter filter : filters) {
                    filter.prepare(path);
                    filter.setFilename(path.getFileName());
                    filter.setPrimaryExchange(path.getName(count - 3));
                    filter.setCurrency(path.getName(count - 4));
                    filter.setSecurityType(path.getName(count - 5));
                }
                return super.prepare(path);
            }

            @Override
            protected boolean accept(String content) {
                boolean accepted = true;
                for (ContractFilter filter : filters) {
                    if (!filter.accept(content)) {
                        accepted = false;
                        break;
                    }
                }
                return accepted;
            }
        };
    }

    @Override
    public Security loadContract(Path contractsDirPath, String productCode) throws IOException {
        final Path[] targetFile = new Path[1];
        Files.walkFileTree(contractsDirPath, new SimpleFileVisitor<Path>() {
            @Override
            public FileVisitResult visitFile(Path file, BasicFileAttributes attrs)
                    throws IOException {
                if (file.getFileName().toString().equals(productCode + ".json")) {
                    targetFile[0] = file;
                    return FileVisitResult.TERMINATE;
                } else {
                    return FileVisitResult.CONTINUE;
                }
            }
        });
        Path descriptionFilePath = targetFile[0];
        if (descriptionFilePath == null) {
            throw new IOException("missing data for contract: " + productCode);
        }
        String content = Files.lines(descriptionFilePath, StandardCharsets.UTF_8).collect(Collectors.joining());
        JsonParser parser = new JsonParser();
        JsonObject jsonSecurity = parser.parse(content).getAsJsonObject();
        return Security.fromJson(jsonSecurity);
    }

    @Override
    public void saveContract(Path contractsDirPath, Security product) throws IOException {
        String primaryExchange = product.getExchange();
        String securityType = product.getSecurityType();
        String currency = product.getCurrency();
        String fileBaseName = product.getCode();
        String fileName = fileBaseName + ".json";
        Path exchangePath = contractsDirPath.resolve(securityType).resolve(currency).resolve(primaryExchange);
        String initials;
        if (fileBaseName.length() < 3) {
            initials = fileBaseName;
        } else {
            initials = fileBaseName.substring(0, 3);
        }
        Path targetPath = exchangePath.resolve(initials);
        if (Files.notExists(targetPath)) {
            Files.createDirectories(targetPath);
        }
        Path filePath = targetPath.resolve(fileName);
        if (Files.notExists(filePath)) {
            Files.createFile(filePath);
        }
        BufferedWriter writer = Files.newBufferedWriter(filePath, StandardCharsets.UTF_8, StandardOpenOption.TRUNCATE_EXISTING);
        writer.write(product.toJson());
        writer.close();
        log.info("saved contract: " + filePath);
    }

    @Override
    public Observable<Security> loadContracts(Path contractsDirPath, ContractFilter filter) throws IOException {
        List<Security> contracts = new LinkedList<>();
        Files.walkFileTree(contractsDirPath, new SimpleFileVisitor<Path>() {
            @Override
            public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
                PathMatcher matcher = FileSystems.getDefault().getPathMatcher("glob:*.json");
                if (!matcher.matches(file.getFileName())) {
                    return FileVisitResult.CONTINUE;
                }
                String content = filter.prepare(file);
                if (filter.accept(content)) {
                    JsonParser parser = new JsonParser();
                    JsonObject jsonContract = parser.parse(content).getAsJsonObject();
                    contracts.add(Security.fromJson(jsonContract));
                    log.debug("added contract: {}", jsonContract);
                }
                return FileVisitResult.CONTINUE;
            }
        });
        return Observable.from(contracts);
    }

}


text:
<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Vote extends Model
{
    public function user() {
    	return $this->belongsTo('App\User');
    }

    public function review() {
    	return $this->belongsTo('App\Review');
    }
}


text:
package org.apache.rave.model;

import javax.xml.bind.annotation.XmlTransient;
import java.sql.Timestamp;
import java.util.Collection;
import java.util.List;

/**
 * Created by Dahyna Guzman on 29/8/2014.
 */
@XmlTransient
public interface Tournament {

    public Long getEntityId();

    public void setEntityId(Long entityId);

    public String getName();

    public void setName(String name);

    public Timestamp getInitialDate();

    public void setInitialDate(Timestamp initialDate);

    public Timestamp getFinalDate();

    public void setFinalDate(Timestamp finalDate);

    public Cities getCitiesByCitiesId();

    public void setCitiesByCitiesId(Cities citiesByCitiesId);

    public CategoriesTournament getCategoriesTournamentByCategoryTournamentId();

    public void setCategoriesTournamentByCategoryTournamentId(CategoriesTournament categoriesTournamentByCategoryTournamentId);

    public Collection<PlayerHasTournament> getPlayerHasTournaments();

    public void setPlayerHasTournaments(Collection<PlayerHasTournament> playerHasTournaments);

    public String getFormatInitialDate();

    public String getFormatFinalDate();

    public TournamentStatus getTournamentStatus();

    public void setTournamentStatus(TournamentStatus tournamentStatus);

    public String getDescription();

    public void setDescription(String description);

}


text:
package org.vertexium.elasticsearch5.plugin;

import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.index.Term;
import org.apache.lucene.queryparser.classic.MapperQueryParser;
import org.apache.lucene.queryparser.classic.ParseException;
import org.apache.lucene.search.DisjunctionMaxQuery;
import org.apache.lucene.search.Query;
import org.apache.lucene.util.BytesRef;
import org.elasticsearch.index.query.QueryShardContext;

import java.util.ArrayList;
import java.util.List;
import java.util.function.Function;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class VertexiumMapperQueryParser extends MapperQueryParser {
    private static final Pattern PROPERTY_NAME_PATTERN = Pattern.compile("^(.*?)(_([0-9a-f]{32}))?(_([a-z]))?$");
    public static final String FIELDNAME_DOT_REPLACEMENT = "-_-";

    private final String[] authorizations;
    private final FieldNameToVisibilityMap fieldNameToVisibilityMap;

    public VertexiumMapperQueryParser(QueryShardContext context, String[] authorizations, FieldNameToVisibilityMap fieldNameToVisibilityMap) {
        super(context);
        this.authorizations = authorizations;
        this.fieldNameToVisibilityMap = fieldNameToVisibilityMap;
    }

    @Override
    protected Query newRegexpQuery(Term regexp) {
        return createQuery(regexp, (term) -> super.newRegexpQuery(term));
    }

    @Override
    protected Query newWildcardQuery(Term t) {
        return createQuery(t, (term) -> super.newWildcardQuery(term));
    }

    @Override
    protected Query newPrefixQuery(Term prefix) {
        return createQuery(prefix, (term) -> super.newPrefixQuery(term));
    }

    @Override
    protected Query newFuzzyQuery(Term term, float minimumSimilarity, int prefixLength) {
        return createQuery(term, (t) -> super.newFuzzyQuery(t, minimumSimilarity, prefixLength));
    }

    @Override
    protected Query newRangeQuery(String field, String part1, String part2, boolean startInclusive, boolean endInclusive) {
        return createQuery(field, (fieldName) -> super.newRangeQuery(fieldName, part1, part2, startInclusive, endInclusive));
    }

    @Override
    protected Query newFieldQuery(Analyzer analyzer, String field, String queryText, boolean quoted) throws ParseException {
        try {
            return createQuery(field, (fieldName) -> {
                try {
                    return super.newFieldQuery(analyzer, fieldName, queryText, quoted);
                } catch (ParseException e) {
                    throw new RuntimeException("could not create field query", e);
                }
            });
        } catch (RuntimeException ex) {
            if (ex.getCause() != null && ex.getCause() instanceof ParseException) {
                throw (ParseException) ex.getCause();
            }
            throw ex;
        }
    }

    private Query createQuery(Term term, Function<Term, Query> fn) {
        String field = term.field();
        BytesRef value = term.bytes();
        return createQuery(field, (fieldName) -> fn.apply(new Term(fieldName, value)));
    }

    private Query createQuery(String field, Function<String, Query> fn) {
        field = field.replace(".", FIELDNAME_DOT_REPLACEMENT);

        if (field.length() == 0) {
            return fn.apply(field);
        }

        Matcher m = PROPERTY_NAME_PATTERN.matcher(field);
        if (m.matches() && m.group(2) != null) {
            String visibility = fieldNameToVisibilityMap.getFieldVisibility(field);
            if (visibility != null && VisibilityUtils.canRead(visibility, authorizations)) {
                return fn.apply(field);
            }
            return null;
        }

        String fieldPrefix = field + "_";
        List<Query> disjucts = new ArrayList<>();
        for (String fieldName : fieldNameToVisibilityMap.getFieldNames()) {
            if (fieldName.startsWith(fieldPrefix)) {
                String visibility = fieldNameToVisibilityMap.getFieldVisibility(fieldName);
                if (visibility != null && VisibilityUtils.canRead(visibility, authorizations)) {
                    Query termQuery = fn.apply(fieldName);
                    disjucts.add(termQuery);
                }
            }
        }
        DisjunctionMaxQuery query = new DisjunctionMaxQuery(disjucts, 0.0f);

        if (query.getDisjuncts().size() == 0) {
            return fn.apply(field);
        }

        return query;
    }
}


text:
// flowlint ambiguous-object-type:error

'use strict';

const invariant = require('invariant');

const {getType} = require('./RelayModernRecord');

import type {ReactFlightPayloadData} from '../network/RelayNetworkTypes';
import type {ReactFlightClientResponse, Record} from './RelayStoreTypes';

// Reachable (client) executable definitions encountered while server component
// rendering
const REACT_FLIGHT_EXECUTABLE_DEFINITIONS_STORAGE_KEY = 'executableDefinitions';
const REACT_FLIGHT_TREE_STORAGE_KEY = 'tree';
const REACT_FLIGHT_TYPE_NAME = 'ReactFlightComponent';

function refineToReactFlightPayloadData(
  payload: mixed,
): ?ReactFlightPayloadData {
  if (
    payload == null ||
    typeof payload !== 'object' ||
    typeof payload.status !== 'string' ||
    (!Array.isArray(payload.tree) && payload.tree !== null) ||
    !Array.isArray(payload.queries) ||
    !Array.isArray(payload.fragments) ||
    !Array.isArray(payload.errors)
  ) {
    return null;
  }
  return (payload: $FlowFixMe);
}

function getReactFlightClientResponse(
  record: Record,
): ?ReactFlightClientResponse {
  invariant(
    getType(record) === REACT_FLIGHT_TYPE_NAME,
    'getReactFlightClientResponse(): Expected a ReactFlightComponentRecord, ' +
      'got %s.',
    record,
  );
  const response: ?ReactFlightClientResponse = (record[
    REACT_FLIGHT_TREE_STORAGE_KEY
  ]: $FlowFixMe);
  if (response != null) {
    return response;
  }
  return null;
}

module.exports = {
  REACT_FLIGHT_EXECUTABLE_DEFINITIONS_STORAGE_KEY,
  REACT_FLIGHT_TREE_STORAGE_KEY,
  REACT_FLIGHT_TYPE_NAME,
  getReactFlightClientResponse,
  refineToReactFlightPayloadData,
};


text:
namespace base {
class SequencedTaskRunner;
}  // namespace base

namespace media {
class AudioBus;
}  // namespace media

namespace net {
class IOBuffer;
}  // namespace net

namespace chromecast {
class IOBufferPool;

namespace media {
class RateAdjuster;
class StreamMixer;

namespace mixer_service {
class Generic;
class OutputStreamParams;
}  // namespace mixer_service

// A mixer source that receives audio data from a mixer service connection and
// buffers/fades it as requested before feeding it to the mixer. Must be created
// on an IO thread. This class manages its own lifetime and should not be
// externally deleted.
class MixerInputConnection : public mixer_service::MixerSocket::Delegate,
                             public MixerInput::Source {
 public:
  using RenderingDelay = MediaPipelineBackend::AudioDecoder::RenderingDelay;

  MixerInputConnection(StreamMixer* mixer,
                       std::unique_ptr<mixer_service::MixerSocket> socket,
                       const mixer_service::OutputStreamParams& params);

  MixerInputConnection(const MixerInputConnection&) = delete;
  MixerInputConnection& operator=(const MixerInputConnection&) = delete;

  // Only public to allow task_runner->DeleteSoon() to work.
  ~MixerInputConnection() override;

 private:
  friend class MixerServiceReceiver;
  class TimestampedFader;

  enum class State {
    kUninitialized,   // Not initialized by the mixer yet.
    kNormalPlayback,  // Normal playback.
    kGotEos,          // Got the end-of-stream buffer (normal playback).
    kSignaledEos,     // Sent EOS signal up to delegate.
    kRemoved,         // The caller has removed this source; finish playing out.
  };

  // mixer_service::MixerSocket::Delegate implementation:
  bool HandleMetadata(const mixer_service::Generic& message) override;
  bool HandleAudioData(char* data, size_t size, int64_t timestamp) override;
  bool HandleAudioBuffer(scoped_refptr<net::IOBuffer> buffer,
                         char* data,
                         size_t size,
                         int64_t timestamp) override;
  void OnConnectionError() override;

  void CreateBufferPool(int frame_count);
  void OnInactivityTimeout();
  void RestartPlaybackAt(int64_t timestamp, int64_t pts);
  void SetMediaPlaybackRate(double rate);
  void SetMediaPlaybackRateLocked(double rate) EXCLUSIVE_LOCKS_REQUIRED(lock_);
  void SetAudioClockRate(double rate);
  double ChangeAudioRate(double desired_clock_rate,
                         double error_slope,
                         double current_error) EXCLUSIVE_LOCKS_REQUIRED(lock_);
  void AdjustTimestamps(int64_t timestamp_adjustment);
  void SetPaused(bool paused);

  // MixerInput::Source implementation:
  size_t num_channels() const override;
  ::media::ChannelLayout channel_layout() const override;
  int sample_rate() const override;
  bool primary() override;
  const std::string& device_id() override;
  AudioContentType content_type() override;
  AudioContentType focus_type() override;
  int desired_read_size() override;
  int playout_channel() override;
  bool active() override;
  bool require_clock_rate_simulation() const override;

  void InitializeAudioPlayback(int read_size,
                               RenderingDelay initial_rendering_delay) override;
  int FillAudioPlaybackFrames(int num_frames,
                              RenderingDelay rendering_delay,
                              ::media::AudioBus* buffer) override;
  void OnAudioPlaybackError(MixerError error) override;
  void OnOutputUnderrun() override;
  void FinalizeAudioPlayback() override;

  int FillAudio(int num_frames,
                int64_t expected_playout_time,
                float* const* channels,
                bool after_silence) EXCLUSIVE_LOCKS_REQUIRED(lock_);
  int FillTimestampedAudio(int num_frames,
                           int64_t expected_playout_time,
                           float* const* channels,
                           bool after_silence) EXCLUSIVE_LOCKS_REQUIRED(lock_);
  int FillFromQueue(int num_frames, float* const* channels, int write_offset)
      EXCLUSIVE_LOCKS_REQUIRED(lock_);
  void LogUnderrun(int num_frames, int filled) EXCLUSIVE_LOCKS_REQUIRED(lock_);

  void WritePcm(scoped_refptr<net::IOBuffer> data);
  RenderingDelay QueueData(scoped_refptr<net::IOBuffer> data)
      EXCLUSIVE_LOCKS_REQUIRED(lock_);
  double ExtraDelayFrames() EXCLUSIVE_LOCKS_REQUIRED(lock_);

  void RemoveSelf() EXCLUSIVE_LOCKS_REQUIRED(lock_);
  void PostPcmCompletion();
  void PostEos();
  void PostError(MixerError error);
  void PostStreamUnderrun();
  void PostOutputUnderrun();
  void PostAudioReadyForPlayback();
  void DropAudio(int64_t frames) EXCLUSIVE_LOCKS_REQUIRED(lock_);
  void CheckAndStartPlaybackIfNecessary(int num_frames,
                                        int64_t playback_absolute_timestamp)
      EXCLUSIVE_LOCKS_REQUIRED(lock_);

  StreamMixer* const mixer_;
  std::unique_ptr<mixer_service::MixerSocket> socket_;

  const bool ignore_for_stream_count_;
  const int fill_size_;
  const int algorithm_fill_size_;
  const int num_channels_;
  const ::media::ChannelLayout channel_layout_;
  const int input_samples_per_second_;
  const audio_service::SampleFormat sample_format_;
  const bool primary_;
  const std::string device_id_;
  const AudioContentType content_type_;
  const AudioContentType focus_type_;
  const int playout_channel_;
  const bool pts_is_timestamp_;
  const int64_t max_timestamp_error_;
  const bool never_crop_;
  const bool enable_audio_clock_simulation_;

  std::atomic<int> effective_playout_channel_;

  const scoped_refptr<base::SequencedTaskRunner> io_task_runner_;
  int max_queued_frames_;
  // Minimum number of frames buffered before starting to fill data.
  int start_threshold_frames_;
  int min_start_threshold_;

  scoped_refptr<IOBufferPool> buffer_pool_;

  // Only used on the IO thread.
  bool audio_ready_for_playback_fired_ = false;
  bool never_timeout_connection_ = false;
  base::OneShotTimer inactivity_timer_;
  bool connection_error_ = false;
  int buffer_pool_frames_ = 0;

  base::Lock lock_;
  State state_ GUARDED_BY(lock_) = State::kUninitialized;
  bool paused_ GUARDED_BY(lock_) = false;
  bool mixer_error_ GUARDED_BY(lock_) = false;
  scoped_refptr<net::IOBuffer> pending_data_ GUARDED_BY(lock_);
  base::circular_deque<scoped_refptr<net::IOBuffer>> queue_ GUARDED_BY(lock_);
  int queued_frames_ GUARDED_BY(lock_) = 0;
  RenderingDelay mixer_rendering_delay_ GUARDED_BY(lock_);
  RenderingDelay next_delay_ GUARDED_BY(lock_);
  int mixer_read_size_ GUARDED_BY(lock_) = 0;
  int current_buffer_offset_ GUARDED_BY(lock_) = 0;
  std::unique_ptr<RateAdjuster> rate_adjuster_ GUARDED_BY(lock_);
  int64_t total_filled_frames_ GUARDED_BY(lock_) = 0;
  bool filled_some_since_resume_ GUARDED_BY(lock_) = false;
  const int fade_frames_;
  std::unique_ptr<TimestampedFader> timestamped_fader_ GUARDED_BY(lock_);
  PlaybackRateShifter rate_shifter_ GUARDED_BY(lock_);
  bool in_underrun_ GUARDED_BY(lock_) = false;
  bool started_ GUARDED_BY(lock_) = false;
  double playback_rate_ GUARDED_BY(lock_) = 1.0;
  bool use_start_timestamp_ GUARDED_BY(lock_) = false;
  // The absolute timestamp relative to clock monotonic (raw) at which the
  // playback should start. INT64_MIN indicates playback should start ASAP.
  // INT64_MAX indicates playback should start at a specified timestamp,
  // but we don't know what that timestamp is.
  int64_t playback_start_timestamp_ GUARDED_BY(lock_) = INT64_MIN;
  // The PTS the playback should start at. We will drop audio pushed to us
  // with PTS values below this value. If the audio doesn't have a starting
  // PTS, then this value can be INT64_MIN, to play whatever audio is sent
  // to us.
  int64_t playback_start_pts_ GUARDED_BY(lock_) = INT64_MIN;
  int remaining_silence_frames_ GUARDED_BY(lock_) = 0;
  bool fed_one_silence_buffer_after_removal_ GUARDED_BY(lock_) = false;
  bool removed_self_ GUARDED_BY(lock_) = false;

  base::RepeatingClosure pcm_completion_task_;
  base::RepeatingClosure eos_task_;
  base::RepeatingClosure ready_for_playback_task_;
  base::RepeatingClosure post_stream_underrun_task_;

  base::WeakPtr<MixerInputConnection> weak_this_;
  base::WeakPtrFactory<MixerInputConnection> weak_factory_;
};

}  // namespace media
}  // namespace chromecast

#endif  // CHROMECAST_MEDIA_CMA_BACKEND_MIXER_MIXER_INPUT_CONNECTION_H_


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NBouncer.Tools
{

    public static class StringEx
    {
        // Biztos, h van erre vmi a .NET FW-ben
        public static string Repeat(this string str, int count)
        {
            var sb = new StringBuilder(count * str.Length);

            for (int i = 0; i < count; i++)
            {
                sb.Append(str);
            }

            return sb.ToString();
        }

        private static UTF8Encoding s_utf8Encoding = new UTF8Encoding();

        public static byte[] ToByteArray(this string str)
        {
            if (str == null)
                return new byte[1] { 0 };

            var lg = s_utf8Encoding.GetByteCount(str);
            var b = new byte[lg + 1];

            b[0] = 1;
            s_utf8Encoding.GetBytes(str, 0, str.Length, b, 1);

            return b;
        }

        public static string RemoveWhitespaces(this string s)
        {
            var str = s
                .Replace('\u00a0', ' ')
                .Replace('\t', ' ')
                .Replace("\r", "")
                .Replace('\n', ' ').Trim();

            while (str.IndexOf("  ") != -1)
            {
                str = str.Replace("  ", " ");
            }

            return str;
        }

        public static int ContainsCount(this string s, char ch)
        {
            if (s.Length == 0)
                return 0;

            int count = 0;

            foreach (var c in s)
            {
                if (c == ch)
                    count++;
            }

            return count;
        }

        public static string[] Split(this string str, char c)
        {
            return str.Split(new char[] { c }, StringSplitOptions.None);
        }

        public static string[] Split(this string str, char c, int count)
        {
            return str.Split(new char[] { c }, count, StringSplitOptions.None);
        }

        public static string[] Split(this string str, string s)
        {
            return str.Split(new string[] { s }, StringSplitOptions.None);
        }

        public static string[] Split(this string str, string s, int count)
        {
            return str.Split(new string[] { s }, count, StringSplitOptions.None);
        }

        public static string Maximize(this string t, int maxlength)
        {
            if (t.Length > maxlength)
                return t.Substring(0, maxlength - 2) + "..";

            return t;
        }

        public static string F(this string t, object arg)
        {
            return string.Format(t, arg);
        }

        public static string F(this string t, object arg1, object arg2)
        {
            return string.Format(t, arg1, arg2);
        }

        public static string F(this string t, object arg1, object arg2, object arg3)
        {
            return string.Format(t, arg1, arg2, arg3);
        }

        public static string FirstLine(this string t)
        {
            if (t == null)
                return null;

            if (t.Contains("\n"))
            {
                return t.Substring(0, t.IndexOf("\n") - 1);
            }
            else
            {
                return t;
            }
        }
    }
}


text:
/*!
 * jQuery Planner V.1.0.0
 * by Abdul HK
 */
.jplanner-table{
	border-collapse:collapse;
}
.jplanner-table>thead>tr>td,
.jplanner-table>tbody>tr>td,
.jplanner-table>thead>tr>th,
.jplanner-table>tbody>tr>th{
	padding: 5px;
	vertical-align: top;
	border-bottom: 1px solid #ddd;
	min-width:10px;
}
.jplanner-plan{
	position:absolute;
	width:300px;
	top:auto;
	left:0px;
}
.jplanner-event{

}
.jplanner-event > span.j-event-tooltip{
	width: 300px;
    padding: 10px 20px;
    margin-top: 0;
    margin-left: -120px;
    opacity: 0;
    visibility: hidden;
    z-index: 10;
    position: absolute;
    font-family: Arial;
    font-size: 12px;
    font-style: normal;
    border-radius: 3px;
    box-shadow: 2px 2px 2px #999;
	/*
    -webkit-transition-property: opacity, margin-top, visibility, margin-left;
    -webkit-transition-duration: 0.4s, 0.3s, 0.4s, 0.3s;
    -webkit-transition-timing-function: ease-in-out, ease-in-out, ease-in-out, ease-in-out;
    transition-property: opacity, margin-top, visibility, margin-left;
    transition-duration: 0.4s, 0.3s, 0.4s, 0.3s;
    transition-timing-function: ease-in-out, ease-in-out, ease-in-out, ease-in-out;
	*/
}
.jplanner-event:hover > span.j-event-tooltip{
	opacity: 1;
    text-decoration: none;
    visibility: visible;
    overflow: visible;
    margin-top: 30px;
    display: inline;
    margin-left: -90px;
}
span.j-event-tooltip{
	color:#ffffff;
	background-color: RGBA(77,77,77,0.8);
}
span.j-event-tooltip b {
    width: 0;
	height: 0;
	border-style: solid;
	border-width: 0 15px 15px 15px;
	border-color: transparent transparent RGBA(77,77,77,0.8) transparent;
	margin-left: 45px;
    margin-top: -25px;
    display: block;
    position: absolute;
}
.jplanner-container{
	overflow-x:scroll;
	overflow-y:visible;
	width:inherit;
	margin-left:305px;
	padding-bottom:1px;
	height:auto;
	border-right:1px solid #ddd;
	border-left:1px solid #ddd;
}
.jplanner-today{
	border-left:1px solid #ff0000;
}


text:
package de.mrapp.android.dialog.animation;

import android.content.Context;
import android.view.animation.AccelerateDecelerateInterpolator;
import android.view.animation.Interpolator;

import androidx.annotation.NonNull;
import de.mrapp.android.dialog.builder.AbstractBuilder;
import de.mrapp.util.Condition;

/**
 * An abstract base class for all animations, which can be used to show or hide a dialog.
 *
 * @author Michael Rapp
 * @since 4.0.0
 */
public abstract class DialogAnimation {

    /**
     * An abstract base class for all builders, which allow to create animations, which can be used
     * to show or hide a dialog.
     *
     * @param <AnimationType>
     *         The type of the animations, which are created by the builder
     * @param <BuilderType>
     *         The type of the builder
     */
    protected static abstract class AbstractDialogAnimationBuilder<AnimationType extends DialogAnimation, BuilderType extends AbstractDialogAnimationBuilder<AnimationType, ?>>
            extends AbstractBuilder<AnimationType, BuilderType> {

        /**
         * Creates a new builder, which allows to create animations, which can be used to show or
         * hide a dialog.
         *
         * @param context
         *         The context, which should be used by the builder, as an instance of the class
         *         {@link Context}. The context may not be null
         */
        protected AbstractDialogAnimationBuilder(@NonNull final Context context) {
            super(context);
        }

        /**
         * Sets the interpolator, which should be used by the animation, which is created by the
         * builder.
         *
         * @param interpolator
         *         The interpolator, which should be set, as an instance of the type {@link
         *         Interpolator}. The interpolator may not be null
         * @return The builder, this method has been called upon, as an instance of the generic type
         * BuilderType
         */
        public BuilderType setInterpolator(@NonNull final Interpolator interpolator) {
            getProduct().setInterpolator(interpolator);
            return self();
        }

        /**
         * Sets the duration of the animation, which is created by the builder.
         *
         * @param duration
         *         The duration, which should be set, in milliseconds as a {@link Long} value. The
         *         duration must be at least 1
         * @return The builder, this method has been called upon, as an instance of the generic type
         * BuilderType
         */
        public BuilderType setDuration(final long duration) {
            getProduct().setDuration(duration);
            return self();
        }

        /**
         * Sets the delay until the animation, which is created by the builder, is started.
         *
         * @param startDelay
         *         The delay, which should be set, as a {@link Long} value. The delay must be at
         *         least 0
         * @return The builder, this method has been called upon, as an instance of the generic type
         * BuilderType
         */
        public BuilderType setStartDelay(final long startDelay) {
            getProduct().setStartDelay(startDelay);
            return self();
        }

        /**
         * Sets the alpha, which should be used by the animation, which is created by the builder.
         *
         * @param alpha
         *         The alpha, which should be set, as a {@link Float} value. The alpha must be at
         *         least 0 and at maximum 1
         * @return The builder, this method has been called upon, as an instance of the generic type
         * BuilderType
         */
        public BuilderType setAlpha(final float alpha) {
            getProduct().setAlpha(alpha);
            return self();
        }

    }

    /**
     * The interpolator, which is used by the animation.
     */
    private Interpolator interpolator;

    /**
     * The duration of the animation in milliseconds.
     */
    private long duration;

    /**
     * The delay until the animation is started.
     */
    private long startDelay;

    /**
     * The alpha, which is used by the animation.
     */
    private Float alpha;

    /**
     * Sets the interpolator, which should be used by the animation.
     *
     * @param interpolator
     *         The interpolator, which should be set, as an instance of the type {@link
     *         Interpolator}. The interpolator may not be null
     */
    protected final void setInterpolator(@NonNull final Interpolator interpolator) {
        Condition.INSTANCE.ensureNotNull(interpolator, "The interpolator may not be null");
        this.interpolator = interpolator;
    }

    /**
     * Sets the duration of the animation.
     *
     * @param duration
     *         The duration, which should be set, in milliseconds as a {@link Long} value. The
     *         duration must be at least 1
     */
    protected final void setDuration(final long duration) {
        Condition.INSTANCE.ensureAtLeast(duration, 1, "The duration must be at least 1");
        this.duration = duration;
    }

    /**
     * Sets the delay until the animation is started.
     *
     * @param startDelay
     *         The delay, which should be set, in milliseconds as a {@link Long} value. The delay
     *         must be at least 0
     */
    protected final void setStartDelay(final long startDelay) {
        Condition.INSTANCE.ensureAtLeast(startDelay, 0, "The start delay must be at least 0");
        this.startDelay = startDelay;
    }

    /**
     * Sets the alpha, which should be used by the animation.
     *
     * @param alpha
     *         The alpha, which should be set, as a {@link Float} value. The alpha must be at least
     *         0 and at maximum 1
     */
    protected final void setAlpha(final float alpha) {
        Condition.INSTANCE.ensureAtLeast(alpha, 0, "The alpha must be at least 0");
        Condition.INSTANCE.ensureAtMaximum(alpha, 1, "The alpha must be at maximum 1");
        this.alpha = alpha;
    }

    /**
     * Creates a new animation, which can be used to show or hide a dialog.
     *
     * @param context
     *         The context, which should be used by the animation, as an instance of the class
     *         {@link Context}. The context may not be null
     */
    protected DialogAnimation(@NonNull final Context context) {
        Condition.INSTANCE.ensureNotNull(context, "The context may not be null");
        this.interpolator = new AccelerateDecelerateInterpolator();
        this.duration = context.getResources().getInteger(android.R.integer.config_shortAnimTime);
        this.startDelay = 0;
        this.alpha = null;
    }

    /**
     * Returns the interpolator, which is used by the animation.
     *
     * @return The interpolator, which is used by the animation, as an instance of the type {@link
     * Interpolator}. The interpolator may not be null
     */
    @NonNull
    public final Interpolator getInterpolator() {
        return interpolator;
    }

    /**
     * Returns the duration of the animation.
     *
     * @return The duration of the animation in milliseconds as a {@link Long} value
     */
    public final long getDuration() {
        return duration;
    }

    /**
     * Returns the delay until the animation is started.
     *
     * @return The delay until the animation is started in milliseconds as a {@link Long} value
     */
    public final long getStartDelay() {
        return startDelay;
    }

    /**
     * Returns the alpha, which is used by the animation.
     *
     * @return The alpha, which is used by the animation as a {@link Float} value, or null, if no
     * alpha is used
     */
    public final Float getAlpha() {
        return alpha;
    }

}


text:
package com.omniprise.cim.model;

import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.omniprise.cim.parse.model.Element;

public class VoltageLevel extends EquipmentContainer {
	private static Logger log = LoggerFactory.getLogger(VoltageLevel.class);
	private static Map<String,List<VoltageLevel>> substations = new HashMap<String,List<VoltageLevel>>();

	private String substation;
	private String baseVoltage;

	public VoltageLevel() {
		log.debug("Created VoltageLevel instance");
	}

	public String getSubstation() {
		return substation;
	}

	public void setSubstation(String substation) {
		this.substation = substation;
	}

	public String getBaseVoltage() {
		return baseVoltage;
	}

	public void setBaseVoltage(String baseVoltage) {
		this.baseVoltage = baseVoltage;
	}

	public static List<VoltageLevel> findVoltageLevels(String id) {
		List<VoltageLevel> result = null;
		log.debug("findVoltageLevels: find voltage levels for substations " + id);
		result = substations.get(id);
		if (result == null) log.debug("findVoltageLevels:  not found");
		return result;
	}

	@Override
	protected boolean handleAttribute(Element element, String value) {
		boolean handled = false;

		if (!(handled = super.handleAttribute(element, value))) {
			if ("cim".equals(element.getNamespace()) && "VoltageLevel".equals(element.getClassName()) && "BaseVoltage".equals(element.getName())) {
				log.debug("handleAttribute cim:VoltageLevel.BaseVoltage = " + value);
				setBaseVoltage(value);
				handled = true;
			} else if ("cim".equals(element.getNamespace()) && "VoltageLevel".equals(element.getClassName()) && "MemberOf_Substation".equals(element.getName())) {
				log.debug("handleAttribute cim:VoltageLevel.MemberOf_Substation = " + value);
				setSubstation(value);
				List<VoltageLevel> voltageLevels = substations.get(substation);
				if (voltageLevels == null) {
					voltageLevels = new LinkedList<VoltageLevel>();
					substations.put(substation,voltageLevels);
				}
				voltageLevels.add(this);
				handled = true;
			}
		}

		return handled;
	}

	@Override
	protected String getDisplayName() { return "VoltageLevel"; }

	@Override
	public String toString() { return super.toString() + "," + getSubstation() + "," + getBaseVoltage(); }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>

    <string name="app_name">TestProject03AsyncTestTest</string>

</resources>


text:
package com.xujun.mylibrary.utils;

import android.text.TextUtils;

import java.io.FileInputStream;
import java.io.IOException;
import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

public class MD5Util {

    /**
     * 指定算法为MD5的MessageDigest
     */
    private static MessageDigest messageDigest = null;

    /** * 初始化messageDigest的加密算法为MD5 */
    static {
        try {
            messageDigest = MessageDigest.getInstance("MD5");
        } catch (NoSuchAlgorithmException e) {
            e.printStackTrace();
        }
    }

    /**
     * 获取文件的MD5
     * @param path 文件的绝对路径
     * @return MD5
     */
    public static String getMd5ByFile(String path) {
        String value = null;
        FileInputStream in = null;

        try {
            in = new FileInputStream(path);
            byte[] buffer = new byte[4096];
            int length;
            while ((length = in.read(buffer)) != -1) {
                messageDigest.update(buffer, 0, length);
            }
            BigInteger bi = new BigInteger(1, messageDigest.digest());
            value = bi.toString(16);
        } catch (IOException ex) {
            ex.printStackTrace();
        } finally {
            try {
                if (in != null) {
                    in.close();
                }
            } catch (IOException ex) {
                ex.printStackTrace();
            }
        }
        return value;
    }

    /**
     * 校验密码与其MD5是否一致
     * @param pwd 密码字符串
     * @param md5 基准MD5值
     * @return 检验结果
     */
    public static boolean checkPassword(String pwd, String md5) {
        return getMD5String(pwd).equalsIgnoreCase(md5);
    }

    /**
     * MD5加密字符串
     * @param str 目标字符串
     * @return MD5加密后的字符串
     */
    public static String getMD5String(String str) {
        if (TextUtils.isEmpty(str))
            return "";
        messageDigest.update(str.getBytes());
        BigInteger bi = new BigInteger(1, messageDigest.digest());
        return bi.toString(16);
    }
}


text:
try:
  from twitter.common import log
except ImportError:
  import logging as log

from twitter.common.zookeeper.group import ActiveGroup, Group, GroupInterface

from .endpoint import ServiceInstance

class ServerSet(object):
  """
    A dynamic set of service endpoints tracked by Zookeeper.
  """

  def __init__(self, zk, path, underlying=None, on_join=None, on_leave=None, **kwargs):
    """
      Construct a ServerSet at :path given zookeeper handle :zh.

      If :underlying is specified, use that as the underlying Group implementation.  Must be a
      subclass of twitter.common.zookeeper.group.GroupInterface.

      If :on_join is specified, it will be called with a ServiceInstance object every time a
      new service joins the ServerSet.  If :on_leave is specified, it will be called with
      a ServiceInstance object every time a server leaves the ServerSet.

      All remaining arguments are passed to the underlying Group implementation.
    """
    # The default underlying implementation is Group if no active monitoring is requested
    # of the ServerSet.  If active monitoring is requested by on_join or on_leave, then
    # use ActiveGroup by default, which has better performance on monitor/iter calls.
    default_underlying = Group if (on_join is None and on_leave is None) else ActiveGroup
    underlying = underlying or default_underlying
    assert issubclass(underlying, GroupInterface), (
        'Underlying group implementation must be a subclass of GroupInterface.')
    self._path = path
    self._group = underlying(zk, path, **kwargs)
    def devnull(*args, **kw): pass
    self._on_join = on_join or devnull
    self._on_leave = on_leave or devnull
    self._members = {}
    if on_join or on_leave:
      self._internal_monitor(set(self._members))

  def join(self, endpoint, additional=None, callback=None, expire_callback=None):
    """
      Given 'endpoint' (twitter.common.zookeeper.serverset.Endpoint) and an
      optional map 'additional' of string => endpoint (also Endpoint), create a
      ServiceInstance and join it into this ServerSet.

      If 'callback' is provided, the join will be done asynchronously and
      'callback' will be called with the Membership object associated with
      the ServiceInstance.  If joining fails, Membership.error() will be
      returned.  If 'callback' is not provided, join will return with this
      information synchronously.

      If 'expire_callback' is provided, it will be called if the membership
      is severed for any reason such as session expiration or malice.
    """
    service_instance = ServiceInstance.pack(ServiceInstance(endpoint, additional))
    return self._group.join(service_instance, callback=callback, expire_callback=expire_callback)

  def cancel(self, membership, callback=None):
    """Cancel membership in the ServerSet."""
    return self._group.cancel(membership, callback=callback)

  def __iter__(self):
    """Iterate over the services (ServiceInstance objects) in this ServerSet."""
    for member in self._group.list():
      try:
        yield ServiceInstance.unpack(self._group.info(member))
      except Exception as e:
        log.warning('Failed to deserialize endpoint: %s' % e)
        continue

  def _internal_monitor(self, members):
    cached = set(self._members)
    new_members = members - cached
    old_members = cached - members
    for service_instance in map(self._members.pop, old_members):
      self._on_leave(service_instance)
    for member_id in new_members:
      def on_finish(service_instance):
        try:
          self._members[member_id] = ServiceInstance.unpack(service_instance)
        except Exception as e:
          log.warning('Failed to deserialize endpoint: %s' % e)
          return
        self._on_join(self._members[member_id])
      self._group.info(member_id, on_finish)
    self._group.monitor(members, self._internal_monitor)


text:
'use strict';

var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = require('babel-runtime/helpers/createClass');

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = require('babel-runtime/helpers/inherits');

var _inherits3 = _interopRequireDefault(_inherits2);

var _framework = require('./framework');

var _framework2 = _interopRequireDefault(_framework);

var _project = require('./project');

var _project2 = _interopRequireDefault(_project);

var _collection = require('./collection');

var _collection2 = _interopRequireDefault(_collection);

var _registry = require('./registry');

var _registry2 = _interopRequireDefault(_registry);

var _assets = require('./assets');

var _assets2 = _interopRequireDefault(_assets);

var _helpers = require('./helpers');

var _helpers2 = _interopRequireDefault(_helpers);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

try {
  require('babel-polyfill');
} catch (e) {}

var Skypager = (function (_Framework) {
  (0, _inherits3.default)(Skypager, _Framework);

  function Skypager() {
    (0, _classCallCheck3.default)(this, Skypager);
    return (0, _possibleConstructorReturn3.default)(this, (0, _getPrototypeOf2.default)(Skypager).apply(this, arguments));
  }

  (0, _createClass3.default)(Skypager, [{
    key: 'Project',
    get: function get() {
      return _project2.default;
    }
  }, {
    key: 'Assets',
    get: function get() {
      return _assets2.default;
    }
  }, {
    key: 'Helpers',
    get: function get() {
      return _helpers2.default;
    }
  }, {
    key: 'Plugin',
    get: function get() {
      return _helpers2.default.Plugin;
    }
  }, {
    key: 'util',
    get: function get() {
      return util;
    }
  }]);
  return Skypager;
})(_framework2.default);

// this tries to ensure that only one instance of skypager lj

var framework = new Skypager(__dirname, 'skypager');

module.exports = framework;


text:
class FontBebasNeue < Cask
  version 'latest'
  sha256 :no_check

  url 'http://fontfabric.com/downfont/bebas.zip'
  homepage 'http://fontfabric.com/bebas-neue/'

  font 'BebasNeue Bold.otf'
  font 'BebasNeue Book.otf'
  font 'BebasNeue Light.otf'
  font 'BebasNeue Regular.otf'
  font 'BebasNeue Thin.otf'
end


text:
namespace Rendering
{
    public enum RenderLayer
    {
        Background,
        LevelObject,
        Player,
        Ui,
        None
    }
}


text:
<?php
/**
 * Created by PhpStorm.
 * User: ivphpan
 * Date: 17.12.15
 * Time: 15:53
 */

namespace app\modules\core\models;

use \yii\base\Model as BaseModel;
use app\modules\lang\models\Language;

class FeedbackForm extends BaseModel
{

    public $name;
    public $email;
    public $message;

    public function rules()
    {
        return [
          [['name','email','message'],'required'],
            ['email','email'],
        ];
    }

    public function attributeLabels()
    {
        return [
          'name'=>Language::t('feedback','Имя'),
          'email'=> Language::t('feedback', 'Email'),
            'message'=> Language::t('feedback', 'Сообщение'),
        ];
    }

    public function send()
    {
        if ($this->validate()) {
            \Yii::$app->mailer->compose()
                ->setTo(\Yii::$app->params['email']->to)
                ->setFrom([$this->email => $this->name])
                ->setSubject('Новое сообщение с сайта '.APP_NAME)
                ->setTextBody($this->message)
                ->send();

            return true;
        }
        return false;
    }

}