text:
package groovy.lang;

import groovy.security.GroovyCodeSourcePermission;
import groovy.ui.GroovyMain;
import org.apache.groovy.plugin.GroovyRunner;
import org.apache.groovy.plugin.GroovyRunnerRegistry;
import org.codehaus.groovy.control.CompilationFailedException;
import org.codehaus.groovy.control.CompilerConfiguration;
import org.codehaus.groovy.runtime.InvokerHelper;
import org.codehaus.groovy.runtime.InvokerInvocationException;

import java.io.File;
import java.io.IOException;
import java.io.Reader;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.net.URI;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
import java.util.List;

import static org.codehaus.groovy.runtime.InvokerHelper.MAIN_METHOD_NAME;

/**
 * Represents a groovy shell capable of running arbitrary groovy scripts
 *
 * @author James Strachan
 * @author Guillaume Laforge
 * @author Paul King
 */
public class GroovyShell extends GroovyObjectSupport {

    public static final String DEFAULT_CODE_BASE = "/groovy/shell";

    private final Binding context;
    private int counter;
    private final CompilerConfiguration config;
    private GroovyClassLoader loader;

    public static void main(String[] args) {
        GroovyMain.main(args);
    }

    public GroovyShell() {
        this(null, new Binding());
    }

    public GroovyShell(Binding binding) {
        this(null, binding);
    }

    public GroovyShell(ClassLoader parent, CompilerConfiguration config) {
        this(parent, new Binding(), config);
    }

    public GroovyShell(CompilerConfiguration config) {
        this(new Binding(), config);
    }

    public GroovyShell(Binding binding, CompilerConfiguration config) {
        this(null, binding, config);
    }

    public GroovyShell(ClassLoader parent, Binding binding) {
        this(parent, binding, CompilerConfiguration.DEFAULT);
    }

    public GroovyShell(ClassLoader parent) {
        this(parent, new Binding(), CompilerConfiguration.DEFAULT);
    }

    public GroovyShell(ClassLoader parent, Binding binding, final CompilerConfiguration config) {
        if (binding == null) {
            throw new IllegalArgumentException("Binding must not be null.");
        }
        if (config == null) {
            throw new IllegalArgumentException("Compiler configuration must not be null.");
        }
        final ClassLoader parentLoader = (parent!=null)?parent:GroovyShell.class.getClassLoader();
        this.loader = AccessController.doPrivileged(new PrivilegedAction<GroovyClassLoader>() {
            public GroovyClassLoader run() {
                return new GroovyClassLoader(parentLoader,config);
            }
        });
        this.context = binding;
        this.config = config;
    }

    public void resetLoadedClasses() {
        loader.clearCache();
    }

    /**
     * Creates a child shell using a new ClassLoader which uses the parent shell's
     * class loader as its parent
     *
     * @param shell is the parent shell used for the variable bindings and the parent class loader
     */
    public GroovyShell(GroovyShell shell) {
        this(shell.loader, shell.context);
    }

    public Binding getContext() {
        return context;
    }

    public GroovyClassLoader getClassLoader() {
        return loader;
    }

    public Object getProperty(String property) {
        Object answer = getVariable(property);
        if (answer == null) {
            answer = super.getProperty(property);
        }
        return answer;
    }

    public void setProperty(String property, Object newValue) {
        setVariable(property, newValue);
        try {
            super.setProperty(property, newValue);
        } catch (GroovyRuntimeException e) {
            // ignore, was probably a dynamic property
        }
    }

    //
    // FIXME: Use List<String> here, current version is not safe
    //

    /**
     * A helper method which runs the given script file with the given command line arguments
     *
     * @param scriptFile the file of the script to run
     * @param list       the command line arguments to pass in
     */
    public Object run(File scriptFile, List list) throws CompilationFailedException, IOException {
        String[] args = new String[list.size()];
        return run(scriptFile, (String[]) list.toArray(args));
    }

    /**
     * A helper method which runs the given cl script with the given command line arguments
     *
     * @param scriptText is the text content of the script
     * @param fileName   is the logical file name of the script (which is used to create the class name of the script)
     * @param list       the command line arguments to pass in
     */
    public Object run(String scriptText, String fileName, List list) throws CompilationFailedException {
        String[] args = new String[list.size()];
        list.toArray(args);
        return run(scriptText, fileName, args);
    }

    /**
     * Runs the given script file name with the given command line arguments
     *
     * @param scriptFile the file name of the script to run
     * @param args       the command line arguments to pass in
     */
    public Object run(final File scriptFile, String[] args) throws CompilationFailedException, IOException {
        String scriptName = scriptFile.getName();
        int p = scriptName.lastIndexOf(".");
        if (p++ >= 0) {
            if (scriptName.substring(p).equals("java")) {
                throw new CompilationFailedException(0, null);
            }
        }

        // Get the current context classloader and save it on the stack
        final Thread thread = Thread.currentThread();
        //ClassLoader currentClassLoader = thread.getContextClassLoader();

        class DoSetContext implements PrivilegedAction {
            ClassLoader classLoader;

            public DoSetContext(ClassLoader loader) {
                classLoader = loader;
            }

            public Object run() {
                thread.setContextClassLoader(classLoader);
                return null;
            }
        }

        AccessController.doPrivileged(new DoSetContext(loader));

        // Parse the script, generate the class, and invoke the main method.  This is a little looser than
        // if you are compiling the script because the JVM isn't executing the main method.
        Class scriptClass;
        try {
            scriptClass = AccessController.doPrivileged(new PrivilegedExceptionAction<Class>() {
                public Class run() throws CompilationFailedException, IOException {
                    return loader.parseClass(scriptFile);
                }
            });
        } catch (PrivilegedActionException pae) {
            Exception e = pae.getException();
            if (e instanceof CompilationFailedException) {
                throw (CompilationFailedException) e;
            } else if (e instanceof IOException) {
                throw (IOException) e;
            } else {
                throw (RuntimeException) pae.getException();
            }
        }

        return runScriptOrMainOrTestOrRunnable(scriptClass, args);

        // Set the context classloader back to what it was.
        //AccessController.doPrivileged(new DoSetContext(currentClassLoader));
    }

    /**
     * if (theClass is a Script) {
     * run it like a script
     * } else if (theClass has a main method) {
     * run the main method
     * } else if (theClass instanceof GroovyTestCase) {
     * use the test runner to run it
     * } else if (theClass implements Runnable) {
     * if (theClass has a constructor with String[] params)
     * instantiate theClass with this constructor and run
     * else if (theClass has a no-args constructor)
     * instantiate theClass with the no-args constructor and run
     * }
     */
    private Object runScriptOrMainOrTestOrRunnable(Class scriptClass, String[] args) {
        // Always set the "args" property, regardless of what path we take in the code.
        // Bad enough to have side effects but worse if their behavior is wonky.
        context.setProperty("args", args);

        if (scriptClass == null) {
            return null;
        }

        //TODO: This logic mostly duplicates InvokerHelper.createScript.  They should probably be unified.

        if (Script.class.isAssignableFrom(scriptClass)) {
            // treat it just like a script if it is one
            try {
                Script script = InvokerHelper.newScript(scriptClass, context);
                return script.run();
            } catch (InstantiationException e) {
                // ignore instantiation errors,, try to do main
            } catch (IllegalAccessException e) {
               // ignore instantiation errors, try to do main
            } catch (InvocationTargetException e) {
                // ignore instantiation errors, try to do main
            }
        }
        try {
            // let's find a main method
            scriptClass.getMethod(MAIN_METHOD_NAME, String[].class);
            // if that main method exist, invoke it
            return InvokerHelper.invokeMethod(scriptClass, MAIN_METHOD_NAME, new Object[]{args});
        } catch (NoSuchMethodException e) {
            // if it implements Runnable, try to instantiate it
            if (Runnable.class.isAssignableFrom(scriptClass)) {
                return runRunnable(scriptClass, args);
            }
            GroovyRunnerRegistry runnerRegistry = GroovyRunnerRegistry.getInstance();
            for (GroovyRunner runner : runnerRegistry) {
                if (runner.canRun(scriptClass, this.loader)) {
                    return runner.run(scriptClass, this.loader);
                }
            }
            StringBuilder message = new StringBuilder("This script or class could not be run.\n" +
                    "It should either:\n" +
                    "- have a main method,\n" +
                    "- be a JUnit test or extend GroovyTestCase,\n" +
                    "- implement the Runnable interface,\n" +
                    "- or be compatible with a registered script runner. Known runners:\n");
            if (runnerRegistry.isEmpty()) {
                message.append("  * <none>");
            } else {
                for (String key : runnerRegistry.keySet()) {
                    message.append("  * ").append(key).append("\n");
                }
            }
            throw new GroovyRuntimeException(message.toString());
        }
    }

    private static Object runRunnable(Class scriptClass, String[] args) {
        Constructor constructor = null;
        Runnable runnable = null;
        Throwable reason = null;
        try {
            // first, fetch the constructor taking String[] as parameter
            constructor = scriptClass.getConstructor((new String[]{}).getClass());
            try {
                // instantiate a runnable and run it
                runnable = (Runnable) constructor.newInstance(new Object[]{args});
            } catch (Throwable t) {
                reason = t;
            }
        } catch (NoSuchMethodException e1) {
            try {
                // otherwise, find the default constructor
                constructor = scriptClass.getConstructor();
                try {
                    // instantiate a runnable and run it
                    runnable = (Runnable) constructor.newInstance();
                } catch (InvocationTargetException ite) {
                    throw new InvokerInvocationException(ite.getTargetException());
                } catch (Throwable t) {
                    reason = t;
                }
            } catch (NoSuchMethodException nsme) {
                reason = nsme;
            }
        }
        if (constructor != null && runnable != null) {
            runnable.run();
        } else {
            throw new GroovyRuntimeException("This script or class was runnable but could not be run. ", reason);
        }
        return null;
    }

