text:
function update_numbers() {
  total_servers = 0,
  total_servers_eps = 0,
  total_network_devices = 0,
  total_network_devices_eps = 0,
  total_devices = 0,
  total_devices_eps = 0,
  grand_total_devices = 0,
  grand_total_devices_eps = 0,
  total_users = 0,
  total_users_eps = 0,
  non_dom_users = 0,
  total_network_data = 0,
  external_users = 0,
  weight = 0;

  field_values[ 'grand_totals' ] = {};
  for ( var slide in field_values[ 'slides' ] ) {
    var this_slide = field_values[ 'slides' ][ slide ];
    this_slide[ 'total' ] = 0;
    this_slide[ 'commatized_total' ] = '';
    for ( var field in this_slide[ 'fields' ] ) {
      var this_field = this_slide[ 'fields' ][ field ];
      if( field !== 'virtual_or_physical' && field !== 'usage_pattern' && field !== 'usma_usage_pattern' ) {
        var elem = document.getElementById( 'number-' + slide + '-' + field );
        this_field[ 'raw' ] = elem.valueAsNumber;
        this_field[ 'commatized_raw' ] = commatize( this_field[ 'raw' ] );
      } else {
        var elem = document.getElementById( slide + '-' + field );
        this_field[ 'raw' ] = elem.options[ elem.selectedIndex ].text;
        this_field[ 'commatized_raw' ] = this_field[ 'raw' ];
        this_field[ 'math_value' ] = Number( elem.options[ elem.selectedIndex ].value );
      }
      if ( this_slide[ 'sum_raw' ] == 1 && this_field[ 'handle' ] !== 'subscription_ids' && this_field[ 'handle' ] !== 'vmachines' && this_field[ 'handle' ] !== 'data_transferred' && this_field[ 'handle' ] !== 'usma_usage_pattern' ) {
        window[ 'total_' + slide ] += this_field[ 'raw' ];
      }
      if ( typeof this_field[ 'raw' ] !== 'string' && this_field[ 'handle' ] !== 'subscription_ids' && this_field[ 'handle' ] !== 'vmachines' && this_field[ 'handle' ] !== 'data_transferred' && this_field[ 'handle' ] !== 'usma_usage_pattern' ){
        this_slide[ 'total' ] += this_field[ 'raw' ];
        window[ 'total_' + this_slide[ 'handle' ] ] = this_slide[ 'total' ];
      }

      if ( this_field[ 'global' ] == 1 ) {
        window[ this_field[ 'handle' ] ] = this_field[ 'raw' ];
        other_globals[ this_field[ 'handle' ] ] = this_field[ 'raw' ];
      }
    }
    if ( this_slide[ 'add_to_total' ] == 1 ) {
      grand_total_devices += this_slide[ 'total' ];
    }
    this_slide[ 'commatized_total' ] = commatize( this_slide[ 'total' ] );
    field_values[ 'grand_totals' ][ 'devices' ] = grand_total_devices;
    field_values[ 'grand_totals' ][ 'commatized_devices' ] = commatize( grand_total_devices );
  }
  for ( var slide in field_values[ 'slides' ] ) {
    var this_slide = field_values[ 'slides' ][ slide ];
    this_slide[ 'total_eps' ] = 0;
    this_slide[ 'commatized_total_eps' ] = '';
    window[ 'total_' + slide + '_eps' ] = 0;
    for ( var field in this_slide[ 'fields' ] ) {
      var this_field = this_slide[ 'fields' ][ field ];

      if( field_functions[ slide + '-' + field ] ) {
        this_field[ 'calc' ] = field_functions[ slide + '-' + field ]( field_values );
        this_field[ 'commatized_calc' ] = commatize( this_field[ 'calc' ] );
      } else {
        this_field[ 'calc' ] = this_field[ 'raw' ];
        this_field[ 'commatized_calc' ] = commatize( this_field[ 'calc' ] );
      }
      if ( ( this_slide[ 'handle' ] == 'cloud_services_aws' || this_slide[ 'handle' ] == 'cloud_services_azure' || this_slide[ 'handle' ] == 'on_prem_summary' ) && ( this_field[ 'handle' ] !== 'subscription_ids' && this_field[ 'handle' ] !== 'vmachines' && this_field[ 'handle' ] !== 'data_transferred' && this_field[ 'handle' ] !== 'usma_usage_pattern' ) ) {
        this_field[ 'commatized_calc' ] = best_unit( this_field[ 'calc' ] );
      } else {
        this_field[ 'commatized_calc' ] = commatize( this_field[ 'calc' ] );
      }
      if ( this_slide[ 'sum_calc' ] == 1 && this_field[ 'handle' ] !== 'subscription_ids' && this_field[ 'handle' ] !== 'vmachines' && this_field[ 'handle' ] !== 'data_transferred' && this_field[ 'handle' ] !== 'usma_usage_pattern' ) {
        window[ 'total_' + slide + '_eps' ] += this_field[ 'calc' ];
        this_slide[ 'total_eps' ] = window[ 'total_' + slide + '_eps' ];
        this_slide[ 'commatized_total_eps' ] = commatize( this_slide[ 'total_eps' ] );
      }
    }

    if ( this_slide[ 'add_to_eps_total' ] == 1 ) {
      grand_total_devices_eps += this_slide[ 'total_eps' ];
    }
  }
  if ( field_values[ 'slides' ][ 'misc' ] ) {
    grand_total_devices_eps += field_values[ 'slides' ][ 'misc' ][ 'fields' ][ 'other_eps' ][ 'raw' ];
  }
  field_values[ 'grand_totals' ][ 'eps' ] = grand_total_devices_eps;
  field_values[ 'grand_totals' ][ 'commatized_eps' ] = commatize( grand_total_devices_eps );
  if ( field_values[ 'slides' ][ 'misc' ] ) {
    update_eps_vals();
    update_recommendations();
  }
  update_report();
  console.log( field_values );
  //console.clear();
  /*
  console.log( grand_total_devices );
  console.log( field_values );
  console.table( field_values['slides'] );
  console.table( field_values['grand_totals'] );
  console.table( field_values['eps_vals'] );
  console.table( field_values['recommendations'] );
  console.table( field_values );
  */
}

// EPS table values being made a part of the virtual dom structure
function update_eps_vals() {
  if ( field_values[ 'slides' ][ 'misc' ] ) {
    var eps_table = {},
      msg_size = field_values[ 'slides' ][ 'misc' ][ 'fields' ][ 'avg_msg_size' ][ 'raw' ],
      cratio = field_values[ 'slides' ][ 'misc' ][ 'fields' ][ 'compression_ratio' ][ 'raw' ];
    eps_table = {
      'per_second': {
        'events': commatize( grand_total_devices_eps ),
        'raw': (grand_total_devices_eps * msg_size),
        'uncompressed': best_unit( grand_total_devices_eps * msg_size ),
        'compressed': best_unit( ( grand_total_devices_eps * msg_size ) / cratio )
      },
      'per_hour': {
        'events': commatize( per_hour( grand_total_devices_eps ) ),
        'raw': per_hour( grand_total_devices_eps * msg_size ),
        'uncompressed': best_unit( per_hour( grand_total_devices_eps * msg_size ) ),
        'compressed': best_unit( per_hour( ( grand_total_devices_eps * msg_size ) / cratio ) )
      },
      'per_day': {
        'events': commatize( per_day( grand_total_devices_eps ) ),
        'raw': per_day( grand_total_devices_eps * msg_size ),
        'uncompressed': best_unit( per_day( grand_total_devices_eps * msg_size ) ),
        'compressed': best_unit( per_day( ( grand_total_devices_eps * msg_size ) / cratio ) )
      },
      'per_month': {
        'events': commatize( per_month( grand_total_devices_eps ) ),
        'raw': per_month( grand_total_devices_eps * msg_size ),
        'uncompressed': best_unit( per_month( grand_total_devices_eps * msg_size ) ),
        'compressed': best_unit( per_month( ( grand_total_devices_eps * msg_size ) / cratio ) )
      },
      'per_year': {
        'events': commatize( per_year(grand_total_devices_eps) ),
        'raw': per_year( grand_total_devices_eps * msg_size ),
        'uncompressed': best_unit( per_year( grand_total_devices_eps * msg_size ) ),
        'compressed': best_unit( per_year( ( grand_total_devices_eps * msg_size ) / cratio ) )
      }
    };

    field_values[ 'eps_vals' ] = eps_table;
  }
}

function update_recommendations() {
  var recommendations = {};

  recommendations = {
    'line_1': line1(),
    'line_2': line2()
  };

  field_values[ 'recommendations' ] = recommendations;
}

// round_pretty(num) => rounds and limites decimal places to two
function round_pretty( num ) {
  return Math.round( num * 100 ) / 100;
}

// Time conversion functions
function per_hour( num ) {
  return ( num * 60 ) * 60;
}
function per_day( num ) {
  return per_hour( num ) * 24;
}
function per_month( num ) {
  return per_day( num ) * 30;
}
function per_year( num ) {
  return per_day( num ) * 365;
}

// Data size conversion functions

// B functions
function b_to_kb( b ) {
  return up_order( b );
}
function b_to_mb( b ) {
  return up_order( up_order( b ) );
}
function b_to_gb( b ) {
  return up_order( up_order( up_order( b ) ) );
}
function b_to_tb( b ) {

}
// KB functions
function kb_to_mb( kb ) {
  return up_order( kb );
}
function kb_to_gb( kb ) {
  return up_order( up_order( kb ) );
}
function kb_to_tb( kb ) {
  return up_order( up_order( up_order( kb ) ) );
}

// MB functions
function mb_to_gb( mb ) {
  return up_order( mb );
}
function mb_to_tb( mb ) {
  return up_order( up_order( mb ) );
}
function mb_to_kb( mb ) {
  return down_order( mb );
}

// GB functions
function gb_to_tb( gb ) {
  return up_order( gb );
}
function gb_to_mb( gb ) {
  return down_order( gb );
}
function gb_to_kb( gb ) {
  return down_order( down_order( gb ) );
}
function gb_to_b( gb ) {
  return down_order( down_order( down_order( gb ) ) );
}

// TB functions
function tb_to_gb( tb ) {
  return down_order( tb );
}
function tb_to_mb( tb ) {
  return down_order( down_order( tb ) );
}
function tb_to_kb( tb ) {
  return down_order( down_order( down_order( tb ) ) );
}

function up_order( num ) {
  return num / 1024;
}

function down_order( num ) {
  return num * 1024;
}

function best_unit( num ) {
  if ( num ) {
    var units = [];
    units[ 0 ] = 'B';
    units[ 1 ] = 'KiB',
    units[ 2 ] = 'MiB',
    units[ 3 ] = 'GiB',
    units[ 4 ] = 'TiB',
    units[ 5 ] = 'PiB',
    units[ 6 ] = 'EiB',
    units[ 7 ] = 'ZiB',
    units[ 8 ] = 'YiB';
    for ( var i = 0 ; i < units.length ; i++ ) {
      if ( num > 1024 ) {
        num = up_order( num );
      } else {
        num = round_pretty( num ) + ' ' + units[ i ];
        break;
      }
    }
    return num;
  }
}

function commatize( num = 0 ) {
  var num_array = String( num ).split( '' ),
    res = '',
    n = 0;
  if ( typeof ( num ) === 'number' ) {
    while ( num_array.length > 0 ) {
      if ( n === 3 ) {
        res = ',' + res;
        n = 1;
      } else {
        n += 1;
      }
      res = num_array.pop() + String( res );
    }
  } else {
    res = num;
  }
  return res;
}


text:
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;

namespace Microting.eForm.Infrastructure.Data.Entities
{
    public  class SurveyConfiguration : PnBase
    {
        public DateTime Start { get; set; }

        public DateTime Stop { get; set; }

        public int TimeToLive { get; set; }

        public string Name { get; set; }

        public int TimeOut { get; set; }

        [ForeignKey("QuestionSet")]
        public int QuestionSetId { get; set; }

        public int? MicrotingUid { get; set; }

        public virtual ICollection<SiteSurveyConfiguration> SiteSurveyConfigurations { get; set; }

        public virtual QuestionSet QuestionSet { get; set; }
    }
}

