text:
// Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.

using System;
using System.Collections.Immutable;
using System.Composition;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.CodeFixes;
using Microsoft.CodeAnalysis.Editing;
using System.Collections.Generic;
using Microsoft.CodeAnalysis;
using Analyzer.Utilities;

namespace Microsoft.ApiDesignGuidelines.Analyzers
{
    /// <summary>
    /// CA1033: Interface methods should be callable by child types
    /// </summary>
    [ExportCodeFixProvider(LanguageNames.CSharp, LanguageNames.VisualBasic), Shared]
    public sealed class InterfaceMethodsShouldBeCallableByChildTypesFixer : CodeFixProvider
    {
        public sealed override ImmutableArray<string> FixableDiagnosticIds
        {
            get { return ImmutableArray.Create(InterfaceMethodsShouldBeCallableByChildTypesAnalyzer.RuleId); }
        }

        public override FixAllProvider GetFixAllProvider()
        {
            return WellKnownFixAllProviders.BatchFixer;
        }

        public async override Task RegisterCodeFixesAsync(CodeFixContext context)
        {
            SemanticModel semanticModel = await context.Document.GetSemanticModelAsync(context.CancellationToken).ConfigureAwait(false);
            SyntaxNode root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
            SyntaxNode nodeToFix = root.FindNode(context.Span);
            if (nodeToFix == null)
            {
                return;
            }

            var methodSymbol = semanticModel.GetDeclaredSymbol(nodeToFix, context.CancellationToken) as IMethodSymbol;
            if (methodSymbol == null)
            {
                return;
            }

            SyntaxGenerator generator = SyntaxGenerator.GetGenerator(context.Document);
            SyntaxNode declaration = generator.GetDeclaration(nodeToFix);
            if (declaration == null)
            {
                return;
            }

            IMethodSymbol candidateToIncreaseVisibility = GetExistingNonVisibleAlternate(methodSymbol);
            if (candidateToIncreaseVisibility != null)
            {
                ISymbol symbolToChange = candidateToIncreaseVisibility.IsAccessorMethod() ? candidateToIncreaseVisibility.AssociatedSymbol : candidateToIncreaseVisibility;
                if (symbolToChange != null)
                {
                    string title = string.Format(MicrosoftApiDesignGuidelinesAnalyzersResources.InterfaceMethodsShouldBeCallableByChildTypesFix1, symbolToChange.Name);

                    context.RegisterCodeFix(new MyCodeAction(title,
                         async ct => await MakeProtected(context.Document, symbolToChange, ct).ConfigureAwait(false),
                         equivalenceKey: MicrosoftApiDesignGuidelinesAnalyzersResources.InterfaceMethodsShouldBeCallableByChildTypesFix1),
                    context.Diagnostics);
                }
            }
            else
            {
                ISymbol symbolToChange = methodSymbol.IsAccessorMethod() ? methodSymbol.AssociatedSymbol : methodSymbol;
                if (symbolToChange != null)
                {
                    string title = string.Format(MicrosoftApiDesignGuidelinesAnalyzersResources.InterfaceMethodsShouldBeCallableByChildTypesFix2, symbolToChange.Name);

                    context.RegisterCodeFix(new MyCodeAction(title,
                         async ct => await ChangeToPublicInterfaceImplementation(context.Document, symbolToChange, ct).ConfigureAwait(false),
                         equivalenceKey: MicrosoftApiDesignGuidelinesAnalyzersResources.InterfaceMethodsShouldBeCallableByChildTypesFix2),
                    context.Diagnostics);
                }
            }

            context.RegisterCodeFix(new MyCodeAction(string.Format(MicrosoftApiDesignGuidelinesAnalyzersResources.InterfaceMethodsShouldBeCallableByChildTypesFix3, methodSymbol.ContainingType.Name),
                     async ct => await MakeContainingTypeSealed(context.Document, methodSymbol, ct).ConfigureAwait(false),
                         equivalenceKey: MicrosoftApiDesignGuidelinesAnalyzersResources.InterfaceMethodsShouldBeCallableByChildTypesFix3),
                context.Diagnostics);
        }

        private static IMethodSymbol GetExistingNonVisibleAlternate(IMethodSymbol methodSymbol)
        {
            foreach (IMethodSymbol interfaceMethod in methodSymbol.ExplicitInterfaceImplementations)
            {
                foreach (INamedTypeSymbol type in methodSymbol.ContainingType.GetBaseTypesAndThis())
                {
                    IMethodSymbol candidate = type.GetMembers(interfaceMethod.Name).OfType<IMethodSymbol>().FirstOrDefault(m => !m.Equals(methodSymbol));
                    if (candidate != null)
                    {
                        return candidate;
                    }
                }
            }

            return null;
        }

        private async Task<Document> MakeProtected(Document document, ISymbol symbolToChange, CancellationToken cancellationToken)
        {
            SymbolEditor editor = SymbolEditor.Create(document);

            await editor.EditAllDeclarationsAsync(symbolToChange, (docEditor, declaration) =>
            {
                docEditor.SetAccessibility(declaration, Accessibility.Protected);
            }, cancellationToken).ConfigureAwait(false);

            return editor.GetChangedDocuments().First();
        }

        private async Task<Document> ChangeToPublicInterfaceImplementation(Document document, ISymbol symbolToChange, CancellationToken cancellationToken)
        {
            SymbolEditor editor = SymbolEditor.Create(document);

            IEnumerable<ISymbol> explicitImplementations = GetExplicitImplementations(symbolToChange);
            if (explicitImplementations == null)
            {
                return document;
            }

            await editor.EditAllDeclarationsAsync(symbolToChange, (docEditor, declaration) =>
            {
                SyntaxNode newDeclaration = declaration;
                foreach (ISymbol implementedMember in explicitImplementations)
                {
                    SyntaxNode interfaceTypeNode = docEditor.Generator.TypeExpression(implementedMember.ContainingType);
                    newDeclaration = docEditor.Generator.AsPublicInterfaceImplementation(newDeclaration, interfaceTypeNode);
                }

                docEditor.ReplaceNode(declaration, newDeclaration);
            }, cancellationToken).ConfigureAwait(false);

            return editor.GetChangedDocuments().First();
        }

        private static IEnumerable<ISymbol> GetExplicitImplementations(ISymbol symbol)
        {
            if (symbol == null)
            {
                return null;
            }

            switch (symbol.Kind)
            {
                case SymbolKind.Method:
                    return ((IMethodSymbol)symbol).ExplicitInterfaceImplementations;

                case SymbolKind.Event:
                    return ((IEventSymbol)symbol).ExplicitInterfaceImplementations;

                case SymbolKind.Property:
                    return ((IPropertySymbol)symbol).ExplicitInterfaceImplementations;

                default:
                    return null;
            }
        }

        private async Task<Document> MakeContainingTypeSealed(Document document, IMethodSymbol methodSymbol, CancellationToken cancellationToken)
        {
            SymbolEditor editor = SymbolEditor.Create(document);

            await editor.EditAllDeclarationsAsync(methodSymbol.ContainingType, (docEditor, declaration) =>
            {
                DeclarationModifiers modifiers = docEditor.Generator.GetModifiers(declaration);
                docEditor.SetModifiers(declaration, modifiers + DeclarationModifiers.Sealed);
            }, cancellationToken).ConfigureAwait(false);

            return editor.GetChangedDocuments().First();
        }

        private class MyCodeAction : DocumentChangeAction
        {
            private readonly string _equivalenceKey;

            public MyCodeAction(string title, Func<CancellationToken, Task<Document>> createChangedDocument, string equivalenceKey)
                : base(title, createChangedDocument)
            {
                _equivalenceKey = equivalenceKey;
            }

            public override string EquivalenceKey => _equivalenceKey;
        }
    }
}


text:
<?php
class Slider_model extends CI_Model{
	protected $_table = 'slider';

	public function __construct(){
		parent::__construct();
	}

	public function get_all_sliders(){
		$this->db->select('title, url');
		return $this->db->get($this->_table)->result_array();
	}
}
?>

redpajama_set_name: RedPajamaGithub


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ltg.posserver.repository.jpa;

import com.ltg.posserver.repository.jpa.model.SeguUsuaRole;
import org.springframework.data.jpa.repository.JpaRepository;

/**
 *
 * @author dpeniafiel
 */
public interface SeguUsuaRoleRepository extends JpaRepository<SeguUsuaRole, String> {

}


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

-->

<!-- These resources are around just to allow their values to be customized
     for different hardware and product builds. -->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">

    <!-- Array of ConnectivityManager.TYPE_xxxx values allowable for tethering -->
    <!-- Common options are [1, 4] for TYPE_WIFI and TYPE_MOBILE_DUN or
    <!== [0,1,5,7] for TYPE_MOBILE, TYPE_WIFI, TYPE_MOBILE_HIPRI and TYPE_BLUETOOTH -->
    <integer-array translatable="false" name="config_tether_upstream_types">
      <item>1</item>
      <item>4</item>
      <item>7</item>
      <item>9</item>
    </integer-array>

    <!-- String containing the apn value for tethering.  May be overriden by secure settings
         TETHER_DUN_APN.  Value is a comma separated series of strings:
         "name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type"
         note that empty fields can be ommitted: "name,apn,,,,,,,,,310,260,,DUN" -->
    <string translatable="false" name="config_tether_apndata">SaskTel Tethering,inet.stm.sk.ca,,,,,,,,,302,780,,DUN</string>

    <!-- Don't use roaming icon for considered operators -->
    <string-array translatable="false" name="config_operatorConsideredNonRoaming">
        <item>302</item>
    </string-array>

    <!-- Configure mobile network MTU. Carrier specific value is set here.
    -->
    <integer name="config_mobile_mtu">1358</integer>

</resources>