    /**
     * Runs the given script text with command line arguments
     *
     * @param scriptText is the text content of the script
     * @param fileName   is the logical file name of the script (which is used to create the class name of the script)
     * @param args       the command line arguments to pass in
     */
    public Object run(final String scriptText, final String fileName, String[] args) throws CompilationFailedException {
        GroovyCodeSource gcs = AccessController.doPrivileged(new PrivilegedAction<GroovyCodeSource>() {
            public GroovyCodeSource run() {
                return new GroovyCodeSource(scriptText, fileName, DEFAULT_CODE_BASE);
            }
        });
        return run(gcs, args);
    }

    /**
     * Runs the given script source with command line arguments
     *
     * @param source    is the source content of the script
     * @param args      the command line arguments to pass in
     */
    public Object run(GroovyCodeSource source, List args) throws CompilationFailedException {
        return run(source, ((String[]) args.toArray(new String[args.size()])));
    }

    /**
     * Runs the given script source with command line arguments
     *
     * @param source    is the source content of the script
     * @param args      the command line arguments to pass in
     */
    public Object run(GroovyCodeSource source, String[] args) throws CompilationFailedException {
        Class scriptClass = parseClass(source);
        return runScriptOrMainOrTestOrRunnable(scriptClass, args);
    }

    /**
     * Runs the given script source with command line arguments
     *
     * @param source    is the source content of the script
     * @param args      the command line arguments to pass in
     */
    public Object run(URI source, List args) throws CompilationFailedException, IOException {
        return run(new GroovyCodeSource(source), ((String[]) args.toArray(new String[args.size()])));
    }

    /**
     * Runs the given script source with command line arguments
     *
     * @param source    is the source content of the script
     * @param args      the command line arguments to pass in
     */
    public Object run(URI source, String[] args) throws CompilationFailedException, IOException {
        return run(new GroovyCodeSource(source), args);
    }

    /**
     * Runs the given script with command line arguments
     *
     * @param in       the stream reading the script
     * @param fileName is the logical file name of the script (which is used to create the class name of the script)
     * @param list     the command line arguments to pass in
     */
    public Object run(final Reader in, final String fileName, List list) throws CompilationFailedException {
        return run(in, fileName, (String[]) list.toArray(new String[list.size()]));
    }

    /**
     * Runs the given script with command line arguments
     *
     * @param in       the stream reading the script
     * @param fileName is the logical file name of the script (which is used to create the class name of the script)
     * @param args     the command line arguments to pass in
     */
    public Object run(final Reader in, final String fileName, String[] args) throws CompilationFailedException {
        GroovyCodeSource gcs = AccessController.doPrivileged(new PrivilegedAction<GroovyCodeSource>() {
                    public GroovyCodeSource run() {
                        return new GroovyCodeSource(in, fileName, DEFAULT_CODE_BASE);
                    }
        });
        Class scriptClass = parseClass(gcs);
        return runScriptOrMainOrTestOrRunnable(scriptClass, args);
    }

    public Object getVariable(String name) {
        return context.getVariables().get(name);
    }

    public void setVariable(String name, Object value) {
        context.setVariable(name, value);
    }

    /**
     * Evaluates some script against the current Binding and returns the result
     *
     * @param codeSource
     * @throws CompilationFailedException
     */
    public Object evaluate(GroovyCodeSource codeSource) throws CompilationFailedException {
        Script script = parse(codeSource);
        return script.run();
    }

    /**
     * Evaluates some script against the current Binding and returns the result
     *
     * @param scriptText the text of the script
     */
    public Object evaluate(final String scriptText) throws CompilationFailedException {
        return evaluate(scriptText, generateScriptName(), DEFAULT_CODE_BASE);
    }

    /**
     * Evaluates some script against the current Binding and returns the result
     *
     * @param scriptText the text of the script
     * @param fileName   is the logical file name of the script (which is used to create the class name of the script)
     */
    public Object evaluate(String scriptText, String fileName) throws CompilationFailedException {
        return evaluate(scriptText, fileName, DEFAULT_CODE_BASE);
    }

    /**
     * Evaluates some script against the current Binding and returns the result.
     * The .class file created from the script is given the supplied codeBase
     */
    public Object evaluate(final String scriptText, final String fileName, final String codeBase) throws CompilationFailedException {
        SecurityManager sm = System.getSecurityManager();
        if (sm != null) {
            sm.checkPermission(new GroovyCodeSourcePermission(codeBase));
        }

        GroovyCodeSource gcs = AccessController.doPrivileged(new PrivilegedAction<GroovyCodeSource>() {
            public GroovyCodeSource run() {
                return new GroovyCodeSource(scriptText, fileName, codeBase);
            }
        });

        return evaluate(gcs);
    }

    /**
     * Evaluates some script against the current Binding and returns the result
     *
     * @param file is the file of the script (which is used to create the class name of the script)
     */
    public Object evaluate(File file) throws CompilationFailedException, IOException {
        return evaluate(new GroovyCodeSource(file, config.getSourceEncoding()));
    }

    /**
     * Evaluates some script against the current Binding and returns the result
     *
     * @param uri is the URI of the script (which is used to create the class name of the script)
     */
    public Object evaluate(URI uri) throws CompilationFailedException, IOException {
        return evaluate(new GroovyCodeSource(uri));
    }

    /**
     * Evaluates some script against the current Binding and returns the result
     *
     * @param in the stream reading the script
     */
    public Object evaluate(Reader in) throws CompilationFailedException {
        return evaluate(in, generateScriptName());
    }

    /**
     * Evaluates some script against the current Binding and returns the result
     *
     * @param in       the stream reading the script
     * @param fileName is the logical file name of the script (which is used to create the class name of the script)
     */
    public Object evaluate(Reader in, String fileName) throws CompilationFailedException {
        Script script = null;
        try {
            script = parse(in, fileName);
            return script.run();
        } finally {
            if (script != null) {
                InvokerHelper.removeClass(script.getClass());
            }
        }
    }

    /**
     * Parses the given script and returns it ready to be run
     *
     * @param reader    the stream reading the script
     * @param fileName  is the logical file name of the script (which is used to create the class name of the script)
     * @return the parsed script which is ready to be run via {@link Script#run()}
     */
    public Script parse(final Reader reader, final String fileName) throws CompilationFailedException {
        return parse(new GroovyCodeSource(reader, fileName, DEFAULT_CODE_BASE));
    }

    /**
     * Parses the groovy code contained in codeSource and returns a java class.
     */
    private Class parseClass(final GroovyCodeSource codeSource) throws CompilationFailedException {
        // Don't cache scripts
        return loader.parseClass(codeSource, false);
    }

    /**
     * Parses the given script and returns it ready to be run.  When running in a secure environment
     * (-Djava.security.manager) codeSource.getCodeSource() determines what policy grants should be
     * given to the script.
     *
     * @param codeSource
     * @return ready to run script
     */
    public Script parse(final GroovyCodeSource codeSource) throws CompilationFailedException {
        return InvokerHelper.createScript(parseClass(codeSource), context);
    }

    /**
     * Parses the given script and returns it ready to be run
     *
     * @param file is the file of the script (which is used to create the class name of the script)
     */
    public Script parse(File file) throws CompilationFailedException, IOException {
        return parse(new GroovyCodeSource(file, config.getSourceEncoding()));
    }

    /**
     * Parses the given script and returns it ready to be run
     *
     * @param uri is the URI of the script (which is used to create the class name of the script)
     */
    public Script parse(URI uri) throws CompilationFailedException, IOException {
        return parse(new GroovyCodeSource(uri));
    }

    /**
     * Parses the given script and returns it ready to be run
     *
     * @param scriptText the text of the script
     */
    public Script parse(String scriptText) throws CompilationFailedException {
        return parse(scriptText, generateScriptName());
    }

    public Script parse(final String scriptText, final String fileName) throws CompilationFailedException {
        GroovyCodeSource gcs = AccessController.doPrivileged(new PrivilegedAction<GroovyCodeSource>() {
            public GroovyCodeSource run() {
                return new GroovyCodeSource(scriptText, fileName, DEFAULT_CODE_BASE);
            }
        });
        return parse(gcs);
    }

    /**
     * Parses the given script and returns it ready to be run
     *
     * @param in the stream reading the script
     */
    public Script parse(Reader in) throws CompilationFailedException {
        return parse(in, generateScriptName());
    }

    protected synchronized String generateScriptName() {
        return "Script" + (++counter) + ".groovy";
    }
}


text:
<?xml version="1.0"?>

<registration>

	<tool
			id="sakai.mailbox"
			title="Email Archive"
			description="For viewing email sent to the site.">

		<configuration name="channel" value="" />
		<configuration name="pagesize" value="20" />
		<configuration name="showNonAlias" value="false" />

		<category name="course" />
		<category name="project" />
		<category name="portfolio" />

		<configuration name="functions.require" value="mail.read" />

	</tool>

</registration>

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace Feedback;

use Zend\ModuleManager\Feature\AutoloaderProviderInterface;

class Module implements AutoloaderProviderInterface
{
    public function getAutoloaderConfig()
    {
        return array(
            'Zend\Loader\ClassMapAutoloader' => array(
                __DIR__ . '/autoload_classmap.php',
            ),
            'Zend\Loader\StandardAutoloader' => array(
                'namespaces' => array(
		    // if we're in a namespace deeper than one level we need to fix the \ in the path
                    __NAMESPACE__ => __DIR__ . '/src/' . str_replace('\\', '/' , __NAMESPACE__),
                ),
            ),
        );
    }

