text:
=head1 LICENSE

# Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

=head1 CONTACT

  Please email comments or questions to the public Ensembl
  developers list at <http://lists.ensembl.org/mailman/listinfo/dev>.

  Questions may also be sent to the Ensembl help desk at
  <http://www.ensembl.org/Help/Contact>.

=cut

=head1 NAME

Bio::EnsEMBL::Analysis::RunnableDB::lincRNAFinder -

=head1 SYNOPSIS

=head1 DESCRIPTION

=head1 METHODS

=cut
package Bio::EnsEMBL::Analysis::RunnableDB::lincRNAFinder;

use warnings ;
use vars qw(@ISA);
use strict;

use Bio::EnsEMBL::Analysis;
use Bio::EnsEMBL::Analysis::RunnableDB::BaseGeneBuild;
use Bio::EnsEMBL::Analysis::Config::GeneBuild::lincRNAFinder;
use Bio::EnsEMBL::Analysis::Runnable::lincRNAFinder;
use Bio::EnsEMBL::Utils::Exception qw(throw warning);
use Bio::EnsEMBL::Utils::Argument qw (rearrange);
use Bio::EnsEMBL::Analysis::RunnableDB;
use Bio::EnsEMBL::Analysis::Tools::Logger;
use Bio::EnsEMBL::Analysis::Tools::GeneBuildUtils qw(id coord_string lies_inside_of_slice);
use Bio::EnsEMBL::Analysis::Tools::GeneBuildUtils::GeneUtils ;

@ISA = qw(Bio::EnsEMBL::Analysis::RunnableDB::BaseGeneBuild Bio::EnsEMBL::Analysis::RunnableDB);

=head2 new

  Arg [1]   : Bio::EnsEMBL::Analysis::RunnableDB::lincRNAFinder
  Function  : instatiates a lincRNAFinder object and reads and checks the config
  file
  Returntype: Bio::EnsEMBL::Analysis::RunnableDB::lincRNAFinder
  Exceptions:
  Example   :

=cut

sub new {
  my ($class,@args) = @_;
  my $self = $class->SUPER::new(@args);

  $self->read_and_check_config($LINCRNA_CONFIG_BY_LOGIC);
  $self->OUTPUT_BIOTYPE($self->analysis->logic_name) if(!$self->OUTPUT_BIOTYPE);

  return $self;
}

sub fetch_input{
  my ($self) = @_;

  $self->query($self->fetch_sequence);

  # get cdnas and convert them to single transcript genes
  my $new_cdna = $self->get_genes_of_biotypes_by_db_hash_ref($self->NEW_SET_1_CDNA);
  my @single_transcript_cdnas =  map { @{convert_to_single_transcript_gene($_)}  }  @$new_cdna ;

  # get protein_coding genes and convert them to single transcript genes
  my $new_set_prot = $self->get_genes_of_biotypes_by_db_hash_ref($self->NEW_SET_2_PROT);
  my @single_trans_pc = map { @{convert_to_single_transcript_gene($_)}  }  @$new_set_prot;

  # create runnable

  my $runnable = Bio::EnsEMBL::Analysis::Runnable::lincRNAFinder->new(
        -query => $self->query,
        -analysis => $self->analysis,
     );

  # add hash-keys and hash-values directly to the $runnable hashref. quicker than using constructors...

  $runnable->set_1_cdna_genes(\@single_transcript_cdnas);
  $runnable->set_2_prot_genes(\@single_trans_pc);
  $runnable->efg_simple_feature_genes($self->get_efg_simple_features);

  $runnable->ignore_strand($self->CDNA_CODING_GENE_CLUSTER_IGNORE_STRAND);
  $runnable->find_single_exon_candidates($self->FIND_SINGLE_EXON_LINCRNA_CANDIDATES);

  $runnable->check_cdna_overlap_with_both_K4_K36($self->CHECK_CDNA_OVERLAP_WITH_BOTH_K4_K36);
  $runnable->check_cdna_overlap_with_multiple_K36($self->CHECK_CDNA_OVERLAP_WITH_MULTI_K36);

  $runnable->maximum_translation_length_ratio($self->MAXIMUM_TRANSLATION_LENGTH_RATIO);
  $runnable->max_translations_stored_per_gene($self->MAX_TRANSLATIONS_PER_GENE) ;

  $runnable->efg_clustering_with_cdna_analysis($self->create_analysis_object($self->DEBUG_LG_EFG_CLUSTERING_WITH_CDNA)) ;
  $runnable->unclustered_efg_analysis( $self->create_analysis_object($self->DEBUG_LG_EFG_UNCLUSTERED));

  $self->runnable($runnable);
};

sub update_efg_and_cdna_db {
  my ($self) = @_;

  # update efg features and change their analysis according to their clustering
  print "Going to write simple features which have been converted to genes ...\n" ;
  for my $rb ( @{ $self->runnable() } ) {
  my @efg_genes  = @{ $rb->updated_efg_genes } ;
    my $gfa = $self->get_dbadaptor($self->DEBUG_OUTPUT_DB)->get_GeneAdaptor() ;
    for my $e ( @efg_genes ) {
      $gfa->store($e) ;
    }
  }
  print "Updated database " . $self->DEBUG_OUTPUT_DB . " with efg features 'genes'.\n" ;

  for my $rb ( @{ $self->runnable() } ) {
    print "Going to write cDNA genes for debugging ...\n";
    my $gfa = $self->get_dbadaptor($self->DEBUG_OUTPUT_DB)->get_GeneAdaptor() ;
    for my $cdna (@{$rb->updated_cdnas}) {
      $gfa->store($cdna);
    }
  }
  print "Updated database " . $self->DEBUG_OUTPUT_DB . " with debugging cDNA 'genes'.\n" ;
}

sub write_output{
  my ($self) = @_;

  if ( $self->WRITE_DEBUG_OUTPUT ) {
    $self->update_efg_and_cdna_db() ;
  }

  my $ga = $self->output_db->get_GeneAdaptor;

  logger_info("have ".@{$self->output}." genes to write");

  my $sucessful_count = 0 ;

  GENE: foreach my $gene(@{$self->output}){

   if ( !defined $gene->get_all_Transcripts ) {
       throw (" gene does not have any transcripts ....\n" ) ;
   }

    my @tr = @{ $gene->get_all_Transcripts };
    my $max_ex = 0;

    for ( @tr ) {
       $_->status(undef);
       $_->analysis($self->analysis);
    }

    $gene->biotype($self->OUTPUT_BIOTYPE);
    $gene->status(undef);
    $gene->analysis($self->analysis);

    eval{
      $ga->store($gene);
    };

    if($@){
      warning("Failed to write gene ".id($gene)." ".coord_string($gene)." $@");
    }else{
      $sucessful_count++;
      logger_info("STORED LINCRNA GENE ".$gene->dbID);
      print "STORED LINCRNA GENE ".$gene->dbID . " " . $gene->biotype . " " .  $self->output_db->dbname . " @ ".$self->output_db->host . " ".scalar(@tr) . " transcripts\n"  ;
    }
  }
     print $sucessful_count ." genes written to " . $self->output_db->dbname . " @ ".
     $self->output_db->host . "\n"  ;

  if($sucessful_count != @{$self->output}){
    throw("Failed to write some genes");
  }
}

sub output_db{
  my ($self, $db) = @_;

  if(!$self->{'output_db'}){
    my $db = $self->get_dbadaptor($self->OUTPUT_DB);
    #$db->disconnect_when_inactive(1);
    $self->{output_db} = $db;
  }
  return $self->{output_db};
}

sub get_efg_simple_features {
  my ( $self ) = @_ ;

  my $dba = $self->get_dbadaptor($self->EFG_FEATURE_DB);
  $dba->disconnect_when_inactive(1);

  my $set_db = $dba->get_SimpleFeatureAdaptor();
  print "Fetching EFG domain data from " . $dba->dbname . "\@" . $dba->host . ".... \n";

  my @simple_features = @{ $set_db->fetch_all_by_Slice($self->query) };
  return  $self->convert_simple_features(\@simple_features);
}

sub convert_simple_features {
  my ( $self, $sf) = @_ ;
  my @converted_sf;
  my @simple_features= @$sf;

  print scalar(@simple_features ) . " retrieved \n" ;
  my %lg_names ;
  my @filtered_sf ;
  for my $sf ( @simple_features ) {
    for my $lg ( @{ $self->EFG_FEATURE_NAMES } ) {
      if ( $sf->analysis ) {
         if ( $sf->analysis->logic_name =~m/^$lg$/) {
           push @filtered_sf, $sf ;
         }
      } else {
         throw ("sf with dbID " . $sf->dbID . " does not have a logic_name , this might be 'cause it has just been created ...! \n") ;
      }
    }
  }
  @simple_features = @filtered_sf ;
  print " after filtering by logic names got " . scalar(@simple_features ) . " features left ...\n" ;

  my $offset =  $self->EXTEND_EFG_FEATURES;
  print "Extending start/end of EFG domains by +-$offset bp.\n";

  for my $f ( @simple_features ) {

    my $f_start ;
    my $f_end ;

    $f_start = $f->start - $offset ;
    $f_end = $f->end+ $offset ;

    #print $f->strand . " : BEFORE S : " . $f->start . "  --->   $f_start \n" ;
    #print $f->strand . " : BEFORE E : " . $f->end  . "  --->   $f_end  \n ";
    #print $f->strand . " : BEFORE L : " . ($f->end - $f->start )   . "  ---> NOW :  " . ($f_end - $f_start) . " \n ";

       my $ex = new Bio::EnsEMBL::Exon(
      -START     => $f_start,
      -END       => $f_end,
      -STRAND    => $f->strand,
      -SLICE     => $f->slice,
      -PHASE     => '0' ,
      -END_PHASE     => '0' ,
      -ANALYSIS  => $f->analysis,
    );
    my $tran = new Bio::EnsEMBL::Transcript();
    $tran->add_Exon($ex) ;
    $tran->analysis($f->analysis);
    my $gene = new Bio::EnsEMBL::Gene() ;
    $gene->add_Transcript($tran) ;
    $gene->biotype("efg") ; # don't change this biotype
    $gene->biotype("efg") ; # don't change this biotype
    $gene->description($f->display_label);
    $gene->dbID($f->dbID) ;
    $gene->analysis($f->analysis);
    push @converted_sf, $gene ;
  }
  return \@converted_sf;
}

