text:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@mipmap/calendar_press" android:state_pressed="true"/>
    <item android:drawable="@mipmap/calendar_press" android:state_focused="true" />
    <item android:drawable="@mipmap/calendar_normal" android:state_focused="false" android:state_pressed="false" />
    <item android:drawable="@mipmap/calendar_normal"/>
</selector>


text:
<?php
namespace Asgard\Auth;

interface IAuth {
	public function isConnected();
	public function isGuest();
	public function check(); #throw NotAuthenticated()
	public function attempt($user, $password);
	public function attemptRemember();
	public function remember($user, $password);
	public function connect($id);
	public function disconnect();
	public function user();
}

redpajama_set_name: RedPajamaGithub


text:
<?php
namespace Concrete\Core\Application\Service;

use Concrete\Core\File\StorageLocation\StorageLocation;
use Loader;
use Config;
use \Concrete\Core\Authentication\AuthenticationType;

class Avatar
{

    /**
     * @param \UserInfo $uo
     * @param bool $suppressNone
     * @param float $aspectRatio
     * @return string
     */
    public function outputUserAvatar($uo, $suppressNone = false, $aspectRatio = 1.0)
    {
        if (is_object($uo)) {
            $ati = $this->getAuthTypeImagePath($uo);
            $width = Config::get('concrete.icons.user_avatar.width') * $aspectRatio;
            $height = Config::get('concrete.icons.user_avatar.height') * $aspectRatio;

            if ($uo->hasAvatar()) {
                $src = $this->getImagePath($uo);
                $str = 'getUserName() . '" />';

                return $str;
            } elseif (Config::get('concrete.user.gravatar.enabled')) {
                return $this->get_gravatar(
                    $uo->getUserEmail(),
                    Config::get('concrete.icons.user_avatar.width'),
                    Config::get('concrete.user.gravatar.image_set'),
                    Config::get('concrete.user.gravatar.max_level'),
                    true,
                    $atts = array('alt' => $uo->getUserName())
                );
            } else {
                if ($ati) {
                    return "";
                }
            }
        }

        if (!$suppressNone) {
            return $this->outputNoAvatar($aspectRatio);
        }
    }

    /**
     * @param \UserInfo $uo
     * @return bool
     * @throws \Exception
     */
    public function getAuthTypeImagePath($uo)
    {
        $lat = $uo->getUserObject()->getLastAuthType();
        if ($lat > 1) {
            try {
                $at = AuthenticationType::getByID($lat);
                if (method_exists($at->controller, 'getUserImagePath')) {
                    $uimgpath = $at->controller->getUserImagePath($uo);
                    return $uimgpath;
                }
            } catch (\Exception $e) {
            }
        }
        return false;
    }

    /**
    * gets the image path for a users avatar
    * @param \UserInfo $uo
    * @param bool $withNoCacheStr
    * @return bool|string $src
    */
    public function getImagePath($uo,$withNoCacheStr=true)
    {
        if (!$uo->hasAvatar()) {
            return false;
        }
        $fsl = StorageLocation::getDefault();
        $fs = $fsl->getFileSystemObject();
        if ($fs->has(REL_DIR_FILES_AVATARS . '/' . $uo->getUserID() . '.jpg')) {
            $configuration = $fsl->getConfigurationObject();
            $src = $configuration->getPublicURLToFile(REL_DIR_FILES_AVATARS . '/' . $uo->getUserID() . '.jpg');
            $cacheStr = "?" . time();
            if ($withNoCacheStr) {
                $src .= $cacheStr;
            }

            return $src;
        }
    }

    /**
    * What to show if the user has no avatar
    * @param float $aspectRatio
    * @return string $str
    */
    public function outputNoAvatar($aspectRatio = 1.0)
    {
        $str = '';
        return $str;
    }

    /**
    * Removes the avatar for the given user
    * @param \User $ui
    */
    public function removeAvatar($ui)
    {
        if (is_object($ui)) {
            $uID = $ui->getUserID();
        } else {
            $uID = $ui;
        }
        $db = Loader::db();
        $db->query("update Users set uHasAvatar = 0 where uID = ?", array($uID));
    }

    /**
    * Get either a Gravatar URL or complete image tag for a specified email address.
    *
    * @param string $email The email address
    * @param int $s Size in pixels, defaults to 80px [ 1 - 512 ]
    * @param string $d Default imageset to use [ 404 | mm | identicon | monsterid | wavatar ]
    * @param string $r Maximum rating (inclusive) [ g | pg | r | x ]
    * @param bool $img True to return a complete IMG tag False for just the URL
    * @param array $atts Optional, additional key/value attributes to include in the IMG tag
    * @return String containing either just a URL or a complete image tag
    * @source http://gravatar.com/site/implement/images/php/
    */
    public function getGravatar($email, $s = 80, $d = 'mm', $r = 'g', $img = false, $atts = array())
    {
        $url = '//www.gravatar.com/avatar/';
        $url .= md5(strtolower(trim($email)));
        $url .= "?s=$s&d=$d&r=$r";
        if ($img) {
            $url = ' $val) {
                $url .= ' ' . $key . '="' . $val . '"';
            }
            $url .= ' />';
        }
        return $url;
    }

    /**
     * @deprecated
     * @param $email
     * @param int $s
     * @param string $d
     * @param string $r
     * @param bool $img
     * @param array $atts
     * @return String
     */
    public function get_gravatar($email, $s = 80, $d = 'mm', $r = 'g', $img = false, $atts = array())
    {
        return self::getGravatar($email, $s, $d, $r, $img, $atts);
    }

}


text:
import os
import sys
sys.path.append(os.curdir)
from pelicanconf import *

SITEURL = 'https://mcss.mosra.cz'

OUTPUT_PATH = 'published/'
DELETE_OUTPUT_DIRECTORY = True

M_CSS_FILES = ['https://fonts.googleapis.com/css?family=Source+Code+Pro:400,400i,600%7CSource+Sans+Pro:400,400i,600,600i&subset=latin-ext',
               'static/m-dark.compiled.css']
THEME_STATIC_PATHS = ['static/m-dark.compiled.css']


text:
import * as fs from 'fs';
import * as path from 'path';
import * as process from 'process';

import { crawl } from './crawl.js';

function usage(rc: number): void {
  console.error('Usage:');
  console.error('  tools/gen_listings [SUITES...]');
  console.error('  tools/gen_listings webgpu unittests');
  process.exit(rc);
}

if (process.argv.length <= 2) {
  usage(0);
}

const myself = 'src/common/tools/gen_listings.ts';
if (!fs.existsSync(myself)) {
  console.error('Must be run from repository root');
  usage(1);
}

(async () => {
  for (const suite of process.argv.slice(2)) {
    const listing = await crawl(suite);

    const outFile = path.normalize(`out/${suite}/listing.js`);
    fs.writeFileSync(
      outFile,
      `\
// AUTO-GENERATED - DO NOT EDIT. See ${myself}.

export const listing = ${JSON.stringify(listing, undefined, 2)};
`
    );
    try {
      fs.unlinkSync(outFile + '.map');
    } catch (ex) {}
  }
})();


text:
/* We want an #include_next, but we are the main source file.
   So, #include ourselves and in that incarnation we can use #include_next.  */
#ifndef INCLUDED_SELF
# define INCLUDED_SELF
# include <sleep.c>
#else
/* This defines the CANCELLATION_P macro, which sleep.c checks for.  */
# include <pthreadP.h>
# include_next <sleep.c>
#endif


text:
import { SharedModule } from './../shared/shared.module';
import { NgModule } from '@angular/core';
import { TimelineListComponent } from './timeline-list/timeline-list.component';

@NgModule({
  imports: [
    SharedModule
  ],
  declarations: [TimelineListComponent],
  exports: [
    TimelineListComponent
  ]
})
export class TimelineModule { }


text:
package org.apache.archiva.remotedownload;

import org.apache.archiva.admin.model.beans.RemoteRepository;
import org.apache.archiva.rest.api.services.RemoteRepositoriesService;
import org.apache.commons.io.FileUtils;
import org.apache.cxf.jaxrs.client.WebClient;
import org.eclipse.jetty.server.Handler;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.handler.DefaultHandler;
import org.eclipse.jetty.server.handler.HandlerList;
import org.eclipse.jetty.server.handler.ResourceHandler;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;

import java.io.File;
import java.nio.file.Files;

import static org.assertj.core.api.Assertions.assertThat;

/**
 * @author Olivier Lamy
 */
public class RemoteRepositoryConnectivityCheckTest
    extends AbstractDownloadTest
{

    @BeforeClass
    public static void setAppServerBase()
    {
        previousAppServerBase = System.getProperty( "appserver.base" );
        System.setProperty( "appserver.base", "target/" + RemoteRepositoryConnectivityCheckTest.class.getName() );
    }

    @AfterClass
    public static void resetAppServerBase()
    {
        System.setProperty( "appserver.base", previousAppServerBase );
    }

    @Override
    protected String getSpringConfigLocation()
    {
        return "classpath*:META-INF/spring-context.xml classpath*:spring-context-test-common.xml classpath*:spring-context-artifacts-download.xml";
    }

    @Test
    public void checkRemoteConnectivity()
        throws Exception
    {

        Server repoServer =
            buildStaticServer( new File( System.getProperty( "basedir" ) + "/src/test/repositories/test-repo" ) );
        repoServer.start();

        RemoteRepositoriesService service = getRemoteRepositoriesService();

        WebClient.client( service ).header( "Authorization", authorizationHeader );

        try
        {

            int repoServerPort = repoServer.getConnectors()[0].getLocalPort();

            RemoteRepository repo = getRemoteRepository();

            repo.setUrl( "http://localhost:" + repoServerPort );

            service.addRemoteRepository( repo );

            assertThat( service.checkRemoteConnectivity( repo.getId() ) ).isTrue();
        }
        finally
        {
            service.deleteRemoteRepository( "id-new" );
            repoServer.stop();
        }
    }

    @Test
    public void checkRemoteConnectivityEmptyRemote()
        throws Exception
    {

        File tmpDir = Files.createTempDirectory( "test" ).toFile();
        Server repoServer = buildStaticServer( tmpDir );
        repoServer.start();

        RemoteRepositoriesService service = getRemoteRepositoriesService();

        WebClient.client( service ).header( "Authorization", authorizationHeader );

        try
        {

            int repoServerPort = repoServer.getConnectors()[0].getLocalPort();

            RemoteRepository repo = getRemoteRepository();

            repo.setUrl( "http://localhost:" + repoServerPort );

            service.addRemoteRepository( repo );

            assertThat( service.checkRemoteConnectivity( repo.getId() ) ).isTrue();
        }
        finally
        {
            service.deleteRemoteRepository( "id-new" );
            FileUtils.deleteQuietly( tmpDir );
            repoServer.stop();
        }
    }

    @Test
    public void checkRemoteConnectivityFail()
        throws Exception
    {

        RemoteRepositoriesService service = getRemoteRepositoriesService();

        WebClient.client( service ).header( "Authorization", authorizationHeader );

        try
        {

            RemoteRepository repo = getRemoteRepository();

            repo.setUrl( "http://localhost:8956" );

            service.addRemoteRepository( repo );

            assertThat( service.checkRemoteConnectivity( repo.getId() ) ).isFalse();
        }
        finally
        {
            service.deleteRemoteRepository( "id-new" );

        }
    }

    protected Server buildStaticServer( File path )
    {
        Server repoServer = new Server( 0 );

        ResourceHandler resourceHandler = new ResourceHandler();
        resourceHandler.setDirectoriesListed( true );
        resourceHandler.setWelcomeFiles( new String[]{ "index.html" } );
        resourceHandler.setResourceBase( path.getAbsolutePath() );

        HandlerList handlers = new HandlerList();
        handlers.setHandlers( new Handler[]{ resourceHandler, new DefaultHandler() } );
        repoServer.setHandler( handlers );

        return repoServer;
    }

    RemoteRepository getRemoteRepository()
    {
        return new RemoteRepository( "id-new", "new one", "http://foo.com", "default", "foo", "foopassword", 120,
                                     "cool repo" );
    }

}


