text:
title: 'Grav: A great Lightweight CMS Worth Using'
published: true
date: 01-11-2015
publish_date: '01-11-2015 00:00'
metadata:
    description: Grav, super lightweight and simple CMS perfect for small business websites, blogs and landing page building.
    keywords: Grav, CMS, Review, small, business
    author: Peter Bui
    robots: ALL
    og:
        title: Grav, super lightweight and simple CMS perfect for small business websites, blogs and landing page building.
        type: Article
        url: https://pbwebdev.com/blog/grav-a-great-lightweight-cms-worth-using
    fb:
        app_id: 749941768443494
    'twitter:card' : Grav, super lightweight and simple CMS perfect for small business websites, blogs and landing page building.
    'twitter:site' : @pbwebdev
    'twitter:title' : Grav CMS Review for Small Business
    'twitter:description' : Grav, super lightweight and simple CMS perfect for small business websites, blogs and landing page building.
cache_enable: true
visible: true
summary:
    enabled: '1'
    size: 128
    format: short
child_type: item
taxonomy:
    tag:
        - CMS
author: 'Peter Bui'
cache_enable: false
routes:
  default: /blog/grav-a-great-lightweight-cms-worth-using
  canonical: /blog/grav-a-great-lightweight-cms-worth-using
---

For the past few months we have been watching and evaluating a new flat file content management system (CMS) that shows a lot of promise called Grav for our clients that want simple business brochure style websites.

We've been eagerly waiting for more updates and releases as some of the features of the CMS are quite exciting for developers and for small business owners.

## Flat File CMS?

It's called a flat file CMS as there is no database storing all of the content of the website, and with no database there isn't a slow down in regards to queries (retrieval) to that database for information. Instead, it uses simple markdown (text files) to store all of the content of the website.

Initially built for what we believed was developers using Markdown for content publishing, Twig templating for the building of the themes and YAML for the configuration of the site and plugins, but Grav has grown up over the last few months with the introduction of its own admin interface, one that I'm currently using to publish this very blog post.

![Content publishing with Grav](grav-content-publishing.png)

The Grav Admin interface is almost stable at the time of writing this release meaning it will no longer be just a CMS for developers but all other non technical users can now start using Grav in all its glory.

![Grav CMS Admin Panel](grav-admin.png)

It's ready for developers and content writers/business owners to start using.

## Whats the Big Deal?

Yes, you may be asking yourself what's the big deal about another CMS, when there are others like Joomla!, WordPress and Drupal which are all do dominate in the market at the moment. Why wouldn't this one make a difference?

### Developer Friendly

Grav is built on modern design principles and modern development tools. Little things like being installed with Composer making really easy to manage dependencies for your projects, or integrating in third party development libraries in your project.

Use of logicless templates with Twig, and simple clean 'What You Mean Is What You Get' (WYMIWUG) editors keep clean clean code and output.

Templating and theming is also a dream with being able to work with any template framework you want. We're currently using Bootstrap3 as our base templates but you can use anything you want.

Very flexible and not being locked into any particular framework makes things quite nice.

It means you can have a great looking website from just about any designer or developer!

### Speed Optimised

It's fast! Out of the box it is fast with page speed load times for some of our websites under 0.5 seconds and a website home page footprint of less than 300kb.

![Grav speed test load size and time](grav-speed-test.png)

Speed is one of those factors for website usability and search engine optimisation. A faster loading website can lead to a better ranking website in terms of search engine results.

### Super Simple Admin Interface

Clients can simple edit their content and get blog posts online with out the worry of clutter, formatting or other things content publishers shouldn't need to worry about.

But where a site admin actually needs to do some site configuration and administration, the tools and power is all there too.

With a simple plugin manager,

![Grav plugin manager](grav-plugins.png)

and a simple theme configuation screen.

![Grav theme chooser](grav-themes.png)

## Conclusion

A lot of the time we just want to be able to build a quick simple website that advertises a business with a contact form and custom landing pages. That's it and Grav lets us do so quickly and easily with very little effort, cheap hosting and most importantly, very little maintenance afterwards.

Less maintenance means less development and more time focused on helping our clients drive traffic and build business which is the end result of all websites we build.

If you're interested in finding our more about Grav or getting your own demo site to try out, just **leave a comment** and we'll get back to you with details of your very own Grav website to try out for your business.


text:
<?xml version="1.0" standalone="no"?>
<source_library title="source library">
  <source name="HESSJ1614-518" type="DiffuseSource">
    <spectrum normPar="Integral" type="PowerLaw2">
      <parameter free="1" max="10000" min="1e-05" name="Integral" scale="1e-08" value="0.9260975894"/>
      <parameter free="1" max="0" min="-5" name="Index" scale="1" value="-1.864347299"/>
      <parameter free="0" max="200000" min="20" name="LowerLimit" scale="1" value="1000"/>
      <parameter free="0" max="1000000" min="20" name="UpperLimit" scale="1" value="100000"/>
    </spectrum>
    <spatialModel file="$(LATEXTDIR)/Templates/HESSJ1614-518.fits" map_based_integral="true" type="SpatialMap">
      <parameter free="0" max="1000" min="0.001" name="Prefactor" scale="1" value="1"/>
    </spatialModel>
  </source>
</source_library>

redpajama_set_name: RedPajamaGithub


text:
int Total(const char *context)
{
  return 22;
}


text:
require 'rbkb/cli'

# Copyright 2009 emonti at matasano.com
# See README.rdoc for license information

# len prepends a binary length number in front of its input and outputs
# raw on STDOUT
class Rbkb::Cli::Len < Rbkb::Cli::Executable

  def initialize(*args)
    # endianness pair. index 0 is always the default
    @endpair = [:big, :little]

    super(*args) do |this|
      {
        :nudge => 0,
        :size => 4,
        :endian => @endpair[0],
      }.each {|k,v| this.opts[k] ||= v}

      yield this if block_given?
    end
  end

  def make_parser()
    super()
    add_std_file_opt(:indat)
    arg = @oparse
    arg.banner += " <data | blank for stdin>"

    arg.on("-n", "--nudge INT", Numeric, "Add integer to length") do |n|
      @opts[:nudge] += n
    end

    arg.on("-s", "--size=SIZE", Numeric,
           "Size of length field in bytes") do |s|
      bail("Size must be greater than 0") unless (@opts[:size] = s) > 0
    end

    arg.on("-x", "--[no-]swap",
           "Swap endianness. Default=#{@opts[:endian]}") do |x|
      @opts[:endian] = @endpair[(x)? 1 : 0]
    end

    arg.on("-t", "--[no-]total", "Include size word in size") do |t|
      @opts[:tot]=t
    end

    arg.on("-l", "--length=LEN", Numeric,
           "Ignore all other flags and use static LEN") do |l|
      @opts[:static]=l
    end
  end

  def parse(*args)
    super(*args)
    @opts[:indat] ||= @argv.shift
    parse_catchall()
    @opts[:indat] ||= @stdin.read
  end

  def go(*args)
    super(*args)
    unless len=@opts[:static]
      len = @opts[:indat].size
      len += @opts[:size] if @opts[:tot]
      len += @opts[:nudge]
    end
    @stdout << len.to_bytes(@opts[:endian], @opts[:size]) << @opts[:indat]
    self.exit(0)
  end

end


text:
#import <Foundation/Foundation.h>
#import <CoreText/CoreText.h>
#import <UIKit/UIKit.h>

/////////////////////////////////////////////////////////////////////////////
// MARK: -
// MARK: NSAttributedString Additions
/////////////////////////////////////////////////////////////////////////////

@interface NSAttributedString (OHCommodityConstructors)
+(id)attributedStringWithString:(NSString*)string;
+(id)attributedStringWithAttributedString:(NSAttributedString*)attrStr;

//! Commodity method that call the following sizeConstrainedToSize:fitRange: method with NULL for the fitRange parameter
-(CGSize)sizeConstrainedToSize:(CGSize)maxSize;
//! if fitRange is not NULL, on return it will contain the used range that actually fits the constrained size.
//! Note: Use CGFLOAT_MAX for the CGSize's height if you don't want a constraint for the height.
-(CGSize)sizeConstrainedToSize:(CGSize)maxSize fitRange:(NSRange*)fitRange;
@end

/////////////////////////////////////////////////////////////////////////////
// MARK: -
// MARK: NSMutableAttributedString Additions
/////////////////////////////////////////////////////////////////////////////

@interface NSMutableAttributedString (OHCommodityStyleModifiers)
-(void)setFont:(UIFont*)font;
-(void)setFont:(UIFont*)font range:(NSRange)range;
-(void)setFontName:(NSString*)fontName size:(CGFloat)size;
-(void)setFontName:(NSString*)fontName size:(CGFloat)size range:(NSRange)range;
-(void)setFontFamily:(NSString*)fontFamily size:(CGFloat)size bold:(BOOL)isBold italic:(BOOL)isItalic range:(NSRange)range;

-(void)setTextColor:(UIColor*)color;
-(void)setTextColor:(UIColor*)color range:(NSRange)range;
-(void)setTextIsUnderlined:(BOOL)underlined;
-(void)setTextIsUnderlined:(BOOL)underlined range:(NSRange)range;
-(void)setTextUnderlineStyle:(int32_t)style range:(NSRange)range; //!< style is a combination of CTUnderlineStyle & CTUnderlineStyleModifiers
-(void)setTextBold:(BOOL)isBold range:(NSRange)range;

-(void)setTextAlignment:(CTTextAlignment)alignment lineBreakMode:(CTLineBreakMode)lineBreakMode;
-(void)setTextAlignment:(CTTextAlignment)alignment lineBreakMode:(CTLineBreakMode)lineBreakMode lineHeight:(CGFloat)lineHeight;
-(void)setTextAlignment:(CTTextAlignment)alignment lineBreakMode:(CTLineBreakMode)lineBreakMode range:(NSRange)range;
-(void)setTextAlignment:(CTTextAlignment)alignment lineBreakMode:(CTLineBreakMode)lineBreakMode range:(NSRange)range lineHeight:(CGFloat)lineHeight;
@end


text:
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using log4net;
using Microsoft.Extensions.Configuration;
using WeGouSharp.Core;
using WeGouSharp.Model;

namespace WeGouSharp
{
    //暴露给外部调用的服务类
    public class WeGouService
    {
        readonly WechatSogouApi _wechatSogouApi;

        private static readonly Lazy<WeGouService> Lazy = new Lazy<WeGouService>(() => new WeGouService());

        public static WeGouService Instance => Lazy.Value;

        private WeGouService()
        {
            Program.EnsureInject();
            Program.RegisterOnExit();

            var logger = ServiceProviderAccessor.ResolveService<ILog>();
            var browser = ServiceProviderAccessor.ResolveService<Browser>();
            var conf = ServiceProviderAccessor.ResolveService<IConfiguration>();

            _wechatSogouApi = new WechatSogouApi(logger, browser, conf);
        }
        // public WeGouService()
        // {
        //     Program.EnsureInject();
        //     Program.RegisterOnExit();

        //     var logger = ServiceProviderAccessor.ResolveService<ILog>();
        //     var browser = ServiceProviderAccessor.ResolveService<Browser>();
        //     var conf = ServiceProviderAccessor.ResolveService<IConfiguration>();

        //     _wechatSogouApi = new WechatSogouApi(logger, browser, conf);
        // }