=head2 read_and_check_config

  Arg [1]   : Bio::EnsEMBL::Analysis::RunnableDB::lincRNAFinder
  Arg [2]   : hashref from config file
  Function  : call the superclass method to set all the varibles and carry
  out some sanity checking
  Returntype: N/A
  Exceptions: throws if certain key variables aren't set properly
  Example   :

=cut

sub read_and_check_config{
  my ($self, $hash) = @_;
  $self->SUPER::read_and_check_config($hash);

  #######
  #CHECKS
  #######
  foreach my $var(qw(NEW_SET_1_CDNA NEW_SET_2_PROT OUTPUT_DB OUTPUT_BIOTYPE EFG_FEATURE_NAMES EXTEND_EFG_FEATURES )){
    throw("RunnableDB::lincRNAFinder $var config variable is not defined")
      unless($self->$var);
  }

}

=head2 NEW_SET_1_CDNA

  Arg [1]   : Bio::EnsEMBL::Analysis::RunnableDB::GeneBuilder
  Arg [2]   : Varies, tends to be boolean, a string, a arrayref or a hashref
  Function  : Getter/Setter for config variables
  Returntype: again varies
  Exceptions:
  Example   :

=cut

sub NEW_SET_1_CDNA {
  my ($self, $arg) = @_;
  if($arg){
    $self->{'NEW_SET_1_CDNA'} = $arg;
  }
  return $self->{'NEW_SET_1_CDNA'};
}

sub NEW_SET_2_PROT{
  my ($self, $arg) = @_;
  if($arg){
    $self->{'NEW_SET_2_PROT'} = $arg;
  }
  return $self->{'NEW_SET_2_PROT'};
}

sub OUTPUT_DB{
  my ($self, $arg) = @_;
  if($arg){
    $self->{'OUTPUT_DB'} = $arg;
  }
  return $self->{'OUTPUT_DB'};
}

sub EFG_FEATURE_DB{
  my ($self, $arg) = @_;
  if(defined $arg){
    $self->{'EFG_FEATURE_DB'} = $arg;
  }
  return $self->{'EFG_FEATURE_DB'};
}

sub EFG_FEATURE_NAMES {
  my ($self, $arg) = @_;
  if(defined $arg){
    $self->{'EFG_FEATURE_NAMES'} = $arg;
  }
  return $self->{'EFG_FEATURE_NAMES'};
}

sub EXTEND_EFG_FEATURES{
  my ($self, $arg) = @_;
  if(defined $arg){
    $self->{'EXTEND_EFG_FEATURES'} = $arg;
  }
  return $self->{EXTEND_EFG_FEATURES};
}

sub OUTPUT_BIOTYPE{
  my ($self, $arg) = @_;
  if(defined $arg){
    $self->{'OUTPUT_BIOTYPE'} = $arg;
  }
  return $self->{'OUTPUT_BIOTYPE'};
}

sub DEBUG_OUTPUT_DB{
  my ($self, $arg) = @_;
  if(defined $arg){
    $self->{'DEBUG_OUTPUT_DB'} = $arg;
  }
  return $self->{'DEBUG_OUTPUT_DB'};
}

sub DEBUG_LG_EFG_CLUSTERING_WITH_CDNA{
  my ($self, $arg) = @_;
  if(defined $arg){
    $self->{'DEBUG_LG_EFG_CLUSTERING_WITH_CDNA'} = $arg;
  }
  return $self->{'DEBUG_LG_EFG_CLUSTERING_WITH_CDNA'};
}

sub MAX_TRANSLATIONS_PER_GENE {
  my ($self, $arg) = @_;
  if(defined $arg){
    $self->{'MAX_TRANSLATIONS_PER_GENE'} = $arg;
  }
  return $self->{'MAX_TRANSLATIONS_PER_GENE'};
}

sub MAXIMUM_TRANSLATION_LENGTH_RATIO {
  my ($self, $arg) = @_;
  if(defined $arg){
    $self->{'MAXIMUM_TRANSLATION_LENGTH_RATIO'} = $arg;
  }
  return $self->{'MAXIMUM_TRANSLATION_LENGTH_RATIO'};
}

sub DEBUG_LG_EFG_UNCLUSTERED{
  my ($self, $arg) = @_;
  if(defined $arg){
    $self->{'DEBUG_LG_EFG_UNCLUSTERED'} = $arg;
  }
  return $self->{'DEBUG_LG_EFG_UNCLUSTERED'};
}

sub WRITE_DEBUG_OUTPUT {
  my ($self, $arg) = @_;
  if(defined $arg){
    $self->{'WRITE_DEBUG_OUTPUT'} = $arg;
  }
  return $self->{'WRITE_DEBUG_OUTPUT'};
}

sub CDNA_CODING_GENE_CLUSTER_IGNORE_STRAND {
  my ($self, $arg) = @_;
  if(defined $arg){
    $self->{'CDNA_CODING_GENE_CLUSTER_IGNORE_STRAND'} = $arg;
  }
  return $self->{'CDNA_CODING_GENE_CLUSTER_IGNORE_STRAND'};
}

sub CHECK_CDNA_OVERLAP_WITH_BOTH_K4_K36 {
  my ($self, $arg) = @_;
  if(defined $arg){
    $self->{'CHECK_CDNA_OVERLAP_WITH_BOTH_K4_K36'} = $arg;
  }
  return $self->{'CHECK_CDNA_OVERLAP_WITH_BOTH_K4_K36'};
}

sub CHECK_CDNA_OVERLAP_WITH_MULTI_K36 {
  my ($self, $arg) = @_;
  if(defined $arg){
    $self->{'CHECK_CDNA_OVERLAP_WITH_MULTI_K36'} = $arg;
  }
  return $self->{'CHECK_CDNA_OVERLAP_WITH_MULTI_K36'};
}

sub FIND_SINGLE_EXON_LINCRNA_CANDIDATES {
  my ($self, $arg) = @_;
  if (defined $arg){
    $self->{'FIND_SINGLE_EXON_LINCRNA_CANDIDATES'} = $arg;
  }
  return $self->{'FIND_SINGLE_EXON_LINCRNA_CANDIDATES'};
}

sub create_analysis_object {
  my ($self,$logic_name ) = @_ ;

  my $efg_out = $self->get_dbadaptor($self->DEBUG_OUTPUT_DB);
  my $aa = $efg_out->get_AnalysisAdaptor() ;
  my $analysis =  $aa->fetch_by_logic_name($logic_name) ;
  if ( $analysis ) {
     return $analysis ;
  }
  # need to create analysis object first
  $analysis=Bio::EnsEMBL::Analysis->new(
                                       -logic_name => $logic_name ,
                                       );
  return $analysis ;
}

use vars '$AUTOLOAD';
sub AUTOLOAD {
 my ($self,$val) = @_;
 (my $routine_name=$AUTOLOAD)=~s/.*:://; #trim package name
 $self->{$routine_name}=$val if defined $val ;
 return $self->{$routine_name} ;
}
sub DESTROY {} # required due to AUTOLOAD

1;


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:background="@color/LightGrey"
              android:orientation="vertical">

    <View
        android:layout_width="match_parent"
        android:layout_height="@dimen/spacing_normal"
        android:layout_gravity="center_horizontal"
        android:layout_marginLeft="@dimen/spacing_triple"
        android:layout_marginRight="@dimen/spacing_triple"
        android:layout_marginTop="@dimen/spacing_triple"
        android:background="@color/silver"/>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="@dimen/spacing_double"
        android:layout_marginRight="@dimen/spacing_double"
        android:background="@color/white"
        android:orientation="vertical"
        android:padding="@dimen/spacing_double">

        <android.support.design.widget.TextInputLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <EditText
                android:id="@+id/inpFullName"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="Full Name"
                android:imeOptions="actionNext"
                android:inputType="text"/>
        </android.support.design.widget.TextInputLayout>

        <android.support.design.widget.TextInputLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <EditText
                android:id="@+id/inpEmail"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="Email"
                android:imeOptions="actionNext"
                android:inputType="textEmailAddress"/>
        </android.support.design.widget.TextInputLayout>

        <android.support.design.widget.TextInputLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="@dimen/spacing_normal">

            <EditText
                android:id="@+id/inpPhone"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="Phone Number"
                android:imeOptions="actionNext"
                android:inputType="number"/>
        </android.support.design.widget.TextInputLayout>

        <android.support.design.widget.TextInputLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="@dimen/spacing_normal">

            <EditText
                android:id="@+id/inpPassword"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="Password"
                android:imeOptions="actionDone"
                android:inputType="textPassword"/>
        </android.support.design.widget.TextInputLayout>

        <Button
            android:id="@+id/btnRegister"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="@dimen/spacing_double"
            android:background="@color/colorPrimary"
            android:text="Register"
            android:textColor="@color/white"/>
    </LinearLayout>

</LinearLayout>

redpajama_set_name: RedPajamaGithub


text:
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}

module User.Json (
) where

import User.Model
import Club.Model
import Data.Aeson.Compat

instance ToJSON User
instance ToJSON Gender

instance FromJSON User where
  parseJSON = withObject "user" $ \o -> do
    usrEmail <- o .: "email"
    usrName <- o .: "name"
    usrGender <- o .: "gender"
    let usrId = 1
    return User'{..}

instance FromJSON Gender where
  parseJSON = withText "gender" (\x -> return Female)


text:
"""Chromium presubmit script for third_party/polymer/v1_0.

See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details on the presubmit API built into depot_tools.
"""

import os
import json