text:
//package com.android.record.list.view;
//
//import android.support.v7.widget.RecyclerView;
//import android.support.v7.widget.helper.ItemTouchHelper;
//import android.util.Log;
//import android.view.View;
//import android.widget.ImageView;
//
//import com.android.record.R;
//import com.android.record.base.componet.BaseFragment;
//import com.android.record.base.componet.image.ChooseImageActivity;
//import com.android.record.base.componet.event.ImageSelectedFinishedEvent;
//import com.android.record.bean.SwipeCardBean;
//import com.android.record.common.dialog.InputDialog;
//import com.android.record.common.sp.UserManager;
//import com.android.record.list.event.GetCardEvent;
//import com.android.record.list.adapter.ListAdapter;
//import com.android.record.list.contract.ListTaskContract;
//import com.android.record.list.event.SendCardEvent;
//import com.mcxtzhang.layoutmanager.swipecard.CardConfig;
//import com.mcxtzhang.layoutmanager.swipecard.OverLayCardLayoutManager;
//
//import org.greenrobot.eventbus.Subscribe;
//import org.greenrobot.eventbus.ThreadMode;
//
//import java.util.ArrayList;
//import java.util.List;
//
///**
// * Created by kiddo on 17-3-31.
// */
//
//@Deprecated
//public class ListFragment extends BaseFragment implements InputDialog.InputListener, ListTaskContract.View{
//    public static final String TAG = ListFragment.class.getSimpleName();
//
//    private RecyclerView mRecyclerView;
//    private ListAdapter mAdapter;
//    private List<SwipeCardBean> mData;
//    private InputDialog mInputDialog;
//    private UserManager mUserManager;
//    private String mUsername ;
//    private String mDescription;
//    private ListTaskContract.Presenter mPresenter;
//    private OverLayCardLayoutManager mOverLayCardLayoutManager;
//    private ImageView mPhoto;
//
//
//    private void initData() {
//        mUsername = mUserManager.getUserName();
//        showLoading("正在加载数据...");
//        mPresenter.getCard(getActivity());
//    }
//
//    @Override
//    protected int getLayoutId() {
//        return R.layout.fragment_list;
//    }
//
//    @Override
//    protected void init() {
//        initView();
//        initData();
//        setConfig();
//    }
//
//    public void initView(){
//        mData = new ArrayList<>();
//        mOverLayCardLayoutManager = new OverLayCardLayoutManager();
//        mUserManager = UserManager.getInstance(getActivity());
//        mAdapter = new ListAdapter(getActivity(), mData, R.layout.part_item_list);
//        mRecyclerView = (RecyclerView) getActivity().findViewById(R.id.rv);
//        mRecyclerView.setLayoutManager(mOverLayCardLayoutManager);
//        mRecyclerView.setAdapter(mAdapter);
//    }
//
//    public void setConfig(){
//        CardConfig.initConfig(getActivity());
//        CardConfig.MAX_SHOW_COUNT = 6;
//        final TanTanCallback callback = new TanTanCallback(mRecyclerView, mAdapter, mData);
//
//        //测试竖直滑动是否已经不会被移除屏幕
//        //callback.setHorizontalDeviation(Integer.MAX_VALUE);
//
//        final ItemTouchHelper itemTouchHelper = new ItemTouchHelper(callback);
//        itemTouchHelper.attachToRecyclerView(mRecyclerView);
//    }
//
//    public void back(){
//        //TODO
//        mOverLayCardLayoutManager.scrollToPosition(2);
//    }
//
//    public void addCard(){
//        showInputDialog();
//    }
//
//    @Subscribe(threadMode = ThreadMode.MAIN)
//    public void onReceiveGetCardEvent(GetCardEvent event){
//        boolean isSuccess = event.isSuccess();
//        Log.d(TAG, "onReceiveGetCardEvent: " + isSuccess);
//        dismissLoading();
//        if (isSuccess){
//            mData.addAll(event.getmCardList());
//            mAdapter.notifyDataSetChanged();
//        } else {
//            showToast("获取数据失败,请检查网络~");
//        }
//    }
//
//    @Subscribe(threadMode = ThreadMode.MAIN)
//    public void onReceiveSendCardEvent(SendCardEvent event){
//        boolean isSuccess = event.isSuccess();
//        Log.d(TAG, "onReceiveSendCardEvent: " + isSuccess);
//        if (isSuccess){
//            dismissInputDialog(1);
//        } else {
//            dismissInputDialog(-1);
//            showToast("获取数据失败,请检查网络~");
//        }
//    }
//
//    @Subscribe(threadMode = ThreadMode.MAIN)
//    public void onReceiveImageSelectedFinishedEvent(ImageSelectedFinishedEvent event){
//        String path = event.selectedImagesPath.get(0);
//        Log.d(TAG, "onReceiveImageSelectedFinishedEvent: " + path + event.position + mUsername);
//        //mData.get(mAdapter)
//        mAdapter.notifyItemChanged(event.position - 1);
//        mPresenter.uploadPhoto(getActivity(), path, mUsername, event.position);
//    }
//
//    @Override
//    public String getDescription() {
//        return mDescription;
//    }
//
//    @Override
//    public String getUserName() {
//        return mUsername;
//    }
//
//    @Override
//    public int getPosition() {
//        return mAdapter.getItemCount() + 1;
//    }
//
//    /**
//     * 弹出输入框
//     */
//    private void showInputDialog() {
//        if (mInputDialog == null){
//            mInputDialog = new InputDialog();
//            mInputDialog.setInputListener(this);
//        }
//        mInputDialog.show(getActivity().getSupportFragmentManager(), "inputDialog");
//    }
//
//    /**
//     * 关闭输入框
//     */
//    private void dismissInputDialog(int code) {
//        if (mInputDialog != null) {
//            mInputDialog.dismissInputDialog(code);
//        }
//    }
//
//    /**
//     * 获取输入框的内容
//     *
//     * @param text
//     */
//    @Override
//    public void onInputComplete(String text) {
//        mDescription = text;
//        mPresenter.sendCard(getActivity());
//        SwipeCardBean swipeCardBean = new SwipeCardBean(mAdapter.getItemCount()+1,"0",text,System.currentTimeMillis());
//        List<SwipeCardBean> list = new ArrayList<>();
//        list.add(swipeCardBean);
//        mData.addAll(list);
//        mAdapter.notifyDataSetChanged();
//    }
//
//    @Override
//    public void setPresenter(ListTaskContract.Presenter presenter) {
//        if (presenter != null){
//            mPresenter = presenter;
//        }
//    }
//}


text:
from __future__ import unicode_literals

from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [
        ('radio', '0043_auto_20170902_2018'),
    ]

    operations = [
        migrations.CreateModel(
            name='SiteOption',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=30, unique=True)),
                ('value', models.CharField(max_length=60)),
                ('javascript_visible', models.BooleanField(default=False)),
                ('template_visible', models.BooleanField(default=False)),
                ('description', models.CharField(blank=True, max_length=100, null=True)),
            ],
        ),
    ]


text:
layout: page
#subheadline:  "Path Tracing"
title:  "Mesh to Signed Distance Field Conversion and Raymarching"
#teaser: "???"
categories:
    - projects
tags:
    - projects
    - signed distance field
header: no
image:
    title: MeshToSDF1.png
---
A project I made for the Advanced Graphics Programming course at Linköping University, based on a GDC Presentation by Matt Swoboda. The program uses a combination of geometry shaders and fragment shaders to compute the signed distance field
of a triangle mesh and store it in a 3D texture.

### All Projects
{: .t60 }

{% include list-posts.html tag='projects' %}


text:
SpriteNode::SpriteNode(sf::Texture const &texture)
        : _sprite(texture)
{
}

SpriteNode::SpriteNode(sf::Texture const &texture, sf::IntRect &rect)
        : _sprite(texture, rect)
{
}

void SpriteNode::drawCurrent(sf::RenderTarget &target, sf::RenderStates states) const
{
    target.draw(_sprite, states);
}


text:
require "spec_helper"

describe "bundle help" do
  # Rubygems 1.4+ no longer load gem plugins so this test is no longer needed
  rubygems_under_14 = Gem::Requirement.new("< 1.4").satisfied_by?(Gem::Version.new(Gem::VERSION))
  it "complains if older versions of bundler are installed", :if => rubygems_under_14 do
    system_gems "bundler-0.8.1"

    bundle "help", :expect_err => true
    err.should == "Please remove older versions of bundler. This can be done by running `gem cleanup bundler`."
  end

  it "uses groff when available" do
    fake_groff!

    bundle "help gemfile"
    out.should == %|["-Wall", "-mtty-char", "-mandoc", "-Tascii", "#{root}/lib/bundler/man/gemfile.5"]|
  end

  it "prefixes bundle commands with bundle- when finding the groff files" do
    fake_groff!

    bundle "help install"
    out.should == %|["-Wall", "-mtty-char", "-mandoc", "-Tascii", "#{root}/lib/bundler/man/bundle-install"]|
  end

  it "simply outputs the txt file when there is no groff on the path" do
    kill_path!

    bundle "help install", :expect_err => true
    out.should =~ /BUNDLE-INSTALL/
  end

  it "still outputs the old help for commands that do not have man pages yet" do
    bundle "help check"
    out.should include("Check searches the local machine")
  end
end


text:
import { Component, OnInit } from '@angular/core';

import { Car } from './car';
import { CarService } from './car.service';