    public function getConfig()
    {
        return include __DIR__ . '/config/module.config.php';
    }

    public function getControllerConfig()
    {
        return array(
            'factories' => array(
                'feedback_controller' => function($cm) {
                    $sm = $cm->getServiceLocator();
                    return new Controller\FeedbackController(
                        $sm->get('user_service')
                    );
                }
            ),
        );
    }

    public function getControllerPluginConfig()
    {

    }

    public function getServiceConfig()
    {
        return array(

        );
    }
}


text:
namespace extensions {

ExtensionsPermissionsTracker::ExtensionsPermissionsTracker(
    ExtensionRegistry* registry,
    content::BrowserContext* browser_context)
    : registry_(registry),
      pref_service_(Profile::FromBrowserContext(browser_context)->GetPrefs()) {
  observation_.Observe(registry_);
  pref_change_registrar_.Init(pref_service_);
  pref_change_registrar_.Add(
      pref_names::kInstallForceList,
      base::BindRepeating(
          &ExtensionsPermissionsTracker::OnForcedExtensionsPrefChanged,
          base::Unretained(
              this)));  // Safe as ExtensionsPermissionsTracker
                        // owns pref_change_registrar_ & outlives it
  // Try to load list now.
  OnForcedExtensionsPrefChanged();
}

ExtensionsPermissionsTracker::~ExtensionsPermissionsTracker() = default;

void ExtensionsPermissionsTracker::OnForcedExtensionsPrefChanged() {
  // TODO(crbug.com/1015378): handle pref_names::kExtensionManagement with
  // installation_mode: forced.
  const base::Value* value = pref_service_->Get(pref_names::kInstallForceList);
  if (!value || value->type() != base::Value::Type::DICTIONARY) {
    return;
  }

  extension_safety_ratings_.clear();
  pending_forced_extensions_.clear();

  for (const auto entry : value->DictItems()) {
    const ExtensionId& extension_id = entry.first;
    // By default the extension permissions are assumed to trigger full warning
    // (false). When the extension is loaded, if all of its permissions is safe,
    // it'll be marked safe (true)
    extension_safety_ratings_.insert(make_pair(extension_id, false));
    const Extension* extension =
        registry_->GetExtensionById(extension_id, ExtensionRegistry::ENABLED);
    if (extension)
      ParseExtensionPermissions(extension);
    else
      pending_forced_extensions_.insert(extension_id);
  }
  if (pending_forced_extensions_.empty())
    UpdateLocalState();
}

bool ExtensionsPermissionsTracker::IsSafePerms(
    const PermissionsData* perms_data) const {
  const PermissionSet& active_permissions = perms_data->active_permissions();
  const APIPermissionSet& api_permissions = active_permissions.apis();
  for (auto* permission : api_permissions) {
    if (permission->info()->requires_managed_session_full_login_warning()) {
      return false;
    }
  }
  const ManifestPermissionSet& manifest_permissions =
      active_permissions.manifest_permissions();
  for (const auto* permission : manifest_permissions) {
    if (permission->RequiresManagedSessionFullLoginWarning()) {
      return false;
    }
  }
  if (active_permissions.ShouldWarnAllHosts() ||
      !active_permissions.effective_hosts().is_empty()) {
    return false;
  }

  return true;
}

void ExtensionsPermissionsTracker::OnExtensionLoaded(
    content::BrowserContext* browser_context,
    const Extension* extension) {
  auto itr = extension_safety_ratings_.find(extension->id());
  if (itr == extension_safety_ratings_.end())
    return;
  pending_forced_extensions_.erase(extension->id());

  ParseExtensionPermissions(extension);

  // If the extension isn't safe or all extensions are loaded, update the local
  // state.
  if (!itr->second || pending_forced_extensions_.empty())
    UpdateLocalState();
}

void ExtensionsPermissionsTracker::UpdateLocalState() {
  bool any_unsafe = std::any_of(
      extension_safety_ratings_.begin(), extension_safety_ratings_.end(),
      [](const auto& key_value) { return !key_value.second; });

  DCHECK(pending_forced_extensions_.empty() || any_unsafe);

  g_browser_process->local_state()->SetBoolean(
      prefs::kManagedSessionUseFullLoginWarning, any_unsafe);
}

// static
void ExtensionsPermissionsTracker::RegisterLocalStatePrefs(
    PrefRegistrySimple* registry) {
  registry->RegisterBooleanPref(prefs::kManagedSessionUseFullLoginWarning,
                                true);
}

void ExtensionsPermissionsTracker::ParseExtensionPermissions(
    const Extension* extension) {
  bool is_safe = IsAllowlistedForPublicSession(extension->id()) ||
                 IsSafePerms(extension->permissions_data());

  extension_safety_ratings_[extension->id()] = is_safe;
}

}  // namespace extensions


text:
<!DOCTYPE html>

	<meta charset="utf-8">
	<title>GTRI Webwise Living Styleguide</title>
	<meta name="description" content="">
	<meta name="generator" content="kss-node" />
	<meta name="viewport" content="width=device-width">
	<link rel="stylesheet" href="public/kss.css">
  <link rel="stylesheet" href="../../../../libraries/flexslider/flexslider.css">
  <link rel="stylesheet" href="../css/webwise.styleguide.css">
  <link rel="stylesheet" href="../css/webwise.styles.css">
  <link rel="stylesheet" href="../css/classy-panel.styles.css">
  <link rel="stylesheet" href="../css/webwise.shame.css">
	<link rel="shortcut icon" href="../ext_icon.gif" />

		≡

GTRI Webwise Styleguide

0.0: Overview

1.0: Base HTML

2.0: Branding

				2.1Typography

				2.5Primary Buttons

				2.7Classy Panel Styles: Text Styles

				#
				2.0 - Branding

Client-Specific Branding such as color, texture, typography, etc.

					#
					2.1 - Typography

Default

Primary Font: Georgia

Secondary Font Heavy: Liberator-Heavy

Secondary Font: Liberator-Medium

Secondary Font Light: Liberator-Light

Tertiary Font: SackersGothicStd-Medium

<h2 class="Sentinel-Medium">Primary Font: Georgia </h2>
<h2 class="Liberator-Heavy">Secondary Font Heavy: Liberator-Heavy</h2>
<h2 class="Liberator-Medium">Secondary Font: Liberator-Medium</h2>
<h2 class="Liberator-Light">Secondary Font Light: Liberator-Light</h2>
<h2 class="SackersGothicStd-Medium">Tertiary Font: SackersGothicStd-Medium</h2>

					#
					2.5 - Primary Buttons

Most button use cases should use one of the modifier classes below.
Both 'button-primary' and 'button-primar--modifier' doesn't need to
be added to the markup. Adding only the modifier class works fine.

								Available modifiers

.button-primary--one

Button Primary: color one

.button-primary--two

Button Primary: color two

.button-primary--three

Button Primary: color three

.button-primary--four

Button Primary: color four

.button-secondary

Button Secondary

.button--large

Larger button alternative

Default

						<button class=" {$modifiers}">HTML Button element</button>

Link with a button class

Button Primary: color one

.button-primary--one

						<button class=" button-primary--one">HTML Button element</button>

Link with a button class

Button Primary: color two

.button-primary--two

						<button class=" button-primary--two">HTML Button element</button>

Link with a button class

Button Primary: color three

.button-primary--three

						<button class=" button-primary--three">HTML Button element</button>

Link with a button class

Button Primary: color four

.button-primary--four

						<button class=" button-primary--four">HTML Button element</button>

Link with a button class

Button Secondary

.button-secondary

						<button class=" button-secondary">HTML Button element</button>

Link with a button class

Larger button alternative

.button--large

						<button class=" button--large">HTML Button element</button>

Link with a button class

<button class=" {$modifiers}">HTML Button element</button>
<br>
<p><a class=" {$modifiers}" href="#">Link with a button class</a></p>

					#
					2.7 - Classy Panel Styles: Text Styles

								Available modifiers

.text-white

Turn all text white

.text-navy

Turn all text Butler blue

Default

First-Level Header; Any header elements may include links.

The main header above is an h1 element.

Second-Level Header; Any header elements may include links.

The secondary header above is an h2 element, which may be used for any form of important page-level header. More than one may be used per page. Consider using an h2 unless you need a header level of less importance, or as a sub-header to an existing h2 element.

Third-Level Header; Any header elements may include links.

The header above is an h3 element, which may be used for any form of page-level header which falls below the h2 header in a document hierarchy.

Fourth-Level Header; Any header elements may include links.

The header above is an h4 element, which may be used for any form of page-level header which falls below the h3 header in a document hierarchy.

Fifth-Level Header; Any header elements may include links.

The header above is an h5 element, which may be used for any form of page-level header which falls below the h4 header in a document hierarchy.

Sixth-Level Header; Any header elements may include links.

The header above is an h6 element, which may be used for any form of page-level header which falls below the h5 header in a document hierarchy.

Turn all text white

.text-white

First-Level Header; Any header elements may include links.

The main header above is an h1 element.

Second-Level Header; Any header elements may include links.

The secondary header above is an h2 element, which may be used for any form of important page-level header. More than one may be used per page. Consider using an h2 unless you need a header level of less importance, or as a sub-header to an existing h2 element.

Third-Level Header; Any header elements may include links.

The header above is an h3 element, which may be used for any form of page-level header which falls below the h2 header in a document hierarchy.

Fourth-Level Header; Any header elements may include links.

The header above is an h4 element, which may be used for any form of page-level header which falls below the h3 header in a document hierarchy.

Fifth-Level Header; Any header elements may include links.

The header above is an h5 element, which may be used for any form of page-level header which falls below the h4 header in a document hierarchy.

