text:
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using Appleseed.Base.Data.Model;
using Appleseed.Base.Data.Repository.Contracts;
using Appleseed.Base.Data.Utility;
using MySql.Data.MySqlClient;
using NLog;

namespace Appleseed.Base.Data.Repository
{
    public class MySqlRepository : IMySqlRepository, IDisposable
    {
        private MySqlConnection MySqlClient;

        public Logger Log
        {
            get;
            private set;
        }

        /// <summary>
        /// Gets the connection.
        /// </summary>
        /// <value>The connection.</value>
        public string ConnectionString
        {
            get;
            private set;
        }

        public MySqlRepository(string incomingConnectionString, Logger logger)
        {
            this.MySqlClient = new MySqlConnection(incomingConnectionString);
            this.ConnectionString = incomingConnectionString;
            this.Log = logger;
        }
        public void Insert(BaseCollectionItem baseCollectionItem)
        {
            baseCollectionItem.Id = Guid.NewGuid();
            baseCollectionItem.CreatedDate = DateTime.Now;
            ////var data = baseCollectionItem.Data.SerializeToByteArray();
            this.MySqlClient.Open();
            var query = @"Insert into basecollectionitem (Id, Data, ItemProcessed, CreatedDate)
                        values(@ItemId, @ItemData, @ItemProcessed, @CreatedDate)";
            var command = new MySqlCommand(query, this.MySqlClient);

            command.Parameters.AddWithValue("@ItemId", baseCollectionItem.Id);
            command.Parameters.AddWithValue("@ItemData", baseCollectionItem.Data.SerializeToByteArray());
            command.Parameters.AddWithValue("@ItemProcessed", baseCollectionItem.ItemProcessed);
            command.Parameters.AddWithValue("@CreatedDate", baseCollectionItem.CreatedDate);
            command.CommandType = CommandType.Text;
            command.ExecuteNonQuery();

            this.MySqlClient.Close();
        }

        public void Update(BaseCollectionItem baseCollectionItem)
        {
            this.MySqlClient.Open();
            var query = @"update basecollectionitem
                           set ItemProcessed=@ItemProcessed where Id=@Id;";
            var command = new MySqlCommand(query, this.MySqlClient);
            command.Parameters.AddWithValue("@ItemProcessed", baseCollectionItem.ItemProcessed);
            command.Parameters.AddWithValue("@Id", baseCollectionItem.Id);
            command.CommandType = CommandType.Text;
            var affectedRows =command.ExecuteNonQuery();

            this.MySqlClient.Close();
        }

        public void DeleteProcessedItems()
        {
            this.MySqlClient.Open();
            var query = @"Delete From basecollectionItem where ItemProcessed = 'true'";
            var command = new MySqlCommand(query, this.MySqlClient);
            command.ExecuteNonQuery();
            this.MySqlClient.Close();
        }

        //public List<BaseCollectionItem> GetAllFromQueue()
        //{
        //    //DONE: implement method to get batch repository items
        //    // gets unprocessed items

        //    this.MySqlClient.Open();
        //    Log.Info("Connected to the database");

        //    ////DONE: Select data from table in MYSQL Successfully and get it back in .NET
        //    ////TODO: filter if processed or not?
        //    MySqlCommand myCommand = new MySqlCommand("SELECT * FROM collectionitemqueue", this.MySqlClient);
        //    MySqlDataReader myReader = myCommand.ExecuteReader();

        //    Log.Info("Retreiving Items from Queue");
        //    //DONE: enumerate through data , create collection to return ;

        //    List<BaseCollectionItem> itemCollection = new List<BaseCollectionItem>();

        //    while (myReader.Read())
        //    {
        //        Log.Info(myReader.GetString(1) + ":" + myReader.GetString(2));

        //        //DONE: convert list of tags separated by commas into a List of strings
        //        ////List<string> itemTags = new List<string>(myReader.GetString(4).Split(','));

        //        var baseCollectionItemData = new BaseCollectionItemData
        //        {
        //            ItemID = myReader.GetInt32(0),
        //            ItemTitle = myReader.GetString(1),
        //            ItemUrl = myReader.GetString(2),
        //            ItemContent_Image = "",
        //            ItemContent_Raw = "",
        //            ItemDescription = myReader.GetString(3),
        //            ItemTags = myReader.GetString(4),
        //            ItemProcessedDate = DateTime.Today
        //        };

        //        itemCollection.Add(new BaseCollectionItem
        //        {
        //            Id = Guid.NewGuid(),
        //            Data = baseCollectionItemData
        //        }
        //        );
        //    }
        //    // close out stuff
        //    myReader.Close();
        //    this.MySqlClient.Close();
        //    return itemCollection;
        //}

        public BaseCollectionItem GetById(Guid id)
        {
            throw new NotImplementedException();
        }

        public IQueryable<BaseCollectionItem> GetUnProcessedBaseCollectionItems()
        {
            this.MySqlClient.Open();
            Log.Info("Connected to the database");

            ////DONE: Select data from table in MYSQL Successfully and get it back in .NET
            ////TODO: filter if processed or not?
            MySqlCommand myCommand = new MySqlCommand("SELECT * FROM basecollectionitem where ItemProcessed='false'", this.MySqlClient);
            MySqlDataReader myReader = myCommand.ExecuteReader();

            Log.Info("Retreiving Items from Queue");
            //DONE: enumerate through data , create collection to return ;

            List<BaseCollectionItem> itemCollection = new List<BaseCollectionItem>();
            if (myReader.HasRows)
            {
                Log.Info("This Collection has Items");
                while (myReader.Read())
                {
                    Log.Info(myReader.GetInt32(0) + ":" + myReader.GetBoolean(3));

                    //DONE: convert list of tags separated by commas into a List of strings
                    ////List<string> itemTags = new List<string>(myReader.GetString(4).Split(','));

                    var binaryData = (byte[])myReader["Data"];

                    itemCollection.Add(new BaseCollectionItem
                    {
                        TableId = myReader.GetInt32(0),
                        Id = myReader.GetGuid(1),
                        Data = (BaseCollectionItemData)binaryData.DeSerializeToObject(),
                        ItemProcessed = myReader.GetBoolean(3),
                        CreatedDate = myReader.GetDateTime(4)
                    });
                }
            }
            // close out stuff
            myReader.Close();
            MySqlClient.Close();
            return itemCollection.AsQueryable();
        }

        public void Dispose()
        {
            throw new NotImplementedException();
        }
    }
}


text:
'use strict';
var expect = require('chai').expect;

describe('let', function() {
  it('variables declared with let are not accessible in other blocks within the same function', function() {
    var a = 1;

    if (true) {
      let foo = 'bar';
    }

    try {
      a = foo;
    }
    catch(err) {
      expect(err).to.be.an.instanceOf(ReferenceError);
    }

    expect(a).to.equal(1);
  });

  it('variables declared with let are accessible within nested blocks', function() {
    let foo = 'bar';

    if (true) {
      expect(foo).to.equal('bar');
    }
  });
});

redpajama_set_name: RedPajamaGithub