@Component({
	selector: 'my-dashboard',
	templateUrl: './dashboard.component.html',
	styleUrls: ['./dashboard.component.css']
})

export class DashboardComponent implements OnInit {
	cars: Car[] = [];

	constructor(private carService: CarService) { }

	ngOnInit(): void {
		this.carService.getCars()
			.then(cars => this.cars = cars.slice(1, 5));
	}
}


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

import java.util.List;
import java.util.Map;

import agent.frida.model.iface2.FridaModelTargetMemoryContainer;
import agent.frida.model.iface2.FridaModelTargetModuleContainer;
import ghidra.dbg.target.schema.TargetAttributeType;
import ghidra.dbg.target.schema.TargetObjectSchemaInfo;

@TargetObjectSchemaInfo(
	name = "DebugContainer",
	attributes = {
		@TargetAttributeType(
			name = "Modules",
			type = FridaModelTargetModuleContainerImpl.class,
			required = true,
			fixed = true),
		@TargetAttributeType(
			name = "Memory",
			type = FridaModelTargetMemoryContainerImpl.class,
			required = true,
			fixed = true),
		@TargetAttributeType(type = Object.class)
	},
	canonicalContainer = true)
public class FridaModelTargetKernelImpl extends FridaModelTargetObjectImpl {

	protected final FridaModelTargetKernelMemoryContainerImpl memory;
	protected final FridaModelTargetKernelModuleContainerImpl modules;

	public FridaModelTargetKernelImpl(FridaModelTargetSessionImpl session) {
		super(session.getModel(), session, "Kernel", "Kernel");

		this.memory = new FridaModelTargetKernelMemoryContainerImpl(this);
		this.modules = new FridaModelTargetKernelModuleContainerImpl(this);

		changeAttributes(List.of(), List.of(  //
			memory,
			modules //
		), Map.of(
			"Base", session.getSession().getAttribute("kbase"), //
			"PageSize", session.getSession().getAttribute("kPageSize") //
		), "Initialized");
	}

	public FridaModelTargetMemoryContainer getMemory() {
		return memory;
	}

	public FridaModelTargetModuleContainer getModules() {
		return modules;
	}

}


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="mobapptut.com.camera2videoimage">

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity
            android:name=".Camera2VideoImageActivity"
            android:screenOrientation="portrait">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".DisplayActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name=".WelcomeActivity"
            android:label="@string/title_activity_welcome"
            android:screenOrientation="portrait" />
        <activity android:name=".HelpActivity"></activity>
    </application>

</manifest>


text:
class Foo{};

function bar(x: {new(): Foo;}){}

bar(Foo); // Error, but should be allowed

//// [assignmentCompatOnNew.js]
var Foo = (function () {
    function Foo() {
    }
    return Foo;
})();
;
function bar(x) {
}
bar(Foo); // Error, but should be allowed


text:
package funcmock

