text:
(function($) {

  $.fn.tweet = function(o){
    var s = {
      username: ["seaofclouds"],                // [string]   required, unless you want to display our tweets. :) it can be an array, just do ["username1","username2","etc"]
      list: null,                               // [string]   optional name of list belonging to username
      avatar_size: null,                        // [integer]  height and width of avatar if displayed (48px max)
      count: 3,                                 // [integer]  how many tweets to display?
      intro_text: null,                         // [string]   do you want text BEFORE your your tweets?
      outro_text: null,                         // [string]   do you want text AFTER your tweets?
      join_text:  null,                         // [string]   optional text in between date and tweet, try setting to "auto"
      auto_join_text_default: "i said,",        // [string]   auto text for non verb: "i said" bullocks
      auto_join_text_ed: "i",                   // [string]   auto text for past tense: "i" surfed
      auto_join_text_ing: "i am",               // [string]   auto tense for present tense: "i was" surfing
      auto_join_text_reply: "i replied to",     // [string]   auto tense for replies: "i replied to" @someone "with"
      auto_join_text_url: "i was looking at",   // [string]   auto tense for urls: "i was looking at" http:...
      loading_text: null,                       // [string]   optional loading text, displayed while tweets load
      query: null,                              // [string]   optional search query
      refresh_interval: null ,                  // [integer]  optional number of seconds after which to reload tweets
      twitter_url: "twitter.com",               // [string]   custom twitter url, if any (apigee, etc.)
      twitter_api_url: "api.twitter.com",       // [string]   custom twitter api url, if any (apigee, etc.)
      twitter_search_url: "search.twitter.com"  // [string]   custom twitter search url, if any (apigee, etc.)
    };

    if(o) $.extend(s, o);

    $.fn.extend({
      linkUrl: function() {
        var returning = [];
        // See http://daringfireball.net/2010/07/improved_regex_for_matching_urls
        var regexp = /\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»""'']))/gi;
        this.each(function() {
          returning.push(this.replace(regexp,
                                      function(match) {
                                        var url = (/^[a-z]+:/i).test(match) ? match : "http://"+match;
                                        return ""+match+"";
                                      }));
        });
        return $(returning);
      },
      linkUser: function() {
        var returning = [];
        var regexp = /[\@]+([A-Za-z0-9-_]+)/gi;
        this.each(function() {
          returning.push(this.replace(regexp,"@$1"));        });
        return $(returning);
      },
      linkHash: function() {
        var returning = [];
        var regexp = /(?:^| )[\#]+([A-Za-z0-9-_]+)/gi;
        this.each(function() {
          returning.push(this.replace(regexp, ' #$1'));
        });
        return $(returning);
      },
      capAwesome: function() {
        var returning = [];
        this.each(function() {
          returning.push(this.replace(/\b(awesome)\b/gi, '$1'));
        });
        return $(returning);
      },
      capEpic: function() {
        var returning = [];
        this.each(function() {
          returning.push(this.replace(/\b(epic)\b/gi, '$1'));
        });
        return $(returning);
      },
      makeHeart: function() {
        var returning = [];
        this.each(function() {
          returning.push(this.replace(/(<)+[3]/gi, "<tt class='heart'>♥</tt>"));
        });
        return $(returning);
      }
    });

    function parse_date(date_str) {
      // The non-search twitter APIs return inconsistently-formatted dates, which Date.parse
      // cannot handle in IE. We therefore perform the following transformation:
      // "Wed Apr 29 08:53:31 +0000 2009" => "Wed, Apr 29 2009 08:53:31 +0000"
      return Date.parse(date_str.replace(/^([a-z]{3})( [a-z]{3} \d\d?)(.*)( \d{4})$/i, '$1,$2$4$3'));
    }

    function relative_time(time_value) {
      var parsed_date = parse_date(time_value);
      var relative_to = (arguments.length > 1) ? arguments[1] : new Date();
      var delta = parseInt((relative_to.getTime() - parsed_date) / 1000);
      var r = '';
      if (delta < 60) {
	r = delta + ' seconds ago';
      } else if(delta < 120) {
	r = 'a minute ago';
      } else if(delta < (45*60)) {
	r = (parseInt(delta / 60, 10)).toString() + ' minutes ago';
      } else if(delta < (2*60*60)) {
	r = 'an hour ago';
      } else if(delta < (24*60*60)) {
	r = '' + (parseInt(delta / 3600, 10)).toString() + ' hours ago';
      } else if(delta < (48*60*60)) {
	r = 'a day ago';
      } else {
	r = (parseInt(delta / 86400, 10)).toString() + ' days ago';
      }
      return 'about ' + r;
    }

    function build_url() {
      var proto = ('https:' == document.location.protocol ? 'https:' : 'http:');
      if (s.list) {
        return proto+"//"+s.twitter_api_url+"/1/"+s.username[0]+"/lists/"+s.list+"/statuses.json?per_page="+s.count+"&callback=?";
      } else if (s.query == null && s.username.length == 1) {
        return proto+'//'+s.twitter_api_url+'/1/statuses/user_timeline.json?screen_name='+s.username[0]+'&count='+s.count+'&include_rts=1&callback=?';
      } else {
        var query = (s.query || 'from:'+s.username.join(' OR from:'));
        return proto+'//'+s.twitter_search_url+'/search.json?&q='+encodeURIComponent(query)+'&rpp='+s.count+'&callback=?';
      }
    }

    return this.each(function(i, widget){
      var list = $('
').appendTo(widget);
      var intro = '
'+s.intro_text+'
';
      var outro = '
'+s.outro_text+'
';
      var loading = $('
'+s.loading_text+'
');

      if(typeof(s.username) == "string"){
        s.username = [s.username];
      }

      if (s.loading_text) $(widget).append(loading);
      $(widget).bind("load", function(){
        $.getJSON(build_url(), function(data){
          if (s.loading_text) loading.remove();
          if (s.intro_text) list.before(intro);
          list.empty();
          var tweets = (data.results || data);
          $.each(tweets, function(i,item){
            // auto join text based on verb tense and content
            if (s.join_text == "auto") {
              if (item.text.match(/^(@([A-Za-z0-9-_]+)) .*/i)) {
                var join_text = s.auto_join_text_reply;
              } else if (item.text.match(/(^\w+:\/\/[A-Za-z0-9-_]+\.[A-Za-z0-9-_:%&\?\/.=]+) .*/i)) {
                var join_text = s.auto_join_text_url;
              } else if (item.text.match(/^((\w+ed)|just) .*/im)) {
                var join_text = s.auto_join_text_ed;
              } else if (item.text.match(/^(\w*ing) .*/i)) {
                var join_text = s.auto_join_text_ing;
              } else {
                var join_text = s.auto_join_text_default;
              }
            } else {
              var join_text = s.join_text;
            };

            var from_user = item.from_user || item.user.screen_name;
            var profile_image_url = item.profile_image_url || item.user.profile_image_url;
            var join_template = ' '+join_text+' ';
            var join = ((s.join_text) ? join_template : ' ');
            var avatar_template = '';
            var avatar = (s.avatar_size ? avatar_template : '');
            var date = ''+relative_time(item.created_at)+'';
            var text = '' +$([item.text]).linkUrl().linkUser().linkHash().makeHeart().capAwesome().capEpic()[0]+ '';

            // until we create a template option, arrange the items below to alter a tweet's display.
            list.append('
' + avatar + date + join + text + '
');

            list.children('li:first').addClass('tweet_first');
            list.children('li:odd').addClass('tweet_even');
            list.children('li:even').addClass('tweet_odd');
          });
          if (s.outro_text) list.after(outro);
          $(widget).trigger("loaded").trigger((tweets.length == 0 ? "empty" : "full"));
          if (s.refresh_interval) {
            window.setTimeout(function() { $(widget).trigger("load"); }, 1000 * s.refresh_interval);
          };
        });
      }).trigger("load");
    });
  };
})(jQuery);


text:
namespace ImagenomicAnalytics {
    class MultipleObjectFeatureAnalysisFilter {
    public:
        typedef MultipleObjectFeatureAnalysisFilter Self;

        ////////////////////////////////////////////////////////////////////////////////
        /// ctor
        MultipleObjectFeatureAnalysisFilter();

        MultipleObjectFeatureAnalysisFilter(std::ostream &outputStream);

        ~MultipleObjectFeatureAnalysisFilter() {}
        /// ctor, end
        ////////////////////////////////////////////////////////////////////////////////

        ////////////////////////////////////////////////////////////////////////////////
        /// public fn

        ///--------------------------------------------------------------------------------
        /// Input: Note that we Assume the spacing of both m_RGBImage and
        /// m_binaryObjectMask are correctly set to mpp
        void setInputRGBImage(itkRGBImageType::Pointer inputRGBImage) { m_RGBImage = inputRGBImage; }

        void setObjectBinaryMask(itkBinaryMaskImageType::Pointer binaryObjectMask) {
            m_binaryObjectMask = binaryObjectMask;
            m_labelComputed = 0;
        }

        void setTopLeft(int64_t x, int64_t y) {
            m_TopLeftX = x;
            m_TopLeftY = y;
        }

        void setMpp(double mpp_val) {
			m_mpp = mpp_val;
		}

        void setObjectLabeledMask(itkLabelImageType::Pointer labeledMask) {
            m_objectLabelImage = labeledMask;
            m_labelComputed = 1;
        }

        void setFeatureNames() {
            ImagenomicAnalytics::SingleObjectFeatureAnalysisFilter tmp;
            featureNames = tmp.getFeatureNames();
            this->numberOfFeatureNoPolygon = static_cast<int>(this->featureNames.size());
            std::cout << this->numberOfFeatureNoPolygon << std::endl;
        }

        std::vector<std::string> getFeatureNames() {
            return featureNames;
        }

        std::vector<std::vector<FeatureValueType> > getFeatures();

        void update();
        ///================================================================================

        ///--------------------------------------------------------------------------------
        /// Output
        void outputFeaturesToFile(std::string outputFeaturesFileName);

        void outputFeaturesToConsole();
        ///================================================================================

        ///--------------------------------------------------------------------------------
        /// Output 2
        void outputFeaturesCSV(std::ofstream &outputFeatureFile, std::vector<std::vector<FeatureValueType> > features) {
            printFeatureNames(featureNames, outputFeatureFile);
            printFeatures(features, outputFeatureFile, numberOfFeatureNoPolygon);

        }
        ///================================================================================

        /// public fn, end
        ////////////////////////////////////////////////////////////////////////////////

    private:
        std::ostream &m_outputStream;

        ////////////////////////////////////////////////////////////////////////////////
        /// private data

        ///--------------------------------------------------------------------------------
        /// Input data
        itkRGBImageType::Pointer m_RGBImage;
        itkBinaryMaskImageType::Pointer m_binaryObjectMask;
        int64_t m_TopLeftX; // the x of the top left corner of this tile in the WSI, in index (pixel) space
        int64_t m_TopLeftY;
		double m_mpp;
        ///================================================================================

        int m_labelComputed;

        std::vector<std::string> featureNames;

        ///--------------------------------------------------------------------------------
        /// Computed data
        itkLabelImageType::Pointer m_objectLabelImage;
        std::vector<std::string> m_featureNames;
        std::vector<std::vector<FeatureValueType> > m_featuresOfAllObjects;

        int64_t m_totalNumberOfConnectedComponents;
        ///================================================================================

        // Output
        int numberOfFeatureNoPolygon;

        bool m_allDone;
        /// private data, end
        ////////////////////////////////////////////////////////////////////////////////

        ////////////////////////////////////////////////////////////////////////////////
        /// private fn
        void _init();

        void _computeFeaturesForAllObjects();
        /// private fn
        ////////////////////////////////////////////////////////////////////////////////
    };

}// namespace gth818n

#endif

redpajama_set_name: RedPajamaGithub


text:
@class CContact, NSDictionary, NSString, WAWebViewController;

@protocol WAAppTaskLoaderDelegate <NSObject>
- (void)removeAndPopAllParentWebViewFromChild:(WAWebViewController *)arg1;
- (void)removeParentWebView:(WAWebViewController *)arg1;
- (void)removeChildWebView:(WAWebViewController *)arg1 fromParentWebView:(WAWebViewController *)arg2;
- (void)getChildWebView:(id *)arg1 withRelativeURL:(NSString *)arg2 childExtraInfo:(NSDictionary *)arg3 fromParentWebView:(WAWebViewController *)arg4;
- (void)setupAppServiceAndWebViewWithAppID:(NSString *)arg1 contact:(CContact *)arg2 baseURL:(NSString *)arg3 pageRelativeURL:(NSString *)arg4 getWebView:(id *)arg5;
@end


text:
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com

using System;

namespace ITCC.UI.Attributes
{
    [AttributeUsage(AttributeTargets.Property)]
    public class HeaderTooltipAttribute : Attribute
    {
        public HeaderTooltipAttribute(string tooltipContent, bool isLongTooltip = false)
        {
            TooltipContent = tooltipContent;
            IsLongTooltip = isLongTooltip;
        }

        public readonly string TooltipContent;

        public readonly bool IsLongTooltip;
    }
}


text:
copyright:

  years: 2015, 2016

---
{:shortdesc: .shortdesc}
{:codeblock: .codeblock}
{:screen: .screen}
{:new_window: target="_blank"}

# Comandos do Cloud Foundry (cf)

*Última atualização: 29 de janeiro de 2016*

É possível usar os comandos do Cloud Foundry (cf) para gerenciar os seus apps.
{:shortdesc}

As informações a seguir listam os comandos cf usados mais comumente para gerenciar apps. Para listar todos os comandos cf e suas informações de ajuda, use `cf help`. Use `cf command_name -h` para visualizar informações detalhadas da ajuda para um comando específico.

*Nota:* Se a sua rede contiver um servidor proxy HTTP entre o host que executa os comandos cf e o terminal da API do Cloud Foundry, deve-se especificar o nome do host ou endereço IP do servidor proxy configurando a variável de ambiente `HTTP_PROXY`. Para obter detalhes, consulte [Usando a CLI cf com um Servidor Proxy HTTP](http://docs.cloudfoundry.org/devguide/installcf/http-proxy.html).

## cf api

Exibe ou especifica a URL do terminal da API do {{site.data.keyword.Bluemix_notm}}.
```
cf api BluemixServerURL
```

BluemixServerURL

A URL do terminal da API do Bluemix que você deve especificar ao se conectar ao {{site.data.keyword.Bluemix_notm}}. Normalmente, essa URL é https://api.{DomainName}.
Se você deseja exibir a URL do terminal da API que estiver usando atualmente, não será necessário especificar esse parâmetro para o comando cf api.

*--skip-ssl-validation*

Desativa o processo de validação SSL. O uso desse parâmetro pode causar problemas de segurança.

*--unset*

Remove as informações de conexão para todos os terminais API.

## cf apps

Lista todos os aplicativos que você implementou no espaço atual. O status
de cada aplicativo também é exibido.

Suponha que tenha uma instância para um app, na coluna de instâncias da resposta do comando cf apps, você verá 1/1 se seu app estiver ativo e 0/1 se seu app estiver inativo. Se você vir ?/1, que indica que o estado da instância do app é desconhecido, será possível copiar a URL do app para seu navegador para verificar se o app responde ou acompanhar o log pelo comando `cf logs appname` para ver se o app está gerando conteúdo de log.

## cf bind-service

Liga uma instância de serviço existente ao seu aplicativo.
```
cf bind-service appname service_instance
```

Por exemplo, se você tiver uma instância de serviço nomeada `my_dataworks` em sua organização e espaço atuais, é possível usar `cf bind-service my_app
my_dataworks` para ligar essa instância de serviço ao seu aplicativo.

appname

O nome do aplicativo.

service_instance

O nome da instância de serviço existente.

## cf create-service

Cria uma instância de serviço.
```
cf create-service service_name service_plan service_instance
```
Por exemplo, é possível usar `cf create-service DataWorks free my_dataworks` para criar uma instância do serviço {{site.data.keyword.dataworks_short}} com um plano grátis.

nome_do_serviço

O nome do serviço.

service_plan

O nome do plano de serviço.

service_instance

O nome que você deseja usar para a nova instância de serviço que você criar.

## cf create-space

Cria um espaço.
```
cf create-space space_name
```

space_name

O nome do espaço.

*-o *

O nome da organização dentro do qual você deseja criar um espaço.

*-q
*

A cota para designar ao espaço recentemente criado. Se não especificado, uma cota padrão será designada automaticamente.

## cf delete

Exclui um aplicativo existente.
```
cf delete appname
```

appname

O nome do aplicativo.

*-f*

Força a exclusão do aplicativo sem nenhuma confirmação. Esse parâmetro é opcional.

*-r*

Exclui todos os nomes de domínio que são associados com o aplicativo. Esse parâmetro é opcional.

## cf delete-space

Exclui um espaço.
```
cf delete-space space_name
```

space_name

O nome do espaço.

*-f*

Força a exclusão do espaço sem nenhuma confirmação. Esse parâmetro é opcional.

*Nota:* A exclusão de um espaço é uma operação irreversível.

## cf events

Exibe eventos de tempo de execução que estão relacionados a um aplicativo.
```
cf events appname
```

appname

O nome do aplicativo.

## cf help

Exibe informações da ajuda para todos os comandos cf ou para um comando cf específico se o parâmetro command_name for usado.
```
cf help command_name
```

command_name

O nome de um comando. Se desejar informações de ajuda que sejam específicas para um comando, é possível usar esse
parâmetro.

Se você não especificar esse parâmetro, informações de ajuda de todos os comandos cf serão exibidas.

## cf login

Efetua seu
login no {{site.data.keyword.Bluemix_notm}}.
```
cf login
```
É possível usar um ou mais dos parâmetros a seguir ao emitir o comando cf login:

*-a* https://api.{DomainName}

A URL do terminal da API do
{{site.data.keyword.Bluemix_notm}}. Esse parâmetro é opcional.

*-u*user_name

Seu nome de usuário. Esse parâmetro é opcional.

*-p*password

Sua senha.

*Importante:* Se você fornecer sua senha usando o parâmetro *-p* na interface de linha de comandos, a senha poderá ser registrada no histórico da linha de comandos. Por motivos de segurança, evite fornecer a senha usando o parâmetro -p. Em vez disso,
insira a senha quando a interface da linha de comandos solicitar.

*-o*organization_name

O nome da organização na qual você deseja efetuar login.

*-s*space_name

O nome do espaço no qual você deseja efetuar login.

*--skip-ssl-validation*

Desativa o processo de validação SSL. O uso desse parâmetro pode causar problemas de segurança.

*Nota:* Se você fornecer a sua senha no parâmetro *-p* desse comando, sua senha poderá ser registrada no arquivo histórico do comando shell e poderá ser visível para outros usuários do sistema operacional local.

## cf logs

Exibe os fluxos de log STDOUT e STDERR de um aplicativo.
```
cf logs appname
```

appname

O nome do aplicativo.

*--recent*

Recupera logs recentes.

## cf marketplace

Lista todos os serviços que estão disponíveis no mercado. Os serviços listados por esse comando também são mostrados no Catálogo do {{site.data.keyword.Bluemix_notm}}.
```
cf marketplace
```

## cf push

Implementa um novo aplicativo no Bluemix ou atualiza um aplicativo existente no Bluemix.
```
cf push appname
```

appname

O nome do aplicativo.

*-b*buildpack_name

O nome do buildpack. O buildpack_name pode ser um buildpack customizado por nome ou uma URL Git, por exemplo, `my-buildpack` ou
`https://github.com/heroku/heroku-buildpack-play.git`.

*-c*start_command

O comando start do seu aplicativo. Para usar o comando inicial padrão, especifique um valor de null para essa opção. Por
exemplo:

```
cf push appname -c null
```

Também
é possível usar esta opção para executar arquivos de script. Por exemplo:
```
cf push appname -c "bash ./<run.sh>"
```

*-f* manifest_path

O caminho do arquivo de manifesto. O arquivo manifest padrão é manifest.yml sob o diretório-raiz de seu aplicativo.

*-i*instance_number

O número de instâncias.

*-k*disk_limit

O limite de disco para o aplicativo, por exemplo, *256M*, *1024M*
oi *1G*.

*-m*memory_limit

O limite de memória para o aplicativo, por exemplo, *256M*, *1024M*
ou *1G*.

*-n*host_name

O nome do host para o aplicativo, por exemplo, *my-subdomain*.

*-p*app_path

O caminho para o diretório do aplicativo ou o archive do aplicativo

*-t*timeout

Tempo máximo, em segundos, para o aplicativo iniciar. Outros tempos-limite do lado do servidor podem substituir esse
valor.

*-s* stackname

A pilha para executar os apps. Uma pilha é um sistema de arquivos pré-construído que inclui o sistema operacional. Use `cf stacks` para visualizar as pilhas disponíveis no {{site.data.keyword.Bluemix_notm}}.

*--no-hostname*

Mapeia o domínio do sistema do Bluemix para esse aplicativo.

*--no-manifest*

Ignora o arquivo de manifesto padrão.

*--no-route*

Não mapeia uma rota para esse aplicativo.

*--no-start*

Não inicia o aplicativo após sua implementação.

*--random-route*

Cria uma rota aleatória para o aplicativo.

## cf scale

Exibe ou muda o número da instância, o limite de espaço em disco e o limite de memória para um aplicativo.
```
cf scale appname -i instance_number -k disk_limit -m memory_limit
```

appname

O nome do aplicativo.

*-i*instance_number

O número de instâncias

*-k*disk_limit

O limite de disco para o aplicativo, por exemplo, *256M*, *1024M*
oi *1G*.

*-m*memory_limit

O limite de memória para o aplicativo, por exemplo, *256M*, *1024M*
ou *1G*.

*-f*

Força o aplicativo a reiniciar sem prompt.

## cf services

Lista todos os serviços que estão disponíveis no espaço
atual.
```
cf services
```

## cf set-env

Configura uma variável de ambiente para um aplicativo.
```
cf set-env appname var_name var_value
```

appname

O nome do aplicativo.

var_name

O nome da variável de ambiente.

var_value

O valor da variável de ambiente.

## cf stacks

Lista todas as
pilhas. Uma pilha é um sistema de arquivos pré-construído, incluindo um
sistema operacional que pode executar apps.
```
cf stacks
```

## cf stop

Para um aplicativo.
```
cf stop appname
```

appname

O nome do aplicativo.

## cf -v

Exibe a versão da interface da linha de comandos do cf.
```
cf -v
```

# rellinks
{: #rellinks}
## general
{: #general}
* [Cartão de referência rápida - comandos cf](ftp://public.dhe.ibm.com/cloud/bluemix/cli_reference_card.pdf)


text:
set -e

# Update this as the draft we support updates.
OPENSSL_BRANCH=${OPENSSL_BRANCH:-"OpenSSL_1_1_1q+quic"}

# Set these, if desired, to change these to your preferred installation
# directory
BASE=${BASE:-"/opt"}
OPENSSL_BASE=${OPENSSL_BASE:-"${BASE}/openssl-quic"}
OPENSSL_PREFIX=${OPENSSL_PREFIX:-"${OPENSSL_BASE}-${OPENSSL_BRANCH}"}
MAKE="make"

# These are for Linux like systems, specially the LDFLAGS, also depends on dirs above
CFLAGS=${CFLAGS:-"-O3 -g"}
CXXFLAGS=${CXXFLAGS:-"-O3 -g"}
LDFLAGS=${LDFLAGS:-"-Wl,-rpath=${OPENSSL_PREFIX}/lib"}

if [ -e /etc/redhat-release ]; then
    MAKE="gmake"
    echo "+-------------------------------------------------------------------------+"
    echo "| You probably need to run this, or something like this, for your system: |"
    echo "|                                                                         |"
    echo "|   sudo yum -y install libev-devel jemalloc-devel python2-devel          |"
    echo "|   sudo yum -y install libxml2-devel c-ares-devel libevent-devel         |"
    echo "|   sudo yum -y install jansson-devel zlib-devel systemd-devel            |"
    echo "+-------------------------------------------------------------------------+"
    echo
    echo
elif [ -e /etc/debian_version ]; then
    echo "+-------------------------------------------------------------------------+"
    echo "| You probably need to run this, or something like this, for your system: |"
    echo "|                                                                         |"
    echo "|   sudo apt -y install libev-dev libjemalloc-dev python2-dev libxml2-dev |"
    echo "|   sudo apt -y install libpython2-dev libc-ares-dev libsystemd-dev       |"
    echo "|   sudo apt -y install libevent-dev libjansson-dev zlib1g-dev            |"
    echo "+-------------------------------------------------------------------------+"
    echo
    echo
fi

set -x

# OpenSSL needs special hackery ... Only grabbing the branch we need here... Bryan has shit for network.
echo "Building OpenSSL with QUIC support"
[ ! -d openssl-quic ] && git clone -b ${OPENSSL_BRANCH} --depth 1 https://github.com/quictls/openssl.git openssl-quic
cd openssl-quic
./config enable-tls1_3 --prefix=${OPENSSL_PREFIX}
${MAKE} -j $(nproc)
sudo ${MAKE} install

# The symlink target provides a more convenient path for the user while also
# providing, in the symlink source, the precise branch of the OpenSSL build.
sudo ln -sf ${OPENSSL_PREFIX} ${OPENSSL_BASE}
cd ..

# Then nghttp3
echo "Building nghttp3..."
[ ! -d nghttp3 ] && git clone https://github.com/ngtcp2/nghttp3.git
cd nghttp3
autoreconf -if
./configure \
  --prefix=${BASE} \
  PKG_CONFIG_PATH=${BASE}/lib/pkgconfig:${OPENSSL_PREFIX}/lib/pkgconfig \
  CFLAGS="${CFLAGS}" \
  CXXFLAGS="${CXXFLAGS}" \
  LDFLAGS="${LDFLAGS}" \
  --enable-lib-only
${MAKE} -j $(nproc)
sudo ${MAKE} install
cd ..

# Now ngtcp2
echo "Building ngtcp2..."
[ ! -d ngtcp2 ] && git clone https://github.com/ngtcp2/ngtcp2.git
cd ngtcp2
autoreconf -if
./configure \
  --prefix=${BASE} \
  PKG_CONFIG_PATH=${BASE}/lib/pkgconfig:${OPENSSL_PREFIX}/lib/pkgconfig \
  CFLAGS="${CFLAGS}" \
  CXXFLAGS="${CXXFLAGS}" \
  LDFLAGS="${LDFLAGS}" \
  --enable-lib-only
${MAKE} -j $(nproc)
sudo ${MAKE} install
cd ..

# Then nghttp2, with support for H3
echo "Building nghttp2 ..."
[ ! -d nghttp2 ] && git clone https://github.com/tatsuhiro-t/nghttp2.git
cd nghttp2
git checkout --track -b quic origin/quic
autoreconf -if
./configure \
  --prefix=${BASE} \
  PKG_CONFIG_PATH=${BASE}/lib/pkgconfig:${OPENSSL_PREFIX}/lib/pkgconfig \
  CFLAGS="${CFLAGS}" \
  CXXFLAGS="${CXXFLAGS}" \
  LDFLAGS="${LDFLAGS}" \
  --enable-lib-only
${MAKE} -j $(nproc)
sudo ${MAKE} install
cd ..

# And finally curl
echo "Building curl ..."
[ ! -d curl ] && git clone https://github.com/curl/curl.git
cd curl
autoreconf -i
./configure \
  --prefix=${BASE} \
  --with-ssl=${OPENSSL_PREFIX} \
  --with-nghttp2=${BASE} \
  --with-nghttp3=${BASE} \
  --with-ngtcp2=${BASE} \
  CFLAGS="${CFLAGS}" \
  CXXFLAGS="${CXXFLAGS}" \
  LDFLAGS="${LDFLAGS}"
${MAKE} -j $(nproc)
sudo ${MAKE} install


text:
module Refinery
  module Resources
    class Engine < ::Rails::Engine
      include Refinery::Engine

      isolate_namespace Refinery
      engine_name :refinery_resources

      config.autoload_paths += %W( #{config.root}/lib )

      initializer 'setup-refinery-resources-with-dragonfly', :before => :load_config_initializers do
        ::Refinery::Resources::Dragonfly.setup!
      end

      initializer 'attach-refinery-resources-with-dragonfly', :after => :load_config_initializers do |app|
        ::Refinery::Resources::Dragonfly.configure!
        ::Refinery::Resources::Dragonfly.attach!(app)
      end

      initializer "register refinery_files plugin" do
        Refinery::Plugin.register do |plugin|
          plugin.pathname = root
          plugin.name = 'refinery_files'
          plugin.menu_match = /refinery\/(refinery_)?(files|resources)$/
          plugin.version = %q{2.0.0}
          plugin.activity = { :class_name => :'refinery/resource' }
          plugin.url = proc { Refinery::Core::Engine.routes.url_helpers.admin_resources_path }
        end
      end

      config.after_initialize do
        Refinery.register_extension(Refinery::Resources)
      end
    end
  end
end


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content">

    <ImageView
        android:id="@+id/cvc_help"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true"
        android:background="@android:color/white"
        android:contentDescription="@string/card_cvc_help_description"
        android:padding="30dp" />
</RelativeLayout>


text:
require 'mkmf'

pkg_name = File.basename(File.dirname(File.expand_path(__FILE__)))

dir_config(pkg_name)
have_library("c", "main")

# Check for prerequisite ZFS header and library.
have_library('zfs', 'zpool_create') || failed_prereqs = true
have_header('libzfs.h') || failed_prereqs = true

create_makefile(pkg_name) unless failed_prereqs


text:
OPEN_RDO_RUNTIME_NAMESPACE

class RDODPTSearchRuntime: public RDODPTSearchTrace
{
DECLARE_FACTORY(RDODPTSearchRuntime);

private:
    RDODPTSearchRuntime(const LPRDORuntime& pRuntime, LPIBaseOperationContainer parent, const LPRDOCalc& _pCondition, const LPRDOCalc& _pTermCondition, const LPRDOCalc& _pEvaluateBy, bool _compTops, RDODPTSearchTrace::TraceFlag _traceFlag);

    LPRDOCalc pCondition;
    LPRDOCalc pTermCondition;
    LPRDOCalc pEvaluateBy;
    bool compTops;

    virtual bool onCheckCondition(const LPRDORuntime& pRuntime);
    virtual bool TermCondition(const LPRDORuntime& pRuntime);
    virtual double EvaluateBy(const LPRDORuntime& pRuntime);
    virtual bool NeedCompareTops();
};

CLOSE_RDO_RUNTIME_NAMESPACE


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DVM4T.Contracts;
using Dynamic = DD4T.ContentModel;
using DD4T.Mvc.SiteEdit;
using DD4T.ContentModel;

namespace DVM4T.DD4T.XPM
{
    /// <summary>
    /// XPM Markup Service for the DD4T DVM4T implementation
    /// </summary>
    /// <remarks>Does not support use of other DVM4T Implementations</remarks>
    public class XpmMarkupService : IXpmMarkupService
    {
        private Dynamic.IField CreateDD4TField(IFieldData field)
        {
            //Dynamic.Schema schema = field.EmbeddedSchema != null ?
            //    new Dynamic.Schema
            //    {
            //        RootElementName = field.EmbeddedSchema.RootElementName,
            //        Title = field.EmbeddedSchema.Title,
            //        Id = field.EmbeddedSchema.TcmUri
            //    }
            //    : new Dynamic.Schema();
            //return new Dynamic.Field
            //{
            //    XPath = field.XPath,
            //    Name = field.Name,
            //    EmbeddedSchema = schema
            //};
            return field == null ? null : field.BaseData as Dynamic.IField; //Will only work with DD4T implementation
        }
        public string RenderXpmMarkupForField(IFieldData field, int index = -1)
        {
            var dd4tField = CreateDD4TField(field);
            var result = index >= 0 ? SiteEditService.GenerateSiteEditFieldTag(dd4tField, index)
                            : SiteEditService.GenerateSiteEditFieldTag(dd4tField);
            return result ?? string.Empty;
        }

        public string RenderXpmMarkupForComponent(IComponentPresentationData cp, string region = null)
        {
            var dd4tCP = cp == null ? null : cp.BaseData as IComponentPresentation; //Will only work with DD4T implementation
            //new Dynamic.ComponentPresentation
            //{
            //    Component = new Dynamic.Component
            //    {
            //        Id = cp.Component.TcmUri,
            //        Title = cp.Component.Title,
            //        PublicationId = "tcm:0-" + cp.Component.PublicationId + "-1"
            //    },
            //    ComponentTemplate = new Dynamic.ComponentTemplate
            //    {
            //        Title = cp.Template.Title,
            //        Id = cp.Template.TcmUri,
            //        RevisionDate = cp.Template.RevisionDate
            //    }
            //};
            return SiteEditService.GenerateSiteEditComponentTag(dd4tCP, region);
        }

        public bool IsSiteEditEnabled(ITridionItemData item)
        {
            int publicationId = 0;
            try
            {
                publicationId = new TcmUri(item.TcmUri).PublicationId;
            }
            catch (Exception)
            {
                publicationId = 0;
            }
            return IsSiteEditEnabled(publicationId);
        }

        public bool IsSiteEditEnabled(int publicationId)
        {
            var settings = SiteEditService.SiteEditSettings.FirstOrDefault(x => x.Key == publicationId.ToString());
            return settings.Value == null ? false : settings.Value.Enabled;
        }
    }
}


text:
import * as test from '../../src/test';
import * as xml from '../../src/index';
import '../../src/test/jsx';

abstract class SyntaxErrorTest extends test.UnitTest {
	protected get parsedDocument() { return this._parsedDocument; }

	protected get syntaxError() { return this._syntaxErrror; }

	protected async parse(stringToParse: string): Promise<void> {
		try {
			this._parsedDocument = await xml.Parser.parseStringToAst(stringToParse);
		} catch(err) {
			this._syntaxErrror = err;
		}
	}

	private _parsedDocument: xml.ast.DocumentNode;

	private _syntaxErrror: xml.SyntaxError;
}

class TagNameStartingWithPeriod extends SyntaxErrorTest {
	protected async performTest() {
		await this.parse('<.a />');
		await this.assert(this.syntaxError instanceof xml.SyntaxError, 'exception is a SyntaxError object');
		await this.assert(this.syntaxError.getErrorCode() === xml.SyntaxErrorCode.InvalidTagName, 'exception has correct code');
	}
}

abstract class ExcessCloseTagTest extends SyntaxErrorTest {
	protected abstract getStringToParse(): string;

	protected async performTest() {
		await this.parse(this.getStringToParse());
		await this.assert(this.syntaxError instanceof xml.SyntaxError, 'exception is a SyntaxError object');
		await this.assert(this.syntaxError.getErrorCode() === xml.SyntaxErrorCode.ExcessCloseTag, 'exception has correct code');
	}
}

class ExcessCloseTagInRoot extends ExcessCloseTagTest {
	protected getStringToParse(): string {
		return '</alpha>';
	}
}

class ExcessCloseTagAfterSelfCloseInRoot extends ExcessCloseTagTest {
	protected getStringToParse(): string {
		return '<alpha /></alpha>';
	}
}

class NestedExcessCloseTag extends ExcessCloseTagTest {
	protected getStringToParse(): string {
		return `
			<alpha>
				<beta>
				</beta>
				</beta>
			</alpha>
		`;
	}
}

class NestedExcessCloseTagAfterSelfClose extends ExcessCloseTagTest {
	protected getStringToParse(): string {
		return `
			<alpha>
				<beta />
				</beta>
			</alpha>
		`;
	}
}

@TestRunner.testName('Syntax Errors')
export class TestRunner extends test.TestRunner {
	constructor() {
		super();
		this.add(
			new TagNameStartingWithPeriod(),
			new ExcessCloseTagInRoot(),
			new ExcessCloseTagAfterSelfCloseInRoot(),
			new NestedExcessCloseTag(),
			new NestedExcessCloseTagAfterSelfClose()
		);
	}
}


text:
<?xml version="1.0" encoding="utf-8"?>
<EditText xmlns:android="http://schemas.android.com/apk/res/android"
  android:id="@+id/edit_text"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:layout_below="@+id/password_text"
  android:layout_centerHorizontal="true"
  android:layout_margin="16dp"
  android:inputType="text"
  android:singleLine="true" />


text:
The User Agent (UA) in Chrome for iOS is the same as the Mobile Safari
user agent, with `CriOS/<ChromeRevision>` instead of
`Version/<VersionNum>`.

Here's an example of the **Chrome** UA on iPhone:

```
Mozilla/5.0 (iPhone; CPU iPhone OS 10_3 like Mac OS X)
AppleWebKit/602.1.50 (KHTML, like Gecko) CriOS/56.0.2924.75
Mobile/14E5239e Safari/602.1
```

For comparison, the **Mobile Safari** UA:

```
Mozilla/5.0 (iPhone; CPU iPhone OS 10_3 like Mac OS X)
AppleWebKit/603.1.23 (KHTML, like Gecko) Version/10.0
Mobile/14E5239e Safari/602.1
```

When the Request Desktop Site feature is enabled, the **Desktop Safari** UA is
sent:

```
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4)
AppleWebKit/600.7.12 (KHTML, like Gecko) Version/8.0.7
Safari/600.7.12
```


text:
param
(
  [string]$shims = "netstandard"
)
$genapi = "\\fxcore\tools\others\GenAPI\GenAPI.exe";

if ($shims -eq "netstandard")
{
    $refPath = Resolve-Path "..\..\..\bin\obj\CompatShims\ref\netstandard1.6"
    $refVersionPath = Resolve-Path "..\..\..\bin\obj\CompatShims\ref\net47"
}
elseif ($shims -eq "netfx")
{
    $refPath = "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7"
}

$shimOutput = $shims;
$shimlistFile = "$shims.shimlist.txt";

if (!(Test-Path $shimlistFile))
{
    Write-Error "Shim list doesn't exist $shimList";
    exit;
}
$shimList = gc $shimlistFile;

$projTemplate = gc shim.projtemplate

$netstandardRef = "..\..\..\bin\ref\netstandard\2.0.0.0\netstandard.dll";
$extensionsDir = "..\..\..\bin\ref\extensions\";
$netstandardAndExtensionsAPIList = "netstandardAndExtensionsAPIList.txt";

& $genapi -writer:DocIds -assembly:$netstandardRef,$extensionsDir -out:$netstandardAndExtensionsAPIList

foreach ($shim in $shimList)
{
    if ($shim[0] -eq '#') { continue; }

    $shimForwards = "$shimOutput\$shim.Forwards.cs";
    $shimProject = "$shimOutput\$shim.csproj";
    $shimContract = "$refPath\$shim.dll";

    if (!(Test-Path $shimContract))
    {
        Write-Host "Assembly $shimContract doesn't exist so skipping."
        continue;
    }

    Write-Host "Generating forwards and project for $shimContract";

    $asmName = [System.Reflection.AssemblyName]::GetAssemblyName($shimContract);
    $asmVersion = $asmName.Version;

    if ($refVersionPath -ne "" -and (Test-Path "$refVersionPath\$shim.dll"))
    {
        $asmRefVersion = [System.Reflection.AssemblyName]::GetAssemblyName("$refVersionPath\$shim.dll");

        if ($asmRefVersion.Version -gt $asmName.Version)
        {
            $asmVersion = $asmRefVersion.Version;
        }
    }

    # Increment the patch version by 1 above the highest stable release to ensure we are higher then any servicing
    $asmVersion = new-object System.Version($asmVersion.Major, $asmVersion.Minor, ($asmVersion.Build+1), 0)

    $asmVersion = $asmVersion.ToString()
    $asmToken = $asmName.GetPublicKeyToken()[0].ToString("x2");
    if ($asmToken -eq "b0")
    {
        $token = "MSFT";
    }
    elseif ($asmToken -eq "b7")
    {
        $token = "ECMA";
    }
    elseif ($asmToken -eq "cc")
    {
        $token = "Open";
    }
    elseif ($asmToken -eq "31")
    {
        $token = "SilverlightExtension";
    }
    else
    {
        Write-Error "Don't know which key is token $asmToken";
    }

    & $genapi -writer:TypeForwards -assembly:"$shimContract" -apiList:"$netstandardAndExtensionsAPIList" -out:"$shimForwards" -libpath:"$refPath"
    #& $genapi -writer:TypeForwards -assembly:"$shimContract" -out:"$shimForwards" -libpath:"$refPath"
    $projTemplate.Replace("[SHIM]", $shim).Replace("[TOKEN]", $token).Replace("[VERSION]", $asmVersion).Replace("[KEY]", $token) | sc "$shimProject"
}


text:
package org.o3project.odenos.remoteobject.messagingclient;

import java.io.Closeable;
import java.net.ProtocolException;
import java.util.Set;

/**
 * Pubsub driver interface.
 */
public interface IPubSubDriver extends Closeable {

  /**
   * Starts services.
   */
  void start();

  /**
   * Closes.
   */
  void close();

  /**
   * Checks if the implementation class is started.
   *
   * @return boolean isStarted
   */
  boolean isStarted();

  /**
   * Subscribes channels.
   *
   * @param channels Set String
   */
  void subscribeChannels(Set<String> channels);

  /**
   * Subscribe a channel.
   *
   * @param channel String
   */
  void subscribeChannel(String channel);

  /**
   * Unsubscribes channels.
   *
   * @param channels Set String
   */
  void unsubscribeChannels(Set<String> channels);

  /**
   * Unsubscribe a channel.
   *
   * @param channel String
   */
  void unsubscribeChannel(String channel);

  /**
   * Unsubscribe all the channels.
   */
  void unsubscribeAll();

  /**
   * Subscribes channels.
   *
   * @param patterns Set String
   */
  void psubscribeChannels(Set<String> patterns);

  /**
   * Subscribe a channel.
   *
   * @param pattern String
   */
  void psubscribeChannel(String pattern);

  /**
   * Unsubscribes channels.
   *
   * @param patterns Set String
   */
  void punsubscribeChannels(Set<String> patterns);

  /**
   * Unsubscribe a channel.
   *
   * @param pattern String
   */
  void punsubscribeChannel(String pattern);

  /**
   * Unsubscribe all the channels.
   */
  void punsubscribeAll();

  /**
   * Publishes a message to listeners.
   *
   * @param channel String
   * @param data  byte[]
   */
  void publish(String channel, byte[] data);

  /**
   * Checks if the channel exists.
   *
   * @param channel Channel to be checked
   * @return true if the channel exists
   * @throws ProtocolException operation failed
   */
  boolean channelExist(String channel) throws ProtocolException;

  /**
   * This method provides extended features for future enhancements.
   *
   * @param name String
   * @param <K> K
   * @param <V> V
   * @return K, V K,V
   */
  <K, V> IMultiMap<K, V> getMultiMap(String name);

}


text:
<?php

/**
 * List of enabled modules for this application.
 *
 * This should be an array of module namespaces used in the application.
 */
return [
    'Zend\Cache',
    'Zend\Serializer',
    'Zend\Mvc\Plugin\Identity',
    'Zend\Paginator',
    'Zend\Mvc\Plugin\FlashMessenger',
    'Zend\Session',
    'Zend\Db',
    'Zend\I18n',
    'Zend\Form',
    'Zend\InputFilter',
    'Zend\Filter',
    'Zend\Hydrator',
    'Zend\Router',
    'Zend\Validator',
    'Application',
    'Blog',
    'User'
];


text:
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSP Reference</title>
<link rel="author" title="Intel" href="http://www.intel.com"/>

Three cheers    for OldVet and the letter he wrote to Senator Dodd (see above Comment).  We all need to be proactive and contact our senators and representatives to let them know our strong feelings on this subject.  I would lose what little faith I have left in our government if they engineered a tax payer bailout.


text:
#include "jerryscript-debugger.h"
#include "jerryscript-port.h"

#include "jerryscript-ext/handler.h"

/**
 * Provide a 'print' implementation for scripts.
 *
 * The routine converts all of its arguments to strings and outputs them
 * char-by-char using jerry_port_print_char.
 *
 * The NUL character is output as "\u0000", other characters are output
 * bytewise.
 *
 * Note:
 *      This implementation does not use standard C `printf` to print its
 *      output. This allows more flexibility but also extends the core
 *      JerryScript engine port API. Applications that want to use
 *      `jerryx_handler_print` must ensure that their port implementation also
 *      provides `jerry_port_print_char`.
 *
 * @return undefined - if all arguments could be converted to strings,
 *         error - otherwise.
 */
jerry_value_t
jerryx_handler_print (const jerry_call_info_t *call_info_p, /**< call information */
                      const jerry_value_t args_p[], /**< function arguments */
                      const jerry_length_t args_cnt) /**< number of function arguments */
{
  (void) call_info_p; /* unused */

  jerry_value_t ret_val = jerry_undefined ();

  for (jerry_length_t arg_index = 0; arg_index < args_cnt; arg_index++)
  {
    jerry_value_t str_val;

    if (jerry_value_is_symbol (args_p[arg_index]))
    {
      str_val = jerry_symbol_descriptive_string (args_p[arg_index]);
    }
    else
    {
      str_val = jerry_value_to_string (args_p[arg_index]);
    }

    if (jerry_value_is_exception (str_val))
    {
      /* There is no need to free the undefined value. */
      ret_val = str_val;
      break;
    }

    if (arg_index > 0)
    {
      jerry_port_print_char (' ');
    }

    jerry_string_print (str_val);
    jerry_value_free (str_val);
  }

  jerry_port_print_char ('\n');
  return ret_val;
} /* jerryx_handler_print */


text:
for i in $(seq 1 20)
do
mkdir result/server/$i
./run_server.sh 285
cat mlperf_log_summary.txt | grep "Result is"
cat mlperf_log_summary.txt | grep "Scheduled samples per second"
cat mlperf_log_summary.txt | grep "99.00 percentile latency"
mv mlperf_log_* result/server/$i
done


text:
<?php
use Magento\Catalog\Model\Product as P;
use Magento\Framework\Exception\NoSuchEntityException as NSE;
use Magento\InventorySales\Model\ResourceModel\GetAssignedStockIdForWebsite as StockIdForWebsite;
use Magento\InventorySalesApi\Model\GetAssignedStockIdForWebsiteInterface as IStockIdForWebsite;
use Magento\Store\Model\Store;
use Magento\Store\Model\Website as W;
/**
 * 2019-11-22
 * @used-by df_pt_has_qty()
 * @used-by df_qty()
 */
function df_msi():bool {return dfcf(function() {return df_module_enabled('Magento_Inventory');});}

/**
 * 2019-11-22
 * @used-by df_qty()
 * @uses df_msi_website2stockId()
 * @return int[]
 */
function df_msi_stock_ids(P $p):array {return array_filter(array_unique(array_map(
	'df_msi_website2stockId', $p->getWebsiteIds()
)));}

/**
 * 2019-11-22
 * 1) It returns null if the website is not linked to a stock.
 * 2) I use the @uses dfcf() caching because
 * @uses \Magento\InventorySales\Model\ResourceModel\GetAssignedStockIdForWebsite::execute()
 * makes a direct query to the database.
 * 3) The $v argument could be one of:
 * 		*) a website: W
 * 		*) a store: Store
 * 		*) a website's ID: int
 * 		*) a website's code: string
 * 		*) `null` or absent: the current website
 * 		*) `true`: the default website
 * @used-by df_msi_stock_ids()
 * @param W|Store|int|string|null|bool $v [optional]
 * @return int|null
 * @throws Exception
 * @throws NSE
 */
function df_msi_website2stockId($v = null) {return dfcf(function($c) {
	$i = df_o(StockIdForWebsite::class); /** @var IStockIdForWebsite|StockIdForWebsite $i */
	return $i->execute($c);
}, [df_website_code($v)]);}


text:
html, *                   { margin: 0; padding: 0; font-size: 12px; font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif; }
body                      { background: #6a6061 url("../images/header.png") repeat-x; }
div.clear                 { clear:  both; }
div#container             { width: 800px; display: block; margin: auto; }
div#header                { width: 800px; height: 128px; display: block; margin: auto; }
div#header a              { width: 270px; height: 128px; display: block; background: transparent url("../images/logo.png") no-repeat; }
div#box                   { width: 760px; height: 20px; margin: -35px auto 0 auto; background: transparent url("../images/box_top.png") no-repeat; }
div#content               { width: 700px; margin: auto; background: transparent url("../images/box_bg.png") repeat-y; padding: 5px 30px; }
div#content h1            { font-size: 15px; color: #6a6061; }
div#content h2            { font-size: 12px; color: #6a6061; margin-top: -5px; font-weight: normal; }
div#content h3            { font-size: 13px; margin: 30px 0 5px 0; }
div#content p             { text-align: justify; }
div#content a             { color: #000; font-weight: bold; text-decoration: none; }
div#content a:hover       { text-decoration: underline; }
div#content ul            { list-style: disc inside; color: #6a6061; }
div#content ul a          { font-weight: normal; }
div#footer                { width: 760px; margin: auto; background: transparent url("../images/box_bottom.png") no-repeat; padding-top: 20px; text-align: center; }
div#footer span           { color: #b3a2a4; font-size: 10px; }
div#footer span a         { color: #b3a2a4; font-size: 10px; font-weight: bold; text-decoration: none; }
div#footer span a:hover   { color: #b3a2a4; text-decoration: underline; }


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

    <parent>
        <artifactId>geomesa-convert_2.11</artifactId>
        <groupId>org.locationtech.geomesa</groupId>
        <version>3.0.0-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>geomesa-convert-common_2.11</artifactId>
    <name>GeoMesa Convert Common</name>

    <dependencies>
        <dependency>
            <groupId>org.locationtech.geomesa</groupId>
            <artifactId>geomesa-feature-all_${scala.binary.version}</artifactId>
        </dependency>
        <dependency>
            <groupId>org.locationtech.geomesa</groupId>
            <artifactId>geomesa-utils_${scala.binary.version}</artifactId>
        </dependency>
        <dependency>
            <groupId>org.locationtech.geomesa</groupId>
            <artifactId>geomesa-filter_${scala.binary.version}</artifactId>
        </dependency>
        <dependency>
            <groupId>com.typesafe</groupId>
            <artifactId>config</artifactId>
        </dependency>
        <dependency>
            <groupId>com.github.pureconfig</groupId>
            <artifactId>pureconfig_${scala.binary.version}</artifactId>
        </dependency>
        <dependency>
            <groupId>io.dropwizard.metrics</groupId>
            <artifactId>metrics-core</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
        </dependency>
        <dependency>
            <groupId>org.scala-lang.modules</groupId>
            <artifactId>scala-parser-combinators_${scala.binary.version}</artifactId>
        </dependency>

        <dependency>
            <groupId>org.specs2</groupId>
            <artifactId>specs2-core_${scala.binary.version}</artifactId>
        </dependency>
        <dependency>
            <groupId>org.specs2</groupId>
            <artifactId>specs2-junit_${scala.binary.version}</artifactId>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.geotools</groupId>
            <artifactId>gt-epsg-hsql</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

</project>


text:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace H1Z1FontRenamer
{
    public partial class H1Z1FontRenamer : Form
    {
        /* Dialogs */
        OpenFileDialog fontDialog;
        FolderBrowserDialog destFolderDialog;

        /* Basic behaviour */
        String fontFile;
        String destPath;

        /* Advanced behaviour */
        String lightFontFile;
        String mediumFontFile;
        String boldFontFile;
        String advDestPath;

        /* Fonts name */
        String[] boldFont;
        String[] lightFont;
        String[] mediumFont;

        public H1Z1FontRenamer()
        {
            InitializeComponent();
            this.Size = new Size(285, 260);
            fontDialog = new OpenFileDialog
            {
                Filter = "Font files (*.ttf, *.otf)|*.ttf;*.otf"
            };
            destFolderDialog = new FolderBrowserDialog
            {
                ShowNewFolderButton = true
            };

            fontFile = "";
            destPath = "";
            lightFontFile = "";
            mediumFontFile = "";
            boldFontFile = "";
            advDestPath = "";

            boldFont = new String[]
            {
                "NanumBarunGothicBold.ttf",
                "Oswald-Bold_0.ttf",
                "Roboto-Bold.ttf",
                "Montserrat-Bold.ttf",
                "Montserrat-ExtraBold.ttf",
                "Montserrat-SemiBold.ttf"
            };
            mediumFont = new String[]
            {
                "NotoSansJP-Regular.otf",
                "Oswald-Regular_0.ttf",
                "Roboto-Medium.ttf",
                "Roboto-Regular.ttf",
                "RobotoMono-Regular.ttf",
                "ROSA Verde Normal.ttf",
                "simhei.ttf",
                "ARIALUNI.TTF",
                "leelawad.ttf",
                "Montserrat-Medium.ttf",
                "Montserrat-Regular.ttf"
            };
            lightFont = new String[]
            {
                "Oswald-Light_0.ttf",
                "Roboto-Light.ttf"
            };
        }

        private void advancedMenuItem_Click(object sender, EventArgs e)
        {
            advancedMenuItem.Checked = !advancedMenuItem.Checked;
            basicPanel.Visible = !advancedMenuItem.Checked;
            advancedPanel.Visible = advancedMenuItem.Checked;
            if (advancedPanel.Visible)
            {
                this.Size = new Size(285, 330);
            }
            else
            {
                this.Size = new Size(285, 260);
            }
        }

        private void fontFileButton_Click(object sender, EventArgs e)
        {
            if (fontDialog.ShowDialog().Equals(DialogResult.OK))
            {
                if (fontDialog.CheckFileExists && fontDialog.CheckPathExists)
                {
                    fontFileText.Text = fontDialog.FileName;
                    fontFile = fontDialog.FileName;
                }
                else
                {
                    MessageBox.Show("Error : file does not exist !", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }

        private void destinationFolderButton_Click(object sender, EventArgs e)
        {
            if (destFolderDialog.ShowDialog().Equals(DialogResult.OK))
            {
                destinationText.Text = destFolderDialog.SelectedPath;
                destPath = destFolderDialog.SelectedPath;
            }
        }

        private void renameButton_Click(object sender, EventArgs e)
        {
            if (!String.IsNullOrWhiteSpace(fontFile) && !String.IsNullOrWhiteSpace(destPath))
            {
                System.IO.FileInfo file = new System.IO.FileInfo(destPath);
                file.Directory.Create();
                String[] allFonts = new String[lightFont.Length + boldFont.Length + mediumFont.Length];
                lightFont.CopyTo(allFonts, 0);
                mediumFont.CopyTo(allFonts, lightFont.Length);
                boldFont.CopyTo(allFonts, lightFont.Length + mediumFont.Length);
                foreach (String font in allFonts)
                {
                    System.IO.File.Copy(fontFile, destPath + "/" + font, true);
                }
                MessageBox.Show("Success : all font files created with success !", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("Error : file or folder does not exist !", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }

        private void lightFontButton_Click(object sender, EventArgs e)
        {
            if (fontDialog.ShowDialog().Equals(DialogResult.OK))
            {
                if (fontDialog.CheckFileExists && fontDialog.CheckPathExists)
                {
                    lightFontText.Text = fontDialog.FileName;
                    lightFontFile = fontDialog.FileName;
                }
                else
                {
                    MessageBox.Show("Error : file does not exist !", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }

        private void mediumFontButton_Click(object sender, EventArgs e)
        {
            if (fontDialog.ShowDialog().Equals(DialogResult.OK))
            {
                if (fontDialog.CheckFileExists && fontDialog.CheckPathExists)
                {
                    mediumFontText.Text = fontDialog.FileName;
                    mediumFontFile = fontDialog.FileName;
                }
                else
                {
                    MessageBox.Show("Error : file does not exist !", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }

        private void boldFontButton_Click(object sender, EventArgs e)
        {
            if (fontDialog.ShowDialog().Equals(DialogResult.OK))
            {
                if (fontDialog.CheckFileExists && fontDialog.CheckPathExists)
                {
                    boldFontText.Text = fontDialog.FileName;
                    boldFontFile = fontDialog.FileName;
                }
                else
                {
                    MessageBox.Show("Error : file does not exist !", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }

        private void advFolderDestButton_Click(object sender, EventArgs e)
        {
            if (destFolderDialog.ShowDialog().Equals(DialogResult.OK))
            {
                advFolderDestText.Text = destFolderDialog.SelectedPath;
                advDestPath = destFolderDialog.SelectedPath;
            }
        }

        private void advRenameButton_Click(object sender, EventArgs e)
        {
            if (!String.IsNullOrWhiteSpace(lightFontFile) && !String.IsNullOrWhiteSpace(mediumFontFile)
                && !String.IsNullOrWhiteSpace(boldFontFile) && !String.IsNullOrWhiteSpace(advDestPath))
            {
                System.IO.FileInfo file = new System.IO.FileInfo(advDestPath);
                file.Directory.Create();
                foreach (String font in lightFont)
                {
                    System.IO.File.Copy(lightFontFile, advDestPath + "/" + font, true);
                }
                foreach (String font in mediumFont)
                {
                    System.IO.File.Copy(mediumFontFile, advDestPath + "/" + font, true);
                }
                foreach (String font in boldFont)
                {
                    System.IO.File.Copy(boldFontFile, advDestPath + "/" + font, true);
                }
                MessageBox.Show("Success : all font files created with success !", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("Error : file or folder does not exist !", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }

        private void showCredit(object sender, EventArgs e)
        {
            Console.WriteLine("hello le monde");
            MessageBox.Show("tototo", "");
        }
    }
}


text:
import { expect } from 'chai';

import { getCredentials, api, request, credentials } from '../../../data/api-data.js';
import { updatePermission, updateSetting } from '../../../data/permissions.helper';
import { createDepartment } from '../../../data/livechat/department.js';

describe('LIVECHAT - departments', function() {
	this.retries(0);
	let department;

	before((done) => getCredentials(done));

	before((done) => {
		updateSetting('Livechat_enabled', true)
			.then(() => createDepartment())
			.then((createdDepartment) => {
				department = createdDepartment;
				done();
			}).catch(console.log);
	});

	describe('livechat/department', () => {
		it('should return an "unauthorized error" when the user does not have the necessary permission ["view-livechat-departments", "view-l-room"]', (done) => {
			updatePermission('view-l-room', [])
				.then(() => updatePermission('view-livechat-departments', []))
				.then(() => {
					request.get(api('livechat/department'))
						.set(credentials)
						.expect('Content-Type', 'application/json')
						.expect(400)
						.expect((res) => {
							expect(res.body).to.have.property('success', false);
							expect(res.body.error).to.be.equal('error-not-authorized');
						})
						.end(done);
				});
		});
		it('should return an array of departments', (done) => {
			updatePermission('view-l-room', ['admin'])
				.then(() => updatePermission('view-livechat-departments', ['admin']))
				.then(() => {
					request.get(api('livechat/department'))
						.set(credentials)
						.expect('Content-Type', 'application/json')
						.expect(200)
						.expect((res) => {
							expect(res.body).to.have.property('success', true);
							expect(res.body.departments).to.be.an('array');
							expect(res.body).to.have.property('offset');
							expect(res.body).to.have.property('total');
							expect(res.body).to.have.property('count');
						})
						.end(done);
				});
		});
	});

	describe('livechat/department/id', () => {
		it('should return an "unauthorized error" when the user does not have the necessary permission ["view-livechat-departments", "view-l-room"]', (done) => {
			updatePermission('view-l-room', [])
				.then(() => updatePermission('view-livechat-departments', []))
				.then(() => {
					request.get(api(`livechat/department/${ department._id }`))
						.set(credentials)
						.expect('Content-Type', 'application/json')
						.expect(400)
						.expect((res) => {
							expect(res.body).to.have.property('success', false);
							expect(res.body.error).to.be.equal('error-not-authorized');
						})
						.end(done);
				});
		});
		it('should return the created department without the agents if the user does not have the necessary permission', (done) => {
			updatePermission('view-l-room', ['admin'])
				.then(() => updatePermission('view-livechat-departments', []))
				.then(() => {
					request.get(api(`livechat/department/${ department._id }`))
						.set(credentials)
						.expect('Content-Type', 'application/json')
						.expect(200)
						.expect((res) => {
							expect(res.body).to.have.property('success', true);
							expect(res.body).to.have.property('department');
							expect(res.body).to.not.have.property('agents');
							expect(res.body.department._id).to.be.equal(department._id);
						})
						.end(done);
				});
		});
		it('should return the created department without the agents if the user does have the permission but request to no include the agents', (done) => {
			updatePermission('view-livechat-departments', ['admin'])
				.then(() => {
					request.get(api(`livechat/department/${ department._id }?includeAgents=false`))
						.set(credentials)
						.expect('Content-Type', 'application/json')
						.expect(200)
						.expect((res) => {
							expect(res.body).to.have.property('success', true);
							expect(res.body).to.have.property('department');
							expect(res.body).to.not.have.property('agents');
							expect(res.body.department._id).to.be.equal(department._id);
						})
						.end(done);
				});
		});
		it('should return the created department', (done) => {
			updatePermission('view-l-room', ['admin'])
				.then(() => updatePermission('view-livechat-departments', ['admin']))
				.then(() => {
					request.get(api(`livechat/department/${ department._id }`))
						.set(credentials)
						.expect('Content-Type', 'application/json')
						.expect(200)
						.expect((res) => {
							expect(res.body).to.have.property('success', true);
							expect(res.body).to.have.property('department');
							expect(res.body).to.have.property('agents');
							expect(res.body.department._id).to.be.equal(department._id);
						})
						.end(done);
				});
		});
	});
});


text:
'use strict';

import NodeBase from '../util/NodeBase'

class Box extends NodeBase {
  constructor (options, body, labelModule) {
    super(options,body,labelModule);
    this._setMargins(labelModule);
  }

  resize(ctx, selected = this.selected, hover = this.hover) {
    if (this.needsRefresh(selected, hover)) {
      this.textSize = this.labelModule.getTextSize(ctx, selected, hover);
      this.width = this.textSize.width + this.margin.right + this.margin.left;
      this.height = this.textSize.height + this.margin.top + this.margin.bottom;
      this.radius = this.width / 2;
    }
  }

  draw(ctx, x, y, selected, hover, values) {
    this.resize(ctx, selected, hover);
    this.left = x - this.width / 2;
    this.top = y - this.height / 2;

    ctx.strokeStyle = values.borderColor;
    ctx.lineWidth = values.borderWidth;
    ctx.lineWidth /= this.body.view.scale;
    ctx.lineWidth = Math.min(this.width, ctx.lineWidth);

    ctx.fillStyle = values.color;

    ctx.roundRect(this.left, this.top, this.width, this.height, values.borderRadius);

    // draw shadow if enabled
    this.enableShadow(ctx, values);
    // draw the background
    ctx.fill();
    // disable shadows for other elements.
    this.disableShadow(ctx, values);

    //draw dashed border if enabled, save and restore is required for firefox not to crash on unix.
    ctx.save();
    // if borders are zero width, they will be drawn with width 1 by default. This prevents that
    if (values.borderWidth > 0) {
      this.enableBorderDashes(ctx, values);
      //draw the border
      ctx.stroke();
      //disable dashed border for other elements
      this.disableBorderDashes(ctx, values);
    }
    ctx.restore();

    this.updateBoundingBox(x, y, ctx, selected, hover);
    this.labelModule.draw(ctx, this.left + this.textSize.width / 2 + this.margin.left,
                               this.top + this.textSize.height / 2 + this.margin.top, selected, hover);
  }

  updateBoundingBox(x, y, ctx, selected, hover) {
    this.resize(ctx, selected, hover);
    this.left = x - this.width / 2;
    this.top = y - this.height / 2;

    let borderRadius = this.options.shapeProperties.borderRadius; // only effective for box
    this.boundingBox.left = this.left - borderRadius;
    this.boundingBox.top = this.top - borderRadius;
    this.boundingBox.bottom = this.top + this.height + borderRadius;
    this.boundingBox.right = this.left + this.width + borderRadius;
  }

  distanceToBorder(ctx, angle) {
    this.resize(ctx);
    let borderWidth = this.options.borderWidth;

    return Math.min(
        Math.abs((this.width) / 2 / Math.cos(angle)),
        Math.abs((this.height)  / 2 / Math.sin(angle))) + borderWidth;
  }
}

export default Box;


text:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

#ifdef _MSC_VER
#   include <intrin.h>
	static unsigned long long profile_rdtsc(void)
	{
		return __rdtsc();
	}
#else
	static unsigned long long profile_rdtsc(void)
	{
		unsigned int hi, lo;
		__asm__ __volatile__("rdtsc" : "=a"(lo), "=d"(hi));
		return (unsigned long long)lo | ((unsigned long long)hi << 32);
	}
#endif

#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
#include "hashset.h"
#include "luaprofiler.h"
#include "../premake.h"

static FILE* profile_file;
static hashset_t string_table;

static unsigned long define_string(const char* str)
{
	unsigned long id;
	size_t len = str ? strlen(str) : 0;
	if (len <= 0)
		return 0;

	id = do_hash(str, 5381);
	if (hashset_add(string_table, id) == 1)
	{
		fprintf(profile_file, "declstr,%x,%s\n", (unsigned int)id, str);
		fflush(profile_file);
	}

	return id;
}

static void enter_hook(lua_State *L, lua_Debug *ar, int tail)
{
	unsigned long name, source;
	size_t             func;
	unsigned long long tick;

	lua_getinfo(L, "nS", ar);
	name = define_string(ar->name);
	source = define_string(ar->source);
	func = *(size_t*)ar->i_ci;
	tick = profile_rdtsc();

	fprintf(profile_file, "enter,%x,%x,%x,%d,%llu\n",
		(unsigned int)func,
		(unsigned int)name,
		(unsigned int)source,
		tail, tick);
	fflush(profile_file);
}

static void leave_hook()
{
	unsigned long long tick = profile_rdtsc();
	fprintf(profile_file, "leave,%llu\n", tick);
	fflush(profile_file);
}

static void callhook(lua_State *L, lua_Debug *ar)
{
	switch (ar->event)
	{
	case LUA_HOOKCALL:
		enter_hook(L, ar, 0);
		break;
	case LUA_HOOKTAILCALL:
		enter_hook(L, ar, 1);
		break;
	case LUA_HOOKRET:
		leave_hook();
		break;
	}
}

void malloc_callback(uintptr_t id, size_t nsize)
{
	if (!profile_file)
		return;

	fprintf(profile_file, "malloc,%llu,%llu\n",
		(long long unsigned int)id,
		(long long unsigned int)nsize);
	fflush(profile_file);
}

void realloc_callback(uintptr_t id, uintptr_t ptr, size_t nsize)
{
	if (!profile_file)
		return;

	fprintf(profile_file, "realloc,%llu,%llu,%llu\n",
		(long long unsigned int)id,
		(long long unsigned int)ptr,
		(long long unsigned int)nsize);
	fflush(profile_file);
}

void free_callback(uintptr_t id)
{
	if (!profile_file)
		return;

	fprintf(profile_file, "free,%llu\n", (long long unsigned int)id);
	fflush(profile_file);
}

char* my_asctime(const struct tm *timeptr)
{
	static const char mon_name[][4] = {
		"Jan", "Feb", "Mar", "Apr", "May", "Jun",
		"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
	};
	static char result[26];
	sprintf(result, "%.3s,%3d %d %d",
		mon_name[timeptr->tm_mon],
		timeptr->tm_mday,
		1900 + timeptr->tm_year,
		(timeptr->tm_hour * 3600) + (timeptr->tm_min * 60) + timeptr->tm_sec);
	return result;
}

void init_profiler()
{
	char fileName[260];
	time_t rawtime;
	struct tm * timeinfo;

	time(&rawtime);
	timeinfo = localtime(&rawtime);
	sprintf(fileName, "lprof (%s).out", my_asctime(timeinfo));

	profile_file = fopen(fileName, "wb");
	if (!profile_file)
	{
		printf("Profiler error: output file could not be opened!");
		exit(-1);
	}

	string_table = hashset_create();
	if (!string_table)
	{
		fclose(profile_file);
		profile_file = NULL;

		printf("Profiler error: unable to create string table!");
		exit(-1);
	}

	printf("Profiler enabled\n");
}

void hook_profiler(lua_State* L)
{
	if (profile_file)
	{
		lua_sethook(L, (lua_Hook)callhook, LUA_MASKCALL | LUA_MASKRET, 0);
	}
}

int shutdown_profiler()
{
	if (string_table)
	{
		hashset_destroy(string_table);
		string_table = NULL;
	}

	if (profile_file)
	{
		fclose(profile_file);
		profile_file = NULL;
	}

	return 0;
}


text:
package io.georocket.query;

import java.util.Arrays;

import io.vertx.core.json.JsonArray;
import io.vertx.core.json.JsonObject;

/**
 * Helper methods to build Elasticsearch queries
 * @author Michel Kraemer
 * @since 1.0.0
 */
public final class ElasticsearchQueryHelper {
  private ElasticsearchQueryHelper() {
    // hidden constructor
  }

  /**
   * Create a query that allows for boolean combinations of other queries
   * @return the query
   */
  public static JsonObject boolQuery() {
    return new JsonObject()
        .put("bool", new JsonObject());
  }

  /**
   * Create a query that allows for boolean combinations of other queries
   * @param minimumShouldMatch the minimum number of should clauses to match
   * @return the query
   * @since 1.1.0
   */
  public static JsonObject boolQuery(int minimumShouldMatch) {
    JsonObject r = boolQuery();
    r.getJsonObject("bool")
        .put("minimum_should_match", 1);
    return r;
  }

  /**
   * Add a filter to a bool query. Do not add it if the clause already exists
   * in the query.
   * @param bool the bool query
   * @param filter the filter to add
   */
  public static void boolAddFilter(JsonObject bool, JsonObject filter) {
    boolAdd(bool, filter, "filter");
  }

  /**
   * Add a "must" clause to a bool query. Do not add it if the clause already
   * exists in the query.
   * @param bool the bool query
   * @param must the clause to add
   */
  public static void boolAddMust(JsonObject bool, JsonObject must) {
    boolAdd(bool, must, "must");
  }

  /**
   * Add a "must_not" clause to a bool query. Do not add it if the clause
   * already exists in the query.
   * @param bool the bool query
   * @param mustNot the clause to add
   */
  public static void boolAddMustNot(JsonObject bool, JsonObject mustNot) {
    boolAdd(bool, mustNot, "must_not");
  }

  /**
   * Add a "should" clause to a bool query. Do not add it if the clause already
   * exists in the query.
   * @param bool the bool query
   * @param should the clause to add
   */
  public static void boolAddShould(JsonObject bool, JsonObject should) {
    boolAdd(bool, should, "should");
  }

  /**
   * Add a clause to a bool query. Do not add it if the clause already exists
   * in the query.
   * @param bool the bool query
   * @param clause the clause to add
   * @param occurrenceType the clause's occurrence type (e.g. "must", "should")
   */
  private static void boolAdd(JsonObject bool, JsonObject clause,
      String occurrenceType) {
    JsonObject b = bool.getJsonObject("bool");
    Object eso = b.getValue(occurrenceType);
    if (eso == null) {
      b.put(occurrenceType, clause);
    } else if (eso instanceof JsonArray) {
      JsonArray esoa = (JsonArray)eso;
      if (!esoa.contains(clause)) {
        esoa.add(clause);
      }
    } else {
      if (!eso.equals(clause)) {
        JsonArray es = new JsonArray().add(eso).add(clause);
        b.put(occurrenceType, es);
      }
    }
  }

  /**
   * Create a term query to exactly compare a field to a value
   * @param name the field's name
   * @param value the value to compare to
   * @return the term query
   */
  public static JsonObject termQuery(String name, Object value) {
    return new JsonObject()
        .put("term", new JsonObject()
            .put(name, value));
  }

  /**
   * Create a term query to compare a field to a value using less than
   * as operator.
   * @param name the field's name
   * @param value the value to compare to
   * @return the term query
   * @since 1.1.0
   */
  public static JsonObject ltQuery(String name, Object value) {
    return new JsonObject()
      .put("range", new JsonObject()
        .put(name, new JsonObject().put("lt", value)));
  }

  /**
   * Create a term query to compare a field to a value using less than
   * or equal to as operator.
   * @param name the field's name
   * @param value the value to compare to
   * @return the term query
   * @since 1.1.0
   */
  public static JsonObject lteQuery(String name, Object value) {
    return new JsonObject()
      .put("range", new JsonObject()
        .put(name, new JsonObject().put("lte", value)));
  }

  /**
   * Create a term query to compare a field to a value using greater
   * than as operator.
   * @param name the field's name
   * @param value the value to compare to
   * @return the term query
   * @since 1.1.0
   */
  public static JsonObject gtQuery(String name, Object value) {
    return new JsonObject()
      .put("range", new JsonObject()
        .put(name, new JsonObject().put("gt", value)));
  }

  /**
   * Create a term query to compare a field to a value using greater
   * than or equal to as operator.
   * @param name the field's name
   * @param value the value to compare to
   * @return the term query
   * @since 1.1.0
   */
  public static JsonObject gteQuery(String name, Object value) {
    return new JsonObject()
      .put("range", new JsonObject()
        .put(name, new JsonObject().put("gte", value)));
  }

  /**
   * Create a query that matches all documents
   * @return the query
   */
  public static JsonObject matchAllQuery() {
    return new JsonObject()
        .put("match_all", new JsonObject());
  }

  /**
   * Create a query that compares a value to multiple fields
   * @param text the value
   * @param fieldNames the names of the fields to compare to
   * @return the query
   */
  public static JsonObject multiMatchQuery(Object text, String... fieldNames) {
    return new JsonObject()
        .put("multi_match", new JsonObject()
            .put("query", text)
            .put("fields", new JsonArray(Arrays.asList(fieldNames))));
  }

  /**
   * Create a query that looks if a field with the given name exists
   * @param name the field's name
   * @return the query
   * @since 1.1.0
   */
  public static JsonObject existsQuery(String name) {
    return new JsonObject()
      .put("exists", new JsonObject()
        .put("field", name));
  }

  /**
   * Create a query that looks for a field starting with a given prefix
   * @param name the field's name
   * @param prefix the prefix
   * @return the query
   */
  public static JsonObject prefixQuery(String name, Object prefix) {
    return new JsonObject()
        .put("prefix", new JsonObject()
            .put(name, prefix));
  }

  /**
   * Create a query that looks for documents matching a geo shape
   * @param name the field name containing the document's geo shape
   * @param shape the geo shape to compare to
   * @param relation the relation used for comparison (i.e. "intersects",
   * "disjoint", "within", "contains")
   * @return the query
   */
  public static JsonObject geoShapeQuery(String name, JsonObject shape, String relation) {
    return new JsonObject()
        .put("geo_shape", new JsonObject()
            .put(name, new JsonObject()
                .put("shape", shape)
                .put("relation", relation)));
  }

  /**
   * Create a geo shape
   * @param type the shape's type (e.g. "envelope")
   * @param coordinates the shape's coordinates
   * @return the shape
   */
  public static JsonObject shape(String type, JsonArray coordinates) {
    return new JsonObject()
        .put("type", type)
        .put("coordinates", coordinates);
  }
}


text:
@interface HTCarSwitcherView : UIView

@property (nonatomic, strong) UIView<HTCarDetailsProtocol> *carDetailsView;

@end


text:
ES5Harness.registerTest({
    id: "15.3.4.5.1-4-10",

    path: "TestCases/chapter15/15.3/15.3.4/15.3.4.5.1/15.3.4.5.1-4-10.js",

    description: "[[Call]] - length of parameters of 'target' is 1, length of 'boundArgs' is 0, length of 'ExtraArgs' is 0, and with 'boundThis'",

    test: function testcase() {
        var obj = { prop: "abc" };

        var func = function (x) {
            return this === obj && typeof x === "undefined";
        };

        var newFunc = Function.prototype.bind.call(func, obj);

        return newFunc();
    },

    precondition: function prereq() {
        return fnExists(Function.prototype.bind);
    }
});


text:
/*
   For step-by-step instructions on connecting your Android application to this backend module,
   see "App Engine Java Endpoints Module" template documentation at
   https://github.com/GoogleCloudPlatform/gradle-appengine-templates/tree/master/HelloEndpoints
*/

package me.vickychijwani.udacity.jokebackend;

import com.google.api.server.spi.config.Api;
import com.google.api.server.spi.config.ApiMethod;
import com.google.api.server.spi.config.ApiNamespace;

import me.vickychijwani.udacity.libjoke.JokeFactory;

/** An endpoint class we are exposing */
@Api(
  name = "libjoke",
  version = "v1",
  namespace = @ApiNamespace(
    ownerDomain = "jokebackend.udacity.vickychijwani.me",
    ownerName = "jokebackend.udacity.vickychijwani.me",
    packagePath=""
  )
)
public class JokeEndpoint {

    @ApiMethod(name = "getRandomJoke")
    public Joke getRandomJoke() {
        return new Joke(JokeFactory.getRandomJoke());
    }

}


text:
package model;

/**
 *
 * @author edilvolima
 */
public class Agenda implements InterfaceAgenda{

    private final Arvore contatos;

    public Agenda(){
        contatos = new Arvore();
    }

    @Override
    public void armazenaPessoa(Pessoa pessoa){
        contatos.insetirNo(null, pessoa);
    }

    @Override
    public void removePessoa(String nome) {
        contatos.removerNo(new No<>(new Pessoa(nome)));
    }

    @Override
    public void buscaPessoa(String nome) {
        ;
    }

    @Override
    public void imprimeAgenda() {
        contatos.imprimirArvore(contatos.getRaiz());
    }

    @Override
    public void imprimePessoa(String nome) {

    }

}


text:
void
test01()
{
  using namespace std::tr1;

  typedef bernoulli_distribution test_type;

  typedef test_type::input_type  input_type;
  typedef test_type::result_type result_type;
}


text:
<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/events/firebase/remoteconfig/v1/data.proto

namespace Google\Events\Firebase\Remoteconfig\V1;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * The data within all Firebase Remote Config events.
 *
 * Generated from protobuf message google.events.firebase.remoteconfig.v1.RemoteConfigEventData
 */
class RemoteConfigEventData extends \Google\Protobuf\Internal\Message
{
    /**
     * The version number of the version's corresponding Remote Config template.
     *
     * Generated from protobuf field int64 version_number = 1;
     */
    protected $version_number = 0;
    /**
     * When the Remote Config template was written to the Remote Config server.
     *
     * Generated from protobuf field .google.protobuf.Timestamp update_time = 2;
     */
    protected $update_time = null;
    /**
     *  Aggregation of all metadata fields about the account that performed the update.
     *
     * Generated from protobuf field .google.events.firebase.remoteconfig.v1.RemoteConfigUser update_user = 3;
     */
    protected $update_user = null;
    /**
     * The user-provided description of the corresponding Remote Config template.
     *
     * Generated from protobuf field string description = 4;
     */
    protected $description = '';
    /**
     * Where the update action originated.
     *
     * Generated from protobuf field .google.events.firebase.remoteconfig.v1.RemoteConfigUpdateOrigin update_origin = 5;
     */
    protected $update_origin = 0;
    /**
     * What type of update was made.
     *
     * Generated from protobuf field .google.events.firebase.remoteconfig.v1.RemoteConfigUpdateType update_type = 6;
     */
    protected $update_type = 0;
    /**
     * Only present if this version is the result of a rollback, and will be the
     * version number of the Remote Config template that was rolled-back to.
     *
     * Generated from protobuf field int64 rollback_source = 7;
     */
    protected $rollback_source = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int|string $version_number
     *           The version number of the version's corresponding Remote Config template.
     *     @type \Google\Protobuf\Timestamp $update_time
     *           When the Remote Config template was written to the Remote Config server.
     *     @type \Google\Events\Firebase\Remoteconfig\V1\RemoteConfigUser $update_user
     *            Aggregation of all metadata fields about the account that performed the update.
     *     @type string $description
     *           The user-provided description of the corresponding Remote Config template.
     *     @type int $update_origin
     *           Where the update action originated.
     *     @type int $update_type
     *           What type of update was made.
     *     @type int|string $rollback_source
     *           Only present if this version is the result of a rollback, and will be the
     *           version number of the Remote Config template that was rolled-back to.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Events\Firebase\Remoteconfig\V1\Data::initOnce();
        parent::__construct($data);
    }

    /**
     * The version number of the version's corresponding Remote Config template.
     *
     * Generated from protobuf field int64 version_number = 1;
     * @return int|string
     */
    public function getVersionNumber()
    {
        return $this->version_number;
    }

    /**
     * The version number of the version's corresponding Remote Config template.
     *
     * Generated from protobuf field int64 version_number = 1;
     * @param int|string $var
     * @return $this
     */
    public function setVersionNumber($var)
    {
        GPBUtil::checkInt64($var);
        $this->version_number = $var;

        return $this;
    }

    /**
     * When the Remote Config template was written to the Remote Config server.
     *
     * Generated from protobuf field .google.protobuf.Timestamp update_time = 2;
     * @return \Google\Protobuf\Timestamp
     */
    public function getUpdateTime()
    {
        return $this->update_time;
    }

    /**
     * When the Remote Config template was written to the Remote Config server.
     *
     * Generated from protobuf field .google.protobuf.Timestamp update_time = 2;
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setUpdateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->update_time = $var;

        return $this;
    }

    /**
     *  Aggregation of all metadata fields about the account that performed the update.
     *
     * Generated from protobuf field .google.events.firebase.remoteconfig.v1.RemoteConfigUser update_user = 3;
     * @return \Google\Events\Firebase\Remoteconfig\V1\RemoteConfigUser
     */
    public function getUpdateUser()
    {
        return $this->update_user;
    }

    /**
     *  Aggregation of all metadata fields about the account that performed the update.
     *
     * Generated from protobuf field .google.events.firebase.remoteconfig.v1.RemoteConfigUser update_user = 3;
     * @param \Google\Events\Firebase\Remoteconfig\V1\RemoteConfigUser $var
     * @return $this
     */
    public function setUpdateUser($var)
    {
        GPBUtil::checkMessage($var, \Google\Events\Firebase\Remoteconfig\V1\RemoteConfigUser::class);
        $this->update_user = $var;

        return $this;
    }

    /**
     * The user-provided description of the corresponding Remote Config template.
     *
     * Generated from protobuf field string description = 4;
     * @return string
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     * The user-provided description of the corresponding Remote Config template.
     *
     * Generated from protobuf field string description = 4;
     * @param string $var
     * @return $this
     */
    public function setDescription($var)
    {
        GPBUtil::checkString($var, True);
        $this->description = $var;

        return $this;
    }

    /**
     * Where the update action originated.
     *
     * Generated from protobuf field .google.events.firebase.remoteconfig.v1.RemoteConfigUpdateOrigin update_origin = 5;
     * @return int
     */
    public function getUpdateOrigin()
    {
        return $this->update_origin;
    }

    /**
     * Where the update action originated.
     *
     * Generated from protobuf field .google.events.firebase.remoteconfig.v1.RemoteConfigUpdateOrigin update_origin = 5;
     * @param int $var
     * @return $this
     */
    public function setUpdateOrigin($var)
    {
        GPBUtil::checkEnum($var, \Google\Events\Firebase\Remoteconfig\V1\RemoteConfigUpdateOrigin::class);
        $this->update_origin = $var;

        return $this;
    }

    /**
     * What type of update was made.
     *
     * Generated from protobuf field .google.events.firebase.remoteconfig.v1.RemoteConfigUpdateType update_type = 6;
     * @return int
     */
    public function getUpdateType()
    {
        return $this->update_type;
    }

    /**
     * What type of update was made.
     *
     * Generated from protobuf field .google.events.firebase.remoteconfig.v1.RemoteConfigUpdateType update_type = 6;
     * @param int $var
     * @return $this
     */
    public function setUpdateType($var)
    {
        GPBUtil::checkEnum($var, \Google\Events\Firebase\Remoteconfig\V1\RemoteConfigUpdateType::class);
        $this->update_type = $var;

        return $this;
    }

    /**
     * Only present if this version is the result of a rollback, and will be the
     * version number of the Remote Config template that was rolled-back to.
     *
     * Generated from protobuf field int64 rollback_source = 7;
     * @return int|string
     */
    public function getRollbackSource()
    {
        return $this->rollback_source;
    }

    /**
     * Only present if this version is the result of a rollback, and will be the
     * version number of the Remote Config template that was rolled-back to.
     *
     * Generated from protobuf field int64 rollback_source = 7;
     * @param int|string $var
     * @return $this
     */
    public function setRollbackSource($var)
    {
        GPBUtil::checkInt64($var);
        $this->rollback_source = $var;

        return $this;
    }

}


text:
FactoryBot.define do
  factory :blog_post do
    company
    body { 'Zażółć gęślą jaźń' }
  end
end


text:
package hugo

var IsExtended = false


text:
namespace net {

// The built-in set of protocol factories
namespace {

struct SchemeToFactory {
  const char* scheme;
  URLRequest::ProtocolFactory* factory;
};

}  // namespace

static const SchemeToFactory kBuiltinFactories[] = {
  { "http", URLRequestHttpJob::Factory },
  { "https", URLRequestHttpJob::Factory },

#if !defined(OS_IOS)
  { "ws", URLRequestHttpJob::Factory },
  { "wss", URLRequestHttpJob::Factory },
#endif  // !defined(OS_IOS)
};

// static
URLRequestJobManager* URLRequestJobManager::GetInstance() {
  return Singleton<URLRequestJobManager>::get();
}

URLRequestJob* URLRequestJobManager::CreateJob(
    URLRequest* request, NetworkDelegate* network_delegate) const {
  DCHECK(IsAllowedThread());

  // If we are given an invalid URL, then don't even try to inspect the scheme.
  if (!request->url().is_valid())
    return new URLRequestErrorJob(request, network_delegate, ERR_INVALID_URL);

  // We do this here to avoid asking interceptors about unsupported schemes.
  const URLRequestJobFactory* job_factory = NULL;
  job_factory = request->context()->job_factory();

  const std::string& scheme = request->url().scheme();  // already lowercase
  if (!job_factory->IsHandledProtocol(scheme)) {
    return new URLRequestErrorJob(
        request, network_delegate, ERR_UNKNOWN_URL_SCHEME);
  }

  // THREAD-SAFETY NOTICE:
  //   We do not need to acquire the lock here since we are only reading our
  //   data structures.  They should only be modified on the current thread.

  // See if the request should be intercepted.
  //

  // TODO(pauljensen): Remove this when AppCacheInterceptor is a
  // ProtocolHandler, see crbug.com/161547.
  if (!(request->load_flags() & LOAD_DISABLE_INTERCEPT)) {
    InterceptorList::const_iterator i;
    for (i = interceptors_.begin(); i != interceptors_.end(); ++i) {
      URLRequestJob* job = (*i)->MaybeIntercept(request, network_delegate);
      if (job)
        return job;
    }
  }

  URLRequestJob* job = job_factory->MaybeCreateJobWithProtocolHandler(
      scheme, request, network_delegate);
  if (job)
    return job;

  // See if the request should be handled by a built-in protocol factory.
  for (size_t i = 0; i < arraysize(kBuiltinFactories); ++i) {
    if (scheme == kBuiltinFactories[i].scheme) {
      URLRequestJob* job = (kBuiltinFactories[i].factory)(
          request, network_delegate, scheme);
      DCHECK(job);  // The built-in factories are not expected to fail!
      return job;
    }
  }

  // If we reached here, then it means that a registered protocol factory
  // wasn't interested in handling the URL.  That is fairly unexpected, and we
  // don't have a specific error to report here :-(
  LOG(WARNING) << "Failed to map: " << request->url().spec();
  return new URLRequestErrorJob(request, network_delegate, ERR_FAILED);
}

URLRequestJob* URLRequestJobManager::MaybeInterceptRedirect(
    URLRequest* request,
    NetworkDelegate* network_delegate,
    const GURL& location) const {
  DCHECK(IsAllowedThread());
  if (!request->url().is_valid() ||
      request->load_flags() & LOAD_DISABLE_INTERCEPT ||
      request->status().status() == URLRequestStatus::CANCELED) {
    return NULL;
  }

  const URLRequestJobFactory* job_factory = NULL;
  job_factory = request->context()->job_factory();

  const std::string& scheme = request->url().scheme();  // already lowercase
  if (!job_factory->IsHandledProtocol(scheme))
    return NULL;

  InterceptorList::const_iterator i;
  for (i = interceptors_.begin(); i != interceptors_.end(); ++i) {
    URLRequestJob* job = (*i)->MaybeInterceptRedirect(request,
                                                      network_delegate,
                                                      location);
    if (job)
      return job;
  }
  return NULL;
}

URLRequestJob* URLRequestJobManager::MaybeInterceptResponse(
    URLRequest* request, NetworkDelegate* network_delegate) const {
  DCHECK(IsAllowedThread());
  if (!request->url().is_valid() ||
      request->load_flags() & LOAD_DISABLE_INTERCEPT ||
      request->status().status() == URLRequestStatus::CANCELED) {
    return NULL;
  }

  const URLRequestJobFactory* job_factory = NULL;
  job_factory = request->context()->job_factory();

  const std::string& scheme = request->url().scheme();  // already lowercase
  if (!job_factory->IsHandledProtocol(scheme))
    return NULL;

  InterceptorList::const_iterator i;
  for (i = interceptors_.begin(); i != interceptors_.end(); ++i) {
    URLRequestJob* job = (*i)->MaybeInterceptResponse(request,
                                                      network_delegate);
    if (job)
      return job;
  }
  return NULL;
}

// static
bool URLRequestJobManager::SupportsScheme(const std::string& scheme) {
  for (size_t i = 0; i < arraysize(kBuiltinFactories); ++i) {
    if (LowerCaseEqualsASCII(scheme, kBuiltinFactories[i].scheme))
      return true;
  }

  return false;
}

void URLRequestJobManager::RegisterRequestInterceptor(
    URLRequest::Interceptor* interceptor) {
  DCHECK(IsAllowedThread());

  base::AutoLock locked(lock_);

  DCHECK(std::find(interceptors_.begin(), interceptors_.end(), interceptor) ==
         interceptors_.end());
  interceptors_.push_back(interceptor);
}

void URLRequestJobManager::UnregisterRequestInterceptor(
    URLRequest::Interceptor* interceptor) {
  DCHECK(IsAllowedThread());

  base::AutoLock locked(lock_);

  InterceptorList::iterator i =
      std::find(interceptors_.begin(), interceptors_.end(), interceptor);
  DCHECK(i != interceptors_.end());
  interceptors_.erase(i);
}

URLRequestJobManager::URLRequestJobManager()
    : allowed_thread_(0),
      allowed_thread_initialized_(false) {
}

URLRequestJobManager::~URLRequestJobManager() {}

}  // namespace net


text:
var baz = new Foo('Jane Doe');
var people = [baz, new Foo('Bob Doe'), baz];


text:
FROM quay.io/openzipkin/zipkin-base:base-1.17.1
MAINTAINER OpenZipkin "http://zipkin.io/"

RUN curl -SL $ZIPKIN_REPO/io/zipkin/zipkin-query-service/$ZIPKIN_VERSION/zipkin-query-service-$ZIPKIN_VERSION-all.jar > zipkin-query.jar

ADD run.sh /usr/local/bin/run.sh
CMD /usr/local/bin/run.sh

EXPOSE 9411


text:
module PQA
  class Question
    attr_accessor :uin,
                  :updated_date,
                  :date_for_answer,
                  :tabled_date,
                  :answering_body_id,
                  :answering_body_name,
                  :answering_body_short_name,
                  :house_id,
                  :house_name,
                  :member_id,
                  :member_name,
                  :member_constituency,
                  :question_status,
                  :question_type,
                  :registered_interest,
                  :session,
                  :target,
                  :text,
                  :session_number,
                  :url,
                  :version_number,
                  :parliament_number

    def self.from_xml(el)
      xml                         = ::XMLExtractor
      q                           = new

      q.uin                       = xml.text(el, 'Uin')
      q.updated_date              = xml.datetime(el, 'UpdatedDate')
      q.date_for_answer           = xml.datetime(el, 'DateForAnswer')
      q.tabled_date               = xml.datetime(el, 'TabledDate')

      q.answering_body_id         = xml.text(el, 'AnsweringBody/AnsweringBodyId')
      q.answering_body_name       = xml.text(el, 'AnsweringBody/AnsweringBodyName')
      q.answering_body_short_name = xml.text(el, 'AnsweringBody/AnsweringBodyShortName')
      q.house_id                  = xml.text(el, 'House/HouseId')
      q.house_name                = xml.text(el, 'House/HouseName')
      q.member_id                 = xml.text(el, 'TablingMember/MemberId')
      q.member_name               = xml.text(el, 'TablingMember/MemberName')
      q.member_constituency       = xml.text(el, 'TablingMember/Constituency')
      q.question_status           = xml.text(el, 'QuestionStatus')
      q.question_type             = xml.text(el, 'QuestionType')

      q.registered_interest       = xml.bool(el, 'RegisteredInterest')

      q.session                   = xml.text(el, 'Session')
      q.target                    = xml.text(el, 'Target')
      q.text                      = xml.text(el, 'Text')
      q.url                       = xml.text(el, 'Url')

      q.version_number            = xml.int(el, 'VersionNumber')
      q.parliament_number         = xml.int(el, 'ParliamentNumber')
      q.session_number            = xml.int(el, 'SessionNumber')
      q
    end
  end
end


text:
import WordDelay from "./WordDelay.js";
import TextInputContainer from "../../../html/Form/TextInput.js";

export default class DelayTextInputContainer extends TextInputContainer {

    onValueChange = null;

    constructor(parentContainer) {

        super(parentContainer);

        let requestNumber = 0;

        let local = this;

        this.onKeyUp = function (event) {

            requestNumber++;

            let delay = new WordDelay();
            delay.delay = 200;
            delay.requestNumber = requestNumber;
            delay.onDelay = function () {

                if (delay.requestNumber === requestNumber) {
                    local.onValueChange();
                }

            }

        }

    }

}