text:
[![Build Status](https://secure.travis-ci.org/peterbraden/node-opencv.svg)](http://travis-ci.org/peterbraden/node-opencv)

[OpenCV](http://opencv.org) bindings for Node.js. OpenCV is
the defacto computer vision library - by interfacing with it natively in node,
we get powerful real time vision in js.

People are using node-opencv to fly control quadrocoptors, detect faces from
webcam images and annotate video streams. If you're using it for something
cool, I'd love to hear about it!

## Install

You'll need OpenCV 2.3.1 or newer installed before installing node-opencv.

## Specific for macOS
Install OpenCV using brew
```bash
brew install pkg-config
brew install opencv@2
brew link --force opencv@2
```

## Specific for Windows
1. Download and install OpenCV (Be sure to use a 2.4 version) @
http://opencv.org/releases.html
For these instructions we will assume OpenCV is put at C:\OpenCV, but you can
adjust accordingly.

2. If you haven't already, create a system variable called OPENCV_DIR and set it
   to C:\OpenCV\build\x64\vc12

   Make sure the "x64" part matches the version of NodeJS you are using.

   Also add the following to your system PATH
        ;%OPENCV_DIR%\bin

3. Install Visual Studio 2013. Make sure to get the C++ components.
   You can use a different edition, just make sure OpenCV supports it, and you
   set the "vcxx" part of the variables above to match.

4. Download peterbraden/node-opencv fork
git clone https://github.com/peterbraden/node-opencv

5. run npm install

```bash
$ npm install opencv
```

## Examples
Run the examples from the parent directory.

### Face Detection

```javascript
cv.readImage("./examples/files/mona.png", function(err, im){
  im.detectObject(cv.FACE_CASCADE, {}, function(err, faces){
    for (var i=0;i<faces.length; i++){
      var x = faces[i]
      im.ellipse(x.x + x.width/2, x.y + x.height/2, x.width/2, x.height/2);
    }
    im.save('./out.jpg');
  });
})
```

## API Documentation

### Matrix

The [matrix](http://opencv.jp/opencv-2svn_org/cpp/core_basic_structures.html#mat) is the most useful
base data structure in OpenCV. Things like images are just matrices of pixels.

#### Creation

```javascript
new Matrix(rows, cols)
```

Or if you're thinking of a Matrix as an image:

```javascript
new Matrix(height, width)
```

Or you can use opencv to read in image files. Supported formats are in the OpenCV docs, but jpgs etc are supported.

```javascript
cv.readImage(filename, function(err, mat){
  ...
})

cv.readImage(buffer, function(err, mat){
  ...
})
```

If you need to pipe data into an image, you can use an ImageDataStream:

```javascript
var s = new cv.ImageDataStream()

s.on('load', function(matrix){
  ...
})

fs.createReadStream('./examples/files/mona.png').pipe(s);
```

If however, you have a series of images, and you wish to stream them into a
stream of Matrices, you can use an ImageStream. Thus:

```javascript
var s = new cv.ImageStream()

s.on('data', function(matrix){
   ...
})

ardrone.createPngStream().pipe(s);
```

Note: Each 'data' event into the ImageStream should be a complete image buffer.

#### Accessing Data

```javascript
var mat = new cv.Matrix.Eye(4,4); // Create identity matrix

mat.get(0,0) // 1

mat.row(0)  // [1,0,0,0]
mat.col(3)  // [0,0,0,1]
```

##### Save

```javascript
mat.save('./pic.jpg')
```

or:

```javascript
var buff = mat.toBuffer()
```

#### Image Processing

```javascript
im.convertGrayscale()
im.canny(5, 300)
im.houghLinesP()
```

#### Simple Drawing

```javascript
im.ellipse(x, y)
im.line([x1,y1], [x2, y2])
```

#### Object Detection

There is a shortcut method for
[Viola-Jones Haar Cascade](http://docs.opencv.org/trunk/d7/d8b/tutorial_py_face_detection.html) object
detection. This can be used for face detection etc.

```javascript
mat.detectObject(haar_cascade_xml, opts, function(err, matches){})
```

For convenience in face detection, cv.FACE_CASCADE is a cascade that can be used for frontal face detection.

Also:

```javascript
mat.goodFeaturesToTrack
```

#### Contours

```javascript
mat.findCountours
mat.drawContour
mat.drawAllContours
```

### Using Contours

`findContours` returns a `Contours` collection object, not a native array. This object provides
functions for accessing, computing with, and altering the contours contained in it.
See [relevant source code](src/Contours.cc) and [examples](examples/)

```javascript
var contours = im.findContours();

// Count of contours in the Contours object
contours.size();

// Count of corners(verticies) of contour `index`
contours.cornerCount(index);

// Access vertex data of contours
for(var c = 0; c < contours.size(); ++c) {
  console.log("Contour " + c);
  for(var i = 0; i < contours.cornerCount(c); ++i) {
    var point = contours.point(c, i);
    console.log("(" + point.x + "," + point.y + ")");
  }
}

// Computations of contour `index`
contours.area(index);
contours.arcLength(index, isClosed);
contours.boundingRect(index);
contours.minAreaRect(index);
contours.isConvex(index);
contours.fitEllipse(index);

// Destructively alter contour `index`
contours.approxPolyDP(index, epsilon, isClosed);
contours.convexHull(index, clockwise);
```

#### Face Recognization

It requires to `train` then `predict`. For acceptable result, the face should be cropped, grayscaled and aligned, I ignore this part so that we may focus on the api usage.

** Please ensure your OpenCV 3.2+ is configured with contrib. MacPorts user may `port install opencv +contrib` **

```javascript
const fs = require('fs');
const path = require('path');
const cv = require('opencv');

function forEachFileInDir(dir, cb) {
  let f = fs.readdirSync(dir);
  f.forEach(function (fpath, index, array) {
    if (fpath != '.DS_Store')
     cb(path.join(dir, fpath));
  });
}

let dataDir = "./_training";
function trainIt (fr) {
  // if model existe, load it
  if ( fs.existsSync('./trained.xml') ) {
    fr.loadSync('./trained.xml');
    return;
  }

  // else train a model
  let samples = [];
  forEachFileInDir(dataDir, (f)=>{
      cv.readImage(f, function (err, im) {
          // Assume all training photo are named as id_xxx.jpg
          let labelNumber = parseInt(path.basename(f).substring(3));
          samples.push([labelNumber, im]);
      })
  })

  if ( samples.length > 3 ) {
    // There are async and sync version of training method:
    // .train(info, cb)
    //     cb : standard Nan::Callback
    //     info : [[intLabel,matrixImage],...])
    // .trainSync(info)
    fr.trainSync(samples);
    fr.saveSync('./trained.xml');
  }else {
    console.log('Not enough images uploaded yet', cvImages)
  }
}

function predictIt(fr, f){
  cv.readImage(f, function (err, im) {
    let result = fr.predictSync(im);
    console.log(`recognize result:(${f}) id=${result.id} conf=${100.0-result.confidence}`);
  });
}

//using defaults: .createLBPHFaceRecognizer(radius=1, neighbors=8, grid_x=8, grid_y=8, threshold=80)
const fr = new cv.FaceRecognizer();
trainIt(fr);
forEachFileInDir('./_bench', (f) => predictIt(fr, f));
```

## Test

Using [tape](https://github.com/substack/tape). Run with command:

`npm test`.

## Contributing

I (@peterbraden) don't spend much time maintaining this library, it runs
primarily on contributor support. I'm happy to accept most PR's if the tests run
green, all new functionality is tested, and there are no objections in the PR.

Because I haven't got much time for maintenance, I'd prefer to keep an absolute
minimum of dependencies.

## MIT License
The library is distributed under the MIT License - if for some reason that
doesn't work for you please get in touch.


text:
/** Automatically generated file. DO NOT MODIFY */
package androidinterview.com.cutomlistviewimage;

public final class BuildConfig {
    public final static boolean DEBUG = true;
}


text:
import { lighten, darken, transparentize } from 'polished'

export const backgroundColor = `#151f33`

export const blackColor = `black`

export const lighterBackgroundColor = lighten(0.06, backgroundColor)

export const darkerBackgroundColor = darken(0.06, backgroundColor)

export const textColorDarkBackground = `#c8c8c8`

export const textColorLightBackground = `#454545`

export const textLinkColor = `#1b7fe3`

export const lighterTextLinkColor = transparentize(0.5, textLinkColor)

export const lighterTextColorDarkBackground = lighten(
  0.5,
  textColorDarkBackground
)

export const darkerTextColorDarkBackground = darken(
  0.5,
  textColorDarkBackground
)


text:
@interface DKHelpMeTableViewController ()

@property (strong, nonatomic) NSArray *helpQAData;

@end

@implementation DKHelpMeTableViewController

- (id)initWithStyle:(UITableViewStyle)style
{
    self = [super initWithStyle:style];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];

    NSString *path = [[NSBundle mainBundle] pathForResource:@"helpMe-QA" ofType:@"plist"];
    self.helpQAData = [NSArray arrayWithContentsOfFile:path];
    self.clearsSelectionOnViewWillAppear = YES;

}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    [MobClick beginLogPageView:HelpMeView];
}

- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
    [MobClick endLogPageView:HelpMeView];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - Table view data source

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return (TableCellRowHeight + 10);
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return [self.helpQAData count];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"helpMeCell" forIndexPath:indexPath];

    NSDictionary *item = [self.helpQAData objectAtIndex:indexPath.row];
    NSString *question = [item valueForKey:@"question"];

    cell.textLabel.text = question;

    return cell;
}

#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{

    DKDetailHelpMeViewController *detailHelpMeViewController = (DKDetailHelpMeViewController*)[segue destinationViewController];

    NSIndexPath *selectedIndexPath = [self.tableView indexPathForSelectedRow];
    NSDictionary *item = [self.helpQAData objectAtIndex:selectedIndexPath.row];
    detailHelpMeViewController.question = [item valueForKey:@"question"];
    NSString *answer = [item valueForKey:@"answer"];
    detailHelpMeViewController.answer = [answer stringByReplacingOccurrencesOfString:@"N" withString:@"\n"];

}

@end


text:
package bolianeducation.bolianchild.view.base;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.view.ViewPager;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

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

import bolianeducation.bolianchild.R;
import bolianeducation.bolianchild.adapter.base.CommonPagerAdapter;
import bolianeducation.bolianchild.view.BaseActivity;
import bolianeducation.bolianchild.view.MainActivity;
import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Author: river
 * Date: 2015/11/27 11:26
 * Description: 引导页面
 */
public class GuideActivity extends BaseActivity {
    @BindView(R.id.vp_pager)
    ViewPager viewPager;
    @BindView(R.id.tv_go)
    TextView tvGo;
    private List<View> views;

    private int[] images = new int[]{R.mipmap.bg_guide1, R.mipmap.bg_guide2, R.mipmap.bg_guide3};

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.guide_activity);
        ButterKnife.bind(this);
        initViewPager();
    }

    private void initViewPager() {
        views = new ArrayList<>();

        for (int i = 0; i < images.length; i++) {
            // 循环加入图片
            ImageView imageView = new ImageView(context);
            imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
            imageView.setBackgroundResource(images[i]);
            views.add(imageView);
        }

        viewPager.setAdapter(new CommonPagerAdapter(views));

        viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
            @Override
            public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {

            }

            @Override
            public void onPageSelected(int position) {
                if (position == views.size() - 1) {
                    views.get(position).setOnClickListener(new View.OnClickListener() {
                        @Override
                        public void onClick(View view) {
                            startActivity(new Intent(context, MainActivity.class));
                            finish();
                        }
                    });
                }
            }

            @Override
            public void onPageScrollStateChanged(int state) {

            }
        });
    }
}


text:
#include "renderer/animator.h"
#include "slenderer.h"

void sl_animator_create( sl_animator *animator, sl_scene *scene )
{
	animator->transforms = vul_vector_create( sizeof( sl_animation_transform ), 0, SL_ALLOC, SL_DEALLOC, SL_REALLOC );
	animator->sprites = vul_vector_create( sizeof( sl_animation_sprite ), 0, SL_ALLOC, SL_DEALLOC, SL_REALLOC );

	animator->next_animation_id = 0;

	animator->clock = vul_timer_create( );
	animator->last_time = vul_timer_get_millis( animator->clock );

	animator->scene_id = scene->scene_id;
}
void sl_animator_destroy( sl_animator *animator )
{
	vul_vector_destroy( animator->transforms );
	vul_vector_destroy( animator->sprites );

	vul_timer_destroy( animator->clock );
}

unsigned int sl_animator_add_transform( sl_animator *animator, unsigned int entity_id, const m44 *end_world_matrix, unsigned long long length_in_ms, sl_animation_state state )
{
	sl_animation_transform* t;
	sl_scene *s;

	s = sl_renderer_get_scene_by_id( animator->scene_id );
	t = ( sl_animation_transform* )vul_vector_add_empty( animator->transforms );
	t->animation_id = animator->next_animation_id++;
	t->entity_id = entity_id;
	t->start_time = vul_timer_get_millis( animator->clock );
	t->end_time = t->start_time + length_in_ms;
	t->start_world_mat = sl_scene_get_const_entity( s, entity_id, 0xffffffff )->world_matrix;
	t->end_world_mat = *end_world_matrix;
	assert( state == SL_ANIMATION_RUNNING || SL_ANIMATION_RUNNING_LOOPED || SL_ANIMATION_RUNNING_PERIODIC );
	t->state = state;

	return t->animation_id;
}