        public WeGouService(ILog logger, Browser browser, IConfiguration conf)
        {
            _wechatSogouApi = new WechatSogouApi(logger, browser, conf);
        }

        #region 公众号

        //根据关键字搜索公众号
        public async Task<List<OfficialAccount>> SearchOfficialAccountAsync(string keyWord, int page = 1)
        {
            var accountList = await _wechatSogouApi.SearchOfficialAccountAsync(keyWord, page);
            return accountList;
        }

        //根据关键字搜索公众号(json)
        public async Task<string> SearchOfficialAccountSerializedAsync(string keyWord, int page = 1)
        {
            var accountList = await _wechatSogouApi.SearchOfficialAccountAsync(keyWord, page);
            return Tools.TryParseJson(accountList);
        }

        //根据公众号id查询
        public async Task<OfficialAccount> GetAccountInfoByIdAsync(string accountId)
        {
            var account = await _wechatSogouApi.GetAccountInfoByIdAsync(accountId);
            return account;
        }

         public async Task<OfficialAccount> GetAccountInfoByNameAsync(string accountName)
        {
            var account = await _wechatSogouApi.GetAccountInfoByIdAsync(accountName);
            return account;
        }

        //根据公众号id查询(json)
        public async Task<string> GetAccountInfoByIdSerializedAsync(string accountId)
        {
            var account = await _wechatSogouApi.GetAccountInfoByIdAsync(accountId);
            return Tools.TryParseJson(account);
        }

        #endregion

        #region 文章

        public async Task<string> SearchArticleAsync(string keyWord)
        {
            var article = await _wechatSogouApi.SearchArticleAsync(keyWord);
            return Tools.TryParseJson(article);
        }

        //从临时文章链接提取文章正文
        public async Task<string> ResolveArticleByUrl(string articleUrl)
        {
            var article = await _wechatSogouApi.ExtractArticleMain(articleUrl);
            return article;
        }

        //从临时文章页面的html代码中提取文章正文
        public async Task<string> ResolveArticleByHtml(string articleHtml)
        {
            var article = await _wechatSogouApi.ExtractArticleMain("", articleHtml);
            return article;
        }

        #endregion

        /// <summary>
        /// 通过账号的url链接获取信息
        /// </summary>
        /// <param name="accountPageUrl"></param>
        /// <returns></returns>
        public async Task<List<BatchMessage>> GetOfficialAccountMessagesByUrlAsync(string accountPageUrl = "")
        {
            var rs = await _wechatSogouApi.GetOfficialAccountMessagesAsync(accountPageUrl);
            return rs;
        }

        /// <summary>
        /// 通过账号的url链接获取信息(json)
        /// </summary>
        /// <param name="accountPageUrl"></param>
        /// <returns></returns>
        public async Task<string> GetOfficialAccountMessagesByUrlSerializedAsync(string accountPageUrl = "")
        {
            var rs = await _wechatSogouApi.GetOfficialAccountMessagesAsync(accountPageUrl);
            return Tools.TryParseJson(rs);
        }

        /// <summary>
        /// 通过账号的id获取信息
        /// </summary>
        /// <param name="wechatId"></param>
        /// <returns></returns>
        public async Task<List<BatchMessage>> GetOfficialAccountMessagesByIdAsync(string wechatId = "")
        {
            var rs = await _wechatSogouApi.GetOfficialAccountMessagesAsync("", wechatId);
            return rs;
        }

        /// <summary>
        /// 通过账号的id获取信息(json)
        /// </summary>
        /// <param name="wechatId"></param>
        /// <returns></returns>
        public async Task<string> GetOfficialAccountMessagesByIdSerializedAsync(string wechatId = "")
        {
            var rs = await _wechatSogouApi.GetOfficialAccountMessagesAsync("", wechatId);
            return Tools.TryParseJson(rs);
        }

        /// <summary>
        /// 通过账号的名称获取信息
        /// </summary>
        /// <param name="accountName"></param>
        /// <returns></returns>
        public async Task<string> GetOfficialAccountMessagesByNameAsync(string accountName)
        {
            var rs = await _wechatSogouApi.GetOfficialAccountMessagesAsync("", "", accountName);
            return Tools.TryParseJson(rs);
        }

        /// <summary>
        /// 通过账号的名称获取信息(json)
        /// </summary>
        /// <param name="accountName"></param>
        /// <returns></returns>
        public async Task<string> GetOfficialAccountMessagesByNameSerializedAsync(string accountName)
        {
            var rs = await _wechatSogouApi.GetOfficialAccountMessagesAsync("", "", accountName);
            return Tools.TryParseJson(rs);
        }

        //获取联想词汇
        public async Task<string[]> GetSuggestKeyWordsAsync(string inputKeyWord)
        {
            var rs = await _wechatSogouApi.GetSuggestKeyWordsAsync(inputKeyWord);
            return rs;
        }

        //获取联想词汇
        public async Task<string> GetSuggestKeyWordsSerializedAsync(string inputKeyWord)
        {
            var rs = await _wechatSogouApi.GetSuggestKeyWordsAsync(inputKeyWord);
            return Tools.TryParseJson(rs);
        }

        //获取首页热搜词汇
        public async Task<List<HotWord>> GetTopWordsAsync()
        {
            var words = await _wechatSogouApi.GetTopWordsAsync();
            return words;
        }

        //获取首页热搜词汇
        public string GetTopWordsSerialized()
        {
            var words = _wechatSogouApi.GetTopWordsAsync();
            return Tools.TryParseJson(words);
        }

        public async Task<List<Article>> GetArticleByCategoryIndex(int categoryIndex, int page)
        {
            var rs = await _wechatSogouApi.GetArticleByCategoryIndex(categoryIndex, page);
            return rs;
        }

        public async Task<string> GetArticleByCategoryIndexSerialized(int categoryIndex, int page)
        {
            var rs = await _wechatSogouApi.GetArticleByCategoryIndex(categoryIndex, page);
            return Tools.TryParseJson(rs);
        }

        public async Task<List<Article>> GetAllRecentArticleAsync(uint maxPage)
        {
            var articles = await _wechatSogouApi.GetAllRecentArticleAsync((int) maxPage);
            return articles;
        }

        public async Task<string> GetAllRecentArticleSerializedAsync(uint maxPage)
        {
            var articles = await _wechatSogouApi.GetAllRecentArticleAsync((int) maxPage);
            return Tools.TryParseJson(articles);
        }

        //add more
    }
}


text:
/**CFile****************************************************************

  FileName    [aigMem.c]

  SystemName  [ABC: Logic synthesis and verification system.]

  PackageName [AIG package.]

  Synopsis    [Memory managers.]

  Author      [Alan Mishchenko]

  Affiliation [UC Berkeley]

  Date        [Ver. 1.0. Started - April 28, 2007.]

  Revision    [$Id: aigMem.c,v 1.00 2007/04/28 00:00:00 alanmi Exp $]

***********************************************************************/

#include "aig.h"

////////////////////////////////////////////////////////////////////////
///                        DECLARATIONS                              ///
////////////////////////////////////////////////////////////////////////

struct Aig_MmFixed_t_
{
    // information about individual entries
    int           nEntrySize;    // the size of one entry
    int           nEntriesAlloc; // the total number of entries allocated
    int           nEntriesUsed;  // the number of entries in use
    int           nEntriesMax;   // the max number of entries in use
    char *        pEntriesFree;  // the linked list of free entries

    // this is where the memory is stored
    int           nChunkSize;    // the size of one chunk
    int           nChunksAlloc;  // the maximum number of memory chunks
    int           nChunks;       // the current number of memory chunks
    char **       pChunks;       // the allocated memory

    // statistics
    int           nMemoryUsed;   // memory used in the allocated entries
    int           nMemoryAlloc;  // memory allocated
};

struct Aig_MmFlex_t_
{
    // information about individual entries
    int           nEntriesUsed;  // the number of entries allocated
    char *        pCurrent;      // the current pointer to free memory
    char *        pEnd;          // the first entry outside the free memory

    // this is where the memory is stored
    int           nChunkSize;    // the size of one chunk
    int           nChunksAlloc;  // the maximum number of memory chunks
    int           nChunks;       // the current number of memory chunks
    char **       pChunks;       // the allocated memory

    // statistics
    int           nMemoryUsed;   // memory used in the allocated entries
    int           nMemoryAlloc;  // memory allocated
};

struct Aig_MmStep_t_
{
    int             nMems;    // the number of fixed memory managers employed
    Aig_MmFixed_t **  pMems;    // memory managers: 2^1 words, 2^2 words, etc
    int             nMapSize; // the size of the memory array
    Aig_MmFixed_t **  pMap;     // maps the number of bytes into its memory manager
};

#define ALLOC(type, num)	 ((type *) malloc(sizeof(type) * (num)))
#define FREE(obj)		     ((obj) ? (free((char *) (obj)), (obj) = 0) : 0)
#define REALLOC(type, obj, num)	\
        ((obj) ? ((type *) realloc((char *)(obj), sizeof(type) * (num))) : \
	     ((type *) malloc(sizeof(type) * (num))))

////////////////////////////////////////////////////////////////////////
///                     FUNCTION DEFINITIONS                         ///
////////////////////////////////////////////////////////////////////////

/**Function*************************************************************

  Synopsis    [Allocates memory pieces of fixed size.]

  Description [The size of the chunk is computed as the minimum of
  1024 entries and 64K. Can only work with entry size at least 4 byte long.]

  SideEffects []

  SeeAlso     []

***********************************************************************/
Aig_MmFixed_t * Aig_MmFixedStart( int nEntrySize, int nEntriesMax )
{
    Aig_MmFixed_t * p;

    p = ALLOC( Aig_MmFixed_t, 1 );
    memset( p, 0, sizeof(Aig_MmFixed_t) );

    p->nEntrySize    = nEntrySize;
    p->nEntriesAlloc = 0;
    p->nEntriesUsed  = 0;
    p->pEntriesFree  = NULL;

    p->nChunkSize = nEntriesMax / 8;
    if ( p->nChunkSize < 8 )
        p->nChunkSize = 8;

    p->nChunksAlloc  = 64;
    p->nChunks       = 0;
    p->pChunks       = ALLOC( char *, p->nChunksAlloc );

    p->nMemoryUsed   = 0;
    p->nMemoryAlloc  = 0;
    return p;
}

/**Function*************************************************************

  Synopsis    []

  Description []

  SideEffects []

  SeeAlso     []

***********************************************************************/
void Aig_MmFixedStop( Aig_MmFixed_t * p, int fVerbose )
{
    int i;
    if ( p == NULL )
        return;
    if ( fVerbose )
    {
        printf( "Fixed memory manager: Entry = %5d. Chunk = %5d. Chunks used = %5d.\n",
            p->nEntrySize, p->nChunkSize, p->nChunks );
        printf( "   Entries used = %8d. Entries peak = %8d. Memory used = %8d. Memory alloc = %8d.\n",
            p->nEntriesUsed, p->nEntriesMax, p->nEntrySize * p->nEntriesUsed, p->nMemoryAlloc );
    }
    for ( i = 0; i < p->nChunks; i++ )
        free( p->pChunks[i] );
    free( p->pChunks );
    free( p );
}