Sixth-Level Header; Any header elements may include links.

The header above is an h6 element, which may be used for any form of page-level header which falls below the h5 header in a document hierarchy.

Turn all text Butler blue

.text-navy

First-Level Header; Any header elements may include links.

The main header above is an h1 element.

Second-Level Header; Any header elements may include links.

The secondary header above is an h2 element, which may be used for any form of important page-level header. More than one may be used per page. Consider using an h2 unless you need a header level of less importance, or as a sub-header to an existing h2 element.

Third-Level Header; Any header elements may include links.

The header above is an h3 element, which may be used for any form of page-level header which falls below the h2 header in a document hierarchy.

Fourth-Level Header; Any header elements may include links.

The header above is an h4 element, which may be used for any form of page-level header which falls below the h3 header in a document hierarchy.

Fifth-Level Header; Any header elements may include links.

The header above is an h5 element, which may be used for any form of page-level header which falls below the h4 header in a document hierarchy.

Sixth-Level Header; Any header elements may include links.

The header above is an h6 element, which may be used for any form of page-level header which falls below the h5 header in a document hierarchy.

<div class="panel-pane {$modifiers}" style="background:#ddd;margin-bottom: 10px;padding: 10px;">
 <h1>First-Level Header; <a href="#">Any header elements may include links.</a></h1>
 <p>The main header above is an <code>h1</code> element. </h1>
 <h2 id="sections">Second-Level Header; <a href="#">Any header elements may include links.</a></h2>
 <p>The secondary header above is an <code>h2</code> element, which may be used for any form of important page-level header. More than one may be used per page. Consider using an <code>h2</code> unless you need a header level of less importance, or as a sub-header to an existing <code>h2</code> element.</p>
 <h3>Third-Level Header; <a href="#">Any header elements may include links.</a></h3>
 <p>The header above is an <code>h3</code> element, which may be used for any form of page-level header which falls below the <code>h2</code> header in a document hierarchy.</p>
 <h4>Fourth-Level Header; <a href="#">Any header elements may include links.</a></h4>
 <p>The header above is an <code>h4</code> element, which may be used for any form of page-level header which falls below the <code>h3</code> header in a document hierarchy.</p>
 <h5>Fifth-Level Header; <a href="#">Any header elements may include links.</a></h5>
 <p>The header above is an <code>h5</code> element, which may be used for any form of page-level header which falls below the <code>h4</code> header in a document hierarchy.</p>
 <h6>Sixth-Level Header; <a href="#">Any header elements may include links.</a></h6>
 <p>The header above is an <code>h6</code> element, which may be used for any form of page-level header which falls below the <code>h5</code> header in a document hierarchy.</p>
</div>

			This styleguide is based on the kss-node_glacier template.


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
G. bot. ital. , n. s. 2(7-8): 43 (1847)

#### Original name
Phacidium delta Kunze, 1830

### Remarks
null


text:
using namespace Ast;
using namespace Codegen;

namespace Codegen
{
	llvm::Type* CodegenInstance::getLlvmTypeOfBuiltin(std::string type)
	{
		if(!Compiler::getDisableLowercaseBuiltinTypes())
		{
			if(type.length() > 0)
			{
				type[0] = toupper(type[0]);
			}
		}

		if(type == "Int8")			return llvm::Type::getInt8Ty(this->getContext());
		else if(type == "Int16")	return llvm::Type::getInt16Ty(this->getContext());
		else if(type == "Int32")	return llvm::Type::getInt32Ty(this->getContext());
		else if(type == "Int64")	return llvm::Type::getInt64Ty(this->getContext());
		else if(type == "Int")		return llvm::Type::getInt64Ty(this->getContext());

		else if(type == "Uint8")	return llvm::Type::getInt8Ty(this->getContext());
		else if(type == "Uint16")	return llvm::Type::getInt16Ty(this->getContext());
		else if(type == "Uint32")	return llvm::Type::getInt32Ty(this->getContext());
		else if(type == "Uint64")	return llvm::Type::getInt64Ty(this->getContext());
		else if(type == "Uint")		return llvm::Type::getInt64Ty(this->getContext());

		else if(type == "Float32")	return llvm::Type::getFloatTy(this->getContext());
		else if(type == "Float")	return llvm::Type::getFloatTy(this->getContext());

		else if(type == "Float64")	return llvm::Type::getDoubleTy(this->getContext());
		else if(type == "Double")	return llvm::Type::getDoubleTy(this->getContext());

		else if(type == "Bool")		return llvm::Type::getInt1Ty(this->getContext());
		else if(type == "Void")		return llvm::Type::getVoidTy(this->getContext());
		else return nullptr;
	}

	llvm::Type* CodegenInstance::getLlvmTypeFromString(Ast::Expr* user, ExprType type, bool allowFail)
	{
		if(type.isLiteral)
		{
			llvm::Type* ret = this->getLlvmTypeOfBuiltin(type.strType);
			if(ret) return ret;

			// not so lucky
			TypePair_t* tp = this->getType(type.strType);
			if(!tp)
				tp = this->getType(type.strType + "E");		// nested types. hack.

			if(!tp && allowFail)
				return 0;

			else if(!tp)
				GenError::unknownSymbol(this, user, type.strType, SymbolType::Type);

			return tp->first;
		}
		else
		{
			error(this, user, "enosup");
		}
	}

	llvm::Value* CodegenInstance::lastMinuteUnwrapType(Expr* user, llvm::Value* alloca)
	{
		iceAssert(alloca->getType()->isPointerTy());
		llvm::Type* baseType = alloca->getType()->getPointerElementType();

		if(this->isEnum(baseType) || this->isTypeAlias(baseType))
		{
			TypePair_t* tp = this->getType(baseType);
			if(!tp)
				error(this, user, "Invalid type '%s'!", baseType->getStructName().str().c_str());

			iceAssert(tp->second.second == TypeKind::Enum);
			Enumeration* enr = dynamic_cast<Enumeration*>(tp->second.first);

			iceAssert(enr);
			if(enr->isStrong)
			{
				return alloca;		// fail.
			}

			return this->builder.CreateStructGEP(alloca, 0);
		}

		return alloca;
	}