unsigned int sl_animator_add_sprite( sl_animator *animator, unsigned int entity_id, vul_vector *frames, unsigned long long ms_per_frame, sl_animation_state state )
{
	sl_animation_sprite* t;

	t = ( sl_animation_sprite* )vul_vector_add_empty( animator->sprites );
	t->animation_id = animator->next_animation_id++;
	t->entity_id = entity_id;
	t->time_per_frame_in_ms = ms_per_frame;
	t->time_since_current_frame = 0ull;
	t->frames = frames;
	t->frame_count = vul_vector_size( frames );
	t->current_frame = 0;
	assert( state == SL_ANIMATION_RUNNING || SL_ANIMATION_RUNNING_LOOPED || SL_ANIMATION_RUNNING_PERIODIC );
	t->state = state;
	t->period_rising = SL_TRUE;

	return t->animation_id;
}

void sl_animator_remove_animation( sl_animator *animator, unsigned int id, sl_animation_type type )
{
	unsigned int i;
	sl_animation_transform *ita, *last_ita;
	sl_animation_sprite *its, *last_its;

	if( type == SL_ANIMATION_TRANSFORM || type == SL_ANIMATION_EITHER )
	{
		i = 0;
		vul_foreach( sl_animation_transform, ita, last_ita, animator->transforms )
		{
			if( ita->animation_id == id ) {
				vul_vector_remove_swap( animator->transforms, i );
				// Now the iterator is unstable, but we break so it's ok.
				break;
			}
			++i;
		}
	}
	if( type == SL_ANIMATION_SPRITE || type == SL_ANIMATION_EITHER )
	{
		i = 0;
		vul_foreach( sl_animation_sprite, its, last_its, animator->sprites )
		{
			if( its->animation_id == id ) {
				vul_vector_remove_swap( animator->sprites, i );
				// Now the iterator is unstable, but we break so it's ok.
				break;
			}
			++i;
		}
	}
}

void sl_animator_update( sl_animator *animator )
{
	unsigned long long now, elapsed, now_relative, total, length_in_ms;
	unsigned int i;
	float t;
	sl_animation_transform *ita, *last_ita;
	sl_animation_sprite *its, *last_its;
	sl_entity *entity;
	sl_animation_sprite_state *state;
	sl_scene *s;
	int deleted;
	m44 tmp;

	// Calculate time since last frame
	now = vul_timer_get_millis( animator->clock );
	elapsed = now - animator->last_time;
	animator->last_time = now;

	s = sl_renderer_get_scene_by_id( animator->scene_id );

	// @TODO: For stopped animations; add elapsed to all times!

	// First, remove any animations that are done. @NOTE: This is slow, since
	// we may have resizes in vul_vector at any time, so any deletion leads to a restart
	// of the entire search. BUT, it should be a small vector and we should have relatively
	// few overlaps anyway, so we're fine...
	while( 1 ) {
		deleted = 0;
		i = 0;
		vul_foreach( sl_animation_transform, ita, last_ita, animator->transforms )
		{
			if( ita->end_time < now ) {
				if( ita->state == SL_ANIMATION_RUNNING_LOOPED ) {
					// Reset to beginning
					length_in_ms = ita->end_time - ita->start_time;
					ita->start_time = now;
					ita->end_time = now + length_in_ms;
					// @TODO: Add callbacks that are called at loop reset/periodic reset
					// to f.ex. add an effect there.
				} else if( ita->state == SL_ANIMATION_RUNNING_PERIODIC ) {
					// Reset time beginning
					length_in_ms = ita->end_time - ita->start_time;
					ita->start_time = now;
					ita->end_time = now + length_in_ms;
					// Swap end and beginning matrices
					memcpy( &tmp, &ita->end_world_mat, sizeof( m44 ) );
					memcpy( &ita->end_world_mat, &ita->start_world_mat, sizeof( m44 ) );
					memcpy( &ita->start_world_mat, &tmp, sizeof( m44 ) );
					// @TODO: Add callbacks that are called at loop reset/periodic reset
					// to f.ex. add an effect there.
				} else {
					// Move to final matrix when done
					entity = sl_scene_get_volitile_entity( s, ita->entity_id, 0xffffffff );
					memcpy( &entity->world_matrix, &ita->end_world_mat, sizeof( m44 ) );
					ita->state = SL_ANIMATION_FINISHED;
				}
				if( ita->state == SL_ANIMATION_FINISHED ) {
					deleted = 1;
					vul_vector_remove_swap( animator->transforms, i );
					break;
				}
			}
			++i;
		}
		if( !deleted ) {
			break; // We did not delete any more items, so we are done.
		}
	}
	while( 1 ) {
		deleted = 0;
		i = 0;
		vul_foreach( sl_animation_sprite, its, last_its, animator->sprites )
		{
			if( its->current_frame == ( int )its->frame_count - 1 && its->period_rising
				&& ( elapsed + its->time_since_current_frame ) >= its->time_per_frame_in_ms ) {
				if( its->state == SL_ANIMATION_RUNNING_LOOPED ) {
					// Reset to beginning
					its->current_frame = -1;
				} else if( its->state == SL_ANIMATION_RUNNING_PERIODIC ) {
					// Change period
					its->period_rising = SL_FALSE;
				} else {
					its->state = SL_ANIMATION_FINISHED;
				}
				if( its->state == SL_ANIMATION_FINISHED ) {
					deleted = 1;
					vul_vector_remove_swap( animator->sprites, i );
					break;
				}
			} else if ( its->current_frame == 0 && !its->period_rising
				&& ( elapsed + its->time_since_current_frame ) >= its->time_per_frame_in_ms ) {
				// Can only happen for oscillating things
				its->period_rising = SL_TRUE;
			}
			++i;
		}
		if( !deleted ) {
			break; // We did not delete any more items, so we are done.
		}
	}

	// Iterate over the transforms and update them
	vul_foreach( sl_animation_transform, ita, last_ita, animator->transforms )
	{
		// Calculate t
		total = ita->end_time - ita->start_time;
		now_relative = now - ita->start_time;
		t = ( float )( ( double )now_relative / ( double )total );
		if( t < 0.f ) {
			t = 0.f;
		} else if ( t > 1.f ) {
			t = 1.f;
		}

		// Grab the entity
		entity = sl_scene_get_volitile_entity( s, ita->entity_id, 0xffffffff ); // @TODO: This is why we want layer info when we add a transform!

		// Set the new matrix, a linear interpolation at t. @TODO: Might want to quaternion it up at some point; slerp for the orientation here!
		entity->world_matrix = mlerp44( &ita->start_world_mat, &ita->end_world_mat, t );
	}

	// Iterate over the sprites and update them.
	vul_foreach( sl_animation_sprite, its, last_its, animator->sprites )
	{
		its->time_since_current_frame += elapsed;
		if( its->time_since_current_frame > its->time_per_frame_in_ms ) {
			// Advance the animation
			its->time_since_current_frame -= its->time_per_frame_in_ms;

			entity = sl_scene_get_volitile_entity( s, its->entity_id, 0xffffffff ); // @TODO: This is why we want layer info when we add a sprite!
			if( its->period_rising ) {
				state = ( sl_animation_sprite_state* )vul_vector_get( its->frames, ++its->current_frame );
			} else {
				state = ( sl_animation_sprite_state* )vul_vector_get( its->frames, --its->current_frame );
			}

			entity->uvs = state->uvs;
			entity->texture_id = state->texture_id;
		}
	}
}


text:
package org.hale.commons.io;

import java.util.Iterator;

/**
 * Created by guilherme on 5/27/17.
 * hale
 */
public interface Sink {
    void write(Iterator<Object> stream);
}


text:
package com.github.javon.labassistant.fragments;

import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.github.javon.labassistant.R;
import com.github.javon.labassistant.classes.helpers.RecyclerItemClickListener;
import com.github.javon.labassistant.classes.holders.CourseViewHolder;
import com.javon.parserecyclerviewadapter.ParseRecyclerQueryAdapter;
import com.parse.ParseObject;

/**
 * A simple {@link Fragment} subclass.
 * Activities that contain this fragment must implement the
 * {@link OnCourseSelectedListener} interface
 * to handle interaction events.
 * Use the {@link CourseFragment#newInstance} factory method to
 * create an instance of this fragment.
 */
public class CourseFragment extends Fragment {

    private OnCourseSelectedListener mListener;

    public CourseFragment() {
        // Required empty public constructor
    }

    /**
     * Use this factory method to create a new instance of
     * this fragment using the provided parameters.
     *
     * @return A new instance of fragment CourseFragment.
     */
    public static CourseFragment newInstance() {
        return new CourseFragment();
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_course, container, false);

        RecyclerView mRecyclerView = (RecyclerView) view.findViewById(R.id.course_list);
        mRecyclerView.setHasFixedSize(true);
        RecyclerView.LayoutManager mLayoutManager = new LinearLayoutManager(getActivity());
        mRecyclerView.setLayoutManager(mLayoutManager);
        final ParseRecyclerQueryAdapter<ParseObject,CourseViewHolder> adapter = new ParseRecyclerQueryAdapter<>(getActivity(), CourseViewHolder.class,"Course");

        mRecyclerView.addOnItemTouchListener(new RecyclerItemClickListener(getActivity(), new RecyclerItemClickListener.OnItemClickListener() {
            @Override
            public void onItemClick(View view, int position) {
                mListener.onCourseSelected(adapter.getItem(position).getString("title"),
                        adapter.getItem(position).getInt("lab_count"),
                        adapter.getItem(position).getString("grade_table_name"));
            }
        }));
        mRecyclerView.setAdapter(adapter);
        return view;
    }

    @Override
    public void onAttach(Context context) {
        super.onAttach(context);
        if (context instanceof OnCourseSelectedListener) {
            mListener = (OnCourseSelectedListener) context;
        } else {
            throw new RuntimeException(context.toString()
                    + " must implement OnCourseSelectedListener");
        }
    }

    @Override
    public void onDetach() {
        super.onDetach();
        mListener = null;
    }

    /**
     * This interface must be implemented by activities that contain this
     * fragment to allow an interaction in this fragment to be communicated
     * to the activity and potentially other fragments contained in that
     * activity.
     *

     * See the Android Training lesson Communicating with Other Fragments for more information.
     */
    public interface OnCourseSelectedListener {
        void onCourseSelected(String courseName, int labCount, String gradeTableName);
    }
}


text:
import {List} from 'immutable';

import DataType from './';

/**
 * @extends src/types/view/data/index.js~DataType
 */
export default class DropDownType extends DataType {
  static typeName = 'dropDown';

  /**
   * Supports async loading of options. The `getOptions` method will then be
   * passed a second argument of the current drop down text input. The return
   * value is expected to be a promise.
   * @params {DataType} dataType - The data type to provide.
   * @return {boolean} `true` if the options are loaded asynchronously.
   */
  isAsync(dataType) {
    return dataType.isAsync
      ? dataType.isAsync()
      : false;
  }

  /**
   * Returns if this display should allow picking multiple items or not.
   * @param {DataType} dataType - An optional data type to provide.
   * @return {boolean} `true` if this should allow picking multiple options.
   */
  isMulti(dataType) {
    if (this.options.has('multi')) {
      return this.options.get('multi');
    } else if (dataType && dataType.isMulti) {
      return dataType.isMulti();
    }
    return false;
  }