/**Function*************************************************************

  Synopsis    []

  Description []

  SideEffects []

  SeeAlso     []

***********************************************************************/
char * Aig_MmFixedEntryFetch( Aig_MmFixed_t * p )
{
    char * pTemp;
    int i;

    // check if there are still free entries
    if ( p->nEntriesUsed == p->nEntriesAlloc )
    { // need to allocate more entries
        assert( p->pEntriesFree == NULL );
        if ( p->nChunks == p->nChunksAlloc )
        {
            p->nChunksAlloc *= 2;
            p->pChunks = REALLOC( char *, p->pChunks, p->nChunksAlloc );
        }
        p->pEntriesFree = ALLOC( char, p->nEntrySize * p->nChunkSize );
        p->nMemoryAlloc += p->nEntrySize * p->nChunkSize;
        // transform these entries into a linked list
        pTemp = p->pEntriesFree;
        for ( i = 1; i < p->nChunkSize; i++ )
        {
            *((char **)pTemp) = pTemp + p->nEntrySize;
            pTemp += p->nEntrySize;
        }
        // set the last link
        *((char **)pTemp) = NULL;
        // add the chunk to the chunk storage
        p->pChunks[ p->nChunks++ ] = p->pEntriesFree;
        // add to the number of entries allocated
        p->nEntriesAlloc += p->nChunkSize;
    }
    // incrememt the counter of used entries
    p->nEntriesUsed++;
    if ( p->nEntriesMax < p->nEntriesUsed )
        p->nEntriesMax = p->nEntriesUsed;
    // return the first entry in the free entry list
    pTemp = p->pEntriesFree;
    p->pEntriesFree = *((char **)pTemp);
    return pTemp;
}

/**Function*************************************************************

  Synopsis    []

  Description []

  SideEffects []

  SeeAlso     []

***********************************************************************/
void Aig_MmFixedEntryRecycle( Aig_MmFixed_t * p, char * pEntry )
{
    // decrement the counter of used entries
    p->nEntriesUsed--;
    // add the entry to the linked list of free entries
    *((char **)pEntry) = p->pEntriesFree;
    p->pEntriesFree = pEntry;
}

/**Function*************************************************************

  Synopsis    []

  Description [Relocates all the memory except the first chunk.]

  SideEffects []

  SeeAlso     []

***********************************************************************/
void Aig_MmFixedRestart( Aig_MmFixed_t * p )
{
    int i;
    char * pTemp;
    if ( p->nChunks == 0 )
        return;
    // deallocate all chunks except the first one
    for ( i = 1; i < p->nChunks; i++ )
        free( p->pChunks[i] );
    p->nChunks = 1;
    // transform these entries into a linked list
    pTemp = p->pChunks[0];
    for ( i = 1; i < p->nChunkSize; i++ )
    {
        *((char **)pTemp) = pTemp + p->nEntrySize;
        pTemp += p->nEntrySize;
    }
    // set the last link
    *((char **)pTemp) = NULL;
    // set the free entry list
    p->pEntriesFree  = p->pChunks[0];
    // set the correct statistics
    p->nMemoryAlloc  = p->nEntrySize * p->nChunkSize;
    p->nMemoryUsed   = 0;
    p->nEntriesAlloc = p->nChunkSize;
    p->nEntriesUsed  = 0;
}

/**Function*************************************************************

  Synopsis    []

  Description []

  SideEffects []

  SeeAlso     []

***********************************************************************/
int Aig_MmFixedReadMemUsage( Aig_MmFixed_t * p )
{
    return p->nMemoryAlloc;
}

/**Function*************************************************************

  Synopsis    []

  Description []

  SideEffects []

  SeeAlso     []

***********************************************************************/
int Aig_MmFixedReadMaxEntriesUsed( Aig_MmFixed_t * p )
{
    return p->nEntriesMax;
}

/**Function*************************************************************

  Synopsis    [Allocates entries of flexible size.]

  Description [Can only work with entry size at least 4 byte long.]

  SideEffects []

  SeeAlso     []

***********************************************************************/
Aig_MmFlex_t * Aig_MmFlexStart()
{
    Aig_MmFlex_t * p;

    p = ALLOC( Aig_MmFlex_t, 1 );
    memset( p, 0, sizeof(Aig_MmFlex_t) );

    p->nEntriesUsed  = 0;
    p->pCurrent      = NULL;
    p->pEnd          = NULL;

    p->nChunkSize    = (1 << 18);
    p->nChunksAlloc  = 64;
    p->nChunks       = 0;
    p->pChunks       = ALLOC( char *, p->nChunksAlloc );

    p->nMemoryUsed   = 0;
    p->nMemoryAlloc  = 0;
    return p;
}

/**Function*************************************************************

  Synopsis    []

  Description []

  SideEffects []

  SeeAlso     []

***********************************************************************/
void Aig_MmFlexStop( Aig_MmFlex_t * p, int fVerbose )
{
    int i;
    if ( p == NULL )
        return;
    if ( fVerbose )
    {
        printf( "Flexible memory manager: Chunk size = %d. Chunks used = %d.\n",
            p->nChunkSize, p->nChunks );
        printf( "   Entries used = %d. Memory used = %d. Memory alloc = %d.\n",
            p->nEntriesUsed, p->nMemoryUsed, p->nMemoryAlloc );
    }
    for ( i = 0; i < p->nChunks; i++ )
        free( p->pChunks[i] );
    free( p->pChunks );
    free( p );
}

/**Function*************************************************************

  Synopsis    []

  Description []

  SideEffects []

  SeeAlso     []

***********************************************************************/
char * Aig_MmFlexEntryFetch( Aig_MmFlex_t * p, int nBytes )
{
    char * pTemp;
    // check if there are still free entries
    if ( p->pCurrent == NULL || p->pCurrent + nBytes > p->pEnd )
    { // need to allocate more entries
        if ( p->nChunks == p->nChunksAlloc )
        {
            p->nChunksAlloc *= 2;
            p->pChunks = REALLOC( char *, p->pChunks, p->nChunksAlloc );
        }
        if ( nBytes > p->nChunkSize )
        {
            // resize the chunk size if more memory is requested than it can give
            // (ideally, this should never happen)
            p->nChunkSize = 2 * nBytes;
        }
        p->pCurrent = ALLOC( char, p->nChunkSize );
        p->pEnd     = p->pCurrent + p->nChunkSize;
        p->nMemoryAlloc += p->nChunkSize;
        // add the chunk to the chunk storage
        p->pChunks[ p->nChunks++ ] = p->pCurrent;
    }
    assert( p->pCurrent + nBytes <= p->pEnd );
    // increment the counter of used entries
    p->nEntriesUsed++;
    // keep track of the memory used
    p->nMemoryUsed += nBytes;
    // return the next entry
    pTemp = p->pCurrent;
    p->pCurrent += nBytes;
    return pTemp;
}

/**Function*************************************************************

  Synopsis    []

  Description [Relocates all the memory except the first chunk.]

  SideEffects []

  SeeAlso     []

***********************************************************************/
void Aig_MmFlexRestart( Aig_MmFlex_t * p )
{
    int i;
    if ( p->nChunks == 0 )
        return;
    // deallocate all chunks except the first one
    for ( i = 1; i < p->nChunks; i++ )
        free( p->pChunks[i] );
    p->nChunks  = 1;
    p->nMemoryAlloc = p->nChunkSize;
    // transform these entries into a linked list
    p->pCurrent = p->pChunks[0];
    p->pEnd     = p->pCurrent + p->nChunkSize;
    p->nEntriesUsed = 0;
    p->nMemoryUsed = 0;
}

/**Function*************************************************************

  Synopsis    []

  Description []

  SideEffects []

  SeeAlso     []

***********************************************************************/
int Aig_MmFlexReadMemUsage( Aig_MmFlex_t * p )
{
    return p->nMemoryUsed;
}

/**Function*************************************************************

  Synopsis    [Starts the hierarchical memory manager.]

  Description [This manager can allocate entries of any size.
  Iternally they are mapped into the entries with the number of bytes
  equal to the power of 2. The smallest entry size is 8 bytes. The
  next one is 16 bytes etc. So, if the user requests 6 bytes, he gets
  8 byte entry. If we asks for 25 bytes, he gets 32 byte entry etc.
  The input parameters "nSteps" says how many fixed memory managers
  are employed internally. Calling this procedure with nSteps equal
  to 10 results in 10 hierarchically arranged internal memory managers,
  which can allocate up to 4096 (1Kb) entries. Requests for larger
  entries are handed over to malloc() and then free()ed.]

  SideEffects []

  SeeAlso     []

***********************************************************************/
Aig_MmStep_t * Aig_MmStepStart( int nSteps )
{
    Aig_MmStep_t * p;
    int i, k;
    p = ALLOC( Aig_MmStep_t, 1 );
    memset( p, 0, sizeof(Aig_MmStep_t) );
    p->nMems = nSteps;
    // start the fixed memory managers
    p->pMems = ALLOC( Aig_MmFixed_t *, p->nMems );
    for ( i = 0; i < p->nMems; i++ )
        p->pMems[i] = Aig_MmFixedStart( (8<<i), (1<<13) );
    // set up the mapping of the required memory size into the corresponding manager
    p->nMapSize = (4<<p->nMems);
    p->pMap = ALLOC( Aig_MmFixed_t *, p->nMapSize+1 );
    p->pMap[0] = NULL;
    for ( k = 1; k <= 4; k++ )
        p->pMap[k] = p->pMems[0];
    for ( i = 0; i < p->nMems; i++ )
        for ( k = (4<<i)+1; k <= (8<<i); k++ )
            p->pMap[k] = p->pMems[i];
//for ( i = 1; i < 100; i ++ )
//printf( "%10d: size = %10d\n", i, p->pMap[i]->nEntrySize );
    return p;
}

/**Function*************************************************************

  Synopsis    [Stops the memory manager.]

  Description []

  SideEffects []

  SeeAlso     []

***********************************************************************/
void Aig_MmStepStop( Aig_MmStep_t * p, int fVerbose )
{
    int i;
    for ( i = 0; i < p->nMems; i++ )
        Aig_MmFixedStop( p->pMems[i], fVerbose );
//    if ( p->pLargeChunks )
//    {
//      for ( i = 0; i < p->nLargeChunks; i++ )
//          free( p->pLargeChunks[i] );
//      free( p->pLargeChunks );
//    }
    free( p->pMems );
    free( p->pMap );
    free( p );
}

/**Function*************************************************************

  Synopsis    [Creates the entry.]

  Description []

  SideEffects []

  SeeAlso     []

***********************************************************************/
char * Aig_MmStepEntryFetch( Aig_MmStep_t * p, int nBytes )
{
    if ( nBytes == 0 )
        return NULL;
    if ( nBytes > p->nMapSize )
    {
//        printf( "Allocating %d bytes.\n", nBytes );
/*
        if ( p->nLargeChunks == p->nLargeChunksAlloc )
        {
            if ( p->nLargeChunksAlloc == 0 )
                p->nLargeChunksAlloc = 5;
            p->nLargeChunksAlloc *= 2;
            p->pLargeChunks = REALLOC( char *, p->pLargeChunks, p->nLargeChunksAlloc );
        }
        p->pLargeChunks[ p->nLargeChunks++ ] = ALLOC( char, nBytes );
        return p->pLargeChunks[ p->nLargeChunks - 1 ];
*/
        return ALLOC( char, nBytes );
    }
    return Aig_MmFixedEntryFetch( p->pMap[nBytes] );
}