	llvm::Type* CodegenInstance::getLlvmType(Expr* expr, bool allowFail, bool setInferred)
	{
		setInferred = false;
		iceAssert(expr);
		{
			if(VarDecl* decl = dynamic_cast<VarDecl*>(expr))
			{
				if(decl->type.strType == "Inferred")
				{
					if(!decl->inferredLType)		// todo: better error detection for this
					{
						error(this, expr, "Invalid variable declaration for %s!", decl->name.c_str());
						// return llvm::Type::getVoidTy(this->getContext());
					}

					iceAssert(decl->inferredLType);
					return decl->inferredLType;
				}
				else
				{
					// if we already "inferred" the type, don't bother doing it again.
					if(decl->inferredLType)
						return decl->inferredLType;

					TypePair_t* type = this->getType(decl->type.strType);
					if(!type)
					{
						// check if it ends with pointer, and if we have a type that's un-pointered
						if(decl->type.strType.find("::") != std::string::npos)
						{
							decl->type.strType = this->mangleRawNamespace(decl->type.strType);

							if(setInferred)
								decl->inferredLType = this->getLlvmType(decl, allowFail);

							return setInferred ? decl->inferredLType : this->getLlvmType(decl, allowFail);
						}

						if(setInferred)
							decl->inferredLType = this->parseTypeFromString(decl, decl->type.strType, allowFail);

						return setInferred ? decl->inferredLType : this->parseTypeFromString(decl, decl->type.strType, allowFail);
					}

					if(setInferred)
						decl->inferredLType = type->first;

					return type->first;
				}
			}
			else if(VarRef* ref = dynamic_cast<VarRef*>(expr))
			{
				VarDecl* decl = getSymDecl(ref, ref->name);
				if(!decl)
					error(this, expr, "(%s:%d) -> Internal check failed: invalid var ref to '%s'", __FILE__, __LINE__, ref->name.c_str());

				auto x = this->getLlvmType(decl, allowFail);
				return x;
			}
			else if(UnaryOp* uo = dynamic_cast<UnaryOp*>(expr))
			{
				if(uo->op == ArithmeticOp::Deref)
				{
					llvm::Type* ltype = this->getLlvmType(uo->expr);
					if(!ltype->isPointerTy())
						error(this, expr, "Attempted to dereference a non-pointer type '%s'", this->getReadableType(ltype).c_str());

					return this->getLlvmType(uo->expr)->getPointerElementType();
				}

				else if(uo->op == ArithmeticOp::AddrOf)
					return this->getLlvmType(uo->expr)->getPointerTo();

				else
					return this->getLlvmType(uo->expr);
			}
			else if(FuncCall* fc = dynamic_cast<FuncCall*>(expr))
			{
				Resolved_t rt = this->resolveFunction(expr, fc->name, fc->params);
				if(!rt.resolved)
				{
					TypePair_t* tp = this->getType(fc->name);
					if(tp)
					{
						return tp->first;
					}
					else
					{
						llvm::Function* genericMaybe = this->tryResolveAndInstantiateGenericFunction(fc);
						if(genericMaybe)
							return genericMaybe->getReturnType();

						GenError::unknownSymbol(this, expr, fc->name.c_str(), SymbolType::Function);
					}
				}
				else
				{
					return getLlvmType(rt.t.second);
				}
			}
			else if(Func* f = dynamic_cast<Func*>(expr))
			{
				return getLlvmType(f->decl);
			}
			else if(FuncDecl* fd = dynamic_cast<FuncDecl*>(expr))
			{
				TypePair_t* type = this->getType(fd->type.strType);
				if(!type)
				{
					llvm::Type* ret = this->parseTypeFromString(fd, fd->type.strType, allowFail);
					return ret;
				}

				return type->first;
			}
			else if(StringLiteral* sl = dynamic_cast<StringLiteral*>(expr))
			{
				if(sl->isRaw)
					return llvm::Type::getInt8PtrTy(this->getContext());

				else
				{
					auto tp = this->getType("String");
					if(!tp)
						return llvm::Type::getInt8PtrTy(this->getContext());

					return tp->first;
				}
			}
			else if(MemberAccess* ma = dynamic_cast<MemberAccess*>(expr))
			{
				VarRef* _vr = dynamic_cast<VarRef*>(ma->left);
				if(_vr)
				{
					// check for type function access (static)
					TypePair_t* tp = 0;
					if((tp = this->getType(this->mangleWithNamespace(_vr->name))))
					{
						if(tp->second.second == TypeKind::Enum)
						{
							iceAssert(tp->first->isStructTy());
							return tp->first;
						}
						else if(tp->second.second == TypeKind::Struct)
						{
							return std::get<0>(this->resolveDotOperator(ma));
						}
					}
				}

				// first, get the type of the lhs
				llvm::Type* lhs = this->getLlvmType(ma->left);
				TypePair_t* pair = this->getType(lhs->isPointerTy() ? lhs->getPointerElementType() : lhs);

				llvm::StructType* st = llvm::dyn_cast<llvm::StructType>(lhs);

				if(!pair && (!st || (st && !st->isLiteral())))
					error(this, expr, "Invalid type '%s' for dot-operator-access", this->getReadableType(lhs).c_str());

				if((st && st->isLiteral()) || (pair->second.second == TypeKind::Tuple))
				{
					// values are 1, 2, 3 etc.
					// for now, assert this.

					Number* n = dynamic_cast<Number*>(ma->right);
					iceAssert(n);

					llvm::Type* ttype = pair ? pair->first : st;
					iceAssert(ttype->isStructTy());

					if(n->ival >= ttype->getStructNumElements())
						error(this, expr, "Tuple does not have %d elements, only %d", (int) n->ival + 1, ttype->getStructNumElements());

					return ttype->getStructElementType(n->ival);
				}
				else if(pair->second.second == TypeKind::Struct)
				{
					Struct* str = dynamic_cast<Struct*>(pair->second.first);
					iceAssert(str);

					VarRef* memberVr = dynamic_cast<VarRef*>(ma->right);
					FuncCall* memberFc = dynamic_cast<FuncCall*>(ma->right);

					if(memberVr)
					{
						for(VarDecl* mem : str->members)
						{
							if(mem->name == memberVr->name)
								return this->getLlvmType(mem);
						}
						for(ComputedProperty* c : str->cprops)
						{
							if(c->name == memberVr->name)
								return this->getLlvmTypeFromString(c, c->type, allowFail);
						}
					}
					else if(memberFc)
					{
						return this->getLlvmType(this->getFunctionFromStructFuncCall(str, memberFc));
					}

					return std::get<0>(this->resolveDotOperator(ma));
				}
				else if(pair->second.second == TypeKind::Enum)
				{
					Enumeration* enr = dynamic_cast<Enumeration*>(pair->second.first);
					iceAssert(enr);

					VarRef* enrcase = dynamic_cast<VarRef*>(ma->right);
					iceAssert(enrcase);

					for(auto c : enr->cases)
					{
						if(c.first == enrcase->name)
							return this->getLlvmType(c.second);
					}

					error(this, expr, "Enum '%s' has no such case '%s'", enr->name.c_str(), enrcase->name.c_str());
				}
				else
				{
					error(this, expr, "Invalid expr type (%s)", typeid(*pair->second.first).name());
				}
			}
			else if(BinOp* bo = dynamic_cast<BinOp*>(expr))
			{
				if(bo->op == ArithmeticOp::CmpLT || bo->op == ArithmeticOp::CmpGT || bo->op == ArithmeticOp::CmpLEq
				|| bo->op == ArithmeticOp::CmpGEq || bo->op == ArithmeticOp::CmpEq || bo->op == ArithmeticOp::CmpNEq)
				{
					return llvm::IntegerType::getInt1Ty(this->getContext());
				}
				else if(bo->op == ArithmeticOp::Cast || bo->op == ArithmeticOp::ForcedCast)
				{
					return this->getLlvmType(bo->right);
				}
				else
				{
					// check if both are integers
					llvm::Type* ltype = this->getLlvmType(bo->left);
					llvm::Type* rtype = this->getLlvmType(bo->right);

					if(ltype->isIntegerTy() && rtype->isIntegerTy())
					{
						if(ltype->getIntegerBitWidth() > rtype->getIntegerBitWidth())
							return ltype;

						return rtype;
					}
					else
					{
						if(ltype->isPointerTy() && rtype->isIntegerTy())
						{
							// pointer arith?
							return ltype;
						}

						return rtype;
					}
				}
			}
			else if(Alloc* alloc = dynamic_cast<Alloc*>(expr))
			{
				TypePair_t* type = getType(alloc->type.strType);
				if(!type)
				{
					// check if it ends with pointer, and if we have a type that's un-pointered
					if(alloc->type.strType.find("::") != std::string::npos)
					{
						alloc->type.strType = this->mangleRawNamespace(alloc->type.strType);
						return this->getLlvmTypeFromString(alloc, alloc->type, allowFail)->getPointerTo();
					}

					return this->parseTypeFromString(alloc, alloc->type.strType)->getPointerTo();
				}

				return type->first->getPointerTo();
			}
			else if(Number* nm = dynamic_cast<Number*>(expr))
			{
				return nm->codegen(this).result.first->getType();
			}
			else if(dynamic_cast<BoolVal*>(expr))
			{
				return llvm::Type::getInt1Ty(getContext());
			}
			else if(Return* retr = dynamic_cast<Return*>(expr))
			{
				return this->getLlvmType(retr->val);
			}
			else if(DummyExpr* dum = dynamic_cast<DummyExpr*>(expr))
			{
				if(dum->type.isLiteral)
				{
					return this->parseTypeFromString(expr, dum->type.strType);
				}
				else
				{
					return this->getLlvmType(dum->type.type);
				}
			}
			else if(dynamic_cast<If*>(expr))
			{
				return llvm::Type::getVoidTy(getContext());
			}
			else if(dynamic_cast<Typeof*>(expr))
			{
				TypePair_t* tp = this->getType("Type");
				iceAssert(tp);

				return tp->first;
			}
			else if(Tuple* tup = dynamic_cast<Tuple*>(expr))
			{
				llvm::Type* tp = tup->cachedLlvmType;
				if(!tup->didCreateType)
					tp = tup->getType(this);

				iceAssert(tp);
				return tp;
			}
			else if(ArrayIndex* ai = dynamic_cast<ArrayIndex*>(expr))
			{
				return this->getLlvmType(ai->arr)->getPointerElementType();
			}
			else if(ArrayLiteral* al = dynamic_cast<ArrayLiteral*>(expr))
			{
				// todo: make this not shit.
				return llvm::ArrayType::get(this->getLlvmType(al->values.front()), al->values.size());
			}
			else if(PostfixUnaryOp* puo = dynamic_cast<PostfixUnaryOp*>(expr))
			{
				llvm::Type* targtype = this->getLlvmType(puo->expr);
				iceAssert(targtype);

				if(puo->kind == PostfixUnaryOp::Kind::ArrayIndex)
				{
					if(targtype->isPointerTy())
						return targtype->getPointerElementType();

					else if(targtype->isArrayTy())
						return targtype->getArrayElementType();

					else
						error(this, expr, "Invalid???");
				}
				else
				{
					iceAssert(0);
				}
			}
		}

		error(this, expr, "(%s:%d) -> Internal check failed: failed to determine type '%s'", __FILE__, __LINE__, typeid(*expr).name());
	}

	llvm::AllocaInst* CodegenInstance::allocateInstanceInBlock(llvm::Type* type, std::string name)
	{
		return this->builder.CreateAlloca(type, 0, name == "" ? "" : name);
	}

	llvm::AllocaInst* CodegenInstance::allocateInstanceInBlock(VarDecl* var)
	{
		return allocateInstanceInBlock(this->getLlvmType(var), var->name);
	}

	llvm::Value* CodegenInstance::getDefaultValue(Expr* e)
	{
		return llvm::Constant::getNullValue(getLlvmType(e));
	}

	static void StringReplace(std::string& str, const std::string& from, const std::string& to)
	{
		size_t start_pos = 0;
		while((start_pos = str.find(from, start_pos)) != std::string::npos)
		{
			str.replace(start_pos, from.length(), to);
			start_pos += to.length(); // Handles case where 'to' is a substring of 'from'
		}
	}

	std::string CodegenInstance::getReadableType(llvm::Type* type)
	{
		if(type == 0)
			return "(null)";

		std::string thing;
		llvm::raw_string_ostream rso(thing);

		type->print(rso);

		// turn it into Flax types.
		std::string ret = rso.str();

		StringReplace(ret, "void", "Void");
		StringReplace(ret, "i8", "Int8");
		StringReplace(ret, "i16", "Int16");
		StringReplace(ret, "i32", "Int32");
		StringReplace(ret, "i64", "Int64");
		StringReplace(ret, "float", "Float32");
		StringReplace(ret, "double", "Float64");

		StringReplace(ret, "i1", "Bool");

		if(ret.length() > 0 && ret[0] == '%')
			ret = ret.substr(1);

		if(ret.length() > 0 && ret.find("=") != (size_t) -1)
		{
			ret = ret.substr(0, ret.find("=") - 1);
		}

		return ret;
	}