  /**
   * Returns a list of avaliable options in the drop down, either specified in
   * this view type's options, or in the passed in data type.
   * @param {RenderData} renderData - The render data to get options from.
   * @param {string} input - If async, the input entered to return options for.
   * @return {Immutable.List} a list of options.
   */
  getOptions(renderData, input) {
    if (this.options.has('options')) {
      return this.options.get('options', List());
    }

    const field = this.getField(renderData);
    if (field && field.getValues) {
      if (this.isAsync(field)) {
        return (typeof input == 'string' && input.length > 0)
          ? field.getValues(input, renderData.options)
          : Promise.resolve({complete: false, options: []});
      } else {
        return field.getValues();
      }
    }

    return List();
  }

  getValueOption(dataType, value, renderData) {
    if (!value) {
      return [];
    }

    const label = dataType.getDisplay(value, renderData.options);
    if (!label) {
      return [];
    }
    return [{
      value,
      label,
      title: label
    }];
  }

  /**
   * Allows subtypes to define filter options for faster searches. Returns
   * undefined so that the default filter options are used.
   * @return The filter options.
   */
  getFilterOptions(dataType) {
    return dataType.getFilterOptions
      ? dataType.getFilterOptions()
      : undefined;
  }
}


text:
<?php

namespace PHPExiftool\Driver\Tag\ExifIFD;

use JMS\Serializer\Annotation\ExclusionPolicy;
use PHPExiftool\Driver\AbstractTag;

/**
 * @ExclusionPolicy("all")
 */
class GDALMetadata extends AbstractTag
{

    protected $Id = 42112;

    protected $Name = 'GDALMetadata';

    protected $FullName = 'Exif::Main';

    protected $GroupName = 'ExifIFD';

    protected $g0 = 'EXIF';

    protected $g1 = 'IFD0';

    protected $g2 = 'Image';

    protected $Type = '?';

    protected $Writable = false;

    protected $Description = 'GDAL Metadata';

    protected $local_g1 = 'ExifIFD';
}


text:
package state_1;
import java.awt.Color;
import javax.swing.ImageIcon;
//========================================================
//Characteristics of this implementation
//1)The constructor of class Context has no parameter.
//   The purpose is that the client class, when use class
//   Context, it doesn't need to create any object of the
//   WeatherState class. Or, the client class doesn't have to
//   know the existence of the WeatherState class
//2)Context class only calls the WeatherState class, and the
//   WeatherState class never calls class Context
//3)This design is totally extenssible. When adding a new state
//   The only thing to do: add a new subclass, and modify methods
//   changeState(), and createStateObj(). You don't need to change
//   class StateAnimatGUI and Context class
//========================================================

public class Context{

   private WeatherState state;

   public Context(){
	  state = new SunnyState();
   }

   //This method is called by the client class to show the
   //current state in a String format
   public String getWeatherState() {
	  return state.getCurrentState();
   }
   //This method is called by the client class to show the
   //color in a String format
   public Color getColor() {
   	  return state.setColor();
   }

   //This method is called by the client class to get the
   //image icon, which will be displayed on the screen
   public ImageIcon getImgIcon(){
   	  return state.setImgIcon();
   }
   //No conditional statements here. Better for extention;
   //Add a new state will not need to change any code here.
   public String doAction(){
	  state.changeState();
	  state = state.createStateObj();
      String voice = state.act();
      return voice;
   }
}


text:
import os
from setuptools import setup

with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme:
    README = readme.read()

# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))

setup(
    name='django-prickly-reports',
    version='0.12',
    packages=['reporting'],
    include_package_data=True,
    license='MIT License',  # example license
    description='A small, generic, django app to generate data reports.',
    long_description=README,
    url='',
    author='Stett',
    author_email='stettjawa@gmail.com',
    classifiers=[
        'Environment :: Web Environment',
        'Framework :: Django',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: MIT License',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        # Replace these appropriately if you are stuck on Python 2.
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.7',
        'Topic :: Internet :: WWW/HTTP',
        'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
    ],
)


text:
from aleph.core import celery as app # noqa
from aleph.crawlers import crawl_source # noqa


text:
package org.jfree.chart.plot;

import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Paint;
import java.awt.Stroke;
import java.io.Serializable;

import org.jfree.chart.event.MarkerChangeEvent;
import org.jfree.ui.GradientPaintTransformer;
import org.jfree.ui.LengthAdjustmentType;
import org.jfree.util.ObjectUtilities;

/**
 * Represents an interval to be highlighted in some way.
 */
public class IntervalMarker extends Marker implements Cloneable, Serializable {

    /** For serialization. */
    private static final long serialVersionUID = -1762344775267627916L;

    /** The start value. */
    private double startValue;

    /** The end value. */
    private double endValue;

    /** The gradient paint transformer (optional). */
    private GradientPaintTransformer gradientPaintTransformer;

    /**
     * Constructs an interval marker.
     *
     * @param start  the start of the interval.
     * @param end  the end of the interval.
     */
    public IntervalMarker(double start, double end) {
        this(start, end, Color.gray, new BasicStroke(0.5f), Color.gray,
                new BasicStroke(0.5f), 0.8f);
    }

    /**
     * Creates a new interval marker with the specified range and fill paint.
     * The outline paint and stroke default to null.
     *
     * @param start  the lower bound of the interval.
     * @param end  the upper bound of the interval.
     * @param paint  the fill paint (null not permitted).
     *
     * @since 1.0.9
     */
    public IntervalMarker(double start, double end, Paint paint) {
        this(start, end, paint, new BasicStroke(0.5f), null, null, 0.8f);
    }

    /**
     * Constructs an interval marker.
     *
     * @param start  the start of the interval.
     * @param end  the end of the interval.
     * @param paint  the paint (null not permitted).
     * @param stroke  the stroke (null not permitted).
     * @param outlinePaint  the outline paint.
     * @param outlineStroke  the outline stroke.
     * @param alpha  the alpha transparency.
     */
    public IntervalMarker(double start, double end,
                          Paint paint, Stroke stroke,
                          Paint outlinePaint, Stroke outlineStroke,
                          float alpha) {

        super(paint, stroke, outlinePaint, outlineStroke, alpha);
        this.startValue = start;
        this.endValue = end;
        this.gradientPaintTransformer = null;
        setLabelOffsetType(LengthAdjustmentType.CONTRACT);

    }

    /**
     * Returns the start value for the interval.
     *
     * @return The start value.
     */
    public double getStartValue() {
        return this.startValue;
    }

    /**
     * Sets the start value for the marker and sends a
     * {@link MarkerChangeEvent} to all registered listeners.
     *
     * @param value  the value.
     *
     * @since 1.0.3
     */
    public void setStartValue(double value) {
        this.startValue = value;
        notifyListeners(new MarkerChangeEvent(this));
    }

    /**
     * Returns the end value for the interval.
     *
     * @return The end value.
     */
    public double getEndValue() {
        return this.endValue;
    }

    /**
     * Sets the end value for the marker and sends a
     * {@link MarkerChangeEvent} to all registered listeners.
     *
     * @param value  the value.
     *
     * @since 1.0.3
     */
    public void setEndValue(double value) {
        this.endValue = value;
        notifyListeners(new MarkerChangeEvent(this));
    }

    /**
     * Returns the gradient paint transformer.
     *
     * @return The gradient paint transformer (possibly null).
     */
    public GradientPaintTransformer getGradientPaintTransformer() {
        return this.gradientPaintTransformer;
    }

    /**
     * Sets the gradient paint transformer and sends a
     * {@link MarkerChangeEvent} to all registered listeners.
     *
     * @param transformer  the transformer (null permitted).
     */
    public void setGradientPaintTransformer(
            GradientPaintTransformer transformer) {
        this.gradientPaintTransformer = transformer;
        notifyListeners(new MarkerChangeEvent(this));
    }

    /**
     * Tests the marker for equality with an arbitrary object.
     *
     * @param obj  the object (null permitted).
     *
     * @return A boolean.
     */
    public boolean equals(Object obj) {
        if (obj == this) {
            return true;
        }
        if (!(obj instanceof IntervalMarker)) {
            return false;
        }
        if (!super.equals(obj)) {
            return false;
        }
        IntervalMarker that = (IntervalMarker) obj;
        if (this.startValue != that.startValue) {
            return false;
        }
        if (this.endValue != that.endValue) {
            return false;
        }
        if (!ObjectUtilities.equal(this.gradientPaintTransformer,
                that.gradientPaintTransformer)) {
            return false;
        }
        return true;
    }

    /**
     * Returns a clone of the marker.
     *
     * @return A clone.
     *
     * @throws CloneNotSupportedException Not thrown by this class, but the
     *         exception is declared for the use of subclasses.
     */
    public Object clone() throws CloneNotSupportedException {
        return super.clone();
    }

}


text:
<?php
/**
 * @var yii\web\View $this
 * @var cornernote\workflow\manager\models\form\StatusForm $model
 * @var ActiveForm $form
 */

use cornernote\workflow\manager\models\Metadata;
use yii\helpers\Html;
use yii\bootstrap\ActiveForm;

?>

    <?php $form = ActiveForm::begin([
        'id' => 'Status',
        'enableClientValidation' => false,
        'errorSummaryCssClass' => 'error-summary alert alert-error'
    ]) ?>

    <?php echo $model->errorSummary($form); ?>

    <fieldset>
        <legend><?= Yii::t('workflow', 'Status') ?></legend>
        <?= $form->field($model->status, 'id')->textInput(['maxlength' => true]) ?>
        <?= $form->field($model->status, 'label')->textInput(['maxlength' => true]) ?>
    </fieldset>

    <fieldset>
        <legend><?= Yii::t('workflow', 'Metadata') ?>
            <?php
            // new metadata button
            echo Html::a(' ' . Yii::t('workflow', 'New Metadata'), 'javascript:void(0);', [
                'id' => 'status-new-metadata-button',
                'class' => 'pull-right btn btn-default btn-xs'
            ])
            ?>
        </legend>
        <?php
        // metadata table
        $metadata = new Metadata();
        $metadata->loadDefaultValues();
        echo '
';
        echo '
';
        echo '
';
        echo '' . $metadata->getAttributeLabel('key') . '	';
        echo '' . $metadata->getAttributeLabel('value') . '	';
        echo ' 	';
        echo '
';
        echo '
';
        echo '
';
        // existing metadatas fields
        foreach ($model->metadatas as $key => $_metadata) {
            echo '
';
            echo $this->render('_form-metadata', [
                'key' => $_metadata->isNewRecord ? (strpos($key, 'new') !== false ? $key : 'new' . $key) : $_metadata->key,
                'form' => $form,
                'metadata' => $_metadata,
            ]);
            echo '
';
        }
        // new metadata fields
        echo '
';
        echo $this->render('_form-metadata', [
            'key' => '__id__',
            'form' => $form,
            'metadata' => $metadata,
        ]);
        echo '
';
        echo '
';
        echo '
';
        ?>

        <?php ob_start(); // output buffer the javascript to register later ?>

        <?php $this->registerJs(str_replace([''], '', ob_get_clean())); ?>

    </fieldset>

    <?= Html::submitButton(' ' . ($model->status->isNewRecord ? Yii::t('workflow', 'Create') : Yii::t('workflow', 'Save')), [
        'id' => 'save-' . $model->formName(),
        'class' => 'btn btn-success'
    ]) ?>
    <?= Html::a(Yii::t('workflow', 'Cancel'), ['default/view', 'id' => $model->status->workflow_id], ['class' => 'btn btn-default']) ?>

    <?php ActiveForm::end(); ?>