/**Function*************************************************************

  Synopsis    [Recycles the entry.]

  Description []

  SideEffects []

  SeeAlso     []

***********************************************************************/
void Aig_MmStepEntryRecycle( Aig_MmStep_t * p, char * pEntry, int nBytes )
{
    if ( nBytes == 0 )
        return;
    if ( nBytes > p->nMapSize )
    {
        free( pEntry );
        return;
    }
    Aig_MmFixedEntryRecycle( p->pMap[nBytes], pEntry );
}

/**Function*************************************************************

  Synopsis    []

  Description []

  SideEffects []

  SeeAlso     []

***********************************************************************/
int Aig_MmStepReadMemUsage( Aig_MmStep_t * p )
{
    int i, nMemTotal = 0;
    for ( i = 0; i < p->nMems; i++ )
        nMemTotal += p->pMems[i]->nMemoryAlloc;
    return nMemTotal;
}

////////////////////////////////////////////////////////////////////////
///                       END OF FILE                                ///
////////////////////////////////////////////////////////////////////////


text:
import pandas as pd
from datetime import datetime

###########################################################################
# Implements a GeneralLedger class that inherits from pandas DataFrame    #
# Adds some custom methods and required elements in order to better       #
# Reflect a general ledger type of object                                 #
###########################################################################

#TODO - update below to reflect calculated beginning and ending based on current date
#TODO - determine if fiscal year and adjust appropriately?
#TODO - create methods with things like 'current fiscal year', 'prior fiscal year', that create beg/end parameters
#TODO - add required columns of acctname; fsgrouping, date, amount; maybe some preset options for fs grouping?
#TODO - add a trial_balance method to GeneralLedger that runs a trial balance for certain time period...
    #Question of whether

def main():
    gl = GeneralLedger(pd.read_csv(csv_path))
    print(gl)
    gl.info()

class GeneralLedger(pd.DataFrame):
    # Subclass from pandas DataFrame

    def __str__(self):
        str_df = GeneralLedger({'testing': [1, 2, 3], 'your mom': [4, 5, 7]})
        return u'MOTHER FUCKER!!!!!!!\n' + str_df.__unicode__()

if __name__ == '__main__':
    main()


text:
interface JQueryDrawerClassOptions {
    nav?: string;
    toggle?: string;
    overlay?: string;
    open?: string;
    close?: string;
    dropdown?: string;
}

interface JQueryDrawerOptions {
    class?: JQueryDrawerClassOptions;
    iscroll?: IScrollOptions;
    showOverlay?: boolean;
}

interface JQuery {
    drawer(options?: JQueryDrawerOptions): JQuery;
    drawer(method: 'open'|'close'|'toggle'|'destroy'): JQuery;
    on(event: 'drawer.opened'|'drawer.closed', handler: () => void): JQuery;
}


text:
Speakers

                            Manu Rink

                            Microsoft

                            Manu Rink* is a mobile enthusiast long before the dawn of the smartphone. After working in the enterprise business, she finally dropped the mic, made her passion to her profession and worked as a mobile software engineer and architect for a couple of #1 apps. Currently she shares her passion as a tech evangelist @Microsoft and inspires a wide audience of techies for her beloved topics including mobile development, serverless computing and gaming.

*raised by Super Mario and Yoshi

                            Pronouns: she/her

                            @@include('./icon-twitter.html')
                            @@include('./icon-linkedin.html')

                            @@include('./icon-medium.html')

                        Alex Casalboni

                        Cloud Academy

                        Alex is a Software Engineer, deeply passionate about serverless technologies, music, and traveling.
                        He's currently a Sr. Software Engineer and Cloud Evangelist at Cloud Academy, a position that gave him the possibility to discover the Cloud world and develop its potential as a web developer and data scientist.
                        He is one of the founders of the Serverless Italy Meetup.

                        Pronouns: he/him

                        @@include('./icon-twitter.html')

                        @@include('./icon-linkedin.html')

                        @@include('./icon-medium.html')

                            Paul Johnston

                            Amazon Web Services

                            Paul is Senior Developer Advocate for Serverless at AWS working in EMEA. He is former CTO of Movivo - a startup working in 20 countries to provide free top up/recharge to those who struggle to afford it and built on a fully serverless architecture (on AWS). He is a prolific blogger about Serverless on Medium. Paul has previously started startups, been a consultant CTO to a number of startups in the past decade and developed mobile products and solutions for global brands such as Sony. Paul also is a director of a community energy scheme that is aiming to take it's community 'off grid' and lives a bit outside of London in Milton Keynes (there are bits of the UK that aren't London!) with his wife and 5 kids.

                            Pronouns: he/him

                            @@include('./icon-twitter.html')

                            @@include('./icon-linkedin.html')

                            @@include('./icon-medium.html')

                            Anna Doubková

                            Hive (British Gas)

                            Anna is a Javascript developer who loves working with new technologies. Currently working at Hive (British Gas), she does full-stack development to deliver a great end to end solution focused on user experience. She's a frequent speaker, runs workshops, and likes contributing to the community.

                            Pronouns: she/her

                            @@include('./icon-twitter.html')

                            Yan Cui

                            Space Ape Games

                            Yan is an experienced engineer who has worked with AWS for near 10 years. He has been an architect and lead developer with a variety of industries ranging from investment banks, e-commence to mobile gaming. In the last 2 years he has worked extensively with AWS Lambda in production, and he has been very active in sharing his experiences and the lessons he has learnt, some of his work has even made their way into the Well-Architected whitepaper published by AWS.

                            Yan is polyglot in both spoken and programming languages, he is fluent in both English and Mandarin, and can count C#, F#, Scala, Node.js and Erlang amongst programming languages that he has worked with professionally. Although he enjoys learning different programming languages and paradigms, he still holds F# as his undisputed favourite.

                            Yan is a regular speaker at user groups and conferences internationally, and he is also the author of AWS Lambda in Motion and a co-author of F# Deep Dives. In his spare time he keeps an active blog at theburningmonk.com where he shares his thoughts on topics such as AWS, serverless, functional programming and chaos engineering.

                            Pronouns: he/him

                            @@include('./icon-twitter.html')
                            @@include('./icon-linkedin.html')

                        Oliver Zeigermann

                        floreysoft. embarc, freelancer

                        Oliver Zeigermann is a software developer from Hamburg, Germany.
                        He has developed software in many different languages and technologies
                        over the past couple of decades, including C, C++, Java, Python, and
                        JavaScript.

                        For the past few years he dived into machine learning and data visualization.

                        Pronouns: he/him

                        @@include('./icon-twitter.html')

                        Daniel Buchholz

                        GHX Europe GmbH

                        Daniel is a Software Engineering Manager and Cloud Architect for a company supporting the Healthcare Supply Chain of suppliers, providers and distributors in the healthcare sector worldwide. He has spent 15 years in this business, starting as a software engineer. Today he is part of a team defining a new global Catalog Management foundation for the company and also an occasional contributor to local AWS meetups in Dortmund, Germany.

                        Pronouns: he/him

                        @@include('./icon-twitter.html')

                        Philipp Müns

                        Serverless, Inc.

                        Philipp Müns is a core developer at Serverless, Inc. He works on the team in charge of building and maintaining the Serverless Framework — an application framework for building web, mobile and IoT applications powered by AWS Lambda, Azure Functions, Google Cloud Functions and more.

                        Pronouns: he/him

                        @@include('./icon-twitter.html')
                        @@include('./icon-linkedin.html')
                        philippmuens.com

                        Lars Trieloff

                        Adobe

                        Lars Trieloff is a principal at Adobe, combining expertise from the fields of software engineering, product management, and marketing and applying it to the evolution and improvement of Adobe's developer ecosystem and the Adobe Cloud Platform. He has been involved with Serverless computing since 2016, and with cloud computing a decade longer.

                        Pronouns: he/him

                        @@include('./icon-twitter.html')
                        @@include('./icon-medium.html')

                        Cyle Riggs

                        Container Solutions

                        Cyle joined Container Solutions in 2017 as a cloud native developer/consultant after spending four years as a developer at AWS. He is focused on the implementation and use cases of modern and postmodern technologies. Outside of his career he is focused on travel and nature.

                        Pronouns: he/him

                        @@include('./icon-twitter.html')

                        @@include('./icon-github.html')

                        Simon Wardley

                        Leading Edge Forum

                        Simon Wardley is a Researcher for Leading Edge Forum, a global research and thought leadership programme dedicated to helping large organizations reimagine their organizations and leadership for a technology-driven future. Simon is also lead practitioner for LEFs Wardley Maps Advisory service which helps client anticipate market and ecosystem developments so they know where to go and why.

                        Simon&#39s focus is on strategic play both at an industrial and global level. He is the author of multiple reports including Clash of the Titans: Can China Dethrone Silicon Valley?, a pioneer in the use of topographical intelligence within business, a former executive and an advisory board member for several successful start-ups. He has twice been voted as one of the UK&#39s top 50 most influential people in technology. Simon has spent the last 20 years defining future strategies for companies in the FMCG, Retail and Technology industries. He is a passionate advocate in the fields of strategic play, organizational structure, open source and leadership and is a regular presenter at conferences worldwide.

                        Pronouns: he/him

                        http://blog.gardeviance.org/

                        @@include('./icon-twitter.html')
                        @@include('./icon-medium.html')

                        Subbu Allamaraju

                        Expedia Inc

Subbu Allamaraju is a technologist fascinated by large ambiguous problems and the learning opportunities such problems present. He is an influential voice both within Expedia, where he is currently a Vice President of Technology, and the industry.  Subbu is passionate about all things related to cloud, infrastructure, platforms, operations, the intersection of culture and technology, and the evolution of cloud native technologies and architectures.

At Expedia, Subbu is leading a large-scale migration of Expedia's travel platforms from enterprise data centers to a highly available architecture on the cloud.

Before joining Expedia, as a Distinguished Engineer at eBay Inc., Subbu helped build private cloud infrastructure and platforms for eBay and PayPal, which positioned these two organizations amongst a select few of the largest operators of OpenStack.

Subbu is an engineer well-rounded in product development, architecture, distributed systems, services, Internet protocols, operations, and cloud. Over the past several years, he helped build and empower several engineering and operations teams in these areas.

