text:
package com.orientechnologies.common.console;

import com.orientechnologies.common.console.annotation.ConsoleCommand;
import com.orientechnologies.common.console.annotation.ConsoleParameter;
import com.orientechnologies.common.log.OLogManager;
import com.orientechnologies.common.parser.OStringParser;
import com.orientechnologies.common.util.OArrays;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.io.PrintStream;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.ServiceLoader;
import java.util.TreeMap;
import java.util.logging.Level;
import java.util.logging.Logger;

public class OConsoleApplication {
  protected static final String[]   COMMENT_PREFIXS = new String[] { "#", "--", "//" };
  protected final StringBuilder     commandBuffer   = new StringBuilder(2048);
  protected InputStream             in              = System.in;                       // System.in;
  protected PrintStream             out             = System.out;
  protected PrintStream             err             = System.err;
  protected String                  wordSeparator   = " ";
  protected String[]                helpCommands    = { "help", "?" };
  protected String[]                exitCommands    = { "exit", "bye", "quit" };
  protected Map<String, String>     properties      = new HashMap<String, String>();
  // protected OConsoleReader reader = new TTYConsoleReader();
  protected OConsoleReader          reader          = new DefaultConsoleReader();
  protected boolean                 interactiveMode;
  protected String[]                args;
  protected TreeMap<Method, Object> methods;

  protected enum RESULT {
    OK, ERROR, EXIT
  }

  public OConsoleApplication(String[] iArgs) {
    this.args = iArgs;
  }

  public static String getCorrectMethodName(Method m) {
    StringBuilder buffer = new StringBuilder(128);
    buffer.append(getClearName(m.getName()));
    for (int i = 0; i < m.getParameterAnnotations().length; i++) {
      for (int j = 0; j < m.getParameterAnnotations()[i].length; j++) {
        if (m.getParameterAnnotations()[i][j] instanceof com.orientechnologies.common.console.annotation.ConsoleParameter) {
          buffer
              .append(" <"
                  + ((com.orientechnologies.common.console.annotation.ConsoleParameter) m.getParameterAnnotations()[i][j]).name()
                  + ">");
        }
      }
    }
    return buffer.toString();
  }

  public static String getClearName(String iJavaName) {
    StringBuilder buffer = new StringBuilder();

    char c;
    if (iJavaName != null) {
      buffer.append(iJavaName.charAt(0));
      for (int i = 1; i < iJavaName.length(); ++i) {
        c = iJavaName.charAt(i);

        if (Character.isUpperCase(c)) {
          buffer.append(' ');
        }

        buffer.append(Character.toLowerCase(c));
      }

    }
    return buffer.toString();
  }

  public void setReader(OConsoleReader iReader) {
    this.reader = iReader;
    reader.setConsole(this);
  }

  public int run() {
    interactiveMode = isInteractiveMode(args);
    onBefore();

    int result = 0;

    if (interactiveMode) {
      // EXECUTE IN INTERACTIVE MODE
      // final BufferedReader reader = new BufferedReader(new InputStreamReader(in));

      String consoleInput = null;

      while (true) {
        try {
          if (commandBuffer.length() == 0) {
            out.println();
            out.print(getPrompt());
          }

          consoleInput = reader.readLine();

          if (consoleInput == null || consoleInput.length() == 0)
            continue;

          if (!executeCommands(new ODFACommandStream(consoleInput), false))
            break;
        } catch (Exception e) {
          result = 1;
          OLogManager.instance().error(this, "Error on reading console input: %s", e, consoleInput);
        }
      }
    } else {
      // EXECUTE IN BATCH MODE
      result = executeBatch(getCommandLine(args)) ? 0 : 1;
    }

    onAfter();

    return result;
  }

  public void message(final String iMessage, final Object... iArgs) {
    final int verboseLevel = getVerboseLevel();
    if (verboseLevel > 1)
      out.printf(iMessage, iArgs);
  }

  public void error(final String iMessage, final Object... iArgs) {
    final int verboseLevel = getVerboseLevel();
    if (verboseLevel > 0)
      out.printf(iMessage, iArgs);
  }

  public int getVerboseLevel() {
    final String v = properties.get("verbose");
    final int verboseLevel = v != null ? Integer.parseInt(v) : 2;
    return verboseLevel;
  }

  public boolean isEchoEnabled() {
    return isPropertyEnabled("echo");
  }

  protected boolean isPropertyEnabled(final String iPropertyName) {
    String v = properties.get(iPropertyName);
    if (v != null) {
      v = v.toLowerCase();
      return v.equals("true") || v.equals("on");
    }
    return false;
  }

  protected String getPrompt() {
    return String.format("%s> ", getContext());
  }

  protected String getContext() {
    return "";
  }

  protected boolean isInteractiveMode(String[] args) {
    return args.length == 0;
  }

  protected boolean executeBatch(final String commandLine) {
    final File commandFile = new File(commandLine);

    OCommandStream scanner;
    try {
      scanner = new ODFACommandStream(commandFile);
    } catch (FileNotFoundException e) {
      scanner = new ODFACommandStream(commandLine);
    }

    return executeCommands(scanner, true);
  }

  protected boolean executeCommands(final OCommandStream commandStream, final boolean iBatchMode) {
    try {
      while (commandStream.hasNext()) {
        String commandLine = commandStream.nextCommand();

        if (commandLine.isEmpty())
          // EMPTY LINE
          continue;

        if (isComment(commandLine))
          continue;

        // SCRIPT CASE: MANAGE ENSEMBLING ALL TOGETHER
        if (isCollectingCommands(commandLine)) {
          // BEGIN: START TO COLLECT
          out.println("[Started multi-line command. Type just 'end' to finish and execute]");
          commandBuffer.append(commandLine);
          commandLine = null;
        } else if (commandLine.startsWith("end") && commandBuffer.length() > 0) {
          // END: FLUSH IT
          commandLine = commandBuffer.toString();
          commandBuffer.setLength(0);

        } else if (commandBuffer.length() > 0) {
          // BUFFER IT
          commandBuffer.append(';');
          commandBuffer.append(commandLine);
          commandLine = null;
        }

        if (commandLine != null) {
          if (iBatchMode || isEchoEnabled()) {
            out.println();
            out.print(getPrompt());
            out.print(commandLine);
            out.println();
          }

          final RESULT status = execute(commandLine);
          commandLine = null;

          if (status == RESULT.EXIT || (status == RESULT.ERROR && !Boolean.parseBoolean(properties.get("ignoreErrors")))
              && iBatchMode)
            return false;
        }
      }

      if (commandBuffer.length() == 0) {
        if (commandBuffer.length() > 0) {
          if (iBatchMode) {
            out.println();
            out.print(getPrompt());
            out.print(commandBuffer);
            out.println();
          }

          final RESULT status = execute(commandBuffer.toString());
          if (status == RESULT.EXIT || (status == RESULT.ERROR && !Boolean.parseBoolean(properties.get("ignoreErrors")))
              && iBatchMode)
            return false;
        }
      }
    } finally {
      commandStream.close();
    }
    return true;
  }

  protected boolean isComment(final String commandLine) {
    for (String comment : COMMENT_PREFIXS)
      if (commandLine.startsWith(comment))
        return true;
    return false;
  }

  protected boolean isCollectingCommands(final String iLine) {
    return false;
  }

  protected RESULT execute(String iCommand) {
    iCommand = iCommand.trim();

    if (iCommand.length() == 0)
      // NULL LINE: JUMP IT
      return RESULT.OK;

    if (isComment(iCommand))
      // COMMENT: JUMP IT
      return RESULT.OK;

    String[] commandWords = OStringParser.getWords(iCommand, wordSeparator);

    for (String cmd : helpCommands)
      if (cmd.equals(commandWords[0])) {
        help();
        return RESULT.OK;
      }

    for (String cmd : exitCommands)
      if (cmd.equals(commandWords[0])) {
        return RESULT.EXIT;
      }

    Method lastMethodInvoked = null;
    final StringBuilder lastCommandInvoked = new StringBuilder(1024);

    final String commandLowerCase = iCommand.toLowerCase();

    for (Entry<Method, Object> entry : getConsoleMethods().entrySet()) {
      final Method m = entry.getKey();
      final String methodName = m.getName();
      final ConsoleCommand ann = m.getAnnotation(ConsoleCommand.class);

      final StringBuilder commandName = new StringBuilder();
      char ch;
      int commandWordCount = 1;
      for (int i = 0; i < methodName.length(); ++i) {
        ch = methodName.charAt(i);
        if (Character.isUpperCase(ch)) {
          commandName.append(" ");
          ch = Character.toLowerCase(ch);
          commandWordCount++;
        }
        commandName.append(ch);
      }

      if (!commandLowerCase.equals(commandName.toString()) && !commandLowerCase.startsWith(commandName.toString() + " ")) {
        if (ann == null)
          continue;

        String[] aliases = ann.aliases();
        if (aliases == null || aliases.length == 0)
          continue;

        boolean aliasMatch = false;
        for (String alias : aliases) {
          if (iCommand.startsWith(alias.split(" ")[0])) {
            aliasMatch = true;
            commandWordCount = 1;
            break;
          }
        }

        if (!aliasMatch)
          continue;
      }

      Object[] methodArgs;

      // BUILD PARAMETERS
      if (ann != null && !ann.splitInWords()) {
        methodArgs = new String[] { iCommand.substring(iCommand.indexOf(' ') + 1) };
      } else {
        final int actualParamCount = commandWords.length - commandWordCount;
        if (m.getParameterTypes().length > actualParamCount) {
          // METHOD PARAMS AND USED PARAMS MISMATCH: CHECK FOR OPTIONALS
          for (int paramNum = m.getParameterAnnotations().length - 1; paramNum > actualParamCount - 1; paramNum--) {
            final Annotation[] paramAnn = m.getParameterAnnotations()[paramNum];
            if (paramAnn != null)
              for (int annNum = paramAnn.length - 1; annNum > -1; annNum--) {
                if (paramAnn[annNum] instanceof ConsoleParameter) {
                  final ConsoleParameter annotation = (ConsoleParameter) paramAnn[annNum];
                  if (annotation.optional())
                    commandWords = OArrays.copyOf(commandWords, commandWords.length + 1);
                  break;
                }
              }
          }
        }
        methodArgs = OArrays.copyOfRange(commandWords, commandWordCount, commandWords.length);
      }

      try {
        m.invoke(entry.getValue(), methodArgs);

      } catch (IllegalArgumentException e) {
        lastMethodInvoked = m;
        // GET THE COMMAND NAME
        lastCommandInvoked.setLength(0);
        for (int i = 0; i < commandWordCount; ++i) {
          if (lastCommandInvoked.length() > 0)
            lastCommandInvoked.append(" ");
          lastCommandInvoked.append(commandWords[i]);
        }
        continue;
      } catch (Exception e) {
        if (e.getCause() != null)
          onException(e.getCause());
        else
          e.printStackTrace(err);
        return RESULT.ERROR;
      }
      return RESULT.OK;
    }

    if (lastMethodInvoked != null)
      syntaxError(lastCommandInvoked.toString(), lastMethodInvoked);

    error("\n!Unrecognized command: '%s'", iCommand);
    return RESULT.ERROR;
  }