text:
package io.swagger.client.model;

import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.client.model.Message100Message;
import io.swagger.client.model.ResourceOem;
import java.util.*;
import java.util.Date;

/**
 * This is the schema definition for a Task resource.
 **/

@ApiModel(description = "This is the schema definition for a Task resource.")
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-05T13:18:34.727-04:00")
public class Task100Task   {

  private String odataContext = null;
  private String odataId = null;
  private String odataType = null;
  private String description = null;
  private Date endTime = null;
  private String id = null;
  private List<Message100Message> messages = new ArrayList<Message100Message>();
  private String name = null;
  private ResourceOem oem = null;
  private Date startTime = null;

  public enum TaskStateEnum {
    NEW("New"),
    STARTING("Starting"),
    RUNNING("Running"),
    SUSPENDED("Suspended"),
    INTERRUPTED("Interrupted"),
    PENDING("Pending"),
    STOPPING("Stopping"),
    COMPLETED("Completed"),
    KILLED("Killed"),
    EXCEPTION("Exception"),
    SERVICE("Service");

    private String value;

    TaskStateEnum(String value) {
      this.value = value;
    }

    @Override
    @JsonValue
    public String toString() {
      return value;
    }
  }

  private TaskStateEnum taskState = null;

  public enum TaskStatusEnum {
    OK("OK"),
    WARNING("Warning"),
    CRITICAL("Critical");

    private String value;

    TaskStatusEnum(String value) {
      this.value = value;
    }

    @Override
    @JsonValue
    public String toString() {
      return value;
    }
  }

  private TaskStatusEnum taskStatus = null;

  /**
   **/

  @ApiModelProperty(value = "")
  @JsonProperty("@odata.context")
  public String getOdataContext() {
    return odataContext;
  }
  public void setOdataContext(String odataContext) {
    this.odataContext = odataContext;
  }

  /**
   **/

  @ApiModelProperty(value = "")
  @JsonProperty("@odata.id")
  public String getOdataId() {
    return odataId;
  }
  public void setOdataId(String odataId) {
    this.odataId = odataId;
  }

  /**
   **/

  @ApiModelProperty(value = "")
  @JsonProperty("@odata.type")
  public String getOdataType() {
    return odataType;
  }
  public void setOdataType(String odataType) {
    this.odataType = odataType;
  }

  /**
   * Provides a description of this resource and is used for commonality  in the schema definitions.
   **/

  @ApiModelProperty(value = "Provides a description of this resource and is used for commonality  in the schema definitions.")
  @JsonProperty("Description")
  public String getDescription() {
    return description;
  }
  public void setDescription(String description) {
    this.description = description;
  }

  /**
   * The date-time stamp that the task was last completed.
   **/

  @ApiModelProperty(value = "The date-time stamp that the task was last completed.")
  @JsonProperty("EndTime")
  public Date getEndTime() {
    return endTime;
  }
  public void setEndTime(Date endTime) {
    this.endTime = endTime;
  }

  /**
   * Uniquely identifies the resource within the collection of like resources.
   **/

  @ApiModelProperty(value = "Uniquely identifies the resource within the collection of like resources.")
  @JsonProperty("Id")
  public String getId() {
    return id;
  }
  public void setId(String id) {
    this.id = id;
  }

  /**
   * This is an array of messages associated with the task.
   **/

  @ApiModelProperty(value = "This is an array of messages associated with the task.")
  @JsonProperty("Messages")
  public List<Message100Message> getMessages() {
    return messages;
  }
  public void setMessages(List<Message100Message> messages) {
    this.messages = messages;
  }

  /**
   * The name of the resource or array element.
   **/

  @ApiModelProperty(value = "The name of the resource or array element.")
  @JsonProperty("Name")
  public String getName() {
    return name;
  }
  public void setName(String name) {
    this.name = name;
  }

  /**
   * This is the manufacturer/provider specific extension moniker used to divide the Oem object into sections.
   **/

  @ApiModelProperty(value = "This is the manufacturer/provider specific extension moniker used to divide the Oem object into sections.")
  @JsonProperty("Oem")
  public ResourceOem getOem() {
    return oem;
  }
  public void setOem(ResourceOem oem) {
    this.oem = oem;
  }

  /**
   * The date-time stamp that the task was last started.
   **/

  @ApiModelProperty(value = "The date-time stamp that the task was last started.")
  @JsonProperty("StartTime")
  public Date getStartTime() {
    return startTime;
  }
  public void setStartTime(Date startTime) {
    this.startTime = startTime;
  }

  /**
   * The state of the task.
   **/

  @ApiModelProperty(value = "The state of the task.")
  @JsonProperty("TaskState")
  public TaskStateEnum getTaskState() {
    return taskState;
  }
  public void setTaskState(TaskStateEnum taskState) {
    this.taskState = taskState;
  }

  /**
   * This is the completion status of the task.
   **/

  @ApiModelProperty(value = "This is the completion status of the task.")
  @JsonProperty("TaskStatus")
  public TaskStatusEnum getTaskStatus() {
    return taskStatus;
  }
  public void setTaskStatus(TaskStatusEnum taskStatus) {
    this.taskStatus = taskStatus;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    Task100Task task100Task = (Task100Task) o;
    return Objects.equals(odataContext, task100Task.odataContext) &&
        Objects.equals(odataId, task100Task.odataId) &&
        Objects.equals(odataType, task100Task.odataType) &&
        Objects.equals(description, task100Task.description) &&
        Objects.equals(endTime, task100Task.endTime) &&
        Objects.equals(id, task100Task.id) &&
        Objects.equals(messages, task100Task.messages) &&
        Objects.equals(name, task100Task.name) &&
        Objects.equals(oem, task100Task.oem) &&
        Objects.equals(startTime, task100Task.startTime) &&
        Objects.equals(taskState, task100Task.taskState) &&
        Objects.equals(taskStatus, task100Task.taskStatus);
  }