Subbu is an occasional blogger and speaker at technology conferences, and has published books on REST and server-side programming in Java. You can follow his activities at https://subbu.org and @sallamar on Twitter.

                        Pronouns: he/him

                        subbu.org
                        @@include('./icon-twitter.html')

                        Michael Wittig

                        cloudonaut.io

                        Michael Wittig is author of Amazon Web Services in Action (Manning). As an independent consultant, he helps his clients to gain value from Amazon Web Services. As a software engineer he develops cloud-native real-time web and mobile applications. He migrated the complete IT infrastructure of the first bank in Germany to AWS. He has expertise in distributed system development and architecture, with experience in algorithmic trading and real-time analytics.

                        Pronouns: he/him

                        cloudonaut.io

                        @@include('./icon-twitter.html')

                        Gillian Armstrong

                        Liberty Information Technology

                        Gillian works as Technical Lead of the Cognitive Technologies team in the Applied Innovation unit in Liberty IT. Her team is focused on exploring and using innovative technology in interesting new ways. At the moment she is working on Conversational AI design and development, mostly within the AWS ecosystem. She has more than a decade's worth of experience in many technologies across the full stack, but her passion is for where technology meets humans in the user interface and experience. She loves being a software engineer as it allows her not just to think up big ideas, but also to make them a reality.

                        Pronouns: she/her

                        virtualgill.io
                        @@include('./icon-twitter.html')
                        @@include('./icon-medium.html')

                        Danilo Poccia

                        Amazon Web Services

                        Danilo works with startups and companies of any size to support their innovation. In his role as Technical Evangelist at Amazon Web Services, he leverages his experience to help people bringing their ideas to life, focusing on event-driven programming and serverless architectures, and on the technical and business impact of machine learning and edge computing. He is author of AWS Lambda in Action from Manning.

                        Pronouns: he/him

                        @@include('./icon-twitter.html')

                        @@include('./icon-linkedin.html')

                        @@include('./icon-medium.html')

                        Arto Liukkonen

                        Nordcloud

                        Arto is a Lead Developer at Nordcloud. He's been a web developer for over ten years, kickstarting his career in 2007 by building successful Facebook games. Originally a PHP/WordPress guy, Arto converted to Javascript with Node.js v0.6 and for the last two years has been focused on React and serverless for both work and hobby projects, ranging from the banking sector to industrial IoT apps.

                        Pronouns: he/him

                        @@include('./icon-twitter.html')
                        @@include('./icon-linkedin.html')

                        Chad Arimura

                        Oracle

                        Chad is a 3x entrepreneur, most recently as co-founder and CEO of Iron.io where he helped grow a multi-million dollar ARR business helping to pioneer serverless computing. In 2017 Chad sold Iron.io and joined Oracle where he's Vice President of Serverless. Chad's currently leading the Fn Project, an open source cloud agnostic FaaS platform.

                        Pronouns: he/him

                        chadarimura.com
                        @@include('./icon-twitter.html')
                        @@include('./icon-linkedin.html')
                        @@include('./icon-medium.html')


text:
module Azure::CognitiveServices::ComputerVision::V2_1
  module Models
    #
    # Image metadata.
    #
    class ImageMetadata

      include MsRestAzure

      # @return [Integer] Image width, in pixels.
      attr_accessor :width

      # @return [Integer] Image height, in pixels.
      attr_accessor :height

      # @return [String] Image format.
      attr_accessor :format

      #
      # Mapper for ImageMetadata class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'ImageMetadata',
          type: {
            name: 'Composite',
            class_name: 'ImageMetadata',
            model_properties: {
              width: {
                client_side_validation: true,
                required: false,
                serialized_name: 'width',
                type: {
                  name: 'Number'
                }
              },
              height: {
                client_side_validation: true,
                required: false,
                serialized_name: 'height',
                type: {
                  name: 'Number'
                }
              },
              format: {
                client_side_validation: true,
                required: false,
                serialized_name: 'format',
                type: {
                  name: 'String'
                }
              }
            }
          }
        }
      end
    end
  end
end


text:
package com.greenpepper.confluence.rpc.xmlrpc;

import java.util.Vector;

import com.greenpepper.confluence.rpc.RpcClientService;
import com.greenpepper.server.rpc.GreenPepperRpcHelper;
import com.greenpepper.server.rpc.xmlrpc.GreenPepperXmlRpcServer;

/**
 *
GreenPepperXmlRpcServerDelegator class.

 *
 * @author oaouattara
 * @version $Id: $Id
 */
public class GreenPepperXmlRpcServerDelegator
		implements RpcClientService
{

	private GreenPepperXmlRpcServer serviceDelegator;
	private GreenPepperRpcHelper confluenceServiceDelegator = new ConfluenceXmlRpcGreenPepperServiceImpl();

	/**
	 *
Constructor for GreenPepperXmlRpcServerDelegator.

	 */
	public GreenPepperXmlRpcServerDelegator()
	{
	}

	/**
	 *
setGreenPepperXmlRpcServerService.

	 *
	 * @param delegator a {@link com.greenpepper.server.rpc.xmlrpc.GreenPepperXmlRpcServer} object.
	 */
	public void setGreenPepperXmlRpcServerService(GreenPepperXmlRpcServer delegator)
	{
		this.serviceDelegator = delegator;
	}

	/**
	 *
testConnection.

	 *
	 * @return a {@link java.lang.String} object.
	 */
	public String testConnection()
	{
		return serviceDelegator.testConnection();
	}

	/** {@inheritDoc} */
	public String ping(Vector<Object> repositoryParams)
	{
		return serviceDelegator.ping(repositoryParams);
	}

	/**
	 *
getAllEnvironmentTypes.

	 *
	 * @return a {@link java.util.Vector} object.
	 */
	public Vector<Object> getAllEnvironmentTypes()
	{
		return serviceDelegator.getAllEnvironmentTypes();
	}

	/** {@inheritDoc} */
	public Vector<Object> getRunner(String name)
	{
		return serviceDelegator.getRunner(name);
	}

	/**
	 *
getAllRunners.

	 *
	 * @return a {@link java.util.Vector} object.
	 */
	public Vector<Object> getAllRunners()
	{
		return serviceDelegator.getAllRunners();
	}

	/** {@inheritDoc} */
	public String createRunner(Vector<Object> runnerParams)
	{
		return serviceDelegator.createRunner(runnerParams);
	}

	/** {@inheritDoc} */
	public String updateRunner(String oldRunnerName, Vector<Object> runnerParams)
	{
		return serviceDelegator.updateRunner(oldRunnerName, runnerParams);
	}

	/** {@inheritDoc} */
	public String removeRunner(String name)
	{
		return serviceDelegator.removeRunner(name);
	}

	/** {@inheritDoc} */
	public Vector<Object> getRegisteredRepository(Vector<Object> repositoryParams)
	{
		return serviceDelegator.getRegisteredRepository(repositoryParams);
	}

	/** {@inheritDoc} */
	public Vector<Object> registerRepository(Vector<Object> repositoryParams)
	{
		return serviceDelegator.registerRepository(repositoryParams);
	}

	/** {@inheritDoc} */
	public String updateRepositoryRegistration(Vector<Object> repositoryParams)
	{
		return serviceDelegator.updateRepositoryRegistration(repositoryParams);
	}

	/** {@inheritDoc} */
	public String removeRepository(String repositoryUid)
	{
		return serviceDelegator.removeRepository(repositoryUid);
	}

	/**
	 *
getAllProjects.

	 *
	 * @return a {@link java.util.Vector} object.
	 */
	public Vector<Object> getAllProjects()
	{
		return serviceDelegator.getAllProjects();
	}

	/**
	 *
getAllSpecificationRepositories.

	 *
	 * @return a {@link java.util.Vector} object.
	 */
	public Vector<Object> getAllSpecificationRepositories()
	{
		return serviceDelegator.getAllSpecificationRepositories();
	}

	/** {@inheritDoc} */
	public Vector<Object> getSpecificationRepositoriesOfAssociatedProject(Vector<Object> repositoryParams)
	{
		return serviceDelegator.getSpecificationRepositoriesOfAssociatedProject(repositoryParams);
	}

	/** {@inheritDoc} */
	public Vector<Object> getAllRepositoriesForSystemUnderTest(Vector<Object> systemUnderTestParams)
	{
		return serviceDelegator.getAllRepositoriesForSystemUnderTest(systemUnderTestParams);
	}

	/** {@inheritDoc} */
	public Vector<Object> getSpecificationRepositoriesForSystemUnderTest(Vector<Object> systemUnderTestParams)
	{
		return serviceDelegator.getSpecificationRepositoriesForSystemUnderTest(systemUnderTestParams);
	}

	/** {@inheritDoc} */
	public Vector<Object> getRequirementRepositoriesOfAssociatedProject(Vector<Object> repositoryParams)
	{
		return serviceDelegator.getRequirementRepositoriesOfAssociatedProject(repositoryParams);
	}

	/** {@inheritDoc} */
	public Vector<Object> getSystemUnderTestsOfAssociatedProject(Vector<Object> repositoryParams)
	{
		return serviceDelegator.getSystemUnderTestsOfAssociatedProject(repositoryParams);
	}

	/** {@inheritDoc} */
	public Vector<Object> getSystemUnderTestsOfProject(String projectName)
	{
		return serviceDelegator.getSystemUnderTestsOfProject(projectName);
	}

	/** {@inheritDoc} */
	public String addSpecificationSystemUnderTest(Vector<Object> systemUnderTestParams,
												  Vector<Object> specificationParams)
	{
		return serviceDelegator.addSpecificationSystemUnderTest(systemUnderTestParams, specificationParams);
	}

	/** {@inheritDoc} */
	public String removeSpecificationSystemUnderTest(Vector<Object> systemUnderTestParams,
													 Vector<Object> specificationParams)
	{
		return serviceDelegator.removeSpecificationSystemUnderTest(systemUnderTestParams, specificationParams);
	}

	/** {@inheritDoc} */
	public String doesSpecificationHasReferences(Vector<Object> specificationParams)
	{
		return serviceDelegator.doesSpecificationHasReferences(specificationParams);
	}

	/** {@inheritDoc} */
	public Vector<Object> getSpecificationReferences(Vector<Object> specificationParams)
	{
		return serviceDelegator.getSpecificationReferences(specificationParams);
	}

	/** {@inheritDoc} */
	public String doesRequirementHasReferences(Vector<Object> requirementParams)
	{
		return serviceDelegator.doesRequirementHasReferences(requirementParams);
	}

	/** {@inheritDoc} */
	public Vector<Object> getRequirementReferences(Vector<Object> requirementParams)
	{
		return serviceDelegator.getRequirementReferences(requirementParams);
	}

	/** {@inheritDoc} */
	public Vector<Object> getReference(Vector<Object> referenceParams)
	{
		return serviceDelegator.getReference(referenceParams);
	}

	/** {@inheritDoc} */
	public Vector<Object> getSystemUnderTest(Vector<Object> systemUnderTestParams, Vector<Object> repositoryParams)
	{
		return serviceDelegator.getSystemUnderTest(systemUnderTestParams, repositoryParams);
	}

	/** {@inheritDoc} */
	public String createSystemUnderTest(Vector<Object> systemUnderTestParams, Vector<Object> repositoryParams)
	{
		return serviceDelegator.createSystemUnderTest(systemUnderTestParams, repositoryParams);
	}

	/** {@inheritDoc} */
	public String updateSystemUnderTest(String oldSystemUnderTestName, Vector<Object> systemUnderTestParams,
										Vector<Object> repositoryParams)
	{
		return serviceDelegator.updateSystemUnderTest(oldSystemUnderTestName, systemUnderTestParams, repositoryParams);
	}

	/** {@inheritDoc} */
	public String removeSystemUnderTest(Vector<Object> systemUnderTestParams, Vector<Object> repositoryParams)
	{
		return serviceDelegator.removeSystemUnderTest(systemUnderTestParams, repositoryParams);
	}

	/** {@inheritDoc} */
	public String setSystemUnderTestAsDefault(Vector<Object> systemUnderTestParams, Vector<Object> repositoryParams)
	{
		return serviceDelegator.setSystemUnderTestAsDefault(systemUnderTestParams, repositoryParams);
	}

	/** {@inheritDoc} */
	public String removeRequirement(Vector<Object> requirementParams)
	{
		return serviceDelegator.removeRequirement(requirementParams);
	}

	/** {@inheritDoc} */
	public Vector<Object> getSpecification(Vector<Object> specificationParams)
	{
		return serviceDelegator.getSpecification(specificationParams);
	}

	/** {@inheritDoc} */
	public Vector<Object> getSpecifications(Vector<Object> systemUnderTestParams, Vector<Object> repositoryParams)
	{
		return serviceDelegator.getSpecifications(systemUnderTestParams, repositoryParams);
	}

	/** {@inheritDoc} */
	public Vector<?> getListOfSpecificationLocations(String repositoryUID, String systemUnderTestName)
	{
		return serviceDelegator.getListOfSpecificationLocations(repositoryUID, systemUnderTestName);
	}

	/** {@inheritDoc} */
	public Vector<Object> createSpecification(Vector<Object> specificationParams)
	{
		return serviceDelegator.createSpecification(specificationParams);
	}

	/** {@inheritDoc} */
	public String updateSpecification(Vector<Object> oldSpecificationParams, Vector<Object> newSpecificationParams)
	{
		return serviceDelegator.updateSpecification(oldSpecificationParams, newSpecificationParams);
	}

	/** {@inheritDoc} */
	public String removeSpecification(Vector<Object> specificationParams)
	{
		return serviceDelegator.removeSpecification(specificationParams);
	}

	/** {@inheritDoc} */
	public String createReference(Vector<Object> referenceParams)
	{
		return serviceDelegator.createReference(referenceParams);
	}

	/** {@inheritDoc} */
	public Vector<Object> updateReference(Vector<Object> oldReferenceParams, Vector<Object> newReferenceParams)
	{
		return serviceDelegator.updateReference(oldReferenceParams, newReferenceParams);
	}

	/** {@inheritDoc} */
	public String removeReference(Vector<Object> referenceParams)
	{
		return serviceDelegator.removeReference(referenceParams);
	}

	/** {@inheritDoc} */
	public Vector<Object> runSpecification(Vector<Object> systemUnderTestParams, Vector<Object> specificationParams,
										   boolean implementedVersion, String locale)
	{
		return serviceDelegator.runSpecification(systemUnderTestParams, specificationParams, implementedVersion, locale);
	}

	/** {@inheritDoc} */
	public Vector<Object> runReference(Vector<Object> referenceParams, String locale)
	{
		return serviceDelegator.runReference(referenceParams, locale);
	}

	/** {@inheritDoc} */
	public Vector<Object> getRequirementSummary(Vector<Object> requirementParams)
	{
		return serviceDelegator.getRequirementSummary(requirementParams);
	}

	/** {@inheritDoc} */
	public Vector<Object> getSpecificationHierarchy(Vector<Object> repositoryParams, Vector<Object> sutParams)
	{
		return serviceDelegator.getSpecificationHierarchy(repositoryParams, sutParams);
	}

	/** {@inheritDoc} */
	public String getRenderedSpecification(String username, String password, Vector<?> args)
	{
		return confluenceServiceDelegator.getRenderedSpecification(username, password, args);
	}

	/** {@inheritDoc} */
	public Vector getSpecificationHierarchy(String username, String password, Vector<?> args)
	{
		return confluenceServiceDelegator.getSpecificationHierarchy(username, password, args);
	}

	/** {@inheritDoc} */
	public String setSpecificationAsImplemented(String username, String password, Vector<?> args)
	{
		return confluenceServiceDelegator.setSpecificationAsImplemented(username, password, args);
	}

	/** {@inheritDoc} */
	public String saveExecutionResult(String username, String password, Vector<?> args)
	{
		return confluenceServiceDelegator.saveExecutionResult(username, password, args);
	}
}