text:
* [NovaTecConsulting / FaceRecognition-in-ARKit](https://github.com/NovaTecConsulting/FaceRecognition-in-ARKit):
        Detects faces using the Vision-API and runs the extracted face through a CoreML-model to identiy the specific persons.

* [olucurious / Awesome-ARKit](https://github.com/olucurious/Awesome-ARKit):
        A curated list of awesome ARKit projects and resources. Feel free to contribute!

* [vapor / vapor](https://github.com/vapor/vapor):

💧 A server-side Swift web framework.

* [ReactiveX / RxSwift](https://github.com/ReactiveX/RxSwift):
        Reactive Programming in Swift

* [johnpatrickmorgan / wtfautolayout](https://github.com/johnpatrickmorgan/wtfautolayout):
        The source code for Why The Failure, Auto Layout?

* [raywenderlich / swift-algorithm-club](https://github.com/raywenderlich/swift-algorithm-club):
        Algorithms and data structures in Swift, with explanations!

* [saoudrizwan / Disk](https://github.com/saoudrizwan/Disk):
        Delightful framework for iOS to easily persist structs, images, and data

* [WenchaoD / FSPagerView](https://github.com/WenchaoD/FSPagerView):
        FSPagerView is an elegant Screen Slide Library. It is extremely helpful for making Banner View、Product Show、Welcome/Guide Pages、Screen/ViewController Sliders.

* [hanleyweng / CoreML-in-ARKit](https://github.com/hanleyweng/CoreML-in-ARKit):
        Simple project to detect objects and display 3D labels above them in AR. This serves as a basic template for an ARKit project to use CoreML.

* [vsouza / awesome-ios](https://github.com/vsouza/awesome-ios):
        A curated list of awesome iOS ecosystem, including Objective-C and Swift Projects

* [Alamofire / Alamofire](https://github.com/Alamofire/Alamofire):
        Elegant HTTP Networking in Swift

* [nmdias / DefaultsKit](https://github.com/nmdias/DefaultsKit):
        Simple, Strongly Typed UserDefaults for iOS, macOS and tvOS

* [lhc70000 / iina](https://github.com/lhc70000/iina):
        The modern video player for macOS.

* [onevcat / Kingfisher](https://github.com/onevcat/Kingfisher):
        A lightweight, pure-Swift library for downloading and caching images from the web.

* [MillmanY / MMPlayerView](https://github.com/MillmanY/MMPlayerView):
        Custom AVPlayerLayer on view and transition player with good effect like youtube and facebook

* [SnapKit / SnapKit](https://github.com/SnapKit/SnapKit):
        A Swift Autolayout DSL for iOS & OS X

* [mergesort / TypedNotifications](https://github.com/mergesort/TypedNotifications):
        A mechanism for sending typed notifications with payloads across your iOS app.

* [Moya / Moya](https://github.com/Moya/Moya):
        Network abstraction layer written in Swift.

* [spotify / SpotifyLogin](https://github.com/spotify/SpotifyLogin):
        Swift framework for authenticating with the Spotify API

* [voyages-sncf-technologies / Collor](https://github.com/voyages-sncf-technologies/Collor):
        A MVVM data-oriented framework for UICollectionView with great and useful features.

* [ProjectDent / ARKit-CoreLocation](https://github.com/ProjectDent/ARKit-CoreLocation):
        Combines the high accuracy of AR with the scale of GPS data.

* [HamzaGhazouani / HGPlaceholders](https://github.com/HamzaGhazouani/HGPlaceholders):
        Nice library to show placeholders and Empty States for any UITableView/UICollectionView in your project

* [LeFal / WaterDrops](https://github.com/LeFal/WaterDrops):
        Simple water drops animation 💧

* [SwiftyJSON / SwiftyJSON](https://github.com/SwiftyJSON/SwiftyJSON):
        The better way to deal with JSON data in Swift

* [xmartlabs / XLPagerTabStrip](https://github.com/xmartlabs/XLPagerTabStrip):
        Android PagerTabStrip for iOS.

####objective-c
* [TKkk-iOSer / WeChatPlugin-MacOS](https://github.com/TKkk-iOSer/WeChatPlugin-MacOS):
        MacOS版微信小助手 功能: 自动回复、消息防撤回、远程控制、微信多开

* [airbnb / lottie-ios](https://github.com/airbnb/lottie-ios):
        An iOS library to natively render After Effects vector animations

* [Sunnyyoung / WeChatTweak-macOS](https://github.com/Sunnyyoung/WeChatTweak-macOS):
        A dynamic library tweak for WeChat macOS - 微信 macOS 客户端撤回拦截与多开

* [CooperRS / RMActionController](https://github.com/CooperRS/RMActionController):
        This is an iOS control for presenting any UIView in an UIAlertController like manner

* [tingxins / SakuraKit](https://github.com/tingxins/SakuraKit):

🤡SakuraKit, a lightweight and powerful library for application to switching themes or skins, inspired by SwiftTheme and DKNightVersion.

* [AFNetworking / AFNetworking](https://github.com/AFNetworking/AFNetworking):
        A delightful networking framework for iOS, OS X, watchOS, and tvOS.

* [AloneMonkey / MonkeyDev](https://github.com/AloneMonkey/MonkeyDev):
        CaptainHook Tweak、Logos Tweak and Command-line Tool、Patch iOS Apps, Without Jailbreak.

* [crazycodeboy / RNStudyNotes](https://github.com/crazycodeboy/RNStudyNotes):
        React Native 研究与实践

* [hackiftekhar / IQKeyboardManager](https://github.com/hackiftekhar/IQKeyboardManager):
        Codeless drop-in universal library allows to prevent issues of keyboard sliding up and cover UITextField/UITextView. Neither need to write any code nor any setup required and much more.

* [airbnb / react-native-maps](https://github.com/airbnb/react-native-maps):
        React Native Mapview component for iOS + Android

* [LoveZYForever / HXWeiboPhotoPicker](https://github.com/LoveZYForever/HXWeiboPhotoPicker):
        仿微博照片/图片选择器 - 支持LivePhoto、GIF图片选择、3DTouch预览、浏览网络图片 功能 Imitation weibo photo/image picker - support for LivePhoto, GIF image selection, 3DTouch preview, browse the web image function

* [newmarcel / KeepingYouAwake](https://github.com/newmarcel/KeepingYouAwake):
        A Caffeine clone for macOS Yosemite, El Capitan and Sierra (including Dark Mode).

* [MacDownApp / macdown](https://github.com/MacDownApp/macdown):
        Open source Markdown editor for macOS.

* [realm / realm-cocoa](https://github.com/realm/realm-cocoa):
        Realm is a mobile database: a replacement for Core Data & SQLite

* [wedxz / LNRefresh](https://github.com/wedxz/LNRefresh):
        轻量级下拉刷新控件,便于扩展与自定义动画。

* [ViccAlexander / Chameleon](https://github.com/ViccAlexander/Chameleon):
        Flat Color Framework for iOS (Obj-C & Swift)

* [ivpusic / react-native-image-crop-picker](https://github.com/ivpusic/react-native-image-crop-picker):
        iOS/Android image picker with support for camera, configurable compression, multiple images and cropping

* [MortimerGoro / MGSwipeTableCell](https://github.com/MortimerGoro/MGSwipeTableCell):
        An easy to use UITableViewCell subclass that allows to display swippable buttons with a variety of transitions.

* [AAChartModel / AAChartKit](https://github.com/AAChartModel/AAChartKit):
        An elegant and friendly chart library for iOS developer

* [ibireme / YYKit](https://github.com/ibireme/YYKit):
        A collection of iOS components.

* [QMUI / QMUI_iOS](https://github.com/QMUI/QMUI_iOS):
        QMUI iOS——致力于提高项目 UI 开发效率的解决方案

* [google / EarlGrey](https://github.com/google/EarlGrey):

🍵 iOS UI Automation Test Framework

* [ReactiveCocoa / ReactiveObjC](https://github.com/ReactiveCocoa/ReactiveObjC):
        The 2.x ReactiveCocoa Objective-C API: Streams of values over time

* [rs / SDWebImage](https://github.com/rs/SDWebImage):
        Asynchronous image downloader with cache support as a UIImageView category

* [Instagram / IGListKit](https://github.com/Instagram/IGListKit):
        A data-driven UICollectionView framework for building fast and flexible lists.

####go
* [ory / hydra](https://github.com/ory/hydra):
        OAuth2 server with OpenID Connect - cloud native, security-first, open source API security for your infrastructure. Written in Go.

* [alexellis / faas](https://github.com/alexellis/faas):
        Functions as a Service (OpenFaaS) - a serverless framework for Docker & Kubernetes

* [golang / go](https://github.com/golang/go):
        The Go programming language

* [schollz / PIanoAI](https://github.com/schollz/PIanoAI):
        Realtime piano learning and accompaniment from a Pi-powered AI 🎹

* [tmc / pqstream](https://github.com/tmc/pqstream):
        pqstream turns your postgres database into an event stream

* [kubernetes / kubernetes](https://github.com/kubernetes/kubernetes):
        Production-Grade Container Scheduling and Management

* [tendermint / tendermint](https://github.com/tendermint/tendermint):
        Tendermint Core (BFT Consensus) in Go

* [astaxie / build-web-application-with-golang](https://github.com/astaxie/build-web-application-with-golang):
        A golang ebook intro how to build a web with golang

* [avelino / awesome-go](https://github.com/avelino/awesome-go):
        A curated list of awesome Go frameworks, libraries and software

* [grofers / go-codon](https://github.com/grofers/go-codon):
        Workflow based REST framework code generator

* [containous / traefik](https://github.com/containous/traefik):
        Træfik, a modern reverse proxy

* [apex / up](https://github.com/apex/up):
        Deploy infinitely scalable serverless apps, apis, and sites in seconds.

* [matryer / is](https://github.com/matryer/is):
        Professional lightweight testing mini-framework for Go.

* [json-iterator / go](https://github.com/json-iterator/go):
        A high-performance 100% compatible drop-in replacement of "encoding/json"

* [gohugoio / hugo](https://github.com/gohugoio/hugo):
        A Fast and Flexible Static Site Generator built with love in GoLang.

* [cilium / cilium](https://github.com/cilium/cilium):
        Linux Native, HTTP Aware Networking and Security for Containers

* [restic / restic](https://github.com/restic/restic):
        Fast, secure, efficient backup program

* [pingcap / tidb](https://github.com/pingcap/tidb):
        TiDB is a distributed NewSQL database compatible with MySQL protocol

* [ethereum / go-ethereum](https://github.com/ethereum/go-ethereum):
        Official Go implementation of the Ethereum protocol

* [grafana / grafana](https://github.com/grafana/grafana):
        The tool for beautiful monitoring and metric analytics & dashboards for Graphite, InfluxDB & Prometheus & More

* [moby / moby](https://github.com/moby/moby):
        Moby Project - a collaborative project for the container ecosystem to assemble container-based systems

* [golang / dep](https://github.com/golang/dep):
        Go dependency management tool

* [mholt / caddy](https://github.com/mholt/caddy):
        Fast, cross-platform HTTP/2 web server with automatic HTTPS

* [fatedier / frp](https://github.com/fatedier/frp):
        A fast reverse proxy to help you expose a local server behind a NAT or firewall to the internet.

* [syncthing / syncthing](https://github.com/syncthing/syncthing):
        Open Source Continuous File Synchronization

####javascript
* [mikeal / r2](https://github.com/mikeal/r2):
        HTTP client. Spiritual successor to request.

* [nitin42 / react-imgpro](https://github.com/nitin42/react-imgpro):

📷 Image Processing Component for React

* [thinkjs / thinkjs](https://github.com/thinkjs/thinkjs):
        Use full ES2015+ features to develop Node.js applications

* [easy-mock / easy-mock](https://github.com/easy-mock/easy-mock):
        一个可视化, 并且能快速生成模拟数据的持久化服务.

* [ryanflorence / render-markdown-javascript](https://github.com/ryanflorence/render-markdown-javascript):
        Renders markdown files to HTML with highlighted code blocks BUT ALSO RENDERS THE JAVASCRIPT ONES.

* [vuejs / vue](https://github.com/vuejs/vue):
        A progressive, incrementally-adoptable JavaScript framework for building UI on the web.

* [minirefresh / minirefresh](https://github.com/minirefresh/minirefresh):
        优雅的H5下拉刷新。零依赖,高性能,多主题,易拓展。(A Graceful HTML5 Drop-Down-Refresh Plugin. )

* [GoogleChrome / puppeteer](https://github.com/GoogleChrome/puppeteer):
        Headless Chrome Node API

* [mzabriskie / axios](https://github.com/mzabriskie/axios):
        Promise based HTTP client for the browser and node.js

* [ladjs / lad](https://github.com/ladjs/lad):
         👦 Lad scaffolds a Koa webapp and API framework for Node.js *TO BE RELEASED*

* [facebook / react](https://github.com/facebook/react):
        A declarative, efficient, and flexible JavaScript library for building user interfaces.

* [facebookincubator / create-react-app](https://github.com/facebookincubator/create-react-app):
        Create React apps with no build configuration.

* [twbs / bootstrap](https://github.com/twbs/bootstrap):
        The most popular HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web.

* [ApoorvSaxena / lozad.js](https://github.com/ApoorvSaxena/lozad.js):
        Advanced performant Lazy Loader using Intersection Observer API

* [justjavac / free-programming-books-zh_CN](https://github.com/justjavac/free-programming-books-zh_CN):

📚 免费的计算机编程类中文书籍,欢迎投稿

* [facebook / react-native](https://github.com/facebook/react-native):
        A framework for building native apps with React.

* [huangshuwei / vue-easytable](https://github.com/huangshuwei/vue-easytable):
        Vue2.x flexible table components, support for multi-head fixed, multi-column fixed, clumn drag, sort, custom column ...(vue2.x table 组件,支持多表头固定、多列固定、列拖动、排序、自定义列、分页... )😊

* [nodejs / node](https://github.com/nodejs/node):
        Node.js JavaScript runtime ✨🐢🚀✨

* [d3 / d3](https://github.com/d3/d3):
        Bring data to life with SVG, Canvas and HTML. 📊📈🎉

* [knownsec / KCon](https://github.com/knownsec/KCon):
        KCon is a famous Hacker Con powered by Knownsec Team.

* [emeeks / semiotic](https://github.com/emeeks/semiotic):
        A data visualization framework combining React & D3

* [airbnb / javascript](https://github.com/airbnb/javascript):
        JavaScript Style Guide

* [Okazari / Rythm.js](https://github.com/Okazari/Rythm.js):
        A javascript library that makes your page dance.

* [ryanmcdermott / clean-code-javascript](https://github.com/ryanmcdermott/clean-code-javascript):

🛁 Clean Code concepts adapted for JavaScript

* [reactjs / redux](https://github.com/reactjs/redux):
        Predictable state container for JavaScript apps

####ruby
* [cstack / db_tutorial](https://github.com/cstack/db_tutorial):
        Writing a sqlite clone from scratch in C

* [toddmotto / public-apis](https://github.com/toddmotto/public-apis):
        A collective list of public JSON APIs for use in web development.

* [fastlane / fastlane](https://github.com/fastlane/fastlane):

🚀 The easiest way to automate building and releasing your iOS and Android apps

* [jekyll / jekyll](https://github.com/jekyll/jekyll):

🌐 Jekyll is a blog-aware, static site generator in Ruby

* [jondot / awesome-react-native](https://github.com/jondot/awesome-react-native):
        Awesome React Native components, news, tools, and learning material!

* [rails / rails](https://github.com/rails/rails):
        Ruby on Rails

* [garrettqmartin8 / volition](https://github.com/garrettqmartin8/volition):
* [Homebrew / brew](https://github.com/Homebrew/brew):

🍺 The missing package manager for macOS

* [Thibaut / devdocs](https://github.com/Thibaut/devdocs):
        API Documentation Browser

* [ruby / ruby](https://github.com/ruby/ruby):
        The Ruby Programming Language

* [rapid7 / metasploit-framework](https://github.com/rapid7/metasploit-framework):
        Metasploit Framework

* [brunofacca / zen-rails-base-app](https://github.com/brunofacca/zen-rails-base-app):
        Base application for Ruby on Rails 5 projects. Built to minimize the time spent writing boilerplate code and performing repetitive setup tasks.

* [caskroom / homebrew-cask](https://github.com/caskroom/homebrew-cask):
        A CLI workflow for the administration of Mac applications distributed as binaries

* [huginn / huginn](https://github.com/huginn/huginn):
        Create agents that monitor and act on your behalf. Your agents are standing by!

* [mitchellh / vagrant](https://github.com/mitchellh/vagrant):
        Vagrant is a tool for building and distributing development environments.

* [discourse / discourse](https://github.com/discourse/discourse):
        A platform for community discussion. Free, open, simple.

* [saasbook / hw-ruby-intro](https://github.com/saasbook/hw-ruby-intro):
        Ruby Introduction Assignment for Agile Development using Ruby on Rails

* [peatio / peatio](https://github.com/peatio/peatio):
        An open-source assets exchange.

* [kilimchoi / engineering-blogs](https://github.com/kilimchoi/engineering-blogs):
        A curated list of engineering blogs

* [piotrmurach / tty-progressbar](https://github.com/piotrmurach/tty-progressbar):
        A flexible progress bar drawing in terminal emulators

* [rails / webpacker](https://github.com/rails/webpacker):
        Use Webpack to manage app-like JavaScript modules in Rails

* [exAspArk / batch-loader](https://github.com/exAspArk/batch-loader):

⚡ Powerful tool to avoid N+1 DB or HTTP queries

* [tootsuite / mastodon](https://github.com/tootsuite/mastodon):
        Your self-hosted, globally interconnected microblogging community

* [shakacode / react_on_rails](https://github.com/shakacode/react_on_rails):
        Integration of React + Webpack + Rails to build Universal (Isomorphic) Apps

* [bbatsov / rubocop](https://github.com/bbatsov/rubocop):
        A Ruby static code analyzer, based on the community Ruby style guide.


text:
package br.pro.fagnerlima.flmoney.api.exceptionhandler;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import org.apache.commons.lang3.exception.ExceptionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.MessageSource;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.dao.DataIntegrityViolationException;
import org.springframework.dao.EmptyResultDataAccessException;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.http.converter.HttpMessageNotReadableException;
import org.springframework.validation.BindingResult;
import org.springframework.validation.FieldError;
import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.context.request.WebRequest;
import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler;

@ControllerAdvice
public class FlMoneyExceptionHandler extends ResponseEntityExceptionHandler {

    @Autowired
    private MessageSource messageSource;

    @Override
    protected ResponseEntity<Object> handleHttpMessageNotReadable(HttpMessageNotReadableException ex,
            HttpHeaders headers, HttpStatus status, WebRequest request) {
        String userMessage = messageSource.getMessage("mensagem.invalida", null, LocaleContextHolder.getLocale());
        String devMessage = null != ex.getCause() ? ex.getCause().toString() : ex.toString();
        List<Error> errors = Arrays.asList(new Error(userMessage, devMessage));

        return handleExceptionInternal(ex, errors, headers, status, request);
    }

    @Override
    protected ResponseEntity<Object> handleMethodArgumentNotValid(MethodArgumentNotValidException ex,
            HttpHeaders headers, HttpStatus status, WebRequest request) {
        List<Error> errors = createErrorsList(ex.getBindingResult());
        return handleExceptionInternal(ex, errors, headers, status, request);
    }

    @ExceptionHandler({ EmptyResultDataAccessException.class })
    public ResponseEntity<Object> handleEmptyResultDataAccessException(EmptyResultDataAccessException ex,
            WebRequest request) {
        String userMessage = messageSource.getMessage("recurso.nao-encontrado", null, LocaleContextHolder.getLocale());
        String devMessage = ex.toString();
        List<Error> errors = Arrays.asList(new Error(userMessage, devMessage));

        return handleExceptionInternal(ex, errors, new HttpHeaders(), HttpStatus.NOT_FOUND, request);
    }

    @ExceptionHandler({ DataIntegrityViolationException.class })
    public ResponseEntity<Object> handleDataIntegrityViolationException(DataIntegrityViolationException ex,
            WebRequest request) {
        String userMessage = messageSource.getMessage("recurso.operacao-nao-permitida", null,
                LocaleContextHolder.getLocale());
        String devMessage = ExceptionUtils.getRootCauseMessage(ex);
        List<Error> errors = Arrays.asList(new Error(userMessage, devMessage));

        return handleExceptionInternal(ex, errors, new HttpHeaders(), HttpStatus.BAD_REQUEST, request);
    }

    private List<Error> createErrorsList(BindingResult bindingResult) {
        List<Error> errors = new ArrayList<Error>();

        for (FieldError fieldError : bindingResult.getFieldErrors()) {
            String userMessage = messageSource.getMessage(fieldError, LocaleContextHolder.getLocale());
            String devMessage = fieldError.toString();
            errors.add(new Error(userMessage, devMessage));
        }

        return errors;
    }

    public static class Error {

        private String userMessage;
        private String devMessage;

        public Error(String userMessage, String devMessage) {
            this.userMessage = userMessage;
            this.devMessage = devMessage;
        }

        public String getUserMessage() {
            return userMessage;
        }

        public String getDevMessage() {
            return devMessage;
        }
    }
}


text:
layout: post
title: TATTS AND DICK FROM THE BACK
titleinfo: pornvd
desc: Watch TATTS AND DICK FROM THE BACK. Pornhub is the ultimate xxx porn and sex site.
---

TATTS AND DICK FROM THE BACK

Watch TATTS AND DICK FROM THE BACK. Pornhub is the ultimate xxx porn and sex site.


text:
import abc
from typing import Awaitable, Callable, Dict, Optional, Sequence, Union
import pkg_resources

import google.auth  # type: ignore
import google.api_core
from google.api_core import exceptions as core_exceptions
from google.api_core import gapic_v1
from google.api_core import retry as retries
from google.api_core import operations_v1
from google.auth import credentials as ga_credentials  # type: ignore
from google.oauth2 import service_account  # type: ignore

from google.cloud.aiplatform_v1beta1.types import annotation_spec
from google.cloud.aiplatform_v1beta1.types import dataset
from google.cloud.aiplatform_v1beta1.types import dataset as gca_dataset
from google.cloud.aiplatform_v1beta1.types import dataset_service
from google.cloud.location import locations_pb2  # type: ignore
from google.iam.v1 import iam_policy_pb2  # type: ignore
from google.iam.v1 import policy_pb2  # type: ignore
from google.longrunning import operations_pb2
from google.longrunning import operations_pb2  # type: ignore

try:
    DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
        gapic_version=pkg_resources.get_distribution(
            "google-cloud-aiplatform",
        ).version,
    )
except pkg_resources.DistributionNotFound:
    DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()

class DatasetServiceTransport(abc.ABC):
    """Abstract transport class for DatasetService."""

    AUTH_SCOPES = ("https://www.googleapis.com/auth/cloud-platform",)

    DEFAULT_HOST: str = "aiplatform.googleapis.com"

    def __init__(
        self,
        *,
        host: str = DEFAULT_HOST,
        credentials: ga_credentials.Credentials = None,
        credentials_file: Optional[str] = None,
        scopes: Optional[Sequence[str]] = None,
        quota_project_id: Optional[str] = None,
        client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
        always_use_jwt_access: Optional[bool] = False,
        api_audience: Optional[str] = None,
        **kwargs,
    ) -> None:
        """Instantiate the transport.

        Args:
            host (Optional[str]):
                 The hostname to connect to.
            credentials (Optional[google.auth.credentials.Credentials]): The
                authorization credentials to attach to requests. These
                credentials identify the application to the service; if none
                are specified, the client will attempt to ascertain the
                credentials from the environment.
            credentials_file (Optional[str]): A file with credentials that can
                be loaded with :func:`google.auth.load_credentials_from_file`.
                This argument is mutually exclusive with credentials.
            scopes (Optional[Sequence[str]]): A list of scopes.
            quota_project_id (Optional[str]): An optional project to use for billing
                and quota.
            client_info (google.api_core.gapic_v1.client_info.ClientInfo):
                The client info used to send a user-agent string along with
                API requests. If ``None``, then default info will be used.
                Generally, you only need to set this if you're developing
                your own client library.
            always_use_jwt_access (Optional[bool]): Whether self signed JWT should
                be used for service account credentials.
        """

        scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES}

        # Save the scopes.
        self._scopes = scopes

        # If no credentials are provided, then determine the appropriate
        # defaults.
        if credentials and credentials_file:
            raise core_exceptions.DuplicateCredentialArgs(
                "'credentials_file' and 'credentials' are mutually exclusive"
            )

        if credentials_file is not None:
            credentials, _ = google.auth.load_credentials_from_file(
                credentials_file, **scopes_kwargs, quota_project_id=quota_project_id
            )
        elif credentials is None:
            credentials, _ = google.auth.default(
                **scopes_kwargs, quota_project_id=quota_project_id
            )
            # Don't apply audience if the credentials file passed from user.
            if hasattr(credentials, "with_gdch_audience"):
                credentials = credentials.with_gdch_audience(
                    api_audience if api_audience else host
                )

        # If the credentials are service account credentials, then always try to use self signed JWT.
        if (
            always_use_jwt_access
            and isinstance(credentials, service_account.Credentials)
            and hasattr(service_account.Credentials, "with_always_use_jwt_access")
        ):
            credentials = credentials.with_always_use_jwt_access(True)

        # Save the credentials.
        self._credentials = credentials

        # Save the hostname. Default to port 443 (HTTPS) if none is specified.
        if ":" not in host:
            host += ":443"
        self._host = host

    def _prep_wrapped_messages(self, client_info):
        # Precompute the wrapped methods.
        self._wrapped_methods = {
            self.create_dataset: gapic_v1.method.wrap_method(
                self.create_dataset,
                default_timeout=5.0,
                client_info=client_info,
            ),
            self.get_dataset: gapic_v1.method.wrap_method(
                self.get_dataset,
                default_timeout=5.0,
                client_info=client_info,
            ),
            self.update_dataset: gapic_v1.method.wrap_method(
                self.update_dataset,
                default_timeout=5.0,
                client_info=client_info,
            ),
            self.list_datasets: gapic_v1.method.wrap_method(
                self.list_datasets,
                default_timeout=5.0,
                client_info=client_info,
            ),
            self.delete_dataset: gapic_v1.method.wrap_method(
                self.delete_dataset,
                default_timeout=5.0,
                client_info=client_info,
            ),
            self.import_data: gapic_v1.method.wrap_method(
                self.import_data,
                default_timeout=5.0,
                client_info=client_info,
            ),
            self.export_data: gapic_v1.method.wrap_method(
                self.export_data,
                default_timeout=5.0,
                client_info=client_info,
            ),
            self.list_data_items: gapic_v1.method.wrap_method(
                self.list_data_items,
                default_timeout=5.0,
                client_info=client_info,
            ),
            self.list_saved_queries: gapic_v1.method.wrap_method(
                self.list_saved_queries,
                default_timeout=None,
                client_info=client_info,
            ),
            self.get_annotation_spec: gapic_v1.method.wrap_method(
                self.get_annotation_spec,
                default_timeout=5.0,
                client_info=client_info,
            ),
            self.list_annotations: gapic_v1.method.wrap_method(
                self.list_annotations,
                default_timeout=5.0,
                client_info=client_info,
            ),
        }

    def close(self):
        """Closes resources associated with the transport.

        .. warning::
             Only call this method if the transport is NOT shared
             with other clients - this may cause errors in other clients!
        """
        raise NotImplementedError()

    @property
    def operations_client(self):
        """Return the client designed to process long-running operations."""
        raise NotImplementedError()

    @property
    def create_dataset(
        self,
    ) -> Callable[
        [dataset_service.CreateDatasetRequest],
        Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]],
    ]:
        raise NotImplementedError()

    @property
    def get_dataset(
        self,
    ) -> Callable[
        [dataset_service.GetDatasetRequest],
        Union[dataset.Dataset, Awaitable[dataset.Dataset]],
    ]:
        raise NotImplementedError()

    @property
    def update_dataset(
        self,
    ) -> Callable[
        [dataset_service.UpdateDatasetRequest],
        Union[gca_dataset.Dataset, Awaitable[gca_dataset.Dataset]],
    ]:
        raise NotImplementedError()

    @property
    def list_datasets(
        self,
    ) -> Callable[
        [dataset_service.ListDatasetsRequest],
        Union[
            dataset_service.ListDatasetsResponse,
            Awaitable[dataset_service.ListDatasetsResponse],
        ],
    ]:
        raise NotImplementedError()

    @property
    def delete_dataset(
        self,
    ) -> Callable[
        [dataset_service.DeleteDatasetRequest],
        Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]],
    ]:
        raise NotImplementedError()

    @property
    def import_data(
        self,
    ) -> Callable[
        [dataset_service.ImportDataRequest],
        Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]],
    ]:
        raise NotImplementedError()

    @property
    def export_data(
        self,
    ) -> Callable[
        [dataset_service.ExportDataRequest],
        Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]],
    ]:
        raise NotImplementedError()

    @property
    def list_data_items(
        self,
    ) -> Callable[
        [dataset_service.ListDataItemsRequest],
        Union[
            dataset_service.ListDataItemsResponse,
            Awaitable[dataset_service.ListDataItemsResponse],
        ],
    ]:
        raise NotImplementedError()

    @property
    def list_saved_queries(
        self,
    ) -> Callable[
        [dataset_service.ListSavedQueriesRequest],
        Union[
            dataset_service.ListSavedQueriesResponse,
            Awaitable[dataset_service.ListSavedQueriesResponse],
        ],
    ]:
        raise NotImplementedError()

    @property
    def get_annotation_spec(
        self,
    ) -> Callable[
        [dataset_service.GetAnnotationSpecRequest],
        Union[
            annotation_spec.AnnotationSpec, Awaitable[annotation_spec.AnnotationSpec]
        ],
    ]:
        raise NotImplementedError()

    @property
    def list_annotations(
        self,
    ) -> Callable[
        [dataset_service.ListAnnotationsRequest],
        Union[
            dataset_service.ListAnnotationsResponse,
            Awaitable[dataset_service.ListAnnotationsResponse],
        ],
    ]:
        raise NotImplementedError()

    @property
    def list_operations(
        self,
    ) -> Callable[
        [operations_pb2.ListOperationsRequest],
        Union[
            operations_pb2.ListOperationsResponse,
            Awaitable[operations_pb2.ListOperationsResponse],
        ],
    ]:
        raise NotImplementedError()

    @property
    def get_operation(
        self,
    ) -> Callable[
        [operations_pb2.GetOperationRequest],
        Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]],
    ]:
        raise NotImplementedError()

    @property
    def cancel_operation(
        self,
    ) -> Callable[[operations_pb2.CancelOperationRequest], None,]:
        raise NotImplementedError()

    @property
    def delete_operation(
        self,
    ) -> Callable[[operations_pb2.DeleteOperationRequest], None,]:
        raise NotImplementedError()

    @property
    def wait_operation(
        self,
    ) -> Callable[
        [operations_pb2.WaitOperationRequest],
        Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]],
    ]:
        raise NotImplementedError()

    @property
    def set_iam_policy(
        self,
    ) -> Callable[
        [iam_policy_pb2.SetIamPolicyRequest],
        Union[policy_pb2.Policy, Awaitable[policy_pb2.Policy]],
    ]:
        raise NotImplementedError()

    @property
    def get_iam_policy(
        self,
    ) -> Callable[
        [iam_policy_pb2.GetIamPolicyRequest],
        Union[policy_pb2.Policy, Awaitable[policy_pb2.Policy]],
    ]:
        raise NotImplementedError()

    @property
    def test_iam_permissions(
        self,
    ) -> Callable[
        [iam_policy_pb2.TestIamPermissionsRequest],
        Union[
            iam_policy_pb2.TestIamPermissionsResponse,
            Awaitable[iam_policy_pb2.TestIamPermissionsResponse],
        ],
    ]:
        raise NotImplementedError()

    @property
    def get_location(
        self,
    ) -> Callable[
        [locations_pb2.GetLocationRequest],
        Union[locations_pb2.Location, Awaitable[locations_pb2.Location]],
    ]:
        raise NotImplementedError()

    @property
    def list_locations(
        self,
    ) -> Callable[
        [locations_pb2.ListLocationsRequest],
        Union[
            locations_pb2.ListLocationsResponse,
            Awaitable[locations_pb2.ListLocationsResponse],
        ],
    ]:
        raise NotImplementedError()

    @property
    def kind(self) -> str:
        raise NotImplementedError()

__all__ = ("DatasetServiceTransport",)


text:
<?php

namespace openacalendar\staticweb\errors;

class DataErrorTwoGroupsHaveSameSlugs extends BaseError {

}


text:
<link href="http://kevinburke.bitbucket.org/markdowncss/markdown.css" rel="stylesheet"></link>

Learn Prolog Now!
=================

Notes for
[chapter 10](http://www.learnprolognow.org/lpnpage.php?pagetype=html&pageid=lpn-htmlch10).

I use [swipl](http://www.swi-prolog.org/) as my prolog interpreter.

Chapter 10 - Cuts and Negation
------------------------------

10.1 The Cut
------------

* Automatic backtracking is one of the most characteristic features of Prolog, but it can lead
  to inefficiency.

* So far, we've seen different ways of changing backtracking behaviour - changing the rule
  order and changing the goal order. Both of these are rather crude.

* There is another way - the built-in predicate __!__, called *cut*, which provides a more
  direct way of controlling the way Prolog looks for solutions.

* Cut is essentially a special atom we can use to write clauses.

E.g.:-

```prolog
    p(X):- b(X), c(X), !, d(X), e(X).
```

* Cut always succeeds, and has a side effect - if some goal makes use of this clause (the
  *parent goal*), then the cut commits Prolog to any choices that were made since the parent
  *goal was unified with the left hand side of the rule (including the choice of using that
  *particular clause too).

* Let's consider an example.

Firstly, without a cut:-

```prolog
    p(X):- a(X).
    p(X):- b(X), c(X), d(X), e(X).
    p(X):- f(X).
    a(1).
    b(1).
    b(2).
    c(1).
    c(2).
    d(2).
    e(2).
    f(3).

    ?- p(X).
    X = 1 ;
    X = 2 ;
    X = 3.
```

The search tree for this knowledge base:-

Now let's insert a cut into the second clause:-

```prolog
    p(X):- b(X), c(X), !, d(X), e(X).

    ?- p(X).
    X = 1 ;
    false.
```

What's happening?

1. __p(X)__ is unified with the first rule, so we get __a(X)__. By instantiating __X__ to 1,
Prolog unifies __a(X)__ with __a(1)__, and we have a solution. So far, this is no different
from the first version.

2. We then look for a second solution. __p(X)__ is unified with the second rule, so we get the
new goals __b(X)__, __c(X)__, __!__, __d(X)__, __e(X)__. Prolog then unifies __b(X)__ with the
fact __b(1)__, so we now have the goals __c(1)__, __!__, __d(1)__, __e(1)__. We already have
__c(1)__ in the database so this simplifies to __!__, __d(1)__, __e(1)__.

3. Now things change - __!__ succeeds (as it always does), and commits us to the choices made
so far. Particularly, we commit to having __X = 1__, and we're also committed to using the
second rule.

4. __d(1)__ fails. We can't try __X=2__, as __!__ has committed us to our decisions so far, and
nor can we try __X=3__ for the same reason, so there's no way to satisfy __p(X)__.

In terms of the search tree we have:-

Search stops when the goal __d(1)__ doesn't lead to any node when an alternative choice is
available. The crosses indicate branches which have been trimmed away.

* An important point to consider is that the cut only commits us to the choices made since the
  parent goal was unified with the left hand side of the clause containing the cut.

E.g., for:-

```prolog
    q:- p1, ..., pn, !, r1, ..., rm
```

When we encounter the cut we are committed to using this particular clause for __q__ and the
choices made when evaluating __p1__, ..., __pn__. However, we can backtrack as much as we like
over __r1__, ..., __rm__, and we can also backtrack among choices made before reaching __q__.

* Let's look at a concrete example.

The knowledge base:-

```prolog
    s(X, Y):- q(X, Y).
    s(0, 0).

    q(X, Y):- i(X), j(Y).

    i(1).
    i(2).

    j(1).
    j(2).
    j(3).
```

Querying this KB:-

```prolog
    s(X, Y).
    X = Y, Y = 1 ;
    X = 1,
    Y = 2 ;
    X = 1,
    Y = 3 ;
    X = 2,
    Y = 1 ;
    X = Y, Y = 2 ;
    X = 2,
    Y = 3 ;
    X = Y, Y = 0.
```

With this corresponding search tree:-

* Now let's add a cut:-

```prolog
    q(X,Y):- i(X), !, j(Y).
```

This results in:-

```prolog
    ?- s(X, Y).
    X = Y, Y = 1 ;
    X = 1,
    Y = 2 ;
    X = 1,
    Y = 3 ;
    X = Y, Y = 0.
```

This is because:-

1. __s(X,Y)__ is first unified with the first rule, which gives us a new goal of __q(X,Y)__.

2. __q(X,Y)__ is then unified with the third rule, so our new goal is __i(X), !, j(Y)__. We
instantiate __X__ to 1, therefore unifying __i(X)__ to __i(1)__. We then end up with the goal
__!,j(Y)__. The cut succeeds (of course), and we are committed to the choices we've made so
far.

3. What are these choices we've committed to? That a. __X=1__, and that we're using this
clause. Note that we haven't chosen a value for __Y__.

4. We instantiate __Y__ to 1 and thus __j(Y)__ unifies to __j(1)__.

5. We then backtrack and obtain __Y=2__, and __Y=3__.

7. These are alternatives for __j(X)__. Backtracking to the left of the cut is not permitted,
so we can't reset __X__ to 2, so we don't find those three solutions that the non-cut program
found. Backtracking over goals which were reached before __q(X,Y)__ *is* allowed, so Prolog
will find the second clause for __s/2__.

And the equivalent search tree is:-

10.2 Using Cut
--------------

* So now we know what cut is, but how do we use it in practice, and why is it so useful?

* Let's look at an example of a cut-free predicate __max/3__ which takes integers as arguments
  and succeeds if the third argument is a maximum of the first two.

E.g., we should expect the following queries to succeed:-

```prolog
    ?- max(2,3,3).
    ?- max(3,2,3).
    ?- max(3,3,3).
```

And the following queries should fail:-

```prolog
    ?- max(2,3,2).
    ?- max(2,3,5).
```

Typically we'd use it thus:-

```prolog
    ?- max(2,3,Max).
    Max = 3.
```

We could write this thus:-

```prolog
    max(X,Y,X):- X >= Y.
    max(X,Y,Y):- Y > X.
```

* This is a perfectly fine program, only we find that Prolog will attempt to backtrack
  unnecessarily in the case of __Y>X__. E.g.:-

```prolog
    ?- max(3,2,X).
    X = 3 ;
    false.
```

* The two clauses in this program are mutually exclusive. If the first succeeds, the second
  must fail and vice-versa. Attempting to re-satisfy this clause is a waste of time.

* We can fix this with cut. E.g.:-

```prolog
    max(X,Y,X):- X >= Y, !.
    max(X,Y,Y):- Y > X.
```

And we get:-

```prolog
    ?- max(3,2,X).
    X = 3.
```

* We might think we can be clever and skip out the second clauses altogether. E.g.:-

```prolog
    max(X,Y,X):- X >= Y, !.
    max(X,Y,Y).
```

However this isn't as clever as it seems. Consider:-

```prolog
    ?- max(3,2,2).
    true.
```

This is obviously invalid. What's happened here is that the query has failed to unify at all
with the first clause, but has trivially unified with the second one.

* We don't have this problem with a variable in the third place, as we actually find the
  max in these cases.

* How do we work around this? Our problem was carrying out variable unification before we
  traversed the cut. We can work around this by introducing a third variable, so our first
  clause actually gets evaluated.

```prolog
    max(X,Y,Z):- X >= Y, !, Z = X.
    max(X,Y,Y).
```

This works, e.g.:-

```prolog
    ?- max(3,2,2).
    false.
```

* One important thing to note here is that this is a *red* cut, whereas our initial __max__
  program was a *green* cut. A red cut is, by definition, one whose absence changes the meaning
  of the program, while a green cut does not change its meaning.

* Red cuts are dangerous because they make the code ever more less declarative, and more
  imperative, therefore it can be confusing as to how the program is actually going to behave.

* The best approach to writing cuts in code is to get a non-cut program working, and only then
  try to improve its efficiency by using cuts.

10.3 Negation as Failure
------------------------

* One of Prolog's most useful features is the simple means by which it lets us state
  generalisations. If we want to say that Vincent enjoys burgers then we write. E.g.:-

```prolog
    enjoys(vincent,X):- burger(X).
```

* However, in real life we have exceptions. How do we represent this in Prolog? E.g., consider
  the case where Vincent enjoys burgers, but not Big Kahuna burgers. How do we state this in
  Prolog?

* To begin with, let's look at the built-in predicate __fail/0__. This immediately fails when
  Prolog encounters it as a goal.

* Keep in mind that once Prolog fails, it tries to backtrack. As a result, __fail/0__ can be
  considered an instruction to force immediate backtracking. Using this in combination with
  cut, which blocks backtracking, we are able to use this to write some interesting problems,
  particularly defining exceptions to general rules.

Consider the following KB:-

```prolog
    enjoys(vincent,X):- big_kahuna_burger(X),!,fail.
    enjoys(vincent,X):- burger(X).

    burger(X):- big_mac(X).
    burger(X):- big_kahuna_burger(b).
    burger(X):- whopper(X).

    big_mac(a).
    big_kahuna_burger(b).
    big_mac(c).
    whopper(d).
```

* From this, we can see that our condition, i.e. that vincent does not like Big Kahuna burgers,
  is applied. E.g.:-

```prolog
    ?- enjoys(vincent,a).
    true.

    ?- enjoys(vincent,b).
    false.

    ?- enjoys(vincent,c).
    true.

    ?- enjoys(vincent,d).
    true.
```

* The reason this works is the combination of __!__ and __fail/0__ - the *cut-fail
  combination*. When we run the query __enjoys(vincent,b)__, the first rule applies, and we
  reach the cut. This commits us to the choices we've made, most importantly of course blocking
  the second rule. When we hit __fail/0__, we are forced to backtrack, but the cut prevents it
  so our query fails.

* There is a problem here - the ordering of the rules is vital. If we reverse the first two
  rules, then the meaning of this program changes. Note also that if we remove the cut, the
  program doesn't work properly - a red cut.

* It'd be better if we could extract this to make the program less reliant on the procedural
  qualities of the program.

* We can abstract this idea away. E.g.:-

```prolog
    neg(Goal):- Goal,!,fail.
    neg(Goal).
```

This will succeed if __Goal__ does not succeed. So we can replace the first rule with:-

```prolog
    enjoys(vincent,X):- burger(X), neg(big_kahuna_burger(X)).
```

* Negation as failure is an important tool - it's expressive (we can describe exceptions),
  while being relatively 'safe'. Using this, rather than using the lower-level cut form helps
  us avoid the programming errors that often go along with red cuts.

* In fact, it's so useful that it often comes built in as the __\\+__ operator. E.g.:-

```prolog
    enjoys(vincent,X):- burger(X), \+ big_kahuna_burger(X).
```

* We have to be careful with the order of things again, e.g. if we rewrote our rule. E.g.:-

```prolog
    enjoys(vincent,X):- \+ big_kahuna_burger(X), burger(X).
```

And if we then pose the query, we get:-

```prolog
    ?- enjoys(vincent,X).
    false.
```

* This fails because __big\_kahuna\_burger(X)__ holds as Prolog unifies __X__ to b. If we
  trace:-

```prolog
    [trace]  ?- enjoys(vincent,X).
       Call: (6) enjoys(vincent, _G560) ?
       Call: (7) big_kahuna_burger(_G560) ?
       Exit: (7) big_kahuna_burger(b) ?
       Fail: (6) enjoys(vincent, _G560) ?
    false.
```

* It's generally better to use the *negation as failure* operator than red cuts, but this isn't
  always the case. As always, perf hacks are the exception to the rule.

* Consider the case where we want to capture the condition: 'p holds if a and b hold or a does
  not hold and c holds too.' We can capture this as:-

```prolog
    p:- a, b.
    p:- \+ a, c.
```

* However, suppose this is a very complicated goal which takes a lot of time to compute - we
  might end up having to compute __a__ twice. We can use a red cut to lock into choosing __a__
  and write this as:-

```prolog
    p:- a,!,b.
    p:- c.
```


text:
build-docs:
	rm -rf ./doc
	mkdir ./doc
	javadoc -d ./doc -author -public -tag param -tag precondition:a:"Precondition:" -tag postcondition:a:"Postcondition:" -tag note:a:"Note:" -tag return -tag throws -tag example:a:"Example:" IntLinkedSeq.java

.PHONY: build-docs


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace Kalendar.Zero.Data.Clients.Response
{
    [Serializable]
    [DataContract]
    public class MsonlineInfo
    {
        [DataMember(Name = "contentType")]
        public string ContentType { get; set; }

        [DataMember(Name = "content")]
        public string Content { get; set; }
    }
}


text:
GithubUser = new Mongo.Collection("githubUser");

//ForTest
export const GithubUserCollection = GithubUser;

if (Meteor.isServer) {

  GithubUser.allow({
    insert: function () {
      return true;
    },
    remove: function () {
      return true;
    },
    update: function () {
      return true;
    }

  });

  Meteor.publish('githubUser', function() {
    return GithubUser.find({});
  });

}


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

    <string name="app_name">AutoSpanGridLayout</string>
    <string name="hello_world">Hello world!</string>
    <string name="action_settings">Settings</string>

</resources>


text:
# media-feature-range-operator-space-after

Require a single space or disallow whitespace after the range operator in media features.

<!-- prettier-ignore -->
```css
@media (width >= 600px) {}
/**           ↑
 * The space after this operator */
```

The [`fix` option](../../../docs/user-guide/usage/options.md#fix) can automatically fix all of the problems reported by this rule.

## Options

`string`: `"always"|"never"`

### `"always"`

There _must always_ be a single space after the range operator.

The following patterns are considered problems:

<!-- prettier-ignore -->
```css
@media (width>=600px) {}
```

<!-- prettier-ignore -->
```css
@media (width >=600px) {}
```

The following patterns are _not_ considered problems:

<!-- prettier-ignore -->
```css
@media (width>= 600px) {}
```

<!-- prettier-ignore -->
```css
@media (width >= 600px) {}
```

### `"never"`

There _must never_ be whitespace after the range operator.

The following patterns are considered problems:

<!-- prettier-ignore -->
```css
@media (width>= 600px) {}
```

<!-- prettier-ignore -->
```css
@media (width >= 600px) {}
```

The following patterns are _not_ considered problems:

<!-- prettier-ignore -->
```css
@media (width>=600px) {}
```

<!-- prettier-ignore -->
```css
@media (width >=600px) {}
```


text:
<!DOCTYPE html>
<html lang="en" ng-app="mb">
<head>
  <link rel="stylesheet" type="text/css" href="bootstrap.css"/>
  <link rel="stylesheet" type="text/css" href="<%= grunt.config.get('pkg.name') %>.css"/>

  <script type="text/javascript" src="angular.js"></script>
  <script type="text/javascript" src="angular-ui.js"></script>
  <script type="text/javascript" src="<%= grunt.config.get('pkg.name') %>.js"></script>
</head>

<body ng-controller="MBMainCtrl">
  <div class="container" ui-view>
  </div>
</body>
</html>


text:
package datomisca

import scala.concurrent._
import scala.util.control.NonFatal

import java.{util => ju}

import datomic.ListenableFuture

class Connection(val connection: datomic.Connection) extends AnyVal {

  /** Retrieves a value of the database for reading.
    *
    * Does not communicate with the transactor, nor block.
    *
    * @return the current value of the database.
    */
  def database(): Database = new Database(connection.db())

  /** Used to coordinate with other peers.
    *
    * Returns a future that will acquire a
    * database value guaranteed to include all transactions that were
    * complete at the time sync was called.  Communicates with the
    * transactor.
    *
    * `database()` is the preferred way to get a database value, as
    * it does not need to wait nor block. Only use `sync()` when
    * coordination is required, and you don't have a basis t.
    *
    * Communicates with the transactor. The future can take
    * arbitrarily long to complete. Waiters should specify a timeout.
    *
    * @param exec
    *     an implicit execution context.
    * @return Returns a future that will acquire a
    * database value guaranteed to include all transactions that were
    * complete at the time sync was called.
    */
  def sync()(implicit exec: ExecutionContext): Future[Database] =
    Connection.bridgeDatomicFuture(connection.sync()) map (new Database(_))

  /** Used to coordinate with other peers.
    *
    * Returns a future that will acquire a
    * database value with basisT >= t.
    *
    * `database()` is the preferred way to get a database value,
    * as it does not need to wait nor block. Only use `sync(t)`
    * when coordination is required, and prefer over `sync()` when
    * you have a basis t.
    *
    * Does not communicate with the transactor, so the future may be
    * available immediately. The future can take arbitrarily long to
    * complete. Waiters should specify a timeout.
    *
    * @param t
    *     a basis t.
    * @param exec
    *     an implicit execution context.
    * @return Returns a future that will acquire a
    * database value guaranteed to include all transactions that were
    * complete at the time sync was called.
    */
  def sync(t: Long)(implicit exec: ExecutionContext): Future[Database] =
    Connection.bridgeDatomicFuture(connection.sync(t)) map (new Database(_))

  /** Used to coordinate with background excision.
    *
    * Returns a future that will aquire a database value that is aware
    * of excisions through time <= `t`.
    *
    * Does not communicate with the transactor, so the future may be
    * available immediately. The future can take arbitrarily long to
    * complete. Waiters should specify a timeout.
    *
    * @param t
    *     a basis t.
    * @param exec
    *     an implicit execution context.
    * @return Returns a future that will acquire a database value
    *     that is aware of excisions through time <= `t`.
    */
  def syncExcise(t: Long)(implicit exec: ExecutionContext): Future[Database] =
    Connection.bridgeDatomicFuture(connection.syncExcise(t)) map (new Database(_))

  /** Used to coordinate with background indexing jobs.
    *
    * Returns a future that will acquire a database value that is
    * indexed through time <= t.
    *
    * Does not communicate with the transactor, so the future may be
    * available immediately. The future can take arbitrarily long to
    * complete. Waiters should specify a timeout.
    *
    * @param t
    *     a basis t.
    * @param exec
    *     an implicit execution context.
    * @return Returns a future that will acquire a database value
    *     that is indexed through time <= t.
    */
  def syncIndex(t: Long)(implicit exec: ExecutionContext): Future[Database] =
    Connection.bridgeDatomicFuture(connection.syncIndex(t)) map (new Database(_))

  /** Used to coordinate with background schema changes.
    *
    * Returns a future that will acquire a database value that is
    * aware of all schema changes through time <= t.
    *
    * Does not communicate with the transactor, so the future may be
    * available immediately. The future can take arbitrarily long to
    * complete. Waiters should specify a timeout.
    *
    * @param t
    *     a basis t.
    * @param exec
    *     an implicit execution context.
    * @return Returns a future that will acquire a database value
    *     that is aware of all schema changes through time <= t.
    */
  def syncSchema(t: Long)(implicit exec: ExecutionContext): Future[Database] =
    Connection.bridgeDatomicFuture(connection.syncSchema(t)) map (new Database(_))

  def transact(ops: TraversableOnce[TxData])(implicit ex: ExecutionContext): Future[TxReport] = {
    val arrayList =
      if (ops.isInstanceOf[Iterable[TxData]])
        new ju.ArrayList[AnyRef](ops.size)
      else
        new ju.ArrayList[AnyRef]()

    for (op <- ops)
      arrayList.add(op.toTxData)

    val future = try {
        Connection.bridgeDatomicFuture(connection.transactAsync(arrayList))
      } catch {
        case NonFatal(ex) => Future.failed(ex)
      }

    future map { javaMap: java.util.Map[_, _] =>
      new TxReport(javaMap)
    }
  }

  def txReportQueue(): TxReportQueue = new TxReportQueue(connection.txReportQueue)

  def removeTxReportQueue(): Unit = connection.removeTxReportQueue

  def requestIndex(): Boolean = connection.requestIndex

  def gcStorage(olderThan: java.util.Date): Unit = connection.gcStorage(olderThan)

  /** Request the release of resources associated with this connection.
    * Copied from Datomic Javadoc: Method returns immediately, resources will be
    * released asynchronously. This method should only be called when the entire
    * process is no longer interested in the connection. Note that Datomic
    * connections do not adhere to an acquire/use/release pattern.
    * They are thread-safe, cached, and long lived. Many processes
    * (e.g. application servers) will never call release.
    */
  def release(): Unit = connection.release()

  /** Retrieves a value of the log for reading.
    *
    * Note: the mem db has no log, and thus for it log will return null.
    *
    * (Copied from Datomic docs.)
    *
    * @return the current value of the log.
    */
  def log(): Log = new Log(connection.log())
}

object Connection {

  private[datomisca] def bridgeDatomicFuture[T](listenF: ListenableFuture[T])(implicit ex: ExecutionContext): Future[T] = {
    val p = Promise[T]

    listenF.addListener(
      new java.lang.Runnable {
        override def run: Unit = {
          try {
            p.success(listenF.get())
          } catch {
            case ex: java.util.concurrent.ExecutionException =>
              p.failure(ex.getCause)
            case NonFatal(ex) =>
              p.failure(ex)
          }
          ()
        }
      },
      new java.util.concurrent.Executor {
        def execute(arg0: Runnable): Unit = ex.execute(arg0)
      }
    )

    p.future
  }
}


text:
/*
 * LocalSimilarityGTest.h
 *
 *  Created on: 26.07.2014
 *      Author: Gerd Lindner
 */

#ifndef NOGTEST

#ifndef LOCALSIMILARITYTEST_H_
#define LOCALSIMILARITYTEST_H_

#include <gtest/gtest.h>

namespace NetworKit {

class LocalSimilarityGTest: public testing::Test {

};

} /* namespace NetworKit */
#endif /* LOCALSIMILARITYTEST_H_ */

#endif /*NOGTEST */


text:
#ifndef AudioContext_h
#define AudioContext_h

#include "bindings/v8/ScriptWrappable.h"
#include "core/dom/ActiveDOMObject.h"
#include "core/dom/EventListener.h"
#include "core/dom/EventTarget.h"
#include "core/platform/audio/AudioBus.h"
#include "core/platform/audio/HRTFDatabaseLoader.h"
#include "modules/webaudio/AsyncAudioDecoder.h"
#include "modules/webaudio/AudioDestinationNode.h"
#include "wtf/HashSet.h"
#include "wtf/MainThread.h"
#include "wtf/OwnPtr.h"
#include "wtf/PassRefPtr.h"
#include "wtf/RefCounted.h"
#include "wtf/RefPtr.h"
#include "wtf/ThreadSafeRefCounted.h"
#include "wtf/Threading.h"
#include "wtf/Vector.h"
#include "wtf/text/AtomicStringHash.h"

namespace WebCore {

class AnalyserNode;
class AudioBuffer;
class AudioBufferCallback;
class AudioBufferSourceNode;
class AudioListener;
class AudioSummingJunction;
class BiquadFilterNode;
class ChannelMergerNode;
class ChannelSplitterNode;
class ConvolverNode;
class DelayNode;
class Document;
class DynamicsCompressorNode;
class ExceptionState;
class GainNode;
class HTMLMediaElement;
class MediaElementAudioSourceNode;
class MediaStreamAudioDestinationNode;
class MediaStreamAudioSourceNode;
class OscillatorNode;
class PannerNode;
class PeriodicWave;
class ScriptProcessorNode;
class WaveShaperNode;

// AudioContext is the cornerstone of the web audio API and all AudioNodes are created from it.
// For thread safety between the audio thread and the main thread, it has a rendering graph locking mechanism.

class AudioContext : public ActiveDOMObject, public ScriptWrappable, public ThreadSafeRefCounted<AudioContext>, public EventTarget {
public:
    // Create an AudioContext for rendering to the audio hardware.
    static PassRefPtr<AudioContext> create(Document*);

    // Create an AudioContext for offline (non-realtime) rendering.
    static PassRefPtr<AudioContext> createOfflineContext(Document*, unsigned numberOfChannels, size_t numberOfFrames, float sampleRate, ExceptionState&);

    virtual ~AudioContext();

    bool isInitialized() const;

    bool isOfflineContext() { return m_isOfflineContext; }

    // Returns true when initialize() was called AND all asynchronous initialization has completed.
    bool isRunnable() const;

    HRTFDatabaseLoader* hrtfDatabaseLoader() const { return m_hrtfDatabaseLoader.get(); }

    // Document notification
    virtual void stop();

    Document* document() const; // ASSERTs if document no longer exists.
    bool hasDocument();

    AudioDestinationNode* destination() { return m_destinationNode.get(); }
    size_t currentSampleFrame() const { return m_destinationNode->currentSampleFrame(); }
    double currentTime() const { return m_destinationNode->currentTime(); }
    float sampleRate() const { return m_destinationNode->sampleRate(); }
    unsigned long activeSourceCount() const { return static_cast<unsigned long>(m_activeSourceCount); }

    void incrementActiveSourceCount();
    void decrementActiveSourceCount();

    PassRefPtr<AudioBuffer> createBuffer(unsigned numberOfChannels, size_t numberOfFrames, float sampleRate, ExceptionState&);
    PassRefPtr<AudioBuffer> createBuffer(ArrayBuffer*, bool mixToMono, ExceptionState&);

    // Asynchronous audio file data decoding.
    void decodeAudioData(ArrayBuffer*, PassRefPtr<AudioBufferCallback>, PassRefPtr<AudioBufferCallback>, ExceptionState&);

    AudioListener* listener() { return m_listener.get(); }

    // The AudioNode create methods are called on the main thread (from JavaScript).
    PassRefPtr<AudioBufferSourceNode> createBufferSource();
    PassRefPtr<MediaElementAudioSourceNode> createMediaElementSource(HTMLMediaElement*, ExceptionState&);
    PassRefPtr<MediaStreamAudioSourceNode> createMediaStreamSource(MediaStream*, ExceptionState&);
    PassRefPtr<MediaStreamAudioDestinationNode> createMediaStreamDestination();
    PassRefPtr<GainNode> createGain();
    PassRefPtr<BiquadFilterNode> createBiquadFilter();
    PassRefPtr<WaveShaperNode> createWaveShaper();
    PassRefPtr<DelayNode> createDelay(ExceptionState&);
    PassRefPtr<DelayNode> createDelay(double maxDelayTime, ExceptionState&);
    PassRefPtr<PannerNode> createPanner();
    PassRefPtr<ConvolverNode> createConvolver();
    PassRefPtr<DynamicsCompressorNode> createDynamicsCompressor();
    PassRefPtr<AnalyserNode> createAnalyser();
    PassRefPtr<ScriptProcessorNode> createScriptProcessor(size_t bufferSize, ExceptionState&);
    PassRefPtr<ScriptProcessorNode> createScriptProcessor(size_t bufferSize, size_t numberOfInputChannels, ExceptionState&);
    PassRefPtr<ScriptProcessorNode> createScriptProcessor(size_t bufferSize, size_t numberOfInputChannels, size_t numberOfOutputChannels, ExceptionState&);
    PassRefPtr<ChannelSplitterNode> createChannelSplitter(ExceptionState&);
    PassRefPtr<ChannelSplitterNode> createChannelSplitter(size_t numberOfOutputs, ExceptionState&);
    PassRefPtr<ChannelMergerNode> createChannelMerger(ExceptionState&);
    PassRefPtr<ChannelMergerNode> createChannelMerger(size_t numberOfInputs, ExceptionState&);
    PassRefPtr<OscillatorNode> createOscillator();
    PassRefPtr<PeriodicWave> createPeriodicWave(Float32Array* real, Float32Array* imag, ExceptionState&);

    // When a source node has no more processing to do (has finished playing), then it tells the context to dereference it.
    void notifyNodeFinishedProcessing(AudioNode*);

    // Called at the start of each render quantum.
    void handlePreRenderTasks();

    // Called at the end of each render quantum.
    void handlePostRenderTasks();

    // Called periodically at the end of each render quantum to dereference finished source nodes.
    void derefFinishedSourceNodes();

    // We schedule deletion of all marked nodes at the end of each realtime render quantum.
    void markForDeletion(AudioNode*);
    void deleteMarkedNodes();

    // AudioContext can pull node(s) at the end of each render quantum even when they are not connected to any downstream nodes.
    // These two methods are called by the nodes who want to add/remove themselves into/from the automatic pull lists.
    void addAutomaticPullNode(AudioNode*);
    void removeAutomaticPullNode(AudioNode*);

    // Called right before handlePostRenderTasks() to handle nodes which need to be pulled even when they are not connected to anything.
    void processAutomaticPullNodes(size_t framesToProcess);

    // Keeps track of the number of connections made.
    void incrementConnectionCount()
    {
        ASSERT(isMainThread());
        m_connectionCount++;
    }

    unsigned connectionCount() const { return m_connectionCount; }

    //
    // Thread Safety and Graph Locking:
    //

    void setAudioThread(ThreadIdentifier thread) { m_audioThread = thread; } // FIXME: check either not initialized or the same
    ThreadIdentifier audioThread() const { return m_audioThread; }
    bool isAudioThread() const;

    // Returns true only after the audio thread has been started and then shutdown.
    bool isAudioThreadFinished() { return m_isAudioThreadFinished; }

    // mustReleaseLock is set to true if we acquired the lock in this method call and caller must unlock(), false if it was previously acquired.
    void lock(bool& mustReleaseLock);

    // Returns true if we own the lock.
    // mustReleaseLock is set to true if we acquired the lock in this method call and caller must unlock(), false if it was previously acquired.
    bool tryLock(bool& mustReleaseLock);

    void unlock();

    // Returns true if this thread owns the context's lock.
    bool isGraphOwner() const;

    // Returns the maximum numuber of channels we can support.
    static unsigned maxNumberOfChannels() { return MaxNumberOfChannels;}

    class AutoLocker {
    public:
        AutoLocker(AudioContext* context)
            : m_context(context)
        {
            ASSERT(context);
            context->lock(m_mustReleaseLock);
        }

        ~AutoLocker()
        {
            if (m_mustReleaseLock)
                m_context->unlock();
        }
    private:
        AudioContext* m_context;
        bool m_mustReleaseLock;
    };

    // In AudioNode::deref() a tryLock() is used for calling finishDeref(), but if it fails keep track here.
    void addDeferredFinishDeref(AudioNode*);

    // In the audio thread at the start of each render cycle, we'll call handleDeferredFinishDerefs().
    void handleDeferredFinishDerefs();

    // Only accessed when the graph lock is held.
    void markSummingJunctionDirty(AudioSummingJunction*);
    void markAudioNodeOutputDirty(AudioNodeOutput*);

    // Must be called on main thread.
    void removeMarkedSummingJunction(AudioSummingJunction*);

    // EventTarget
    virtual const AtomicString& interfaceName() const;
    virtual ScriptExecutionContext* scriptExecutionContext() const;
    virtual EventTargetData* eventTargetData() { return &m_eventTargetData; }
    virtual EventTargetData* ensureEventTargetData() { return &m_eventTargetData; }

    DEFINE_ATTRIBUTE_EVENT_LISTENER(complete);

    // Reconcile ref/deref which are defined both in ThreadSafeRefCounted and EventTarget.
    using ThreadSafeRefCounted<AudioContext>::ref;
    using ThreadSafeRefCounted<AudioContext>::deref;

    void startRendering();
    void fireCompletionEvent();

    static unsigned s_hardwareContextCount;

protected:
    explicit AudioContext(Document*);
    AudioContext(Document*, unsigned numberOfChannels, size_t numberOfFrames, float sampleRate);

    static bool isSampleRateRangeGood(float sampleRate);

private:
    void constructCommon();

    void lazyInitialize();
    void uninitialize();

    // ScriptExecutionContext calls stop twice.
    // We'd like to schedule only one stop action for them.
    bool m_isStopScheduled;
    static void stopDispatch(void* userData);
    void clear();

    void scheduleNodeDeletion();
    static void deleteMarkedNodesDispatch(void* userData);

    bool m_isInitialized;
    bool m_isAudioThreadFinished;

    // The context itself keeps a reference to all source nodes.  The source nodes, then reference all nodes they're connected to.
    // In turn, these nodes reference all nodes they're connected to.  All nodes are ultimately connected to the AudioDestinationNode.
    // When the context dereferences a source node, it will be deactivated from the rendering graph along with all other nodes it is
    // uniquely connected to.  See the AudioNode::ref() and AudioNode::deref() methods for more details.
    void refNode(AudioNode*);
    void derefNode(AudioNode*);

    // When the context goes away, there might still be some sources which haven't finished playing.
    // Make sure to dereference them here.
    void derefUnfinishedSourceNodes();

    RefPtr<AudioDestinationNode> m_destinationNode;
    RefPtr<AudioListener> m_listener;

    // Only accessed in the audio thread.
    Vector<AudioNode*> m_finishedNodes;

    // We don't use RefPtr<AudioNode> here because AudioNode has a more complex ref() / deref() implementation
    // with an optional argument for refType.  We need to use the special refType: RefTypeConnection
    // Either accessed when the graph lock is held, or on the main thread when the audio thread has finished.
    Vector<AudioNode*> m_referencedNodes;

    // Accumulate nodes which need to be deleted here.
    // This is copied to m_nodesToDelete at the end of a render cycle in handlePostRenderTasks(), where we're assured of a stable graph
    // state which will have no references to any of the nodes in m_nodesToDelete once the context lock is released
    // (when handlePostRenderTasks() has completed).
    Vector<AudioNode*> m_nodesMarkedForDeletion;

    // They will be scheduled for deletion (on the main thread) at the end of a render cycle (in realtime thread).
    Vector<AudioNode*> m_nodesToDelete;
    bool m_isDeletionScheduled;

    // Only accessed when the graph lock is held.
    HashSet<AudioSummingJunction*> m_dirtySummingJunctions;
    HashSet<AudioNodeOutput*> m_dirtyAudioNodeOutputs;
    void handleDirtyAudioSummingJunctions();
    void handleDirtyAudioNodeOutputs();

    // For the sake of thread safety, we maintain a seperate Vector of automatic pull nodes for rendering in m_renderingAutomaticPullNodes.
    // It will be copied from m_automaticPullNodes by updateAutomaticPullNodes() at the very start or end of the rendering quantum.
    HashSet<AudioNode*> m_automaticPullNodes;
    Vector<AudioNode*> m_renderingAutomaticPullNodes;
    // m_automaticPullNodesNeedUpdating keeps track if m_automaticPullNodes is modified.
    bool m_automaticPullNodesNeedUpdating;
    void updateAutomaticPullNodes();

    unsigned m_connectionCount;

    // Graph locking.
    Mutex m_contextGraphMutex;
    volatile ThreadIdentifier m_audioThread;
    volatile ThreadIdentifier m_graphOwnerThread; // if the lock is held then this is the thread which owns it, otherwise == UndefinedThreadIdentifier

    // Only accessed in the audio thread.
    Vector<AudioNode*> m_deferredFinishDerefList;

    // HRTF Database loader
    RefPtr<HRTFDatabaseLoader> m_hrtfDatabaseLoader;

    // EventTarget
    virtual void refEventTarget() { ref(); }
    virtual void derefEventTarget() { deref(); }
    EventTargetData m_eventTargetData;

    RefPtr<AudioBuffer> m_renderTarget;

    bool m_isOfflineContext;

    AsyncAudioDecoder m_audioDecoder;

    // This is considering 32 is large enough for multiple channels audio.
    // It is somewhat arbitrary and could be increased if necessary.
    enum { MaxNumberOfChannels = 32 };

    // Number of AudioBufferSourceNodes that are active (playing).
    int m_activeSourceCount;
};

} // WebCore

#endif // AudioContext_h


text:
require File.expand_path('../boot', __FILE__)

require 'rails/all'
require 'amazon/ecs'
require 'open-uri'

# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)

module TheBeautyShop
  class Application < Rails::Application
    # Settings in config/environments/* take precedence over those specified here.
    # Application configuration should go into files in config/initializers
    # -- all .rb files in that directory are automatically loaded.

    # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
    # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
    # config.time_zone = 'Central Time (US & Canada)'

    # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
    # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
    # config.i18n.default_locale = :de

    # Do not swallow errors in after_commit/after_rollback callbacks.
    config.active_record.raise_in_transactional_callbacks = true

    # uuid
    #config.generators do |g|
    #  g.orm :active_record, primary_key_type: :uuid
    #end

    Dotenv.load

    Amazon::Ecs.configure do |options|
      options[:AWS_access_key_id] = ENV["AWS_ACCESS_KEY_ID"]
      options[:AWS_secret_key] = ENV["AWS_SECRET_KEY"]
      options[:associate_tag] = ENV["ASSOCIATE_TAG"]
    end

  end
end


text:
"""Tool for converting Google Code issues to a format accepted by BitBucket.

Most BitBucket concepts map cleanly to their Google Code equivalent, with the
exception of the following:
 - Issue Assignee is called an Owner
 - Issue Reporter is called an Author
 - Comment User is called an Author
"""

import argparse
import json
import sys

import issues

def _getKind(kind):
  mapping = {
    "defect": "bug",
    "enhancement": "enhancement",
    "task": "task",
    "review": "proposal",
    "other": "bug",
  }
  return mapping.get(kind.lower(), "bug")

def _getPriority(priority):
  mapping = {
    "low": "trivial",
    "medium": "minor",
    "high": "major",
    "critical": "critical",
  }
  return mapping.get(priority.lower(), "minor")

def _getStatus(status):
  mapping = {
      "new": "new",
      "fixed": "resolved",
      "invalid": "invalid",
      "duplicate": "duplicate",
      "wontfix": "wontfix",
  }
  return mapping.get(status.lower(), "new")

def _getTitle(title):
  if len(title) < 255:
    return title
  return title[:250] + "[...]"

class UserService(issues.UserService):
  """BitBucket user operations.
  """

  def IsUser(self, username):
    """Returns wheter a username is a valid user.

    BitBucket does not have a user api, so accept all usernames.
    """
    return True

class IssueService(issues.IssueService):
  """Abstract issue operations.

  Handles creating and updating issues and comments on an user API.
  """
  def __init__(self):
    self._bitbucket_issues = []
    self._bitbucket_comments = []

  def GetIssues(self, state="open"):
    """Gets all of the issue for the repository.

    Since BitBucket does not have an issue API, always returns an empty list.

    Args:
      state: The state of the repository can be either 'open' or 'closed'.

    Returns:
      An empty list.
    """
    return []

  def CreateIssue(self, googlecode_issue):
    """Creates an issue.

    Args:
      googlecode_issue: An instance of GoogleCodeIssue

    Returns:
      The issue number of the new issue.

    Raises:
      ServiceError: An error occurred creating the issue.
    """
    bitbucket_issue = {
        "assignee": googlecode_issue.GetOwner(),
        "content": googlecode_issue.GetDescription(),
        "content_updated_on": googlecode_issue.GetContentUpdatedOn(),
        "created_on": googlecode_issue.GetCreatedOn(),
        "id": googlecode_issue.GetId(),
        "kind": _getKind(googlecode_issue.GetKind()),
        "priority": _getPriority(googlecode_issue.GetPriority()),
        "reporter": googlecode_issue.GetAuthor(),
        "status": _getStatus(googlecode_issue.GetStatus()),
        "title": _getTitle(googlecode_issue.GetTitle()),
        "updated_on": googlecode_issue.GetUpdatedOn()
    }
    self._bitbucket_issues.append(bitbucket_issue)
    return googlecode_issue.GetId()

  def CloseIssue(self, issue_number):
    """Closes an issue.

    Args:
      issue_number: The issue number.
    """

  def CreateComment(self, issue_number, source_issue_id,
                    googlecode_comment, project_name):
    """Creates a comment on an issue.

    Args:
      issue_number: The issue number.
      source_issue_id: The Google Code issue id.
      googlecode_comment: An instance of GoogleCodeComment
      project_name: The Google Code project name.
    """
    bitbucket_comment = {
        "content": googlecode_comment.GetDescription(),
        "created_on": googlecode_comment.GetCreatedOn(),
        "id": googlecode_comment.GetId(),
        "issue": googlecode_comment.GetIssue().GetId(),
        "updated_on": googlecode_comment.GetUpdatedOn(),
        "user": googlecode_comment.GetAuthor()
    }
    self._bitbucket_comments.append(bitbucket_comment)

  def WriteIssueData(self, default_issue_kind):
    """Writes out the json issue and comments data to db-1.0.json.
    """
    issues_data = {
        "issues": self._bitbucket_issues,
        "comments": self._bitbucket_comments,
        "meta": {
            "default_kind": default_issue_kind
        }
    }
    with open("db-1.0.json", "w") as issues_file:
      issues_json = json.dumps(issues_data, sort_keys=True, indent=4,
                               separators=(",", ": "))
      issues_file.write(issues_json)

def ExportIssues(issue_file_path, project_name,
                 user_file_path, default_issue_kind):
  """Exports all issues for a given project.
  """
  issue_service = IssueService()
  user_service = UserService()

  issue_data = issues.LoadIssueData(issue_file_path, project_name)
  user_map = issues.LoadUserData(user_file_path, user_service)

  issue_exporter = issues.IssueExporter(
      issue_service, user_service, issue_data, project_name, user_map)

  try:
    issue_exporter.Init()
    issue_exporter.Start()
    issue_service.WriteIssueData(default_issue_kind)
    print "\nDone!\n"
  except IOError, e:
    print "[IOError] ERROR: %s" % e
  except issues.InvalidUserError, e:
    print "[InvalidUserError] ERROR: %s" % e

def main(args):
  """The main function.

  Args:
    args: The command line arguments.

  Raises:
    ProjectNotFoundError: The user passed in an invalid project name.
  """
  parser = argparse.ArgumentParser()
  parser.add_argument("--issue_file_path", required=True,
                      help="The path to the file containing the issues from"
                      "Google Code.")
  parser.add_argument("--project_name", required=True,
                      help="The name of the Google Code project you wish to"
                      "export")
  parser.add_argument("--user_file_path", required=False,
                      help="The path to the file containing a mapping from"
                      "email address to bitbucket username")
  parser.add_argument("--default_issue_kind", required=False,
                      help="A non-null string containing one of the following"
                      "values: bug, enhancement, proposal, task. Defaults to"
                      "bug")
  parsed_args, _ = parser.parse_known_args(args)

  # Default value.
  if not parsed_args.default_issue_kind:
    print "Using default issue kind of 'bug'."
    parsed_args.default_issue_kind = "bug"

  ExportIssues(
    parsed_args.issue_file_path, parsed_args.project_name,
    parsed_args.user_file_path, parsed_args.default_issue_kind)

if __name__ == "__main__":
  main(sys.argv)


text:
using ExampleClient.Repositories;
using ExampleClient.ViewModels;
using ExampleClient.Views;
using SaturdayMP.XPlugins.Notifications;
using Xamarin.Forms;

namespace ExampleClient
{
    /// <summary>
    ///     Handle notifications.
    /// </summary>
    public class NotificationObserver : INotificationObserver
    {
        /// <summary>
        ///     When a notification is recieved update the repository and show
        ///     the recieved notification to the user.
        /// </summary>
        /// <param name="notification"></param>
        public void NotificationReceived(Notification notification)
        {
            // Copy the notification values to the view model
            var viewModel = new NotificationRecievedViewModel
            {
                Id = notification.Id,
                Title = notification.Title,
                Message = notification.Message
            };

            // Only copy the extra info if it exists.
            if (notification.ExtraInfo.ContainsKey("ExtraInfoOne"))
                viewModel.ExtraInfoOne = notification.ExtraInfo["ExtraInfoOne"];

            if (notification.ExtraInfo.ContainsKey("ExtraInfoTwo"))
                viewModel.ExtraInfoTwo = notification.ExtraInfo["ExtraInfoTwo"];

            // Save the recieved view model.
            ScheduledNotificationRepository.NotificationRecieved(notification.Id, viewModel.Title, viewModel.Message, viewModel.ExtraInfoOne, viewModel.ExtraInfoTwo);

            // Show the notifcation page.
            var notificationPage = new NotificationRecievedPage(viewModel);
            Application.Current.MainPage.Navigation.PushAsync(notificationPage);
        }
    }
}


text:
// CocoaUPnP by A&R Cambridge Ltd, http://www.arcam.co.uk
// Copyright 2015 Arcam. See LICENSE file.

#import <Foundation/Foundation.h>

@class UPPEventSubscriptionManager;

/**
 This protocol describes a required subscription notification method which
 conforming objects are expected to implement.
 */
@protocol UPPEventSubscriptionDelegate <NSObject>

/**
 A method which is called whenever an incoming event is detected.

 @param event A dictionary representation of the XML sent by the subscribed
 service.
 */
- (void)eventReceived:(nonnull NSDictionary *)event;
@end

/**
 This class models a UPnP subscription. It retains information passed back in
 the header of a `SUBSCRIBE` call. Additionally, it keeps an array of observers
 which in turn are informed of any UPnP event passed in from the manager.
 */
@interface UPPEventSubscription : NSObject

#pragma mark - Properties

///-----------------------------------------------------------------------------
/// @name Properties
///-----------------------------------------------------------------------------

/**
 The subscription identifier returned by the service.
 */
@property (copy, nonatomic, readonly, nullable) NSString *subscriptionID;

/**
 The date at which the subscription is expired by the service.
 */
@property (strong, nonatomic, readonly, nullable) NSDate *expiryDate;

/**
 The URL where the service expects subscription calls to be made.
 */
@property (strong, nonatomic, readonly, nonnull) NSURL *eventSubscriptionURL;

/**
 A timer which fires 30 seconds before the subscription is due to expire, which
 triggers the subscription's manager to resubscribe.
 */
@property (strong, nonatomic, readonly, nullable) NSTimer *renewTimer;

/**
 A timer which fires at the subscriptions expiration date, which triggers the
 subscription's manager to attempt to subscribe again or scrap the subscription.
 */
@property (strong, nonatomic, readonly, nullable) NSTimer *expirationTimer;

/**
 The manager responsible for making the subscription network calls.
 */
@property (weak, nonatomic, nullable) UPPEventSubscriptionManager *manager;

/**
 The unique name of the service that the subscription applies to
 */
@property (copy, nonatomic, readonly, nonnull) NSString *uniqueServiceName;

#pragma mark - Initialisation

///-----------------------------------------------------------------------------
/// @name Initialisation
///-----------------------------------------------------------------------------

/**
 Convenience initialiser which returns a new subscription object when passed in
 an event subscription URL.

 @param eventSubscriptionURL The full event subscription URL, which is used when
 resubscribing or unsubscribing from events.
 @param serviceIdentifier    The unique name of the service the subscription
 relates to

 @return Returns a new subscription object.
 */
+ (nonnull instancetype)subscriptionWithSubscriptionURL:(nonnull NSURL *)eventSubscriptionURL serviceIdentifier:(nonnull NSString *)uniqueServiceName;

/**
 Convenience initialiser which returns a new subscription object when given a
 subscription identifier, an expiry date and an event subscription URL.

 @param subscriptionID       The subscription identifier returned by the service.
 @param expiryDate           The date at which the subscription is expired by the
 service.
 @param eventSubscriptionURL The full event subscription URL, which is used when
 resubscribing or unsubscribing from events.
 @param serviceIdentifier    The unique name of the service the subscription.

 @return Returns a new subscription object.
 */
+ (nonnull instancetype)subscriptionWithID:(nullable NSString *)subscriptionID expiryDate:(nonnull NSDate *)expiryDate eventSubscriptionURL:(nonnull NSURL *)eventSubscriptionURL serviceIdentifier:(nonnull NSString *)uniqueServiceName;

/**
 Update the object after renewing a subscription.

 @param subscriptionID The subscription identifier returned by the service being
 subscribed to.
 @param expiryDate     The date which the subscription expires. Decided by the
 UPnP service currently being subscribed to.
 */
- (void)updateSubscriptionID:(nonnull NSString *)subscriptionID expiryDate:(nonnull NSDate *)expiryDate;

#pragma mark - Events

///-----------------------------------------------------------------------------
/// @name Events
///-----------------------------------------------------------------------------

/**
 Add an observer you wish to be informed of UPnP events.

 @param observer An observer class conforming to `UPPEventSubscriptionDelegate`
 */
- (void)addEventObserver:(nonnull id <UPPEventSubscriptionDelegate>)observer;

/**
 Remove a previously added observer, once you no longer wish to be notified of
 new events.

 @param observer An observer class conforming to `UPPEventSubscriptionDelegate`
 */
- (void)removeEventObserver:(nonnull id <UPPEventSubscriptionDelegate>)observer;

/**
 An array of event observers.
 */
- (nonnull NSArray *)eventObservers;

/**
 Inform all observers of a new event.

 @param event A dictionary containing parsed XML related to the event.
 */
- (void)informObserversOfEvent:(nonnull NSDictionary *)event;

#pragma mark - Background Helpers

///-----------------------------------------------------------------------------
/// @name Events
///-----------------------------------------------------------------------------

/**
 Invalidate both expiration and renew subscription timers.
 */
- (void)invalidateTimers;

/**
 Renew subscription after returning from background operation.
 */
- (void)renewSubscription;

@end


text:
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Renci.SshNet.Tests.Common;

namespace Renci.SshNet.Tests.Classes.Common
{
    /// <summary>
    /// Provides data for <see cref="Renci.SshNet.Channels.Channel.RequestReceived"/> event.
    /// </summary>
    [TestClass]
    public class ChannelRequestEventArgsTest : TestBase
    {
    }
}


text:
package net.theinterweb.Client;

import java.awt.Color;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;
import javax.swing.JTextPane;
import javax.swing.border.LineBorder;

public class LoginPanel extends JPanel {
	/**
	 *
	 */
	private static final long serialVersionUID = 2844664515768867717L;
	public JPasswordField jpf_Password;
	public JTextField jtf_Username;
	public JButton btn_SignUp;
	public JButton btn_Submit;

	/**
	 * Create the panel.
	 */
	public LoginPanel() {
		setLayout(null);

		jpf_Password = new JPasswordField();
		jpf_Password.setBounds(123, 188, 254, 28);
		jpf_Password.setColumns(20);
		add(jpf_Password);

		btn_Submit = new JButton("Login");
		btn_Submit.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
			}
		});
		btn_Submit.setBounds(123, 228, 117, 29);
		add(btn_Submit);

		JLabel lblPassword = new JLabel("Password:");
		lblPassword.setBounds(54, 194, 63, 16);
		add(lblPassword);

		JLabel lblUsername = new JLabel("Username:");
		lblUsername.setBounds(47, 127, 70, 16);
		add(lblUsername);

		jtf_Username = new JTextField();
		jtf_Username.setBounds(123, 121, 254, 28);
		add(jtf_Username);
		jtf_Username.setColumns(20);

		JPanel panel = new JPanel();
		panel.setBorder(new LineBorder(new Color(0, 0, 0)));
		panel.setBounds(434, 20, 245, 260);
		add(panel);
		panel.setLayout(null);

		JLabel lblUpdateNotes = new JLabel("Update Notes:");
		lblUpdateNotes.setBounds(6, 6, 89, 16);
		panel.add(lblUpdateNotes);

		JTextPane txtpn_UpdateNotes = new JTextPane();
		txtpn_UpdateNotes.setEditable(false);
		txtpn_UpdateNotes.setBackground(this.getBackground());
		txtpn_UpdateNotes.setText("* Added Support for Multiplayer\n\n\n* Support for login\n\n\n* Server can hold multiple games at once");
		txtpn_UpdateNotes.setBounds(16, 34, 211, 207);
		panel.add(txtpn_UpdateNotes);

		JLabel lblNewLabel = new JLabel("Hearthstone");
		lblNewLabel.setFont(new Font("Lucida Grande", Font.PLAIN, 35));
		lblNewLabel.setBounds(150, 35, 211, 61);
		add(lblNewLabel);

		btn_SignUp = new JButton("Sign Up");
		btn_SignUp.setBounds(260, 228, 117, 29);
		add(btn_SignUp);

	}
}


text:
FROM rancher/confd-base:0.11.0-dev-rancher

ADD ./conf.d /etc/confd/conf.d
ADD ./templates /etc/confd/templates
VOLUME /etc/logstash
VOLUME /opt/logstash/patterns

ENTRYPOINT ["/confd"]
CMD ["--backend", "rancher", "--prefix", "/2015-07-25"]