redpajama_set_name: RedPajamaGithub


text:
class BackgroundModeManager;
class CRLSetFetcher;
class DownloadRequestLimiter;
class DownloadStatusUpdater;
class GpuModeManager;
class GpuProfileCache;
class IconManager;
class IntranetRedirectDetector;
class IOThread;
class MediaFileSystemRegistry;
class NotificationPlatformBridge;
class NotificationUIManager;
class PrefService;
class ProfileManager;
class StatusTray;
class WatchDogThread;
#if BUILDFLAG(ENABLE_WEBRTC)
class WebRtcLogUploader;
#endif

namespace safe_browsing {
class SafeBrowsingService;
}

namespace subresource_filter {
class RulesetService;
}

namespace variations {
class VariationsService;
}

namespace component_updater {
class ComponentUpdateService;
class PnaclComponentInstaller;
class SupervisedUserWhitelistInstaller;
}

namespace extensions {
class EventRouterForwarder;
}

namespace gcm {
class GCMDriver;
}

namespace memory {
class TabManager;
}

namespace message_center {
class MessageCenter;
}

namespace metrics {
class MetricsService;
}

namespace metrics_services_manager {
class MetricsServicesManager;
}

namespace net {
class URLRequestContextGetter;
}

namespace net_log {
class ChromeNetLog;
}

namespace network_time {
class NetworkTimeTracker;
}

namespace physical_web {
class PhysicalWebDataSource;
}

namespace policy {
class BrowserPolicyConnector;
class PolicyService;
}

namespace printing {
class BackgroundPrintingManager;
class PrintJobManager;
class PrintPreviewDialogController;
}

namespace rappor {
class RapporServiceImpl;
}

namespace safe_browsing {
class ClientSideDetectionService;
}

// NOT THREAD SAFE, call only from the main thread.
// These functions shouldn't return NULL unless otherwise noted.
class BrowserProcess {
 public:
  BrowserProcess();
  virtual ~BrowserProcess();

  // Called when the ResourceDispatcherHost object is created by content.
  virtual void ResourceDispatcherHostCreated() = 0;

  // Invoked when the user is logging out/shutting down. When logging off we may
  // not have enough time to do a normal shutdown. This method is invoked prior
  // to normal shutdown and saves any state that must be saved before we are
  // continue shutdown.
  virtual void EndSession() = 0;

  // Gets the manager for the various metrics-related services, constructing it
  // if necessary.
  virtual metrics_services_manager::MetricsServicesManager*
  GetMetricsServicesManager() = 0;

  // Services: any of these getters may return NULL
  virtual metrics::MetricsService* metrics_service() = 0;
  virtual rappor::RapporServiceImpl* rappor_service() = 0;
  virtual ProfileManager* profile_manager() = 0;
  virtual PrefService* local_state() = 0;
  virtual net::URLRequestContextGetter* system_request_context() = 0;
  virtual variations::VariationsService* variations_service() = 0;

  virtual BrowserProcessPlatformPart* platform_part() = 0;

  virtual extensions::EventRouterForwarder*
      extension_event_router_forwarder() = 0;

  // Returns the manager for desktop notifications.
  // TODO(miguelg) This is in the process of being deprecated in favour of
  // NotificationPlatformBridge + NotificationDisplayService
  virtual NotificationUIManager* notification_ui_manager() = 0;
  virtual NotificationPlatformBridge* notification_platform_bridge() = 0;

  // MessageCenter is a global list of currently displayed notifications.
  virtual message_center::MessageCenter* message_center() = 0;

  // Returns the state object for the thread that we perform I/O
  // coordination on (network requests, communication with renderers,
  // etc.
  //
  // Can be NULL close to startup and shutdown.
  //
  // NOTE: If you want to post a task to the IO thread, use
  // BrowserThread::PostTask (or other variants).
  virtual IOThread* io_thread() = 0;

  // Returns the thread that is used for health check of all browser threads.
  virtual WatchDogThread* watchdog_thread() = 0;

  // Starts and manages the policy system.
  virtual policy::BrowserPolicyConnector* browser_policy_connector() = 0;

  // This is the main interface for chromium components to retrieve policy
  // information from the policy system.
  virtual policy::PolicyService* policy_service() = 0;

  virtual IconManager* icon_manager() = 0;

  virtual GpuModeManager* gpu_mode_manager() = 0;

  virtual GpuProfileCache* gpu_profile_cache() = 0;

  // Create and bind remote debugging server to a given |ip| and |port|.
  // Passing empty |ip| results in binding to localhost:
  // 127.0.0.1 or ::1 depending on the environment.
  virtual void CreateDevToolsHttpProtocolHandler(const std::string& ip,
                                                 uint16_t port) = 0;
  virtual void CreateDevToolsAutoOpener() = 0;

  virtual bool IsShuttingDown() = 0;

  virtual printing::PrintJobManager* print_job_manager() = 0;
  virtual printing::PrintPreviewDialogController*
      print_preview_dialog_controller() = 0;
  virtual printing::BackgroundPrintingManager*
      background_printing_manager() = 0;

  virtual IntranetRedirectDetector* intranet_redirect_detector() = 0;

  // Returns the locale used by the application. It is the IETF language tag,
  // defined in BCP 47. The region subtag is not included when it adds no
  // distinguishing information to the language tag (e.g. both "en-US" and "fr"
  // are correct here).
  virtual const std::string& GetApplicationLocale() = 0;
  virtual void SetApplicationLocale(const std::string& locale) = 0;

  virtual DownloadStatusUpdater* download_status_updater() = 0;
  virtual DownloadRequestLimiter* download_request_limiter() = 0;

  // Returns the object that manages background applications.
  virtual BackgroundModeManager* background_mode_manager() = 0;
  virtual void set_background_mode_manager_for_test(
      std::unique_ptr<BackgroundModeManager> manager) = 0;

  // Returns the StatusTray, which provides an API for displaying status icons
  // in the system status tray. Returns NULL if status icons are not supported
  // on this platform (or this is a unit test).
  virtual StatusTray* status_tray() = 0;

  // Returns the SafeBrowsing service.
  virtual safe_browsing::SafeBrowsingService* safe_browsing_service() = 0;

  // Returns an object which handles communication with the SafeBrowsing
  // client-side detection servers.
  virtual safe_browsing::ClientSideDetectionService*
      safe_browsing_detection_service() = 0;

  // Returns the service providing versioned storage for rules used by the Safe
  // Browsing subresource filter.
  virtual subresource_filter::RulesetService*
  subresource_filter_ruleset_service() = 0;

#if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS)
  // This will start a timer that, if Chrome is in persistent mode, will check
  // whether an update is available, and if that's the case, restart the
  // browser. Note that restart code will strip some of the command line keys
  // and all loose values from the cl this instance of Chrome was launched with,
  // and add the command line key that will force Chrome to start in the
  // background mode. For the full list of "blacklisted" keys, refer to
  // |kSwitchesToRemoveOnAutorestart| array in browser_process_impl.cc.
  virtual void StartAutoupdateTimer() = 0;
#endif

  virtual net_log::ChromeNetLog* net_log() = 0;

  virtual component_updater::ComponentUpdateService* component_updater() = 0;

  virtual CRLSetFetcher* crl_set_fetcher() = 0;

  virtual component_updater::PnaclComponentInstaller*
  pnacl_component_installer() = 0;

  virtual component_updater::SupervisedUserWhitelistInstaller*
  supervised_user_whitelist_installer() = 0;

  virtual MediaFileSystemRegistry* media_file_system_registry() = 0;

  virtual bool created_local_state() const = 0;

#if BUILDFLAG(ENABLE_WEBRTC)
  virtual WebRtcLogUploader* webrtc_log_uploader() = 0;
#endif

  virtual network_time::NetworkTimeTracker* network_time_tracker() = 0;

  virtual gcm::GCMDriver* gcm_driver() = 0;

  // Returns the tab manager. On non-supported platforms, this returns null.
  virtual memory::TabManager* GetTabManager() = 0;

  // Returns the default web client state of Chrome (i.e., was it the user's
  // default browser) at the time a previous check was made sometime between
  // process startup and now.
  virtual shell_integration::DefaultWebClientState
  CachedDefaultWebClientState() = 0;

  // Returns the Physical Web data source.
  virtual physical_web::PhysicalWebDataSource* GetPhysicalWebDataSource() = 0;

 private:
  DISALLOW_COPY_AND_ASSIGN(BrowserProcess);
};

extern BrowserProcess* g_browser_process;

#endif  // CHROME_BROWSER_BROWSER_PROCESS_H_


text:
from logging import getLogger

from plenum.common.messages.node_messages import PrePrepare, Prepare, Commit
from plenum.server.replica import Replica
from plenum.test import waits

from plenum.test.checkpoints.conftest import tconf, chkFreqPatched, \
    reqs_for_checkpoint
from plenum.test.helper import send_reqs_batches_and_get_suff_replies
from plenum.test.node_catchup.helper import waitNodeDataEquality, \
    checkNodeDataForInequality, get_number_of_completed_catchups
from plenum.test.pool_transactions.helper import sdk_add_new_steward_and_node
from plenum.test.test_node import checkNodesConnected

logger = getLogger()

TestRunningTimeLimitSec = 200

CHK_FREQ = 5
LOG_SIZE = 3 * CHK_FREQ

def test_incomplete_short_checkpoint_included_in_lag_for_catchup(
        looper, chkFreqPatched, reqs_for_checkpoint, txnPoolNodeSet,
        sdk_pool_handle, sdk_wallet_steward, sdk_wallet_client,
        tdir, tconf, allPluginsPath):
    """
    Verifies that if the first stored own checkpoint has a not aligned lower
    bound (this means that it was started after a catch-up), is incomplete
    and there is a quorumed stashed checkpoint from other replicas with
    the same end then this stashed checkpoint is included into the lag
    for a catch-up, i.e. in such a case the lag which makes the node perform
    catch-up is Replica.STASHED_CHECKPOINTS_BEFORE_CATCHUP + 1 quorumed stashed
    received checkpoints.
    """
    max_batch_size = chkFreqPatched.Max3PCBatchSize

    _, new_node = sdk_add_new_steward_and_node(
        looper, sdk_pool_handle, sdk_wallet_steward,
        'EpsilonSteward', 'Epsilon', tdir, tconf,
        allPluginsPath=allPluginsPath)
    txnPoolNodeSet.append(new_node)
    looper.run(checkNodesConnected(txnPoolNodeSet))
    waitNodeDataEquality(looper, new_node, *txnPoolNodeSet[:-1], exclude_from_check=['check_last_ordered_3pc_backup'])
    # Epsilon did not participate in ordering of the batch with EpsilonSteward
    # NYM transaction and the batch with Epsilon NODE transaction.
    # Epsilon got these transactions via catch-up.

    # Send some requests but not enough to complete the first checkpoint.
    # Note that there are already 2 3PC-batches in the first checkpoint:
    # with EpsilonSteward NYM transaction and with Epsilon NODE transaction.
    # This checkpoint has a not aligned lower bound on the new node replicas.
    send_reqs_batches_and_get_suff_replies(looper, txnPoolNodeSet,
                                           sdk_pool_handle,
                                           sdk_wallet_client,
                                           reqs_for_checkpoint - 4 * max_batch_size)

    # The master replica of the new node stops to receive 3PC-messages
    new_node.master_replica.external_bus._handlers[PrePrepare] = [lambda *x, **y: (None, None)]
    new_node.master_replica.external_bus._handlers[Prepare] = [lambda *x, **y: (None, None)]
    new_node.master_replica.external_bus._handlers[Commit] = [lambda *x, **y: (None, None)]

    completed_catchups_before_reqs = get_number_of_completed_catchups(new_node)

    # Send requests for the new node's master replica to reach
    # Replica.STASHED_CHECKPOINTS_BEFORE_CATCHUP quorumed stashed
    # checkpoints from others
    send_reqs_batches_and_get_suff_replies(looper, txnPoolNodeSet,
                                           sdk_pool_handle,
                                           sdk_wallet_client,
                                           (Replica.STASHED_CHECKPOINTS_BEFORE_CATCHUP - 1) *
                                           reqs_for_checkpoint + max_batch_size)

    # Give time for the new node to catch up if it is going to do it
    looper.runFor(waits.expectedPoolConsistencyProof(len(txnPoolNodeSet)) +
                  waits.expectedPoolCatchupTime(len(txnPoolNodeSet)))

    checkNodeDataForInequality(new_node, *txnPoolNodeSet[:-1])

    # Verify that the new node has not caught up
    assert get_number_of_completed_catchups(new_node) == completed_catchups_before_reqs

    # Send more requests for the new node's master replica to reach
    # Replica.STASHED_CHECKPOINTS_BEFORE_CATCHUP + 1 quorumed stashed
    # checkpoints from others
    send_reqs_batches_and_get_suff_replies(looper, txnPoolNodeSet,
                                           sdk_pool_handle,
                                           sdk_wallet_client,
                                           reqs_for_checkpoint)

    waitNodeDataEquality(looper, new_node, *txnPoolNodeSet[:-1], exclude_from_check=['check_last_ordered_3pc_backup'])

    # Verify that the new node has caught up
    assert get_number_of_completed_catchups(new_node) > completed_catchups_before_reqs