text:
package VMOMI::VirtualDiskCompatibilityMode;
use parent 'VMOMI::SimpleType';

use strict;
use warnings;

1;


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

package com.outjected.email;

import java.util.ArrayList;
import java.util.Collection;

import org.junit.Test;

import com.outjected.email.api.EmailContact;
import com.outjected.email.api.InvalidAddressException;
import com.outjected.email.api.MailMessage;
import com.outjected.email.impl.BasicEmailContact;
import com.outjected.email.impl.MailMessageImpl;
import com.outjected.email.util.TestMailConfigs;

/**
 * @author Cody Lerum
 */
public class InternetAddressTest {
    @Test
    public void validAddresses() {
        MailMessage m = new MailMessageImpl(TestMailConfigs.standardConfig());

        BasicEmailContact seam = new BasicEmailContact("seam@domain.test");
        BasicEmailContact seamey = new BasicEmailContact("seamey@domain.test");

        Collection<EmailContact> addresses = new ArrayList<EmailContact>();
        addresses.add(seamey);

        m.from("seam@domain.test", "Seam Seamerson<seam@domain.test>");
        m.from("Seam Seamerson<seam@domain.test>");
        m.from("seam@domain.test");
        m.from(seam);
        m.from(addresses);

        m.to("seam@domain.test", "Seam Seamerson<seam@domain.test>");
        m.to("Seam Seamerson<seam@domain.test>");
        m.to("seam@domain.test");
        m.to(seam);
        m.to(addresses);

        m.cc("seam@domain.test", "Seam Seamerson<seam@domain.test>");
        m.cc("Seam Seamerson<seam@domain.test>");
        m.cc("seam@domain.test");
        m.cc(seam);
        m.cc(addresses);

        m.bcc("seam@domain.test", "Seam Seamerson<seam@domain.test>");
        m.bcc("Seam Seamerson<seam@domain.test>");
        m.bcc("seam@domain.test");
        m.bcc(seam);
        m.bcc(addresses);

        m.replyTo("seam@domain.test", "Seam Seamerson<seam@domain.test>");
        m.replyTo("Seam Seamerson<seam@domain.test>");
        m.replyTo("seam@domain.test");
        m.replyTo(seam);
        m.replyTo(addresses);
    }

    @Test(expected = InvalidAddressException.class)
    public void invalidFromSimpleAddresses() {
        MailMessage m = new MailMessageImpl(TestMailConfigs.standardConfig());

        m.from("woo foo @bar.com");
    }

    @Test(expected = InvalidAddressException.class)
    public void invalidFromFullAddresses() {
        MailMessage m = new MailMessageImpl(TestMailConfigs.standardConfig());

        m.from("foo @bar.com", "Woo");
    }

    @Test(expected = InvalidAddressException.class)
    public void invalidToSimpleAddresses() {
        MailMessage m = new MailMessageImpl(TestMailConfigs.standardConfig());

        m.to("woo foo @bar.com");
    }

    @Test(expected = InvalidAddressException.class)
    public void invalidToFullAddresses() {
        MailMessage m = new MailMessageImpl(TestMailConfigs.standardConfig());

        m.to("foo @bar.com", "Woo");
    }

    @Test(expected = InvalidAddressException.class)
    public void invalidCcSimpleAddresses() {
        MailMessage m = new MailMessageImpl(TestMailConfigs.standardConfig());

        m.cc("woo foo @bar.com");
    }

    @Test(expected = InvalidAddressException.class)
    public void invalidCcFullAddresses() {
        MailMessage m = new MailMessageImpl(TestMailConfigs.standardConfig());

        m.cc("foo @bar.com", "Woo");
    }

    @Test(expected = InvalidAddressException.class)
    public void invalidBccSimpleAddresses() {
        MailMessage m = new MailMessageImpl(TestMailConfigs.standardConfig());

        m.bcc("woo foo @bar.com");
    }

    @Test(expected = InvalidAddressException.class)
    public void invalidbccFullAddresses() {
        MailMessage m = new MailMessageImpl(TestMailConfigs.standardConfig());

        m.bcc("foo @bar.com", "Woo");
    }

    @Test(expected = InvalidAddressException.class)
    public void invalidReplyToSimpleAddresses() {
        MailMessage m = new MailMessageImpl(TestMailConfigs.standardConfig());

        m.replyTo("woo foo @bar.com");
    }

    @Test(expected = InvalidAddressException.class)
    public void invalidReplyToFullAddresses() {
        MailMessage m = new MailMessageImpl(TestMailConfigs.standardConfig());

        m.replyTo("foo @bar.com", "Woo");
    }

    @Test(expected = InvalidAddressException.class)
    public void invalidDeliveryReceipt() {
        MailMessage m = new MailMessageImpl(TestMailConfigs.standardConfig());

        m.deliveryReceipt("woo foo @bar.com");
    }

    @Test(expected = InvalidAddressException.class)
    public void invalidReadReceipt() {
        MailMessage m = new MailMessageImpl(TestMailConfigs.standardConfig());

        m.readReceipt("woo foo @bar.com");
    }
}


text:
import { Component,  ElementRef } from '@angular/core';
import { NavController } from 'ionic-angular';
import { EventsService } from './events.service';
import { EventsPreviewPage } from './preview/events-preview.page';
import * as moment from 'moment';

import { style } from './events.style';

@Component({
  templateUrl: 'events.html'
})
export class EventsPage {
  private EventsService: EventsService;
  private _elementRef: ElementRef;
  eventSource = [];
  viewTitle: string;
  selectedDay = new Date();

  private mapStyle = style;
  map: any;

  calendar = {
    label: 'Seleccione un día',
    mode: 'month',
    currentDate: this.selectedDay
  }

  constructor(public nav: NavController, EventsService: EventsService) {
    this.EventsService = EventsService;
    this.EventsService.all().subscribe( response => this.eventSource = response )
  }

onEventSelected(event) {
  moment.locale('es');
  let start = moment(event.startTime).format('DD MMMM YYYY, HH:mm a');
  let end = moment(event.endTime).format('DD MMMM YYYY, HH:mm a');

  console.log(event);

  this.nav.push(EventsPreviewPage, {
    title: event.title,
    description: event.description,
    location: event.location,
    start: start,
    end: end,
    cost: event.costo,
    type: event.tipo
  });

}

  onViewTitleChanged(title) {
    this.viewTitle = title;
  }

  onTimeSelected(event) {
    this.selectedDay = event.selectedTime;
  }

  ionViewDidLoad() {
      console.log('ionViewDidLoad EventsPage');
  }

  loadMap(nombre, ubicacion_maps) {
    let coords = ubicacion_maps.split(',');
    let latLng = new google.maps.LatLng(coords[0], coords[1]);

    let mapOptions = {
      center: latLng,
      zoom: 15,
      styles: this.mapStyle,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    }

    this.map = new google.maps.Map(this._elementRef.nativeElement.querySelector('#map'), mapOptions);

    let marker = new google.maps.Marker({
      position: latLng,
      map: this.map,
      title: nombre
    });

  }

}


text:
module TokyoMetro::Api::StationTimetable::Info::TrainTime::Info::Note::YurakuchoFukusohin
end


text:
/*******************************************************************************
 *
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 ******************************************************************************/
#include "util.h"
#include "clustering/CharCluster.hpp"
#include "clustering/ClusteringResult.hpp"
#include "util/ColorMap.hpp"

#include <iostream>
#include <fstream>