	std::string CodegenInstance::getReadableType(llvm::Value* val)
	{
		return this->getReadableType(val->getType());
	}

	std::string CodegenInstance::getReadableType(Expr* expr)
	{
		return this->getReadableType(this->getLlvmType(expr));
	}

	int CodegenInstance::getAutoCastDistance(llvm::Type* from, llvm::Type* to)
	{
		if(!from || !to)
			return -1;

		if(from->isIntegerTy() && to->isIntegerTy() && from->getIntegerBitWidth() != to->getIntegerBitWidth())
		{
			unsigned int ab = from->getIntegerBitWidth();
			unsigned int bb = to->getIntegerBitWidth();

			// we only allow promotion, never truncation (implicitly anyway)
			if(ab > bb) return -1;

			// fk it
			if(ab == 8)
			{
				if(bb == 8)			return 0;
				else if(bb == 16)	return 1;
				else if(bb == 32)	return 2;
				else if(bb == 64)	return 3;
			}
			if(ab == 16)
			{
				if(bb == 8)			return 1;
				else if(bb == 16)	return 0;
				else if(bb == 32)	return 1;
				else if(bb == 64)	return 2;
			}
			if(ab == 32)
			{
				if(bb == 8)			return 2;
				else if(bb == 16)	return 1;
				else if(bb == 32)	return 0;
				else if(bb == 64)	return 1;
			}
			if(ab == 64)
			{
				if(bb == 8)			return 3;
				else if(bb == 16)	return 2;
				else if(bb == 32)	return 1;
				else if(bb == 64)	return 0;
			}
		}
		// check for string to int8*
		else if(to->isPointerTy() && to->getPointerElementType() == llvm::Type::getInt8Ty(this->getContext())
			&& from->isStructTy() && from->getStructName() == this->mangleWithNamespace("String", { }, false))
		{
			return 2;
		}
		else if(from->isPointerTy() && from->getPointerElementType() == llvm::Type::getInt8Ty(this->getContext())
			&& to->isStructTy() && to->getStructName() == this->mangleWithNamespace("String", { }, false))
		{
			return 2;
		}
		else if(to->isFloatingPointTy() && from->isIntegerTy())
		{
			// int-to-float is 10.
			return 10;
		}

		return -1;
	}

	int CodegenInstance::autoCastType(llvm::Type* target, llvm::Value*& right, llvm::Value* rhsPtr)
	{
		if(!target || !right)
			return -1;

		// casting distance for size is determined by the number of "jumps"
		// 8 -> 16 = 1
		// 8 -> 32 = 2
		// 8 -> 64 = 3
		// 16 -> 64 = 2
		// etc.

		int dist = -1;
		if(target->isIntegerTy() && right->getType()->isIntegerTy()
			&& target->getIntegerBitWidth() != right->getType()->getIntegerBitWidth())
		{
			unsigned int lBits = target->getIntegerBitWidth();
			unsigned int rBits = right->getType()->getIntegerBitWidth();

			bool shouldCast = lBits > rBits;
			// check if the RHS is a constant value
			llvm::ConstantInt* constVal = llvm::dyn_cast<llvm::ConstantInt>(right);
			if(constVal)
			{
				// check if the number fits in the LHS type
				if(lBits < 64)	// 64 is the max
				{
					if(constVal->getSExtValue() < 0)
					{
						int64_t max = -1 * powl(2, lBits - 1);
						if(constVal->getSExtValue() > max)
							shouldCast = true;
					}
					else
					{
						uint64_t max = powl(2, lBits) - 1;
						if(constVal->getZExtValue() <= max)
							shouldCast = true;
					}
				}
			}

			if(shouldCast)
			{
				dist = this->getAutoCastDistance(right->getType(), target);
				right = this->builder.CreateIntCast(right, target, false);
			}
		}

		// check if we're passing a string to a function expecting an Int8*
		else if(target->isPointerTy() && target->getPointerElementType() == llvm::Type::getInt8Ty(this->getContext()))
		{
			llvm::Type* rtype = right->getType();
			if(rtype->isStructTy() && rtype->getStructName()== this->mangleWithNamespace("String", std::deque<std::string>()))
			{
				// get the struct gep:
				// Layout of string:
				// var data: Int8*
				// var allocated: Uint64

				// cast the RHS to the LHS
				iceAssert(rhsPtr);
				llvm::Value* ret = this->builder.CreateStructGEP(rhsPtr, 0);
				right = this->builder.CreateLoad(ret);	// mutating

				// string-to-int8* is 2.
				dist = this->getAutoCastDistance(right->getType(), target);
			}
		}
		else if(target->isFloatingPointTy() && right->getType()->isIntegerTy())
		{
			// int-to-float is 10.
			right = this->builder.CreateSIToFP(right, target);
			dist = this->getAutoCastDistance(right->getType(), target);
		}

		return dist;
	}

	int CodegenInstance::autoCastType(llvm::Value* left, llvm::Value*& right, llvm::Value* rhsPtr)
	{
		return this->autoCastType(left->getType(), right, rhsPtr);
	}

	std::string CodegenInstance::unwrapPointerType(std::string type, int* _indirections)
	{
		std::string sptr = std::string("*");
		size_t ptrStrLength = sptr.length();

		std::string actualType = type;
		if(actualType.length() > ptrStrLength && std::equal(sptr.rbegin(), sptr.rend(), actualType.rbegin()))
		{
			int& indirections = *_indirections;

			while(actualType.length() > ptrStrLength && std::equal(sptr.rbegin(), sptr.rend(), actualType.rbegin()))
				actualType = actualType.substr(0, actualType.length() - ptrStrLength), indirections++;
		}

		return actualType;
	}

	static llvm::Type* recursivelyParseTuple(CodegenInstance* cgi, Expr* user, std::string& str, bool allowFail)
	{
		iceAssert(str.length() > 0);
		iceAssert(str[0] == '(');

		str = str.substr(1);
		char front = str.front();
		if(front == ')')
			error(cgi, user, "Empty tuples are not supported");

		std::vector<llvm::Type*> types;
		while(front != ')')
		{
			std::string cur;
			while(front != ',' && front != '(' && front != ')')
			{
				cur += front;

				str.erase(str.begin());
				front = str.front();
			}

			if(front == ',' || front == ')')
			{
				bool shouldBreak = (front == ')');
				llvm::Type* ty = cgi->parseTypeFromString(user, cur, allowFail);
				iceAssert(ty);

				types.push_back(ty);

				str.erase(str.begin());
				front = str.front();

				if(shouldBreak)
					break;
			}
			else if(front == '(')
			{
				iceAssert(str.front() == '(');
				types.push_back(recursivelyParseTuple(cgi, user, str, allowFail));

				if(str.front() == ',')
					str.erase(str.begin());

				front = str.front();
			}
		}

		return llvm::StructType::get(cgi->getContext(), types);
	}

	static llvm::Type* recursivelyParseArray(CodegenInstance* cgi, Expr* user, std::string& type, bool allowFail)
	{
		iceAssert(type.size() > 0);

		llvm::Type* ret = 0;
		if(type[0] != '[')
		{
			std::string t = "";
			while(type[0] != ']')
			{
				t += type[0];
				type.erase(type.begin());
			}

			ret = cgi->parseTypeFromString(user, t, allowFail);
		}
		else
		{
			type = type.substr(1);
			ret = recursivelyParseArray(cgi, user, type, allowFail);

			// todo: FIXME -- arrays, not pointers.
			ret = ret->getPointerTo();

			if(type[0] != ']')
				error(cgi, user, "Expected closing '['");
		}

		return ret;
	}

	llvm::Type* CodegenInstance::parseTypeFromString(Expr* user, std::string type, bool allowFail)
	{
		if(type.length() > 0)
		{
			if(type[0] == '(')
			{
				// parse a tuple.
				llvm::Type* parsed = recursivelyParseTuple(this, user, type, allowFail);
				return parsed;
			}
			else if(type[0] == '[')
			{
				// array.
				std::string tp = type;
				llvm::Type* parsed = recursivelyParseArray(this, user, tp, allowFail);

				return parsed;
			}
			else
			{
				int indirections = 0;

				std::string actualType = this->unwrapPointerType(type, &indirections);
				if(actualType.find("[") != (size_t) -1)
				{
					size_t k = actualType.find("[");
					std::string base = actualType.substr(0, k);

					std::string arr = actualType.substr(k);
					llvm::Type* btype = this->parseTypeFromString(user, base, allowFail);

					std::vector<int> sizes;
					if(arr[0] == '[')
					{
						arr = arr.substr(1);
						while(true)
						{
							const char* c = arr.c_str();
							char* final = 0;

							size_t asize = strtoll(c, &final, 0);
							size_t numlen = final - c;

							arr = arr.substr(numlen);
							sizes.push_back(asize);

							if(arr[0] == ',')
							{
								arr = arr.substr(1);
							}
							else if(arr[0] == ']')
							{
								arr = arr.substr(1);
								break;
							}
						}
					}

					for(auto i : sizes)
					{
						btype = llvm::ArrayType::get(btype, i);
					}

					return btype;
				}
				else
				{
					llvm::Type* ret = this->getLlvmTypeFromString(user, ExprType(actualType), allowFail);

					if(ret)
					{
						while(indirections > 0)
						{
							ret = ret->getPointerTo();
							indirections--;
						}
					}

					return ret;
				}
			}
		}
		else
		{
			return nullptr;
		}
	}

	bool CodegenInstance::isArrayType(Expr* e)
	{
		iceAssert(e);
		llvm::Type* ltype = this->getLlvmType(e);
		return ltype && ltype->isArrayTy();
	}

	bool CodegenInstance::isIntegerType(Expr* e)
	{
		iceAssert(e);
		llvm::Type* ltype = this->getLlvmType(e);
		return ltype && ltype->isIntegerTy();
	}