text:
title: gqt
category: software
subtitle: Genotype Query Tools
layout: blog_default
modal-id: 4
img: gqt.overview.png
thumbnail: gqt.png
alt: gqt.png
manuscript: http://www.nature.com/nmeth/journal/vaop/ncurrent/full/nmeth.3654.html
code: https://github.com/ryanlayer/gqt
docs: https://github.com/ryanlayer/gqt
description: Genotype Query Tools (GQT) is command line software and a C API for indexing and querying large-scale genotype data sets like those produced by 1000 Genomes, the UK100K, and forthcoming datasets involving millions of genomes. GQT represents genotypes as compressed bitmap indices, which reduce computational burden of variant queries based on sample genotypes, phenotypes, and relationships by orders of magnitude over standard "variant-centric" indexing strategies. This index can significantly expand the capabilities of population-scale analyses by providing interactive-speed queries to data sets with millions of individuals.
---


text:
var Mongoose = require('mongoose');
var bcrypt = require('bcrypt-nodejs');
var Schema = Mongoose.Schema;

var userSchema = new Schema({
	email: {
		type: String,
		required: true,
		unique: true
	},

	password: {
		type: String,
		minLength: 6,
	},
	role: {
		type: String,
		enum: [
			'student',
			'admin'
		]
	}
});

userSchema.pre('save', function(callback) {
	var user = this;
	// Break out if the password hasn't changed
	if (!user.isModified('password')) return callback();

	// Password changed so we need to hash it
	bcrypt.genSalt(5, function(err, salt) {
		if (err) return callback(err);
		bcrypt.hash(user.password, salt, null, function(err, hash) {
			if (err) return callback(err);
			user.password = hash;
			callback();
		});
	});
});

// Password match
userSchema.methods.verifyPassword = function(password, cb) {
	console.log('this is userSchema verify password', password)
	var user = this;
	bcrypt.compare(password, user.password, function(err, isMatch) {
		if (err) return cb(err);
		cb(null, isMatch);
	});
};
module.exports = Mongoose.model('User', userSchema);


text:
extern NSString * const APLevelDBErrorDomain;

@class APLevelDBIterator;
@protocol APLevelDBWriteBatch;

@interface APLevelDB : NSObject

@property (nonatomic, readonly, strong) NSString *path;

+ (APLevelDB *)levelDBWithPath:(NSString *)path error:(NSError *__autoreleasing*)errorOut;
- (void)close;

- (BOOL)setData:(NSData *)data forKey:(NSString *)key;
- (BOOL)setString:(NSString *)str forKey:(NSString *)key;

- (NSData *)dataForKey:(NSString *)key;
- (NSString *)stringForKey:(NSString *)key;

- (BOOL)removeKey:(NSString *)key;

- (NSArray *)allKeys;

- (void)enumerateKeys:(void (^)(NSString *key, BOOL *stop))block;
- (void)enumerateKeysWithPrefix:(NSString *)prefix usingBlock:(void (^)(NSString *key, BOOL *stop))block;

- (void)enumerateKeysAndValuesAsStrings:(void (^)(NSString *key, NSString *value, BOOL *stop))block;
- (void)enumerateKeysWithPrefix:(NSString *)prefix asStrings:(void (^)(NSString *key, NSString *value, BOOL *stop))block;

- (void)enumerateKeysAndValuesAsData:(void (^)(NSString *key, NSData *value, BOOL *stop))block;
- (void)enumerateKeysWithPrefix:(NSString *)prefix asData:(void (^)(NSString *key, NSData *value, BOOL *stop))block;

- (NSUInteger)approximateSizeFrom:(NSString *)from to:(NSString *)to;
- (NSUInteger)exactSizeFrom:(NSString *)from to:(NSString *)to;

// Objective-C Subscripting Support:
//   The database object supports subscripting for string-string and string-data key-value access and assignment.
//   Examples:
//     db[@"key"] = @"value";
//     db[@"key"] = [NSData data];
//     NSString *s = db[@"key"];
//   An NSInvalidArgumentException is raised if the key is not an NSString, or if the assigned object is not an
//   instance of NSString or NSData.
- (id)objectForKeyedSubscript:(id)key;
- (void)setObject:(id)object forKeyedSubscript:(id<NSCopying>)key;

// Batch write/atomic update support:
- (id<APLevelDBWriteBatch>)beginWriteBatch;

@end

@interface APLevelDBIterator : NSObject

+ (id)iteratorWithLevelDB:(APLevelDB *)db;

// Designated initializer:
- (id)initWithLevelDB:(APLevelDB *)db;

- (BOOL)seekToKey:(NSString *)key;
- (NSString *)nextKey;
- (NSString *)key;
- (NSString *)valueAsString;
- (NSData *)valueAsData;

@end

@protocol APLevelDBWriteBatch <NSObject>

- (void)setData:(NSData *)data forKey:(NSString *)key;
- (void)setString:(NSString *)str forKey:(NSString *)key;

- (void)removeKey:(NSString *)key;

// Remove all of the buffered sets and removes:
- (void)clear;
- (BOOL)commit;

@end


text:
package ${packageName}.web;

import org.apache.wicket.Component;
import org.apache.wicket.PageParameters;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.security.components.ISecurePage;

/**
 * Home page. If your application has a public part that does not require users to login you will want this as your
 * homepage. otherwise the {@link SecureHomePage} might be an alternative. Only pages implementing {@link ISecurePage}
 * or secure {@link Component}s need to be granted permission in application.hive. Even unsecured pages can contain
 * secure components.
 */
public class HomePage extends BasePage
{

	private static final long serialVersionUID = 1L;

	// TODO Add any page properties or variables here

	/**
	 * Constructor that is invoked when page is invoked without a session.
	 *
	 * @param parameters Page parameters
	 */
	public HomePage(final PageParameters parameters)
	{
		super(parameters);
		// Add the simplest type of label
		add(new Label("message", "If you see this message wicket is properly configured and running"));

		// TODO Add your page's components here
	}
}


text:
package feihua.jdbc.api.pojo;

/**
 * 业务实体基类
 * Created by yangwei
 * Created at 2017/8/22 10:27
 */
public class BaseBo extends BasePojo {
}


text:
    <button class="btn btn-default" type="button">
        button.btn.btn-default
    </button>
    <button class="btn btn-primary" type="button">..btn-primary</button>
    <button class="btn btn-success" type="button">..btn-success</button>
    <button class="btn btn-info" type="button">..btn-info</button>
    <button class="btn btn-warning" type="button">..btn-warning</button>
    <button class="btn btn-danger" type="button">..btn-danger</button>
    <button class="btn btn-link" type="button">..btn-link</button>

    <button class="btn btn-default btn-lg" type="button">...btn-lg</button>
    <button class="btn btn-default" type="button">Default button size</button>
    <button class="btn btn-default btn-sm" type="button">...btn-sm</button>
    <button class="btn btn-default btn-xs" type="button">...btn-xs</button>

    <button class="btn btn-primary btn-block" type="button">
        ..btn-primary.btn-block
    </button>
    <button class="btn btn-default btn-block" type="button">
        ..btn-default.btn-block
    </button>

    a.btn.btn-default
    <button class="btn btn-default" type="button">button..</button>
    <input class="btn btn-default" type="button" value="input[type='button']..">
    <input class="btn btn-default" type="submit" value="input[type='submit']..">

    a...active
    <button class="btn btn-default active" type="button">
        button...active
    </button>

    a...disabled
    <button class="btn btn-default" type="button" disabled="disabled">
        button..[disabled]
    </button>

.btn-group

        <button class="btn btn-default" type="button">
            button.btn.btn-default
        </button>
        <button class="btn btn-default" type="button">2</button>
        <button class="btn btn-default" type="button">3</button>

.btn-toolbar .btn-group

            <button class="btn btn-default" type="button">
                ..btn-group-lg button
            </button>
            <button class="btn btn-default" type="button">2</button>
            <button class="btn btn-default" type="button">3</button>

            <button class="btn btn-default" type="button">
                ..btn-group-sm button
            </button>
            <button class="btn btn-default" type="button">2</button>
            <button class="btn btn-default" type="button">3</button>

            <button class="btn btn-default" type="button">
                ..btn-group-xs button
            </button>
            <button class="btn btn-default" type="button">2</button>
            <button class="btn btn-default" type="button">3</button>

        <button class="btn btn-default" type="button">1</button>
        <button class="btn btn-default" type="button">2</button>

            <button class="btn btn-default dropdown-toggle" data-toggle="dropdown" type="button">
                button.dropdown-toggle

            </button>

Link #1

Link #2

        <button class="btn btn-default" type="button">
            .btn-group-vertical button
        </button>

            <button class="btn btn-default dropdown-toggle" data-toggle="dropdown" type="button">
                Dropdown

            </button>

Link #1

Link #2

        <button class="btn btn-default" type="button">3</button>

.btn-group.btn-group-justified

        Button
        2
        3

.btn-toolbar .btn-group.dropup

        <button class="btn btn-default" type="button">
            .dropdown-menu →
        </button>
        <button class="btn btn-default dropdown-toggle" data-toggle="dropdown" type="button">

        </button>

Link #1

Link #2

        <button class="btn btn-default" type="button">
            ..dropdown-menu-right →
        </button>
        <button class="btn btn-default dropdown-toggle" data-toggle="dropdown" type="button">

        </button>

Link #1

Link #2


text:
package br.edu.utfpr.recominer.repository;

import br.edu.utfpr.recominer.core.repository.ReadOnlyJdbcRepository;
import br.edu.utfpr.recominer.core.model.Committer;
import java.sql.ResultSet;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.stereotype.Repository;

/**
 *
 * @author Rodrigo T. Kuroda <rodrigokuroda at alunos.utfpr.edu.br>
 */
@Repository
public class CommitterRepository extends ReadOnlyJdbcRepository<Committer, Integer> {

    public CommitterRepository() {
        super(ROW_MAPPER, TABLE_NAME, ID_COLUMN);
    }

    private static final String ID_COLUMN = "id";
    private static final String TABLE_NAME = "people";

    public static final RowMapper<Committer> ROW_MAPPER
            = (ResultSet rs, int rowNum) -> {
                Committer committer = new Committer(rs.getInt("id"),
                        rs.getString("name"),
                        rs.getString("email"));
                return committer;
            };

}


text:
__all__ = [
    'init',
    'cleanup',
    'set_defaults',
    'add_extra_exmods',
    'clear_extra_exmods',
    'get_allowed_exmods',
    'RequestContextSerializer',
    'get_client',
    'get_server',
    'get_notifier',
    'TRANSPORT_ALIASES',
]

import functools

from jacket.i18n import _, _LI
from oslo_config import cfg
from oslo_log import log as logging
import oslo_messaging as messaging
from oslo_serialization import jsonutils

import jacket.context
import jacket.exception
from jacket import objects
from jacket.objects import base
from jacket.objects.storage import base as storage_base

CONF = cfg.CONF
notification_opts = [
    cfg.StrOpt('notification_format',
               choices=['unversioned', 'versioned', 'both'],
               default='both',
               help='Specifies which notification format shall be used by '
                    'jacket.'),
]