namespace impact_tr4 {

void writeLibSVMOutputFile(const std::vector<unsigned int> &labels, const ublas::matrix<float> &featureMat, const std::string filename)
{
	if (labels.size() != featureMat.size1()) {
		throw Exception("Nr of labels must be the same as number of features in data matrix!");
	}

	std::ofstream outfile(filename.c_str());
	for (int i=0; i<featureMat.size1(); ++i) { // for all rows of matrix
		outfile << labels[i];
		for (int j=0; j<featureMat.size2(); ++j) {
			outfile << " " << j+1 << ":" << featureMat(i,j);
		}
		outfile << "\n";
	}

	return;
}

std::string num2Str(double number)
{
	std::stringstream ss;
	std::string str;
	ss << number;
	ss >> str;
	return str;
}

int replaceAllChars(std::string& str, const char c1, const char c2)
{
	int count = 0;
	for (int i=0; i<str.size(); ++i) {
		if (str[i] == c1) {
			str[i] = c2;
			++count;
		}
	}
	return count;
} // end replace_chars

int replaceAllCharsW(std::wstring& str, const wchar_t c1, const wchar_t c2)
{
	int count = 0;
	for (int i=0; i<str.size(); ++i) {
		if (str[i] == c1) {
			str[i] = c2;
			++count;
		}
	}
	return count;
} // end replace_chars_w

int createPath(const std::string& path) {
	int count = 0;
	std::string pathT = path;
	std::string subStr;
	convertToRegularPath(pathT);
//	std::cout << pathT << std::endl;

    subStr = "";
	int fpos = -1;
	bool firstFlag = true;
	do {
		fpos = pathT.find('/', 0);
		if (fpos != -1) {
			subStr.append( pathT.substr(0, fpos+1) );
			pathT = pathT.substr(fpos+1, pathT.size()-fpos-1);
		}
		else {
			subStr.append(pathT);
		}
//		std::cout << subStr << ", " << pathT << std::endl;
		if (firstFlag && subStr[subStr.size()-2]==':') {
			;
		}
		else if (!subStr.empty()) {
			if (!isDir(subStr)) { // if dir not already there -> create!
#if defined(_WIN32) || defined(WIN32)
				BOOL success = CreateDirectory(subStr.c_str(), NULL);
				if (success)
					count++;
				else {
					// do error handling here...
					throw Exception("There was an error during path creation in createPath(...)!");
				}
#else // put unix code for dir-creation here
				// TODO
				std::cout << "DIRECTORY CREATION NOT DONE IN UNIX YET!!" << std::endl;
				throw Exception("DIRECTORY CREATION NOT DONE IN UNIX YET!!");
#endif
			}
		}
		firstFlag = false;
	} while (fpos != -1);
	return count;
} // end of createPath

std::string pathName(const std::string& input)
{
	std::string tmp = input;
	std::string res;
	convertToRegularPath(tmp);
	int index1 = tmp.find_last_of("/");
	if (index1 < tmp.size()) {
		res = tmp.substr(0, index1+1);
	}
	return res;
}

std::string baseFileName(const std::string& input)
{
	std::string tmp = input;
	std::string res;
	convertToRegularPath(tmp);
	int index1 = tmp.find_last_of("/");
	int index2 = tmp.find_last_of(".");
	if (index2 >= tmp.size()) index2 = tmp.size()-1;
	if (index1 < tmp.size()) {
		res = tmp.substr(index1+1, index2-index1-1);
	}
	return res;
}

std::string baseFileNameWithPath(const std::string& input)
{
	std::string tmp = input;
	std::string res;
	convertToRegularPath(tmp);
	int index = tmp.find_last_of(".");
	if (index >= tmp.size()) index = tmp.size()-1;
	res = tmp.substr(0, index);
	return res;
}

std::string& trim( std::string& str)
{
    // Trim Both leading and trailing spaces
    size_t startpos = str.find_first_not_of(" \t"); // Find the first character position after excluding leading blank spaces
    size_t endpos = str.find_last_not_of(" \t"); // Find the first character position from reverse af

    // if all spaces or empty return an empty string
    if(( std::string::npos == startpos ) || ( std::string::npos == endpos))
    {
        str = "";
    }
    else
        str = str.substr( startpos, endpos-startpos+1 );

    return  str;
}

void convertGrayscaleToJet(const QImage& srcGrayscaleImage, QImage &dstJetImage)
{
	if (!srcGrayscaleImage.isGrayscale()) {
		throw Exception("convertGrayscaleToJet: This function is only supported for grayscale images!");
		std::cerr << "convertGrayscaleToJet: This function is only supported for grayscale images!" << std::endl;
		return;
	}

	ColorMap jetMap;
	jetMap.createJetMap();
	QRgb rgbValue;
	int grayValue;

	const int width = srcGrayscaleImage.size().width();
	const int height = srcGrayscaleImage.size().height();

	dstJetImage = QImage(width, height, QImage::Format_RGB32);

	for (int i=0; i<width; ++i) {
		for (int j=0; j<height; ++j) {
			grayValue = qGray(srcGrayscaleImage.pixel(i,j));
			rgbValue = qRgb(jetMap.red(grayValue), jetMap.green(grayValue), jetMap.blue(grayValue));
			dstJetImage.setPixel(i,j,rgbValue);
		}
	} // end for i

	return;
} // end convertGrayscaleToJet

} // end of namespace impact_tr4


text:
"use strict";

const assert = require("assert");

const Selector = require("..").Selector;

const describe = global.describe;
const it = global.it;

describe("Match", () => {
	it("should match labels", () => {
		const selector = Selector("labelA = a, labelB = b");

		assert.strictEqual(selector({ labelA : "a" }), false);
		assert.strictEqual(selector({
			labelA : "a",
			labelB : "b"
		}), true);
	});

	it("should match set operators", () => {
		const selector = Selector("labelA in (a, A), labelB notin (b, B)");

		assert.strictEqual(selector({ labelA : "a" }), true);
		assert.strictEqual(selector({ labelA : "a" }), true);
	});

	it("should match exists", () => {
		const selector = Selector("labelA, !labelB");

		assert.strictEqual(selector({ labelA : "a" }), true);
		assert.strictEqual(selector({
			labelA : "a",
			labelB : "B"
		}), false);
	});

	it("should be able to create with matchLabels", () => {
		const selector = Selector({
			matchLabels : {
				labelA : "a",
				labelB : "b"
			}
		});

		assert.strictEqual(selector({ labelA : "a" }), false);
		assert.strictEqual(selector({
			labelA : "a",
			labelB : "b"
		}), true);
	});

	it("should be able to create with matchExpressions", () => {
		const selector = Selector({
			matchExpressions : [{
				operator : "DoesNotExist",
				key      : "labelA"
			}]
		});

		assert.strictEqual(selector({ labelA : "a" }), false);
		assert.strictEqual(selector(), true);
	});

	it("should throw trying to match invalid operator", () => {
		const selector = Selector({
			matchExpressions : [{
				operator : "invalid"
			}]
		});

		assert.throws(() => selector());
	});
});


text:
module Netzke
  module Basepack
    # Include this module into your component component class when you want lazy-loaded component in config to be auto-replaced with
    # a panel with the 'fit' layout, and a property wrappedComponent set to the name of the original component.
    # Used, for instance, in TabPanel and Accordion to dynamically load components on expanding a panel or clicking
    # a tab.
    module WrapLazyLoaded
      def js_configure(cfg)
        super
        cfg.items = cfg.items.each_with_index.map do |item,i|
          c = component_config(item[:netzke_component]).try(:merge, item)

          # when a nested component with lazy loading is detected, it gets replaced with a 'fit' panel,
          # into which later the component itself is dynamically loaded on request.
          if c && !c[:eager_loading] && i != config.active_tab.to_i # so it works for both TabPanel and Accordion
            { layout: :fit,
              wrapped_component: c[:item_id],
              title: c[:title] || c[:item_id].humanize,
              icon_cls: c[:icon_cls],
              disabled: c[:disabled]
            }
          else
            item
          end
        end
      end
    end
  end
end


text:
set -e

if [ ! -f src/libgo/libgo.go ]; then
	cwd=$(pwd)
	echo 'misc/cgo/testcshared/test.bash is running in $cwd' 1>&2
	exit 1
fi

goos=$(go env GOOS)
goarch=$(go env GOARCH)
goroot=$(go env GOROOT)
if [ ! -d "$goroot" ]; then
	echo 'misc/cgo/testcshared/test.bash cannnot find GOROOT' 1>&2
	echo '$GOROOT:' "$GOROOT" 1>&2
	echo 'go env GOROOT:' "$goroot" 1>&2
	exit 1
fi

# Directory where cgo headers and outputs will be installed.
# The installation directory format varies depending on the platform.
installdir=pkg/${goos}_${goarch}_testcshared_shared
if [ "${goos}" == "darwin" ]; then
	installdir=pkg/${goos}_${goarch}_testcshared
fi

# Temporary directory on the android device.
androidpath=/data/local/tmp/testcshared-$$

function cleanup() {
	rm -f libgo.$libext libgo2.$libext libgo4.$libext libgo5.$libext
	rm -f libgo.h libgo4.h libgo5.h
	rm -f testp testp2 testp3 testp4 testp5
	rm -rf pkg "${goroot}/${installdir}"

	if [ "$goos" == "android" ]; then
		adb shell rm -rf "$androidpath"
	fi
}
trap cleanup EXIT

if [ "$goos" == "android" ]; then
	adb shell mkdir -p "$androidpath"
fi

function run() {
	case "$goos" in
	"android")
		local args=$@
		output=$(adb shell "cd ${androidpath}; $@")
		output=$(echo $output|tr -d '\r')
		case $output in
			*PASS) echo "PASS";;
			*) echo "$output";;
		esac
		;;
	*)
		echo $(env $@)
		;;
	esac
}

function binpush() {
	bin=${1}
	if [ "$goos" == "android" ]; then
		adb push "$bin"  "${androidpath}/${bin}" 2>/dev/null
	fi
}

rm -rf pkg

suffix="-installsuffix testcshared"

libext="so"
if [ "$goos" == "darwin" ]; then
	libext="dylib"
fi

# Create the header files.
GOPATH=$(pwd) go install -buildmode=c-shared $suffix libgo

GOPATH=$(pwd) go build -buildmode=c-shared $suffix -o libgo.$libext src/libgo/libgo.go
binpush libgo.$libext

if [ "$goos" == "linux" ] || [ "$goos" == "android" ] ; then
    if readelf -d libgo.$libext | grep TEXTREL >/dev/null; then
        echo "libgo.$libext has TEXTREL set"
        exit 1
    fi
fi

GOGCCFLAGS=$(go env GOGCCFLAGS)
if [ "$goos" == "android" ]; then
	GOGCCFLAGS="${GOGCCFLAGS} -pie"
fi

status=0

# test0: exported symbols in shared lib are accessible.
# TODO(iant): using _shared here shouldn't really be necessary.
$(go env CC) ${GOGCCFLAGS} -I ${installdir} -o testp main0.c libgo.$libext
binpush testp

output=$(run LD_LIBRARY_PATH=. ./testp)
if [ "$output" != "PASS" ]; then
	echo "FAIL test0 got ${output}"
	status=1
fi

# test1: shared library can be dynamically loaded and exported symbols are accessible.
$(go env CC) ${GOGCCFLAGS} -o testp main1.c -ldl
binpush testp
output=$(run ./testp ./libgo.$libext)
if [ "$output" != "PASS" ]; then
	echo "FAIL test1 got ${output}"
	status=1
fi

# test2: tests libgo2 which does not export any functions.
GOPATH=$(pwd) go build -buildmode=c-shared $suffix -o libgo2.$libext libgo2
binpush libgo2.$libext
linkflags="-Wl,--no-as-needed"
if [ "$goos" == "darwin" ]; then
	linkflags=""