  @Override
  public int hashCode() {
    return Objects.hash(odataContext, odataId, odataType, description, endTime, id, messages, name, oem, startTime, taskState, taskStatus);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class Task100Task {\n");

    sb.append("    odataContext: ").append(toIndentedString(odataContext)).append("\n");
    sb.append("    odataId: ").append(toIndentedString(odataId)).append("\n");
    sb.append("    odataType: ").append(toIndentedString(odataType)).append("\n");
    sb.append("    description: ").append(toIndentedString(description)).append("\n");
    sb.append("    endTime: ").append(toIndentedString(endTime)).append("\n");
    sb.append("    id: ").append(toIndentedString(id)).append("\n");
    sb.append("    messages: ").append(toIndentedString(messages)).append("\n");
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    oem: ").append(toIndentedString(oem)).append("\n");
    sb.append("    startTime: ").append(toIndentedString(startTime)).append("\n");
    sb.append("    taskState: ").append(toIndentedString(taskState)).append("\n");
    sb.append("    taskStatus: ").append(toIndentedString(taskStatus)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }
}


text:
class AGLExporter
{
private:
	char*		mPath;
	AglScene*	mScene;
	vector<AglMesh*> mMeshes;
	vector<AglNode> mNodes;
	vector<AglMaterial*> mMaterials;
	vector<AglMaterialMapping> mMaterialMappings;
	vector<AglSkeleton*> mSkeletons;
	vector<AglSkeletonMapping*> mMeshSkeletonMappings;
	vector<AglNodeAnimation*> mNodeAnimations;
	vector<AglAnimationLayer*> mAnimationLayers;
	vector<AglAnimation*> mAnimations;
public:
	AGLExporter(string pPath);
	~AGLExporter();
	void AddMesh(MeshData* pData);
	void AddNode(NodeData* pData);
	void AddSkeleton(SkeletonData* pData);
	void AddMeshSkeletonMapping(AglSkeletonMapping* pData);
	void AddNodeAnimation(NodeAnimationData* pData);
	void AddAnimationLayer(AnimationLayerData* pData);
	void AddAnimation(AnimationData* pData);
	void AddMaterial(MaterialData* pData);
	void AddMaterialMapping(AglMaterialMapping* pData);
	void AddConnectionPoint(pair<AglConnectionPoint, string> pCP);
	void Write();
};

#endif


text:
package com.sequenceiq.mock.clouderamanager.base;

import javax.inject.Inject;
import javax.validation.Valid;

import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;

import com.sequenceiq.mock.clouderamanager.ClouderaManagerStoreService;
import com.sequenceiq.mock.clouderamanager.ResponseCreatorComponent;
import com.sequenceiq.mock.swagger.model.ApiUser2;
import com.sequenceiq.mock.swagger.model.ApiUser2List;

@Controller
public class UsersResourceOperation {

    @Inject
    private ResponseCreatorComponent responseCreatorComponent;

    @Inject
    private ClouderaManagerStoreService clouderaManagerStoreService;

    public ResponseEntity<ApiUser2List> createUsers2(String mockUuid, @Valid ApiUser2List body) {
        ApiUser2List apiUser2List = clouderaManagerStoreService.addUsers(mockUuid, body);
        return responseCreatorComponent.exec(apiUser2List);
    }

    public ResponseEntity<ApiUser2List> readUsers2(String mockUuid, @Valid String view) {
        return responseCreatorComponent.exec(clouderaManagerStoreService.getUserList(mockUuid));
    }

    public ResponseEntity<ApiUser2> updateUser2(String mockUuid, String userName, @Valid ApiUser2 body) {
        ApiUser2 user = clouderaManagerStoreService.updateUser(mockUuid, userName, body);
        return responseCreatorComponent.exec(user);
    }

    public ResponseEntity<ApiUser2> deleteUser2(String mockUuid, String userName) {
        ApiUser2 apiUser2 = clouderaManagerStoreService.removeUser(mockUuid, userName);
        return responseCreatorComponent.exec(apiUser2);
    }
}


text:
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package git4idea.history;

import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Pair;
import com.intellij.openapi.vcs.VcsException;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.Consumer;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.containers.MultiMap;
import git4idea.GitVcs;
import git4idea.commands.Git;
import git4idea.commands.GitLineHandler;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.*;

import static com.intellij.util.ObjectUtils.notNull;
import static git4idea.history.GitLogParser.GitLogOption.HASH;
import static git4idea.history.GitLogParser.GitLogOption.TREE;

/*
 * This class collects records for one commit and sends them together for processing.
 * It also deals with problems with `-m` flag, when `git log` does not provide empty records when a commit is not different from one of the parents.
 */
class GitLogRecordCollector implements Consumer<GitLogRecord> {
  private static final Logger LOG = Logger.getInstance(GitLogRecordCollector.class);

  @NotNull protected final Project myProject;
  @NotNull protected final VirtualFile myRoot;
  @NotNull protected final Consumer<List<GitLogRecord>> myConsumer;

  @NotNull private final MultiMap<String, GitLogRecord> myHashToRecord = MultiMap.createLinked();
  @Nullable private String myLastHash = null;

  protected GitLogRecordCollector(@NotNull Project project,
                                  @NotNull VirtualFile root,
                                  @NotNull Consumer<List<GitLogRecord>> consumer) {
    myProject = project;
    myRoot = root;
    myConsumer = consumer;
  }

  @Override
  public void consume(@NotNull GitLogRecord record) {
    if (!record.getHash().equals(myLastHash)) {
      processCollectedRecords();
    }
    myLastHash = record.getHash();

    myHashToRecord.putValue(record.getHash(), record);
    String[] parents = record.getParentsHashes();
    if (parents.length == 0 || parents.length == myHashToRecord.get(record.getHash()).size()) {
      processCollectedRecords();
    }
  }

  public void finish() {
    processCollectedRecords();
  }

  protected void processCollectedRecords() {
    for (String hash : myHashToRecord.keySet()) {
      ArrayList<GitLogRecord> records = ContainerUtil.newArrayList(notNull(myHashToRecord.get(hash)));
      GitLogRecord firstRecord = records.get(0);
      if (firstRecord.getParentsHashes().length != 0 && records.size() != firstRecord.getParentsHashes().length) {
        processIncompleteRecord(hash, records);
      }
      else {
        myConsumer.consume(records);
      }
    }
    myHashToRecord.clear();
  }

  protected void processIncompleteRecord(@NotNull String hash, @NotNull List<GitLogRecord> records) {
    // there is a surprising (or not really surprising, depending how to look at it) problem with `-m` option
    // despite what is written in git-log documentation, it does not always output a record for each parent of a merge commit
    // if a merge commit has no changes with one of the parents, nothing is output for that parent
    // there is no way of knowing which parent it is just from git-log output
    // if we did not use custom pretty format, line `from <hash>` would appear in the record header
    // but we use, so there is no hash in the record header
    // and there is no format option to display it
    // so the solution is to run another git log command and get tree hashes for all participating commits
    // tree hashes allow to determine, which parent of the commit in question is the same as the commit itself and create an empty record for it
    MultiMap<String, GitLogRecord> incompleteRecords = MultiMap.create();
    incompleteRecords.put(hash, records);
    try {
      processIncompleteRecords(incompleteRecords, myProject, myRoot, myConsumer);
    }
    catch (VcsException e) {
      LOG.error(e);
    }
  }

  public static void processIncompleteRecords(@NotNull MultiMap<String, GitLogRecord> incompleteRecords,
                                              @NotNull Project project,
                                              @NotNull VirtualFile root,
                                              @NotNull Consumer<List<GitLogRecord>> consumer) throws VcsException {
    List<GitLogRecord> firstRecords = ContainerUtil.map(incompleteRecords.entrySet(), e -> ContainerUtil.getFirstItem(e.getValue()));
    Map<String, String> hashToTreeMap = getHashToTreeMap(project, root, firstRecords);
    for (String hash : incompleteRecords.keySet()) {
      ArrayList<GitLogRecord> records = ContainerUtil.newArrayList(notNull(incompleteRecords.get(hash)));
      fillWithEmptyRecords(records, hashToTreeMap);
      consumer.consume(records);
    }
  }

  /*
   * This method calculates tree hashes for commits and their parents.
   */
  @NotNull
  private static Map<String, String> getHashToTreeMap(@NotNull Project project,
                                                      @NotNull VirtualFile root,
                                                      @NotNull Collection<GitLogRecord> records)
    throws VcsException {
    Set<String> hashes = ContainerUtil.newHashSet();

    for (GitLogRecord r : records) {
      hashes.add(r.getHash());
      ContainerUtil.addAll(hashes, r.getParentsHashes());
    }

    GitLineHandler handler = GitLogUtil.createGitHandler(project, root);
    GitLogParser parser = new GitLogParser(project, GitLogParser.NameStatus.NONE, HASH, TREE);
    GitVcs vcs = GitVcs.getInstance(project);
    handler.setStdoutSuppressed(true);
    handler.addParameters(parser.getPretty());
    handler.addParameters(GitLogUtil.getNoWalkParameter(vcs));
    handler.addParameters(GitLogUtil.STDIN);
    handler.endOptions();

    GitLogUtil.sendHashesToStdin(vcs, hashes, handler);
    String output = Git.getInstance().runCommand(handler).getOutputOrThrow();

    List<GitLogRecord> hashAndTreeRecords = parser.parse(output);
    return ContainerUtil.map2Map(hashAndTreeRecords, record -> Pair.create(record.getHash(), record.getTreeHash()));
  }

  /*
   * This method places an empty record for parents that have same tree hash.
   */
  private static void fillWithEmptyRecords(@NotNull List<GitLogRecord> records, @NotNull Map<String, String> hashToTreeMap) {
    GitLogRecord firstRecord = records.get(0);
    String commit = firstRecord.getHash();
    String[] parents = firstRecord.getParentsHashes();

    String commitTreeHash = hashToTreeMap.get(commit);
    LOG.assertTrue(commitTreeHash != null, "Could not get tree hash for commit " + commit);

    for (int parentIndex = 0; parentIndex < parents.length; parentIndex++) {
      String parent = parents[parentIndex];
      // sometimes a merge commit is identical to all its parents
      // in this case, we get one empty record
      String parentTreeHash = hashToTreeMap.get(parent);
      LOG.assertTrue(parentTreeHash != null, "Could not get tree hash for commit " + parent);
      if (parentTreeHash.equals(commitTreeHash) && records.size() < parents.length) {
        records.add(parentIndex, new GitLogRecord(firstRecord.getOptions(), ContainerUtil.emptyList(), firstRecord.isSupportsRawBody()));
      }
    }
  }
}


text:
/*
 * Modified by the GLib Team and others 1997-2000.  See the AUTHORS
 * file for a list of people on the GLib Team.  See the ChangeLog
 * files for a list of changes.  These files are distributed with
 * GLib at ftp://ftp.gtk.org/pub/gtk/.
 */

/*
 * MT safe
 */

#include "config.h"

/* Uncomment the next line (and the corresponding line in gmain.c) to
 * enable debugging printouts if the environment variable
 * G_MAIN_POLL_DEBUG is set to some value.
 */
/* #define G_MAIN_POLL_DEBUG */

#ifdef _WIN32
/* Always enable debugging printout on Windows, as it is more often
 * needed there...
 */
#define G_MAIN_POLL_DEBUG
#endif

#include "glib.h"
#include <sys/types.h>
#include <time.h>
#include <stdlib.h>
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif /* HAVE_SYS_TIME_H */
#ifdef GLIB_HAVE_SYS_POLL_H
#  include <sys/poll.h>
#  undef events	 /* AIX 4.1.5 & 4.3.2 define this for SVR3,4 compatibility */
#  undef revents /* AIX 4.1.5 & 4.3.2 define this for SVR3,4 compatibility */

/* The poll() emulation on OS/X doesn't handle fds=NULL, nfds=0,
 * so we prefer our own poll emulation.
 */
#if defined(_POLL_EMUL_H_) || defined(BROKEN_POLL)
#undef HAVE_POLL
#endif

#endif /* GLIB_HAVE_SYS_POLL_H */
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif /* HAVE_UNISTD_H */
#include <errno.h>

#ifdef G_OS_WIN32
#define STRICT
#include <windows.h>
#endif /* G_OS_WIN32 */

#include "galias.h"

#ifdef G_MAIN_POLL_DEBUG
extern gboolean _g_main_poll_debug;
#endif

#ifdef HAVE_POLL
/* SunOS has poll, but doesn't provide a prototype. */
#  if defined (sun) && !defined (__SVR4)
extern gint poll (struct pollfd *fds, guint nfsd, gint timeout);
#  endif  /* !sun */

/**
 * g_poll:
 * @fds: file descriptors to poll
 * @nfds: the number of file descriptors in @fds
 * @timeout: amount of time to wait, in milliseconds, or -1 to wait forever
 *
 * Polls @fds, as with the poll() system call, but portably. (On
 * systems that don't have poll(), it is emulated using select().)
 * This is used internally by #GMainContext, but it can be called
 * directly if you need to block until a file descriptor is ready, but
 * don't want to run the full main loop.
 *
 * Each element of @fds is a #GPollFD describing a single file
 * descriptor to poll. The %fd field indicates the file descriptor,
 * and the %events field indicates the events to poll for. On return,
 * the %revents fields will be filled with the events that actually
 * occurred.
 *
 * On POSIX systems, the file descriptors in @fds can be any sort of
 * file descriptor, but the situation is much more complicated on
 * Windows. If you need to use g_poll() in code that has to run on
 * Windows, the easiest solution is to construct all of your
 * #GPollFD<!-- -->s with g_io_channel_win32_make_pollfd().
 *
 * Return value: the number of entries in @fds whose %revents fields
 * were filled in, or 0 if the operation timed out, or -1 on error or
 * if the call was interrupted.
 *
 * Since: 2.20
 **/
gint
g_poll (GPollFD *fds,
	guint    nfds,
	gint     timeout)
{
  return poll ((struct pollfd *)fds, nfds, timeout);
}

#else	/* !HAVE_POLL */

#ifdef G_OS_WIN32

static int
poll_rest (gboolean  poll_msgs,
	   HANDLE   *handles,
	   gint      nhandles,
	   GPollFD  *fds,
	   guint     nfds,
	   gint      timeout)
{
  DWORD ready;
  GPollFD *f;
  int recursed_result;

  if (poll_msgs)
    {
      /* Wait for either messages or handles
       * -> Use MsgWaitForMultipleObjectsEx
       */
      if (_g_main_poll_debug)
	g_print ("  MsgWaitForMultipleObjectsEx(%d, %d)\n", nhandles, timeout);

      ready = MsgWaitForMultipleObjectsEx (nhandles, handles, timeout,
					   QS_ALLINPUT, MWMO_ALERTABLE);

      if (ready == WAIT_FAILED)
	{
	  gchar *emsg = g_win32_error_message (GetLastError ());
	  g_warning ("MsgWaitForMultipleObjectsEx failed: %s", emsg);
	  g_free (emsg);
	}
    }
  else if (nhandles == 0)
    {
      /* No handles to wait for, just the timeout */
      if (timeout == INFINITE)
	ready = WAIT_FAILED;
      else
	{
	  SleepEx (timeout, TRUE);
	  ready = WAIT_TIMEOUT;
	}
    }
  else
    {
      /* Wait for just handles
       * -> Use WaitForMultipleObjectsEx
       */
      if (_g_main_poll_debug)
	g_print ("  WaitForMultipleObjectsEx(%d, %d)\n", nhandles, timeout);

      ready = WaitForMultipleObjectsEx (nhandles, handles, FALSE, timeout, TRUE);
      if (ready == WAIT_FAILED)
	{
	  gchar *emsg = g_win32_error_message (GetLastError ());
	  g_warning ("WaitForMultipleObjectsEx failed: %s", emsg);
	  g_free (emsg);
	}
    }

  if (_g_main_poll_debug)
    g_print ("  wait returns %ld%s\n",
	     ready,
	     (ready == WAIT_FAILED ? " (WAIT_FAILED)" :
	      (ready == WAIT_TIMEOUT ? " (WAIT_TIMEOUT)" :
	       (poll_msgs && ready == WAIT_OBJECT_0 + nhandles ? " (msg)" : ""))));

  if (ready == WAIT_FAILED)
    return -1;
  else if (ready == WAIT_TIMEOUT ||
	   ready == WAIT_IO_COMPLETION)
    return 0;
  else if (poll_msgs && ready == WAIT_OBJECT_0 + nhandles)
    {
      for (f = fds; f < &fds[nfds]; ++f)
	if (f->fd == G_WIN32_MSG_HANDLE && f->events & G_IO_IN)
	  f->revents |= G_IO_IN;

      /* If we have a timeout, or no handles to poll, be satisfied
       * with just noticing we have messages waiting.
       */
      if (timeout != 0 || nhandles == 0)
	return 1;

      /* If no timeout and handles to poll, recurse to poll them,
       * too.
       */
      recursed_result = poll_rest (FALSE, handles, nhandles, fds, nfds, 0);
      return (recursed_result == -1) ? -1 : 1 + recursed_result;
    }
  else if (ready >= WAIT_OBJECT_0 && ready < WAIT_OBJECT_0 + nhandles)
    {
      for (f = fds; f < &fds[nfds]; ++f)
	{
	  if ((HANDLE) f->fd == handles[ready - WAIT_OBJECT_0])
	    {
	      f->revents = f->events;
	      if (_g_main_poll_debug)
		g_print ("  got event %p\n", (HANDLE) f->fd);
	    }
	}

      /* If no timeout and polling several handles, recurse to poll
       * the rest of them.
       */
      if (timeout == 0 && nhandles > 1)
	{
	  /* Remove the handle that fired */
	  int i;
	  if (ready < nhandles - 1)
	    for (i = ready - WAIT_OBJECT_0 + 1; i < nhandles; i++)
	      handles[i-1] = handles[i];
	  nhandles--;
	  recursed_result = poll_rest (FALSE, handles, nhandles, fds, nfds, 0);
	  return (recursed_result == -1) ? -1 : 1 + recursed_result;
	}
      return 1;
    }

  return 0;
}

gint
g_poll (GPollFD *fds,
	guint    nfds,
	gint     timeout)
{
  HANDLE handles[MAXIMUM_WAIT_OBJECTS];
  gboolean poll_msgs = FALSE;
  GPollFD *f;
  gint nhandles = 0;
  int retval;

  if (_g_main_poll_debug)
    g_print ("g_poll: waiting for");

  for (f = fds; f < &fds[nfds]; ++f)
    if (f->fd == G_WIN32_MSG_HANDLE && (f->events & G_IO_IN))
      {
	if (_g_main_poll_debug && !poll_msgs)
	  g_print (" MSG");
	poll_msgs = TRUE;
      }
    else if (f->fd > 0)
      {
	/* Don't add the same handle several times into the array, as
	 * docs say that is not allowed, even if it actually does seem
	 * to work.
	 */
	gint i;

	for (i = 0; i < nhandles; i++)
	  if (handles[i] == (HANDLE) f->fd)
	    break;

	if (i == nhandles)
	  {
	    if (nhandles == MAXIMUM_WAIT_OBJECTS)
	      {
		g_warning ("Too many handles to wait for!\n");
		break;
	      }
	    else
	      {
		if (_g_main_poll_debug)
		  g_print (" %p", (HANDLE) f->fd);
		handles[nhandles++] = (HANDLE) f->fd;
	      }
	  }
      }

  if (_g_main_poll_debug)
    g_print ("\n");

  for (f = fds; f < &fds[nfds]; ++f)
    f->revents = 0;

  if (timeout == -1)
    timeout = INFINITE;

  /* Polling for several things? */
  if (nhandles > 1 || (nhandles > 0 && poll_msgs))
    {
      /* First check if one or several of them are immediately
       * available
       */
      retval = poll_rest (poll_msgs, handles, nhandles, fds, nfds, 0);

      /* If not, and we have a significant timeout, poll again with
       * timeout then. Note that this will return indication for only
       * one event, or only for messages. We ignore timeouts less than
       * ten milliseconds as they are mostly pointless on Windows, the
       * MsgWaitForMultipleObjectsEx() call will timeout right away
       * anyway.
       */
      if (retval == 0 && (timeout == INFINITE || timeout >= 10))
	retval = poll_rest (poll_msgs, handles, nhandles, fds, nfds, timeout);
    }
  else
    {
      /* Just polling for one thing, so no need to check first if
       * available immediately
       */
      retval = poll_rest (poll_msgs, handles, nhandles, fds, nfds, timeout);
    }

  if (retval == -1)
    for (f = fds; f < &fds[nfds]; ++f)
      f->revents = 0;

  return retval;
}

#else  /* !G_OS_WIN32 */

/* The following implementation of poll() comes from the GNU C Library.
 * Copyright (C) 1994, 1996, 1997 Free Software Foundation, Inc.
 */

#include <string.h> /* for bzero on BSD systems */

#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif /* HAVE_SYS_SELECT_H */

#ifdef G_OS_BEOS
#undef NO_FD_SET
#endif /* G_OS_BEOS */

#ifndef NO_FD_SET
#  define SELECT_MASK fd_set
#else /* !NO_FD_SET */
#  ifndef _AIX
typedef long fd_mask;
#  endif /* _AIX */
#  ifdef _IBMR2
#    define SELECT_MASK void
#  else /* !_IBMR2 */
#    define SELECT_MASK int
#  endif /* !_IBMR2 */
#endif /* !NO_FD_SET */

gint
g_poll (GPollFD *fds,
	guint    nfds,
	gint     timeout)
{
  struct timeval tv;
  SELECT_MASK rset, wset, xset;
  GPollFD *f;
  int ready;
  int maxfd = 0;

  FD_ZERO (&rset);
  FD_ZERO (&wset);
  FD_ZERO (&xset);

  for (f = fds; f < &fds[nfds]; ++f)
    if (f->fd >= 0)
      {
	if (f->events & G_IO_IN)
	  FD_SET (f->fd, &rset);
	if (f->events & G_IO_OUT)
	  FD_SET (f->fd, &wset);
	if (f->events & G_IO_PRI)
	  FD_SET (f->fd, &xset);
	if (f->fd > maxfd && (f->events & (G_IO_IN|G_IO_OUT|G_IO_PRI)))
	  maxfd = f->fd;
      }

  tv.tv_sec = timeout / 1000;
  tv.tv_usec = (timeout % 1000) * 1000;

  ready = select (maxfd + 1, &rset, &wset, &xset,
		  timeout == -1 ? NULL : &tv);
  if (ready > 0)
    for (f = fds; f < &fds[nfds]; ++f)
      {
	f->revents = 0;
	if (f->fd >= 0)
	  {
	    if (FD_ISSET (f->fd, &rset))
	      f->revents |= G_IO_IN;
	    if (FD_ISSET (f->fd, &wset))
	      f->revents |= G_IO_OUT;
	    if (FD_ISSET (f->fd, &xset))
	      f->revents |= G_IO_PRI;
	  }
      }

  return ready;
}

#endif /* !G_OS_WIN32 */

#endif	/* !HAVE_POLL */

#define __G_POLL_C__
#include "galiasdef.c"


text:
/* tslint:disable:no-unused-variable */

import {
  beforeEach, beforeEachProviders,
  describe, xdescribe,
  expect, it, xit,
  async, inject
} from '@angular/core/testing';
import { AppComponent } from './app.component';

beforeEachProviders(() => [AppComponent]);

describe('App: Hn', () => {
  it('should create the app',
      inject([AppComponent], (app: AppComponent) => {
    expect(app).toBeTruthy();
  }));

  it('should have as isReloading \'true\'',
      inject([AppComponent], (app: AppComponent) => {
    expect(app.isReloading).toEqual(true);
  }));
});


text:
#include "get_gpu_context.hh"
#include "../base.hh"
#include <iostream>

using namespace HyperCanny;

std::tuple<std::vector<cl::Device>, cl::Context>
    HyperCanny::get_default_gpu_context()
{
    Console::Log console(
        "\033[32m☷ \033[m OpenCL initialisation ...",
        "\033[32m│\033[m  ");

    std::vector<cl::Platform> platform_list;
    cl::Platform::get(&platform_list);
    checkErr(platform_list.size() != 0 ? CL_SUCCESS : -1,
        " cl::Platform::get failed to retrieve a platform;\n"
        "  is OpenCL correctly installed?"
        "\n(fail)\n");

    cl::Platform default_platform = platform_list[0];
    console.message(
        "Using platform: ",
        default_platform.getInfo<CL_PLATFORM_NAME>());

    std::vector<cl::Device> device_list;
    default_platform.getDevices(CL_DEVICE_TYPE_GPU, &device_list);
    checkErr(device_list.size() != 0 ? CL_SUCCESS : -1,
        " cl::Platform::getDevices failed to find a GPU device;\n"
        "  do you have the correct device loader installed?"
        "\n(fail)\n");

    cl::Device default_device = device_list[0];
    console.message(
        "Using device:   ",
        default_device.getInfo<CL_DEVICE_NAME>());

    console.finish("\033[32m┕\033[m (ok)");

    cl::Context context({default_device});
    return std::make_tuple(device_list, context);
}


text:
package kantan.codecs

package object scalaz extends DecoderInstances with EncoderInstances with CommonInstances


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>OperationalPatternConstant (Media Authoring with Java API)</title>
<meta name="date" content="2016-02-05">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Media Authoring with Java API (MAJ)

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

tv.amwa.maj.constant

Interface OperationalPatternConstant

public interface OperationalPatternConstant

Implement this interface to access unique identifiers for operational patterns or AAF protocols, such as
 as the AAF edit protocol. An operational pattern constraints levels of file complexity.

See Also:

OperationalPatternDescription,
Preface.getOperationalPattern()

Field Summary

Fields

Modifier and Type
Field and Description

static AUID
EditProtocol

File complexity is constrained to that specified by the
 AAF edit protocol.

static AUID
Unconstrained

File complexity is not constrained by an optional pattern.

Field Detail

EditProtocol

@OperationalPatternDescription(description="Operational Pattern for the AAF Edit Protocol",
                               aliases="OPDef_EditProtocol")
static final AUID EditProtocol

File complexity is constrained to that specified by the
 AAF edit protocol.

Unconstrained

@OperationalPatternDescription(description="Unconstrained by an Operational Pattern",
                               aliases="OPDef_Unconstrained")
static final AUID Unconstrained

File complexity is not constrained by an optional pattern.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Media Authoring with Java API (MAJ)

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

(c)2007-2016 Richard Cartwright, all rights reserved. Licensed 						under Apache 2 license and subject to the AMWA IPR policy.


text:
from citeproc.source.bibtex import BibTeX as cpBibTeX
import citeproc as cp

import os
from os.path import dirname, exists
import pickle
import requests
import tempfile
from six import PY2, itervalues, iteritems
import warnings

from .config import CACHE_DIR, DUECREDIT_FILE
from .entries import BibTeX, Doi
from .log import lgr

def get_doi_cache_file(doi):
    return os.path.join(CACHE_DIR, doi)

def import_doi(doi):
    cached = get_doi_cache_file(doi)

    if exists(cached):
        with open(cached) as f:
            doi = f.read()
            if PY2:
                return doi.decode('utf-8')
            return doi

    # else -- fetch it
    headers = {'Accept': 'text/bibliography; style=bibtex'}
    url = 'http://dx.doi.org/' + doi
    r = requests.get(url, headers=headers)
    r.encoding = 'UTF-8'
    bibtex = r.text.strip()
    if not bibtex.startswith('@'):
        raise ValueError('wrong doi specified')
    if not exists(cached):
        cache_dir = dirname(cached)
        if not exists(cache_dir):
            os.makedirs(cache_dir)
        with open(cached, 'w') as f:
            if PY2:
                f.write(bibtex.encode('utf-8'))
            else:
                f.write(bibtex)
    return bibtex

class TextOutput(object):  # TODO some parent class to do what...?
    def __init__(self, fd, collector, style=None):
        self.fd = fd
        self.collector = collector
        # TODO: check that CLS style actually exists
        self.style = style
        if 'DUECREDIT_STYLE' in os.environ.keys():
            self.style = os.environ['DUECREDIT_STYLE']
        else:
            self.style = 'harvard1'

    def dump(self, tags=None):

        # TODO: all that configuration/options should be done outside
        if not tags:
            tags = os.environ.get('DUECREDIT_REPORT_TAGS', 'reference,implementation').split(',')
        tags = set(tags)

        citations = self.collector.citations
        if tags != {'*'}:
            # Filter out citations
            citations = dict((k, c)
                             for k, c in iteritems(citations)
                             if tags.intersection(c.tags))

        # Separate logic (model) from presentation (view).  Let's first create a "model"
        # Collect all citations under their corresponding packages

        # TODO: such logic/setup would not work if we want to allow citations for modules
        # within packages, so we really need a 3 level reporting:  package / module / obj
        cited_packages = {}
        for citation in itervalues(citations):
            package = citation.package
            objname = citation.objname

            if package not in cited_packages:
                # list of two lists -- one citations for the package itself,
                # another one will be also dictionary for citations for functions
                cited_packages[package] = [[], {}]

            if citation.cites_module is True:
                cited_packages[package][0].append(citation)
            else:
                if objname not in cited_packages[package][1]:
                    # initiate a list of citations for that object
                    cited_packages[package][1][objname] = []
                cited_packages[package][1][objname].append(citation)

        # Now prune references to packages which had no citations ot internal functionality
        # TODO: theoretically should be done before pruning based on tags so we still
        # catch those which were used anyhow
        for package, (package_citations, obj_citations) in list(iteritems(cited_packages)): # operate on a copy
            # check if any citation is tagged as 'cite-on-import', so we
            # always cite if it was imported
            if any('cite-on-import' in c.tags for c in package_citations):
                continue
            if not obj_citations:
                cited_packages.pop(package)

        # Now we can "render" different views of our "model"
        # Here for now just text BUT that is where we can "split" the logic and provide
        # different renderings given the model -- text, rest, md, tex+latex, whatever
        self.fd.write('DueCredit Report:\n')

        refnr = 1
        citations_ordered = []

        for package, (package_citations, obj_citations) in iteritems(cited_packages):
            # package level citation
            versions = sorted(map(str, set(str(r.version) for r in package_citations)))
            refnr = len(citations_ordered) + 1
            self.fd.write('- {0} (v {1}) [{2}]\n'.format(
                package,
                ', '.join(versions),
                ', '.join(str(x) for x in range(refnr, refnr+len(package_citations)))))
            citations_ordered.extend(package_citations)

            # function level citations
            for obj, citations in iteritems(obj_citations):
                # TODO -- there could be multiple, and they might have different
                # description so must be groupped accordingly. For now just simply listing them
                # all separately
                for citation in citations:
                    refnr = len(citations_ordered) + 1
                    self.fd.write('  - {0} ({1}) [{2}]\n'.format(
                        citation.path,
                        citation.description,
                        refnr))
                    citations_ordered.extend(citations)

        # Let's collect some stats now (before it was misleading since multiple citations
        # could have been for the same package or object)
        self.fd.write('\n{0} modules cited\n{1} functions cited\n'.format(
            len(cited_packages), sum(len(x[1]) for x in itervalues(cited_packages))))
        if citations_ordered:
            self.fd.write('\nReferences\n' + '-' * 10 + '\n')
            for i, citation in enumerate(citations_ordered):
                self.fd.write('\n'"[%d] " % (i+1) + get_text_rendering(citation, style=self.style))
            self.fd.write('\n')

def get_text_rendering(citation, style='harvard1'):
    # TODO: smth fked up smwhere
    from .collector import Citation
    # TODO: and we need to move it away -- circular imports etc
    if isinstance(citation, Citation):
        entry = citation.entry
    else:
        entry = citation
    if isinstance(entry, Doi):
        bibtex_rendering = get_bibtex_rendering(entry)
        return get_text_rendering(bibtex_rendering)
    elif isinstance(entry, BibTeX):
        return format_bibtex(entry, style=style)
    else:
        return str(entry)

def get_bibtex_rendering(entry):
    if isinstance(entry, Doi):
        return BibTeX(import_doi(entry.doi))
    elif isinstance(entry, BibTeX):
        return entry
    else:
        raise ValueError("Have no clue how to get bibtex out of %s" % entry)

def format_bibtex(bibtex_entry, style='harvard1'):
    key = bibtex_entry.get_key()
    # need to save it temporarily to use citeproc-py
    fname = tempfile.mktemp(suffix='.bib')
    try:
        with open(fname, 'wt') as f:
            bibtex = bibtex_entry.rawentry
            bibtex = bibtex.replace(u'\u2013', '--') + "\n"
            # TODO: manage to save/use UTF-8
            if PY2:
                bibtex = bibtex.encode('ascii', 'ignore')
            f.write(bibtex)
        # We need to avoid cpBibTex spitting out warnings
        old_filters = warnings.filters[:]  # store a copy of filters
        warnings.simplefilter('ignore', UserWarning)
        try:
            bib_source = cpBibTeX(fname)
        except Exception as e:
            lgr.error("Failed to process BibTeX file %s" % fname)
            return "ERRORED: %s" % str(e)
        finally:
            # return warnings back
            warnings.filters = old_filters
        bib_style = cp.CitationStylesStyle(style, validate=False)
        # TODO: specify which tags of formatter we want
        bibliography = cp.CitationStylesBibliography(bib_style, bib_source,
                                                     cp.formatter.plain)
        citation = cp.Citation([cp.CitationItem(key)])
        bibliography.register(citation)
    finally:
        os.unlink(fname)

    biblio_out = bibliography.bibliography()
    assert(len(biblio_out) == 1)
    biblio_out = ''.join(biblio_out[0])
    return biblio_out # if biblio_out else str(bibtex_entry)

# TODO: harmonize order of arguments
class PickleOutput(object):
    def __init__(self, collector, fn=DUECREDIT_FILE):
        self.collector = collector
        self.fn = fn

    def dump(self):
        with open(self.fn, 'wb') as f:
            pickle.dump(self.collector, f)

    @classmethod
    def load(cls, filename=DUECREDIT_FILE):
        with open(filename, 'rb') as f:
            return pickle.load(f)

class BibTeXOutput(object):  # TODO some parent class to do what...?
    def __init__(self, fd, collector):
        self.fd = fd
        self.collector = collector

    def dump(self):
        for citation in self.collector.citations.values():
            try:
                bibtex = get_bibtex_rendering(citation.entry)
            except:
                lgr.warning("Failed to generate bibtex for %s" % citation.entry)
                continue
            self.fd.write(bibtex.rawentry + "\n")

def load_due(filename):
    return PickleOutput.load(filename)


text:
<?php
error_reporting(E_ALL);

require __DIR__ . '/../vendor/autoload.php';

// sorts the selectors in stylesheet in order to normalize it for comparison

$exe = array_shift($argv); // remove filename

if (!$fname = array_shift($argv)) {
    $fname = 'php://stdin';
}

class LesscNormalized extends \LesserPhp\Compiler
{

    /**
     * LesscNormalized constructor.
     */
    public function __construct()
    {
        parent::__construct();
        $this->setNumberPrecision(3);
    }

    /**
     * @inheritdoc
     */
    public function compileValue(array $value, array $options = [])
    {
        $options['compressColors'] = true;

        return parent::compileValue($value, $options);
    }
}

/**
 * Class SortingFormatter
 */
class SortingFormatter extends \LesserPhp\Formatter\Lessjs
{

    /**
     * @param $block
     *
     * @return string
     */
    public function sortKey($block)
    {
        if (!isset($block->sortKey)) {
            sort($block->selectors, SORT_STRING);
            $block->sortKey = implode(',', $block->selectors);
        }

        return $block->sortKey;
    }

    /**
     * @param $block
     */
    public function sortBlock($block)
    {
        usort($block->children, function ($a, $b) {
            $sort = strcmp($this->sortKey($a), $this->sortKey($b));
            if ($sort === 0) {
                // TODO
            }

            return $sort;
        });
    }

    /**
     * @param $block
     *
     * @return mixed
     */
    public function block($block)
    {
        $this->sortBlock($block);

        return parent::block($block);
    }

}

$less = new LesscNormalized();
$less->setFormatter(new SortingFormatter);
echo $less->parse(file_get_contents($fname));


text:
.modals-fill-viewport.modal-active #container {
    overflow: hidden;
}

.modals-fill-viewport .modal {
    left: 0;
    right: 0;
    top: 0 !important;
    bottom: 0;
    position: fixed;
    margin: 0;
    width: auto;
}
.modals-fill-viewport .modal-body {
    max-height: none;
}
.modals-fill-viewport .modal-footer {
    -moz-border-radius: 0;
    -webkit-border-radius: 0;
    border-radius: 0;
}


text:
<!DOCTYPE html>