  protected void syntaxError(String iCommand, Method m) {
    error(
        "\n!Wrong syntax. If you're using a file make sure all commands are delimited by semicolon (;) or a linefeed (\\n)\n\r\n\r Expected: %s ",
        iCommand);

    String paramName = null;
    String paramDescription = null;
    boolean paramOptional = false;

    StringBuilder buffer = new StringBuilder("\n\nWhere:\n\n");
    for (Annotation[] annotations : m.getParameterAnnotations()) {
      for (Annotation ann : annotations) {
        if (ann instanceof com.orientechnologies.common.console.annotation.ConsoleParameter) {
          paramName = ((com.orientechnologies.common.console.annotation.ConsoleParameter) ann).name();
          paramDescription = ((com.orientechnologies.common.console.annotation.ConsoleParameter) ann).description();
          paramOptional = ((com.orientechnologies.common.console.annotation.ConsoleParameter) ann).optional();
          break;
        }
      }

      if (paramName == null)
        paramName = "?";

      if (paramOptional)
        message("[<%s>] ", paramName);
      else
        message("<%s> ", paramName);

      buffer.append("* ");
      buffer.append(String.format("%-15s", paramName));

      if (paramDescription != null)
        buffer.append(String.format("%-15s", paramDescription));
      buffer.append("\n");
    }

    message(buffer.toString());
  }

  /**
   * Returns a map of all console method and the object they can be called on.
   *
   * @return Map<Method,Object>
   */
  protected Map<Method, Object> getConsoleMethods() {
    if (methods != null)
      return methods;

    // search for declared command collections
    final Iterator<OConsoleCommandCollection> ite = ServiceLoader.load(OConsoleCommandCollection.class).iterator();
    final Collection<Object> candidates = new ArrayList<Object>();
    candidates.add(this);
    while (ite.hasNext()) {
      try {
        // make a copy and set it's context
        final OConsoleCommandCollection cc = ite.next().getClass().newInstance();
        cc.setContext(this);
        candidates.add(cc);
      } catch (InstantiationException ex) {
        Logger.getLogger(OConsoleApplication.class.getName()).log(Level.WARNING, ex.getMessage());
      } catch (IllegalAccessException ex) {
        Logger.getLogger(OConsoleApplication.class.getName()).log(Level.WARNING, ex.getMessage());
      }
    }

    methods = new TreeMap<Method, Object>(new Comparator<Method>() {
      public int compare(Method o1, Method o2) {
        final ConsoleCommand ann1 = o1.getAnnotation(ConsoleCommand.class);
        final ConsoleCommand ann2 = o2.getAnnotation(ConsoleCommand.class);

        if (ann1 != null && ann2 != null) {
          if (ann1.priority() != ann2.priority())
            // PRIORITY WINS
            return ann1.priority() - ann2.priority();
        }

        int res = o1.getName().compareTo(o2.getName());
        if (res == 0)
          res = o1.toString().compareTo(o2.toString());
        return res;
      }
    });

    for (final Object candidate : candidates) {
      final Method[] classMethods = candidate.getClass().getMethods();

      for (Method m : classMethods) {
        if (Modifier.isAbstract(m.getModifiers()) || Modifier.isStatic(m.getModifiers()) || !Modifier.isPublic(m.getModifiers())) {
          continue;
        }
        if (m.getReturnType() != Void.TYPE) {
          continue;
        }
        methods.put(m, candidate);
      }
    }
    return methods;
  }

  protected Map<String, Object> addCommand(Map<String, Object> commandsTree, String commandLine) {
    return commandsTree;
  }

  protected void help() {
    message("\nAVAILABLE COMMANDS:\n");

    for (Method m : getConsoleMethods().keySet()) {
      com.orientechnologies.common.console.annotation.ConsoleCommand annotation = m
          .getAnnotation(com.orientechnologies.common.console.annotation.ConsoleCommand.class);

      if (annotation == null)
        continue;

      message("* %-70s%s\n", getCorrectMethodName(m), annotation.description());
    }
    message("* %-70s%s\n", getClearName("help"), "Print this help");
    message("* %-70s%s\n", getClearName("exit"), "Close the console");

  }

  protected String getCommandLine(String[] iArguments) {
    StringBuilder command = new StringBuilder(512);
    for (int i = 0; i < iArguments.length; ++i) {
      if (i > 0)
        command.append(" ");

      command.append(iArguments[i]);
    }
    return command.toString();
  }

  protected void onBefore() {
  }

  protected void onAfter() {
  }

  protected void onException(final Throwable throwable) {
    throwable.printStackTrace(err);
  }
}


text:
import { connect } from 'react-redux'
import { fetchUser, updateUser, changePassword, resetPasswordEmail } from '../../../actions/firebaseActions'
import { bindActionCreators } from 'redux'

import Profile from '../components/Profile'

const mapDispatchToProps = dispatch => {
  return bindActionCreators({
    fetchUser,
    updateUser,
    changePassword,
    resetPasswordEmail
  }, dispatch)
}

const mapStateToProps = state => {
  return({
    currentUser: state.profile.currentUser
  })
}
export default connect(mapStateToProps, mapDispatchToProps)(Profile)

redpajama_set_name: RedPajamaGithub


text:
layout: default
---

{% assign minutes = content | number_of_words | divided_by: 180 %}
{% if minutes == 0 %}
{% assign minutes = 1 %}
{% endif %}

{{ page.title }}

  {{ page.date | date: "%b %-d, %Y" }}

  {% if page.update_date %}
    Updated: {{ page.update_date | date: "%b %-d, %Y" }}

  {% endif %}
  {{ minutes }} minute read

  {{ content }}

{% include fb-sdk.html %}
{% include fb-like.html %}

{% include fb-comment.html %}


text:
package com.softnuke.biosleep.android;

import screens.GameScreen;
import utils.Constants;
import android.app.AlertDialog;
import android.content.ActivityNotFoundException;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.provider.Settings;
import android.widget.Toast;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.backends.android.AndroidApplication;
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration;
import com.badlogic.gdx.utils.Array;
import com.softnuke.biosleep.ActionListener;
import com.softnuke.biosleep.MyGame;
import com.softnuke.biosleep.PlatformSpecific;

public class AndroidLauncher extends AndroidApplication implements PlatformSpecific{

	AlertDialog.Builder alertBuilder;

	//send event to all those who are waiting to listen
    private Array<ActionListener> listeners;

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

		 // fix for launcher icon starting new activity on top of old one
        if ((getIntent().getFlags() & Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT) != 0) {
            finish();
            return;
        }

		listeners = new Array<ActionListener>();

		AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
		config.useAccelerometer = false;
		config.useCompass = false;
		config.hideStatusBar = true;
		//config.useImmersiveMode = true;
	    config.useAccelerometer = false;

	    if(GameScreen.SOFT_DEBUG)
	    	config.useWakelock = true;

		MyGame.setPlatformSpecific(this);

		initialize(new MyGame(), config);