fi
$(go env CC) ${GOGCCFLAGS} -o testp2 main2.c $linkflags libgo2.$libext
binpush testp2
output=$(run LD_LIBRARY_PATH=. ./testp2)
if [ "$output" != "PASS" ]; then
	echo "FAIL test2 got ${output}"
	status=1
fi

# test3: tests main.main is exported on android.
if [ "$goos" == "android" ]; then
	$(go env CC) ${GOGCCFLAGS} -o testp3 main3.c -ldl
	binpush testp3
	output=$(run ./testp ./libgo.so)
	if [ "$output" != "PASS" ]; then
		echo "FAIL test3 got ${output}"
		status=1
	fi
fi

# test4: tests signal handlers
GOPATH=$(pwd) go build -buildmode=c-shared $suffix -o libgo4.$libext libgo4
binpush libgo4.$libext
$(go env CC) ${GOGCCFLAGS} -pthread -o testp4 main4.c -ldl
binpush testp4
output=$(run ./testp4 ./libgo4.$libext 2>&1)
if test "$output" != "PASS"; then
    echo "FAIL test4 got ${output}"
    if test "$goos" != "android"; then
	echo "re-running test4 in verbose mode"
	./testp4 ./libgo4.$libext verbose
    fi
    status=1
fi

# test5: tests signal handlers with os/signal.Notify
GOPATH=$(pwd) go build -buildmode=c-shared $suffix -o libgo5.$libext libgo5
binpush libgo5.$libext
$(go env CC) ${GOGCCFLAGS} -pthread -o testp5 main5.c -ldl
binpush testp5
output=$(run ./testp5 ./libgo5.$libext 2>&1)
if test "$output" != "PASS"; then
    echo "FAIL test5 got ${output}"
    if test "$goos" != "android"; then
	echo "re-running test5 in verbose mode"
	./testp5 ./libgo5.$libext verbose
    fi
    status=1
fi

if test $status = 0; then
    echo "ok"
fi

exit $status


text:
h3_py
=====

h3_py is a python interface for automating Heritrix3

Requirements
------------

- Python 3.4 or later
- Heritrix 3


text:
<?php

declare(strict_types=1);

namespace Leevel\Router\Console;

use Leevel\Console\Command;
use Leevel\Kernel\IApp;

/**
 * 路由缓存清理.
 */
class Clear extends Command
{
    /**
     * 命令名字.
     */
    protected string $name = 'router:clear';

    /**
     * 命令行描述.
     */
    protected string $description = 'Clear cache of router';

    /**
     * 响应命令.
     */
    public function handle(IApp $app): int
    {
        $this->line('Start to clear cache router.');
        $cachePath = $app->routerCachedPath();
        $this->clearCache($cachePath);
        $this->info(sprintf('Router cache files %s clear successed.', $cachePath));

        return 0;
    }

    /**
     * 删除缓存.
     */
    protected function clearCache(string $cachePath): void
    {
        if (!is_file($cachePath)) {
            $this->warn(sprintf('Router cache file %s have been cleaned up.', $cachePath));

            return;
        }

        unlink($cachePath);
    }
}


text:
"""Fixture module to skip the datasets loading when offline

Doctests are skipped if the datasets have not already been downloaded
and cached in the past.
"""
from os.path import exists
from os.path import join

from nose import SkipTest
from sklearn.datasets import get_data_home

def setup_module(module):
    data_home = get_data_home()
    if not exists(join(data_home, '20news_home')):
        raise SkipTest("Skipping dataset loading doctests")


text:
package agent

import (
	"encoding/json"
	"net/http"
	"strings"

	log "github.com/Sirupsen/logrus"

	"github.com/Dataman-Cloud/swan/types"
)

func (agent *Agent) syncFull(addr string) error {
	if !strings.HasPrefix(addr, "http://") {
		addr = "http://" + addr
	}
	addr += "/v1/fullsync"

	resp, err := http.Get(addr)
	if err != nil {
		return err
	}
	defer resp.Body.Close()

	var full []*types.CombinedEvents
	if err := json.NewDecoder(resp.Body).Decode(&full); err != nil {
		return err
	}

	log.Printf("full syncing %d dns & proxy records ...", len(full))

	for _, cmb := range full {
		var (
			proxy = cmb.Proxy
			dns   = cmb.DNS
		)

		if agent.config.DNS.Enabled {
			if err := agent.resolver.Upsert(dns); err != nil {
				log.Errorln("full syncing, upsert dns record error:", err)
			}
		}

		if agent.config.Janitor.Enabled {
			if err := agent.janitor.UpsertBackend(proxy); err != nil {
				log.Errorln("full syncing, upsert proxy record error:", err)
			}
		}
	}

	log.Println("full synced dns & proxy records succeed")
	return nil
}


text:
package org.beyene.protege.core.encoding;

import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlType;

import org.beyene.protege.core.data.Primitive;

@XmlType(name = "double-encoding")
public enum DoubleEncoding implements Encoding<Double> {

	@XmlEnumValue("ieee754-double")
	IEEE_754_DOUBLE("ieee754-double", 64);

	private final String key;
	private final int bits;

	private DoubleEncoding(String key, int bits) {
		this.key = key;
		this.bits = bits;
	}

	@Override
	public String getKey() {
		return key;
	}

	@Override
	public int getWidth() {
		return bits;
	}

	@Override
	public Primitive<Double> getPrimitive() {
		return Primitive.DOUBLE;
	}
}


text:
package specconv // import "github.com/docker/docker/rootless/specconv"

import (
	"io/ioutil"
	"strconv"

	"github.com/opencontainers/runtime-spec/specs-go"
)

// ToRootless converts spec to be compatible with "rootless" runc.
// * Remove cgroups (will be supported in separate PR when delegation permission is configured)
// * Fix up OOMScoreAdj
func ToRootless(spec *specs.Spec) error {
	return toRootless(spec, getCurrentOOMScoreAdj())
}

func getCurrentOOMScoreAdj() int {
	b, err := ioutil.ReadFile("/proc/self/oom_score_adj")
	if err != nil {
		return 0
	}
	i, err := strconv.Atoi(string(b))
	if err != nil {
		return 0
	}
	return i
}

func toRootless(spec *specs.Spec, currentOOMScoreAdj int) error {
	// Remove cgroup settings.
	spec.Linux.Resources = nil
	spec.Linux.CgroupsPath = ""

	if spec.Process.OOMScoreAdj != nil && *spec.Process.OOMScoreAdj < currentOOMScoreAdj {
		*spec.Process.OOMScoreAdj = currentOOMScoreAdj
	}
	return nil
}


text:
using Castle.DynamicProxy;

using NInsight.Core.Handlers.Record;

namespace NInsight.Core.Interceptors
{
    internal class RecordInterceptor : IInterceptor
    {
        public PreInvocationHandler PreInvocationHandler { get; set; }

        public PostInvocationHandler PostInvocationHandler { get; set; }

        public void Intercept(IInvocation invocation)
        {
            this.PreInvocationHandler.Handle(invocation);
            invocation.Proceed();
            this.PostInvocationHandler.Handle(invocation);
        }
    }
}


text:
package com.systematic.trading.signals.data.api.quandl.converter;

import java.util.List;

import org.apache.commons.lang3.StringUtils;

import com.systematic.trading.data.exception.CannotRetrieveDataException;
import com.systematic.trading.signals.data.api.quandl.model.QuandlColumnName;

/**
 * Common utility methods for the response column classes.
 *
 * @author CJ Hare
 */
public class ResponseColumnsUtil {

	public int indexOf( final List<QuandlColumnName> columns, final String name ) throws CannotRetrieveDataException {

		for (int i = 0; i < columns.size(); i++) {
			if (columnNameEquals(name, columns.get(i))) { return i; }
		}

		throw new CannotRetrieveDataException(String.format("Missing expected column: %s", name));
	}

	public boolean containsName( final String name, final List<QuandlColumnName> columns ) {

		for (int i = 0; i < columns.size(); i++) {
			if (columnNameEquals(name, columns.get(i))) { return true; }
		}

		return false;
	}

	private boolean columnNameEquals( final String name, final QuandlColumnName column ) {

		return StringUtils.equalsIgnoreCase(name, column.name());
	}
}


text:
package org.apache.cassandra.db;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

import org.apache.cassandra.io.IVersionedSerializer;
import org.apache.cassandra.net.MessageOut;
import org.apache.cassandra.net.MessagingService;

/**
 * This message is sent back the truncate operation and basically specifies if
 * the truncate succeeded.
 */
public class TruncateResponse
{
    public static final TruncateResponseSerializer serializer = new TruncateResponseSerializer();

    public final String keyspace;
    public final String columnFamily;
    public final boolean success;

    public TruncateResponse(String keyspace, String columnFamily, boolean success)
    {
        this.keyspace = keyspace;
        this.columnFamily = columnFamily;
        this.success = success;
    }

    public MessageOut<TruncateResponse> createMessage()
    {
        return new MessageOut<TruncateResponse>(MessagingService.Verb.REQUEST_RESPONSE, this, serializer);
    }

    public static class TruncateResponseSerializer implements IVersionedSerializer<TruncateResponse>
    {
        public void serialize(TruncateResponse tr, DataOutput dos, int version) throws IOException
        {
            dos.writeUTF(tr.keyspace);
            dos.writeUTF(tr.columnFamily);
            dos.writeBoolean(tr.success);
        }

        public TruncateResponse deserialize(DataInput dis, int version) throws IOException
        {
            String keyspace = dis.readUTF();
            String columnFamily = dis.readUTF();
            boolean success = dis.readBoolean();
            return new TruncateResponse(keyspace, columnFamily, success);
        }

        public long serializedSize(TruncateResponse tr, int version)
        {
            return TypeSizes.NATIVE.sizeof(tr.keyspace)
                 + TypeSizes.NATIVE.sizeof(tr.columnFamily)
                 + TypeSizes.NATIVE.sizeof(tr.success);
        }
    }
}


text:
from glacier_flow_model.base import Base
from osgeo.gdal import Open, Dataset
import importlib.resources as resources

class PkgDataAccess(Base):
    """Package example data bindings."""

    def __init__(self, verbose: bool = False) -> None:
        """
        Initializes an instance of the PkgDataAccess class.

        Parameters
        ----------
        verbose : bool
            Should information be printed?

        Returns
        -------
        None
            Constructor of the PkgDataAccess class.

        """
        super().__init__(verbose)
        self.verbose = verbose

    def locate_dem(self) -> str:
        """
        Locates the file 'dem.tif' on the current system.

        Returns
        -------
        str
            The path to the file on the system.

        """
        with resources.path('glacier_flow_model.data', 'dem.tif') as file_path:
            self._print(f"Example located at '{file_path}' ...")
            return str(file_path)

    def load_dem(self) -> Dataset:
        """
        Loads the file 'dem.tif' on the current system.

        Returns
        -------
        Dataset
            The example digital elevation model.

        """
        file_path = self.locate_dem()
        self._print(f"Reading example from '{file_path}' ...")
        dem = Open(file_path)
        return dem


text:
require "dictionary_lookup/pearson"

module DictionaryLookup
  class Base
    # Handles a lookup request
    #
    # @param (see Pearson.define)
    # @return (see Pearson.define)
    # @raise (see Pearson.define)
    def self.define(term, config={})
      Pearson.define(term, config)
    end
  end
end