CONF.register_opts(notification_opts)

LOG = logging.getLogger(__name__)

TRANSPORT = None
LEGACY_NOTIFIER = None
NOTIFICATION_TRANSPORT = None
NOTIFIER = None

ALLOWED_EXMODS = [
    jacket.exception.__name__,
]
EXTRA_EXMODS = []

# NOTE(markmc): The compute.openstack.common.rpc entries are for backwards compat
# with Havana rpc_backend configuration values. The compute.rpc entries are for
# compat with Essex values.
TRANSPORT_ALIASES = {
    'jacket.openstack.common.rpc.impl_kombu': 'rabbit',
    'jacket.openstack.common.rpc.impl_qpid': 'qpid',
    'jacket.openstack.common.rpc.impl_zmq': 'zmq',
    'jacket.rpc.impl_kombu': 'rabbit',
    'jacket.rpc.impl_qpid': 'qpid',
    'jacket.rpc.impl_zmq': 'zmq',
}

def init(conf):
    global TRANSPORT, NOTIFICATION_TRANSPORT, LEGACY_NOTIFIER, NOTIFIER
    exmods = get_allowed_exmods()
    TRANSPORT = messaging.get_transport(conf,
                                        allowed_remote_exmods=exmods,
                                        aliases=TRANSPORT_ALIASES)
    NOTIFICATION_TRANSPORT = messaging.get_notification_transport(
        conf, allowed_remote_exmods=exmods, aliases=TRANSPORT_ALIASES)
    serializer = RequestContextSerializer(JsonPayloadSerializer())
    if conf.notification_format == 'unversioned':
        LEGACY_NOTIFIER = messaging.Notifier(NOTIFICATION_TRANSPORT,
                                             serializer=serializer)
        NOTIFIER = messaging.Notifier(NOTIFICATION_TRANSPORT,
                                      serializer=serializer, driver='noop')
    elif conf.notification_format == 'both':
        LEGACY_NOTIFIER = messaging.Notifier(NOTIFICATION_TRANSPORT,
                                             serializer=serializer)
        NOTIFIER = messaging.Notifier(NOTIFICATION_TRANSPORT,
                                      serializer=serializer,
                                      topic='versioned_notifications')
    else:
        LEGACY_NOTIFIER = messaging.Notifier(NOTIFICATION_TRANSPORT,
                                             serializer=serializer,
                                             driver='noop')
        NOTIFIER = messaging.Notifier(NOTIFICATION_TRANSPORT,
                                      serializer=serializer,
                                      topic='versioned_notifications')

def cleanup():
    global TRANSPORT, NOTIFICATION_TRANSPORT, LEGACY_NOTIFIER, NOTIFIER
    assert TRANSPORT is not None
    assert NOTIFICATION_TRANSPORT is not None
    assert LEGACY_NOTIFIER is not None
    assert NOTIFIER is not None
    TRANSPORT.cleanup()
    NOTIFICATION_TRANSPORT.cleanup()
    TRANSPORT = NOTIFICATION_TRANSPORT = LEGACY_NOTIFIER = NOTIFIER = None

def set_defaults(control_exchange):
    messaging.set_transport_defaults(control_exchange)

def add_extra_exmods(*args):
    EXTRA_EXMODS.extend(args)

def clear_extra_exmods():
    del EXTRA_EXMODS[:]

def get_allowed_exmods():
    return ALLOWED_EXMODS + EXTRA_EXMODS

class JsonPayloadSerializer(messaging.NoOpSerializer):
    @staticmethod
    def serialize_entity(context, entity):
        return jsonutils.to_primitive(entity, convert_instances=True)

class RequestContextSerializer(messaging.Serializer):

    def __init__(self, base):
        self._base = base

    def serialize_entity(self, context, entity):
        if not self._base:
            return entity
        return self._base.serialize_entity(context, entity)

    def deserialize_entity(self, context, entity):
        if not self._base:
            return entity
        return self._base.deserialize_entity(context, entity)

    def serialize_context(self, context):
        return context.to_dict()

    def deserialize_context(self, context):
        return jacket.context.RequestContext.from_dict(context)

def get_transport_url(url_str=None):
    return messaging.TransportURL.parse(CONF, url_str, TRANSPORT_ALIASES)

def get_client(target, version_cap=None, serializer=None):
    assert TRANSPORT is not None
    serializer = RequestContextSerializer(serializer)
    return messaging.RPCClient(TRANSPORT,
                               target,
                               version_cap=version_cap,
                               serializer=serializer)

def get_server(target, endpoints, serializer=None):
    assert TRANSPORT is not None
    serializer = RequestContextSerializer(serializer)
    return messaging.get_rpc_server(TRANSPORT,
                                    target,
                                    endpoints,
                                    executor='eventlet',
                                    serializer=serializer)

def get_notifier(service, host=None, publisher_id=None):
    assert LEGACY_NOTIFIER is not None
    if not publisher_id:
        publisher_id = "%s.%s" % (service, host or CONF.host)
    return LegacyValidatingNotifier(
            LEGACY_NOTIFIER.prepare(publisher_id=publisher_id))

def get_versioned_notifier(publisher_id):
    assert NOTIFIER is not None
    return NOTIFIER.prepare(publisher_id=publisher_id)

class LegacyValidatingNotifier(object):
    """Wraps an oslo.messaging Notifier and checks for allowed event_types."""

    # If true an exception is thrown if the event_type is not allowed, if false
    # then only a WARNING is logged
    fatal = False

    # This list contains the already existing therefore allowed legacy
    # notification event_types. New items shall not be added to the list as
    # Nova does not allow new legacy notifications any more. This list will be
    # removed when all the notification is transformed to versioned
    # notifications.
    allowed_legacy_notification_event_types = [
        'aggregate.addhost.end',
        'aggregate.addhost.start',
        'aggregate.create.end',
        'aggregate.create.start',
        'aggregate.delete.end',
        'aggregate.delete.start',
        'aggregate.removehost.end',
        'aggregate.removehost.start',
        'aggregate.updatemetadata.end',
        'aggregate.updatemetadata.start',
        'aggregate.updateprop.end',
        'aggregate.updateprop.start',
        'api.fault',
        'compute.instance.create.end',
        'compute.instance.create.error',
        'compute.instance.create_ip.end',
        'compute.instance.create_ip.start',
        'compute.instance.create.start',
        'compute.instance.delete.end',
        'compute.instance.delete_ip.end',
        'compute.instance.delete_ip.start',
        'compute.instance.delete.start',
        'compute.instance.evacuate',
        'compute.instance.exists',
        'compute.instance.finish_resize.end',
        'compute.instance.finish_resize.start',
        'compute.instance.live.migration.abort.start',
        'compute.instance.live.migration.abort.end',
        'compute.instance.live_migration.post.dest.end',
        'compute.instance.live_migration.post.dest.start',
        'compute.instance.live_migration._post.end',
        'compute.instance.live_migration._post.start',
        'compute.instance.live_migration.pre.end',
        'compute.instance.live_migration.pre.start',
        'compute.instance.live_migration.rollback.dest.end',
        'compute.instance.live_migration.rollback.dest.start',
        'compute.instance.live_migration._rollback.end',
        'compute.instance.live_migration._rollback.start',
        'compute.instance.pause.end',
        'compute.instance.pause.start',
        'compute.instance.power_off.end',
        'compute.instance.power_off.start',
        'compute.instance.power_on.end',
        'compute.instance.power_on.start',
        'compute.instance.reboot.end',
        'compute.instance.reboot.start',
        'compute.instance.rebuild.end',
        'compute.instance.rebuild.error',
        'compute.instance.rebuild.scheduled',
        'compute.instance.rebuild.start',
        'compute.instance.rescue.end',
        'compute.instance.rescue.start',
        'compute.instance.resize.confirm.end',
        'compute.instance.resize.confirm.start',
        'compute.instance.resize.end',
        'compute.instance.resize.error',
        'compute.instance.resize.prep.end',
        'compute.instance.resize.prep.start',
        'compute.instance.resize.revert.end',
        'compute.instance.resize.revert.start',
        'compute.instance.resize.start',
        'compute.instance.restore.end',
        'compute.instance.restore.start',
        'compute.instance.resume.end',
        'compute.instance.resume.start',
        'compute.instance.shelve.end',
        'compute.instance.shelve_offload.end',
        'compute.instance.shelve_offload.start',
        'compute.instance.shelve.start',
        'compute.instance.shutdown.end',
        'compute.instance.shutdown.start',
        'compute.instance.snapshot.end',
        'compute.instance.snapshot.start',
        'compute.instance.soft_delete.end',
        'compute.instance.soft_delete.start',
        'compute.instance.suspend.end',
        'compute.instance.suspend.start',
        'compute.instance.trigger_crash_dump.end',
        'compute.instance.trigger_crash_dump.start',
        'compute.instance.unpause.end',
        'compute.instance.unpause.start',
        'compute.instance.unrescue.end',
        'compute.instance.unrescue.start',
        'compute.instance.unshelve.start',
        'compute.instance.unshelve.end',
        'compute.instance.update',
        'compute.instance.volume.attach',
        'compute.instance.volume.detach',
        'compute.libvirt.error',
        'compute_task.build_instances',
        'compute_task.migrate_server',
        'compute_task.rebuild_server',
        'HostAPI.power_action.end',
        'HostAPI.power_action.start',
        'HostAPI.set_enabled.end',
        'HostAPI.set_enabled.start',
        'HostAPI.set_maintenance.end',
        'HostAPI.set_maintenance.start',
        'keypair.create.start',
        'keypair.create.end',
        'keypair.delete.start',
        'keypair.delete.end',
        'keypair.import.start',
        'keypair.import.end',
        'network.floating_ip.allocate',
        'network.floating_ip.associate',
        'network.floating_ip.deallocate',
        'network.floating_ip.disassociate',
        'scheduler.select_destinations.end',
        'scheduler.select_destinations.start',
        'servergroup.addmember',
        'servergroup.create',
        'servergroup.delete',
        'volume.usage',
    ]

    message = _('%(event_type)s is not a versioned notification and not '
                'whitelisted. See ./doc/source/notification.rst')

    def __init__(self, notifier):
        self.notifier = notifier
        for priority in ['debug', 'info', 'warn', 'error', 'critical']:
            setattr(self, priority,
                    functools.partial(self._notify, priority))

    def _is_wrap_exception_notification(self, payload):
        # jacket.compute.wrap_exception decorator emits notification where the
        # event_type is the name of the decorated function. This is used in
        # many places but it will be converted to versioned notification in one
        # run by updating the decorator so it is pointless to white list all
        # the function names here we white list the notification itself
        # detected by the special payload keys.
        return {'exception', 'args'} == set(payload.keys())

    def _notify(self, priority, ctxt, event_type, payload):
        if (event_type not in self.allowed_legacy_notification_event_types and
                not self._is_wrap_exception_notification(payload)):
            if self.fatal:
                raise AssertionError(self.message % {'event_type': event_type})
            else:
                LOG.warning(self.message, {'event_type': event_type})

        getattr(self.notifier, priority)(ctxt, event_type, payload)

LAST_RPC_VERSIONS = {}
LAST_OBJ_VERSIONS = {}