	bool CodegenInstance::isSignedType(Expr* e)
	{
		return false;	// TODO: something about this
	}

	bool CodegenInstance::isPtr(Expr* expr)
	{
		llvm::Type* ltype = this->getLlvmType(expr);
		return ltype && ltype->isPointerTy();
	}

	bool CodegenInstance::isAnyType(llvm::Type* type)
	{
		if(type->isStructTy())
		{
			if(llvm::cast<llvm::StructType>(type)->hasName() && type->getStructName() == "Any")
			{
				return true;
			}

			TypePair_t* pair = this->getType("Any");
			iceAssert(pair);

			if(pair->first == type)
				return true;
		}

		return false;
	}

	bool CodegenInstance::isEnum(ExprType type)
	{
		if(type.isLiteral)
		{
			TypePair_t* tp = 0;
			if((tp = this->getType(this->mangleWithNamespace(type.strType))))
			{
				if(tp->second.second == TypeKind::Enum)
					return true;
			}

			return false;
		}
		else
		{
			error("enosup");
		}
	}

	bool CodegenInstance::isEnum(llvm::Type* type)
	{
		if(!type) return false;

		bool res = true;
		if(!type->isStructTy())							res = false;
		if(res && type->getStructNumElements() != 1)	res = false;

		TypePair_t* tp = 0;
		if((tp = this->getType(type)))
			return tp->second.second == TypeKind::Enum;

		return res;
	}

	bool CodegenInstance::isTypeAlias(ExprType type)
	{
		if(type.isLiteral)
		{
			TypePair_t* tp = 0;
			if((tp = this->getType(this->mangleWithNamespace(type.strType))))
			{
				if(tp->second.second == TypeKind::TypeAlias)
					return true;
			}

			return false;
		}
		else
		{
			error("enosup");
		}
	}

	bool CodegenInstance::isTypeAlias(llvm::Type* type)
	{
		if(!type) return false;

		bool res = true;
		if(!type->isStructTy())							res = false;
		if(res && type->getStructNumElements() != 1)	res = false;

		TypePair_t* tp = 0;
		if((tp = this->getType(type)))
			return tp->second.second == TypeKind::TypeAlias;

		return res;
	}

	bool CodegenInstance::isBuiltinType(llvm::Type* ltype)
	{
		return (ltype && (ltype->isIntegerTy() || ltype->isFloatingPointTy()));
	}

	bool CodegenInstance::isBuiltinType(Expr* expr)
	{
		llvm::Type* ltype = this->getLlvmType(expr);
		return this->isBuiltinType(ltype);
	}

	std::string CodegenInstance::printAst(Expr* expr)
	{
		if(MemberAccess* ma = dynamic_cast<MemberAccess*>(expr))
		{
			// auto ret = this->flattenDotOperators(ma);

			// std::string s;
			// for(Expr* e : ret)
			// 	s += this->printAst(e) + ".";

			// s = s.substr(0, s.length() - 1);
			// return s;

			return this->printAst(ma->left) + "." + this->printAst(ma->right);
		}
		else if(FuncCall* fc = dynamic_cast<FuncCall*>(expr))
		{
			std::string ret = fc->name + "(";

			for(auto p : fc->params)
				ret += this->printAst(p) + ", ";

			if(fc->params.size() > 0)
				ret = ret.substr(0, ret.length() - 2);

			ret += ")";
			return ret;
		}
		else if(FuncDecl* fd = dynamic_cast<FuncDecl*>(expr))
		{
			std::string str = "ƒ " + fd->name + "(";
			for(auto p : fd->params)
			{
				str += p->name + ": " + (p->inferredLType ? this->getReadableType(p->inferredLType) : p->type.strType) + ", ";
				// str += this->printAst(p).substr(4) + ", "; // remove the leading 'val' or 'var'.
			}

			if(fd->params.size() > 0)
				str = str.substr(0, str.length() - 2);

			str +=  ") -> " + fd->type.strType;
			return str;
		}
		else if(VarRef* vr = dynamic_cast<VarRef*>(expr))
		{
			return vr->name;
		}
		else if(VarDecl* vd = dynamic_cast<VarDecl*>(expr))
		{
			return (vd->immutable ? ("val ") : ("var ")) + vd->name + ": " + this->getReadableType(vd);
		}
		else if(BinOp* bo = dynamic_cast<BinOp*>(expr))
		{
			return "(" + this->printAst(bo->left) + " " + Parser::arithmeticOpToString(bo->op) + " " + this->printAst(bo->right) + ")";
		}
		else if(UnaryOp* uo = dynamic_cast<UnaryOp*>(expr))
		{
			return "(" + Parser::arithmeticOpToString(uo->op) + this->printAst(uo->expr) + ")";
		}
		else if(Number* n = dynamic_cast<Number*>(expr))
		{
			return n->decimal ? std::to_string(n->dval) : std::to_string(n->ival);
		}
		else if(ArrayLiteral* al = dynamic_cast<ArrayLiteral*>(expr))
		{
			std::string s = "[ ";
			for(auto v : al->values)
				s += this->printAst(v) + ", ";

			s = s.substr(0, s.length() - 2);
			s += " ]";

			return s;
		}
		else if(ArrayIndex* ai = dynamic_cast<ArrayIndex*>(expr))
		{
			return this->printAst(ai->arr) + "[" + this->printAst(ai->index) + "]";
		}
		else if(Func* fn = dynamic_cast<Func*>(expr))
		{
			return this->printAst(fn->decl) + "\n" + this->printAst(fn->block);
		}
		else if(BracedBlock* blk = dynamic_cast<BracedBlock*>(expr))
		{
			std::string ret = "{\n";
			for(auto e : blk->statements)
				ret += "\t" + this->printAst(e) + "\n";

			for(auto d : blk->deferredStatements)
				ret += "\tdefer " + this->printAst(d->expr) + "\n";

			ret += "}";
			return ret;
		}
		else if(StringLiteral* sl = dynamic_cast<StringLiteral*>(expr))
		{
			std::string ret = "\"" + sl->str + "\"";
			return ret;
		}
		else if(BoolVal* bv = dynamic_cast<BoolVal*>(expr))
		{
			return bv->val ? "true" : "false";
		}
		else if(Tuple* tp = dynamic_cast<Tuple*>(expr))
		{
			std::string ret = "(";
			for(auto el : tp->values)
				ret += this->printAst(el) + ", ";

			if(tp->values.size() > 0)
				ret = ret.substr(0, ret.size() - 2);

			ret += ")";
			return ret;
		}
		else if(dynamic_cast<DummyExpr*>(expr))
		{
			return "";
		}

		error(this, expr, "Unknown shit (%s)", typeid(*expr).name());
	}
}


text:
'use strict';

const Server = require('./Server');
const LogStream = require('../shared/log-stream');

const pkg = require('../package.json');
const fs = require('fs');

function validateConfig(config) {
  let retVal = true;
  if (!config.port) {
    retVal = false;
  }
  return retVal;
}

function launch(config) {
  if (validateConfig(config.server)) {
    let srv = new Server(config.server)
    srv.launch();
  } else {
    console.log('INVALID CONFIG\nEXIT');
  }
}

console.log('\n-------------------------------------------------');
console.log('  pitch it.');
console.log('        Backend Server');
console.log('    v' + pkg.version);
console.log('-------------------------------------------------\n');
let config;
if (process.argv[2]) {
  let configFile = fs.readFileSync(process.argv[2]);
  if (configFile) {
    config = JSON.parse(configFile);
  }
}

if (config) {
  LogStream.config(config.logLevel);
  launch(config);
} else {
  console.log('Please, specify a config file');
}


text:
from __future__ import absolute_import

import os
import posixpath
from collections import Iterable

from .compatibility import string as compatible_string
from .compatibility import PY3, WINDOWS, pathname2url, url2pathname
from .util import Memoizer

if PY3:
  import urllib.parse as urlparse
else:
  import urlparse