def _CheckBowerDependencies(input_api, output_api):
  os_path = input_api.os_path
  cwd = input_api.PresubmitLocalPath()
  components_dir = os_path.join(cwd, 'components-chromium')
  bower_json_path = os_path.join(cwd, 'bower.json')

  for f in input_api.AffectedFiles(include_dirs=True):
    p = f.AbsoluteLocalPath()
    if p == bower_json_path or p.startswith(components_dir):
      break
  else:
      return []

  bower_dependencies = \
      set(json.load(open(bower_json_path))['dependencies'].keys())
  installed_components = set(p for p in os.listdir(components_dir))
  # Add web-animations-js because we keep it in a separate directory
  # '../third_party/web-animations-js'.
  installed_components.add('web-animations-js')

  if bower_dependencies == installed_components:
    return []

  problems = []

  if installed_components - bower_dependencies:
    problems.append(output_api.PresubmitError(
        'Found components that are not listed in bower.json.',
        items = list(installed_components - bower_dependencies)))

  if bower_dependencies - installed_components:
    problems.append(output_api.PresubmitError(
        'Some of the Bower dependencies are not installed.',
        items = list(bower_dependencies - installed_components)))

  return problems

def CheckChangeOnUpload(input_api, output_api):
  return _CheckBowerDependencies(input_api, output_api)

def CheckChangeOnCommit(input_api, output_api):
  return _CheckBowerDependencies(input_api, output_api)


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Pseudobaeomyces pachycarpus var. pachycarpus

### Remarks
null


text:
<?php

class User {

    protected $data = array();

    public function __construct($id)
    {
        $this->userID = $id;
        $this->userNameFirst = 'Not available';
        $this->userNameLast  = 'Not available';
        $this->userPassword  = 'Not available';
        $this->userEmail     = 'Not available';
        $this->userStatus    = 'Not available';
    }
    public function __construct($user_id,$user_nameFirst , $user_nameLast ,$user_password ,$user_email ,$user_status)
    {
        $this->userID 	     = $user_id;
        $this->userNameFirst = $user_nameFirst;
        $this->userNameLast  = $user_nameLast;
        $this->userPassword  = $user_password;
        $this->userEmail     = $user_email;
        $this->userStatus    = $user_status;
    }

    public function __set($name, $value)
    {
        $this -> data[$name] = $value;
    }

    public function __get($name)
    {
        if ( isset($this -> data[$name]) ) {
            return $this -> data[$name];
        } else {
            return false;
        }
    }

    public function getUserStatus()
    {
        if (is_numeric($this->userStatus)) {
            return number_format($this->userStatus);
        } else {
            return $this->userStatus;
        }
    }

    public function __toString()
    {
        $output =  'userID	 : ' . $this->car_id 	    . '
';
        $output .= 'userNameFirst: ' . $this->userNameFirst . '
';
        $output .= 'userNameLast : ' . $this->userNameLast  . '
';
        $output .= 'userPassword : ' . $this->userPassword  . '
';
        $output .= 'userEmail	 : ' . $this->userEmail     . '
';
        $output .= 'userStatus	 : ' . $this->getUserStatus . '
';
        return $output;
    }

}


text:
namespace content {
class ContentViewCoreImpl;
class SynchronousCompositorClient;
class WebContentsImpl;

// Android-specific implementation of the WebContentsView.
class WebContentsViewAndroid : public WebContentsView,
                               public RenderViewHostDelegateView {
 public:
  WebContentsViewAndroid(WebContentsImpl* web_contents,
                         WebContentsViewDelegate* delegate);
  ~WebContentsViewAndroid() override;

  // Sets the interface to the view system. ContentViewCoreImpl is owned
  // by its Java ContentViewCore counterpart, whose lifetime is managed
  // by the UI frontend.
  void SetContentViewCore(ContentViewCoreImpl* content_view_core);

  void set_synchronous_compositor_client(SynchronousCompositorClient* client) {
    synchronous_compositor_client_ = client;
  }

  SynchronousCompositorClient* synchronous_compositor_client() const {
    return synchronous_compositor_client_;
  }

  void SetOverscrollRefreshHandler(
      std::unique_ptr<ui::OverscrollRefreshHandler> overscroll_refresh_handler);

  // WebContentsView implementation --------------------------------------------
  gfx::NativeView GetNativeView() const override;
  gfx::NativeView GetContentNativeView() const override;
  gfx::NativeWindow GetTopLevelNativeWindow() const override;
  void GetScreenInfo(ScreenInfo* screen_info) const override;
  void GetContainerBounds(gfx::Rect* out) const override;
  void SizeContents(const gfx::Size& size) override;
  void Focus() override;
  void SetInitialFocus() override;
  void StoreFocus() override;
  void RestoreFocus() override;
  DropData* GetDropData() const override;
  gfx::Rect GetViewBounds() const override;
  void CreateView(const gfx::Size& initial_size,
                  gfx::NativeView context) override;
  RenderWidgetHostViewBase* CreateViewForWidget(
      RenderWidgetHost* render_widget_host,
      bool is_guest_view_hack) override;
  RenderWidgetHostViewBase* CreateViewForPopupWidget(
      RenderWidgetHost* render_widget_host) override;
  void SetPageTitle(const base::string16& title) override;
  void RenderViewCreated(RenderViewHost* host) override;
  void RenderViewSwappedIn(RenderViewHost* host) override;
  void SetOverscrollControllerEnabled(bool enabled) override;

  // Backend implementation of RenderViewHostDelegateView.
  void ShowContextMenu(RenderFrameHost* render_frame_host,
                       const ContextMenuParams& params) override;
  void ShowPopupMenu(RenderFrameHost* render_frame_host,
                     const gfx::Rect& bounds,
                     int item_height,
                     double item_font_size,
                     int selected_item,
                     const std::vector<MenuItem>& items,
                     bool right_aligned,
                     bool allow_multiple_selection) override;
  void HidePopupMenu() override;
  ui::OverscrollRefreshHandler* GetOverscrollRefreshHandler() const override;
  void StartDragging(const DropData& drop_data,
                     blink::WebDragOperationsMask allowed_ops,
                     const gfx::ImageSkia& image,
                     const gfx::Vector2d& image_offset,
                     const DragEventSourceInfo& event_info,
                     RenderWidgetHostImpl* source_rwh) override;
  void UpdateDragCursor(blink::WebDragOperation operation) override;
  void GotFocus() override;
  void TakeFocus(bool reverse) override;

  void OnDragEntered(const std::vector<DropData::Metadata>& metadata,
                     const gfx::Point& location,
                     const gfx::Point& screen_location);
  void OnDragUpdated(const gfx::Point& location,
                     const gfx::Point& screen_location);
  void OnDragExited();
  void OnPerformDrop(DropData* drop_data,
                     const gfx::Point& location,
                     const gfx::Point& screen_location);
  void OnDragEnded();

 private:
  // The WebContents whose contents we display.
  WebContentsImpl* web_contents_;

  // ContentViewCoreImpl is our interface to the view system.
  ContentViewCoreImpl* content_view_core_;

  // Handles "overscroll to refresh" events
  std::unique_ptr<ui::OverscrollRefreshHandler> overscroll_refresh_handler_;

  // Interface for extensions to WebContentsView. Used to show the context menu.
  std::unique_ptr<WebContentsViewDelegate> delegate_;

  // The native view associated with the contents of the web.
  ui::ViewAndroid view_;

  // Interface used to get notified of events from the synchronous compositor.
  SynchronousCompositorClient* synchronous_compositor_client_;

  DISALLOW_COPY_AND_ASSIGN(WebContentsViewAndroid);
};

} // namespace content

#endif  // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_ANDROID_H_


text:
//
//  JoystickView.m
//  RYTSketchView
//
//  Created by Ryan Tan on 23/5/12.
//  Copyright (c) 2012 Ryan Tan. All rights reserved.
//

#import "RYTJoystickView.h"

@implementation RYTJoystickView

@synthesize delegate, shouldShowJoystick;

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {

        //self.backgroundColor = [UIColor redColor]; // For testing
        self.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"Joystick-bg"]];

        stick = [[UIView alloc]init];
        stick.frame = CGRectMake(50, 50, 50, 50);

        //stick.backgroundColor = [UIColor blueColor]; // For testing
        stick.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"Joystick-stick"]];

        [self addSubview:stick];
    }
    return self;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
    // Drawing code
}
*/

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
    //NSLog(@"JoystickViewController.touchesBegan:withEvent:");
    UITouch *theTouch = (UITouch*)[[touches allObjects] objectAtIndex:0];

    firstLocation = [theTouch locationInView:self];
    //NSLog(@"firstLocation=%@", NSStringFromCGPoint(firstLocation));
}

- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{
    //NSLog(@"JoystickViewController.touchesMoved:withEvent:");
    UITouch *theTouch = (UITouch*)[[touches allObjects] objectAtIndex:0];

    CGPoint currLocation = [theTouch locationInView:self];
    //NSLog(@"currLocation=%@", NSStringFromCGPoint(currLocation));
    //[theTouch locationInView:self.view];

    CGPoint delta;
    //delta = CGPointMake((currLocation.x - firstLocation.x)/self.bounds.size.width, (currLocation.y - firstLocation.y)/self.bounds.size.height);
    delta = CGPointMake((currLocation.x-25)/(self.bounds.size.width-50), (currLocation.y-25)/(self.bounds.size.height-50));
    //NSLog(@"delta=%@", NSStringFromCGPoint(delta));

    delta.x = delta.x < 0 ? 0 : delta.x;
    delta.x = delta.x > 1 ? 1 : delta.x;
    delta.y = delta.y < 0 ? 0 : delta.y;
    delta.y = delta.y > 1 ? 1 : delta.y;
    //NSLog(@"delta=%@", NSStringFromCGPoint(delta));

    if (delegate){
        [delegate joystick:self moved:delta];
    }else{
        NSLog(@"JoystickViewController.touchesMoved:withEvent:  delegate is nil!");
    }

    currLocation.x = (delta.x * (self.bounds.size.width-50)) + 25;
    currLocation.y = (delta.y * (self.bounds.size.height-50)) + 25;

    stick.center = currLocation;

}

- (void)resetJoystick{
    [UIView animateWithDuration:0.2 delay:0.0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
        stick.center = CGPointMake(self.bounds.size.width/2, self.bounds.size.height/2);
    } completion:^(BOOL finished) {
        //do nothing
    }];
}