import (
	"testing"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

func TestController(t *testing.T) {
	RegisterFailHandler(Fail)
	RunSpecs(t, "BetterMock Suite")
}


text:
/**
 *  @name  Filtro pasabajos
 *  @description Aplica un filtro pasabajos (p5.LowPass) a un archivo de audio (p5.SoundFile).
 *  Visualiza el sonido con FFT.
 *  Mapea la posición horizontal del ratón (mouseX) a la frecuencia de corte del filtro
 *  y la vertical (mouseY) a la razón resonancia/ancho de un filtro pasabanda.
 *
 *

 Para correr localmente este ejemplo, necesitarás la
 * biblioteca p5.sound
 * un archivo de audio y correr un servidor local.
 */
var soundFile;
var fft;

var filter, filterFreq, filterRes;

function preload() {
  soundFormats('mp3', 'ogg');
  soundFile = loadSound('assets/beat');
}

function setup() {
  createCanvas(710, 256);
  fill(255, 40, 255);

  // reproduce el archivo de sonido en bucle
  soundFile.loop();

  filter = new p5.LowPass();

  // desconecta el archivo de audio de la salida maestra.
  // luego, conéctalo al filtro, para que solo escuchemos el sonido filtrado
  soundFile.disconnect();
  soundFile.connect(filter);

  fft = new p5.FFT();
}

function draw() {
  background(30);

  // Mapea la posición horizontal del ratón (mouseX) a la frecuencia de corte desde
  // la frecuencia más grave (10Hz) a la más aguda (22050Hz) que los humanos escuchan
  filterFreq = map (mouseX, 0, width, 10, 22050);

  // Mapea la posición vertical del ratón (mouseY) a la resonancia (aumento de volumen) en la frecuencia de corte
  filterRes = map(mouseY, 0, height, 15, 5);

  // define los parámetros del filtro
  filter.set(filterFreq, filterRes);

  // dibuja cada lugar en el análisis de espectro FFT donde
  // x = frecuencia más grave (10Hz) a la más aguda (22050Hz),
  // h = energía (amplitud / volumen) en esa frecuencia
  var spectrum = fft.analyze();
  noStroke();
  for (var i = 0; i< spectrum.length; i++){
    var x = map(i, 0, spectrum.length, 0, width);
    var h = -height + map(spectrum[i], 0, 255, height, 0);
    rect(x, height, width/spectrum.length, h) ;
  }

}


text:
using Contoso.Core;
using LanguageExt;
using MediatR;

namespace Contoso.Application.Courses.Commands
{
    public class CreateCourse : Record<CreateCourse>, IRequest<Either<Error, int>>
    {
        public CreateCourse(string title, int credits, int departmentId)
        {
            Title = title;
            Credits = credits;
            DepartmentId = departmentId;
        }

        public string Title { get; }
        public int Credits { get; }
        public int DepartmentId { get; }
    }
}


text:
/** @file vector2.h
 *  @brief 2D vector structure, including operators when compiling in C++
 */
#ifndef AI_VECTOR2D_H_INC
#define AI_VECTOR2D_H_INC

#ifdef __cplusplus
#   include <cmath>
#else
#   include <math.h>
#endif

#include "./Compiler/pushpack1.h"

// ----------------------------------------------------------------------------------
/** Represents a two-dimensional vector.
 */

#ifdef __cplusplus
template <typename TReal>
class aiVector2t
{
public:

	aiVector2t () : x(), y() {}
	aiVector2t (TReal _x, TReal _y) : x(_x), y(_y) {}
	explicit aiVector2t (TReal _xyz) : x(_xyz), y(_xyz) {}
	aiVector2t (const aiVector2t& o) : x(o.x), y(o.y) {}

public:

	void Set( TReal pX, TReal pY);
	TReal SquareLength() const ;
	TReal Length() const ;
	aiVector2t& Normalize();

public:

	const aiVector2t& operator += (const aiVector2t& o);
	const aiVector2t& operator -= (const aiVector2t& o);
	const aiVector2t& operator *= (TReal f);
	const aiVector2t& operator /= (TReal f);

	TReal operator[](unsigned int i) const;
	TReal& operator[](unsigned int i);

	bool operator== (const aiVector2t& other) const;
	bool operator!= (const aiVector2t& other) const;

	bool Equal(const aiVector2t& other, TReal epsilon = 1e-6) const;

	aiVector2t& operator= (TReal f);
	const aiVector2t SymMul(const aiVector2t& o);

	template <typename TOther>
	operator aiVector2t<TOther> () const;

	TReal x, y;
} PACK_STRUCT;

typedef aiVector2t<float> aiVector2D;

#else

struct aiVector2D {
	float x,y;
};

#endif // __cplusplus

#include "./Compiler/poppack1.h"

#endif // AI_VECTOR2D_H_INC


text:
title: Seth Bling
summary: Game hacker, streamer, speedrunner
date: 2016-05-24
categories:
- game
- video
- windows
---

### Who are you, and what do you do?

My name is [Seth](https://twitter.com/sethbling "Seth's Twitter account."), but on the Internet I go by Sethbling. I run [a gaming-centric YouTube channel](https://www.youtube.com/user/sethbling "Seth's YouTube channel."), particularly focused on Mario games and [Minecraft][]. My channel is all about engineering and deconstructing games. My channel grew popular through my Minecraft recreations of other games, things like [Splatoon][], [agar.io][], and [Team Fortress 2][tf2]. I've since branched out into speedrunning, and creating my own Minecraft maps and [Mario Maker][super-mario-maker] levels, as well as venturing into the world of livestreaming on [Twitch][].

I really like to find out how a game works at a deep level, and see how I can use that knowledge to really break the game wide open. People watch my videos to see the wacky ways I've been able to do unexpected things in video games, and to learn about how those exploits work.

### What hardware do you use?

My computer is a custom laptop build from Malibal. It's got an i7 desktop CPU and high end mobile video card, and weighs something like 10 pounds. The power brick is similarly heavy. I do all my work, including video rendering and livestreaming on this laptop, with the idea that if I travel I can pack my work computer and bring it with me, and my entire setup will be exactly the same.

I use a [Blue Yeti mic][yeti] and a [Logitech C920 webcam][c920] for recording. I play Super Mario World on [SNES][] and Super Mario Maker on [Wii U][wii-u], so I use an [XCAPTURE-1 HD capture card][xcapture-1], as well as an [XRGB-mini Framemeister hardware upscaler][xrgb-mini-framemeister] to convert SNES to 720p. I have two ASUS monitors that I plug into my laptop, as well as an external keyboard and wireless mouse, which makes it basically feel like a desktop.

### And what software?

I use [Dxtory][] to record DirectX games, and [XSplit][broadcaster] to screen capture, as well as for livestreaming. I use [Vegas Movie Studio][vegas-movie-studio] for editing, it's a relatively cheap and full-featured piece of video editing software. I occasionally use [Handbrake][] to transcode video. Sometimes I use [Audacity][] to record audio snippets. When collaborating, I use a variety of voice software, from [Skype][] to [Discord][] to [Mumble][] to [TeamSpeak][]. I play Minecraft, and often use [MCEdit][] to edit my Minecraft worlds. I also use the [Bizhawk][] SNES emulator to help me do glitch hunting and exploit/speedrun routing for [Super Mario World][super-mario-world].

### What would be your dream setup?

I'm generally pretty happy with my current setup. I always wondered what it would be like to have a 3x3 grid of monitors, but that does seem a bit impractical. Someday I might switch to an XLR audio setup, including a hardware compressor - I think it would improve my audio quality. And get a better facecam for my livestreams. If we're really dreaming, it'd be nice if everything was wireless; my desk is kind of a mess with wires.

[agar.io]: http://agar.io/ "A game involving spheres that consume other spheres."
[audacity]: https://sourceforge.net/projects/audacity/ "An open-source, cross-platform audio editor."
[bizhawk]: http://tasvideos.org/BizHawk.html "An emulator for a number of game platforms."
[broadcaster]: https://www.xsplit.com//#broadcaster "Multimedia broadcasting software for Windows."
[c920]: https://www.logitech.com/en-us/product/hd-pro-webcam-c920 "A webcam."
[discord]: https://discordapp.com/ "A voice and text chat service."
[dxtory]: https://exkode.com/dxtory-features-en.html "DirectX and OpenGL video capture software."
[handbrake]: https://handbrake.fr/ "Cross-platform, open source video encoding software."
[mcedit]: http://www.mcedit.net/ "A Minecraft saved game editor."
[minecraft]: https://minecraft.net/ "A digging and building game."
[mumble]: https://wiki.mumble.info/wiki/Main_Page "Voice chat software."
[skype]: https://www.skype.com/en/ "Voice and video chat software."
[snes]: https://en.wikipedia.org/wiki/Super_Nintendo_Entertainment_System "A 16-bit video game console."
[splatoon]: https://en.wikipedia.org/wiki/Splatoon "A third-person shooting game."
[super-mario-maker]: https://en.wikipedia.org/wiki/Super_Mario_Maker "A video game and game editor for the Wii U."
[super-mario-world]: https://en.wikipedia.org/wiki/Super_Mario_World "A platforming game for the SNES."
[teamspeak]: https://www.teamspeak.com/ "A voice chat service."
[tf2]: http://www.teamfortress.com/ "A team FPS game."
[twitch]: https://www.twitch.tv/ "A video broadcasting service."
[vegas-movie-studio]: https://en.wikipedia.org/wiki/Sony_Vegas_Movie_Studio "Video editing software."
[wii-u]: https://www.nintendo.com/wiiu "A unique gaming console."
[xcapture-1]: https://solarisjapan.com/products/xcapture-1-usb-3-0-hd-capture-unit "A USB-based video capture device."
[xrgb-mini-framemeister]: https://solarisjapan.com/products/xrgb-mini-framemeister-compact-up-scaler-unit "A device for upscaling video sources."
[yeti]: http://bluemic.com/yeti/ "A USB microphone."


text:
"""pool but no finish."""

import multiprocessing as mp

import wandb
import yea

def do_run(num):
    run = wandb.init()
    run.config.id = num
    run.log(dict(s=num))
    return num

def main():
    wandb.require("service")
    wandb.setup()
    num_proc = 4
    pool = mp.Pool(processes=num_proc)
    result = pool.map_async(do_run, range(num_proc))

    data = result.get(60)
    print(f"DEBUG: {data}")
    assert len(data) == 4

if __name__ == "__main__":
    yea.setup()  # Use ":yea:start_method:" to set mp.set_start_method()
    main()


text:
package com.gs.collections.impl.partition.set;

import com.gs.collections.api.partition.set.PartitionImmutableSet;
import com.gs.collections.api.partition.set.PartitionMutableSet;
import com.gs.collections.api.set.ImmutableSet;
import net.jcip.annotations.Immutable;

@Immutable
public class PartitionImmutableSetImpl<T> implements PartitionImmutableSet<T>
{
    private final ImmutableSet<T> selected;
    private final ImmutableSet<T> rejected;

    public PartitionImmutableSetImpl(PartitionMutableSet<T> mutablePartition)
    {
        this.selected = mutablePartition.getSelected().toImmutable();
        this.rejected = mutablePartition.getRejected().toImmutable();
    }

    public ImmutableSet<T> getSelected()
    {
        return this.selected;
    }

    public ImmutableSet<T> getRejected()
    {
        return this.rejected;
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.blueweather"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_SETTINGS" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.CALL_PHONE" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_GPS" />

    <uses-sdk
        android:minSdkVersion="14"
        android:targetSdkVersion="21" />

    <application
        android:name="com.example.blueweather.activity.BlueWeatherApplication"
        android:allowBackup="true"
        android:icon="@drawable/blue_weather1"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <meta-data
            android:name="com.baidu.lbsapi.API_KEY"
            android:value="RSLabG1PzmZcU5m99KcNx1jGupBAevFE" />
        <activity
            android:name="com.example.blueweather.activity.WeatherActivity"
            android:label="@string/app_name"
            android:configChanges="orientation|screenSize"
            android:launchMode="singleTask" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name="com.example.blueweather.activity.SettingActivity"
            android:configChanges="orientation|screenSize" >
        </activity>
        <activity
            android:name="com.example.blueweather.activity.ChooseAreaActivity"
            android:configChanges="orientation|screenSize" >
		</activity>

        <service
            android:name="com.baidu.location.f"
            android:enabled="true"
            android:process=":remote"
            android:permission="android.permission.BAIDU_LOCATION_SERVICE">
        </service>

        <service
            android:name="com.example.blueweather.service.AutoUpdateService" >
        </service>

        <receiver
            android:name="com.example.blueweather.receiver.AutoUpdateReceiver">
        </receiver>
    </application>

</manifest>


text:
#include "../../inc/MarlinConfig.h"

#if HAS_STATUS_MESSAGE

#include "../gcode.h"
#include "../../lcd/marlinui.h"

/**
 * M117: Set LCD Status Message
 */
void GcodeSuite::M117() {

  if (parser.string_arg && parser.string_arg[0])
    ui.set_status(parser.string_arg);
  else
    ui.reset_status();

}

#endif // HAS_STATUS_MESSAGE


text:
package org.springframework.cloud.stream.app.test.rabbit;

import static org.mockito.Matchers.anyBoolean;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

import java.util.Properties;

import org.springframework.amqp.rabbit.connection.Connection;
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
import org.springframework.cloud.stream.app.test.BinderTestPropertiesInitializer;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.rabbitmq.client.Channel;

/**
 * Generated app test configuration for RabbitMQ Source.
 *
 * @author Gary Russell
 *
 */
@Configuration
public class RabbitSourceTestConfiguration {

	@Bean
	public static BinderTestPropertiesInitializer loadProps(ConfigurableApplicationContext context) {
		// minimal properties for the context to load
		Properties properties = new Properties();
		properties.put("queues", "foo");
		return new BinderTestPropertiesInitializer(context, properties);
	}

	@Bean
	public ConnectionFactory rabbitConnectionFactory() {
		ConnectionFactory mockCF = mock(ConnectionFactory.class);
		Connection mockConn = mock(Connection.class);
		when(mockCF.createConnection()).thenReturn(mockConn);
		Channel mockChannel = mock(Channel.class);
		when(mockChannel.isOpen()).thenReturn(true);
		when(mockConn.createChannel(anyBoolean())).thenReturn(mockChannel);
		return mockCF;
	}

}


text:
{% extends "base.html" %}
{% import "bootstrap/wtf.html" as wtf %}
{% block title %}Delete Confirm{% endblock %}

{% block page_content %}

Delete Confirmation

  {{ wtf.quick_form(form) }}

  Delete
  Cancel

{% endblock %}

{% block scripts %}
{{ super() }}
{{ pagedown.include_pagedown() }}
{% endblock %}


text:
namespace Merchello.Web.Discounts.Coupons.Constraints
{
    using Merchello.Core;
    using Merchello.Core.Exceptions;
    using Merchello.Core.Marketing.Constraints;
    using Merchello.Core.Marketing.Offer;
    using Merchello.Core.Models;

    using Umbraco.Core;

    /// <summary>
    /// Base class for coupon constraints.
    /// </summary>
    public abstract class CouponConstraintBase : OfferConstraintComponentBase<ILineItemContainer>
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="CouponConstraintBase"/> class.
        /// </summary>
        /// <param name="definition">
        /// The definition.
        /// </param>
        protected CouponConstraintBase(OfferComponentDefinition definition)
            : base(definition)
        {
        }

        /// <summary>
        /// Utility method to build a successful <see cref="Attempt{ILineItemCollection}"/>.
        /// </summary>
        /// <param name="value">
        /// The value.
        /// </param>
        /// <returns>
        /// The <see cref="Attempt"/>.
        /// </returns>
        protected Attempt<ILineItemContainer> Success(ILineItemContainer value)
        {
            return Attempt<ILineItemContainer>.Succeed(value);
        }

        /// <summary>
        /// Utility method to build a failed <see cref="Attempt{ILineItemCollection}"/>.
        /// </summary>
        /// <param name="value">
        /// The value.
        /// </param>
        /// <param name="message">
        /// The message.
        /// </param>
        /// <returns>
        /// The <see cref="Attempt"/>.
        /// </returns>
        protected Attempt<ILineItemContainer> Fail(ILineItemContainer value, string message)
        {
            var att = this.GetOfferComponentAttribute();
            var msg = string.Format("{0}: {1}", att.Name, message);
            return Attempt<ILineItemContainer>.Fail(value, new OfferRedemptionException(msg));
        }
    }
}


text:
<!DOCTYPE html>

        <meta name="viewport" content="width=device-width, maximum-scale=1.0, initial-scale=1.0, user-scalable=no"/>
        <meta charset="utf-8"/>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <link href='//fonts.googleapis.com/css?family=Droid+Sans' rel='stylesheet' type='text/css'>
        <title>Kasutajate haldus</title>
        <link rel="stylesheet" href="css/icons.css"/>
        <link rel="stylesheet" href="css/forms.css"/>
        <link rel="stylesheet" href="css/style.css"/>

            <container>
                <h>Identity management</h>
            </container>

        <container id="users">

        </container>
        <container id="profile">
        </container>


text:
'use strict';

var xhr = require('xhr');
var sum = require('hash-sum');
var temporize = require('temporize');

function request (url, options, end) {
  var displaced = typeof options === 'function';
  var hasUrl = typeof url === 'string';
  var user;
  var done = displaced ? options : end;

  if (hasUrl) {
    if (displaced) {
      user = { url: url };
    } else {
      user = options;
      user.url = url;
    }
  } else {
    user = url;
  }

  var o = {
    headers: { Accept: 'application/json' }
  };
  Object.keys(user).forEach(overwrite);

  var req;
  var hash = sum(o) + ':' + o.url;
  var cached = true;

  temporize({
    name: hash,
    seconds: 1,
    load: load
  }, loaded);

  return req;

  function overwrite (prop) {
    o[prop] = user[prop];
  }

  function load (done) {
    global.DEBUG && global.DEBUG('[xhr] %s %s', o.method || 'GET', o.url);
    cached = false;
    var result = xhr(o, handle);
    done(null, result);
    return result;
  }

  function loaded (result) {
    if (cached) {
      global.DEBUG && global.DEBUG('[xhr] %s %s (cache)', o.method || 'GET', o.url);
    }
    req = result;
  }

  function handle (err, res, body) {
    if (err && !req.getAllResponseHeaders()) {
      global.DEBUG && global.DEBUG('[xhr] %s %s (aborted)', o.method || 'GET', o.url);
      done(new Error('aborted'), null, res);
    } else {
      try  {
        res.body = body = JSON.parse(body);
      } catch (e) {
        // suppress
      }
      global.DEBUG && global.DEBUG('[xhr] %s %s (done)', o.method || 'GET', o.url);
      done(err, body, res);
    }
  }
}

module.exports = request;


text:
package com.gatech.beatouch.entities;

public class Metadata extends BaseMetadata{
    public String difficultyName;
    public Long difficulty;

    public int compareTo(Metadata metadata) {
        if (songName.equals(metadata.songName))
        {
            if (difficulty.equals(metadata.difficulty))
            {
                return difficultyName.compareTo(metadata.difficultyName);
            }
            else return Long.compare(difficulty, metadata.difficulty);
        }
        return songName.compareTo(metadata.songName);
    }
}


text:
module Nanoc::Helpers
  # @see https://nanoc.ws/doc/reference/helpers/#filtering
  module HTMLEscape
    require 'nanoc/helpers/capturing'
    include Nanoc::Helpers::Capturing

    # @param [String] string
    #
    # @return [String]
    def html_escape(string = nil, &block)
      if block_given?
        # Capture and escape block
        data = capture(&block)
        escaped_data = html_escape(data)

        # Append filtered data to buffer
        buffer = eval('_erbout', block.binding)
        buffer << escaped_data
      elsif string
        unless string.is_a? String
          raise ArgumentError, 'The #html_escape or #h function needs either a ' \
            "string or a block to HTML-escape, but #{string.class} was given"
        end

        string
          .gsub('&', '&')
          .gsub('<', '<')
          .gsub('>', '>')
          .gsub('"', '"')
          .gsub("'", ''')
      else
        raise 'The #html_escape or #h function needs either a ' \
          'string or a block to HTML-escape, but neither a string nor a block was given'
      end
    end

    alias h html_escape
  end
end


text:
package manifestfakes

import (
	"io"
	"sync"

	"code.cloudfoundry.org/cli/cf/manifest"
	"code.cloudfoundry.org/cli/cf/models"
)

type FakeApp struct {
	BuildpackURLStub        func(string, string)
	buildpackURLMutex       sync.RWMutex
	buildpackURLArgsForCall []struct {
		arg1 string
		arg2 string
	}
	DiskQuotaStub        func(string, int64)
	diskQuotaMutex       sync.RWMutex
	diskQuotaArgsForCall []struct {
		arg1 string
		arg2 int64
	}
	MemoryStub        func(string, int64)
	memoryMutex       sync.RWMutex
	memoryArgsForCall []struct {
		arg1 string
		arg2 int64
	}
	ServiceStub        func(string, string)
	serviceMutex       sync.RWMutex
	serviceArgsForCall []struct {
		arg1 string
		arg2 string
	}
	StartCommandStub        func(string, string)
	startCommandMutex       sync.RWMutex
	startCommandArgsForCall []struct {
		arg1 string
		arg2 string
	}
	EnvironmentVarsStub        func(string, string, string)
	environmentVarsMutex       sync.RWMutex
	environmentVarsArgsForCall []struct {
		arg1 string
		arg2 string
		arg3 string
	}
	HealthCheckTimeoutStub        func(string, int)
	healthCheckTimeoutMutex       sync.RWMutex
	healthCheckTimeoutArgsForCall []struct {
		arg1 string
		arg2 int
	}
	HealthCheckTypeStub        func(string, string)
	healthCheckTypeMutex       sync.RWMutex
	healthCheckTypeArgsForCall []struct {
		arg1 string
		arg2 string
	}
	HealthCheckHTTPEndpointStub        func(string, string)
	healthCheckHTTPEndpointMutex       sync.RWMutex
	healthCheckHTTPEndpointArgsForCall []struct {
		arg1 string
		arg2 string
	}
	InstancesStub        func(string, int)
	instancesMutex       sync.RWMutex
	instancesArgsForCall []struct {
		arg1 string
		arg2 int
	}
	RouteStub        func(string, string, string, string, int)
	routeMutex       sync.RWMutex
	routeArgsForCall []struct {
		arg1 string
		arg2 string
		arg3 string
		arg4 string
		arg5 int
	}
	GetContentsStub        func() []models.Application
	getContentsMutex       sync.RWMutex
	getContentsArgsForCall []struct{}
	getContentsReturns     struct {
		result1 []models.Application
	}
	StackStub        func(string, string)
	stackMutex       sync.RWMutex
	stackArgsForCall []struct {
		arg1 string
		arg2 string
	}
	SaveStub        func(f io.Writer) error
	saveMutex       sync.RWMutex
	saveArgsForCall []struct {
		f io.Writer
	}
	saveReturns struct {
		result1 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeApp) BuildpackURL(arg1 string, arg2 string) {
	fake.buildpackURLMutex.Lock()
	fake.buildpackURLArgsForCall = append(fake.buildpackURLArgsForCall, struct {
		arg1 string
		arg2 string
	}{arg1, arg2})
	fake.recordInvocation("BuildpackURL", []interface{}{arg1, arg2})
	fake.buildpackURLMutex.Unlock()
	if fake.BuildpackURLStub != nil {
		fake.BuildpackURLStub(arg1, arg2)
	}
}

func (fake *FakeApp) BuildpackURLCallCount() int {
	fake.buildpackURLMutex.RLock()
	defer fake.buildpackURLMutex.RUnlock()
	return len(fake.buildpackURLArgsForCall)
}

func (fake *FakeApp) BuildpackURLArgsForCall(i int) (string, string) {
	fake.buildpackURLMutex.RLock()
	defer fake.buildpackURLMutex.RUnlock()
	return fake.buildpackURLArgsForCall[i].arg1, fake.buildpackURLArgsForCall[i].arg2
}

func (fake *FakeApp) DiskQuota(arg1 string, arg2 int64) {
	fake.diskQuotaMutex.Lock()
	fake.diskQuotaArgsForCall = append(fake.diskQuotaArgsForCall, struct {
		arg1 string
		arg2 int64
	}{arg1, arg2})
	fake.recordInvocation("DiskQuota", []interface{}{arg1, arg2})
	fake.diskQuotaMutex.Unlock()
	if fake.DiskQuotaStub != nil {
		fake.DiskQuotaStub(arg1, arg2)
	}
}

func (fake *FakeApp) DiskQuotaCallCount() int {
	fake.diskQuotaMutex.RLock()
	defer fake.diskQuotaMutex.RUnlock()
	return len(fake.diskQuotaArgsForCall)
}

func (fake *FakeApp) DiskQuotaArgsForCall(i int) (string, int64) {
	fake.diskQuotaMutex.RLock()
	defer fake.diskQuotaMutex.RUnlock()
	return fake.diskQuotaArgsForCall[i].arg1, fake.diskQuotaArgsForCall[i].arg2
}

func (fake *FakeApp) Memory(arg1 string, arg2 int64) {
	fake.memoryMutex.Lock()
	fake.memoryArgsForCall = append(fake.memoryArgsForCall, struct {
		arg1 string
		arg2 int64
	}{arg1, arg2})
	fake.recordInvocation("Memory", []interface{}{arg1, arg2})
	fake.memoryMutex.Unlock()
	if fake.MemoryStub != nil {
		fake.MemoryStub(arg1, arg2)
	}
}

func (fake *FakeApp) MemoryCallCount() int {
	fake.memoryMutex.RLock()
	defer fake.memoryMutex.RUnlock()
	return len(fake.memoryArgsForCall)
}

func (fake *FakeApp) MemoryArgsForCall(i int) (string, int64) {
	fake.memoryMutex.RLock()
	defer fake.memoryMutex.RUnlock()
	return fake.memoryArgsForCall[i].arg1, fake.memoryArgsForCall[i].arg2
}

func (fake *FakeApp) Service(arg1 string, arg2 string) {
	fake.serviceMutex.Lock()
	fake.serviceArgsForCall = append(fake.serviceArgsForCall, struct {
		arg1 string
		arg2 string
	}{arg1, arg2})
	fake.recordInvocation("Service", []interface{}{arg1, arg2})
	fake.serviceMutex.Unlock()
	if fake.ServiceStub != nil {
		fake.ServiceStub(arg1, arg2)
	}
}

func (fake *FakeApp) ServiceCallCount() int {
	fake.serviceMutex.RLock()
	defer fake.serviceMutex.RUnlock()
	return len(fake.serviceArgsForCall)
}

func (fake *FakeApp) ServiceArgsForCall(i int) (string, string) {
	fake.serviceMutex.RLock()
	defer fake.serviceMutex.RUnlock()
	return fake.serviceArgsForCall[i].arg1, fake.serviceArgsForCall[i].arg2
}

func (fake *FakeApp) StartCommand(arg1 string, arg2 string) {
	fake.startCommandMutex.Lock()
	fake.startCommandArgsForCall = append(fake.startCommandArgsForCall, struct {
		arg1 string
		arg2 string
	}{arg1, arg2})
	fake.recordInvocation("StartCommand", []interface{}{arg1, arg2})
	fake.startCommandMutex.Unlock()
	if fake.StartCommandStub != nil {
		fake.StartCommandStub(arg1, arg2)
	}
}

func (fake *FakeApp) StartCommandCallCount() int {
	fake.startCommandMutex.RLock()
	defer fake.startCommandMutex.RUnlock()
	return len(fake.startCommandArgsForCall)
}

func (fake *FakeApp) StartCommandArgsForCall(i int) (string, string) {
	fake.startCommandMutex.RLock()
	defer fake.startCommandMutex.RUnlock()
	return fake.startCommandArgsForCall[i].arg1, fake.startCommandArgsForCall[i].arg2
}

func (fake *FakeApp) EnvironmentVars(arg1 string, arg2 string, arg3 string) {
	fake.environmentVarsMutex.Lock()
	fake.environmentVarsArgsForCall = append(fake.environmentVarsArgsForCall, struct {
		arg1 string
		arg2 string
		arg3 string
	}{arg1, arg2, arg3})
	fake.recordInvocation("EnvironmentVars", []interface{}{arg1, arg2, arg3})
	fake.environmentVarsMutex.Unlock()
	if fake.EnvironmentVarsStub != nil {
		fake.EnvironmentVarsStub(arg1, arg2, arg3)
	}
}

func (fake *FakeApp) EnvironmentVarsCallCount() int {
	fake.environmentVarsMutex.RLock()
	defer fake.environmentVarsMutex.RUnlock()
	return len(fake.environmentVarsArgsForCall)
}

func (fake *FakeApp) EnvironmentVarsArgsForCall(i int) (string, string, string) {
	fake.environmentVarsMutex.RLock()
	defer fake.environmentVarsMutex.RUnlock()
	return fake.environmentVarsArgsForCall[i].arg1, fake.environmentVarsArgsForCall[i].arg2, fake.environmentVarsArgsForCall[i].arg3
}

func (fake *FakeApp) HealthCheckTimeout(arg1 string, arg2 int) {
	fake.healthCheckTimeoutMutex.Lock()
	fake.healthCheckTimeoutArgsForCall = append(fake.healthCheckTimeoutArgsForCall, struct {
		arg1 string
		arg2 int
	}{arg1, arg2})
	fake.recordInvocation("HealthCheckTimeout", []interface{}{arg1, arg2})
	fake.healthCheckTimeoutMutex.Unlock()
	if fake.HealthCheckTimeoutStub != nil {
		fake.HealthCheckTimeoutStub(arg1, arg2)
	}
}

func (fake *FakeApp) HealthCheckTimeoutCallCount() int {
	fake.healthCheckTimeoutMutex.RLock()
	defer fake.healthCheckTimeoutMutex.RUnlock()
	return len(fake.healthCheckTimeoutArgsForCall)
}

func (fake *FakeApp) HealthCheckTimeoutArgsForCall(i int) (string, int) {
	fake.healthCheckTimeoutMutex.RLock()
	defer fake.healthCheckTimeoutMutex.RUnlock()
	return fake.healthCheckTimeoutArgsForCall[i].arg1, fake.healthCheckTimeoutArgsForCall[i].arg2
}

func (fake *FakeApp) HealthCheckType(arg1 string, arg2 string) {
	fake.healthCheckTypeMutex.Lock()
	fake.healthCheckTypeArgsForCall = append(fake.healthCheckTypeArgsForCall, struct {
		arg1 string
		arg2 string
	}{arg1, arg2})
	fake.recordInvocation("HealthCheckType", []interface{}{arg1, arg2})
	fake.healthCheckTypeMutex.Unlock()
	if fake.HealthCheckTypeStub != nil {
		fake.HealthCheckTypeStub(arg1, arg2)
	}
}

func (fake *FakeApp) HealthCheckTypeCallCount() int {
	fake.healthCheckTypeMutex.RLock()
	defer fake.healthCheckTypeMutex.RUnlock()
	return len(fake.healthCheckTypeArgsForCall)
}

func (fake *FakeApp) HealthCheckTypeArgsForCall(i int) (string, string) {
	fake.healthCheckTypeMutex.RLock()
	defer fake.healthCheckTypeMutex.RUnlock()
	return fake.healthCheckTypeArgsForCall[i].arg1, fake.healthCheckTypeArgsForCall[i].arg2
}

func (fake *FakeApp) HealthCheckHTTPEndpoint(arg1 string, arg2 string) {
	fake.healthCheckHTTPEndpointMutex.Lock()
	fake.healthCheckHTTPEndpointArgsForCall = append(fake.healthCheckHTTPEndpointArgsForCall, struct {
		arg1 string
		arg2 string
	}{arg1, arg2})
	fake.recordInvocation("HealthCheckHTTPEndpoint", []interface{}{arg1, arg2})
	fake.healthCheckHTTPEndpointMutex.Unlock()
	if fake.HealthCheckHTTPEndpointStub != nil {
		fake.HealthCheckHTTPEndpointStub(arg1, arg2)
	}
}

func (fake *FakeApp) HealthCheckHTTPEndpointCallCount() int {
	fake.healthCheckHTTPEndpointMutex.RLock()
	defer fake.healthCheckHTTPEndpointMutex.RUnlock()
	return len(fake.healthCheckHTTPEndpointArgsForCall)
}

func (fake *FakeApp) HealthCheckHTTPEndpointArgsForCall(i int) (string, string) {
	fake.healthCheckHTTPEndpointMutex.RLock()
	defer fake.healthCheckHTTPEndpointMutex.RUnlock()
	return fake.healthCheckHTTPEndpointArgsForCall[i].arg1, fake.healthCheckHTTPEndpointArgsForCall[i].arg2
}

func (fake *FakeApp) Instances(arg1 string, arg2 int) {
	fake.instancesMutex.Lock()
	fake.instancesArgsForCall = append(fake.instancesArgsForCall, struct {
		arg1 string
		arg2 int
	}{arg1, arg2})
	fake.recordInvocation("Instances", []interface{}{arg1, arg2})
	fake.instancesMutex.Unlock()
	if fake.InstancesStub != nil {
		fake.InstancesStub(arg1, arg2)
	}
}

func (fake *FakeApp) InstancesCallCount() int {
	fake.instancesMutex.RLock()
	defer fake.instancesMutex.RUnlock()
	return len(fake.instancesArgsForCall)
}

func (fake *FakeApp) InstancesArgsForCall(i int) (string, int) {
	fake.instancesMutex.RLock()
	defer fake.instancesMutex.RUnlock()
	return fake.instancesArgsForCall[i].arg1, fake.instancesArgsForCall[i].arg2
}

func (fake *FakeApp) Route(arg1 string, arg2 string, arg3 string, arg4 string, arg5 int) {
	fake.routeMutex.Lock()
	fake.routeArgsForCall = append(fake.routeArgsForCall, struct {
		arg1 string
		arg2 string
		arg3 string
		arg4 string
		arg5 int
	}{arg1, arg2, arg3, arg4, arg5})
	fake.recordInvocation("Route", []interface{}{arg1, arg2, arg3, arg4, arg5})
	fake.routeMutex.Unlock()
	if fake.RouteStub != nil {
		fake.RouteStub(arg1, arg2, arg3, arg4, arg5)
	}
}

func (fake *FakeApp) RouteCallCount() int {
	fake.routeMutex.RLock()
	defer fake.routeMutex.RUnlock()
	return len(fake.routeArgsForCall)
}

func (fake *FakeApp) RouteArgsForCall(i int) (string, string, string, string, int) {
	fake.routeMutex.RLock()
	defer fake.routeMutex.RUnlock()
	return fake.routeArgsForCall[i].arg1, fake.routeArgsForCall[i].arg2, fake.routeArgsForCall[i].arg3, fake.routeArgsForCall[i].arg4, fake.routeArgsForCall[i].arg5
}

func (fake *FakeApp) GetContents() []models.Application {
	fake.getContentsMutex.Lock()
	fake.getContentsArgsForCall = append(fake.getContentsArgsForCall, struct{}{})
	fake.recordInvocation("GetContents", []interface{}{})
	fake.getContentsMutex.Unlock()
	if fake.GetContentsStub != nil {
		return fake.GetContentsStub()
	} else {
		return fake.getContentsReturns.result1
	}
}

func (fake *FakeApp) GetContentsCallCount() int {
	fake.getContentsMutex.RLock()
	defer fake.getContentsMutex.RUnlock()
	return len(fake.getContentsArgsForCall)
}

func (fake *FakeApp) GetContentsReturns(result1 []models.Application) {
	fake.GetContentsStub = nil
	fake.getContentsReturns = struct {
		result1 []models.Application
	}{result1}
}

func (fake *FakeApp) Stack(arg1 string, arg2 string) {
	fake.stackMutex.Lock()
	fake.stackArgsForCall = append(fake.stackArgsForCall, struct {
		arg1 string
		arg2 string
	}{arg1, arg2})
	fake.recordInvocation("Stack", []interface{}{arg1, arg2})
	fake.stackMutex.Unlock()
	if fake.StackStub != nil {
		fake.StackStub(arg1, arg2)
	}
}

func (fake *FakeApp) StackCallCount() int {
	fake.stackMutex.RLock()
	defer fake.stackMutex.RUnlock()
	return len(fake.stackArgsForCall)
}

func (fake *FakeApp) StackArgsForCall(i int) (string, string) {
	fake.stackMutex.RLock()
	defer fake.stackMutex.RUnlock()
	return fake.stackArgsForCall[i].arg1, fake.stackArgsForCall[i].arg2
}

func (fake *FakeApp) Save(f io.Writer) error {
	fake.saveMutex.Lock()
	fake.saveArgsForCall = append(fake.saveArgsForCall, struct {
		f io.Writer
	}{f})
	fake.recordInvocation("Save", []interface{}{f})
	fake.saveMutex.Unlock()
	if fake.SaveStub != nil {
		return fake.SaveStub(f)
	} else {
		return fake.saveReturns.result1
	}
}

func (fake *FakeApp) SaveCallCount() int {
	fake.saveMutex.RLock()
	defer fake.saveMutex.RUnlock()
	return len(fake.saveArgsForCall)
}

func (fake *FakeApp) SaveArgsForCall(i int) io.Writer {
	fake.saveMutex.RLock()
	defer fake.saveMutex.RUnlock()
	return fake.saveArgsForCall[i].f
}

func (fake *FakeApp) SaveReturns(result1 error) {
	fake.SaveStub = nil
	fake.saveReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeApp) Invocations() map[string][][]interface{} {
	fake.invocationsMutex.RLock()
	defer fake.invocationsMutex.RUnlock()
	fake.buildpackURLMutex.RLock()
	defer fake.buildpackURLMutex.RUnlock()
	fake.diskQuotaMutex.RLock()
	defer fake.diskQuotaMutex.RUnlock()
	fake.memoryMutex.RLock()
	defer fake.memoryMutex.RUnlock()
	fake.serviceMutex.RLock()
	defer fake.serviceMutex.RUnlock()
	fake.startCommandMutex.RLock()
	defer fake.startCommandMutex.RUnlock()
	fake.environmentVarsMutex.RLock()
	defer fake.environmentVarsMutex.RUnlock()
	fake.healthCheckTimeoutMutex.RLock()
	defer fake.healthCheckTimeoutMutex.RUnlock()
	fake.healthCheckTypeMutex.RLock()
	defer fake.healthCheckTypeMutex.RUnlock()
	fake.healthCheckHTTPEndpointMutex.RLock()
	defer fake.healthCheckHTTPEndpointMutex.RUnlock()
	fake.instancesMutex.RLock()
	defer fake.instancesMutex.RUnlock()
	fake.routeMutex.RLock()
	defer fake.routeMutex.RUnlock()
	fake.getContentsMutex.RLock()
	defer fake.getContentsMutex.RUnlock()
	fake.stackMutex.RLock()
	defer fake.stackMutex.RUnlock()
	fake.saveMutex.RLock()
	defer fake.saveMutex.RUnlock()
	copiedInvocations := map[string][][]interface{}{}
	for key, value := range fake.invocations {
		copiedInvocations[key] = value
	}
	return copiedInvocations
}

func (fake *FakeApp) recordInvocation(key string, args []interface{}) {
	fake.invocationsMutex.Lock()
	defer fake.invocationsMutex.Unlock()
	if fake.invocations == nil {
		fake.invocations = map[string][][]interface{}{}
	}
	if fake.invocations[key] == nil {
		fake.invocations[key] = [][]interface{}{}
	}
	fake.invocations[key] = append(fake.invocations[key], args)
}

var _ manifest.App = new(FakeApp)


text:
package com.profitbricks.rest.domain;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
 * @author denis@stackpointcloud.com
 */
public class Share extends ProfitbricksBase{
    private Properties properties = new Properties();

    /**
     * @return the properties
     */
    public Properties getProperties() {
        return properties;
    }

    /**
     * @param properties the properties to set
     */
    public void setProperties(Properties properties) {
        this.properties = properties;
    }

    @JsonIgnoreProperties(ignoreUnknown = true)
    public class Properties {
        private Boolean editPrivilege;
        private  Boolean sharePrivilege;

        public Boolean getEditPrivilege() {
            return editPrivilege;
        }

        public void setEditPrivilege(Boolean editPrivilege) {
            this.editPrivilege = editPrivilege;
        }

        public Boolean getSharePrivilege() {
            return sharePrivilege;
        }

        public void setSharePrivilege(Boolean sharePrivilege) {
            this.sharePrivilege = sharePrivilege;
        }
    }
}


text:
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="DensityTests.cs" company="QuantityTypes">
//   Copyright (c) 2014 QuantityTypes contributors
// </copyright>
// --------------------------------------------------------------------------------------------------------------------

namespace QuantityTypes.Tests
{
    using System.Diagnostics.CodeAnalysis;

    using NUnit.Framework;

    [TestFixture]
    [SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1600:ElementsMustBeDocumented",
        Justification = "Reviewed. Suppression is OK here.")]
    // ReSharper disable InconsistentNaming
    public class MassConcentrationTests
    {
        [Test]
        public void Constructor_Double()
        {
            Assert.AreEqual(2d, new MassConcentration(2).Value);
        }

        [Test]
        public void Constructor_String()
        {
            Assert.AreEqual(2d, new MassConcentration("2kg/m^3").Value);
        }

        [Test]
        public void Operator()
        {
            Assert.AreEqual(MassConcentration.KilogramPerCubicMetre, (MassConcentration)(Mass.Gram / Volume.Litre));
        }

        [Test]
        public void ConvertTo()
        {
            var wv = 1 * MassConcentration.MicrogramPerLitre;
            Assert.AreEqual(0.001d, wv.ConvertTo(MassConcentration.MilligramPerLitre));
        }

    }
}


text:
package org.wso2.carbon.esb.mediator.test.router;

import org.apache.axiom.om.OMElement;
import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import org.wso2.esb.integration.common.utils.ESBIntegrationTest;

/**
 * Tests whether routing happens to the given expression
 */

public class RouterMediatorExpressionTestCase extends ESBIntegrationTest {

    @BeforeClass
    public void setEnvironment() throws Exception {
        init();
        verifyProxyServiceExistence("routerExpressionTestProxy");
    }

    @Test(groups = "wso2.esb", description = "Tests the matches part of the expression")
    public void testMatchesExpression() throws Exception {
        OMElement response =
                axis2Client.sendSimpleStockQuoteRequest(getProxyServiceURLHttp("routerExpressionTestProxy"), null, "WSO2");
        Assert.assertTrue(response.toString().contains("WSO2"));
    }

    @AfterClass
    public void close() throws Exception {
        super.cleanup();
    }

}


text:
using fortune_api.Dtos.LoadBoard;
using fortune_api.Models.LoadBoard;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace fortune_api.Services.LoadBoard
{
    public interface ILocationService
    {
        /// <summary>
        /// Gets the location with the specified id
        /// </summary>
        /// <param name="id">Location Id</param>
        /// <returns>Location</returns>
        /// <exception cref="DoesNotExistException">Location does not exist</exception>
        LocationDto Get(Guid id);

        /// <summary>
        /// Gets all locations
        /// </summary>
        /// <param name="includeDeleted">Optional - Whether to include deleted locations</param>
        /// <returns>List of locations</returns>
        LocationDto[] Get(bool includeDeleted = false);

        /// <summary>
        /// Adds location
        /// </summary>
        /// <param name="location">Location to add</param>
        /// <returns>Saved location</returns>
        /// <exception cref="AlreadyExistsException">A location with the same name already exists</exception>
        LocationDto Add(LocationDto dto);

        /// <summary>
        /// Updates location
        /// </summary>
        /// <param name="location">Location to update</param>
        /// <returns>Saved location</returns>
        /// <exception cref="DoesNotExistException">Location does not exist</exception>
        /// <exception cref="ConflictException">Conflict occurred</exception>
        LocationDto Update(LocationDto dto);

        /// <summary>
        /// Soft deletes location
        /// </summary>
        /// <param name="id">Location Id</param>
        void Delete(Guid id);
    }
}


text:
using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore.Migrations;

namespace WWW.Data.Migrations
{
    public partial class CreateMorePropertiesForOrg : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<DateTime>(
                name: "JoinTime",
                table: "OURelations",
                nullable: false,
                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));

            migrationBuilder.AddColumn<DateTime>(
                name: "CreateTime",
                table: "Orgs",
                nullable: false,
                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "JoinTime",
                table: "OURelations");

            migrationBuilder.DropColumn(
                name: "CreateTime",
                table: "Orgs");
        }
    }
}


text:
namespace AttributeRouting.Framework
{
    /// <summary>
    /// Strategy for building route names from a route specification.
    /// </summary>
    interface IRouteNameBuilder
    {
        string Execute(RouteSpecification routeSpec);
    }
}


text:
package org.keycloak.it.cli;

import org.keycloak.it.junit5.extension.CLITestExtension;

/**
 * Used to specify the output directory for the received / to-be-approved outputs of this packages tests.
 * In our case they should be stored under resources/clitest/approvals or resources/rawdist/approvals depending
 * on the runtype of the tests (@DistributionTest in Raw mode, or @CLITest, leading to either using "kc.sh"
 * or "java -jar $KEYCLOAK_HOME/lib/quarkus-run.jar" as command in the usage output).
 *
 * Note: Creates the directories if they don't exist yet.
 * **/
public class PackageSettings {

    public String UseApprovalSubdirectory = "approvals/cli/help";
    public String ApprovalBaseDirectory = "../resources";
}


text:
/*
 *
 * Upvote
 *
 */

import { FC, memo } from 'react'

import type { TUser, TUpvoteLayout } from '@/spec'
import { UPVOTE_LAYOUT } from '@/constant'
import { buildLog } from '@/utils/logger'

import DefaultLayout from './DefaultLayout'
import KanbanLayout from './KanbanLayout'
import FixedHeaderLayout from './FixedHeaderLayout'
import CommentLayout from './CommentLayout'
import PostListLayout from './PostListLayout'
import GuideListLayout from './GuideListLayout'
import BlogListLayout from './BlogListLayout'
import ArticleLayout from './ArticleLayout'
import WorksArticleLayout from './WorksArticleLayout'
import WorksCardLayout from './WorksCardLayout'
import StickerLayout from './StickerLayout'

/* eslint-disable-next-line */
const log = buildLog('c:Upvote:index')

type TProps = {
  testid?: string
  type?: TUpvoteLayout
  count?: number
  avatarsRowLimit?: number
  viewerHasUpvoted?: boolean
  alias?: string // 觉得很赞(default), 觉得很酷(works), 学到了(blog), 感兴趣(meetup), 有意思(Radar)
  avatarList?: TUser[]
  onAction?: (did: boolean) => void
}

const Upvote: FC<TProps> = ({ type = UPVOTE_LAYOUT.DEFAULT, ...restProps }) => {
  switch (type) {
    case UPVOTE_LAYOUT.COMMENT: {
      return <CommentLayout {...restProps} />
    }
    case UPVOTE_LAYOUT.POST_LIST: {
      return <PostListLayout {...restProps} />
    }
    case UPVOTE_LAYOUT.GUIDE_LIST: {
      return <GuideListLayout {...restProps} />
    }
    case UPVOTE_LAYOUT.BLOG_LIST: {
      return <BlogListLayout {...restProps} />
    }
    case UPVOTE_LAYOUT.WORKS_ARTICLE: {
      return <WorksArticleLayout {...restProps} />
    }
    case UPVOTE_LAYOUT.WORKS_CARD: {
      return <WorksCardLayout {...restProps} />
    }
    case UPVOTE_LAYOUT.ARTICLE: {
      return <ArticleLayout {...restProps} />
    }
    case UPVOTE_LAYOUT.KANBAN: {
      return <KanbanLayout {...restProps} />
    }
    case UPVOTE_LAYOUT.FIXED_HEADER: {
      return <FixedHeaderLayout {...restProps} />
    }
    case UPVOTE_LAYOUT.STICKER: {
      return <StickerLayout {...restProps} />
    }
    default: {
      return <DefaultLayout {...restProps} />
    }
  }
}

export default memo(Upvote)


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

import java.lang.ref.Cleaner;

import com.sun.jna.WString;
import com.sun.jna.platform.win32.Kernel32Util;
import com.sun.jna.platform.win32.WinDef.DWORD;
import com.sun.jna.platform.win32.WinNT.HANDLE;
import com.sun.jna.platform.win32.COM.IUnknown;

import agent.dbgeng.impl.dbgeng.client.DebugClientInternal;
import agent.dbgeng.jna.dbgeng.DbgEngNative;
import ghidra.comm.util.BitmaskSet;
import ghidra.util.Msg;

/**
 * A wrapper for Microsoft's {@code dbgeng.dll} that presents a Java-friendly interface.
 *
 * This is the "root interface" from which all other interfaces to {@code dbgeng.dll} are generated.
 * Not every method listed in the documentation, nor every method present in the header, is
 * implemented. Only those that were necessary to implement the SCTL adapter. However, the class and
 * interface hierarchy was designed so that adding the remaining methods should be fairly
 * straightforward. This wrapper attempts to obtain the most capable COM interfaces for the debug
 * client that it knows. Again, newer interfaces should be fairly straightforward to add.
 *
 * Methods that are "obviously" wrappers for a COM method are left undocumented, unless there is
 * some nuance to how it has been wrapped. In many cases, a parameter which is an integer in the COM
 * method may be presented as an {@code enum} or {@link BitmaskSet} by the wrapper. Consult the MSDN
 * for the meaning of the various values and bit flags.
 *
 * Each wrapper interface is implemented by several COM interface wrappers: one for each known COM
 * interface version. The wrapper is optimistic, in that it declares wrapper methods even for COM
 * methods that are only available in later versions. The implementations limited to earlier COM
 * interfaces should either emulate the operation, or throw an
 * {@link UnsupportedOperationException}. Where a newer method is provided by a newer interface, a
 * wrapper implementation should prefer the latest. For example, one series of interfaces introduces
 * {@code *Wide} variants of existing methods. Since Java also uses a UTF-16-like string encoding
 * internally, JNA permits wide strings to be passed by reference. Thus, the wide variant is always
 * preferred.
 *
 * Pay careful attention to the threading requirements imposed by {@code dbgeng.dll} these can be
 * found in the MSDN. As a general rule of thumb, if the method is reentrant (i.e., it can be called
 * from any thread), it is declared in the {@code *Reentrant} variant of the wrapper interface.
 * There are few of these. Unless the documentation explicitly lists the method as reentrant, do not
 * declare it there. Many methods appear to execute successfully from the wrong thread, but cause
 * latent issues. A practice to prevent accidental use of non-reentrant methods outside of the
 * client's owning thread is to ensure that only the owning thread can see the full interface. All
 * other threads should only have access to the reentrant interface.
 *
 * If you implement methods that introduce a new callback class, use the existing callback type
 * hierarchies as a model. There are many classes to implement. Furthermore, be sure to keep a
 * reference to any active callback instances within the wrapper that uses them. The JNA has no way
 * of knowing whether or not the instance is still being used by the external C/C++ library. If you
 * do not store a reference, the JVM will think it's garbage and free it, even though COM is still
 * using it. Drop the reference only when you are certain nothing external has a reference to it.
 */
public class DbgEng {
	private static final Cleaner CLEANER = Cleaner.create();

	private static class ReleaseCOMObject implements Runnable {
		private final IUnknown obj;

		ReleaseCOMObject(IUnknown obj) {
			this.obj = obj;
		}

		@Override
		public void run() {
			Msg.debug(this, "Releasing COM object: " + obj);
			obj.Release();
		}
	}

	private static class ReleaseHANDLE implements Runnable {
		private final HANDLE handle;

		public ReleaseHANDLE(HANDLE handle) {
			this.handle = handle;
		}

		@Override
		public void run() {
			Kernel32Util.closeHandle(handle);
		}
	}

	public static class OpaqueCleanable {
		@SuppressWarnings("unused") // A reference to control GC
		private final Object state;
		@SuppressWarnings("unused") // A reference to control GC
		private final Cleaner.Cleanable cleanable;

		public OpaqueCleanable(Object state, Cleaner.Cleanable cleanable) {
			this.state = state;
			this.cleanable = cleanable;
		}
	}

	public static OpaqueCleanable releaseWhenPhantom(Object owner, IUnknown obj) {
		ReleaseCOMObject state = new ReleaseCOMObject(obj);
		return new OpaqueCleanable(state, CLEANER.register(owner, state));
	}

	public static OpaqueCleanable releaseWhenPhantom(Object owner, HANDLE handle) {
		ReleaseHANDLE state = new ReleaseHANDLE(handle);
		return new OpaqueCleanable(state, CLEANER.register(owner, state));
	}

	/**
	 * Connect to a debug session.
	 *
	 * See {@code DebugConnect} or {@code DebugConnectWide} on the MSDN.
	 *
	 * @param remoteOptions the options, like those given to {@code -remote}
	 * @return a new client connected as specified
	 */
	public static DebugClient debugConnect(String remoteOptions) {
		WString options = new WString(remoteOptions);
		return DebugClientInternal.tryPreferredInterfaces((refiid,
				ppClient) -> DbgEngNative.INSTANCE.DebugConnectWide(options, refiid, ppClient));
	}

	/**
	 * Create a debug client.
	 *
	 * Typically, this client is connected to the "local server". See {@code DebugCreate} on the
	 * MSDN.
	 *
	 * @return a new client
	 */
	public static DebugClient debugCreate() {
		return DebugClientInternal.tryPreferredInterfaces(DbgEngNative.INSTANCE::DebugCreate);
	}

	/**
	 * Create a debug client with the given options.
	 *
	 * See {@code DebugCreateEx} on the MSDN.
	 *
	 * @param options the options
	 * @return a new client
	 */
	public static DebugClient debugCreate(int options) {
		DWORD dwOpts = new DWORD(options);
		return DebugClientInternal.tryPreferredInterfaces(
			(refiid, ppClient) -> DbgEngNative.INSTANCE.DebugCreateEx(refiid, dwOpts, ppClient));
	}
}


text:
PACKAGE_NAME = rotate-backups
WORKON_HOME ?= $(HOME)/.virtualenvs
VIRTUAL_ENV ?= $(WORKON_HOME)/$(PACKAGE_NAME)
PYTHON ?= python3
PATH := $(VIRTUAL_ENV)/bin:$(PATH)
MAKE := $(MAKE) --no-print-directory
SHELL = bash

default:
	@echo "Makefile for $(PACKAGE_NAME)"
	@echo
	@echo 'Usage:'
	@echo
	@echo '    make install    install the package in a virtual environment'
	@echo '    make reset      recreate the virtual environment'
	@echo '    make check      check coding style (PEP-8, PEP-257)'
	@echo '    make test       run the test suite, report coverage'
	@echo '    make tox        run the tests on all Python versions'
	@echo '    make readme     update usage in readme'
	@echo '    make docs       update documentation using Sphinx'
	@echo '    make publish    publish changes to GitHub/PyPI'
	@echo '    make clean      cleanup all temporary files'
	@echo

install:
	@test -d "$(VIRTUAL_ENV)" || mkdir -p "$(VIRTUAL_ENV)"
	@test -x "$(VIRTUAL_ENV)/bin/python" || virtualenv --python=$(PYTHON) --quiet "$(VIRTUAL_ENV)"
	@pip install --quiet --requirement=requirements.txt
	@pip uninstall --yes $(PACKAGE_NAME) &>/dev/null || true
	@pip install --quiet --no-deps --ignore-installed .

reset:
	@$(MAKE) clean
	@rm -Rf "$(VIRTUAL_ENV)"
	@$(MAKE) install

check: install
	@pip install --upgrade --quiet --requirement=requirements-checks.txt
	@flake8

test: install
	@pip install --quiet --requirement=requirements-tests.txt
	@py.test --cov
	@coverage html
	@coverage report --fail-under=90 &>/dev/null

tox: install
	@pip install --quiet tox
	@tox

readme: install
	@pip install --quiet cogapp
	@cog.py -r README.rst

docs: readme
	@pip install --quiet sphinx
	@cd docs && sphinx-build -nb html -d build/doctrees . build/html

publish: install
	@git push origin && git push --tags origin
	@$(MAKE) clean
	@pip install --quiet twine wheel
	@python setup.py sdist bdist_wheel
	@twine upload dist/*
	@$(MAKE) clean

clean:
	@rm -Rf *.egg .cache .coverage .tox build dist docs/build htmlcov
	@find -depth -type d -name __pycache__ -exec rm -Rf {} \;
	@find -type f -name '*.pyc' -delete

.PHONY: default install reset check test tox readme docs publish clean


text:
'use strict'

const updateOpacityImpl = (id, className) => {
    const elements = document.getElementsByClassName(className)
    Array.from(elements).forEach(item => {
        let opacity = 0.6
        if(id == undefined || item.id == id){
            opacity = 1.0
        }
        item.style.opacity = opacity
    })
}

const updateOpacity = (id) => {
    let label = undefined
    if(id != undefined){
        label = `${id}_phase`
    }
    updateOpacityImpl(id, 'node')
    updateOpacityImpl(label, 'label')
}

const initializeEvent = (id) => {
    const elements = document.getElementsByClassName('node')
    Array.from(elements).forEach(item => {
        item.addEventListener('mouseover', () => updateOpacity(item.id))
        item.addEventListener('mouseleave', () => updateOpacity(undefined))
    })
}

const initialize = () => {
    const config = {
        startOnLoad: true,
        htmlLabels: true,
        securityLevel: 'loose',
        mermaid: {
            callback: initializeEvent
        }
    }
    mermaid.initialize(config)
}

initialize()


text:
package com.findide.job;

import com.findide.product.cmscenter.CMSService;
import com.findide.utils.DateTimeUtils;
import com.findide.utils.HTTPUtil;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import java.text.SimpleDateFormat;
import java.util.Date;

public class JobRunner implements Job {

    public void execute(JobExecutionContext context) throws JobExecutionException {
        System.out.println("JobRunner is Executing ... " + new java.util.Date());
        CMSService service = CMSService.getInstance();

        try {
            String format = "yyyy-MM-dd HH:mm:ss";
            String today = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
            Date nowTime = new Date();
            Date startTime = new SimpleDateFormat(format).parse(today+" 15:00:00");
            Date endTime = new SimpleDateFormat(format).parse(today+" 15:30:00");
            if(DateTimeUtils.isEffectiveDate(nowTime, startTime, endTime)){//时间范围内,将临时表发布到正式

                int downId = service.getDownloadsNoShenRandom();
                if (service.setShenhe(downId+"") && downId > 0)
                    HTTPUtil.sendGet("http://www.findtp.com/download-" + downId + ".html", "");

//                int articleId = service.getArticleNoShenRandomFindide();
//                if (service.setShenheArticle(articleId+"") && articleId > 0) {
//                    HTTPUtil.sendGet("http://www.findide.com/article-" + articleId + ".html", "");
//                }
            }

        }catch (Exception e){}
    }

}


text:
believe a man 27 years older than you loves you.
suck him off and moan with the last of the air
in your throat. do not breathe in after you swallow.

counterfeit 96.4 weeks of orgasms. wait for a kiss.
read your palms in the bathroom after you moan
with the last of the air in your throat. do not

breathe in. sever your love line. hemorrhage, but
do it quietly because you need to go back
and mass produce another orgasm in the sweatshop

that is your bed. the blood you fracked from your body
through the pipeline of your love line now sloshes
in the open cavity of your bathroom sink.

the man that is 27 years older than you is colorblind
so he calls the blood water and spits in it but remember—
he has a heightened sense of smell and knows this is not

water. remember. do not breathe in. take your bloodless
body back to bed and forget

you have a voice.

fail to understand that orgasm and sound are simply
vibrations passing through narrow and damp spaces
of the body. cause no drama. tell no one. take

your bloodless body to the bed and moan in a 2/5
time signature. call this music. make an album. win
a Grammy. when he pulls your hair at the root call

the not blood             not water slicking  your thighs
a mercy.

---

# Creation Myth #18
## Tafisha Edwards

How I was made:                    "I see you. You are a part of me."

The mark of greatness

I don't remember what I was before you what I was isn't memorable

is when

you were worried I would go crazy.
     I did.  but I am not lot's wife—I look and look
               at the ruins (me) and do not die.

everything before you

I don't remember how I was before you how I was isn't memorable

is obsolete

           what to call this: murder?
                    maturity?

I don't remember where I was before you where I was isn't memorable

and everything after

to survive I unremember: how to know, your unlistening
     deadweight, a short film starring your ex
& her nimbus of hair,

                    you

  I keep: your hand under my dress in a movie theater,
                your head on my shoulder in a movie theater, 28 snores
                of perfume on my neck.

I don't remember why I was before you why I was isn't memorable

bears your mark.

all things question their makers—
if you did not love me, then why?