class RPCAPI(object):
    """Mixin class aggregating methods related to RPC API compatibility."""

    RPC_API_VERSION = '1.0'
    TOPIC = ''
    BINARY = ''

    def __init__(self):
        target = messaging.Target(topic=self.TOPIC,
                                  version=self.RPC_API_VERSION)
        obj_version_cap = self._determine_obj_version_cap()
        #serializer = base.CinderObjectSerializer(obj_version_cap)
        serializer = base.JacketObjectSerializer()

        rpc_version_cap = self._determine_rpc_version_cap()
        self.client = get_client(target, version_cap=rpc_version_cap,
                                 serializer=serializer)

    def _determine_rpc_version_cap(self):
        global LAST_RPC_VERSIONS
        if self.BINARY in LAST_RPC_VERSIONS:
            return LAST_RPC_VERSIONS[self.BINARY]

        version_cap = objects.Service.get_minimum_rpc_version(
            jacket.context.get_admin_context(), self.BINARY)
        if version_cap == 'liberty':
            # NOTE(dulek): This means that one of the services is Liberty,
            # we should cap to it's RPC version.
            version_cap = LIBERTY_RPC_VERSIONS[self.BINARY]
        elif not version_cap:
            # If there is no service we assume they will come up later and will
            # have the same version as we do.
            version_cap = self.RPC_API_VERSION
        LOG.info(_LI('Automatically selected %(binary)s RPC version '
                     '%(version)s as minimum service version.'),
                 {'binary': self.BINARY, 'version': version_cap})
        LAST_RPC_VERSIONS[self.BINARY] = version_cap
        return version_cap

    def _determine_obj_version_cap(self):
        global LAST_OBJ_VERSIONS
        if self.BINARY in LAST_OBJ_VERSIONS:
            return LAST_OBJ_VERSIONS[self.BINARY]
        version_cap = objects.Service.get_minimum_obj_version(
            jacket.context.get_admin_context(), self.BINARY)
        # If there is no service we assume they will come up later and will
        # have the same version as we do.
        if not version_cap:
            version_cap = storage_base.OBJ_VERSIONS.get_current()
        LOG.info(_LI('Automatically selected %(binary)s storage version '
                     '%(version)s as minimum service version.'),
                 {'binary': self.BINARY, 'version': version_cap})
        LAST_OBJ_VERSIONS[self.BINARY] = version_cap
        return version_cap

# FIXME(dulek): Liberty haven't reported its RPC versions, so we need to have
# them hardcoded. This dict may go away as soon as we drop compatibility with
# L, which should be in early N.
#
# This is the only time we need to have such dictionary. We don't need to add
# similar ones for any release following Liberty.
LIBERTY_RPC_VERSIONS = {
    'storage-volume': '1.30',
    'storage-scheduler': '1.8',
    # NOTE(dulek) backup.manager had specified version '1.2', but backup.rpcapi
    # was really only sending messages up to '1.1'.
    'storage-backup': '1.1',
}


text:
require "language/node"

class Kibana < Formula
  desc "Analytics and search dashboard for Elasticsearch"
  homepage "https://www.elastic.co/products/kibana"
  url "https://github.com/elastic/kibana.git",
      :tag => "v5.6.3",
      :revision => "f363a8fe7aeeb6a535e0bb43b3b1916f26ab3732"
  head "https://github.com/elastic/kibana.git"

  bottle do
    sha256 "8bd71d71c346020941e81226c3cfb98f2d42ad60abc8e4fd2929cdf72454690e" => :high_sierra
    sha256 "24f7ef61fd3d28731e1f046b3f1e8ce65264449878d33c53129d13516d64220f" => :sierra
    sha256 "137533a3bde1309c371bc77539c440b2ec00b8ed58c3532c61935d2991d6b14b" => :el_capitan
  end

  resource "node" do
    url "https://nodejs.org/dist/v6.11.1/node-v6.11.1.tar.xz"
    sha256 "6f6655b85919aa54cb045a6d69a226849802fcc26491d0db4ce59873e41cc2b8"
  end

  def install
    resource("node").stage do
      system "./configure", "--prefix=#{libexec}/node"
      system "make", "test"
      system "make", "install"
    end

    # do not build packages for other platforms
    inreplace buildpath/"tasks/config/platforms.js", /('(linux-x64|windows-x64)',?(?!;))/, "// \\1"

    # trick the build into thinking we've already downloaded the Node.js binary
    mkdir_p buildpath/".node_binaries/#{resource("node").version}/darwin-x64"

    # set npm env and fix cache edge case (https://github.com/Homebrew/brew/pull/37#issuecomment-208840366)
    ENV.prepend_path "PATH", prefix/"libexec/node/bin"
    system "npm", "install", "-ddd", "--build-from-source", "--#{Language::Node.npm_cache_config}"
    system "npm", "run", "build", "--", "--release", "--skip-os-packages", "--skip-archives"

    prefix.install Dir["build/kibana-#{version}-darwin-x86_64/{bin,config,node_modules,optimize,package.json,src,ui_framework,webpackShims}"]

    inreplace "#{bin}/kibana", %r{/node/bin/node}, "/libexec/node/bin/node"
    inreplace "#{bin}/kibana-plugin", %r{/node/bin/node}, "/libexec/node/bin/node"

    cd prefix do
      inreplace "config/kibana.yml", "/var/run/kibana.pid", var/"run/kibana.pid"
      (etc/"kibana").install Dir["config/*"]
      rm_rf "config"
    end
  end

  def post_install
    ln_s etc/"kibana", prefix/"config"
    (prefix/"data").mkdir
    (prefix/"plugins").mkdir
  end

  def caveats; <<-EOS.undent
    Config: #{etc}/kibana/
    If you wish to preserve your plugins upon upgrade, make a copy of
    #{opt_prefix}/plugins before upgrading, and copy it into the
    new keg location after upgrading.
    EOS
  end

  plist_options :manual => "kibana"

  def plist; <<-EOS.undent
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
    "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
      <dict>
        <key>Label</key>
        <string>#{plist_name}</string>
        <key>Program</key>
        <string>#{opt_bin}/kibana</string>
        <key>RunAtLoad</key>
        <true/>
      </dict>
    </plist>
  EOS
  end

  test do
    ENV["BABEL_CACHE_PATH"] = testpath/".babelcache.json"
    assert_match /#{version}/, shell_output("#{bin}/kibana -V")
  end
end


text:
from nose.plugins.multiprocess import MultiProcessTestRunner #@UnresolvedImport
from nose.plugins.base import Plugin #@UnresolvedImport
import sys
import pydev_runfiles_xml_rpc
import time
from pydev_runfiles_coverage import StartCoverageSupport

#=======================================================================================================================
# PydevPlugin
#=======================================================================================================================
class PydevPlugin(Plugin):

    def __init__(self, configuration):
        self.configuration = configuration
        Plugin.__init__(self)

    def begin(self):
        #Called before any test is run (it's always called, with multiprocess or not)
        self.start_time = time.time()
        self.coverage_files, self.coverage = StartCoverageSupport(self.configuration)

    def finalize(self, result):
        #Called after all tests are run (it's always called, with multiprocess or not)
        self.coverage.stop()
        self.coverage.save()

        pydev_runfiles_xml_rpc.notifyTestRunFinished('Finished in: %.2f secs.' % (time.time() - self.start_time,))

    #===================================================================================================================
    # Methods below are not called with multiprocess (so, we monkey-patch MultiProcessTestRunner.consolidate
    # so that they're called, but unfortunately we loose some info -- i.e.: the time for each test in this
    # process).
    #===================================================================================================================

    def reportCond(self, cond, test, captured_output, error=''):
        '''
        @param cond: fail, error, ok
        '''

        #test.address() is something as:
        #('D:\\workspaces\\temp\\test_workspace\\pytesting1\\src\\mod1\\hello.py', 'mod1.hello', 'TestCase.testMet1')
        #
        #and we must pass: location, test
        #    E.g.: ['D:\\src\\mod1\\hello.py', 'TestCase.testMet1']
        try:
            if hasattr(test, 'address'):
                address = test.address()
                address = address[0], address[2]
            else:
                #multiprocess
                try:
                    address = test[0], test[1]
                except TypeError:
                    #It may be an error at setup, in which case it's not really a test, but a Context object.
                    f = test.context.__file__
                    if f.endswith('.pyc'):
                        f = f[:-1]
                    address = f, '?'
        except:
            sys.stderr.write("PyDev: Internal pydev error getting test address. Please report at the pydev bug tracker\n")
            import traceback;traceback.print_exc()
            sys.stderr.write("\n\n\n")
            address = '?', '?'

        error_contents = self.getIoFromError(error)
        try:
            time_str = '%.2f' % (time.time() - test._pydev_start_time)
        except:
            time_str = '?'

        pydev_runfiles_xml_rpc.notifyTest(cond, captured_output, error_contents, address[0], address[1], time_str)

    def startTest(self, test):
        test._pydev_start_time = time.time()
        if hasattr(test, 'address'):
            address = test.address()
            file, test = address[0], address[2]
        else:
            #multiprocess
            file, test = test
        pydev_runfiles_xml_rpc.notifyStartTest(file, test)

    def getIoFromError(self, err):
        if type(err) == type(()):
            if len(err) != 3:
                if len(err) == 2:
                    return err[1] #multiprocess
            try:
                from StringIO import StringIO
            except:
                from io import StringIO
            s = StringIO()
            etype, value, tb = err
            import traceback;traceback.print_exception(etype, value, tb, file=s)
            return s.getvalue()
        return err

    def getCapturedOutput(self, test):
        if test.capturedOutput:
            return test.capturedOutput
        return ''

    def addError(self, test, err):
        self.reportCond(
            'error',
            test,
            self.getCapturedOutput(test),
            err,
        )

    def addFailure(self, test, err):
        self.reportCond(
            'fail',
            test,
            self.getCapturedOutput(test),
            err,
        )

    def addSuccess(self, test):
        self.reportCond(
            'ok',
            test,
            self.getCapturedOutput(test),
            '',
        )

PYDEV_NOSE_PLUGIN_SINGLETON = None
def StartPydevNosePluginSingleton(configuration):
    global PYDEV_NOSE_PLUGIN_SINGLETON
    PYDEV_NOSE_PLUGIN_SINGLETON = PydevPlugin(configuration)
    return PYDEV_NOSE_PLUGIN_SINGLETON

original = MultiProcessTestRunner.consolidate
#=======================================================================================================================
# NewConsolidate
#=======================================================================================================================
def NewConsolidate(self, result, batch_result):
    '''
    Used so that it can work with the multiprocess plugin.
    Monkeypatched because nose seems a bit unsupported at this time (ideally
    the plugin would have this support by default).
    '''
    ret = original(self, result, batch_result)

    parent_frame = sys._getframe().f_back
    #addr is something as D:\pytesting1\src\mod1\hello.py:TestCase.testMet4
    #so, convert it to what reportCond expects
    addr = parent_frame.f_locals['addr']
    i = addr.rindex(':')
    addr = [addr[:i], addr[i+1:]]

    output, testsRun, failures, errors, errorClasses = batch_result
    if failures or errors:
        for failure in failures:
            PYDEV_NOSE_PLUGIN_SINGLETON.reportCond('fail', addr, output, failure)

        for error in errors:
            PYDEV_NOSE_PLUGIN_SINGLETON.reportCond('error', addr, output, error)
    else:
        PYDEV_NOSE_PLUGIN_SINGLETON.reportCond('ok', addr, output)

    return ret

MultiProcessTestRunner.consolidate = NewConsolidate


text:
import React from 'react/addons';
import Game from 'components/game/Game';
import Score from 'components/score/Score';

import styles from './SnakeApp.scss';

class SnakeApp extends React.Component {
    render() {
        return (

                    <Score />
                    <Game />

        );
    }
}

SnakeApp.defaultProps = {
};

export default SnakeApp;


text:
#pragma once

#include "InternalEvents.h"

using namespace SEGSEvents;

uint64_t get_session_token(Event* ev);
uint64_t get_session_token(InternalEvent* ev);


text:
///////////////////////////////////////////////////////////////////////////////
//
// This file is part of ntfslinkutils.
//
// Copyright (c) 2014, Jean-Philippe Steinmetz
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice, this
//   list of conditions and the following disclaimer.
//
// * Redistributions in binary form must reproduce the above copyright notice,
//   this list of conditions and the following disclaimer in the documentation
//   and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
///////////////////////////////////////////////////////////////////////////////

#include "stdafx.h"

#include <Junction.h>
#include <memory.h>
#include <Symlink.h>
#include <strsafe.h>

#include "DataTypes.h"
#include "StringUtils.h"

using namespace libntfslinks;

mvlinkOptions Options;
mvlinkStats Stats;

/**
 * Prints a friendly message based on the given error code.
 */
void PrintErrorMessage(DWORD ErrorCode, LPCTSTR Path)
{
	switch (ErrorCode)
	{
	case ERROR_FILE_NOT_FOUND: _tprintf(TEXT("File not found: %s.\n"), Path); break;
	case ERROR_PATH_NOT_FOUND: _tprintf(TEXT("Path not found: %s.\n"), Path); break;
	case ERROR_ACCESS_DENIED: _tprintf(TEXT("Access denied: %s.\n"), Path); break;
	}
}