		//create app exit
		alertBuilder = new AlertDialog.Builder(this);
    	alertBuilder.setTitle("Exit");
		alertBuilder.setMessage("Do you really want to exit?");
		alertBuilder.setCancelable(true);
		alertBuilder.setPositiveButton("Yes",
            new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog, int id) {
                Gdx.app.exit();
            }
        });
		alertBuilder.setNegativeButton("No",
            new DialogInterface.OnClickListener() {
	            public void onClick(DialogInterface dialog, int id) {
	                dialog.cancel();
	            }
        });
	}

	@Override
	public String getID() {
		String androidId = Settings.Secure.getString(getContentResolver(),Settings.Secure.ANDROID_ID);

		//TelephonyManager tManager = (TelephonyManager)myActivity.getSystemService(Context.TELEPHONY_SERVICE);
		//String uid = tManager.getDeviceId();

		return androidId;
	}

	@Override
	public void signIn() {
		// TODO Auto-generated method stub

	}

	@Override
	public void signOut() {
		// TODO Auto-generated method stub

	}

	@Override
	public void rateGame() {
		// Replace the end of the URL with the package of your game
		//String str ="https://play.google.com/store/apps/details?id=com.softnuke.jumper";
		//startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(str)));

		Uri uri = Uri.parse("market://details?id=" + getPackageName());
		Intent goToMarket = new Intent(Intent.ACTION_VIEW, uri);
		goToMarket.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY | Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET | Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
		try {
		  startActivity(goToMarket);
		} catch (ActivityNotFoundException e) {
		  startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + getPackageName())));
		}

		//unlock the doer achievement
		//unlockAchievementGPGS(Constants.ACHIEVEMENT_DOER);
	}

	@Override
	public void shareScore(int score){
		//TODO:add a screenshot too

		Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);
		sharingIntent.setType("text/plain");
		sharingIntent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY | Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET | Intent.FLAG_ACTIVITY_MULTIPLE_TASK);

		String shareBody = "OMG! I scored "+score+" points. You have to give this a try - https://play.google.com/store/apps/details?id="+getPackageName();
		if(score < 0)
			shareBody = "You have to at least try this game once! Its insanely awesome - https://play.google.com/store/apps/details?id="+getPackageName();

		sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, R.string.app_name);
		sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, shareBody);
		startActivity(Intent.createChooser(sharingIntent, "Share via"));

		sendEvent(ActionListener.SCORE_SHARED);

		//unlock achievement show off
		//unlockAchievementGPGS(Constants.ACHIEVEMENT_SHOWOFF);
	}

	@Override
	public void submitLeaderboard(long score) {
		// TODO Auto-generated method stub

	}

	@Override
	public void showLeaderboard() {
		// TODO Auto-generated method stub

	}

	@Override
	public boolean isSignedIn() {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public void getAchievementsGPGS() {
		// TODO Auto-generated method stub

	}

	@Override
	public void unlockAchievementGPGS(String achievementId) {
		// TODO Auto-generated method stub

	}

	@Override
	public void loadAd() {
		// TODO Auto-generated method stub

	}

	@Override
	public void showAd() {
		// TODO Auto-generated method stub

	}

	@Override
	public void appInvite() {
		// TODO Auto-generated method stub

	}

	@Override
	public void setTrackerScreen(String screen) {
		// TODO Auto-generated method stub

	}

	@Override
	public void removeAds() {
		// TODO Auto-generated method stub

	}

	@Override
	public boolean isAdsRemoved() {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public void showToast(String text, boolean shortTime) {
		final String  message = text;
		final int duration = (shortTime) ? Toast.LENGTH_SHORT : Toast.LENGTH_LONG;

		this.runOnUiThread(new Runnable() {
            @Override
            public void run() {

                Toast.makeText(getApplicationContext(), message, duration).show();
            }
        });
	}

	public void sendEvent(int id){
        sendEvent(id, null);
    }

    public void sendEvent(int id, Object data){
        for (ActionListener listener: listeners){
            listener.handleEvent(id, data);
        }
    }

    @Override
    public void registerActionListener(ActionListener listener) {
        if (!listeners.contains(listener, true)){
            listeners.add(listener);
        }
    }

    @Override
    public void unRegisterActionListener(ActionListener listener) {
        listeners.removeValue(listener, true);
    }

	@Override
	public void exitApp() {
		runOnUiThread(new Runnable() {
            @Override
            public void run() {
            	AlertDialog exitAlert = alertBuilder.create();
            	exitAlert.show();
            }
        });

	}

	@Override
	public void openTwitter() {
		//TODO: Add @thekushsharma

		try {
			  startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://twitter.com/thekushsharma")));
		} catch (ActivityNotFoundException e) {
		}
	}

	@Override
	public void showVideoAd() {
		// TODO Auto-generated method stub

	}

	@Override
	public void sendStats(int jump, int slomo, int shield, int deaths) {
		// TODO Auto-generated method stub

	}

	@Override
	public void isOnline() {
		// TODO Auto-generated method stub

	}
}


text:
namespace chromeos {

namespace {

class GnubbyClientImpl : public GnubbyClient {
 public:
  GnubbyClientImpl() {}

  // GnubbyClient override.
  void AddObserver(Observer* observer) override {
    observer_list_.AddObserver(observer);
  }

  // GnubbyClient override.
  void RemoveObserver(Observer* observer) override {
    observer_list_.RemoveObserver(observer);
  }

  void PromptUserAuth(dbus::Signal* signal) {
    for (auto& observer : observer_list_)
      observer.PromptUserAuth();
  }

 protected:
  void Init(dbus::Bus* bus) override {
    dbus::ObjectProxy* proxy_ = bus->GetObjectProxy(
        u2f::kU2FServiceName, dbus::ObjectPath(u2f::kU2FServicePath));

    proxy_->ConnectToSignal(
        u2f::kU2FInterface, u2f::kU2FUserNotificationSignal,
        base::BindRepeating(&GnubbyClientImpl::PromptUserAuth,
                            weak_ptr_factory_.GetWeakPtr()),
        base::BindOnce(&GnubbyClientImpl::OnSignalConnected,
                       weak_ptr_factory_.GetWeakPtr()));
  }

 private:
  // Handles the result of signal connection setup.
  void OnSignalConnected(const std::string& interface,
                         const std::string& signal,
                         bool succeeded) {
    LOG_IF(ERROR, !succeeded)
        << "Connect to " << interface << " " << signal << " failed.";
  }

  base::ObserverList<Observer>::Unchecked observer_list_;

  base::WeakPtrFactory<GnubbyClientImpl> weak_ptr_factory_{this};

  DISALLOW_COPY_AND_ASSIGN(GnubbyClientImpl);
};

}  // namespace

GnubbyClient::GnubbyClient() = default;

GnubbyClient::~GnubbyClient() = default;

// static
std::unique_ptr<GnubbyClient> GnubbyClient::Create() {
  return std::make_unique<GnubbyClientImpl>();
}
}  // namespace chromeos


text:
package stacktrace

import (
	"strings"
	"testing"
)

func captureFunc() Stacktrace {
	return Capture(0)
}

func TestCaptureTestFunc(t *testing.T) {
	stack := captureFunc()

	if len(stack.Frames) == 0 {
		t.Fatal("expected stack frames to be returned")
	}

	// the first frame is the caller
	frame := stack.Frames[0]
	if expected := "captureFunc"; frame.Function != expected {
		t.Fatalf("expected function %q but recevied %q", expected, frame.Function)
	}
	expected := "/runc/libcontainer/stacktrace"
	if !strings.HasSuffix(frame.Package, expected) {
		t.Fatalf("expected package %q but received %q", expected, frame.Package)
	}
	if expected := "capture_test.go"; frame.File != expected {
		t.Fatalf("expected file %q but received %q", expected, frame.File)
	}
}


text:
import { EventEmitter }   from 'events'

import blessed       from 'blessed'

import {
  FILE_FACENET_ICON_PNG,
  // MODULE_ROOT,
  log,
  VERSION,
}                         from '../../config'

import {
  Face,
}                         from '../../face'

import {
  imageToData,
  loadImage,
  toBuffer,
}                         from '../../misc'
const contrib             = require('blessed-contrib')

export type FrameEventName = 'face'
                            | 'image'
                            | 'log'
                            | 'status'
                            | 'title'

export class Frame extends EventEmitter {

  private elementList = [] as blessed.Widgets.Node[]

  private _box!: blessed.Widgets.BoxElement; // for external usage, mainly to draw a contrib.grid
  // for external usage, mainly to draw a contrib.grid

  private thumbWidth  = 44  // 2 for border line, 2 for float "/" workaround
  private imageWidth  = 2 * this.thumbWidth
  // (* 4 / 3) image width/height = 4/3
  // (/2) // characters' height is about twice times of width in console
  private imageHeight = this.imageWidth * 3 / 4 / 2

  constructor (
    public screen: blessed.Widgets.Screen,
  ) {
    super()
  }

  public init () {
    this.addHeaderElement()
    this.addThumbElementList()
    this.addImageElement()
    this.addMeterElement()
    this.addStatusElement()

    // provide box area for external usage
    this.addBoxElement()
  }

  public emit(event: 'image',   filename: string): boolean
  public emit(event: 'log',     message:  string): boolean
  public emit(event: 'title',   title:    string): boolean
  public emit(event: 'status',  message:  string): boolean
  public emit(event: 'face',    face:     Face):   boolean

  public emit(event: never,     data: any): boolean
  public emit (event: FrameEventName, data: any) {
    return super.emit(event, data)
  }

  public clean () {
    let i = this.screen.children.length
    while (i--) {
      const child = this.screen.children[i]
      if (!this.elementList.includes(child)) {
        child.detach()
      }
    }
  }

  get box () {
    if (this._box) {
      this._box.detach()
    }
    this.addBoxElement()
    return this._box
  }

  public bindQuitKey (callback: Function) {
    const quitKeyList = ['escape', 'q', 'x', 'C-q', 'C-x', 'f4', 'f10']
    const quitRegexp = new RegExp('^[' + quitKeyList.join('|') + ']$', 'i')

    const listener = (_: any, key: any) => {
      if (quitRegexp.test(key.name)) {
        this.screen.removeListener('keypress', listener)
        callback()
      }
    }
    this.screen.addListener('keypress', listener)
  }

  private addBoxElement (): void {
    const right  = this.thumbWidth + this.imageWidth
    const width  = (this.screen.width as number) - right
    const height = (this.screen.height as number) - 1

    const box = blessed.box({
      right,
      width,
      height,

      top:    1,
      // border: 'line',
    })
    this.append(box)

    this._box = box
  }

  private append (element: blessed.Widgets.Node) {
    this.elementList.push(element)
    this.screen.append(element)
  }

  private addHeaderElement (): void {
    const box = blessed.box({
      top:     0,
      left:    0,
      width:   '100%',
      height:  1,
      tags:    true,
      content: `{center} FaceNet Manager v${VERSION} {/center}`,
      style:   {
        bg: 'blue',
      },
    })
    this.append(box)
    this.on('title', title => box.setContent(title))
  }

  private addThumbElementList (): void {
    const width = this.thumbWidth

    const cols   = width - 2 - 2          // 2 is padding for border, 2 is for in picture-tube `dx = png.width / opts.cols`
    let   top    = 1
    const height = Math.floor(width / 2)  // characters' height is about twice of width in console

    const faceList     = [] as Face[]
    const thumbList    = [] as blessed.Widgets.ANSIImageElement[]
    const distanceList = [] as blessed.Widgets.BoxElement[]

    do {
      const thumbElement = contrib.picture({
        cols,
        width,
        height,
        top,

        keys   : true,
        vi     : true,
        mouse  : true,

        right  : 0,
        file   : FILE_FACENET_ICON_PNG,
        border : 'line',
        style  : {
          border: {
            fg: 'cyan',
          },
        },
        onReady: () => this.screen.render(),
      })

      const distanceElement = blessed.box({
        width,
        top:     top + height,
        right:   0,
        height:  1,
        bg:      'grey',
        fg:      'white',
        tags:    true,
        // content: '{center}distance: 0.75{/center}',
      })

      thumbList.push(thumbElement)
      distanceList.push(distanceElement)

      thumbElement.on('click', () => {
        const idx = thumbList.indexOf(thumbElement)
        if (idx > 0                           // skip the first thumb
            && faceList[idx]                  // face exist in thumb
            && faceList[idx] !== faceList[0]  // face is not exist in the first thumb
        ) {
          this.emit('face', faceList[idx])
        }
      })

      this.append(thumbElement)
      this.append(distanceElement)

      top += height + 1 // thumb(height) + distance(1)

    } while (top < this.screen.height)
    this.screen.render()
    this.on('face', (face: Face) => this.addFace(face, faceList, thumbList, distanceList))
  }

  private addFace (
    face:         Face,
    faceList:     Face[],
    thumbList:    any[],  // contrib.picture
    distanceList: blessed.Widgets.BoxElement[],
  ) {
    log.verbose('Frame', 'addFace(%s, %d, %d, %d)',
      face, faceList.length, thumbList.length, distanceList.length)

    let i = thumbList.length

    while (i--) {
      if (i === 0) {
        faceList[0] = face
        this.showPicture(thumbList[i], face)
          .then(() => log.silly('Frame', 'addFace(%s) done', face))
          .catch(e => log.error('Frame', 'this.showPicture() rejection: %s', e))
      } else {
        const prevFace = faceList[i - 1]
        if (prevFace) {
          faceList[i] = prevFace
          this.showPicture(thumbList[i], prevFace)
            .catch(e => log.error('Frame', 'this.showPicture() rejection: %s', e))

        }
      }
    }
    i = distanceList.length
    while (i--) {
      if (faceList[i + 1] && faceList[i]) {
        let distance
        try {
          distance = faceList[i + 1].distance(faceList[i])
            .toFixed(2)
        } catch (e) { // no embedding
          distance = -1
        }
        distanceList[i].setContent(`{center} | distance: ${distance} | {/center}`)
        distanceList[i].bg = distance > 0.75 ? 'red' : 'green' as any
      }
    }
  }

  private addImageElement (): void {
    const paddingRight = this.thumbWidth
    const width        = this.imageWidth
    const height       = this.imageHeight

    const cols = height * 2

    const pic = contrib.picture({
      right: paddingRight,
      width,
      cols,
      height,

      keys    : true,
      vi      : true,
      mouse   : true,
      top     : 1,
      border  : 'line',
      file    : FILE_FACENET_ICON_PNG,
      onReady : () => this.screen.render(),
      style   : {
        border: {
          fg: 'cyan',
        },
      },
    })
    // console.info(MODULE_ROOT)
    this.append(pic)
    this.on('image', async (file: string) => {
      try {
        const image = await loadImage(file)
        const data = imageToData(image)
        const buffer = toBuffer(data)
        await this.showPicture(pic, buffer.toString('base64'))
        log.verbose('Frame', 'addImageElement() on(image) %s', file)
      } catch (e) {
        log.error('Frame', 'addImageElement() on(image) not support file format: %s', file)
      }
    })
  }

  private async showPicture (
    picture:         any,
    faceOrBase64?: string | Face,
  ): Promise<void> {
    let base64: string | undefined

    if (faceOrBase64 instanceof Face) {
      base64 = faceOrBase64.buffer()
        .toString('base64')
    } else {
      base64 = faceOrBase64
    }

    // 2 is padding for border, 2 is for picture-tube `dx = png.width / opts.cols`
    const cols = picture.width - 2 - 2

    return new Promise<void>(resolve => {
      picture.setImage({
        cols,
        base64,
        onReady: () => {
          this.screen.render()
          resolve()
        },
      })
    })
  }

  private addMeterElement (): void {
    const top    = 1 + this.imageHeight
    const right  = this.thumbWidth
    const width  = this.imageWidth
    const height = (this.screen.height as number) - top

    const box = blessed.box({
      top,
      right,
      width,
      height,
      style: {
        bg: 'blue',
      },
    })

    this.append(box)

    // eslint-disable-next-line new-cap
    const grid = new contrib.grid({
      screen: box,
      rows: 6,
      cols: 6,
    })
    const logger = grid.set(0, 0, 6, 6, contrib.log, {
      tags: true,
      keys: true,
      vi: true,
      mouse: true,
      scrollbar: {
        ch: ' ',
        track: {
          bg: 'yellow',
        },
        style: {
          inverse: true,
        },
      },
      fg        : 'green',
      selectedFg: 'green',
      label     : ' Log ',
    })

    this.on('log', text => logger.log(text))
  }

  private addStatusElement (): void {
    const status = blessed.box({
      bottom:  0,
      right:   0,
      height:  1,
      width:   'shrink',
      content: 'Status messages here.',
      style:   {
        bg: 'blue',
      },
    })
    this.on('status', text => status.setContent(text))
    this.append(status)
  }
  // hit/miss    process time

}

//   screen.render()

//   screen.on('resize', function() {
//     mainBox.height  = (screen.height as number) - 1
//     mainBox.width   = (screen.width as number) - 40
//     console.info(contrib)
//     // FIXME: emit typing
//     bigImage.emit('attach')
//     tree.emit('attach')
//     logBox.emit('attach')
//   })

export default Frame


text:
/**
 @module index.js
 @author mtarkiai
 @since 2/23/15
 */

/**
 * Drills into a data structure with a flattened key ("my.nested.field")
 * @param data
 * @param flat_key
 * @returns {*}
 * @private
 */
function get_flat(data, flat_key, options) {
    options = options || {};
    return flat_key ? _get(data, flat_key.split('.')) : undefined;
    function _get(data, key_parts) {
        if (typeof options.match == 'function') {
            // options.match defines an early detection gate; positive match will stop path traversal
            if (options.match(data)) {
                return data;
            }
        }
        if (!(key_parts[0] || "").length) {
            return data;
        }
        else if (Object(data) !== data) {
            return undefined; // cannot drill down
        }
        var first = key_parts.shift();
        return _get(data[first], key_parts);
    }
}

function set_flat(data, flat_key, value) {
    flat_key && _set(data, flat_key.split('.'), value);

    return data;

    function _set(data, key_parts, value) {
        if (Object(data) === data) {
            var branch = key_parts.shift();
            if (key_parts.length) {
                data[branch] = data[branch] || {};
                _set(data[branch], key_parts, value);
            }
            else
                data[branch] = value;
        }
    }
}

/**
 * Computes a specificity index for a path
 * Splits a path into components
 * For each component, a non-wildcard token earns a 9 and a '*' earns a 1
 * First part has a weight of 0.1, then *0.1 for each consecutive part
 * @param path
 */
function specificityIndex(path) {
    if (!path) {
        return 0;
    }

    var parts = (path || "").split('.');
    var score = 0;
    for (var i=0; i<parts.length; i++) {
        var part = parts[i];
        var part_score;
        if (part.indexOf('*') == 0) {
            part_score = part.length == 1 ? 1 : 2;
        }
        else if (part.indexOf('*') > 0) {
            part_score = 3;
        }
        else if (part.indexOf('?') >= 0) {
            part_score = 4;
        }
        else {
            part_score = 9;
        }
        score += part_score * Math.pow(0.1, i+1);
    }
    return score;
}

module.exports = {
    fget: get_flat,
    fset: set_flat,
    computeSpecificityIndex: specificityIndex
};


text:
package com.bj58.sql.parser;

/**
 * MySQL's index hints.
 */
public class IndexHintList extends QueryTreeNodeList<IndexHintNode>
{
}


text:
<?php

namespace Laraflock\Dashboard\Controllers;

class DashboardController extends BaseDashboardController
{
    /**
     * The dashboard.
     *
     * @return \Illuminate\View\View
     */
    public function dashboard()
    {
        return $this->view('dashboard.index');
    }
}


text:
"""This module is deprecated. Please use :mod:`airflow.providers.google.cloud.operators.bigquery`."""

import warnings

# pylint: disable=unused-import
from airflow.providers.google.cloud.operators.bigquery import (  # noqa
    BigQueryCheckOperator,
    BigQueryIntervalCheckOperator,
    BigQueryValueCheckOperator,
)

warnings.warn(
    "This module is deprecated. Please use `airflow.providers.google.cloud.operators.bigquery`.",
    DeprecationWarning,
    stacklevel=2,
)


text:
<!DOCTYPE html>

  <title>avg worst case</title>

  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
  <meta name="mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-capable" content="yes">

  <link rel="import" href="../../../polymer/polymer.html">
  <link rel="import" href="../../../paper-styles/paper-styles.html">
  <link rel="import" href="../../iron-list.html">

  <template is="dom-bind">

The physical avarage is not useful in this situations

The list is correct if it can render all the items without empty spaces.

    <iron-list id="list" items="[791, 671]" as="item" style="width: 300px; height: 300px;">
      <template>

[[index]] height: [[item]]

      </template>
    </iron-list>

    <iron-list id="list2" items="[791, 671]" as="item" style="width: 710px; height: 453px;">
      <template>

[[index]] height: [[item]]

      </template>
    </iron-list>

    <iron-list items="[512, 256, 128, 64, 16, 16, 16, 16, 16, 16, 8, 4]" as="item" style="height: 256px;">
      <template>

[[index]] height: [[item]]

      </template>
    </iron-list>
  </template>


text:
.. _continuous-foldcauchy:

Folded Cauchy Distribution
==========================

This formula can be expressed in terms of the standard formulas for
the Cauchy distribution (call the cdf :math:`C\left(x\right)` and
the pdf :math:`d\left(x\right)` ).
If :math:`Y` is cauchy then :math:`\left|Y\right|` is folded cauchy.
There is one shape parameter :math:`c` and the support is :math:`x\geq0.`

.. math::
   :nowrap:

    \begin{eqnarray*} f\left(x;c\right) & = & \frac{1}{\pi\left(1+\left(x-c\right)^{2}\right)}+\frac{1}{\pi\left(1+\left(x+c\right)^{2}\right)}\\
    F\left(x;c\right) & = & \frac{1}{\pi}\tan^{-1}\left(x-c\right)+\frac{1}{\pi}\tan^{-1}\left(x+c\right)\\
    G\left(q;c\right) & = & F^{-1}\left(q;c\right)\end{eqnarray*}

No moments

Implementation: `scipy.stats.foldcauchy`


text:
//------------------------------------------------------------------------------
// <auto-generated>
//     このコードはツールによって生成されました。
//     ランタイム バージョン:4.0.30319.34014
//
//     このファイルへの変更は、以下の状況下で不正な動作の原因になったり、
//     コードが再生成されるときに損失したりします。
// </auto-generated>
//------------------------------------------------------------------------------

namespace MsgPack.Serialization.GeneratedSerializers.MapBased {

    [System.CodeDom.Compiler.GeneratedCodeAttribute("MsgPack.Serialization.CodeDomSerializers.CodeDomSerializerBuilder", "0.5.0.0")]
    [System.Diagnostics.DebuggerNonUserCodeAttribute()]
    public class MsgPack_Serialization_AddOnlyCollection_1_System_Int32Array_Serializer : MsgPack.Serialization.MessagePackSerializer<MsgPack.Serialization.AddOnlyCollection<int[]>> {

        private MsgPack.Serialization.MessagePackSerializer<int[][]> _serializer0;

        private MsgPack.Serialization.MessagePackSerializer<int[]> _serializer1;

        public MsgPack_Serialization_AddOnlyCollection_1_System_Int32Array_Serializer(MsgPack.Serialization.SerializationContext context) :
                base(context) {
            this._serializer0 = context.GetSerializer<int[][]>();
            this._serializer1 = context.GetSerializer<int[]>();
        }

        protected internal override void PackToCore(MsgPack.Packer packer, MsgPack.Serialization.AddOnlyCollection<int[]> objectTree) {
            this._serializer0.PackTo(packer, System.Linq.Enumerable.ToArray(objectTree));
        }

        protected internal override MsgPack.Serialization.AddOnlyCollection<int[]> UnpackFromCore(MsgPack.Unpacker unpacker) {
            if ((unpacker.IsArrayHeader == false)) {
                throw MsgPack.Serialization.SerializationExceptions.NewIsNotArrayHeader();
            }
            MsgPack.Serialization.AddOnlyCollection<int[]> collection = default(MsgPack.Serialization.AddOnlyCollection<int[]>);
            collection = new MsgPack.Serialization.AddOnlyCollection<int[]>();
            this.UnpackToCore(unpacker, collection);
            return collection;
        }

        protected internal override void UnpackToCore(MsgPack.Unpacker unpacker, MsgPack.Serialization.AddOnlyCollection<int[]> collection) {
            if ((unpacker.IsArrayHeader == false)) {
                throw MsgPack.Serialization.SerializationExceptions.NewIsNotArrayHeader();
            }
            int count = default(int);
            count = MsgPack.Serialization.UnpackHelpers.GetItemsCount(unpacker);
            for (int i = 0; (i < count); i = (i + 1)) {
                int[] nullable = default(int[]);
                if ((unpacker.Read() == false)) {
                    throw MsgPack.Serialization.SerializationExceptions.NewMissingItem(i);
                }
                if (((unpacker.IsArrayHeader == false)
                            && (unpacker.IsMapHeader == false))) {
                    nullable = this._serializer1.UnpackFrom(unpacker);
                }
                else {
                    MsgPack.Unpacker disposable = default(MsgPack.Unpacker);
                    disposable = unpacker.ReadSubtree();
                    try {
                        nullable = this._serializer1.UnpackFrom(disposable);
                    }
                    finally {
                        if (((disposable == null)
                                    == false)) {
                            disposable.Dispose();
                        }
                    }
                }
                if (((nullable == null)
                            == false)) {
                    collection.Add(nullable);
                }
                else {
                    collection.Add(nullable);
                }
            }
        }

        private static T @__Conditional<T>(bool condition, T whenTrue, T whenFalse)
         {
            if (condition) {
                return whenTrue;
            }
            else {
                return whenFalse;
            }
        }
    }
}


text:
namespace Util {
namespace IO {

class SceneLoader final
{
public:
	SceneLoader() = default;

	SceneLoader(const SceneLoader& rhs) = delete;
	SceneLoader(SceneLoader&& rhs) noexcept = delete;

	SceneLoader& operator = (const SceneLoader& rhs) = delete;
	SceneLoader& operator = (SceneLoader&& rhs) noexcept = delete;

	~SceneLoader() = default;

public:
	std::unique_ptr<Model::SceneModel> Load(
		const std::string& styles_file_name,
		const std::string& geometries_file_name);
};

} // namespace IO
} // namespace Util


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Reflection;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.CodeAnalysis.PooledObjects;
using Roslyn.Utilities;

namespace Microsoft.VisualStudio.LanguageServices.Implementation.Diagnostics
{
    /// <summary>
    /// This service provides diagnostic analyzers from the analyzer assets specified in the manifest files of installed VSIX extensions.
    /// These analyzers are used across this workspace session.
    /// </summary>
    internal partial class VisualStudioDiagnosticAnalyzerProvider
    {
        private const string AnalyzerContentTypeName = "Microsoft.VisualStudio.Analyzer";

        /// <summary>
        /// Loader for VSIX-based analyzers.
        /// </summary>
        public static readonly IAnalyzerAssemblyLoader AnalyzerAssemblyLoader = new Loader();

        private readonly object _extensionManager;
        private readonly Type _typeIExtensionContent;

        private readonly Lazy<ImmutableArray<(AnalyzerFileReference reference, string extensionId)>> _lazyAnalyzerReferences;

        // internal for testing
        internal VisualStudioDiagnosticAnalyzerProvider(object extensionManager, Type typeIExtensionContent)
        {
            Contract.ThrowIfNull(extensionManager);
            Contract.ThrowIfNull(typeIExtensionContent);

            _extensionManager = extensionManager;
            _typeIExtensionContent = typeIExtensionContent;
            _lazyAnalyzerReferences = new Lazy<ImmutableArray<(AnalyzerFileReference, string)>>(GetAnalyzerReferencesImpl);
        }

        public ImmutableArray<(AnalyzerFileReference reference, string extensionId)> GetAnalyzerReferencesInExtensions()
            => _lazyAnalyzerReferences.Value;

        private ImmutableArray<(AnalyzerFileReference reference, string extensionId)> GetAnalyzerReferencesImpl()
        {
            try
            {
                // dynamic is weird. it can't see internal type with public interface even if callee is
                // implementation of the public interface in internal type. so we can't use dynamic here
                var _ = PooledDictionary<AnalyzerFileReference, string>.GetInstance(out var analyzePaths);

                // var enabledExtensions = extensionManager.GetEnabledExtensions(AnalyzerContentTypeName);
                var extensionManagerType = _extensionManager.GetType();
                var extensionManager_GetEnabledExtensionsMethod = extensionManagerType.GetRuntimeMethod("GetEnabledExtensions", new Type[] { typeof(string) });
                var enabledExtensions = (IEnumerable<object>)extensionManager_GetEnabledExtensionsMethod.Invoke(_extensionManager, new object[] { AnalyzerContentTypeName });

                foreach (var extension in enabledExtensions)
                {
                    var extensionType = extension.GetType();
                    var extensionType_HeaderProperty = extensionType.GetRuntimeProperty("Header");
                    var extension_Header = extensionType_HeaderProperty.GetValue(extension);
                    var extension_HeaderType = extension_Header.GetType();
                    var extension_HeaderType_Identifier = extension_HeaderType.GetRuntimeProperty("Identifier");
                    var identifier = (string)extension_HeaderType_Identifier.GetValue(extension_Header);

                    var extensionType_ContentProperty = extensionType.GetRuntimeProperty("Content");
                    var extension_Content = (IEnumerable<object>)extensionType_ContentProperty.GetValue(extension);

                    foreach (var content in extension_Content)
                    {
                        if (!ShouldInclude(content))
                        {
                            continue;
                        }

                        var extensionType_GetContentMethod = extensionType.GetRuntimeMethod("GetContentLocation", new Type[] { _typeIExtensionContent });
                        if (extensionType_GetContentMethod?.Invoke(extension, new object[] { content }) is not string assemblyPath ||
                            string.IsNullOrEmpty(assemblyPath))
                        {
                            continue;
                        }

                        analyzePaths.Add(new AnalyzerFileReference(assemblyPath, AnalyzerAssemblyLoader), identifier);
                    }
                }

                // make sure enabled extensions are alive in memory
                // so that we can debug it through if mandatory analyzers are missing
                GC.KeepAlive(enabledExtensions);

                // Order for deterministic result.
                return analyzePaths.OrderBy((x, y) => string.CompareOrdinal(x.Key.FullPath, y.Key.FullPath)).SelectAsArray(entry => (entry.Key, entry.Value));
            }
            catch (TargetInvocationException ex) when (ex.InnerException is InvalidOperationException)
            {
                // this can be called from any thread, and extension manager could be disposed in the middle of us using it since
                // now all these are free-threaded and there is no central coordinator, or API or state is immutable that prevent states from
                // changing in the middle of others using it.
                //
                // fortunately, this only happens on disposing at shutdown, so we just catch the exception and silently swallow it.
                // we are about to shutdown anyway.
                return ImmutableArray<(AnalyzerFileReference, string)>.Empty;
            }
        }

        private static bool ShouldInclude(object content)
        {
            // var content_ContentTypeName = content.ContentTypeName;
            var contentType = content.GetType();
            var contentType_ContentTypeNameProperty = contentType.GetRuntimeProperty("ContentTypeName");
            var content_ContentTypeName = contentType_ContentTypeNameProperty.GetValue(content) as string;

            return string.Equals(content_ContentTypeName, AnalyzerContentTypeName, StringComparison.InvariantCultureIgnoreCase);
        }
    }
}


text:
<?php

namespace Ecommerce\V1\Rest\Users;

class UsersResourceFactory
{
    public function __invoke($services)
    {
        $resource = new UsersResource();
        $resource->setServiceLocator($services);

        return $resource;
    }
}


text:
namespace swganh
{
namespace attributes
{

void Initialize(swganh::app::SwganhKernel* kernel)
{
    swganh::plugin::ObjectRegistration registration;
    registration.version.major = VERSION_MAJOR;
    registration.version.minor = VERSION_MINOR;

    // Register Attribute Service
    {
        // Attribute::AttributeService
        registration.CreateObject = [kernel] (swganh::plugin::ObjectParams* params) -> void *
        {
            auto attributes_service = new AttributesService(kernel);

            return attributes_service;
        };

        registration.DestroyObject = [] (void * object)
        {
            if (object)
            {
                delete static_cast<AttributesService*>(object);
            }
        };

        kernel->GetPluginManager()->RegisterObject("Attribute::AttributesService", &registration);
    }
}

}
}  // namespace swganh::attribute


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Fr8Data.Manifests
{
    public class StandardEmailMessageCM : Manifest
    {
        public StandardEmailMessageCM()
            : base(Constants.MT.StandardEmailMessage)
        {

        }

        public string MessageID { get; set; }

        public string References { get; set; }
        public string Subject { get; set; }

        public string HtmlText { get; set; }

        public string PlainText { get; set; }

        public DateTime DateReceived { get; set; }

        public string EmailStatus { get; set; }

        public string EmailFromName { get; set; }
    }
}


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

       Copyright 2009-2016 the original author or authors.

       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.

-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
	"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.apache.ibatis.submitted.xml_external_ref.MultipleCrossIncludePersonMapper">
	<cache-ref namespace="org.apache.ibatis.submitted.xml_external_ref.MultipleCrossIncludePetMapper" />
	<resultMap type="org.apache.ibatis.submitted.xml_external_ref.Person"
		id="personResult">
		<id property="id" column="person_id" />
		<result property="name" column="person_name" />
	</resultMap>
	<resultMap type="org.apache.ibatis.submitted.xml_external_ref.Person"
		id="resultWithPets" extends="personResult">
		<collection property="pets"
			ofType="org.apache.ibatis.submitted.xml_external_ref.Pet"
			resultMap="org.apache.ibatis.submitted.xml_external_ref.MultipleCrossIncludePetMapper.petResult" />
	</resultMap>
	<sql id="petIdColumnList">
		pet_id
	</sql>
	<sql id="personColumnList">
		<include refid="org.apache.ibatis.submitted.xml_external_ref.MultipleCrossIncludePetMapper.personIdColumnList"/>,
		person_name
	</sql>
	<!-- Referencing a sql fragment in another file -->
	<select id="select" parameterType="java.lang.Integer" resultMap="resultWithPets">
		SELECT
		<include refid="personColumnList" />
		,
		<include
			refid="org.apache.ibatis.submitted.xml_external_ref.MultipleCrossIncludePetMapper.petColumnList" />
		FROM person, pet
		WHERE person_id = #{id}
		AND person_id = owner_id
		ORDER BY pet_id
	</select>
	<!-- Referencing a sql fragment and a result map in another file -->
	<select id="selectPet" parameterType="java.lang.Integer"
		resultMap="org.apache.ibatis.submitted.xml_external_ref.MultipleCrossIncludePetMapper.petResult">
		SELECT
		<include
			refid="org.apache.ibatis.submitted.xml_external_ref.MultipleCrossIncludePetMapper.petColumnList" />
		FROM pet
		WHERE pet_id = #{id}
	</select>
</mapper>


text:
'use strict';

import * as assert from 'assert';
import { RenderMinimap, EditorLayoutInfo, OverviewRulerPosition } from 'vs/editor/common/editorCommon';
import { EditorLayoutProvider, IEditorLayoutProviderOpts } from 'vs/editor/common/viewLayout/editorLayoutProvider';

suite('Editor ViewLayout - EditorLayoutProvider', () => {

	function doTest(input: IEditorLayoutProviderOpts, expected: EditorLayoutInfo): void {
		let actual = EditorLayoutProvider.compute(input);
		assert.deepEqual(actual, expected);
	}

	test('EditorLayoutProvider 1', () => {
		doTest({
			outerWidth: 1000,
			outerHeight: 800,
			showGlyphMargin: false,
			lineHeight: 16,
			showLineNumbers: false,
			lineNumbersMinChars: 0,
			lineNumbersDigitCount: 1,
			lineDecorationsWidth: 10,
			typicalHalfwidthCharacterWidth: 10,
			maxDigitWidth: 10,
			verticalScrollbarWidth: 0,
			horizontalScrollbarHeight: 0,
			scrollbarArrowSize: 0,
			verticalScrollbarHasArrows: false,
			minimap: false,
			minimapRenderCharacters: true,
			minimapMaxColumn: 150,
			pixelRatio: 1,
		}, new EditorLayoutInfo({
			width: 1000,
			height: 800,

			glyphMarginLeft: 0,
			glyphMarginWidth: 0,
			glyphMarginHeight: 800,

			lineNumbersLeft: 0,
			lineNumbersWidth: 0,
			lineNumbersHeight: 800,

			decorationsLeft: 0,
			decorationsWidth: 10,
			decorationsHeight: 800,

			contentLeft: 10,
			contentWidth: 990,
			contentHeight: 800,

			renderMinimap: RenderMinimap.None,
			minimapWidth: 0,
			viewportColumn: 99,

			verticalScrollbarWidth: 0,
			horizontalScrollbarHeight: 0,

			overviewRuler: new OverviewRulerPosition({
				top: 0,
				width: 0,
				height: 800,
				right: 0
			})
		}));
	});

	test('EditorLayoutProvider 1.1', () => {
		doTest({
			outerWidth: 1000,
			outerHeight: 800,
			showGlyphMargin: false,
			lineHeight: 16,
			showLineNumbers: false,
			lineNumbersMinChars: 0,
			lineNumbersDigitCount: 1,
			lineDecorationsWidth: 10,
			typicalHalfwidthCharacterWidth: 10,
			maxDigitWidth: 10,
			verticalScrollbarWidth: 11,
			horizontalScrollbarHeight: 12,
			scrollbarArrowSize: 13,
			verticalScrollbarHasArrows: true,
			minimap: false,
			minimapRenderCharacters: true,
			minimapMaxColumn: 150,
			pixelRatio: 1,
		}, new EditorLayoutInfo({
			width: 1000,
			height: 800,

			glyphMarginLeft: 0,
			glyphMarginWidth: 0,
			glyphMarginHeight: 800,

			lineNumbersLeft: 0,
			lineNumbersWidth: 0,
			lineNumbersHeight: 800,

			decorationsLeft: 0,
			decorationsWidth: 10,
			decorationsHeight: 800,

			contentLeft: 10,
			contentWidth: 990,
			contentHeight: 800,

			renderMinimap: RenderMinimap.None,
			minimapWidth: 0,
			viewportColumn: 97,

			verticalScrollbarWidth: 11,
			horizontalScrollbarHeight: 12,

			overviewRuler: new OverviewRulerPosition({
				top: 13,
				width: 11,
				height: (800 - 2 * 13),
				right: 0
			})
		}));
	});

	test('EditorLayoutProvider 2', () => {
		doTest({
			outerWidth: 900,
			outerHeight: 800,
			showGlyphMargin: false,
			lineHeight: 16,
			showLineNumbers: false,
			lineNumbersMinChars: 0,
			lineNumbersDigitCount: 1,
			lineDecorationsWidth: 10,
			typicalHalfwidthCharacterWidth: 10,
			maxDigitWidth: 10,
			verticalScrollbarWidth: 0,
			horizontalScrollbarHeight: 0,
			scrollbarArrowSize: 0,
			verticalScrollbarHasArrows: false,
			minimap: false,
			minimapRenderCharacters: true,
			minimapMaxColumn: 150,
			pixelRatio: 1,
		}, new EditorLayoutInfo({
			width: 900,
			height: 800,

			glyphMarginLeft: 0,
			glyphMarginWidth: 0,
			glyphMarginHeight: 800,

			lineNumbersLeft: 0,
			lineNumbersWidth: 0,
			lineNumbersHeight: 800,

			decorationsLeft: 0,
			decorationsWidth: 10,
			decorationsHeight: 800,

			contentLeft: 10,
			contentWidth: 890,
			contentHeight: 800,

			renderMinimap: RenderMinimap.None,
			minimapWidth: 0,
			viewportColumn: 89,

			verticalScrollbarWidth: 0,
			horizontalScrollbarHeight: 0,

			overviewRuler: new OverviewRulerPosition({
				top: 0,
				width: 0,
				height: 800,
				right: 0
			})
		}));
	});

	test('EditorLayoutProvider 3', () => {
		doTest({
			outerWidth: 900,
			outerHeight: 900,
			showGlyphMargin: false,
			lineHeight: 16,
			showLineNumbers: false,
			lineNumbersMinChars: 0,
			lineNumbersDigitCount: 1,
			lineDecorationsWidth: 10,
			typicalHalfwidthCharacterWidth: 10,
			maxDigitWidth: 10,
			verticalScrollbarWidth: 0,
			horizontalScrollbarHeight: 0,
			scrollbarArrowSize: 0,
			verticalScrollbarHasArrows: false,
			minimap: false,
			minimapRenderCharacters: true,
			minimapMaxColumn: 150,
			pixelRatio: 1,
		}, new EditorLayoutInfo({
			width: 900,
			height: 900,

			glyphMarginLeft: 0,
			glyphMarginWidth: 0,
			glyphMarginHeight: 900,

			lineNumbersLeft: 0,
			lineNumbersWidth: 0,
			lineNumbersHeight: 900,

			decorationsLeft: 0,
			decorationsWidth: 10,
			decorationsHeight: 900,

			contentLeft: 10,
			contentWidth: 890,
			contentHeight: 900,

			renderMinimap: RenderMinimap.None,
			minimapWidth: 0,
			viewportColumn: 89,

			verticalScrollbarWidth: 0,
			horizontalScrollbarHeight: 0,

			overviewRuler: new OverviewRulerPosition({
				top: 0,
				width: 0,
				height: 900,
				right: 0
			})
		}));
	});

	test('EditorLayoutProvider 4', () => {
		doTest({
			outerWidth: 900,
			outerHeight: 900,
			showGlyphMargin: false,
			lineHeight: 16,
			showLineNumbers: false,
			lineNumbersMinChars: 5,
			lineNumbersDigitCount: 1,
			lineDecorationsWidth: 10,
			typicalHalfwidthCharacterWidth: 10,
			maxDigitWidth: 10,
			verticalScrollbarWidth: 0,
			horizontalScrollbarHeight: 0,
			scrollbarArrowSize: 0,
			verticalScrollbarHasArrows: false,
			minimap: false,
			minimapRenderCharacters: true,
			minimapMaxColumn: 150,
			pixelRatio: 1,
		}, new EditorLayoutInfo({
			width: 900,
			height: 900,

			glyphMarginLeft: 0,
			glyphMarginWidth: 0,
			glyphMarginHeight: 900,

			lineNumbersLeft: 0,
			lineNumbersWidth: 0,
			lineNumbersHeight: 900,

			decorationsLeft: 0,
			decorationsWidth: 10,
			decorationsHeight: 900,

			contentLeft: 10,
			contentWidth: 890,
			contentHeight: 900,

			renderMinimap: RenderMinimap.None,
			minimapWidth: 0,
			viewportColumn: 89,

			verticalScrollbarWidth: 0,
			horizontalScrollbarHeight: 0,

			overviewRuler: new OverviewRulerPosition({
				top: 0,
				width: 0,
				height: 900,
				right: 0
			})
		}));
	});

	test('EditorLayoutProvider 5', () => {
		doTest({
			outerWidth: 900,
			outerHeight: 900,
			showGlyphMargin: false,
			lineHeight: 16,
			showLineNumbers: true,
			lineNumbersMinChars: 5,
			lineNumbersDigitCount: 1,
			lineDecorationsWidth: 10,
			typicalHalfwidthCharacterWidth: 10,
			maxDigitWidth: 10,
			verticalScrollbarWidth: 0,
			horizontalScrollbarHeight: 0,
			scrollbarArrowSize: 0,
			verticalScrollbarHasArrows: false,
			minimap: false,
			minimapRenderCharacters: true,
			minimapMaxColumn: 150,
			pixelRatio: 1,
		}, new EditorLayoutInfo({
			width: 900,
			height: 900,

			glyphMarginLeft: 0,
			glyphMarginWidth: 0,
			glyphMarginHeight: 900,

			lineNumbersLeft: 0,
			lineNumbersWidth: 50,
			lineNumbersHeight: 900,

			decorationsLeft: 50,
			decorationsWidth: 10,
			decorationsHeight: 900,

			contentLeft: 60,
			contentWidth: 840,
			contentHeight: 900,

			renderMinimap: RenderMinimap.None,
			minimapWidth: 0,
			viewportColumn: 84,

			verticalScrollbarWidth: 0,
			horizontalScrollbarHeight: 0,

			overviewRuler: new OverviewRulerPosition({
				top: 0,
				width: 0,
				height: 900,
				right: 0
			})
		}));
	});

	test('EditorLayoutProvider 6', () => {
		doTest({
			outerWidth: 900,
			outerHeight: 900,
			showGlyphMargin: false,
			lineHeight: 16,
			showLineNumbers: true,
			lineNumbersMinChars: 5,
			lineNumbersDigitCount: 5,
			lineDecorationsWidth: 10,
			typicalHalfwidthCharacterWidth: 10,
			maxDigitWidth: 10,
			verticalScrollbarWidth: 0,
			horizontalScrollbarHeight: 0,
			scrollbarArrowSize: 0,
			verticalScrollbarHasArrows: false,
			minimap: false,
			minimapRenderCharacters: true,
			minimapMaxColumn: 150,
			pixelRatio: 1,
		}, new EditorLayoutInfo({
			width: 900,
			height: 900,

			glyphMarginLeft: 0,
			glyphMarginWidth: 0,
			glyphMarginHeight: 900,

			lineNumbersLeft: 0,
			lineNumbersWidth: 50,
			lineNumbersHeight: 900,

			decorationsLeft: 50,
			decorationsWidth: 10,
			decorationsHeight: 900,

			contentLeft: 60,
			contentWidth: 840,
			contentHeight: 900,

			renderMinimap: RenderMinimap.None,
			minimapWidth: 0,
			viewportColumn: 84,

			verticalScrollbarWidth: 0,
			horizontalScrollbarHeight: 0,

			overviewRuler: new OverviewRulerPosition({
				top: 0,
				width: 0,
				height: 900,
				right: 0
			})
		}));
	});

	test('EditorLayoutProvider 7', () => {
		doTest({
			outerWidth: 900,
			outerHeight: 900,
			showGlyphMargin: false,
			lineHeight: 16,
			showLineNumbers: true,
			lineNumbersMinChars: 5,
			lineNumbersDigitCount: 6,
			lineDecorationsWidth: 10,
			typicalHalfwidthCharacterWidth: 10,
			maxDigitWidth: 10,
			verticalScrollbarWidth: 0,
			horizontalScrollbarHeight: 0,
			scrollbarArrowSize: 0,
			verticalScrollbarHasArrows: false,
			minimap: false,
			minimapRenderCharacters: true,
			minimapMaxColumn: 150,
			pixelRatio: 1,
		}, new EditorLayoutInfo({
			width: 900,
			height: 900,

			glyphMarginLeft: 0,
			glyphMarginWidth: 0,
			glyphMarginHeight: 900,

			lineNumbersLeft: 0,
			lineNumbersWidth: 60,
			lineNumbersHeight: 900,

			decorationsLeft: 60,
			decorationsWidth: 10,
			decorationsHeight: 900,

			contentLeft: 70,
			contentWidth: 830,
			contentHeight: 900,

			renderMinimap: RenderMinimap.None,
			minimapWidth: 0,
			viewportColumn: 83,

			verticalScrollbarWidth: 0,
			horizontalScrollbarHeight: 0,

			overviewRuler: new OverviewRulerPosition({
				top: 0,
				width: 0,
				height: 900,
				right: 0
			})
		}));
	});

	test('EditorLayoutProvider 8', () => {
		doTest({
			outerWidth: 900,
			outerHeight: 900,
			showGlyphMargin: false,
			lineHeight: 16,
			showLineNumbers: true,
			lineNumbersMinChars: 5,
			lineNumbersDigitCount: 6,
			lineDecorationsWidth: 10,
			typicalHalfwidthCharacterWidth: 5,
			maxDigitWidth: 5,
			verticalScrollbarWidth: 0,
			horizontalScrollbarHeight: 0,
			scrollbarArrowSize: 0,
			verticalScrollbarHasArrows: false,
			minimap: false,
			minimapRenderCharacters: true,
			minimapMaxColumn: 150,
			pixelRatio: 1,
		}, new EditorLayoutInfo({
			width: 900,
			height: 900,

			glyphMarginLeft: 0,
			glyphMarginWidth: 0,
			glyphMarginHeight: 900,

			lineNumbersLeft: 0,
			lineNumbersWidth: 30,
			lineNumbersHeight: 900,

			decorationsLeft: 30,
			decorationsWidth: 10,
			decorationsHeight: 900,

			contentLeft: 40,
			contentWidth: 860,
			contentHeight: 900,

			renderMinimap: RenderMinimap.None,
			minimapWidth: 0,
			viewportColumn: 172,

			verticalScrollbarWidth: 0,
			horizontalScrollbarHeight: 0,

			overviewRuler: new OverviewRulerPosition({
				top: 0,
				width: 0,
				height: 900,
				right: 0
			})
		}));
	});

	test('EditorLayoutProvider 8 - rounds floats', () => {
		doTest({
			outerWidth: 900,
			outerHeight: 900,
			showGlyphMargin: false,
			lineHeight: 16,
			showLineNumbers: true,
			lineNumbersMinChars: 5,
			lineNumbersDigitCount: 6,
			lineDecorationsWidth: 10,
			typicalHalfwidthCharacterWidth: 5.05,
			maxDigitWidth: 5.05,
			verticalScrollbarWidth: 0,
			horizontalScrollbarHeight: 0,
			scrollbarArrowSize: 0,
			verticalScrollbarHasArrows: false,
			minimap: false,
			minimapRenderCharacters: true,
			minimapMaxColumn: 150,
			pixelRatio: 1,
		}, new EditorLayoutInfo({
			width: 900,
			height: 900,

			glyphMarginLeft: 0,
			glyphMarginWidth: 0,
			glyphMarginHeight: 900,

			lineNumbersLeft: 0,
			lineNumbersWidth: 30,
			lineNumbersHeight: 900,

			decorationsLeft: 30,
			decorationsWidth: 10,
			decorationsHeight: 900,

			contentLeft: 40,
			contentWidth: 860,
			contentHeight: 900,

			renderMinimap: RenderMinimap.None,
			minimapWidth: 0,
			viewportColumn: 170,

			verticalScrollbarWidth: 0,
			horizontalScrollbarHeight: 0,

			overviewRuler: new OverviewRulerPosition({
				top: 0,
				width: 0,
				height: 900,
				right: 0
			})
		}));
	});

	test('EditorLayoutProvider 9 - render minimap', () => {
		doTest({
			outerWidth: 1000,
			outerHeight: 800,
			showGlyphMargin: false,
			lineHeight: 16,
			showLineNumbers: false,
			lineNumbersMinChars: 0,
			lineNumbersDigitCount: 1,
			lineDecorationsWidth: 10,
			typicalHalfwidthCharacterWidth: 10,
			maxDigitWidth: 10,
			verticalScrollbarWidth: 0,
			horizontalScrollbarHeight: 0,
			scrollbarArrowSize: 0,
			verticalScrollbarHasArrows: false,
			minimap: true,
			minimapRenderCharacters: true,
			minimapMaxColumn: 150,
			pixelRatio: 1,
		}, new EditorLayoutInfo({
			width: 1000,
			height: 800,

			glyphMarginLeft: 0,
			glyphMarginWidth: 0,
			glyphMarginHeight: 800,

			lineNumbersLeft: 0,
			lineNumbersWidth: 0,
			lineNumbersHeight: 800,

			decorationsLeft: 0,
			decorationsWidth: 10,
			decorationsHeight: 800,

			contentLeft: 10,
			contentWidth: 900,
			contentHeight: 800,

			renderMinimap: RenderMinimap.Small,
			minimapWidth: 90,
			viewportColumn: 90,

			verticalScrollbarWidth: 0,
			horizontalScrollbarHeight: 0,

			overviewRuler: new OverviewRulerPosition({
				top: 0,
				width: 0,
				height: 800,
				right: 0
			})
		}));
	});

	test('EditorLayoutProvider 9 - render minimap with pixelRatio = 2', () => {
		doTest({
			outerWidth: 1000,
			outerHeight: 800,
			showGlyphMargin: false,
			lineHeight: 16,
			showLineNumbers: false,
			lineNumbersMinChars: 0,
			lineNumbersDigitCount: 1,
			lineDecorationsWidth: 10,
			typicalHalfwidthCharacterWidth: 10,
			maxDigitWidth: 10,
			verticalScrollbarWidth: 0,
			horizontalScrollbarHeight: 0,
			scrollbarArrowSize: 0,
			verticalScrollbarHasArrows: false,
			minimap: true,
			minimapRenderCharacters: true,
			minimapMaxColumn: 150,
			pixelRatio: 2,
		}, new EditorLayoutInfo({
			width: 1000,
			height: 800,

			glyphMarginLeft: 0,
			glyphMarginWidth: 0,
			glyphMarginHeight: 800,

			lineNumbersLeft: 0,
			lineNumbersWidth: 0,
			lineNumbersHeight: 800,

			decorationsLeft: 0,
			decorationsWidth: 10,
			decorationsHeight: 800,

			contentLeft: 10,
			contentWidth: 900,
			contentHeight: 800,

			renderMinimap: RenderMinimap.Large,
			minimapWidth: 90,
			viewportColumn: 90,

			verticalScrollbarWidth: 0,
			horizontalScrollbarHeight: 0,

			overviewRuler: new OverviewRulerPosition({
				top: 0,
				width: 0,
				height: 800,
				right: 0
			})
		}));
	});

	test('EditorLayoutProvider 9 - render minimap with pixelRatio = 4', () => {
		doTest({
			outerWidth: 1000,
			outerHeight: 800,
			showGlyphMargin: false,
			lineHeight: 16,
			showLineNumbers: false,
			lineNumbersMinChars: 0,
			lineNumbersDigitCount: 1,
			lineDecorationsWidth: 10,
			typicalHalfwidthCharacterWidth: 10,
			maxDigitWidth: 10,
			verticalScrollbarWidth: 0,
			horizontalScrollbarHeight: 0,
			scrollbarArrowSize: 0,
			verticalScrollbarHasArrows: false,
			minimap: true,
			minimapRenderCharacters: true,
			minimapMaxColumn: 150,
			pixelRatio: 4,
		}, new EditorLayoutInfo({
			width: 1000,
			height: 800,

			glyphMarginLeft: 0,
			glyphMarginWidth: 0,
			glyphMarginHeight: 800,

			lineNumbersLeft: 0,
			lineNumbersWidth: 0,
			lineNumbersHeight: 800,

			decorationsLeft: 0,
			decorationsWidth: 10,
			decorationsHeight: 800,

			contentLeft: 10,
			contentWidth: 943,
			contentHeight: 800,

			renderMinimap: RenderMinimap.Large,
			minimapWidth: 47,
			viewportColumn: 94,

			verticalScrollbarWidth: 0,
			horizontalScrollbarHeight: 0,

			overviewRuler: new OverviewRulerPosition({
				top: 0,
				width: 0,
				height: 800,
				right: 0
			})
		}));
	});
});


text:
<resources>
    <!-- Default screen margins, per the Android Design guidelines. -->
    <dimen name="activity_horizontal_margin">16dp</dimen>
    <dimen name="activity_vertical_margin">16dp</dimen>
    <dimen name="toolbar_elevation">16dp</dimen>

    <dimen name="nav_header_height">160dp</dimen>
    <dimen name="spacing_small">8dp</dimen>
    <dimen name="spacing_normal">16dp</dimen>
    <dimen name="spacing_large">72dp</dimen>
    <dimen name="border_circle_image">2dp</dimen>

    <dimen name="spacing_middle">48dp</dimen>

    <dimen name="width_navigation_user_avatar">78dp</dimen>
    <dimen name="height_navigation_user_avatar">78dp</dimen>

    <dimen name="size_photo_toolbar">78dp</dimen>

    <dimen name="width_navigation_user_rating">56dp</dimen>
    <dimen name="height_navigation_user_rating">56dp</dimen>

    <dimen name="width_collapsing_user_rating">56dp</dimen>
    <dimen name="height_collapsing_user_rating">56dp</dimen>

    <dimen name="font_subheading_size">14sp</dimen>
    <dimen name="font_medium_size">16sp</dimen>

    <dimen name="text_size_user_email">14sp</dimen>
    <dimen name="text_size_user_fullname">14sp</dimen>
    <dimen name="size_toolbar_collapsing_image">256dp</dimen>
    <dimen name="size_user_avatar">40dp</dimen>
    <dimen name="height_item_user_list">72dp</dimen>
</resources>


text:
begin
  require 'capybara/rspec'
rescue LoadError
end

begin
  require 'capybara/rails'
rescue LoadError
end

if defined?(Capybara)
  require 'rspec/support/comparable_version'
  unless RSpec::Support::ComparableVersion.new(Capybara::VERSION) >= '2.2.0'
    raise "You are using capybara #{Capybara::VERSION}. RSpec requires >= 2.2.0."
  end

  RSpec.configure do |c|
    if defined?(Capybara::DSL)
      c.include Capybara::DSL, :type => :feature
    end

    if defined?(Capybara::RSpecMatchers)
      c.include Capybara::RSpecMatchers, :type => :view
      c.include Capybara::RSpecMatchers, :type => :helper
      c.include Capybara::RSpecMatchers, :type => :mailer
      c.include Capybara::RSpecMatchers, :type => :controller
      c.include Capybara::RSpecMatchers, :type => :feature
    end

    unless defined?(Capybara::RSpecMatchers) || defined?(Capybara::DSL)
      c.include Capybara, :type => :request
      c.include Capybara, :type => :controller
    end
  end
end


text:
//base64.h:

#ifndef _LIBROARBASE64_H_
#define _LIBROARBASE64_H_

#include "libroar.h"

#define ROAR_BASE64_FLAG_NONE           0x0000
#define ROAR_BASE64_FLAG_EOF            0x0001
#define ROAR_BASE64_FLAG_OPENPGP        0x0002
#define ROAR_BASE64_FLAG_CRC_OK         0x0004

struct roar_base64 {
 int flags;
 unsigned char iobuf[3];
 int buflen;
 int reg, reglen;
};

int roar_base64_init(struct roar_base64 * state, int flags);

#define roar_base64_init_encode(state,flags) roar_base64_init((state),(flags))
#define roar_base64_init_decode(state,flags) roar_base64_init((state),(flags))

ssize_t roar_base64_encode(struct roar_base64 * state, void * out, size_t outlen, const void * in, size_t inlen, size_t * off, int eof);

ssize_t roar_base64_decode(struct roar_base64 * state, void * out, size_t outlen, const void * in, size_t inlen, size_t * off);

int roar_base64_is_eof(struct roar_base64 * state);

int roar_base64_uninit(struct roar_base64 * state);

#endif

//ll


text:
from __future__ import unicode_literals
from builtins import str
from django.db import models
from lino.api import dd

@dd.python_2_unicode_compatible
class Person(dd.Model):

    name = models.CharField(max_length=50)

    def __str__(self):
        return self.name

@dd.python_2_unicode_compatible
class Place(dd.Model):

    name = models.CharField(max_length=50)
    owners = models.ManyToManyField(Person, related_name="owned_places")
    ceo = models.ForeignKey(Person, related_name="managed_places")

    def __str__(self):
        if self.get_restaurant():
            if self.get_bar():
                what = "Restaurant & Bar "
            else:
                what = "Restaurant "
        elif self.get_bar():
            what = "Bar "
        else:
            what = ''
        return "%s %s(ceo=%s,owners=%s)" % (
            self.name, what, self.ceo,
            ','.join([str(o) for o in self.owners.all()]))

    def get_restaurant(self):
        try:
            return self.restaurant
        except Restaurant.DoesNotExist:
            return None

    def get_bar(self):
        try:
            return self.bar
        except Bar.DoesNotExist:
            return None

@dd.python_2_unicode_compatible
class Bar(dd.Model):

    place = models.OneToOneField(Place)
    serves_alcohol = models.BooleanField(default=True)

    def __str__(self):
        if self.serves_alcohol:
            return self.place.name
        return "%s (no alcohol)" % self.place.name

@dd.python_2_unicode_compatible
class Restaurant(dd.Model):

    place = models.OneToOneField(Place)
    serves_hot_dogs = models.BooleanField(default=False)
    cooks = models.ManyToManyField(Person)

    def __str__(self):
        return "%s (cooks=%s)" % (
            self.place.name,
            ','.join([str(o) for o in self.cooks.all()]))

@dd.python_2_unicode_compatible
class Visit(models.Model):

    allow_cascaded_delete = ['place']
    person = models.ForeignKey(Person)
    place = models.ForeignKey(Place)
    purpose = models.CharField(max_length=50)

    def __str__(self):
        return "%s visit by %s at %s" % (
            self.purpose, self.person, self.place.name)

@dd.python_2_unicode_compatible
class Meal(models.Model):
    allow_cascaded_delete = ['restaurant']
    person = models.ForeignKey(Person)
    restaurant = models.ForeignKey(Restaurant)
    what = models.CharField(max_length=50)

    def __str__(self):
        return "%s eats %s at %s" % (
            self.person, self.what, self.restaurant.name)


text:
using System;
using System.IO;
using System.IO.Packaging;
using System.Text;

namespace RFAThumbnailCreator
{

 ///
 /// Utility for manipulating string objects.
 ///
 public sealed class StringUtility
 {

  // added to suppress the default public constructor
  private StringUtility()
  {
  }

  ///
  /// Adds a trailing backslash (\) to the supplied
  /// path if it does not exist.
  ///
  /// <param name="path">The path to check.</param>
  /// <returns>
  /// The supplied path is returned with a trailing
  /// backslash (\) if is does not exist. If path is
  /// an empty string, an empty string is returned.
  /// </returns>
  public static string AddTrailingBackslash(string path)
  {
   // check for null argument
   if(path == null)
   {
    throw new ArgumentNullException("path");
   }

   // check for empty string
   if(path.Length == 0)
   {
    return path;
   }

   // check for existing backslash
   if(path.EndsWith(@"\") == false)
   {
    return string.Format(@"{0}\", path);
   }

   // there is already a trailing backslash
   return path;
  }

  ///
  /// Counts the number of specified characters in the specified string.
  ///
  /// <param name="value">The string to parse.</param>
  /// <param name="characterToCount">The character to count.</param>
  /// <returns>This method returns the number of specified characters
  /// in the specified string. Zero (0) is returned if the specified
  /// string does not contain any of the specified characters.</returns>
  public static int CharacterCount(string value, char characterToCount)
  {
   int count = 0;
   for(int i = 0; i < value.Length; i++)
   {
    if(value[i].Equals(characterToCount))
    {
     count += 1;
    }
   }
   return count;
  }

  ///
  ///
  ///
  /// <param name="value">The original string the substring will
  /// be taken from.</param>
  /// <param name="startIndex">The starting index (zero based) in the
  /// original string to begin the search for the delimiter character.</param>
  /// <param name="length">The number of characters from the starting index
  /// to search for the delimiter.</param>
  /// <param name="delimiter">The delimiter used to find the end of the substring.</param>
  /// <param name="count">The number of occurances of the delimiter to use to
  /// find the end of the substring.</param>
  /// <returns>This method returns the portion of the original string that contains
  /// count occurrances of the specified delimiter. The search starts at the character
  /// in the startingIndex position and continues for length characters.</returns>
  /// <remarks>
  /// The string returned by this method includes the nth occurance of the
  /// sprcified delimiter.

  /// Given the following string (originalString)...

  /// P:\Projects\546002\Central Campus\Sheets\Buildings 3-4-5\HVAC\

  /// SubString(originalString, 3, 31, '\', 1) returns "Projects\"

  /// SubString(originalString, 3, 31, '\', 2) returns "Projects\546002\"

  /// SubString(originalString, 3, 31, '\', 3) returns "Projects\546002\Central Campus\"

  /// SubString(originalString, 3, 31, '\', 7) returns "Projects\546002\Central Campus\Sheets\Buildings 3-4-5\HVAC\"

  /// SubString(originalString, 3, 31, '_', 3) returns the original string

  /// </remarks>
  public static string Substring(string value, int startIndex, int length, char delimiter, int count)
  {
   if(count == 0)
   {
    return value;
   }

   if(CharacterCount(value, delimiter) < count)
   {
    return value;
   }

   int internalCount = 0;

   for(int i = startIndex; i < length; i++)
   {
    if(value[i].Equals(delimiter))
    {
     internalCount += 1;
    }
    if(internalCount == count)
    {
     return value.Substring(startIndex, i + 1);
    }
   }

   return value;
  }

  ///
  /// Finds a substring in the entire specified original string using the
  /// specified count occurrance of the specified delimiter.
  ///
  /// <param name="value">The original string the substring will
  /// be taken from.</param>
  /// <param name="delimiter">The delimiter used to find the end of the substring.</param>
  /// <param name="count">The number of occurances of the delimiter to use to
  /// find the end of the substring.</param>
  /// <returns>This method returns the portion of the original string that contains
  /// count occurrances of the specified delimiter.</returns>
  /// <remarks>
  /// The string returned by this method includes the nth occurance of the
  /// sprcified delimiter.

  /// Given the following string (originalString)...

  /// P:\Projects\546002\Central Campus\Sheets\Buildings 3-4-5\HVAC\

  /// SubString(originalString, '\', 2) returns "P:\Projects\"

  /// SubString(originalString, '\', 4) returns "P:\Projects\546002\Central Campus\"

  /// SubString(originalString, '\', 7) returns "P:\Projects\546002\Central Campus\Sheets\Buildings 3-4-5\HVAC\"

  /// SubString(originalString, '\', 9) returns the original string

  /// SubString(originalString, '_', 9) returns the original string

  /// </remarks>
  public static string Substring(string value, char delimiter, int count)
  {
   int startIndex = 0;
   int length = value.Length - 1;
   return Substring(value, startIndex, length, delimiter, count);
  }

  ///
  /// Purges unprintable characters from the supplied string.
  ///
  /// <param name="oldValue">The string value that will be purged.</param>
  /// <returns>The supplied value is returned as an ASCII string with all
  /// characters less than Decimnal 32 (SPACE) and greater than Decimal 126
  /// (~) removed.</returns>
  /// <remarks>The characters out of range are not replaced with a printable
  /// character. They are permanently removed.</remarks>
  public static string PurgeUnprintableCharacters(string oldValue)
  {
   StringBuilder sb = new StringBuilder();
   char[] oldValueArray = oldValue.ToCharArray();
   foreach(char letter in oldValueArray)
   {
    int decimalValue = (int)letter;
    if((decimalValue >= 32) && (decimalValue <= 126))
    {
     sb.Append(letter);
    }
   }
   oldValue = sb.ToString();
   sb.Length = 0;
   sb.Capacity = 0;
   sb = null;
   return oldValue;
  }

  ///
  /// Converts the byte data from a StreamInfo Package stream to
  /// HEX string data.
  ///
  /// <param name="streamInfo">The StreamInfo Package the data is read from.</param>
  /// <returns>A HEX string of the byte data is returned.</returns>
  /// <remarks>The underlying stream is opened in Read Only mode using a
  /// Stream object.</remarks>
  public static string ConvertStreamBytesToHex(StreamInfo streamInfo)
  {
   StringBuilder sb = new StringBuilder();
   string convertedValue = string.Empty;
   try
   {
    using(Stream streamReader = streamInfo.GetStream(FileMode.Open, FileAccess.Read))
    {
     int currentRead;
     while((currentRead = streamReader.ReadByte()) >= 0)
     {
      byte currentByte = (byte)currentRead;
      sb.AppendFormat("{0:X2}", currentByte);
     }
     convertedValue = sb.ToString();
     return convertedValue;
    }
   }
   catch (Exception ex)
   {
    throw ex;
   }
   finally
   {
    sb.Length = 0;
    sb.Capacity = 0;
    sb = null;
   }
  }

  ///
  /// Converts the byte data from a StreamInfo Package stream to
  /// ASCII string data.
  ///
  /// <param name="streamInfo">The StreamInfo Package the data is read from.</param>
  /// <returns>A ASCII string of the byte data is returned.</returns>
  /// <remarks>The underlying stream is opened in Read Only mode using a
  /// Stream object.</remarks>
  public static string ConvertStreamBytesToASCII(StreamInfo streamInfo)
  {
   byte[] streamData = null;
   try
   {
    using(Stream streamReader = streamInfo.GetStream(FileMode.Open, FileAccess.Read))
    {
     streamData = new byte[streamReader.Length];
     streamReader.Read(streamData, 0, streamData.Length);
     return ASCIIEncoding.ASCII.GetString(streamData);
    }
   }
   catch(Exception ex)
   {
    throw ex;
   }
   finally
   {
    streamData = null;
   }
  }

  ///
  /// Converts the byte data from a StreamInfo Package stream to
  /// Unicode string data.
  ///
  /// <param name="streamInfo">The StreamInfo Package the data is read from.</param>
  /// <returns>A Unicode string of the byte data is returned.</returns>
  /// <remarks>The underlying stream is opened in Read Only mode using a
  /// Stream object.</remarks>
  public static string ConvertStreamBytesToUnicode(StreamInfo streamInfo)
  {
   byte[] streamData = null;
   try
   {
    using(Stream streamReader = streamInfo.GetStream(FileMode.Open, FileAccess.Read))
    {
     streamData = new byte[streamReader.Length];
     streamReader.Read(streamData, 0, streamData.Length);
     return ASCIIEncoding.Unicode.GetString(streamData);
    }
   }
   catch(Exception ex)
   {
    throw ex;
   }
   finally
   {
    streamData = null;
   }
  }

 }
}


text:
package junit.org.rapidpm.vaadin.jumpstart.backend.logic;

import org.junit.After;
import org.junit.Before;
import org.rapidpm.ddi.DI;

/**
 * Created by svenruppert on 06.04.17.
 */
public class BaseDDITest {

    @Before
    public void setUp()
        throws Exception {
        DI.clearReflectionModel();
        DI.activatePackages("org.rapidpm");
        DI.activatePackages(this.getClass().getPackage().getName());
    }

    @After
    public void tearDown()
        throws Exception {
        DI.clearReflectionModel();
    }
}