        <meta charset="UTF-8" />
        <title>Some Test Html</title>
        <meta content="width=device-width, initial-scale=1" name="viewport" />
        <link href="/a.css" rel="stylesheet" />
        <link href='b.css' rel="stylesheet" />
        <link href="http://example.com/c.css" rel="stylesheet" />
        <link href="https://example.com/d.css" rel="stylesheet" />
        <link href='https://example.com/e.css' rel="stylesheet" />

placeholder1

placeholder2


text:
package br.com.navita.test;

import java.util.Map;

import br.com.navita.mobile.console.exception.SapGatewayException;
import br.com.navita.mobile.domain.MobileBean;

public abstract class SapExecution {
	protected SapExecutionConfig config;
	public void setConfig(SapExecutionConfig config) {
		this.config = config;
	}

	protected abstract MobileBean execute( Map<String, Object> params) throws SapGatewayException;

}


text:
require 'active_connection/version'

module ActiveConnection
  class << self
    def schema_search_path(*paths, &block)
      original_search_path = ActiveRecord::Base.connection.schema_search_path
      ActiveRecord::Base.connection.schema_search_path = paths.join(',')
      yield
    ensure
      ActiveRecord::Base.connection.schema_search_path = original_search_path
    end
  end
end


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<groupId>tsar-tomcat-status</groupId>
	<artifactId>tsar-tomcat-status</artifactId>
	<version>1.0-SNAPSHOT</version>
	<packaging>jar</packaging>