/**
 * Moves all reparse points in the specified source path to a given destination and rebases the target of each based on
 * the options set (when applicable).
 *
 * @param Src The path of the source file to move.
 * @param Dest The path of the destination to move Src to.
 * @param CurDepth The current level that has been traversed in the filesystem tree.
 * @return Returns zero if the operation was successful, otherwise a non-zero value on failure.
 */
DWORD mvlink(LPCTSTR Src, LPCTSTR Dest, int CurDepth = 0)
{
	DWORD result = 0;

	// If applicable, do not go further than the specified maximum depth
	if (Options.MaxDepth >= 0 && CurDepth > Options.MaxDepth)
	{
		return result;
	}

	// Expand the source to a full path
	TCHAR SrcPath[MAX_PATH] = {0};
	if (GetFullPathName(Src, MAX_PATH, SrcPath, NULL) == 0)
	{
		Stats.NumFailed++;
		_tprintf(TEXT("Invalid source path specified.\n"));
		return 1;
	}

	// Expand the destination to a full path
	TCHAR DestPath[MAX_PATH] = {0};
	if (GetFullPathName(Dest, MAX_PATH, DestPath, NULL) == 0)
	{
		Stats.NumFailed++;
		_tprintf(TEXT("Invalid destination path specified.\n"));
		return 1;
	}

	// Retrieve the file attributes of SrcPath
	WIN32_FILE_ATTRIBUTE_DATA srcAttributeData = {0};
	if (GetFileAttributesEx(SrcPath, GetFileExInfoStandard, &srcAttributeData))
	{
		// Reparse points must be processed first as they can also be considered a directory.
		if ((srcAttributeData.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) != 0)
		{
			// Check if the destination already exists
			WIN32_FILE_ATTRIBUTE_DATA destAttributeData = {0};
			if (GetFileAttributesEx(DestPath, GetFileExInfoStandard, &destAttributeData))
			{
				// Ask permission to delete the destination
				// TODO

				// Delete the existing reparse point destinations
				if ((destAttributeData.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) != 0)
				{
					if (IsJunction(DestPath))
					{
						result = DeleteJunction(DestPath);
					}
					else if (IsSymlink(DestPath))
					{
						result = DeleteSymlink(DestPath);
					}
				}
			}

			// Was there a failure deleting the existing destination?
			if (result == 0)
			{
				// Is this a junction or a symlink?
				if (IsJunction(SrcPath))
				{
					// Retrieve the existing target
					TCHAR Target[MAX_PATH] = {0};
					result = GetJunctionTarget(SrcPath, Target, sizeof(Target));
					if (result == 0)
					{
						// If specified, rebase the target to the new root
						if (Options.NewTargetBase[0] != 0 && Options.OldTargetBase[0] != 0)
						{
							TCHAR NewTarget[MAX_PATH] = {0};
							StrReplace(Target, Options.OldTargetBase, Options.NewTargetBase, NewTarget, -1, -1);

							// Create the junction at the destination
							result = CreateJunction(DestPath, NewTarget);
							if (result == 0 && Options.bVerbose)
							{
								_tprintf(TEXT("junction created for %s <<===>> %s\n"), DestPath, NewTarget);
							}
						}
						// Otherwise create a junction to the existing target at the destination
						else
						{
							result = CreateJunction(DestPath, Target);
							if (result == 0 && Options.bVerbose)
							{
								_tprintf(TEXT("junction created for %s <<===>> %s\n"), DestPath, Target);
							}
						}

						// Was the junction created successfully?
						if (result == 0)
						{
							Stats.NumMoved++;

							// Remove the original
							result = DeleteJunction(SrcPath);
						}
					}
				}
				else if (IsSymlink(SrcPath))
				{
					// Retrieve the existing target
					TCHAR Target[MAX_PATH] = {0};
					result = GetSymlinkTarget(SrcPath, Target, sizeof(Target));
					if (result == 0)
					{
						// If specified, rebase the target to the new root
						if (Options.NewTargetBase[0] != 0 && Options.OldTargetBase[0] != 0)
						{
							TCHAR NewTarget[MAX_PATH] = {0};
							StrReplace(Target, Options.OldTargetBase, Options.NewTargetBase, NewTarget, -1, -1);

							// Create the symlink at the destination
							result = CreateSymlink(DestPath, NewTarget);
							if (result == 0 && Options.bVerbose)
							{
								_tprintf(TEXT("symbolic link created for %s <<===>> %s\n"), DestPath, NewTarget);
							}
						}
						// Otherwise create a symlink to the existing target at the destination
						else
						{
							result = CreateSymlink(DestPath, Target);
							if (result == 0 && Options.bVerbose)
							{
								_tprintf(TEXT("symbolic link created for %s <<===>> %s\n"), DestPath, Target);
							}
						}

						// Was the symlink created successfully?
						if (result == 0)
						{
							Stats.NumMoved++;

							// Remove the original
							result = DeleteSymlink(SrcPath);
						}
					}
				}
				else
				{
					result = GetLastError();
					if (result == 0)
					{
						_tprintf(TEXT("Unrecognized reparse point: %s\n"), SrcPath);
						Stats.NumSkipped++;
					}
				}
			}
		}
		else if ((srcAttributeData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0)
		{
			// Make sure the the destination directory exists. If not create it.
			WIN32_FILE_ATTRIBUTE_DATA destAttributeData = {0};
			if (GetFileAttributesEx(DestPath, GetFileExInfoStandard, &destAttributeData))
			{
				if ((destAttributeData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0)
				{
					// TODO Copy security descriptor?
					if (!CreateDirectoryEx(SrcPath, DestPath, NULL))
					{
						// Failed to create the destination directory. Already exists?
						// TODO
					}
				}
			}

			WIN32_FIND_DATA ffd;
			TCHAR szDir[MAX_PATH] = {0};
			HANDLE hFind;

			// The search path must include '\*'
			StringCchCopy(szDir, sizeof(szDir), SrcPath);
			StringCchCat(szDir, sizeof(szDir), TEXT("\\*"));

			// Iterate through the list of files in the directory and mvlink each one. This will be done in two passes,
			// the first pass will move all regular files and directories. The second pass will move all reparse points.
			hFind = FindFirstFile(szDir, &ffd);
			if (hFind != INVALID_HANDLE_VALUE)
			{
				do
				{
					// Ignore the '.' and '..' entries
					size_t fileNameLength;
					if (FAILED(StringCchLength(ffd.cFileName, MAX_PATH, &fileNameLength)) || fileNameLength == 0 ||
						(fileNameLength == 1 && ffd.cFileName[0] == '.') ||
						(fileNameLength == 2 && ffd.cFileName[0] == '.' && ffd.cFileName[1] == '.'))
					{
						continue;
					}

					// Ignore anything that isn't a directory or reparse point
					if ((ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0 ||
						(ffd.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) != 0)
					{
						TCHAR srcFile[MAX_PATH];
						StringCchCopy(srcFile, sizeof(srcFile), SrcPath);
						StringCchCat(srcFile, sizeof(srcFile), TEXT("\\"));
						StringCchCat(srcFile, sizeof(srcFile), ffd.cFileName);

						TCHAR destFile[MAX_PATH];
						StringCchCopy(destFile, sizeof(destFile), DestPath);
						StringCchCat(destFile, sizeof(destFile), TEXT("\\"));
						StringCchCat(destFile, sizeof(destFile), ffd.cFileName);

						result = mvlink(srcFile, destFile, CurDepth+1);
					}
				} while (FindNextFile(hFind, &ffd) != 0);

				// Close the handle for the first pass
				FindClose(hFind);
			}
			else
			{
				// If we failed to be able to read the directory listing due to a access violation count it as a skip
				// instead of a complete failure.
				if (GetLastError() == ERROR_ACCESS_DENIED)
				{
					PrintErrorMessage(GetLastError(), SrcPath);
					Stats.NumSkipped++;
				}
				else
				{
					result = GetLastError();
				}
			}
		}
	}
	else
	{
		result = GetLastError();
	}

	// Was the operation successful?
	if (result != 0)
	{
		Stats.NumFailed++;
		PrintErrorMessage(result, SrcPath);
	}

	return result;
}

void PrintUsage()
{
	_tprintf(TEXT("Moves all symbolic links and junctions from one path to another.\n\n"));
	_tprintf(TEXT("Usage: mvlink [/V] [/LEV:n] [/R <find> <replace>] <source> <destination>\n\n"));
	_tprintf(TEXT("Options:\n"));
	_tprintf(TEXT("\t\t/LEV:n\t\tOnly move the top n levels of the source directory tree.\n"));
	_tprintf(TEXT("\t\t/R <old> <new>\tModifies the target path of all links, replacing the last occurrence of <old> with <new>.\n"));
	_tprintf(TEXT("\t\t/V\t\tEnable verbose output and display more information.\n"));
	_tprintf(TEXT("\t\t/VER\t\tDisplay the version and copyright information.\n"));
	_tprintf(TEXT("\t\t/?\t\tView this list of options.\n"));
}

void PrintVersion()
{
	_tprintf(TEXT("Copyright (C) 2014, Jean-Philippe Steinmetz. All rights reserved.\n"));
	_tprintf(TEXT("\n"));
	_tprintf(TEXT("Redistribution and use in source and binary forms, with or without\n"));
	_tprintf(TEXT("modification, are permitted provided that the following conditions are met:\n"));
	_tprintf(TEXT("\n"));
	_tprintf(TEXT("* Redistributions of source code must retain the above copyright notice, this\n"));
	_tprintf(TEXT("  list of conditions and the following disclaimer.\n"));
	_tprintf(TEXT("\n"));
	_tprintf(TEXT("* Redistributions in binary form must reproduce the above copyright notice,\n"));
	_tprintf(TEXT("  this list of conditions and the following disclaimer in the documentation\n"));
	_tprintf(TEXT("  and/or other materials provided with the distribution.\n"));
	_tprintf(TEXT("\n"));
	_tprintf(TEXT("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n"));
	_tprintf(TEXT("AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n"));
	_tprintf(TEXT("IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n"));
	_tprintf(TEXT("DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n"));
	_tprintf(TEXT("FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n"));
	_tprintf(TEXT("DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n"));
	_tprintf(TEXT("SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n"));
	_tprintf(TEXT("CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n"));
	_tprintf(TEXT("OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n"));
	_tprintf(TEXT("OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"));
}

int _tmain(int argc, TCHAR* argv[])
{
	DWORD result;
	int requiredArgs = 3;

	// Parse the command line arguments
	TCHAR Value[1024];
	for (int i = 1; i < argc; i++)
	{
		if (StrFind(argv[i], TEXT("/VER")) >= 0 || StrFind(argv[i], TEXT("/ver")) >= 0)
		{
			PrintVersion();
			return 0;
		}
		else if (StrFind(argv[i], TEXT("/?")) >= 0)
		{
			PrintUsage();
			return 0;
		}
		else if (StrFind(argv[i], TEXT("/LEV")) >= 0 || StrFind(argv[i], TEXT("/lev")) >= 0)
		{
			memset(Value, 0, sizeof(Value));
			StringCchCopy(Value, sizeof(Value), &argv[i][5]);
			Options.MaxDepth = _ttoi(Value);
		}
		else if (StrFind(argv[i], TEXT("/R")) >= 0 || StrFind(argv[i], TEXT("/r")) >= 0)
		{
			requiredArgs += 3;
			if (argc < requiredArgs || argv[i+1][0] == '/' || argv[i+2][0] == '/')
			{
				_tprintf(TEXT("Error: Invalid argument(s).\n"));
				PrintUsage();
				return 1;
			}

			StringCchCopy(Options.OldTargetBase, sizeof(Options.OldTargetBase), argv[i+1]);
			StringCchCopy(Options.NewTargetBase, sizeof(Options.NewTargetBase), argv[i+2]);
		}
		else if (StrFind(argv[i], TEXT("/V")) >= 0 || StrFind(argv[i], TEXT("/v")) >= 0)
		{
			Options.bVerbose = true;
		}
	}

	// Check the minimum required arguments
	if (argc < requiredArgs)
	{
		_tprintf(TEXT("Error: Missing argument(s).\n"));
		PrintUsage();
		return 1;
	}

	// Execute mvlink
	result = mvlink(argv[argc-2], argv[argc-1]);

	// Print the execution statistics
	_tprintf(TEXT("Moved: %d\n"), Stats.NumMoved);
	_tprintf(TEXT("Skipped: %d\n"), Stats.NumSkipped);
	_tprintf(TEXT("Failed: %d\n"), Stats.NumFailed);

	// Make sure that if there were errors it is reflected in the result
	if (result == 0 && Stats.NumFailed > 0)
	{
		result = 1;
	}

	return result;
}


text:
CUT_NS_BEGIN

#define AFTER_ALL_OBJECT(object) UNCONDITIONAL_HOOK(object, AfterAllHook)

///////////////////////////////////////////////////////////////
#define AFTER_ALL() AFTER_ALL_OBJECT(HOOK_NAME)

CUT_NS_END

#endif


text:
<?xml version="1.0" encoding="UTF-8"?>
<blueprint default-activation="eager"
           xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
           xmlns:jpa="http://aries.apache.org/xmlns/jpa/v1.0.0"
           xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0"
           xmlns:authz="http://aries.apache.org/xmlns/authorization/v1.0.0"
>

  <!-- ***************************************************************** -->
  <authz:enable />
  <!-- ***************************************************************** -->

  <!-- ***************************************************************** -->
  <bean id="daoManagerPeer" init-method="init" class="io.subutai.common.dao.DaoManager" scope="prototype">
    <jpa:unit unitname="localPeerPUnit" property="entityManagerFactory" />
  </bean>
  <!-- ***************************************************************** -->

  <reference id="messenger" availability="mandatory"
             interface="io.subutai.core.messenger.api.Messenger" />

  <reference id="commandExecutor" interface="io.subutai.core.executor.api.CommandExecutor" />

  <reference id="templateManager" availability="optional"
             interface="io.subutai.core.template.api.TemplateManager" />

  <reference id="hostRegistry" interface="io.subutai.core.hostregistry.api.HostRegistry" />

  <reference id="monitor" availability="optional"
             interface="io.subutai.core.metric.api.Monitor" />

  <reference id="identityManager" availability="mandatory"
             interface="io.subutai.core.identity.api.IdentityManager" />

  <reference id="relationManager"
             interface="io.subutai.common.security.relation.RelationManager" />

  <reference id="securityManager" availability="mandatory"
             interface="io.subutai.core.security.api.SecurityManager" />

  <reference id="healthService" availability="mandatory"
             interface="io.subutai.health.HealthService" />

  <bean id="localPeer" class="io.subutai.core.localpeer.impl.LocalPeerImpl" init-method="init"
        destroy-method="dispose" scope="singleton" activation="eager">
    <argument ref="daoManagerPeer" />
    <argument ref="templateManager" />
    <argument ref="commandExecutor" />
    <argument ref="hostRegistry" />
    <argument ref="monitor" />
    <argument ref="securityManager" />
    <argument ref="healthService" />
    <property name="identityManager" ref="identityManager" />
    <property name="relationManager" ref="relationManager" />
  </bean>

  <bean id="messageRequestListener" class="io.subutai.core.localpeer.impl.request.MessageRequestListener"
        destroy-method="dispose" scope="singleton" activation="eager">
    <argument ref="localPeer" />
    <argument ref="messenger" />
  </bean>

  <reference-list id="peerMsgLstnr"
                  interface="io.subutai.common.peer.RequestListener"
                  availability="optional" ext:proxy-method="classes">
    <reference-listener ref="localPeer"
                        bind-method="addRequestListener" unbind-method="removeRequestListener" />
  </reference-list>

  <service ref="localPeer" interface="io.subutai.core.hostregistry.api.HostListener" />

  <service ref="localPeer" interface="io.subutai.common.peer.LocalPeer" />

  <service ref="messageRequestListener" interface="io.subutai.core.messenger.api.MessageListener" />

  <reference-list id="peerLstnr"
                  interface="io.subutai.common.peer.LocalPeerEventListener"
                  availability="optional">
    <reference-listener ref="localPeer"
                        bind-method="addListener" unbind-method="removeListener" />
  </reference-list>

</blueprint>


text:
package com.efinkg.alfred;

import android.content.Context;
import android.os.Handler;
import android.os.SystemClock;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.FrameLayout;
import android.widget.TextView;

import java.lang.Long;
import java.util.concurrent.TimeUnit;

/**
 * Animated countdown going from {@code mTimeSeconds} to 0.
 *
 * The current animation for each second is as follow: 1. From 0 to 500ms, move
 * the TextView from {@code MAX_TRANSLATION_Y} to 0 and its alpha from {@code 0}
 * to {@code ALPHA_DELIMITER}. 2. From 500ms to 1000ms, update the TextView's
 * alpha from {@code ALPHA_DELIMITER} to {@code 1}. At each second change,
 * update the TextView text.
 */
public class CountDownView extends FrameLayout {
	private static final String TAG = "CountDownView";

	/**
	 * Interface to listen for changes in the countdown.
	 */
	public interface CountDownListener {
		/**
		 * Notified of a tick, indicating a layout change.
		 */
		public void onTick(long millisUntilFinish);

		/**
		 * Notified when the countdown is finished.
		 */
		public void onFinish();
	}

	/** Time delimiter specifying when the second component is fully shown. */
	public static final float ANIMATION_DURATION_IN_MILLIS = 850.0f;

	// About 24 FPS.
	private static final long DELAY_MILLIS = 41;
	private static final int MAX_TRANSLATION_Y = 30;
	private static final float ALPHA_DELIMITER = 0.95f;
	private static final long SEC_TO_MILLIS = TimeUnit.SECONDS.toMillis(1);

	private final TextView mSecondsView;

	private long mTimeSeconds;
	private long mStopTimeInFuture;
	private CountDownListener mListener;
	private boolean mStarted;

	public CountDownView(Context context) {
		this(context, null, 0);
	}

	public CountDownView(Context context, AttributeSet attrs) {
		this(context, attrs, 0);
	}

	public CountDownView(Context context, AttributeSet attrs, int style) {
		super(context, attrs, style);
		LayoutInflater.from(context).inflate(R.layout.card_countdown, this);

		mSecondsView = (TextView) findViewById(R.id.seconds_view);
	}

	public void setCountDown(long timeSeconds) {
		mTimeSeconds = timeSeconds;
	}

	public long getCountDown() {
		return mTimeSeconds;
	}

	/**
	 * Set a {@link CountDownListener}.
	 */
	public void setListener(CountDownListener listener) {
		mListener = listener;
	}

	private final Handler mHandler = new Handler();

	private final Runnable mUpdateViewRunnable = new Runnable() {
		@Override
		public void run() {
			final long millisLeft = mStopTimeInFuture
					- SystemClock.elapsedRealtime();

			// Count down is done.
			if (millisLeft <= 0) {
				mStarted = false;
				if (mListener != null) {
					mListener.onFinish();
				}
			} else {
				updateView(millisLeft);
				if (mListener != null) {
					mListener.onTick(millisLeft);
				}
				mHandler.postDelayed(mUpdateViewRunnable, DELAY_MILLIS);
			}
		}
	};

	/**
	 * Starts the countdown animation if not yet started.
	 */
	public void start() {
		if (!mStarted) {
			mStopTimeInFuture = TimeUnit.SECONDS.toMillis(mTimeSeconds)
					+ SystemClock.elapsedRealtime();
			mStarted = true;
			mHandler.postDelayed(mUpdateViewRunnable, DELAY_MILLIS);
		}
	}

	/**
	 * Updates the views to reflect the current state of animation.
	 *
	 * @params millisUntilFinish milliseconds until the countdown is done
	 */
	private void updateView(long millisUntilFinish) {
		long currentTimeSeconds = TimeUnit.MILLISECONDS
				.toSeconds(millisUntilFinish) + 1;
		long frame = SEC_TO_MILLIS - (millisUntilFinish % SEC_TO_MILLIS);

		mSecondsView.setText(Long.toString(currentTimeSeconds));
		if (frame <= ANIMATION_DURATION_IN_MILLIS) {
			float factor = frame / ANIMATION_DURATION_IN_MILLIS;
			mSecondsView.setAlpha(factor * ALPHA_DELIMITER);
			mSecondsView.setTranslationY(MAX_TRANSLATION_Y * (1 - factor));
		} else {
			float factor = (frame - ANIMATION_DURATION_IN_MILLIS)
					/ ANIMATION_DURATION_IN_MILLIS;
			mSecondsView.setAlpha(ALPHA_DELIMITER + factor
					* (1 - ALPHA_DELIMITER));
		}
	}

}


text:
<?php

namespace Provider;

use Pimple\ServiceProviderInterface;
use Pimple\Container;
use Eole\Sandstone\Websocket\ServiceProvider as WebsocketServiceProvider;

class WebsocketServerProvider implements ServiceProviderInterface
{
    /**
     * {@InheritDoc}
     */
    public function register(Container $app)
    {
        // Register and configure your websocket server
        $app->register(new WebsocketServiceProvider(), [
            'sandstone.websocket.server' => $app['environment']['websocket']['server'],
        ]);
    }
}


text:
@implementation UIView (AccessViewController)
- (UIViewController *)viewController;
{
    id nextResponder = [self nextResponder];
    if ([nextResponder isKindOfClass:[UIViewController class]]) {
        return nextResponder;
    } else {
        return nil;
    }
}
- (UIViewController *)firstAvailableUIViewController {
    // convenience function for casting and to "mask" the recursive function
    return (UIViewController *)[self traverseResponderChainForUIViewController];
}

- (id)traverseResponderChainForUIViewController {
    id nextResponder = [self nextResponder];
    if ([nextResponder isKindOfClass:[UIViewController class]]) {
        return nextResponder;
    } else if ([nextResponder isKindOfClass:[UIView class]]) {
        return [nextResponder traverseResponderChainForUIViewController];
    } else {
        return nil;
    }
}
@end


text:
import logging.config
from .config_logging import config_logging_dict

logging.config.dictConfig(config_logging_dict)
logger = logging.getLogger('slack_logging_sample')

def same_notset():
	logger.log(logging.NOTSET, "同レベルのノットセット")
	return

def same_debug():
	logger.debug("同レベルのデバッグ")
	return

def same_info():
	logger.info("同レベルのインフォ")
	return

def same_warning():
	logger.warning("同レベルのワーニング")
	return

def same_error():
	logger.error("同レベルのエラー")
	return

def same_critical():
	logger.critical("同レベルのクリティカル")
	return


text:
/* global PDFJS, URL */

'use strict';

(function(window, undefined) {
  var Reader = function(el) {
    this.element = el;
    this.reader = Polymer.dom(el.root).querySelector('.pdf-viewer');
    this.viewportOut = Polymer.dom(el.root).querySelector('.pdf-viewport-out');
    this.toolbar = Polymer.dom(el.root).querySelector('.pdf-toolbar');
    this.toolbarHeight = 0;
    this.title = Polymer.dom(el.root).querySelector('.title');
    this.enableTextSelection = el.enableTextSelection;
    this.fitWidth = el.fitWidth;
    this.HEIGHT = el.getAttribute('height');

    this.viewport = Polymer.dom(el.root).querySelector('.pdf-viewport');

    if (this.enableTextSelection){
      this.textLayerDiv = Polymer.dom(el.root).querySelector(".textLayer");
      this.textLayerDivStyle = this.textLayerDiv.style;
    }

    this.spinner = Polymer.dom(el.root).querySelector(".spinner");
    this.totalPages = Polymer.dom(el.root).querySelector('#totalPages');

    this.viewportStyle = this.viewport.style;
    this.viewportOutStyle = this.viewportOut.style;

    this.ctx = this.viewport.getContext('2d');

    this.SRC = el.src;

    // this.loadPDF();
    // this.renderPages();
    this.pageRendering = false;
    this.pageNumPending = null;

  };

  Reader.prototype.setSize = function(attrName, newVal) {

    this.WIDTH = this.viewportOut.offsetWidth;
    if (!this.HEIGHT)
      this.HEIGHT = this.viewportOut.offsetHeight;

    var width = this.WIDTH,
      height = this.HEIGHT;

    if (attrName === 'width') {
      width = newVal;
    }

    if (attrName === 'height') {
      height = newVal;
    }

    // this.element.style.width = this.reader.style.width = width + 'px';
    // this.element.style.height = this.reader.style.height = height + 'px';
    // this.element.style.height = this.reader.style.height = this.HEIGHT + 64 + 'px';

    // this.viewportOutStyle.width = width + 'px';
    this.viewportOutStyle.height = height + 'px';

    this.spinner.style.top = (height - this.toolbarHeight) / 2 + 'px';
  };

  Reader.prototype.setSrc = function(src) {
    this.SRC = src;
  };

  Reader.prototype.setFitWidth = function(fitWidth) {
    this.fitWidth = fitWidth;
  };

  Reader.prototype.queueRenderPage = function(num) {
    if (this.pageRendering) {
      this.pageNumPending = num;
    } else {
      this.renderPDF(num);
    }
  };

  Reader.prototype.loadPDF = function() {
    this.setSize();
    var self = this;

    PDFJS.getDocument(this.SRC).then(function(pdf) {
      self.PDF = pdf;
      self.queueRenderPage(1);

      self.currentPage = 1;
      self.totalPages.innerHTML = self.PDF.numPages;
      self.totalPagesNum = self.PDF.numPages;
      self.currentZoomVal = self.fitZoomVal = self.widthZoomVal = 0;
      self.createDownloadLink();
    });
  };

  Reader.prototype.renderPages = function(pdf) {
    var self = this;
    self.viewportOut.innerHTML="";
    PDFJS.getDocument(this.SRC).then(function(pdf) {
      self.PDF = pdf;

      for(var num = 1; num <= self.PDF.numPages; num++){
        pdf.getPage(num).then(self.renderPDF(num, null, true));
      }

      self.currentPage = 1;
      self.totalPages.innerHTML = self.PDF.numPages;
      self.totalPagesNum = self.PDF.numPages;
      if (!self.currentZoomVal)
        self.currentZoomVal = self.fitZoomVal = self.widthZoomVal = 0;
      self.createDownloadLink();
    });
  };

  Reader.prototype.renderPDF = function(pageNum, resize, isFull) {
    var self = this;
    self.pageRendering = true;
    self.spinner.active = true;
    this.PDF.getPage(pageNum).then(function(page) {
      var scaleW, scaleH, viewerViewport, scale, radians;
      radians = page.pageInfo.rotate * Math.PI / 180;

      self.pageW = Math.abs((page.view[2]*Math.cos(radians)) + (page.view[3]*Math.sin(radians)));
      self.pageH = Math.abs((page.view[3]*Math.cos(radians)) + (page.view[2]*Math.sin(radians)));

      if (self.currentZoomVal === 0 || !!resize) {
        scaleW = Math.round((self.WIDTH / self.pageW) * 100) / 100,
          scaleH = Math.round(((self.HEIGHT - self.toolbarHeight) / self.pageH) * 100) / 100,
          scale = Math.min(scaleH, scaleW);
        self.fitZoomVal = scale;
        self.widthZoomVal = self.WIDTH / self.pageW;
        self.currentZoomVal = self.fitWidth ? self.widthZoomVal : self.fitZoomVal;
      }
      if (!!resize) {
        self.zoomPage({
          target: self.zoomLvl
        });
      } else {
        scale = self.currentZoomVal;

        viewerViewport = page.getViewport(scale);

        self.ctx.height = viewerViewport.height;
        self.ctx.width = viewerViewport.width;

        self.pageW = self.pageW * scale;
        self.pageH = self.pageH * scale;

        self.setViewportPos();

        self.viewport.width = self.pageW;
        self.viewport.height = self.pageH;
        self.viewportStyle.width = self.pageW + 'px';
        self.viewportStyle.height = self.pageH + 'px';

        if (self.enableTextSelection){
          self.textLayerDivStyle.width = self.pageW + 'px';
          self.textLayerDivStyle.height = self.pageH + 'px';
        }
        self.ctx.clearRect(0, 0, self.viewport.width, self.viewport.height);

        if (isFull){

          var wrapper = document.createElement('div');
          wrapper.setAttribute("style", "position: relative");
          var canvas = document.createElement('canvas');
          var textLayer = document.createElement('div');
          textLayer.setAttribute("style", "left: " + self.viewportStyle.left)

          textLayer.className = "textLayer";

          var ctx = canvas.getContext('2d');

          // canvas.height = viewerViewport.height;
          // canvas.width = viewerViewport.width;

          textLayer.height = viewerViewport.height;
          textLayer.width = viewerViewport.width;

          self.viewportOut.appendChild(wrapper);
          wrapper.appendChild(canvas);
          wrapper.appendChild(textLayer);

          page.render({
            canvasContext: ctx,
            viewport: viewerViewport
          });

          if (self.enableTextSelection){
            self.textLayerDiv.innerHTML="";
            page.getTextContent().then(function(textContent) {
              PDFJS.renderTextLayer({
                textContent: textContent,
                container: textLayer,
                pageIndex : pageNum,
                viewport: viewerViewport,
                textDivs: []
              });
            });
          }

        } else{

          var renderTask = page.render({
            canvasContext: self.ctx,
            viewport: viewerViewport
          });

          renderTask.promise.then(function () {
            self.pageRendering = false;
            self.spinner.active = false;
            if (self.pageNumPending !== null) {
              // New page rendering is pending
              self.renderPDF(self.pageNumPending);
              self.pageNumPending = null;
            }
          });
        }

        if (self.enableTextSelection){
          self.textLayerDiv.innerHTML="";
          page.getTextContent().then(function(textContent) {
            PDFJS.renderTextLayer({
              textContent: textContent,
              container: self.textLayerDiv,
              pageIndex : pageNum,
              viewport: viewerViewport,
              textDivs: []
            });
          });
        }
      }
    });
  };

  Reader.prototype.setViewportPos = function() {
    if (this.pageW < this.WIDTH)
      this.viewportStyle.left = (this.WIDTH - this.pageW) / 2 + 'px';
    else
      this.viewportStyle.left = 0;

    if (this.pageH < this.HEIGHT) {
      this.viewportStyle.top = (this.HEIGHT - this.pageH - this.toolbarHeight) / 2 + 'px';
      this.viewportStyle.topNum = Math.floor((this.HEIGHT - this.pageH - this.toolbarHeight) / 2) + this.toolbarHeight;
      if (this.enableTextSelection){
        this.textLayerDivStyle.topNum = Math.floor((this.HEIGHT - this.pageH - this.toolbarHeight) / 2) + this.toolbarHeight;
      }
    } else {
      this.viewportStyle.top = 0;
    }

    if (this.enableTextSelection) {
      this.textLayerDivStyle.left = this.viewportStyle.left;
      this.textLayerDivStyle.top = this.viewportStyle.top;
    }
  };

  Reader.prototype.changePDFSource = function(newSrc) {
    this.setSrc(newSrc);
    this.loadPDF();
  };

  Reader.prototype.zoomInOut = function(step) {
    // var step = 0.1;
    this.currentZoomVal = Math.round((Math.round(this.currentZoomVal * 10) / 10 + step) * 10) / 10;
    this.queueRenderPage(this.currentPage);
    // this.renderPages();
  };

  Reader.prototype.zoomIn = function() {
    var step = 0.1;
    this.currentZoomVal = Math.round((Math.round(this.currentZoomVal * 10) / 10 + step) * 10) / 10;
    this.queueRenderPage(this.currentPage);
    // this.renderPages();
  };

  Reader.prototype.zoomOut = function() {
    var step = -0.1;
    this.currentZoomVal = Math.round((Math.round(this.currentZoomVal * 10) / 10 + step) * 10) / 10;
    this.queueRenderPage(this.currentPage);
  };

  Reader.prototype.zoomPageFit = function() {
    this.currentZoomVal = this.fitZoomVal;
    this.queueRenderPage(this.currentPage);
  };

  Reader.prototype.zoomWidthFit = function() {
    this.currentZoomVal = this.widthZoomVal;
    this.queueRenderPage(this.currentPage);
  };

  Reader.prototype.getPageNum = function() {
    return this.PDF.numPages;
  };

  Reader.prototype.createDownloadLink = function() {
    var self = this;

    this.PDF.getData().then(function(data) {
      var blob = PDFJS.createBlob(data, 'application/pdf');

      self.downloadLink = URL.createObjectURL(blob);
    });
  };

  Reader.prototype.download = function(context) {
    var a = document.createElement('a'),
      filename = this.SRC.split('/');

    a.href = this.downloadLink;
    a.target = '_parent';

    if ('download' in a) {
      a.download = decodeURIComponent(filename[filename.length - 1]);
    }

    this.reader.appendChild(a);
    a.click();
    a.parentNode.removeChild(a);
  };

  window.Polymer.Reader = Reader;
})(window);


text:
/*
 *  latria_connection.c
 *  Created by Benjamin Friedman on 06/24/17.
 */

#include "latria_connection.h"

/* Connection buffer standard size */
#define LAT_CONNECTION_BUFFER_SIZE 1024

/* Buffers for communication over sockets */
char commOutBuff[LAT_CONNECTION_BUFFER_SIZE];
char commInBuff[LAT_CONNECTION_BUFFER_SIZE];

/* Writes data to an established connection */
int latriaConnection_write(int connId, char *message) {

#ifdef _WIN32
    /* Windows implementation */

    int result = 0;
    sprintf(commOutBuff, "%s", message);
    commOutBuff[strlen(message)] = '\0';
    result = send(connId, commOutBuff, strlen(commOutBuff), 0);
    if(result == SOCKET_ERROR) {

        /* Failed to send! */
        return 0;

    }

    return result;

#else
    /* linux/mac implementation */

    ssize_t result = 0;
    size_t msgLen = strlen(message);

    sprintf(commOutBuff, "%s", message);
    commOutBuff[msgLen] = '\0';

    result = write( connId, commOutBuff, msgLen);
    if(result == -1) {

        /* Error, failed to write! */
        return 0;
    }

    return (int)result;
#endif
}

/* Read data from an established connection */
void latriaConnection_read(int connId) {

    char *origData = NULL;
    char *data = NULL;

#ifdef _WIN32
    /* int for windows */
    int n;
#else
    /*  ssize_t for linux/mac */
    ssize_t n;
#endif

    while(( n = recv(connId, commInBuff, sizeof(commInBuff)-1, 0)) > 0) {

        if((size_t)n <= (size_t)sizeof(commInBuff)-1 && data == NULL) {

            /* Fits in one run, cap our end, simply set the result and leave */
            commInBuff[n] = 0;
            setSysResult(commInBuff);
            setSystemStatus(HAS_RESULT);
            return;

        } else if(data != NULL) {

            /* Append */
            commInBuff[n] = 0;
            origData = LATAlloc(origData, sizeof(char) * strlen(origData), (size_t)(n+1) + strlen(origData));
            data = strcat(data, commInBuff);

            if(n < 1024) {

                /* Done, return */
                setSysResult(origData);
                setSystemStatus(HAS_RESULT);
                LATDealloc(origData);
                return;

            }

        } else if(data == NULL) {

            /* Allocate, first run */
            data = origData = LATAlloc(NULL, 0, (size_t)(n+1));
            data = strcat(data, commInBuff);

        }
    }

    if(origData != NULL) {

        /* Indicate we have a result to return */
        setSysResult(commInBuff);
        setSystemStatus(HAS_RESULT);
        LATDealloc(origData);

    }
}

/* Closes an established connection */
void latriaConnection_close(int connId) {

#ifdef _WIN32
    /* Windows */

    int result = shutdown(connId, SD_SEND);
    if(result == SOCKET_ERROR) {

        printf("\n\nShutdown failed with err: %d\n\n", WSAGetLastError());

    }

    closesocket(connId);
    WSACleanup();

#else
    /* Mac/Linux */

    close(connId);
#endif
}