class Link(object):
  """Wrapper around a URL."""

  @classmethod
  def wrap(cls, url):
    """Given a url that is either a string or :class:`Link`, return a :class:`Link`.

    :param url: A string-like or :class:`Link` object to wrap.
    :returns: A :class:`Link` object wrapping the url.
    """
    if isinstance(url, cls):
      return url
    elif isinstance(url, compatible_string):
      return cls(url)
    else:
      raise ValueError('url must be either a string or Link.')

  @classmethod
  def wrap_iterable(cls, url_or_urls):
    """Given a string or :class:`Link` or iterable, return an iterable of :class:`Link` objects.

    :param url_or_urls: A string or :class:`Link` object, or iterable of string or :class:`Link`
      objects.
    :returns: A list of :class:`Link` objects.
    """
    try:
      return [cls.wrap(url_or_urls)]
    except ValueError:
      pass
    if isinstance(url_or_urls, Iterable):
      return [cls.wrap(url) for url in url_or_urls]
    raise ValueError('url_or_urls must be string/Link or iterable of strings/Links')

  @classmethod
  def _normalize(cls, filename):
    return urlparse.urljoin('file:', pathname2url(
        os.path.realpath(os.path.expanduser(filename))))

  # A cache for the result of from_filename
  _FROM_FILENAME_CACHE = Memoizer()

  @classmethod
  def from_filename(cls, filename):
    """Return a :class:`Link` wrapping the local filename."""
    result = cls._FROM_FILENAME_CACHE.get(filename)
    if result is None:
      result = cls(cls._normalize(filename))
      cls._FROM_FILENAME_CACHE.store(filename, result)
    return result

  def __init__(self, url):
    """Construct a :class:`Link` from a url.

    :param url: A string-like object representing a url.
    """
    purl = urlparse.urlparse(url)
    if purl.scheme == '' or (
        WINDOWS and len(purl.scheme) == 1):  # This is likely a drive letter.
      purl = urlparse.urlparse(self._normalize(url))

    self._url = purl

  def __ne__(self, other):
    return not self.__eq__(other)

  def __eq__(self, link):
    return self.__class__ == link.__class__ and self._url == link._url

  def __hash__(self):
    return hash(self._url)

  def join(self, href):
    """Given a href relative to this link, return the :class:`Link` of the absolute url.

    :param href: A string-like path relative to this link.
    """
    return self.wrap(urlparse.urljoin(self.url, href))

  @property
  def filename(self):
    """The basename of this url."""
    return urlparse.unquote(posixpath.basename(self._url.path))

  @property
  def path(self):
    """The full path of this url with any hostname and scheme components removed."""
    return urlparse.unquote(self._url.path)

  @property
  def local_path(self):
    """Returns the local filesystem path (only works for file:// urls)."""
    assert self.local, 'local_path called on a non-file:// url %s' % (self.url,)
    return url2pathname(self.path)

  @property
  def url(self):
    """The url string to which this link points."""
    return urlparse.urlunparse(self._url)

  @property
  def fragment(self):
    """The url fragment following '#' if any."""
    return urlparse.unquote(self._url.fragment)

  @property
  def scheme(self):
    """The URI scheme used by this Link."""
    return self._url.scheme

  @property
  def local(self):
    """Is the url a local file?"""
    return self._url.scheme in ('', 'file')

  @property
  def remote(self):
    """Is the url a remote file?"""
    return self._url.scheme in ('http', 'https')

  def __repr__(self):
    return '%s(%r)' % (self.__class__.__name__, self.url)


text:
package svc_test

import (
	"context"
	"fmt"
	"reflect"
	"runtime"
	"testing"
	"time"

	"github.com/nerdalize/nerd/pkg/transfer/archiver"
	"github.com/nerdalize/nerd/pkg/transfer/store"
	"github.com/nerdalize/nerd/svc"
)

func TestListDatasets(t *testing.T) {
	for _, c := range []struct {
		Name     string
		Timeout  time.Duration
		Datasets []*svc.CreateDatasetInput
		Input    *svc.ListDatasetsInput
		IsOutput func(tb testing.TB, out *svc.ListDatasetsOutput) bool
		IsErr    func(error) bool
	}{
		{
			Name:     "when a zero value input is provided it should return a validation error",
			Timeout:  time.Second * 5,
			Datasets: nil,
			Input:    nil,
			IsErr:    svc.IsValidationErr,
			IsOutput: func(t testing.TB, out *svc.ListDatasetsOutput) bool {
				return true
			},
		},
		{
			Name:    "when no datasets have been uploaded the output should be empty",
			Timeout: time.Second * 5,
			Input:   &svc.ListDatasetsInput{},
			IsErr:   isNilErr,
			IsOutput: func(t testing.TB, out *svc.ListDatasetsOutput) bool {
				assert(t, len(out.Items) == 0, "expected zero datasets to be listed")
				return true
			},
		},
		{
			Name:     "when one correct dataset was uploaded it should be listed",
			Timeout:  time.Minute,
			Datasets: []*svc.CreateDatasetInput{{Name: "my-dataset", StoreOptions: transferstore.StoreOptions{Type: transferstore.StoreTypeS3}, ArchiverOptions: transferarchiver.ArchiverOptions{Type: transferarchiver.ArchiverTypeTar}}},
			Input:    &svc.ListDatasetsInput{},
			IsErr:    isNilErr,
			IsOutput: func(t testing.TB, out *svc.ListDatasetsOutput) bool {
				assert(t, len(out.Items) == 1, "expected one dataset to be listed")
				assert(t, !out.Items[0].Details.CreatedAt.IsZero(), "created at time should not be zero")

				assert(t, out.Items[0].Name == "my-dataset", "expected dataset name to be equal to what was provided")
				return true
			},
		},
	} {
		t.Run(c.Name, func(t *testing.T) {
			if c.Timeout > time.Second*5 && testing.Short() {
				t.Skipf("skipping long test with contex timeout: %s", c.Timeout)
			}

			di, clean := testDI(t)
			defer clean()

			ctx := context.Background()
			ctx, cancel := context.WithTimeout(ctx, c.Timeout)
			defer cancel()

			kube := svc.NewKube(di)
			for _, dataset := range c.Datasets {
				_, err := kube.CreateDataset(ctx, dataset)
				ok(t, err)
			}

			out, err := kube.ListDatasets(ctx, c.Input)
			if c.IsErr != nil {
				assert(t, c.IsErr(err), fmt.Sprintf("unexpected '%#v' to match: %#v", err, runtime.FuncForPC(reflect.ValueOf(c.IsErr).Pointer()).Name()))
			}

			if c.IsOutput != nil {
				c.IsOutput(t, out)
			}
		})
	}
}


text:
import java.io.File

import testgen.TestSuiteBuilder._
import testgen._

object SublistTestGenerator {
  def main(args: Array[String]): Unit = {
    val file = new File("src/main/resources/sublist.json")

    def toString(expected: CanonicalDataParser.Expected): String = {
      expected match {
        case Right("equal") => s"Sublist.Equal"
        case Right("sublist") => s"Sublist.Sublist"
        case Right("superlist") => s"Sublist.Superlist"
        case Right("unequal") => s"Sublist.Unequal"
        case _ => throw new IllegalStateException()
      }
    }

    def fromLabeledTestFromInput(argNames: String*): ToTestCaseData =
      withLabeledTest { sut =>
        labeledTest =>
          val args = sutArgsFromInput(labeledTest.result, argNames: _*)
          val property = labeledTest.property
          val sutCall =
            s"$sut.$property($args)"
          val expected = toString(labeledTest.expected)
          TestCaseData(labeledTest.description, sutCall, expected)
      }

    val code =
      TestSuiteBuilder.build(file, fromLabeledTestFromInput("listOne", "listTwo"))

    println(s"-------------")
    println(code)
    println(s"-------------")
  }
}


text:
namespace P01_HospitalDatabase.Data
{
    using Microsoft.EntityFrameworkCore;
    using Data.Models;
    public class HospitalContext : DbContext
    {
        public HospitalContext()
        {
        }

        public HospitalContext(DbContextOptions options)
            : base(options)
        {
        }

        public DbSet<Patient> Patients { get; set; }

        public DbSet<Visitation> Visitations { get; set; }

        public DbSet<Diagnose> Diagnoses { get; set; }

        public DbSet<Medicament> Medicaments { get; set; }

        public DbSet<Doctor> Doctors { get; set; }

        public DbSet<PatientMedicament> PatientMedicaments { get; set; }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<Patient>()
                .HasMany(p => p.Visitations)
                .WithOne(v => v.Patient)
                .HasForeignKey(v => v.PatientId);

            modelBuilder.Entity<Patient>()
               .HasMany(p => p.Diagnoses)
               .WithOne(d => d.Patient)
               .HasForeignKey(d => d.PatientId);

            modelBuilder.Entity<Patient>()
                .HasMany(p => p.Prescriptions)
                .WithOne(p => p.Patient)
                .HasForeignKey(p => p.PatientId);

            modelBuilder.Entity<Doctor>()
                .HasMany(d => d.Visitations)
                .WithOne(v => v.Doctor)
                .HasForeignKey(v => v.DoctorId);

            modelBuilder.Entity<PatientMedicament>()
                .HasKey(k => new { k.PatientId, k.MedicamentId });

            modelBuilder.Entity<PatientMedicament>()
                .HasOne(pm => pm.Medicament)
                .WithMany(pm => pm.Prescriptions);

            modelBuilder.Entity<PatientMedicament>()
                .HasOne(pm => pm.Patient)
                .WithMany(pm => pm.Prescriptions)
                .HasForeignKey(pm=>pm.PatientId);

        }

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            if (!optionsBuilder.IsConfigured)
            {
                optionsBuilder.UseSqlServer(Configuration.ConnectionString);
            }
        }
    }
}


text:
<?php

	$__TITLE_PAGE__ = '';
	$__DESC_PAGE__ = '';
	$level = '';

	ob_start();
	if(!empty($_GET['page'])){

		switch($_GET['page']){

			case 'home':
				include('global_html/header.php');
				include('includes/home.php');
			break;

			case 'connexion':
				include('includes/connexion.php');
			break;

			case 'inscription':
				include('includes/inscription.php');
			break;

			case 'reset':
				include('includes/nouveau-motdepasse.php');
			break;

			case 'activation':
				include('includes/activation.php');
			break;

			case 'mon-compte':
				include('global_html/header.php');
				include('includes/mon-compte.php');
			break;

			case 'question':
				include('global_html/header.php');
				include('includes/question.php');
			break;

			case 'nouvelle-question':
				include('global_html/header.php');
				include('includes/nouvelle-question.php');
			break;

			case 'tes-questions':
				include('global_html/header.php');
				include('includes/tes-questions.php');
			break;

			default:
				include('includes/404.html');
			break;
		}
	}
	else{
		include('global_html/header.php');
		include('includes/home.php');
	}
	$content = ob_get_clean();

	include('global_html/head.php');

	echo $content;

	include('global_html/footer.php');

?>


text:
package com.vmware.vim25;

/**
* @author Steve Jin (http://www.doublecloud.org)
* @version 5.1
*/

@SuppressWarnings("all")
public class OvfMissingElementNormalBoundary extends OvfMissingElement {
  public String boundary;

  public String getBoundary() {
    return this.boundary;
  }

  public void setBoundary(String boundary) {
    this.boundary=boundary;
  }
}