	<name>tsar-tomcat-status</name>
	<url>http://maven.apache.org</url>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
	</properties>

	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-compiler-plugin</artifactId>
					<version>3.3</version>
					<configuration>
						<source>1.7</source>
						<target>1.7</target>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>

	<dependencies>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.10</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>javax.servlet-api</artifactId>
			<version>3.1.0</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
				<groupId>org.apache.tomcat</groupId>
				<artifactId>tomcat-catalina</artifactId>
				<version>8.0.32</version>
				<scope>provided</scope>
			</dependency>
	</dependencies>
</project>


text:
function download(filename, text) {
  var element = document.createElement('a');
  element.setAttribute('href', text);
  element.setAttribute('download', filename);

  element.style.display = 'none';
  document.body.appendChild(element);

  element.click();

  document.body.removeChild(element);
}

$("#mainfrm").on("submit",function(e){
  e.preventDefault();
  $("#genbtn").prop("disabled",true);
  $("#genbtn").val("Please wait");
  $.get("./cover.tex", {}, function (tex) {

    var document = tex + "\\begin{document}\n";
    var inputs = $('#mainfrm :input');
    document += "\\titleGM{" + [inputs[4].value, inputs[5].value, inputs[6].value, inputs[0].value, inputs[1].value, inputs[2].value, inputs[3].value].join("}{")
    document += "}\n\\end{document}"

    var pdftex = new PDFTeX("texlive/pdftex-worker.js");

    pdftex.compile(document).then(function (pdf) { download("cover.pdf", pdf); });
  }
  );
  }
);