@end


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<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/maven-v4_0_0.xsd">

  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.apache.camel</groupId>
    <artifactId>camel-salesforce-parent</artifactId>
    <version>2.19.0-SNAPSHOT</version>
  </parent>

  <artifactId>camel-salesforce</artifactId>
  <packaging>jar</packaging>
  <name>Camel :: Salesforce</name>
  <description>Camel Salesforce support</description>

  <properties>
    <camel.osgi.export.pkg>
      org.apache.camel.component.salesforce,
      org.apache.camel.component.salesforce.api.*
    </camel.osgi.export.pkg>
    <camel.osgi.export.service>org.apache.camel.spi.ComponentResolver;component=salesforce</camel.osgi.export.service>
    <camel.osgi.private.pkg>org.apache.camel.component.salesforce.internal.*</camel.osgi.private.pkg>
    <salesforce.component.root>..</salesforce.component.root>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-csv</artifactId>
      <version>${commons-csv-version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-core</artifactId>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-client</artifactId>
      <version>${jetty9-version}</version>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-util</artifactId>
      <version>${jetty9-version}</version>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-util-ajax</artifactId>
      <version>${jetty9-version}</version>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-io</artifactId>
      <version>${jetty9-version}</version>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-annotations</artifactId>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-core</artifactId>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
    </dependency>
    <dependency>
      <groupId>com.thoughtworks.xstream</groupId>
      <artifactId>xstream</artifactId>
    </dependency>
    <dependency>
      <groupId>org.cometd.java</groupId>
      <artifactId>cometd-java-client</artifactId>
      <version>${cometd-java-client-version}</version>
      <exclusions>
        <exclusion>
          <groupId>org.eclipse.jetty</groupId>
          <artifactId>*</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.slf4j</groupId>
          <artifactId>slf4j-api</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <!-- logging -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>

    <!-- testing -->
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-api</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-slf4j-impl</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-test</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-csv</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-server</artifactId>
      <version>${jetty9-version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-servlet</artifactId>
      <version>${jetty9-version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-proxy</artifactId>
      <version>${jetty9-version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.googlecode.junit-toolbox</groupId>
      <artifactId>junit-toolbox</artifactId>
      <version>2.2</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.gmavenplus</groupId>
        <artifactId>gmavenplus-plugin</artifactId>
        <version>1.5</version>
        <executions>
          <execution>
            <goals>
              <goal>addTestSources</goal>
              <goal>testCompile</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>integration</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-antrun-plugin</artifactId>
            <executions>
              <execution>
                <id>setup-salesforce-instance</id>
                <goals>
                  <goal>run</goal>
                </goals>
                <phase>pre-integration-test</phase>
                <configuration>
                  <target>
                    <taskdef resource="com/salesforce/antlib.xml" uri="antlib:com.salesforce">
                      <classpath>
                        <pathelement location="${salesforce.component.root}/it/resources/migration-tool/ant-salesforce.jar" />
                      </classpath>
                    </taskdef>

                    <property file="${salesforce.component.root}/test-salesforce-login.properties" />

                    <sf:deploy xmlns:sf="antlib:com.salesforce" username="${userName}" password="${password}"
                      deployRoot="${salesforce.component.root}/it/resources/salesforce" rollbackOnError="true" />
                  </target>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-failsafe-plugin</artifactId>
            <executions>
              <execution>
                <phase>integration-test</phase>
                <goals>
                  <goal>integration-test</goal>
                </goals>
                <configuration>
                  <childDelegation>false</childDelegation>
                  <useFile>true</useFile>
                  <forkCount>3</forkCount>
                  <runOrder>random</runOrder>
                  <reuseForks>true</reuseForks>
                  <forkedProcessTimeoutInSeconds>300</forkedProcessTimeoutInSeconds>
                  <includes>
                    <include>**/*IntegrationTest.java</include>
                  </includes>
                  <excludedGroups>org.apache.camel.component.salesforce.Standalone</excludedGroups>
                </configuration>
              </execution>
              <execution>
                <id>standalone-integration-tests</id>
                <phase>integration-test</phase>
                <goals>
                  <goal>integration-test</goal>
                </goals>
                <configuration>
                  <childDelegation>false</childDelegation>
                  <useFile>true</useFile>
                  <includes>
                    <include>**/*IntegrationTest.java</include>
                  </includes>
                  <groups>org.apache.camel.component.salesforce.Standalone</groups>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>


text:
/* SystemJS module definition */
declare var module: NodeModule;
interface NodeModule {
  id: string;
}

declare var System: any;

declare class Clipboard {
    constructor(selector: (string | Element | NodeListOf<Element>), options?: ClipboardOptions);

    /**
     * Subscribes to events that indicate the result of a copy/cut operation.
     * @param type {String} Event type ('success' or 'error').
     * @param handler Callback function.
     */
    on(type: 'success', handler: (e: ClipboardEvent) => void): this;
    on(type: 'error', handler: (e: ClipboardEvent) => void): this;
    on(type: string, handler: (e: ClipboardEvent) => void): this;

    /**
     * Clears all event bindings.
     */
    destroy(): void;
}

interface ClipboardOptions {
    /**
     * Overwrites default command ('cut' or 'copy').
     * @param {Element} elem Current element
     * @returns {String} Only 'cut' or 'copy'.
     */
    action?: (elem: Element) => string;

    /**
     * Overwrites default target input element.
     * @param {Element} elem Current element
     * @returns {Element} <input> element to use.
     */
    target?: (elem: Element) => Element;

    /**
     * Returns the explicit text to copy.
     * @param {Element} elem Current element
     * @returns {String} Text to be copied.
     */
    text?: (elem: Element) => string;
}

interface ClipboardEvent {
    action: string;
    text: string;
    trigger: Element;
    clearSelection(): void;
}

declare module 'clipboard' {
    export default Clipboard;
}

/**
 * Typescript interface definitions for using
 * Jeff Mesnil's stomp.js Javascript STOMP client
 * under Typescript, for example with Angular 2.
 *
 * https://github.com/jmesnil/stomp-websocket
 *
 */
declare module 'stompjs/lib/stomp.min' {

  export interface Client {
    heartbeat: any;

    debug(...args: string[]): any;

    connect(...args: any[]): any;
    disconnect(disconnectCallback: () => any, headers?: any): any;

    send(destination: string, headers?: any, body?: string): any;
    subscribe(destination: string, callback?: (message: Message) => any, body?: string): any;
    unsubscribe(id: string): any;

    begin(transaction: string): any;
    commit(transaction: string): any;
    abort(transaction: string): any;

    ack(messageID: string, subscription: string, headers?: any): any;
    nack(messageID: string, subscription: string, headers?: any): any;
  }

  export interface Message {
    command: string;
    headers: any;
    body: string;

    ack(headers?: any): any;
    nack(headers?: any): any;
  }

  export interface Frame {
    constructor(command: string, headers?: any, body?: string): any;

    toString(): string;
    sizeOfUTF8(s: string): any;
    unmarshall(datas: any): any;
    marshall(command: string, headers?: any, body?: any): any;
  }

  export interface Stomp {
    client: Client;
    Frame: Frame;

    over(ws: WebSocket): any;
  }

  export var Stomp: any;
}

// Type definitions for sockjs-client 1.0.3
// Project: https://github.com/sockjs/sockjs-client
// Definitions by: Emil Ivanov <https://github.com/vladev>, Alexander Rusakov <https://github.com/arusakov/>

declare namespace __SockJSClient {
  interface BaseEvent {
    type: string;
  }

  interface OpenEvent extends BaseEvent {}

  interface CloseEvent extends BaseEvent {
    code: number;
    reason: string;
    wasClean: boolean;
  }

  interface MessageEvent extends BaseEvent {
    data: string;
  }

  interface SessionGenerator {
    (): string;
  }

  interface Options {
    server?: string;
    sessionId?: number | SessionGenerator;
    transports?: string | string[];
  }

  enum State {
    CONNECTING = 0, OPEN, CLOSING, CLOSED
  }

  interface SockJSClass extends EventTarget {
    readyState: State;
    protocol: string;
    url: string;
    onopen: (e: OpenEvent) => any;
    onclose: (e: CloseEvent) => any;
    onmessage: (e: MessageEvent) => any;
    send(data: any): void;
    close(code?: number, reason?: string): void;
  }
}

declare module 'sockjs-client' {
  import SockJSClass = __SockJSClient.SockJSClass;
  import Options = __SockJSClient.Options;
  import State = __SockJSClient.State;

  let SockJS: {
    new(url: string, _reserved?: any, options?: Options): SockJSClass;
    (url: string, _reserved?: any, options?: Options): SockJSClass;
    prototype: SockJSClass;
    CONNECTING: State;
    OPEN: State;
    CLOSING: State;
    CLOSED: State;
  };

  export = SockJS;
}


text:
'use strict';

/**
 * @fileoverview Ensures tabindex attribute values are not greater than 0.
 * See base class in axe-audit.js for audit() implementation.
 */

const AxeAudit = require('./axe-audit');

class TabIndex extends AxeAudit {
  /**
   * @return {!AuditMeta}
   */
  static get meta() {
    return {
      category: 'Accessibility',
      name: 'tabindex',
      description: 'No element has a `[tabindex]` value greater than 0.',
      failureDescription: 'Some elements have a `[tabindex]` value greater than 0.',
      helpText: 'A value greater than 0 implies an explicit navigation ordering. ' +
          'Although technically valid, this often creates frustrating experiences ' +
          'for users who rely on assistive technologies. [Learn more](https://dequeuniversity.com/rules/axe/2.2/tabindex?application=lighthouse).',
      requiredArtifacts: ['Accessibility'],
    };
  }
}

module.exports = TabIndex;


text:
var newlines = /\n+$/;

module.exports = {
  write: function(str) {
    var args = Array.prototype.slice.call(arguments),
        len = args.length,
        last = args[args.length-1];
    if (typeof console === 'undefined' || !console.log) return;
    if(last && typeof last === 'string') {
      args[args.length -1] = last.replace(newlines, '');
    }
    if (console.log.apply) {
      // console.log.apply is undefined in IE8 and IE9
      // and still useless for objects in IE9. But useful for non-IE browsers.
      return console.log.apply(console, args);
    }
    if(!JSON || !JSON.stringify) return;
    // for IE8/9: make console.log at least a bit less awful
    for(var i = 0; i < len; i++) {
      args[i] = JSON.stringify(args[i]);
    }
    console.log(args.join(' '));
  },
  end: function() {}
};


text:
package org.diorite.impl.inventory;

import org.apache.commons.lang3.Validate;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import org.diorite.impl.inventory.item.ItemStackImplArray;
import org.diorite.entity.Player;
import org.diorite.inventory.PlayerInventory;
import org.diorite.inventory.PlayerInventoryPart;
import org.diorite.inventory.slot.Slot;

public abstract class PlayerInventoryPartImpl extends InventoryImpl<Player> implements PlayerInventoryPart
{
    protected final PlayerInventoryImpl playerInventory;
    protected final ItemStackImplArray  content;

    protected PlayerInventoryPartImpl(final PlayerInventoryImpl playerInventory, final ItemStackImplArray content)
    {
        super(playerInventory.getHolder());
        this.content = content;
        Validate.notNull(playerInventory, "Base player inventory can't be null!");
        this.playerInventory = playerInventory;
    }

    @Override
    public Player getHolder()
    {
        return this.playerInventory.getHolder();
    }

    @Override
    public String toString()
    {
        return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).appendSuper(super.toString()).append("playerInventory", this.playerInventory).toString();
    }

    @Override
    public PlayerInventory getPlayerInventory()
    {
        return this.playerInventory;
    }

    @Override
    public Slot getSlot(final int slot)
    {
        return this.playerInventory.getSlot(this.getSlotOffset() + slot);
    }

    @Override
    public ItemStackImplArray getArray()
    {
        return this.content;
    }

    @Override
    public void update(final Player player) throws IllegalArgumentException
    {
        this.playerInventory.update(player);
    }

    @Override
    public void update()
    {
        this.playerInventory.update();
    }

    @Override
    public int getSlotOffset()
    {
        return this.content.offset();
    }

    @Override
    public void softUpdate()
    {
        throw new UnsupportedOperationException("soft update should be called only for root EQ.");
    }
}


text:
package org.apache.tinkerpop.gremlin.groovy;

import org.apache.tinkerpop.gremlin.AbstractGremlinSuite;
import org.apache.tinkerpop.gremlin.AbstractGremlinTest;
import org.apache.tinkerpop.gremlin.GraphManager;
import org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutorPerformanceTest;
import org.apache.tinkerpop.gremlin.groovy.loaders.SugarLoader;
import org.apache.tinkerpop.gremlin.groovy.loaders.SugarLoaderPerformanceTest;
import org.apache.tinkerpop.gremlin.groovy.util.SugarTestHelper;
import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
import org.apache.tinkerpop.gremlin.structure.Graph;
import org.apache.tinkerpop.gremlin.structure.StructureStandardSuite;
import org.junit.runners.model.InitializationError;
import org.junit.runners.model.RunnerBuilder;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * The {@code GroovyEnvironmentPerformanceSuite} is a JUnit test runner that executes the Gremlin Test Suite over a
 * {@link Graph} implementation.  This test suite covers ensures that a vendor implementation is compliant with
 * the Groovy "environment" which will typically ensure that the {@link Graph} will work as expected in the Gremlin
 * Console, Gremlin Server, and other Groovy environments.
 *

 * Note that this suite contains "long-run" tests.  At this time, this suite can be considered optional to vendors
 * as the functionality that it provides is generally covered elsewhere.
 *

 * For more information on the usage of this suite, please see {@link StructureStandardSuite}.
 *
 * @author Stephen Mallette (http://stephen.genoprime.com)
 */
public class GroovyEnvironmentPerformanceSuite extends AbstractGremlinSuite {

    /**
     * This list of tests in the suite that will be executed.  Gremlin developers should add to this list
     * as needed to enforce tests upon implementations.
     */
    private static final Class<?>[] allTests = new Class<?>[]{
            GremlinExecutorPerformanceTest.class,
            SugarLoaderPerformanceTest.class
    };

    public GroovyEnvironmentPerformanceSuite(final Class<?> klass, final RunnerBuilder builder) throws InitializationError {
        super(klass, builder, allTests, null, false, TraversalEngine.Type.STANDARD);
    }

    @Override
    public boolean beforeTestExecution(final Class<? extends AbstractGremlinTest> testClass) {
        unloadSugar();
        SugarLoader.load();
        return true;
    }

    @Override
    public void afterTestExecution(final Class<? extends AbstractGremlinTest> testClass) {
        unloadSugar();
    }

    private void unloadSugar() {
        try {
            SugarTestHelper.clearRegistry(GraphManager.getGraphProvider());
        } catch (Exception ex) {
            throw new RuntimeException(ex);
        }
    }
}


text:
PEGASUS_NAMESPACE_BEGIN

// Clone the string to a plain old C-String and null out
// trailing slash (if any).

static CString _clonePath(const String& path)
{
    String clone = path;

    if (clone.size() && clone[clone.size()-1] == '/')
        clone.remove(clone.size()-1);

    return clone.getCString();
}

Dir::Dir(const String& path)
    : _path(path)
{
    _dirRep.dir = opendir(_clonePath(_path));

    if (_dirRep.dir)
    {
#if defined(PEGASUS_OS_ZOS) || defined(PEGASUS_OS_VMS)
        // ATTN: DO NOT REMOVE THE errno = 0 assignment.
        // Reason: On some platforms readdir_r is a wrapper around
        // readdir. Without errno set to 0, readdir reports a bad return
        // code even in the case that just the end of directory was reached.
        errno = 0;
#endif
        // Need to use readdir_r since we are multithreaded
        if (readdir_r(_dirRep.dir, &_dirRep.buffer, &_dirRep.entry) != 0)
        {
            _more = false;
            closedir(_dirRep.dir);
            throw CannotOpenDirectory(_path);
        }
        _more = _dirRep.entry != NULL;
    }
    else
    {
        _more = false;
        throw CannotOpenDirectory(_path);
    }
}

Dir::~Dir()
{
    if (_dirRep.dir)
        closedir(_dirRep.dir);

}

const char* Dir::getName() const
{
    return _more ? _dirRep.entry->d_name : "";
}

void Dir::next()
{
    if (_more)
    {
#if defined(PEGASUS_OS_ZOS) || defined(PEGASUS_OS_VMS)
        // ATTN: DO NOT REMOVE THE errno = 0 assignment.
        // Reason: On some platforms readdir_r is a wrapper around
        // readdir. Without errno set to 0, readdir reports a bad return
        // code even in the case that just the end of directory was reached.
        errno = 0;
#endif
        // Need to use readdir_r since we are multithreaded
        if (readdir_r(_dirRep.dir, &_dirRep.buffer, &_dirRep.entry) != 0)
        {
            _more = false;
            throw CannotOpenDirectory(_path);
        }
        _more = _dirRep.entry != NULL;
    }
}

PEGASUS_NAMESPACE_END


text:
<?php

/**
 * @package     Doctrine
 * @subpackage  DataDict
 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
 * @author      Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
 * @version     $Revision$
 * @link        www.phpdoctrine.org
 * @since       1.0
 */
class Doctrine_DataDict_Informix extends Doctrine_DataDict
{
    /**
     * Obtain DBMS specific SQL code portion needed to declare an text type
     * field to be used in statements like CREATE TABLE.
     *
     * @param array $field  associative array with the name of the properties
     *      of the field being declared as array indexes. Currently, the types
     *      of supported field properties are as follows:
     *
     *      length
     *          Integer value that determines the maximum length of the text
     *          field. If this argument is missing the field should be
     *          declared to have the longest length allowed by the DBMS.
     *
     *      default
     *          Text value to be used as default for this field.
     *
     *      notnull
     *          Boolean flag that indicates whether this field is constrained
     *          to not be set to null.
     *
     * @throws RuntimeException
     * @throws Doctrine_DataDict_Exception
     * @return string  DBMS specific SQL code portion that should be used to
     *      declare the specified field.
     */
  public function getNativeDeclaration($field)
  {
    if ( ! isset($field['type'])) {
      throw new Doctrine_DataDict_Exception('Missing column type.');
    }

    switch ($field['type']) {
      case 'char':
      case 'enum':
        $field['length'] = isset($field['length']) && $field['length'] ? $field['length']:255;
      case 'varchar':
      case 'array':
      case 'object':
      case 'string':
        if (empty($field['length']) && array_key_exists('default', $field)) {
          $field['length'] = $this->conn->varchar_max_length;
        }

        $length = ( ! empty($field['length'])) ? $field['length'] : false;
        $fixed  = ((isset($field['fixed']) && $field['fixed']) || $field['type'] == 'char') ? true : false;

        $result = false;
        if($fixed)  {
          $result =  $length ? 'CHAR('.$length.')' : 'CHAR(255)';
        }
        else{
          if($length){
            $result =  ($length <= 255) ? 'VARCHAR('.$length.')' : 'LVARCHAR('.$length.')';
          }else{
            $result = 'TEXT';
          }
        }
        if($result)  {
          return $result;
        }
        throw new RuntimeException('check typedefintion in your model');
      case 'clob':
        return 'TEXT';
      case 'blob':
        return 'BLOB';
      case 'integer':
      case 'int':
        if ( ! empty($field['autoincrement'])) {
          if ( ! empty($field['length'])) {
            $length = $field['length'];
            if ($length > 4) {
              return 'BIGSERIAL';
            }
          }
          return 'SERIAL';
        }
        if ( ! empty($field['length'])) {
          $length = $field['length'];
          if ($length <= 1) {
            return 'SMALLINT';
          } elseif ($length == 2) {
            return 'SMALLINT';
          } elseif ($length == 3 || $length == 4) {
            return 'INTEGER';
          } elseif ($length > 4) {
            return 'BIGINT';
          }
        }
        return 'INT';
      case 'boolean':
        return 'BOOLEAN';
      case 'date':
        return 'DATE';
      case 'time':
        return  'DATETIME HOUR TO SECOND';
      case 'timestamp':
        return 'DATETIME YEAR TO SECOND';
      case 'float':
        return 'FLOAT';
      case 'decimal':
        return 'DECIMAL';
    }
    throw new Doctrine_DataDict_Exception('Unknown field type \'' . $field['type'] .  '\'.');
  }

  /**
   * TODO check if this can replace the connection implementation of defaultvalue
   * parseBoolean
   * parses a literal boolean value and returns
   * proper sql equivalent
   *
   * @param string $value     boolean value to be parsed
   * @return string           parsed boolean value
   */
  //    public function parseBoolean($value)
  //    {
  //        return $value;
  //    }
  }


text:
ww2ogg
======

Audiokinetic Wwise RIFF/RIFX Vorbis to Ogg Vorbis converter by hcs

Usage
----
Standard usage is just

`ww2ogg input.bin`

which will convert input.bin to input.ogg.

You can also specify an output file with `-o`, as in

`ww2ogg input.ogg -o output.ogg`

Troubleshooting
--------------------------------------------------------------------------------

* If the conversion seemed to go well but you get a nonsense output file
  * first try setting the alternate packed codebooks:

    `ww2ogg input.ogg --pcb packed_codebooks_aoTuV_603.bin`

  * then try also setting `--no-mod-packets`:

    `ww2ogg input.ogg --no-mod-packets --pcb packed_codebooks_aoTuV_603.bin`

  * You can try other combinations of `--pcb`, `--no-mod-packets`,
    and `--mod-packets`, but these are the common ones that work.

* `Parse error: expected 0x42 fmt if vorb missing` suggests that the input is
   not Vorbis data at all, and so it is not supported by this program.

* `Error opening packed_codebooks.bin` means the ww2ogg couldn't find the
   packed_codebooks.bin file that comes with the program. Either run ww2ogg
   in the same working directory as packed_codebooks.bin, or give the path with
   the `--pcb` switch

   `other_dir/ww2ogg input.ogg --pcb other_dir/packed_codebooks.bin`

* `Parse error: invalid codebook id 0x342, try --full-setup`

   follow the suggestion and use `--full-setup`

Note:

It is a good idea to run the output through revorb to get smaller,
cleaner files than ww2ogg generates currently.

https://hydrogenaud.io/index.php/topic,64328.0.html

https://cloudflare-ipfs.com/ipfs/QmVgjfU7qgPEtANatrfh7VQJby9t1ojrTbN7X8Ei4djF4e/revorb.exe


text:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.eas.designer.application;

import org.openide.modules.ModuleInstall;

public class Installer extends ModuleInstall {

    private static final String ALERT_LOG_MIN_LEVEL = "950"; //NOI18N
    private static final String ALERT_LOG_MIN_LEVEL_PROPERTY_NAME = "netbeans.exception.alert.min.level"; //NOI18N
    private static final String REPORT_LOG_MIN_LEVEL_PROPERTY_NAME = "netbeans.exception.report.min.level"; //NOI18N

    @Override
    public void restored() {
        //Disable Netbeans alert dialog for WARNING level exceptions but enable it for SEVERE level
        System.setProperty(ALERT_LOG_MIN_LEVEL_PROPERTY_NAME, ALERT_LOG_MIN_LEVEL);
        System.setProperty(REPORT_LOG_MIN_LEVEL_PROPERTY_NAME, ALERT_LOG_MIN_LEVEL);
    }
}


text:
<!DOCTYPE html>

  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />

  <title>Sample Angular App with Auth0</title>

      click to login
      Signup
      Reset password

      main
      logout

{{message}}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Mn.NewsCms.Common.Models;
using Mn.NewsCms.Common;
using Mn.NewsCms.Common.Helper;
using Mn.NewsCms.DomainClasses.UpdaterBusiness;
using System.Data.SqlClient;
using System.Configuration;
using System.Data;
using Mn.NewsCms.Common.BaseClass;
using Mn.NewsCms.Common.Config;
using Mn.NewsCms.Common.EventsLog;

namespace Mn.NewsCms.DomainClasses
{
    public class FeedItemBusiness : BaseBusiness<FeedItem, Guid>, IFeedItemBusiness
    {
        const int MinCacheTime = 3;
        const int DefaultCacheTime = 20;
        ITagBusiness TagBiz;
        ICategoryBusiness CatBiz;
        private readonly IAppConfigBiz _appConfigBiz;
        private readonly IRepositorySaver _repositorySaver;
        List<FeedItem> res;
        public FeedItemBusiness(IUnitOfWork unitOfWork, ITagBusiness tagBusiness, ICategoryBusiness categoryBusiness,
            IAppConfigBiz appConfigBiz, IRepositorySaver repositorySaver) : base(unitOfWork)
        {
            TagBiz = tagBusiness;
            CatBiz = categoryBusiness;
            _appConfigBiz = appConfigBiz;
            _repositorySaver = repositorySaver;
        }
        public FeedItem Get(string feedItemId)
        {
            long itemId;
            if (long.TryParse(feedItemId, out itemId))
                return GetList().SingleOrDefault(i => i.ItemId == itemId);
            else
            {
                Guid id;
                if (Guid.TryParse(feedItemId, out id))
                    return Get(id);
            }
            return null;
        }
        public FeedItem Get(long itemId)
        {
            return GetList().SingleOrDefault(i => i.ItemId == itemId);
        }
        public FeedItem Get(Guid feedItemId)
        {
            var item = base.GetList().SingleOrDefault(i => i.Id == feedItemId);
            if (item == null)
            {
                IRepositorySearcher _LuceneRepository = new LuceneSearcherRepository();
                item = _LuceneRepository.GetItem(feedItemId.ToString(), null, true);
            }
            return item;
        }
        public IQueryable<FeedItem> GetList()
        {
            return base.GetList();
        }
        public OperationStatus Update(FeedItem item)
        {
            return base.Update(item);
        }

        public List<FeedItem> DescriptClear(List<FeedItem> Items, string Key)
        {
            if (Items == null)
                return Items;
            foreach (var item in Items)
            {
                item.Description = HtmlRemoval.StripTagsCharArray(item.Description);
                item.Description = item.Description.SubstringX(0, _appConfigBiz.MaxDescriptionLength());
            }
            return Items;
        }

        public void IncreaseVisitCount(List<FeedItem> Items)
        {
            try
            {
                foreach (var item in Items.ToList())
                {
                    item.VisitsCount = item.VisitsCount + 1;
                    base.Update(item);
                }
            }
            catch
            {
            }
        }
        public List<FeedItem> FeedItemsBySite(long siteId, int PageSize, int PageIndex, int CacheTime = MinCacheTime)
        {
            return FeedItemsBySite(siteId, PageSize, PageIndex, null, CacheTime);
        }
        public List<FeedItem> FeedItemsBySite(long siteId, int PageSize, int PageIndex, bool? hasPhoto, int CacheTime = MinCacheTime)
        {
            var cacheName = hasPhoto.HasValue ? "ItemsSite" + siteId + hasPhoto + PageIndex + PageSize : "ItemsSite" + siteId + PageIndex + PageSize;
            var inCache = System.Web.HttpRuntime.Cache.Get(cacheName);
            if (inCache != null)
                return inCache as List<FeedItem>;

            List<FeedItem> res;
            if (hasPhoto.HasValue)
                res = base.GetList().Where(item => item.SiteId == siteId && item.HasPhoto == hasPhoto.Value)
                       .OrderByDescending(item => item.PubDate).Skip(PageIndex * PageSize).Take(PageSize).ToList();
            else
                res = base.GetList().Where(item => item.SiteId == siteId)
                       .OrderByDescending(item => item.PubDate).Skip(PageIndex * PageSize).Take(PageSize).ToList();

            System.Web.HttpRuntime.Cache.AddToCache(cacheName, res, CacheTime);
            return res;

        }
        public List<FeedItem> FeedItemsBySite(string SiteUrl, int PageSize, int PageIndex, int CacheTime = MinCacheTime)
        {
            var cacheName = "ItemsSite" + SiteUrl + PageIndex + PageSize;
            var inCache = System.Web.HttpRuntime.Cache.Get(cacheName);
            if (inCache != null)
                return inCache as List<FeedItem>;

            res = base.GetList().Where(item => item.SiteUrl == SiteUrl.ToLower())
                 .OrderByDescending(item => item.PubDate).Skip(PageIndex * PageSize).Take(PageSize).ToList();

            System.Web.HttpRuntime.Cache.AddToCache(cacheName, res, CacheTime);

            return res;

        }
        public List<FeedItem> FeedItemsByCat(long catId, int PageSize, int PageIndex, int CacheTime = MinCacheTime)
        {
            return FeedItemsByCat(catId, PageSize, PageIndex, null, CacheTime);
        }
        public List<FeedItem> FeedItemsByCat(string code, int PageSize, int PageIndex, bool? hasPhoto, int CacheTime = MinCacheTime)
        {
            var cat = CatBiz.Get(code);
            return FeedItemsByCat(cat.Id, PageSize, PageIndex, hasPhoto.HasValue ? hasPhoto : false, CacheTime);
        }
        public List<FeedItem> FeedItemsByCat(long catId, int PageSize, int PageIndex, bool? hasPhoto, int CacheTime = MinCacheTime)
        {
            var cacheName = hasPhoto.HasValue ? "ItemsCat" + catId + hasPhoto + PageSize + PageIndex : "ItemsCat" + catId + PageSize + PageIndex;
            var inCache = System.Web.HttpRuntime.Cache.Get(cacheName);
            if (inCache != null)
                return inCache as List<FeedItem>;

            List<FeedItem> res;
            if (hasPhoto.HasValue)
                res = base.GetList().Where(item => item.HasPhoto == hasPhoto && item.Feed.Categories.Any(c => c.Id == catId || c.ParentId == catId))
                      .OrderByDescending(item => item.PubDate).Skip(PageIndex * PageSize).Take(PageSize).ToList();
            else
                res = base.GetList().Where(item => item.Feed.Categories.Any(c => c.Id == catId || c.ParentId == catId))
                  .OrderByDescending(item => item.PubDate).Skip(PageIndex * PageSize).Take(PageSize).ToList();

            System.Web.HttpRuntime.Cache.AddToCache(cacheName, res, CacheTime);
            return res;
        }
        public List<FeedItem> FeedItemsByCat(ref string content, int PageSize, int PageIndex, int CacheTime = MinCacheTime)
        {
            var cat = CatBiz.Get(content);
            content = cat.Title;
            return FeedItemsByCat(cat.Id, PageSize, PageIndex, null);
        }
        public List<FeedItem> FeedItemsByTag(string Content, int PageSize, int PageIndex, ref string TagTitle, int CacheTime = MinCacheTime)
        {
            var TagCurrent = new Tag();
            TagCurrent = TagBiz.Get(Content.Trim());
            if (TagCurrent == null)
                if (TagBiz.GetList(Content).Any())
                    TagCurrent = TagBiz.GetList(Content).First();

            if (TagCurrent != null)
            {
                Content = TagCurrent.Value;
                TagTitle = TagCurrent.Title;
            }
            return ItemsByKey(Content, PageSize, PageIndex);
        }
        public List<FeedItem> FeedItemsByTag(Tag TagCurrent, int PageSize, int PageIndex, int CacheTime = MinCacheTime)
        {
            var Content = TagCurrent.Value;
            Content = TagCurrent.Value;
            return ItemsByKey(Content, PageSize, PageIndex);
        }
        public List<FeedItem> FeedItemsByTag(Tag TagCurrent, int PageSize, int PageIndex, bool HasPhoto, int CacheTime = MinCacheTime)
        {
            var Content = TagCurrent.Value;
            Content = TagCurrent.Value;
            return ItemsByKey(Content, PageSize, PageIndex, HasPhoto);
        }
        public List<FeedItem> FeedItemsByKey(string Content, int PageSize, int PageIndex, int CacheTime = MinCacheTime)
        {
            return ItemsByKey(Content, PageSize, PageIndex);
        }
        public List<FeedItem> FeedItemsByTime(DateTime dateTime, int PageSize, int PageIndex)
        {
            return base.GetList().Where(item => item.PubDate >= dateTime)
                  .OrderByDescending(item => item.PubDate).Skip(PageIndex * PageSize).Take(PageSize).ToList();
        }
        public List<FeedItem> FeedItemsByFeed(long feedId, int PageSize, int PageIndex)
        {
            return base.GetList().Where(item => item.FeedId == feedId)
             .OrderByDescending(item => item.PubDate).Skip(PageIndex * PageSize).Take(PageSize).ToList();
        }

        public void DeleteOldItems(DateTime startDate, DateTime endDate)
        {
            throw new NotImplementedException();
        }

        private List<FeedItem> ItemsByKey(string Content, int PageSize, int PageIndex, int CacheTime = MinCacheTime)
        {
            return ItemsByKey(Content, PageSize, PageIndex, false, CacheTime);
        }
        private List<FeedItem> ItemsByKey(string Content, int PageSize, int PageIndex, bool HasPhoto, int CacheTime = MinCacheTime)
        {
            var cacheName = "Items" + Content + PageSize + PageIndex + HasPhoto;
            var inCache = System.Web.HttpRuntime.Cache.Get(cacheName);
            if (inCache != null)
                return inCache as List<FeedItem>;

            IRepositorySearcher _LuceneRepository = new LuceneSearcherRepository();
            var items = _LuceneRepository.Search(Content, PageSize, PageIndex, Mn.NewsCms.Common.LuceneBase.LuceneSearcherType.Key, Mn.NewsCms.Common.LuceneBase.LuceneSortField.PubDate, HasPhoto);
            res = GetList().Where(item => items.Contains(item.Id)).ToList();

            System.Web.HttpRuntime.Cache.AddToCache(cacheName, res, CacheTime);
            return res;
        }

        #region MostVisited

        public IEnumerable<FeedItem> LastItemVisited(int counter = 20, int index = 0)
        {
            var dudate = DateTime.Now.AddHours(-1);
            var res = base.GetList().Where(i => i.CreateDate > dudate).OrderByDescending(i => i.PubDate).Skip(index).Take(counter).ToList();
            if (res == null || !res.Any())
            {
                res = base.GetList().OrderByDescending(i => i.PubDate).Skip(index).Take(counter).ToList();
            }
            return res;
        }
        public IEnumerable<FeedItem> MostVisitedItems(string EntityCode, int EntityRef, int PageSize, int CacheTime = MinCacheTime)
        {
            List<FeedItem> res;
            var inCache = System.Web.HttpRuntime.Cache.Get("ItemsTop" + EntityCode);
            if (inCache != null)
            {
                res = inCache as List<FeedItem>;
                if (res.Count >= PageSize)
                    return res.Take(PageSize);
            }

            if (EntityCode.EqualsX("Any") || EntityCode.EqualsX("Key") || EntityRef == 0)
                res = base.GetList().OrderByDescending(x => x.VisitsCount)
                        .Take(PageSize).ToList();
            else if (EntityCode.EqualsX("today"))
            {
                var date = DateTime.Now.AddDays(-1);
                res = base.GetList().Where(i => i.PubDate > date).
                          OrderByDescending(x => x.VisitsCount).
                          Take(PageSize).ToList();
            }
            else //if (EntityCode.EqualsX("todayall"))
            {
                var date = DateTime.Now.AddDays(-1);
                res = base.GetList().Where(i => i.PubDate > date).
                          OrderByDescending(x => x.VisitsCount).
                          Take(PageSize).ToList();
            }

            System.Web.HttpRuntime.Cache.AddToCache("ItemsTop" + EntityCode, res, CacheTime);
            return res;
        }
        #endregion
        #region DeleteOldItems
        #endregion
        public int AddItems(List<FeedItem> items)
        {
            var res = AddItemsToDataBase(items).Split(new char[] { ':' });
            if (res.Any())
            {
                items = items.Where(t => res.Contains(t.Id.ToString())).ToList();
                if (items.Any())
                    _repositorySaver.AddItems(items);
            }
            return res.Count();
        }

        private string AddItemsToDataBase(List<FeedItem> Items)
        {
            var res = string.Empty;
            try
            {
                using (var con = new SqlConnection(ConfigurationManager.ConnectionStrings["TazehaContext"].ConnectionString))
                {
                    con.Open();
                    using (var cmd = new SqlCommand("exec sp_FeedItemsCreate @list", con))
                    {
                        var table = new DataTable();
                        table.Columns.Add("FeedItemId", typeof(string));
                        table.Columns.Add("Title", typeof(string));
                        table.Columns.Add("Link", typeof(string));
                        table.Columns.Add("HasPhoto", typeof(bool));
                        table.Columns.Add("Description", typeof(string));
                        table.Columns.Add("PubDate", typeof(DateTime));
                        table.Columns.Add("FeedId", typeof(int));
                        table.Columns.Add("SiteId", typeof(long));
                        table.Columns.Add("SiteUrl", typeof(string));
                        table.Columns.Add("SiteTitle", typeof(string));
                        table.Columns.Add("VisitsCount", typeof(int));
                        table.Columns.Add("ShowContentType", typeof(byte));
                        foreach (var item in Items)
                            table.Rows.Add(item.Id,
                                item.Title.SubstringM(0, 256).ApplyUnifiedYeKe(),
                                HttpUtility.UrlDecode(item.Link.SubstringM(0, 256)).ApplyUnifiedYeKe(),
                                item.HasPhoto,
                                item.Description.SubstringM(0, 512),
                                item.PubDate,
                                item.FeedId,
                                item.SiteId,
                                item.SiteUrl.SubstringM(0, 64),
                                item.SiteTitle.SubstringM(0, 64).ApplyUnifiedYeKe(),
                                item.VisitsCount,
                                item.ShowContentType);

                        var pList = new SqlParameter("@list", SqlDbType.Structured);
                        pList.TypeName = "dbo.FeedItemDictionary1";
                        pList.Value = table;
                        cmd.Parameters.Add(pList);
                        res = cmd.ExecuteScalar().ToString();
                        if (!string.IsNullOrEmpty(res))
                            res = res.Remove(0, 1);
                    }
                    con.Close();
                }
            }
            catch (Exception ex)
            {
                GeneralLogs.WriteLogInDB(ex, typeof(FeedItemBusiness));
            }
            return res;
        }

        public void IncreaseVisitCount(Guid feedItemId)
        {
            SqlCommandExecute($"update feeditems set visitscount=visitscount+1 where feeditemid='{feedItemId}'");
        }
    }
}


text:
//
//  AWFCascadingStyle.h
//  AerisUI
//
//  Created by Nicholas Shipes on 9/27/13.
//  Copyright (c) 2013 HAMweather, LLC. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "Globals.h"

@class AWFTextStyleSpec;

/**
 *  An `AWFCascadingStyle` object contains style information that can be applied to `AWFStyledView` instances. This base class already contains default
 *  styles that are used for all styled views and should be subclassed to provide your own custom styles.
 */
@interface AWFCascadingStyle : NSObject

//------------------
// @name Layout
//------------------

/**
 *  Padding to use within a content view.
 */
@property (nonatomic, assign) CGFloat inset;

//------------------
// @name Text Styles
//------------------

/**
 *  The default text style for all text.
 */
@property (nonatomic, strong) AWFTextStyleSpec *defaultTextStyle;

/**
 *  The text style for secondary text, such as date and time.
 */
@property (nonatomic, strong) AWFTextStyleSpec *detailTextStyle;

/**
 *  The primary text style for a header view.
 */
@property (nonatomic, strong) AWFTextStyleSpec *headerTextStyle;

/**
 *  The text style for secondary text within a header view, such as date and time.
 */
@property (nonatomic, strong) AWFTextStyleSpec *headerDetailTextStyle;

//------------------------
// @name Background Colors
//------------------------

/**
 *  The primary background color
 */
@property (nonatomic, strong) UIColor *backgroundColor;

/**
 *  An array of colors to use for the gradient background.
 */
@property (nonatomic, strong) NSArray *backgroundGradientColors;

/**
 *  The primary background color for header views.
 */
@property (nonatomic, strong) UIColor *headerBackgroundColor;

/**
 *  An array of colors to use for the gradient background in header views.
 */
@property (nonatomic, strong) NSArray *headerBackgroundGradientColors;

/**
 *  The primary background color for view controller root views.
 */
@property (nonatomic, strong) UIColor *viewControllerBackgroundColor;

@property (nonatomic, strong) UIColor *tintColor;

/**
 *  The color for keylines within a view.
 */
@property (nonatomic, strong) UIColor *keylineColor;

/**
 *  Creates and returns a `AWFCascadingStyle` instance initialized with the default styles.
 *
 *  @return The initialized style instance
 */
+ (instancetype)style;

//+ (id)styleFromObject:(id)object;
//- (void)applyToObject:(id)object;
//- (void)setValuesFromObject:(id)object;

/**
 *  Returns the current default style instance.
 */
+ (instancetype)defaultStyle;

/**
 *  Sets the default style instance.
 *
 *  @param style The style to use as the default
 */
+ (void)setDefaultStyle:(AWFCascadingStyle *)style;

@end


text:
class CreateUserLocations < ActiveRecord::Migration
  def self.up
    create_table :user_locations do |t|
     t.column :user_id, :integer, :null => true
     t.column :location_id, :integer, :null => true
     t.column :delta, :text
     t.timestamps
    end

    a= User.find :all
    a.each do |usr|
      usr.locations.each do | loc |
        UserLocation.create :user_id => usr.id, :location_id => loc.id
      end
    end
  end

  def self.down
    drop_table :user_locations
  end
end


text:
#ifndef _WX_GTK_PRIVATE_H_
#define _WX_GTK_PRIVATE_H_

#include <gtk/gtk.h>

#include "wx/gtk/private/string.h"

// pango_version_check symbol is quite recent ATM (4/2007)... so we
// use our own wrapper which implements a smart trick.
// Use this function as you'd use pango_version_check:
//
//  if (!wx_pango_version_check(1,18,0))
//     ... call to a function available only in pango >= 1.18 ...
//
// and use it only to test for pango versions >= 1.16.0
extern const gchar *wx_pango_version_check(int major, int minor, int micro);

#if wxUSE_UNICODE
    #define wxGTK_CONV(s) s.utf8_str()
    #define wxGTK_CONV_ENC(s, enc) wxGTK_CONV((s))
    #define wxGTK_CONV_FONT(s, font) wxGTK_CONV((s))
    #define wxGTK_CONV_SYS(s) wxGTK_CONV((s))

    #define wxGTK_CONV_BACK(s) wxString::FromUTF8Unchecked(s)
    #define wxGTK_CONV_BACK_ENC(s, enc) wxGTK_CONV_BACK(s)
    #define wxGTK_CONV_BACK_FONT(s, font) wxGTK_CONV_BACK(s)
    #define wxGTK_CONV_BACK_SYS(s) wxGTK_CONV_BACK(s)
#else
    #include "wx/font.h"

    // convert the text between the given encoding and UTF-8 used by wxGTK
    extern WXDLLIMPEXP_CORE wxCharBuffer
    wxConvertToGTK(const wxString& s,
                   wxFontEncoding enc = wxFONTENCODING_SYSTEM);

    extern WXDLLIMPEXP_CORE wxCharBuffer
    wxConvertFromGTK(const wxString& s,
                     wxFontEncoding enc = wxFONTENCODING_SYSTEM);

    // helper: use the encoding of the given font if it's valid
    inline wxCharBuffer wxConvertToGTK(const wxString& s, const wxFont& font)
    {
        return wxConvertToGTK(s, font.Ok() ? font.GetEncoding()
                                           : wxFONTENCODING_SYSTEM);
    }

    inline wxCharBuffer wxConvertFromGTK(const wxString& s, const wxFont& font)
    {
        return wxConvertFromGTK(s, font.Ok() ? font.GetEncoding()
                                             : wxFONTENCODING_SYSTEM);
    }

    // more helpers: allow passing GTK+ strings directly
    inline wxCharBuffer
    wxConvertFromGTK(const wxGtkString& gs,
                     wxFontEncoding enc = wxFONTENCODING_SYSTEM)
    {
        return wxConvertFromGTK(gs.c_str(), enc);
    }

    inline wxCharBuffer
    wxConvertFromGTK(const wxGtkString& gs, const wxFont& font)
    {
        return wxConvertFromGTK(gs.c_str(), font);
    }

    #define wxGTK_CONV(s) wxGTK_CONV_FONT((s), m_font)
    #define wxGTK_CONV_ENC(s, enc) wxConvertToGTK((s), (enc))
    #define wxGTK_CONV_FONT(s, font) wxConvertToGTK((s), (font))
    #define wxGTK_CONV_SYS(s) wxConvertToGTK((s))

    #define wxGTK_CONV_BACK(s) wxConvertFromGTK((s), m_font)
    #define wxGTK_CONV_BACK_ENC(s, enc) wxConvertFromGTK((s), (enc))
    #define wxGTK_CONV_BACK_FONT(s, font) wxConvertFromGTK((s), (font))
    #define wxGTK_CONV_BACK_SYS(s) wxConvertFromGTK((s))
#endif

// ----------------------------------------------------------------------------
// various private helper functions
// ----------------------------------------------------------------------------

namespace wxGTKPrivate
{

// these functions create the GTK widgets of the specified types which can then
// used to retrieve their styles, pass them to drawing functions &c
//
// the returned widgets shouldn't be destroyed, this is done automatically on
// shutdown
GtkWidget *GetButtonWidget();
GtkWidget *GetCheckButtonWidget();
GtkWidget *GetComboBoxWidget();
GtkWidget *GetEntryWidget();
GtkWidget *GetHeaderButtonWidgetFirst();
GtkWidget *GetHeaderButtonWidgetLast();
GtkWidget *GetHeaderButtonWidget();
GtkWidget *GetRadioButtonWidget();
GtkWidget *GetSplitterWidget();
GtkWidget *GetTextEntryWidget();
GtkWidget *GetTreeWidget();

} // wxGTKPrivate

#endif // _WX_GTK_PRIVATE_H_


text:
#import <Foundation/Foundation.h>

#import "MXJSONModel.h"

@class MXEventAnnotationChunk;
@class MXEventReplace;
@class MXEventReferenceChunk;
@class MXEventRelationThread;

NS_ASSUME_NONNULL_BEGIN

/**
 JSON model for MXEvent.unsignedData.relations.
 */
@interface MXEventRelations : MXJSONModel

@property (nonatomic, readonly, nullable) MXEventAnnotationChunk *annotation;
@property (nonatomic, readonly, nullable) MXEventReferenceChunk *reference;
@property (nonatomic, readonly, nullable) MXEventReplace *replace;
@property (nonatomic, readonly, nullable) MXEventRelationThread *thread;

@end

NS_ASSUME_NONNULL_END


text:
"use strict";

var express  = require("express"),
    socketio = require("socket.io"),
    body_p   = require("body-parser"),
    cookie_p = require("cookie-parser"),
    sock_c   = require("socket.io-cookie"),
    http     = require("http"),
    path     = require("path");

var config = require("./config");
var router = require("./router");
var serve = require("./serve");
var encrypt = require("./encryption");
var utils = require("./utils");

var app = express();
var server = http.Server(app);

global.bot = require("./bot");
global.rooms = require("./rooms");
global.io = socketio(server);

app.set("trust proxy", "loopback");
app.set("view engine", "pug");
app.set("views", path.join(__dirname, "static"));

app.use(body_p.urlencoded({ extended: true }));
app.use(body_p.json());
app.use(cookie_p());

router(express, app);

app.use(express.static(app.get("views")));
app.use(serve);

global.io.use(sock_c);

global.io.on("connection", (socket) => {
	var cookie = socket.handshake.headers.cookie;
	var pathname = socket.handshake.headers.referer.replace(config.domain, "");
	var authed = encrypt.authenticate(cookie);

	if (authed){
		socket.user = require("./user")({
			name: encrypt.decrypt(cookie.user),
			id: encrypt.decrypt(cookie.user_id),
			access: encrypt.decrypt(cookie.access),
			refresh: encrypt.decrypt(cookie.refresh),
			socket: socket.id
		});
	} else {
		socket.emit("cookie", {
			name: "next",
			value: pathname
		});

		var emit = "";

		if (socket.request.headers["user-agent"].indexOf("Electron") > -1){
			emit = "electron-auth";
		} else {
			emit = "redirect";
		}

		socket.emit(emit, utils.authURL(socket.request.headers["user-agent"]), pathname);

		return;
	}

	if (!pathname.startsWith("/connect/") && !pathname.startsWith("/rooms")){
		socket.emit("redirect", "/connect/rooms?message=Either shows.js restarted, or you were in the wrong place. Sorry about that.");
	}

	socket.on("disconnect", () => {
		if (socket.room){
			global.rooms.remUser(socket.user, socket);
		}
	});

	socket.on("service", (service) => {
		if (socket.room){
			if (global.rooms.hasRoom(socket.room)){
				global.rooms.remUser(socket.user);
			}

			socket.room = undefined;
		}

		if (service.startsWith("/rooms")){
			socket.emit("finished", {
				valid: true
			});
		} else if (service.startsWith("/room/")){
			var name = service.replace("/room/", "");

			if (config.exempt_room_names.indexOf(name) > -1){
				socket.emit("finished", {
					valid: false,
					message: "Invalid room name."
				});
			} else if (!/^[a-z]+$/i.test(name)){
				socket.emit("finished", {
					valid: false,
					message: "Room names must only have letters."
				});
			} else if (name.length < 2){
				socket.emit("finished", {
					valid: false,
					message: "Room names must have 2 or more characters."
				});
			} else {
				var message = undefined;

				if (global.rooms.hasRoom(name)){
					if (Object.keys(global.rooms.getRoom(name).getUsers()).indexOf(socket.user.id) == -1){
						global.rooms.addUser(name, socket.user);
					} else {
						socket.emit("finished", {
							valid: false,
							message: "You are already in this room."
						});
					}
				} else {
					var room = require("./room")(name);

					room.addUser(socket.user);
					room.setHost(socket.user);

					global.rooms.addRoom(room);

					if (global.bot.getUserByID(socket.user.getID()).status == "offline"){
						message = "You're not logged into Discord! If you're not logged in, you won't be able to use commands. This includes playing a video (host only)."
					}
				}

				socket.emit("finished", {
					valid: true,
					message: message
				});
			}
		} else {
			socket.emit("redirect", "/");
		}
	});

	socket.on("get_rooms", () => {
		var data = { };
		var list = global.rooms.getRooms();

		for (var room in list){
			var room = list[room];

			data[room.getName()] = {
				name: room.getName(),
				host: room.getHost().getName(),
				pass: room.hasPassword()
			};
		}

		socket.emit("get_rooms", data);
	});

	socket.on("error", (error) => {
		console.log(error.stack);
	});
});

server.listen(config.port, () => {
	console.log("Server started on port " + config.port + ".");
});