text:
package com.intellij.codeInsight.editorActions;

import com.intellij.codeInsight.AutoPopupController;
import com.intellij.codeInsight.completion.CodeCompletionHandlerBase;
import com.intellij.codeInsight.completion.CompletionPhase;
import com.intellij.codeInsight.completion.CompletionType;
import com.intellij.codeInsight.completion.impl.CompletionServiceImpl;
import com.intellij.codeInsight.lookup.LookupManager;
import com.intellij.codeInsight.lookup.impl.LookupImpl;
import com.intellij.lang.injection.InjectedLanguageManager;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.EditorModificationUtil;
import com.intellij.openapi.project.IndexNotReadyException;
import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiDocumentManager;
import com.intellij.psi.PsiFile;
import com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil;
import org.jetbrains.annotations.NotNull;

/**
 * @author peter
 */
public class CompletionAutoPopupHandler extends TypedHandlerDelegate {
  private static final Logger LOG = Logger.getInstance("#com.intellij.codeInsight.editorActions.CompletionAutoPopupHandler");
  public static volatile boolean ourTestingAutopopup = false;

  @Override
  public Result checkAutoPopup(char charTyped, final Project project, final Editor editor, final PsiFile file) {
    CompletionPhase oldPhase = CompletionServiceImpl.getCompletionPhase();
    if (oldPhase instanceof CompletionPhase.EmptyAutoPopup && ((CompletionPhase.EmptyAutoPopup)oldPhase).editor != editor) {
      CompletionServiceImpl.setCompletionPhase(CompletionPhase.NoCompletion);
    }

    if (oldPhase instanceof CompletionPhase.CommittingDocuments && ((CompletionPhase.CommittingDocuments)oldPhase).isRestartingCompletion()) {
      oldPhase.indicator.scheduleRestart();
      return Result.STOP;
    }

    LookupImpl lookup = (LookupImpl)LookupManager.getActiveLookup(editor);
    if (lookup != null) {
      if (editor.getSelectionModel().hasSelection()) {
        lookup.performGuardedChange(new Runnable() {
          @Override
          public void run() {
            EditorModificationUtil.deleteSelectedText(editor);
          }
        });
      }
      return Result.STOP;
    }

    if (Character.isLetter(charTyped) || charTyped == '_') {
      AutoPopupController.getInstance(project).scheduleAutoPopup(editor);
      return Result.STOP;
    }

    if (CompletionServiceImpl.isPhase(CompletionPhase.EmptyAutoPopup.class, CompletionPhase.CommittingDocuments.class)) {
      CompletionServiceImpl.setCompletionPhase(CompletionPhase.NoCompletion);
    }
    return Result.CONTINUE;
  }

  public static void invokeCompletion(CompletionType completionType,
                                      boolean autopopup,
                                      Project project, Editor editor, int time, boolean restart) {
    if (editor.isDisposed()) {
      CompletionServiceImpl.setCompletionPhase(CompletionPhase.NoCompletion);
      return;
    }

    // retrieve the injected file from scratch since our typing might have destroyed the old one completely
    Editor topLevelEditor = InjectedLanguageUtil.getTopLevelEditor(editor);
    PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(topLevelEditor.getDocument());
    if (file == null) {
      CompletionServiceImpl.setCompletionPhase(CompletionPhase.NoCompletion);
      return;
    }

    PsiFile topLevelFile = InjectedLanguageManager.getInstance(file.getProject()).getTopLevelFile(file);
    if (!PsiDocumentManager.getInstance(project).isCommitted(editor.getDocument())) {
      LOG.error("Non-committed document");
      PsiDocumentManager.getInstance(project).commitAllDocuments();
    }
    Editor newEditor = InjectedLanguageUtil.getEditorForInjectedLanguageNoCommit(topLevelEditor, topLevelFile);
    try {
      new CodeCompletionHandlerBase(completionType, false, autopopup, false).invokeCompletion(project, newEditor, time, false, restart);
    }
    catch (IndexNotReadyException ignored) {
    }
  }

  public static void runLaterWithCommitted(@NotNull final Project project,
                                           @NotNull final Document document,
                                           @NotNull final Runnable runnable) {
    final long beforeStamp = document.getModificationStamp();
    PsiDocumentManager.getInstance(project).performWhenAllCommitted(new Runnable() {
      @Override
      public void run() {
        // later because we may end up in write action here if there was a synchronous commit
        ApplicationManager.getApplication().invokeLater(new Runnable() {
          @Override
          public void run() {
            if (beforeStamp != document.getModificationStamp()) {
              // no luck, will try later
              runLaterWithCommitted(project, document, runnable);
            }
            else {
              runnable.run();
            }
          }
        }, project.getDisposed());
      }
    });
  }
}


text:
namespace {

// MEMBER FUNCTIONS - Body may be edited by hand.

void CEF_CALLBACK load_handler_on_loading_state_change(
    struct _cef_load_handler_t* self, cef_browser_t* browser, int isLoading,
    int canGoBack, int canGoForward) {
  // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING

  DCHECK(self);
  if (!self)
    return;
  // Verify param: browser; type: refptr_diff
  DCHECK(browser);
  if (!browser)
    return;

  // Execute
  CefLoadHandlerCppToC::Get(self)->OnLoadingStateChange(
      CefBrowserCToCpp::Wrap(browser),
      isLoading?true:false,
      canGoBack?true:false,
      canGoForward?true:false);
}

void CEF_CALLBACK load_handler_on_load_start(struct _cef_load_handler_t* self,
    cef_browser_t* browser, cef_frame_t* frame) {
  // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING

  DCHECK(self);
  if (!self)
    return;
  // Verify param: browser; type: refptr_diff
  DCHECK(browser);
  if (!browser)
    return;
  // Verify param: frame; type: refptr_diff
  DCHECK(frame);
  if (!frame)
    return;

  // Execute
  CefLoadHandlerCppToC::Get(self)->OnLoadStart(
      CefBrowserCToCpp::Wrap(browser),
      CefFrameCToCpp::Wrap(frame));
}

void CEF_CALLBACK load_handler_on_load_end(struct _cef_load_handler_t* self,
    cef_browser_t* browser, cef_frame_t* frame, int httpStatusCode) {
  // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING

  DCHECK(self);
  if (!self)
    return;
  // Verify param: browser; type: refptr_diff
  DCHECK(browser);
  if (!browser)
    return;
  // Verify param: frame; type: refptr_diff
  DCHECK(frame);
  if (!frame)
    return;

  // Execute
  CefLoadHandlerCppToC::Get(self)->OnLoadEnd(
      CefBrowserCToCpp::Wrap(browser),
      CefFrameCToCpp::Wrap(frame),
      httpStatusCode);
}

void CEF_CALLBACK load_handler_on_load_error(struct _cef_load_handler_t* self,
    cef_browser_t* browser, cef_frame_t* frame, cef_errorcode_t errorCode,
    const cef_string_t* errorText, const cef_string_t* failedUrl) {
  // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING

  DCHECK(self);
  if (!self)
    return;
  // Verify param: browser; type: refptr_diff
  DCHECK(browser);
  if (!browser)
    return;
  // Verify param: frame; type: refptr_diff
  DCHECK(frame);
  if (!frame)
    return;
  // Verify param: failedUrl; type: string_byref_const
  DCHECK(failedUrl);
  if (!failedUrl)
    return;
  // Unverified params: errorText

  // Execute
  CefLoadHandlerCppToC::Get(self)->OnLoadError(
      CefBrowserCToCpp::Wrap(browser),
      CefFrameCToCpp::Wrap(frame),
      errorCode,
      CefString(errorText),
      CefString(failedUrl));
}

}  // namespace

// CONSTRUCTOR - Do not edit by hand.

CefLoadHandlerCppToC::CefLoadHandlerCppToC() {
  GetStruct()->on_loading_state_change = load_handler_on_loading_state_change;
  GetStruct()->on_load_start = load_handler_on_load_start;
  GetStruct()->on_load_end = load_handler_on_load_end;
  GetStruct()->on_load_error = load_handler_on_load_error;
}

template<> CefRefPtr<CefLoadHandler> CefCppToC<CefLoadHandlerCppToC,
    CefLoadHandler, cef_load_handler_t>::UnwrapDerived(CefWrapperType type,
    cef_load_handler_t* s) {
  NOTREACHED() << "Unexpected class type: " << type;
  return NULL;
}

#ifndef NDEBUG
template<> base::AtomicRefCount CefCppToC<CefLoadHandlerCppToC, CefLoadHandler,
    cef_load_handler_t>::DebugObjCt = 0;
#endif

template<> CefWrapperType CefCppToC<CefLoadHandlerCppToC, CefLoadHandler,
    cef_load_handler_t>::kWrapperType = WT_LOAD_HANDLER;

redpajama_set_name: RedPajamaGithub


text:
<?php
/**
 * Wrapper class containing various request-specific objects.
 * Each of these objects is created only once for the context.
 * The creation happends on-demand and is put in a private cache.
 *
 * @author Timo Tijhof, 2012-2013
 * @since 1.0.0
 * @package TestSwarm
 */
class TestSwarmContext {
	protected $browserInfo, $conf, $db, $request, $auth, $versionInfo;

	/**
	 * The context is self-initializing. The only thing it needs to be passed is
	 * an object with all setting keys from testswarm-defaults.json. Logic for
	 * loading defaults and overriding with local settings is in inc/init.php
	 * @param $config
	 */
	public function __construct( stdClass $config ) {
		$this->conf = $config;
	}

	public function getBrowserInfo() {
		if ( $this->browserInfo === null ) {
			$ua = isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : '-';
			$this->browserInfo = BrowserInfo::newFromContext( $this, $ua );
		}
		return $this->browserInfo;
	}

	/**
	 * Get the configuration object
	 * @return stdClass
	 */
	public function getConf() {
		return $this->conf;
	}

	/**
	 * Get the Database object
	 * @return Database
	 */
	public function getDB() {
		if ( $this->db === null ) {
			// Check if there is a database lock
			$lock = $this->dbLock();
			if ( $lock ) {
				throw new SwarmException(
					'Database is temporarily locked for maintenance (since: '
					. strftime( '%c', $lock ) . ')'
				);
			}
			$this->db = Database::newFromContext( $this );
		}
		return $this->db;
	}

	/**
	 * Get and set the lock status.
	 * @param $change bool: [optional] Change the lock state.
	 * @return bool|int Boolean false or a timestamp of when the lock was set.
	 */
	public function dbLock( $change = null ) {
		$dbLockFile = $this->getConf()->storage->cacheDir . '/database.lock';
		$dbLocktime = false;
		if ( is_bool( $change ) ) {
			if ( $change ) {
				$done = @touch( $dbLockFile );
			} else {
				$done = @unlink( $dbLockFile );
			}
			if ( !$done ) {
				throw new SwarmException( 'Unable to change database.lock' );
			}
		}
		if ( file_exists( $dbLockFile ) ) {
			$dbLocktime = @filemtime( $dbLockFile );
		}
		return $dbLocktime;
	}

	/**
	 * Get the WebRequest object
	 * @return WebRequest
	 */
	public function getRequest() {
		if ( $this->request === null ) {
			$this->request = WebRequest::newFromContext( $this );
		}
		return $this->request;
	}

	/**
	 * Get the authentication object.
	 * This logic used to be in init.php and accessed in other files directly
	 * from the session. However since initialisation of the session can sometimes
	 * only be determined after the context is created (see api.php), we need to
	 * defer it to here where we lazy-init the object. Another reason is security
	 * (see github.com/jquery/testswarm/issues/181), we need to invalidate the
	 * session if we detect it is no longer up to date with the corresponding
	 * account in the database (which we can only access after init).
	 * @return object|false
	 */
	public function getAuth() {
		if ( $this->auth === null ) {
			$request = $this->getRequest();

			$auth = $request->getSessionData( 'auth' );
			if ( !$auth ) {
				return $this->flushAuth();
			}

			// Invalidate session if it is malformed (different structure)
			if ( !isset( $auth->project ) || !is_object( $auth->project ) ) {
				return $this->flushAuth();
			}

			// Invalidate session if it is outdated (password changed, project deleted, ..)
			$projectRow = $this->getDB()->getRow(str_queryf(
				'SELECT
					auth_token,
					updated
				FROM projects
				WHERE id = %s',
				$auth->project->id
			));
			if ( $auth->project->auth_token !== $projectRow->auth_token || $auth->project->updated !== $projectRow->updated ) {
				return $this->flushAuth();
			}
			// Valid!
			$this->auth = $auth;
		}
		return $this->auth;
	}

	public function flushAuth() {
		$this->getRequest()->setSessionData( 'auth', null );
		$this->auth = false;
		return $this->auth;
	}

	public function createDerivedRequestContext( Array $query = array(), $method = 'GET' ) {
		$derivContext = clone $this;

		$req = DerivativeWebRequest::newFromContext( $derivContext );
		$req->setRawQuery( $query );
		$req->setWasPosted( $method === 'POST' );

		$derivContext->request = $req;
		return $derivContext;
	}

	/**
	 * Get the current TestSwarm version (cached for 5 minutes).
	 *
	 * @param $options string|array: 'bypass-cache'
	 * @return array (see also calculateVersionInfo)
	 */
	public function getVersionInfo( $options = array() ) {
		$options = (array)$options;

		if ( in_array( 'bypass-cache', $options ) ) {
			return $this->calculateVersionInfo();
		}

		// Cache within the class, never calculate more than once per request
		if ( $this->versionInfo !== null ) {
			return $this->versionInfo;
		}

		// Deal with cache expiration
		$versionCacheFile = $this->getConf()->storage->cacheDir . '/version_info.json';
		if ( is_readable( $versionCacheFile ) ) {
			$versionCacheFileUpdated = filemtime( $versionCacheFile );
			if ( $versionCacheFileUpdated < strtotime( '5 minutes ago' ) ) {
				unlink( $versionCacheFile );
			}
		}

		// If cache file (still) exists it means we can use it
		if ( is_readable( $versionCacheFile ) ) {
			$this->versionInfo = json_decode( file_get_contents( $versionCacheFile ), /*assoc=*/true );
			return $this->versionInfo;
		}

		// Calculate it and populate the class cache and file cache
		$this->versionInfo = $this->calculateVersionInfo();
		$isWritten = file_put_contents( $versionCacheFile, json_encode( $this->versionInfo ) );
		if ( $isWritten === false ) {
			throw new SwarmException( 'Writing to cache directory failed.' );
		}

		return $this->versionInfo;
	}

	/**
	 * Compute the version of this TestSwarm install, including the Git hash
	 * if the installation directory contains a git repository.
	 * @since 1.0.0
	 *
	 * @return array
	 */
	protected function calculateVersionInfo() {
		global $swarmInstallDir;

		$baseVersionFile = "$swarmInstallDir/config/version.ini";
		if ( !is_readable( $baseVersionFile ) ) {
			throw new SwarmException( 'version.ini is missing or unreadable.' );
		}

		$swarmVersion = trim( file_get_contents( $baseVersionFile ) );
		$devInfo = null;

		// If this is a git repository, get a hold of the HEAD SHA1 hash as well,
		// and append it to the version.
		$gitHeadFile = "$swarmInstallDir/.git/HEAD";
		if ( is_readable( $gitHeadFile ) ) {
			// Get HEAD
			$gitHeadFileCnt = file_get_contents( $gitHeadFile );
			if ( preg_match( '/ref: (.*)/', $gitHeadFileCnt, $matches ) ) {
				$gitHead = trim( $matches[1] );
			} else {
				$gitHead = trim( $gitHeadFileCnt );
			}

			// Get current branch
			if ( $gitHead && preg_match( "#^refs/heads/(.*)$#", $gitHead, $m ) ) {
				// If it is a simple head, only return the heads name
				$gitBranch = $m[1];
			} else {
				// Otherwise it is something else, for which we'll show the full name
				$gitBranch = $gitHead;
			}

			// Get SHA1
			$gitRefFile = "$swarmInstallDir/.git/$gitHead";
			if ( is_readable( $gitRefFile ) ) {
				$gitSHA1 = trim( file_get_contents( $gitRefFile ) );
			} else {
				// If such refs file doesn't exist, HEAD is detached,
				// in which case ./.git/HEAD contains the SHA1 directly.
				$gitSHA1 = $gitHead;
				$gitBranch = '(no branch)';
			}

			$devInfo = array(
				'branch' => $gitBranch,
				'SHA1' => $gitSHA1,
			);
		}

		return array(
			'TestSwarm' => $swarmVersion,
			'devInfo' => $devInfo,
		);
	}
}


text:
<!DOCTYPE html>

    <title>viewScroller</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <link rel="stylesheet" href="../normalize.css"/>
    <link rel="stylesheet" href="../demo.css"/>

singlePage By liyu365

        View on GitHub
        Download

Hello!
Everyone.

This's
a
demo.

View on GitHub

your page footer


text:
package org.apache.click.examples.domain;

import org.apache.click.examples.domain.auto._PostCode;

/**
 * Provides an Client entity class.
 */
public class PostCode extends _PostCode {

    private static final long serialVersionUID = 1L;

}


text:
import django.db.models.deletion
import django.utils.timezone
from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [
        ("zerver", "0230_rename_to_enable_stream_audible_notifications"),
    ]

    operations = [
        migrations.CreateModel(
            name="ArchiveTransaction",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
                    ),
                ),
                (
                    "timestamp",
                    models.DateTimeField(db_index=True, default=django.utils.timezone.now),
                ),
                ("restored", models.BooleanField(db_index=True, default=False)),
                ("type", models.PositiveSmallIntegerField(db_index=True)),
                (
                    "realm",
                    models.ForeignKey(
                        null=True, on_delete=django.db.models.deletion.CASCADE, to="zerver.Realm"
                    ),
                ),
            ],
        ),
        migrations.RemoveField(
            model_name="archivedattachment",
            name="archive_timestamp",
        ),
        migrations.RemoveField(
            model_name="archivedmessage",
            name="archive_timestamp",
        ),
        migrations.RemoveField(
            model_name="archivedreaction",
            name="archive_timestamp",
        ),
        migrations.RemoveField(
            model_name="archivedsubmessage",
            name="archive_timestamp",
        ),
        migrations.RemoveField(
            model_name="archivedusermessage",
            name="archive_timestamp",
        ),
        migrations.AddField(
            model_name="archivedmessage",
            name="archive_transaction",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to="zerver.ArchiveTransaction",
            ),
        ),
    ]


text:
package ru.job4j.ilya;

/**
 * Created by Lenovo2 on 02.11.2017.
 */
public class Task extends Item {
    public Task(String name, String desc) {
        this.name = name;
        this.description = desc;
    }

}


text:
layout: post
title:  "Google's Foo Bar Challenge"
date:   2016-12-19
excerpt: "My current responses to the famous hiring challenge."
tags: [foo bar]
comments: false
---
## Testing

About a month ago, I got a strange message after some search queries. My lack of understanding of Python iterators led me to a message popping up on my screen, asking if I was interested in a challege.

<figure>
	<img src="../assets/ui/foobar.png">
</figure>

The infamous foo bar challenge, a collection of challenges that are used as a way of finding employees. I am currently on level three of the challenge, and will update repeatedly as my progress continues. I will post solutions once I am able to submit my answers after level four, but if you are interested in some of the problems (and solutions) feel free to email me.


text:
package org.imsglobal.lti2.objects.consumer;

import org.imsglobal.lti2.LTI2Config;

import java.util.HashMap;
import java.util.Map;
import javax.annotation.Generated;
import org.codehaus.jackson.annotate.JsonAnyGetter;
import org.codehaus.jackson.annotate.JsonAnySetter;
import org.codehaus.jackson.annotate.JsonProperty;
import org.codehaus.jackson.annotate.JsonPropertyOrder;
import org.codehaus.jackson.map.annotate.JsonSerialize;

@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
@Generated("com.googlecode.jsonschema2pojo")
@JsonPropertyOrder({
    "@id",
    "service_owner_name",
    "description",
    "timestamp",
    "support"
})
public class ServiceOwner {

    @JsonProperty("@id")
    private String _id;
    @JsonProperty("service_owner_name")
    private ServiceOwnerName service_owner_name;
    @JsonProperty("description")
    private Description description;
    @JsonProperty("timestamp")
    private String timestamp;
    @JsonProperty("support")
    private Support support;
    private Map<String, Object> additionalProperties = new HashMap<String, Object>();

    public ServiceOwner(LTI2Config cnf) {
        this._id = cnf.getService_owner_id();
        this.service_owner_name = new ServiceOwnerName(cnf.getService_owner_owner_name());
        this.description = new Description(cnf.getService_owner_description());
        this.support = new Support(cnf.getService_owner_support_email());
    }

    public ServiceOwner() {
    }

    @JsonProperty("@id")
    public String get_id() {
        return _id;
    }

    @JsonProperty("@id")
    public void set_id(String _id) {
        this._id = _id;
    }

    @JsonProperty("service_owner_name")
    public ServiceOwnerName getService_owner_name() {
        return service_owner_name;
    }

    @JsonProperty("service_owner_name")
    public void setService_name(ServiceOwnerName service_owner_name) {
        this.service_owner_name = service_owner_name;
    }

    @JsonProperty("description")
    public Description getDescription() {
        return description;
    }

    @JsonProperty("description")
    public void setDescription(Description description) {
        this.description = description;
    }

    @JsonProperty("timestamp")
    public String getTimestamp() {
        return timestamp;
    }

    @JsonProperty("timestamp")
    public void setTimestamp(String timestamp) {
        this.timestamp = timestamp;
    }

    @JsonProperty("support")
    public Support getSupport() {
        return support;
    }

    @JsonProperty("support")
    public void setSupport(Support support) {
        this.support = support;
    }

    @JsonAnyGetter
    public Map<String, Object> getAdditionalProperties() {
        return this.additionalProperties;
    }

    @JsonAnySetter
    public void setAdditionalProperties(String name, Object value) {
        this.additionalProperties.put(name, value);
    }

}


text:
import {createSelector} from "reselect";

/**
 * Direct selector to the header state domain
 */
const selectHeaderDomain = () => state => state.get('header');

/**
 * Other specific selectors
 */

/**
 * Default selector used by Header
 */

const selectHeader = () => createSelector(
    selectHeaderDomain(),
    (substate) => substate
);

export default selectHeader;
export {
    selectHeaderDomain,
};


text:
{{ post.title }}

{{ post.date | date }}

{{ post.content }}

            <ux-checkbox>Archive post</ux-checkbox>


text:
#ifndef KYTHE_CXX_INDEXER_CXX_INDEXED_PARENT_ITERATOR_H_
#define KYTHE_CXX_INDEXER_CXX_INDEXED_PARENT_ITERATOR_H_

#include <iterator>

#include "absl/types/optional.h"
#include "clang/AST/ASTTypeTraits.h"
#include "clang/AST/Decl.h"
#include "indexed_parent_map.h"

namespace kythe {

// Range class for a traversal from the given Decl to the root.
class RootTraversal {
 public:
  // Type containing the values used during root traversal iterator.
  struct value_type {
    // The current node in the traversal.
    clang::ast_type_traits::DynTypedNode node;
    // A pointer to the `clang::Decl` of the node, if any.
    const clang::Decl* decl;
    // A pointer to the IndexedParent of the current node, if any.
    // This will be next current node.
    const IndexedParent* indexed_parent;

    // The values are EqComparable and only care about node.
    bool operator==(const value_type& rhs) const { return node == rhs.node; }
    bool operator!=(const value_type& rhs) const { return !(*this == rhs); }
  };

  // Root iteration state, modeling standard iterators in all their awkwardness.
  class iterator : public std::iterator<std::forward_iterator_tag, value_type,
                                        std::ptrdiff_t, const value_type*,
                                        const value_type&> {
   public:
    iterator() = default;
    reference operator*() const { return *current_; }
    bool operator==(const iterator& rhs) const;
    bool operator!=(const iterator& rhs) const;
    iterator& operator++();
    iterator operator++(int);

   private:
    friend class RootTraversal;

    explicit iterator(const IndexedParentMap* parent_map,
                      clang::ast_type_traits::DynTypedNode node,
                      const clang::Decl* decl, const IndexedParent* parent)
        : parent_map_(parent_map), current_(value_type{node, decl, parent}) {
      // If we would be constructed from a TranslationUnitDecl, stop.
      if (decl && clang::isa<clang::TranslationUnitDecl>(decl)) {
        parent_map_ = nullptr;
        current_ = absl::nullopt;
      }
    }

    explicit iterator(const IndexedParentMap* parent_map,
                      clang::ast_type_traits::DynTypedNode node,
                      const clang::Decl* decl)
        : iterator(parent_map, node, decl, parent_map->GetIndexedParent(node)) {
    }

    explicit iterator(const IndexedParentMap* parent_map,
                      clang::ast_type_traits::DynTypedNode node)
        : iterator(parent_map, node, node.get<clang::Decl>()) {}

    explicit iterator(const IndexedParentMap* parent_map,
                      const clang::Decl* decl)
        : iterator(parent_map,
                   clang::ast_type_traits::DynTypedNode::create(*decl), decl) {}

    iterator next() const;
    void advance();

    const IndexedParentMap* parent_map_ = nullptr;
    absl::optional<value_type> current_ = absl::nullopt;
  };

  // Constructs a RootTraversal range over `parent_map` beginning at
  // the node indicated in `decl`.
  explicit RootTraversal(const IndexedParentMap* parent_map,
                         const clang::Decl* decl)
      : start_(parent_map, decl) {}

  // Constructs a RootTraversal range over `parent_map` beginning at
  // the node indicated in `stmt`.
  explicit RootTraversal(const IndexedParentMap* parent_map,
                         const clang::Stmt* stmt)
      : start_(parent_map,
               clang::ast_type_traits::DynTypedNode::create(*stmt)) {}

  iterator begin() const { return start_; }
  iterator end() const { return iterator(); }

 private:
  iterator start_;
};

inline bool RootTraversal::iterator::operator==(const iterator& rhs) const {
  return std::tie(parent_map_, current_) ==
         std::tie(rhs.parent_map_, rhs.current_);
}

inline bool RootTraversal::iterator::operator!=(const iterator& rhs) const {
  return !(*this == rhs);
}

}  // namespace kythe

#endif  // KYTHE_CXX_INDEXER_CXX_INDEXED_PARENT_ITERATOR_H_


text:
package com.google.security.zynamics.binnavi.Gui.MainWindow.ProjectTree.Nodes.Data.Component;

import com.google.common.base.Preconditions;
import com.google.security.zynamics.binnavi.Gui.Actions.CActionProxy;
import com.google.security.zynamics.binnavi.Gui.MainWindow.ProjectTree.Nodes.Views.Component.Actions.OpenInLastWindowAndZoomToAddressAction;
import com.google.security.zynamics.binnavi.disassembly.INaviModule;
import com.google.security.zynamics.binnavi.disassembly.types.Section;
import com.google.security.zynamics.binnavi.disassembly.types.TypeInstance;
import com.google.security.zynamics.binnavi.disassembly.types.TypeInstanceAddress;
import com.google.security.zynamics.binnavi.disassembly.types.TypeInstanceContainer;
import com.google.security.zynamics.binnavi.disassembly.types.TypeInstanceReference;
import com.google.security.zynamics.binnavi.disassembly.types.TypeManager;
import com.google.security.zynamics.binnavi.disassembly.views.INaviView;
import com.google.security.zynamics.binnavi.disassembly.views.IViewContainer;
import com.google.security.zynamics.binnavi.disassembly.views.IViewContainerListener;
import com.google.security.zynamics.zylib.general.ListenerProvider;
import com.google.security.zynamics.zylib.gui.CodeDisplay.CodeDisplay;
import com.google.security.zynamics.zylib.gui.CodeDisplay.CodeDisplayCoordinate;
import com.google.security.zynamics.zylib.gui.CodeDisplay.CodeDisplayEventListener;
import com.google.security.zynamics.zylib.gui.JHexPanel.IDataChangedListener;
import com.google.security.zynamics.zylib.gui.JHexPanel.IDataProvider;
import com.google.security.zynamics.zylib.gui.JHexPanel.IMenuCreator;
import com.google.security.zynamics.zylib.gui.JHexPanel.JHexView;
import com.google.security.zynamics.zylib.gui.JHexPanel.JHexView.DefinitionStatus;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;

import javax.swing.JCheckBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.SwingUtilities;
import javax.swing.border.TitledBorder;

/**
 * Provides a viewer for the sections list of a single module. This component contains a hex view to
 * display the raw bytes as well as a table which contains the corresponding type instances.
 */
public class DataSectionComponent extends JPanel {

  private static final int SELECTED_INSTANCE_HIGHLIGHT_LEVEL = 4;
  private static final int DEFAULT_INSTANCE_HIGHLIGHT_LEVEL = 5;

  // We need to declare these members as volatile since assignments can occur from an arbitrary
  // thread during module load.
  private volatile HexViewDataAdapter hexViewData;
  private volatile Section currentSection;
  private volatile SectionComboBox sections;
  private final JHexView hexView = new JHexView();
  private final INaviModule module;
  private JCheckBox virtualAddresses;
  private final IViewContainer container;
  private TypeInstanceAddressTableCellRenderer addressRenderer =
      new TypeInstanceAddressTableCellRenderer();

  private final IViewContainerListener internalViewContainerListener =
      new InternalViewContainerListener();

  private final TypeInstanceTableDatamodel typeDataModel;
  private final CodeDisplay typeDisplay;

  public DataSectionComponent(final INaviModule module, final IViewContainer container) {
    // TODO(jannewger): there should probably be a "data provider" argument to
    // the constructor: if we use this component while debugging, we need a
    // different implementation than if we are viewing static section content!
    // For now we only deal with static section data via HexViewDataAdapter.
    super(new BorderLayout(5, 5));
    this.module = Preconditions.checkNotNull(module, "Error: module argument can not be null");
    this.container = Preconditions.checkNotNull(container, "Error: type argument can not be null");
    this.container.addListener(internalViewContainerListener);

    hexView.setDefinitionStatus(DefinitionStatus.DEFINED);
    hexView.setEnabled(true);
    hexView.setMenuCreator(new TypeInstanceMenu());
    // Note: We need to account for the fact that this component is created
    // prior to the module being loaded. Thus, we need to fill the models of the
    // hexview and table component later in moduleLoaded().

    typeDataModel = new TypeInstanceTableDatamodel();
    typeDisplay = new CodeDisplay(typeDataModel);
    // Register the JCodeDisplay with the typeDataModel so that it can be refreshed when the
    // underlying data changes ansynchronously.
    typeDataModel.registerCodeDisplayToUpdate(typeDisplay);

    // Register a custom Mouselistener for the typeDisplays so that a popup can be displayed.
    typeDisplay.addMouseListener(new TypeInstanceTableMouseListener());
    typeDisplay.addCaretChangedListener(new InstancesTableSelectionListener());
    add(typeDisplay, BorderLayout.CENTER);

    final JPanel panel = createOptionsPanel();
    add(panel, BorderLayout.NORTH);
    add(hexView, BorderLayout.WEST);

    addressRenderer = new TypeInstanceAddressTableCellRenderer();
  }

  /**
   * This function initializes the highlighting for a {@link JHexView hex view} given the
   * {@link TypeInstance type instances} of a {@link Section section}.
   *
   * @param hexView The {@link JHexView} in which the highlighting will be set.
   * @param useVirtualAddresses Determines whether to the hex view should use virtual addresses or
   *        offsets.
   * @param instances The {@link TypeInstance type instances} for which to set the highlighting.
   */
  private static void initializeHighlighting(final JHexView hexView,
      final boolean useVirtualAddresses, final Collection<TypeInstance> instances) {
    hexView.uncolorizeAll(DEFAULT_INSTANCE_HIGHLIGHT_LEVEL);
    for (final TypeInstance instance : instances) {
      hexView.colorize(DEFAULT_INSTANCE_HIGHLIGHT_LEVEL,
          useVirtualAddresses ? instance.getAddress().getVirtualAddress()
              : instance.getAddress().getOffset(), instance.getBaseType().getByteSize(),
          Color.BLACK, Color.YELLOW);
    }
  }

  private final JPanel createOptionsPanel() {
    final JPanel optionsPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
    optionsPanel.setBorder(new TitledBorder("Options"));
    optionsPanel.add(createVirtualAddressCheckBox());
    optionsPanel.add(createSectionSelectionPanel());
    return optionsPanel;
  }

  private final JPanel createSectionSelectionPanel() {
    final JPanel section_panel = new JPanel();
    final JLabel lblSection = new JLabel("Section:");
    section_panel.add(lblSection);
    sections = new SectionComboBox();
    section_panel.add(sections);
    sections.addActionListener(new SectionSelectedListener());
    return section_panel;
  }

  private final JCheckBox createVirtualAddressCheckBox() {
    virtualAddresses = new JCheckBox("Show Virtual Addresses");
    virtualAddresses.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(final ActionEvent e) {
        if (virtualAddresses.isSelected()) {
          hexView.setBaseAddress(currentSection.getStartAddress().toLong());
          addressRenderer.showVirtualAddress(true);
        } else {
          hexView.setBaseAddress(0);
          addressRenderer.showVirtualAddress(false);
        }
        initializeHighlighting(hexView, virtualAddresses.isSelected(),
            module.getContent().getTypeInstanceContainer().getTypeInstances(currentSection));
      }
    });
    return virtualAddresses;
  }

  private void highlightType(final int row) {
    final TypeInstance instance = typeDataModel.getTypeAtRow(row);
    hexView.uncolorizeAll(SELECTED_INSTANCE_HIGHLIGHT_LEVEL);
    hexView.colorize(SELECTED_INSTANCE_HIGHLIGHT_LEVEL,
        instance.getAddress().getOffset() + hexView.getBaseAddress(),
        instance.getBaseType().getByteSize(), Color.GREEN, Color.BLACK);
    hexView.gotoOffset(instance.getAddress().getOffset() + hexView.getBaseAddress());
  }

  /**
   * Once the module is loaded, we can fill the component models.
   *
   *  Note that this method may be invoked from an arbitrary thread during module loading. Thus, the
   * members that are assigned in this method are declared as volatile.
   */
  private void moduleLoaded() {
    final List<Section> sectionList = module.getContent().getSections().getSections();
    if (sectionList.isEmpty()) {
      return;
    }
    currentSection = sectionList.get(0);
    hexViewData = new HexViewDataAdapter(currentSection);
    hexView.setData(hexViewData);
    final Collection<TypeInstance> instances =
        module.getContent().getTypeInstanceContainer().getTypeInstances(currentSection);
    initializeHighlighting(hexView, virtualAddresses.isSelected(), instances);
    sections.setSections(sectionList);

    typeDataModel.setTypeInstanceContainer(module.getContent().getTypeInstanceContainer());
    typeDataModel.setSection(currentSection);
  }

  private void sectionChanged(final Section section) {
    // Note: no listener concept here because a) there is exactly one event, and b) there are only
    // two consumers. Will probably change once we have debugger support!
    currentSection = section;
    hexViewData.setActiveSection(section);
    typeDataModel.setSection(section);
    initializeHighlighting(hexView, virtualAddresses.isSelected(),
        module.getContent().getTypeInstanceContainer().getTypeInstances(section));
  }

  public JHexView getHexView() {
    return hexView;
  }

  /**
   * Scrolls the instance table to the given instance and selects the corresponding section in the
   * combobox.
   *
   * @param instance The instance to scroll to.
   */
  public void scrollToInstance(final TypeInstance instance) {
    // TODO(thomasdullien): Implement this again.
  }

  /**
   * Selects the given section and scrolls the hex view component to the given address.
   *
   * @param section The section to select.
   * @param address The address to scroll to.
   */
  public void scrollToSectionAddress(final Section section, final long address) {
    sections.setSelectedItem(section);
    hexView.gotoOffset(address - section.getStartAddress().toLong());
  }

  /**
   * Uses a section instance to obtain the corresponding data and provides it to the hex view
   * component.
   */
  private class HexViewDataAdapter implements IDataProvider {
    private final ListenerProvider<IDataChangedListener> listeners =
        new ListenerProvider<IDataChangedListener>();
    private Section activeSection;

    public HexViewDataAdapter(final Section currentSection) {
      this.activeSection = currentSection;
    }

    @Override
    public void addListener(final IDataChangedListener hexView) {
      listeners.addListener(hexView);
    }

    @Override
    public byte[] getData() {
      return activeSection.getData();
    }

    @Override
    public byte[] getData(final long offset, final int length) {
      return Arrays.copyOfRange(getData(), (int) (offset - hexView.getBaseAddress()),
          (int) (offset - hexView.getBaseAddress() + length));
    }

    @Override
    public int getDataLength() {
      return activeSection.getRawSize();
    }

    @Override
    public boolean hasData(final long start, final int length) {
      return (start - hexView.getBaseAddress() + length) <= getDataLength();
    }

    @Override
    public boolean isEditable() {
      return false;
    }

    @Override
    public boolean keepTrying() {
      return true;
    }

    @Override
    public void removeListener(final IDataChangedListener listener) {
      listeners.removeListener(listener);
    }

    public void setActiveSection(final Section section) {
      activeSection = section;
      for (final IDataChangedListener listener : listeners) {
        listener.dataChanged();
      }
    }

    @Override
    public void setData(final long offset, final byte[] data) {}
  }

  /**
   * Listens on selection changed events in the type instance table and forwards them to the data
   * section component.
   */
  private class InstancesTableSelectionListener implements CodeDisplayEventListener {
    @Override
    public void caretChanged(final CodeDisplayCoordinate caret) {
      highlightType(caret.getRow());
    }
  }

  private class InternalViewContainerListener implements IViewContainerListener {

    @Override
    public void addedView(final IViewContainer container, final INaviView view) {}

    @Override
    public void closedContainer(final IViewContainer container, final List<INaviView> views) {}

    @Override
    public void deletedView(final IViewContainer container, final INaviView view) {}

    @Override
    public void loaded(final IViewContainer container) {
      if (container.getModules().contains(module)) {
        moduleLoaded();
      }
    }
  }

  /**
   * Listens for section selection events and forwards them to the data section component.
   */
  private class SectionSelectedListener implements ActionListener {
    @Override
    public void actionPerformed(final ActionEvent e) {
      final SectionComboBox comboBox = (SectionComboBox) e.getSource();
      final Section section = (Section) comboBox.getSelectedItem();
      sectionChanged(section);
    }
  }

  /**
   * Creates a context menu for the hex view component in order to create a new type instance.
   */
  private class TypeInstanceMenu implements IMenuCreator {

    @Override
    public JPopupMenu createMenu(final long offset) {
      final JPopupMenu popupMenu = new JPopupMenu();
      final TypeInstanceContainer instanceContainer =
          module.getContent().getTypeInstanceContainer();
      final TypeInstance existingInstance = instanceContainer.getTypeInstance(
          new TypeInstanceAddress(currentSection.getStartAddress(), offset));
      if (existingInstance != null) {
        popupMenu.add(new EditTypeInstanceAction(
            (JFrame) SwingUtilities.getAncestorOfClass(JFrame.class, DataSectionComponent.this),
            module.getTypeManager(), existingInstance, instanceContainer));
      } else {
        popupMenu.add(new CreateTypeInstanceAction(
            (JFrame) SwingUtilities.getAncestorOfClass(JFrame.class, DataSectionComponent.this),
            instanceContainer, module.getTypeManager(), currentSection, offset));
      }
      popupMenu.addSeparator();
      popupMenu.add(HexViewOptionsMenu.createHexViewOptionsMenu(hexView));
      return popupMenu;
    }
  }

  /**
   * Creates a context menu for the type instance table in order to create, edit or delete
   * {@link TypeInstance} objects.
   */
  private class TypeInstanceTableMouseListener extends MouseAdapter {

    private void handleClick(final MouseEvent event) {
      final int row = typeDisplay.rowAtPoint(event.getPoint());
      if (event.isPopupTrigger()) {
        showPopupMenu(row, event);
      }
    }

    private void showPopupMenu(final int rowIndex, final MouseEvent event) {
      final JPopupMenu popupMenu = new JPopupMenu();
      final JFrame owner =
          (JFrame) SwingUtilities.getAncestorOfClass(JFrame.class, DataSectionComponent.this);
      final TypeInstanceContainer instanceContainer =
          module.getContent().getTypeInstanceContainer();
      final TypeManager typeManager = module.getTypeManager();
      popupMenu.add(
          new CreateTypeInstanceAction(owner, instanceContainer, typeManager, currentSection));
      if (rowIndex != -1) {
        final TypeInstance existingInstance = typeDataModel.getTypeAtRow(rowIndex);
        popupMenu.add(
            new EditTypeInstanceAction(owner, typeManager, existingInstance, instanceContainer));
        popupMenu.add(new DeleteTypeInstanceAction(owner, existingInstance, instanceContainer));
      }
      popupMenu.show(event.getComponent(), event.getX(), event.getY());
    }

    @Override
    public void mouseClicked(final MouseEvent event) {
      if (event.getClickCount() == 2 && (event.getButton() == MouseEvent.BUTTON1) && (
          typeDisplay.columnAtPoint(event.getPoint()) == TypeInstanceTableDatamodel.XREFS_INDEX)) {
        final int row = typeDisplay.rowAtPoint(event.getPoint());
        final int line = typeDisplay.lineAtPoint(event.getPoint());
        final TypeInstanceReference reference = typeDataModel.getTypeInstanceReference(row, line);
        if (reference == null) {
          return;
        }
        final JFrame owner =
            (JFrame) SwingUtilities.getAncestorOfClass(JFrame.class, DataSectionComponent.this);
        final javax.swing.Action actionProxy =
            CActionProxy.proxy(new OpenInLastWindowAndZoomToAddressAction(owner, container,
                new INaviView[] {reference.getView()}, reference));
        actionProxy.actionPerformed(null);
      }
    }

    @Override
    public void mousePressed(final MouseEvent event) {
      handleClick(event);
    }

    @Override
    public void mouseReleased(final MouseEvent event) {
      handleClick(event);
    }
  }
}


text:
class CÃÜÂëѧ¿Î³ÌÉè¼ÆDlg : public CDialogEx
{
// ¹¹Ôì
public:
	CÃÜÂëѧ¿Î³ÌÉè¼ÆDlg(CWnd* pParent = NULL);	// ±ê×¼¹¹Ô캯Êý

// ¶Ô»°¿òÊý¾Ý
	enum { IDD = IDD_MY_DIALOG };

	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV Ö§³Ö

// ʵÏÖ
protected:
	HICON m_hIcon;

	// Éú³ÉµÄÏûÏ¢Ó³É亯Êý
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnBnClickedButton1();
	CEdit shuifilename;
	afx_msg void OnBnClickedButton2();
	afx_msg void OnBnClickedButton3();
	afx_msg void OnBnClickedButton4();
	afx_msg void OnBnClickedButton5();
	afx_msg void OnBnClickedButton6();
	afx_msg void OnBnClickedButton7();
	afx_msg void OnBnClickedButton8();
	afx_msg void OnBnClickedButton9();
	afx_msg void OnBnClickedButton10();
//	CEdit ckey;
};


text:
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2015 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#if defined(HAVE_CONFIG_H)
#include "config/etp-config.h"
#endif

#include "tinyformat.h"
#include "utiltime.h"

#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/thread.hpp>

using namespace std;

static int64_t nMockTime = 0;  //! For unit testing

int64_t GetTime()
{
    if (nMockTime) return nMockTime;

    time_t now = time(NULL);
    assert(now > 0);
    return now;
}

void SetMockTime(int64_t nMockTimeIn)
{
    nMockTime = nMockTimeIn;
}

int64_t GetTimeMillis()
{
    int64_t now = (boost::posix_time::microsec_clock::universal_time() -
                   boost::posix_time::ptime(boost::gregorian::date(1970,1,1))).total_milliseconds();
    assert(now > 0);
    return now;
}

int64_t GetTimeMicros()
{
    int64_t now = (boost::posix_time::microsec_clock::universal_time() -
                   boost::posix_time::ptime(boost::gregorian::date(1970,1,1))).total_microseconds();
    assert(now > 0);
    return now;
}

/** Return a time useful for the debug log */
int64_t GetLogTimeMicros()
{
    if (nMockTime) return nMockTime*1000000;

    return GetTimeMicros();
}

void MilliSleep(int64_t n)
{

/**
 * Boost's sleep_for was uninterruptable when backed by nanosleep from 1.50
 * until fixed in 1.52. Use the deprecated sleep method for the broken case.
 * See: https://svn.boost.org/trac/boost/ticket/7238
 */
#if defined(HAVE_WORKING_BOOST_SLEEP_FOR)
    boost::this_thread::sleep_for(boost::chrono::milliseconds(n));
#elif defined(HAVE_WORKING_BOOST_SLEEP)
    boost::this_thread::sleep(boost::posix_time::milliseconds(n));
#else
//should never get here
#error missing boost sleep implementation
#endif
}

std::string DateTimeStrFormat(const char* pszFormat, int64_t nTime)
{
    // std::locale takes ownership of the pointer
    std::locale loc(std::locale::classic(), new boost::posix_time::time_facet(pszFormat));
    std::stringstream ss;
    ss.imbue(loc);
    ss << boost::posix_time::from_time_t(nTime);
    return ss.str();
}

std::string DurationToDHMS(int64_t nDurationTime)
{
    int seconds = nDurationTime % 60;
    nDurationTime /= 60;
    int minutes = nDurationTime % 60;
    nDurationTime /= 60;
    int hours = nDurationTime % 24;
    int days = nDurationTime / 24;
    if(days)
        return strprintf("%dd %02dh:%02dm:%02ds", days, hours, minutes, seconds);
    if(hours)
        return strprintf("%02dh:%02dm:%02ds", hours, minutes, seconds);
    return strprintf("%02dm:%02ds", minutes, seconds);
}


text:
package ca.uhn.fhir.jpa.entity;

import java.io.Serializable;

import javax.persistence.*;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

@Entity
@Table(name = "HFJ_RES_PARAM_PRESENT", indexes = {
		@Index(name = "IDX_RESPARMPRESENT_RESID", columnList = "RES_ID")
}, uniqueConstraints = {
		@UniqueConstraint(name = "IDX_RESPARMPRESENT_SPID_RESID", columnNames = { "SP_ID", "RES_ID" })
})
public class SearchParamPresent implements Serializable {

	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name = "SEQ_RESPARMPRESENT_ID", sequenceName = "SEQ_RESPARMPRESENT_ID")
	@GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ_RESPARMPRESENT_ID")
	@Column(name = "PID")
	private Long myId;

	@Column(name = "SP_PRESENT", nullable = false)
	private boolean myPresent;

	@ManyToOne()
	@JoinColumn(name = "RES_ID", referencedColumnName = "RES_ID", nullable = false, foreignKey = @ForeignKey(name = "FK_RESPARMPRES_RESID"))
	private ResourceTable myResource;

	@ManyToOne()
	@JoinColumn(name = "SP_ID", referencedColumnName = "PID", nullable = false, foreignKey = @ForeignKey(name = "FK_RESPARMPRES_SPID"))
	private SearchParam mySearchParam;

	/**
	 * Constructor
	 */
	public SearchParamPresent() {
		super();
	}

	public ResourceTable getResource() {
		return myResource;
	}

	public SearchParam getSearchParam() {
		return mySearchParam;
	}

	public boolean isPresent() {
		return myPresent;
	}

	public void setPresent(boolean thePresent) {
		myPresent = thePresent;
	}

	public void setResource(ResourceTable theResourceTable) {
		myResource = theResourceTable;
	}

	public void setSearchParam(SearchParam theSearchParam) {
		mySearchParam = theSearchParam;
	}

	@Override
	public String toString() {
		ToStringBuilder b = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE);

		b.append("res_pid", myResource.getIdDt().toUnqualifiedVersionless().getValue());
		b.append("param", mySearchParam.getParamName());
		b.append("present", myPresent);
		return b.build();
	}

}


text:
class CommentMailer < ActionMailer::Base
  include ActionView::Helpers::TextHelper
  helper CommentsHelper

  default from: Shuttle::Configuration.mailer.from

  # Notifies everybody who is associated with this comment that a new comment is created.
  #
  # @param [Comment] comment The comment that is created.
  # @return [Mail::Message] The email to be delivered.

  def comment_created(comment)
    @comment = comment
    return if @comment.issue.subscribed_emails.empty?
    mail to: @comment.issue.subscribed_emails, subject: t('mailer.comment.comment_created.subject', name: @comment.user_name, content: truncate(@comment.content, length: 50, escape: false))
  end
end


text:
function runAtlasBalancingWithContactSensor(example_options)
if ~checkDependency('gurobi')
  warning('Must have gurobi installed to run this example');
  return;
end

path_handle = addpathTemporary(fullfile(getDrakePath(), 'examples', 'ZMP'));
import atlasControllers.*;

% put robot in a random x,y,yaw position and balance for 2 seconds
if nargin<1, example_options=struct(); end
example_options = applyDefaults(example_options, struct('use_mex', true, ...
                                                        'use_bullet', false,...
                                                        'visualize', true,...
                                                        'terrain', RigidBodyFlatTerrain));

% silence some warnings
warning('off','Drake:RigidBodyManipulator:UnsupportedContactPoints')
warning('off','Drake:RigidBodyManipulator:UnsupportedVelocityLimits')

options.floating = true;
options.ignore_self_collisions = true;
options.ignore_friction = true;
options.dt = 0.001;
options.use_new_kinsol = true;
options.terrain = example_options.terrain;
options.use_bullet = example_options.use_bullet;
options.use_mex = example_options.use_mex;
r = Atlas('urdf/atlas_minimal_contact.urdf',options);
r = r.removeCollisionGroupsExcept({'heel','toe'});
r = compile(r);

r_pure = r;
l_foot_body = findLinkId(r,'l_foot');
l_foot_frame = RigidBodyFrame(l_foot_body,zeros(3,1),zeros(3,1),'l_foot_forcetorque');
r = r.addFrame(l_foot_frame);
l_foot_force_sensor = ContactForceTorqueSensor(r, l_foot_frame);
r = addSensor(r, l_foot_force_sensor);
r_foot_body = findLinkId(r,'r_foot');
r_foot_frame = RigidBodyFrame(r_foot_body,zeros(3,1),zeros(3,1),'r_foot_forcetorque');
r = r.addFrame(r_foot_frame);
r_foot_force_sensor = ContactForceTorqueSensor(r, r_foot_frame);
r = addSensor(r, r_foot_force_sensor);

r = compile(r);

nq = getNumPositions(r);

% set initial state to fixed point
load('data/atlas_fp.mat');
xstar(1) = 0.1*randn();
xstar(2) = 0.1*randn();
xstar(6) = pi*randn();
initstate = zeros(r.getNumStates, 1);
initstate(1:length(xstar)) = xstar;
r = r.setInitialState(initstate);

x0 = xstar;
q0 = x0(1:nq);
kinsol = doKinematics(r,q0);

standing_plan = QPLocomotionPlanSettings.fromStandingState(x0, r);
% standing_plan.planned_support_command = QPControllerPlan.support_logic_maps.kinematic_or_sensed;

control = atlasControllers.InstantaneousQPController(r_pure, [], struct());
planeval = atlasControllers.AtlasPlanEval(r_pure, QPLocomotionPlanCPPWrapper(standing_plan));

plancontroller = atlasControllers.AtlasPlanEvalAndControlSystem(r_pure, control, planeval);

% Pass through outputs from robot
outs(1).system = 1;
outs(1).output = 1;
outs(2).system = 1;
outs(2).output = 2;
outs(3).system = 1;
outs(3).output = 3;
sys = mimoFeedback(r, plancontroller, [], [], [], outs);

if example_options.visualize
  v = r.constructVisualizer;
  v.display_dt = 0.01;
  S=warning('off','Drake:DrakeSystem:UnsupportedSampleTime');
  output_select(1).system=1;
  output_select(1).output=1;
  output_select(2).system=1;
  output_select(2).output=2;
  output_select(3).system=1;
  output_select(3).output=3;
  sys = mimoCascade(sys,v,[],[],output_select);
  warning(S);
end
x0 = initstate;
% x0(3) = 1.0; % drop it a bit

traj = simulate(sys,[0 2.0],x0);
if example_options.visualize
  playback(v,traj,struct('slider',true));
end

xf = traj.eval(traj.tspan(2));

err = norm(xf(1:6)-xstar(1:6))
if err > 0.02
  error('drakeBalancing unit test failed: error is too large');
end

end


text:
package com.balancedpayments;

import com.balancedpayments.errors.HTTPError;
import com.balancedpayments.errors.MultipleResultsFound;
import com.balancedpayments.errors.NoResultsFound;
import org.junit.Test;

import java.util.HashMap;
import java.util.Map;

import static org.junit.Assert.assertEquals;

public class AccountTest extends BaseTest {
    @Test
    public void testAccountTransfer() throws HTTPError, MultipleResultsFound,
            NoResultsFound {
        Customer merchant = createPersonCustomer();
        Account payableAccount = merchant.payableAccount();

        BankAccount ba = createBankAccount();
        ba.associateToCustomer(merchant);
        Order order = merchant.createOrder(null);
        Card card = createCard();

        Map<String, Object> debitPayload = new HashMap<String, Object>();
        debitPayload.put("description", "Debit for Order #234123");
        debitPayload.put("amount", 5000);

        order.debitFrom(card, debitPayload);
        order.reload();

        Map<String, Object> creditPayload = new HashMap<String, Object>();
        creditPayload.put("description", "Payout for Order #234123");
        creditPayload.put("amount", 5000);
        creditPayload.put("order", order.href);

        payableAccount.credit(creditPayload);
        payableAccount.reload();
        assertEquals(payableAccount.balance.intValue(), 5000);
    }
}


text:
<?php
class Mbemro_Autoexport_Model_Cron{
	public function autoexportrecords(){
		Mage::helper('autoexport')->doAutoExport();
	}
}


text:
#pragma once

#include <libmemcached/memcached_util.h>


text:
package org.apache.ignite.ml.math.decompositions;

import org.apache.ignite.ml.math.Destroyable;
import org.apache.ignite.ml.math.Matrix;
import org.apache.ignite.ml.math.Vector;
import org.apache.ignite.ml.math.exceptions.CardinalityException;
import org.apache.ignite.ml.math.exceptions.NonPositiveDefiniteMatrixException;
import org.apache.ignite.ml.math.exceptions.NonSymmetricMatrixException;

import static org.apache.ignite.ml.math.util.MatrixUtil.like;
import static org.apache.ignite.ml.math.util.MatrixUtil.likeVector;

/**
 * Calculates the Cholesky decomposition of a matrix.
 *

 * This class inspired by class from Apache Common Math with similar name.

 *
 * @see MathWorld
 * @see Wikipedia
 */
public class CholeskyDecomposition implements Destroyable {
    /**
     * Default threshold above which off-diagonal elements are considered too different
     * and matrix not symmetric.
     */
    public static final double DFLT_REL_SYMMETRY_THRESHOLD = 1.0e-15;

    /**
     * Default threshold below which diagonal elements are considered null
     * and matrix not positive definite.
     */
    public static final double DFLT_ABS_POSITIVITY_THRESHOLD = 1.0e-10;

    /** Row-oriented storage for LT matrix data. */
    private double[][] lTData;
    /** Cached value of L. */
    private Matrix cachedL;
    /** Cached value of LT. */
    private Matrix cachedLT;
    /** Origin matrix */
    private Matrix origin;

    /**
     * Calculates the Cholesky decomposition of the given matrix.
     *

     * Calling this constructor is equivalent to call {@link #CholeskyDecomposition(Matrix, double, double)} with the
     * thresholds set to the default values {@link #DFLT_REL_SYMMETRY_THRESHOLD} and
     * {@link #DFLT_ABS_POSITIVITY_THRESHOLD}.

     *
     * @param mtx the matrix to decompose.
     * @throws CardinalityException if matrix is not square.
     * @see #CholeskyDecomposition(Matrix, double, double)
     * @see #DFLT_REL_SYMMETRY_THRESHOLD
     * @see #DFLT_ABS_POSITIVITY_THRESHOLD
     */
    public CholeskyDecomposition(final Matrix mtx) {
        this(mtx, DFLT_REL_SYMMETRY_THRESHOLD, DFLT_ABS_POSITIVITY_THRESHOLD);
    }

    /**
     * Calculates the Cholesky decomposition of the given matrix.
     *
     * @param mtx the matrix to decompose.
     * @param relSymmetryThreshold threshold above which off-diagonal elements are considered too different and matrix
     * not symmetric
     * @param absPositivityThreshold threshold below which diagonal elements are considered null and matrix not positive
     * definite
     * @see #CholeskyDecomposition(Matrix)
     * @see #DFLT_REL_SYMMETRY_THRESHOLD
     * @see #DFLT_ABS_POSITIVITY_THRESHOLD
     */
    public CholeskyDecomposition(final Matrix mtx, final double relSymmetryThreshold,
        final double absPositivityThreshold) {
        assert mtx != null;

        if (mtx.columnSize() != mtx.rowSize())
            throw new CardinalityException(mtx.rowSize(), mtx.columnSize());

        origin = mtx;

        final int order = mtx.rowSize();

        lTData = toDoubleArr(mtx);
        cachedL = null;
        cachedLT = null;

        // Check the matrix before transformation.
        for (int i = 0; i < order; ++i) {
            final double[] lI = lTData[i];

            // Check off-diagonal elements (and reset them to 0).
            for (int j = i + 1; j < order; ++j) {
                final double[] lJ = lTData[j];

                final double lIJ = lI[j];
                final double lJI = lJ[i];

                final double maxDelta = relSymmetryThreshold * Math.max(Math.abs(lIJ), Math.abs(lJI));

                if (Math.abs(lIJ - lJI) > maxDelta)
                    throw new NonSymmetricMatrixException(i, j, relSymmetryThreshold);

                lJ[i] = 0;
            }
        }

        // Transform the matrix.
        for (int i = 0; i < order; ++i) {
            final double[] ltI = lTData[i];

            // Check diagonal element.
            if (ltI[i] <= absPositivityThreshold)
                throw new NonPositiveDefiniteMatrixException(ltI[i], i, absPositivityThreshold);

            ltI[i] = Math.sqrt(ltI[i]);
            final double inverse = 1.0 / ltI[i];

            for (int q = order - 1; q > i; --q) {
                ltI[q] *= inverse;
                final double[] ltQ = lTData[q];

                for (int p = q; p < order; ++p)
                    ltQ[p] -= ltI[q] * ltI[p];
            }
        }
    }

    /** {@inheritDoc} */
    @Override public void destroy() {
        if (cachedL != null)
            cachedL.destroy();
        if (cachedLT != null)
            cachedLT.destroy();
    }

    /**
     * Returns the matrix L of the decomposition.
     *
L is an lower-triangular matrix

     *
     * @return the L matrix
     */
    public Matrix getL() {
        if (cachedL == null)
            cachedL = getLT().transpose();

        return cachedL;
    }

    /**
     * Returns the transpose of the matrix L of the decomposition.
     *
LT is an upper-triangular matrix

     *
     * @return the transpose of the matrix L of the decomposition
     */
    public Matrix getLT() {

        if (cachedLT == null) {
            Matrix like = like(origin, origin.rowSize(), origin.columnSize());
            like.assign(lTData);

            cachedLT = like;
        }

        // return the cached matrix
        return cachedLT;
    }

    /**
     * Return the determinant of the matrix
     *
     * @return determinant of the matrix
     */
    public double getDeterminant() {
        double determinant = 1.0;

        for (int i = 0; i < lTData.length; ++i) {
            double lTii = lTData[i][i];
            determinant *= lTii * lTii;
        }

        return determinant;
    }

    /**
     * Solve the linear equation A × X = B for matrices A.
     *
     * @param b right-hand side of the equation A × X = B
     * @return a vector X that minimizes the two norm of A × X - B
     * @throws CardinalityException if the vectors dimensions do not match
     */
    public Vector solve(final Vector b) {
        final int m = lTData.length;

        if (b.size() != m)
            throw new CardinalityException(b.size(), m);

        final double[] x = b.getStorage().data();

        // Solve LY = b
        for (int j = 0; j < m; j++) {
            final double[] lJ = lTData[j];

            x[j] /= lJ[j];

            final double xJ = x[j];

            for (int i = j + 1; i < m; i++)
                x[i] -= xJ * lJ[i];
        }

        // Solve LTX = Y
        for (int j = m - 1; j >= 0; j--) {
            x[j] /= lTData[j][j];

            final double xJ = x[j];

            for (int i = 0; i < j; i++)
                x[i] -= xJ * lTData[i][j];
        }

        return likeVector(origin, m).assign(x);
    }

    /**
     * Solve the linear equation A × X = B for matrices A.
     *
     * @param b right-hand side of the equation A × X = B
     * @return a matrix X that minimizes the two norm of A × X - B
     * @throws CardinalityException if the matrices dimensions do not match
     */
    public Matrix solve(final Matrix b) {
        final int m = lTData.length;

        if (b.rowSize() != m)
            throw new CardinalityException(b.rowSize(), m);

        final int nColB = b.columnSize();
        final double[][] x = b.getStorage().data();

        // Solve LY = b
        for (int j = 0; j < m; j++) {
            final double[] lJ = lTData[j];
            final double lJJ = lJ[j];
            final double[] xJ = x[j];

            for (int k = 0; k < nColB; ++k)
                xJ[k] /= lJJ;

            for (int i = j + 1; i < m; i++) {
                final double[] xI = x[i];
                final double lJI = lJ[i];

                for (int k = 0; k < nColB; ++k)
                    xI[k] -= xJ[k] * lJI;
            }
        }

        // Solve LTX = Y
        for (int j = m - 1; j >= 0; j--) {
            final double lJJ = lTData[j][j];
            final double[] xJ = x[j];

            for (int k = 0; k < nColB; ++k)
                xJ[k] /= lJJ;

            for (int i = 0; i < j; i++) {
                final double[] xI = x[i];
                final double lIJ = lTData[i][j];

                for (int k = 0; k < nColB; ++k)
                    xI[k] -= xJ[k] * lIJ;
            }
        }

        return like(origin, m, b.columnSize()).assign(x);
    }

    /** */
    private double[][] toDoubleArr(Matrix mtx) {
        if (mtx.isArrayBased())
            return mtx.getStorage().data();

        double[][] res = new double[mtx.rowSize()][];

        for (int row = 0; row < mtx.rowSize(); row++) {
            res[row] = new double[mtx.columnSize()];
            for (int col = 0; col < mtx.columnSize(); col++)
                res[row][col] = mtx.get(row, col);
        }

        return res;
    }
}


text:
/**
 * @file
 * @brief UART-driven console
 *
 *
 * Serial console driver.
 * Hooks into the printk and fputc (for printf) modules. Poll driven.
 */

#include <nanokernel.h>
#include <arch/cpu.h>

#include <stdio.h>
#include <stdint.h>
#include <errno.h>
#include <ctype.h>

#include <device.h>
#include <init.h>

#include <board.h>
#include <uart.h>
#include <console/uart_console.h>
#include <toolchain.h>
#include <sections.h>
#include <atomic.h>
#include <misc/printk.h>

static struct device *uart_console_dev;

#if 0 /* NOTUSED */
/**
 *
 * @brief Get a character from UART
 *
 * @return the character or EOF if nothing present
 */

static int console_in(void)
{
	unsigned char c;

	if (uart_poll_in(uart_console_dev, &c) < 0)
		return EOF;
	else
		return (int)c;
}
#endif

#if defined(CONFIG_PRINTK) || defined(CONFIG_STDOUT_CONSOLE)
/**
 *
 * @brief Output one character to UART
 *
 * Outputs both line feed and carriage return in the case of a '\n'.
 *
 * @param c Character to output
 *
 * @return The character passed as input.
 */

static int console_out(int c)
{
	uart_poll_out(uart_console_dev, (unsigned char)c);
	if ('\n' == c) {
		uart_poll_out(uart_console_dev, (unsigned char)'\r');
	}
	return c;
}

#endif

#if defined(CONFIG_STDOUT_CONSOLE)
extern void __stdout_hook_install(int (*hook)(int));
#else
#define __stdout_hook_install(x)		\
	do {/* nothing */			\
	} while ((0))
#endif

#if defined(CONFIG_PRINTK)
extern void __printk_hook_install(int (*fn)(int));
#else
#define __printk_hook_install(x)		\
	do {/* nothing */			\
	} while ((0))
#endif

#if defined(CONFIG_CONSOLE_HANDLER)
static struct nano_fifo *avail_queue;
static struct nano_fifo *lines_queue;

/* Control characters */
#define ESC                0x1b
#define DEL                0x7f

/* ANSI escape sequences */
#define ANSI_ESC           '['
#define ANSI_UP            'A'
#define ANSI_DOWN          'B'
#define ANSI_FORWARD       'C'
#define ANSI_BACKWARD      'D'

static int read_uart(struct device *uart, uint8_t *buf, unsigned int size)
{
	int rx;

	rx = uart_fifo_read(uart, buf, size);
	if (rx < 0) {
		/* Overrun issue. Stop the UART */
		uart_irq_rx_disable(uart);

		return -EIO;
	}

	return rx;
}

static inline void cursor_forward(unsigned int count)
{
	printk("\x1b[%uC", count);
}

static inline void cursor_backward(unsigned int count)
{
	printk("\x1b[%uD", count);
}

static inline void cursor_save(void)
{
	printk("\x1b[s");
}

static inline void cursor_restore(void)
{
	printk("\x1b[u");
}

static void insert_char(char *pos, char c, uint8_t end)
{
	char tmp;

	/* Echo back to console */
	uart_poll_out(uart_console_dev, c);

	if (end == 0) {
		*pos = c;
		return;
	}

	tmp = *pos;
	*(pos++) = c;

	cursor_save();

	while (end-- > 0) {
		uart_poll_out(uart_console_dev, tmp);
		c = *pos;
		*(pos++) = tmp;
		tmp = c;
	}

	/* Move cursor back to right place */
	cursor_restore();
}

static void del_char(char *pos, uint8_t end)
{
	uart_poll_out(uart_console_dev, '\b');

	if (end == 0) {
		uart_poll_out(uart_console_dev, ' ');
		uart_poll_out(uart_console_dev, '\b');
		return;
	}

	cursor_save();

	while (end-- > 0) {
		*pos = *(pos + 1);
		uart_poll_out(uart_console_dev, *(pos++));
	}

	uart_poll_out(uart_console_dev, ' ');

	/* Move cursor back to right place */
	cursor_restore();
}

enum {
	ESC_ESC,
	ESC_ANSI,
	ESC_ANSI_FIRST,
	ESC_ANSI_VAL,
	ESC_ANSI_VAL_2
};

static atomic_t esc_state;
static unsigned int ansi_val, ansi_val_2;
static uint8_t cur, end;

static void handle_ansi(uint8_t byte)
{
	if (atomic_test_and_clear_bit(&esc_state, ESC_ANSI_FIRST)) {
		if (!isdigit(byte)) {
			ansi_val = 1;
			goto ansi_cmd;
		}

		atomic_set_bit(&esc_state, ESC_ANSI_VAL);
		ansi_val = byte - '0';
		ansi_val_2 = 0;
		return;
	}

	if (atomic_test_bit(&esc_state, ESC_ANSI_VAL)) {
		if (isdigit(byte)) {
			if (atomic_test_bit(&esc_state, ESC_ANSI_VAL_2)) {
				ansi_val_2 *= 10;
				ansi_val_2 += byte - '0';
			} else {
				ansi_val *= 10;
				ansi_val += byte - '0';
			}
			return;
		}

		/* Multi value sequence, e.g. Esc[Line;ColumnH */
		if (byte == ';' &&
		    !atomic_test_and_set_bit(&esc_state, ESC_ANSI_VAL_2)) {
			return;
		}

		atomic_clear_bit(&esc_state, ESC_ANSI_VAL);
		atomic_clear_bit(&esc_state, ESC_ANSI_VAL_2);
	}

ansi_cmd:
	switch (byte) {
	case ANSI_BACKWARD:
		if (ansi_val > cur) {
			break;
		}

		end += ansi_val;
		cur -= ansi_val;
		cursor_backward(ansi_val);
		break;
	case ANSI_FORWARD:
		if (ansi_val > end) {
			break;
		}

		end -= ansi_val;
		cur += ansi_val;
		cursor_forward(ansi_val);
		break;
	default:
		break;
	}

	atomic_clear_bit(&esc_state, ESC_ANSI);
}

void uart_console_isr(void *unused)
{
	ARG_UNUSED(unused);

	while (uart_irq_update(uart_console_dev) &&
	       uart_irq_is_pending(uart_console_dev)) {
		static struct uart_console_input *cmd;
		uint8_t byte;
		int rx;

		if (!uart_irq_rx_ready(uart_console_dev)) {
			continue;
		}

		/* Character(s) have been received */

		rx = read_uart(uart_console_dev, &byte, 1);
		if (rx < 0) {
			return;
		}

		if (uart_irq_input_hook(uart_console_dev, byte) != 0) {
			/*
			 * The input hook indicates that no further processing
			 * should be done by this handler.
			 */
			return;
		}

		if (!cmd) {
			cmd = nano_isr_fifo_get(avail_queue, TICKS_NONE);
			if (!cmd)
				return;
		}

		/* Handle ANSI escape mode */
		if (atomic_test_bit(&esc_state, ESC_ANSI)) {
			handle_ansi(byte);
			continue;
		}

		/* Handle escape mode */
		if (atomic_test_and_clear_bit(&esc_state, ESC_ESC)) {
			switch (byte) {
			case ANSI_ESC:
				atomic_set_bit(&esc_state, ESC_ANSI);
				atomic_set_bit(&esc_state, ESC_ANSI_FIRST);
				break;
			default:
				break;
			}

			continue;
		}

		/* Handle special control characters */
		if (!isprint(byte)) {
			switch (byte) {
			case DEL:
				if (cur > 0) {
					del_char(&cmd->line[--cur], end);
				}
				break;
			case ESC:
				atomic_set_bit(&esc_state, ESC_ESC);
				break;
			case '\r':
				cmd->line[cur + end] = '\0';
				uart_poll_out(uart_console_dev, '\n');
				cur = 0;
				end = 0;
				nano_isr_fifo_put(lines_queue, cmd);
				cmd = NULL;
				break;
			default:
				break;
			}

			continue;
		}

		/* Ignore characters if there's no more buffer space */
		if (cur + end < sizeof(cmd->line) - 1) {
			insert_char(&cmd->line[cur++], byte, end);
		}
	}
}

static void console_input_init(void)
{
	uint8_t c;

	uart_irq_rx_disable(uart_console_dev);
	uart_irq_tx_disable(uart_console_dev);
	IRQ_CONNECT(CONFIG_UART_CONSOLE_IRQ, CONFIG_UART_CONSOLE_IRQ_PRI,
		    uart_console_isr, 0, UART_IRQ_FLAGS);
	irq_enable(CONFIG_UART_CONSOLE_IRQ);

	/* Drain the fifo */
	while (uart_irq_rx_ready(uart_console_dev)) {
		uart_fifo_read(uart_console_dev, &c, 1);
	}

	uart_irq_rx_enable(uart_console_dev);
}

void uart_register_input(struct nano_fifo *avail, struct nano_fifo *lines)
{
	avail_queue = avail;
	lines_queue = lines;

	console_input_init();
}
#else
#define console_input_init(x)			\
	do {/* nothing */			\
	} while ((0))
#define uart_register_input(x)			\
	do {/* nothing */			\
	} while ((0))
#endif

/**
 *
 * @brief Install printk/stdout hook for UART console output
 *
 * @return N/A
 */

void uart_console_hook_install(void)
{
	__stdout_hook_install(console_out);
	__printk_hook_install(console_out);
}

/**
 *
 * @brief Initialize one UART as the console/debug port
 *
 * @return DEV_OK if successful, otherwise failed.
 */
static int uart_console_init(struct device *arg)
{
	ARG_UNUSED(arg);

	uart_console_dev = device_get_binding(CONFIG_UART_CONSOLE_ON_DEV_NAME);

	uart_console_hook_install();

	return DEV_OK;
}

/* UART consloe initializes after the UART device itself */
SYS_INIT(uart_console_init,
#if defined(CONFIG_EARLY_CONSOLE)
			PRIMARY,
#else
			SECONDARY,
#endif
			CONFIG_UART_CONSOLE_PRIORITY);


text:
module VirtualAttributes
  VERSION = "0.0.2"
end


text:
// <copyright file="IxUnlimitedMultiplicityConfig.cs" company="ClrCoder project">
// Copyright (c) ClrCoder project. All rights reserved.
// Licensed under the Apache 2.0 license. See LICENSE file in the project root for full license information.
// </copyright>

namespace ClrCoder.ComponentModel.IndirectX
{
    public class IxUnlimitedMultiplicityConfig
    {
    }
}


text:
package org.terasology.engine.input;

import org.terasology.engine.input.events.AxisEvent;

public class BindAxisEvent extends AxisEvent {

    private String id;
    private float value;

    public BindAxisEvent() {
        super(0);
    }

    @Override
    public double getValue() {
        return value;
    }

    public void prepare(String axisId, float axisValue, float delta) {
        reset(delta);
        this.id = axisId;
        this.value = axisValue;
    }

    public String getId() {
        return id;
    }

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<Module>
    <ModulePrefs height="300" title="BlogSocial">
        <Require feature="opensocial-0.7"/>
        <Require feature="google.blog"/>
        <Require feature="skins"/>
        <Require feature="views"/>
    </ModulePrefs>
    <Content type="html">

            Canvas mode

    </Content>
</Module>


text:
package org.efidroid.efidroidmanager.types;

import android.content.Intent;
import android.os.Bundle;

import org.efidroid.efidroidmanager.activities.GenericProgressActivity;
import org.efidroid.efidroidmanager.services.GenericProgressIntentService;

public abstract class ProgressServiceTask {
    private GenericProgressIntentService mService;

    public ProgressServiceTask(GenericProgressIntentService service) {
        mService = service;
    }

    protected GenericProgressIntentService getService() {
        return mService;
    }

    public int publishProgress(int percent, String text) {
        return mService.publishProgress(percent, text);
    }

    public void publishFinish(boolean success) {
        mService.publishFinish(success);
    }

    public boolean shouldStop() {
        return mService.shouldStop();
    }

    abstract public void onProcess(Bundle extras);
    abstract public String getNotificationProgressTitle();
    abstract public String getNotificationResultTitle();
}


text:
using System;
using System.ComponentModel;
using System.Collections.Generic;
using Newtonsoft.Json;
using System.Linq;
using STEP;

namespace IFC
{
    /// <summary>
	/// http://www.buildingsmart-tech.org/ifc/IFC4/final/html/link/ifcrotationalfrequencymeasure.htm
	/// </summary>
	public class IfcRotationalFrequencyMeasure : BaseIfc
	{
		internal double value;

		public IfcRotationalFrequencyMeasure(double value){ this.value = value; }
		public static implicit operator double(IfcRotationalFrequencyMeasure v){ return v.value; }
		public static implicit operator IfcRotationalFrequencyMeasure(double v){ return new IfcRotationalFrequencyMeasure(v); }
		public static IfcRotationalFrequencyMeasure FromJSON(string json){ return JsonConvert.DeserializeObject<IfcRotationalFrequencyMeasure>(json); }
        public override string ToString(){ return value.ToString(); }
		public override string ToStepValue(bool isSelectOption = false){
			if(isSelectOption){ return $"{GetType().Name.ToUpper()}({value.ToStepValue(isSelectOption)})"; }
			else{ return value.ToStepValue(isSelectOption); }
        }
	}
}


text:
<?php
namespace Family\Authentication;

use Zend\Authentication\Adapter\AbstractAdapter;
use Zend\Authentication\Result;
use Zend\ServiceManager\ServiceLocatorAwareInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
use Zend\Stdlib\Hydrator;
use Family\Model\Entity\User as UserModel;

class Adapter extends AbstractAdapter implements ServiceLocatorAwareInterface
{

    protected $serviceLocator;

    public function authenticate()
    {
		$UsersTableGateway = $this->serviceLocator->get('table-gateway')->get('users', null, null);
		try {
			$rowset = $UsersTableGateway->select(array('userId' => $this->identity));
        }
		catch (\Exception $ex) {
            return;
        }
		$data = $rowset->current();
		if ($data) {
			$hydrator = new Hydrator\ClassMethods();
			$user = new UserModel();
			$hydrator->hydrate(get_object_vars($data), $user);
			if($user->verifyPassword($this->credential)) {
				return new Result(Result::SUCCESS, $user);
			}
        }

        return new Result(Result::FAILURE, $this->identity);

    }

    public function setServiceLocator(ServiceLocatorInterface $serviceLocator)
    {
        $this->serviceLocator = $serviceLocator;
    }

    public function getServiceLocator()
    {
        return $this->serviceLocator;
    }

}


text:
package com.example.trust.reportbutton.passface;

import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.widget.Toast;

import com.example.trust.reportbutton.PasswordObject;
import com.example.trust.reportbutton.R;
import com.example.trust.reportbutton.recyclerview.PassFaceItemAdapter;
import com.example.trust.reportbutton.recyclerview.PasswordItemAdapter;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Objects;

import butterknife.Bind;
import butterknife.ButterKnife;

import static com.example.trust.reportbutton.SharedKey.SHARED_PREF_KEY;
import static com.example.trust.reportbutton.SharedKey.SHARED_PREF_PASSFACE_KEY;
import static com.example.trust.reportbutton.SharedKey.SHARED_PREF_PASSWORD_KEY;

public class PassFacePasswordActivity extends AppCompatActivity implements PassFaceItemAdapter.OnPasswordClickListener {

    @Bind(R.id.password_recyclerview)
    RecyclerView pinRecyclerView;

    private int count = 0;
    private String password = "";

    private static final int PASSWORD_LENGTH = 4;

    ArrayList<Integer> guessList = new ArrayList<>();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_passface );
        ButterKnife.bind(this);
        getSupportActionBar().hide();
        setupPinRecyclerView();
        createPassword();
    }

    private void setupPinRecyclerView() {
        GridLayoutManager gridLayoutManager = new GridLayoutManager(this, 5, GridLayoutManager.HORIZONTAL, false) {
            @Override
            public boolean canScrollVertically() {
                return false;
            }
        };
        PassFaceItemAdapter passwordItemAdapter = new PassFaceItemAdapter();
        passwordItemAdapter.setOnPasswordClickListener(this);
        pinRecyclerView.setLayoutManager(gridLayoutManager);
        pinRecyclerView.setAdapter(passwordItemAdapter);
    }

    private void createPassword() {
        String[] passwordArray = getSharedPrefValue(SHARED_PREF_PASSFACE_KEY).split("-");
        ArrayList<Integer> passwordList = new ArrayList<>();
        for (int i = 0; i < PASSWORD_LENGTH; i++) {
            passwordList.add(Integer.parseInt(passwordArray[i]));
        }
        Collections.sort(passwordList);
        for (int i = 0; i < PASSWORD_LENGTH; i++) {
            password = password + "" + passwordList.get(i);
        }
    }

    private String getSharedPrefValue(String key) {
        SharedPreferences pref = this.getSharedPreferences(SHARED_PREF_KEY, Context.MODE_PRIVATE);
        return pref.getString(key, "");
    }

    @Override
    public void onPasswordClick(PassFacePasswordPicture passwordObject) {
        count++;
        guessList.add(passwordObject.getValue());
        if (count == PASSWORD_LENGTH) {
            String guess = "";
            Collections.sort(guessList);
            for (int i = 0; i < PASSWORD_LENGTH; i++) {
                guess = guess + "" + guessList.get(i);
            }
            if (Objects.equals(guess, password)) {
                Toast.makeText(this, "CORRECT!", Toast.LENGTH_SHORT).show();
                finish();
            } else {
                Toast.makeText(this, "WRONG!", Toast.LENGTH_SHORT).show();
                count = 0;
                guessList.clear();
            }
        }

    }
}


text:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE ldml SYSTEM "../../common/dtd/ldml.dtd">
<ldml>
	<identity>
		<version number="$Revision: 6546 $"/>
		<generation date="$Date: 2012-02-07 12:32:35 -0600 (Tue, 07 Feb 2012) $"/>
		<language type="en"/>
		<territory type="ZW"/>
	</identity>
	<dates>
		<calendars>
			<calendar type="gregorian">
				<dateFormats>
					<dateFormatLength type="full">
						<dateFormat>
							<pattern>EEEE dd MMMM y</pattern>
						</dateFormat>
					</dateFormatLength>
					<dateFormatLength type="long">
						<dateFormat>
							<pattern>dd MMMM y</pattern>
						</dateFormat>
					</dateFormatLength>
					<dateFormatLength type="medium">
						<dateFormat>
							<pattern>dd MMM,y</pattern>
						</dateFormat>
					</dateFormatLength>
					<dateFormatLength type="short">
						<dateFormat>
							<pattern>d/M/yyyy</pattern>
						</dateFormat>
					</dateFormatLength>
				</dateFormats>
				<dateTimeFormats>
					<availableFormats>
						<dateFormatItem id="Md">d/M</dateFormatItem>
						<dateFormatItem id="MEd">E d/M</dateFormatItem>
						<dateFormatItem id="MMMd">dd MMM</dateFormatItem>
						<dateFormatItem id="MMMEd">E dd MMM</dateFormatItem>
						<dateFormatItem id="yMd">d/M/y</dateFormatItem>
						<dateFormatItem id="yMEd">E, d/M/y</dateFormatItem>
						<dateFormatItem id="yMMMd">dd MMM, y</dateFormatItem>
						<dateFormatItem id="yMMMEd">E, dd MMM, y</dateFormatItem>
					</availableFormats>
					<intervalFormats>
						<intervalFormatFallback draft="unconfirmed">{0} - {1}</intervalFormatFallback>
						<intervalFormatItem id="d">
							<greatestDifference id="d" draft="unconfirmed">d-d</greatestDifference>
						</intervalFormatItem>
						<intervalFormatItem id="h">
							<greatestDifference id="a" draft="unconfirmed">h a - h a</greatestDifference>
							<greatestDifference id="h" draft="unconfirmed">h-h a</greatestDifference>
						</intervalFormatItem>
						<intervalFormatItem id="hm">
							<greatestDifference id="a" draft="unconfirmed">h:mm a - h:mm a</greatestDifference>
							<greatestDifference id="h" draft="unconfirmed">h:mm-h:mm a</greatestDifference>
							<greatestDifference id="m" draft="unconfirmed">h:mm-h:mm a</greatestDifference>
						</intervalFormatItem>
						<intervalFormatItem id="hmv">
							<greatestDifference id="a" draft="unconfirmed">h:mm a - h:mm a v</greatestDifference>
							<greatestDifference id="h" draft="unconfirmed">h:mm-h:mm a v</greatestDifference>
							<greatestDifference id="m" draft="unconfirmed">h:mm-h:mm a v</greatestDifference>
						</intervalFormatItem>
						<intervalFormatItem id="hv">
							<greatestDifference id="a" draft="unconfirmed">h a - h a v</greatestDifference>
							<greatestDifference id="h" draft="unconfirmed">h-h a v</greatestDifference>
						</intervalFormatItem>
						<intervalFormatItem id="M">
							<greatestDifference id="M" draft="unconfirmed">M-M</greatestDifference>
						</intervalFormatItem>
						<intervalFormatItem id="Md">
							<greatestDifference id="d" draft="unconfirmed">d/M - d/M</greatestDifference>
							<greatestDifference id="M" draft="unconfirmed">d/M - d/M</greatestDifference>
						</intervalFormatItem>
						<intervalFormatItem id="MEd">
							<greatestDifference id="d" draft="unconfirmed">E d/M - E d/M</greatestDifference>
							<greatestDifference id="M" draft="unconfirmed">E d/M - E d/M</greatestDifference>
						</intervalFormatItem>
						<intervalFormatItem id="MMM">
							<greatestDifference id="M" draft="unconfirmed">MMM-MMM</greatestDifference>
						</intervalFormatItem>
						<intervalFormatItem id="MMMd">
							<greatestDifference id="d" draft="unconfirmed">dd-dd MMM</greatestDifference>
							<greatestDifference id="M" draft="unconfirmed">dd MMM - dd MMM</greatestDifference>
						</intervalFormatItem>
						<intervalFormatItem id="MMMEd">
							<greatestDifference id="d" draft="unconfirmed">E dd - E dd MMM</greatestDifference>
							<greatestDifference id="M" draft="unconfirmed">E dd MMM - E dd MMM</greatestDifference>
						</intervalFormatItem>
						<intervalFormatItem id="y">
							<greatestDifference id="y" draft="unconfirmed">y-y</greatestDifference>
						</intervalFormatItem>
						<intervalFormatItem id="yM">
							<greatestDifference id="M" draft="unconfirmed">M/yyyy - M/yyyy</greatestDifference>
							<greatestDifference id="y" draft="unconfirmed">M/yyyy - M/yyyy</greatestDifference>
						</intervalFormatItem>
						<intervalFormatItem id="yMd">
							<greatestDifference id="d" draft="unconfirmed">d/M/yyyy - d/M/yyyy</greatestDifference>
							<greatestDifference id="M" draft="unconfirmed">d/M/yyyy - d/M/yyyy</greatestDifference>
							<greatestDifference id="y" draft="unconfirmed">d/M/yyyy - d/M/yyyy</greatestDifference>
						</intervalFormatItem>
						<intervalFormatItem id="yMEd">
							<greatestDifference id="d" draft="unconfirmed">E d/M/yyyy - E d/M/yyyy</greatestDifference>
							<greatestDifference id="M" draft="unconfirmed">E d/M/yyyy - E d/M/yyyy</greatestDifference>
							<greatestDifference id="y" draft="unconfirmed">E d/M/yyyy - E d/M/yyyy</greatestDifference>
						</intervalFormatItem>
						<intervalFormatItem id="yMMM">
							<greatestDifference id="M" draft="unconfirmed">MMM-MMM y</greatestDifference>
							<greatestDifference id="y" draft="unconfirmed">MMM y - MMM y</greatestDifference>
						</intervalFormatItem>
						<intervalFormatItem id="yMMMd">
							<greatestDifference id="d" draft="unconfirmed">dd-dd MMM y</greatestDifference>
							<greatestDifference id="M" draft="unconfirmed">dd MMM - dd MMM y</greatestDifference>
							<greatestDifference id="y" draft="unconfirmed">dd MMM y - dd MMM y</greatestDifference>
						</intervalFormatItem>
						<intervalFormatItem id="yMMMEd">
							<greatestDifference id="d" draft="unconfirmed">E dd - E dd MMM y</greatestDifference>
							<greatestDifference id="M" draft="unconfirmed">E dd MMM - E dd MMM y</greatestDifference>
							<greatestDifference id="y" draft="unconfirmed">E dd MMM y - E dd MMM y</greatestDifference>
						</intervalFormatItem>
					</intervalFormats>
				</dateTimeFormats>
			</calendar>
		</calendars>
		<timeZoneNames>
			<metazone type="Africa_Central">
				<short>
					<standard>CAT</standard>
				</short>
			</metazone>
			<metazone type="Africa_Eastern">
				<short>
					<standard>EAT</standard>
				</short>
			</metazone>
			<metazone type="Africa_Southern">
				<short>
					<standard>SAST</standard>
				</short>
			</metazone>
			<metazone type="Africa_Western">
				<short>
					<generic>WAT</generic>
					<standard>WAT</standard>
					<daylight>WAST</daylight>
				</short>
			</metazone>
		</timeZoneNames>
	</dates>
	<numbers>
		<currencyFormats numberSystem="latn">
			<currencyFormatLength>
				<currencyFormat>
					<pattern>¤#,##0.00</pattern>
				</currencyFormat>
			</currencyFormatLength>
		</currencyFormats>
	</numbers>
</ldml>


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

<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you 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.
-->

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

  <groupId>org.apache.maven.plugins.invoker</groupId>
  <artifactId>skip-install</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>pom</packaging>

  <description>Test to check that invoker.skip=true will skip all installations</description>

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

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-invoker-plugin</artifactId>
        <version>@project.version@</version>
        <configuration>
          <localRepositoryPath>${project.build.directory}/it-repo</localRepositoryPath>
        </configuration>
        <executions>
          <execution>
            <id>integration-test</id>
            <phase>initialize</phase>
            <goals>
              <goal>install</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

</project>


text:
using System;
using System.IO;
using System.Linq;
using NUnit.Framework;
using Xamarin.UITest;
using Xamarin.UITest.Android;
using Xamarin.UITest.Queries;

namespace GeneticsUITests
{
    [TestFixture]
    public class Tests
    {
        private AndroidApp app;

        [SetUp]
        public void BeforeEachTest()
        {
            // TODO: If the Android app being tested is included in the solution then open
            // the Unit Tests window, right click Test Apps, select Add App Project
            // and select the app projects that should be tested.
            app = ConfigureApp
                .Android
				.ApkFile("../../../GeneticsTests/bin/Release/com.example.genetics.GeneticsTests.apk")
                .StartApp();
        }

        [Test]
        public void RunTests()
        {
            //app.Repl();

			// start the tests
			app.WaitForElement (e => e.Id ("RunTestsButton"));
			app.Tap (e => e.Id ("RunTestsButton"));

			// wait for results
			app.WaitForElement (e => e.Id ("ResultsResult"), timeout: TimeSpan.FromMinutes(5)); // to run all the tests
			var resultsText = app.Query (e => e.Id ("ResultsResult")).FirstOrDefault ();
			Assert.IsNotNull (resultsText);
			app.WaitFor (() => !string.IsNullOrEmpty (resultsText.Text));

			// take a screenshot to confirm
			app.Screenshot("Results");

			// make sure all passed
			Assert.AreEqual ("Passed", resultsText.Text);
        }
    }
}


text:
from ..base import ShopifyResource

class Event(ShopifyResource):
    _prefix_source = "/admin/$resource/$resource_id/"

    @classmethod
    def _prefix(cls, options={}):
        resource = options.get("resource")
        if resource:
            return "/admin/%s/%s" % (resource, options["resource_id"])
        else:
            return "/admin"


text:
#region Disclaimer/License Info

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

// sBlog.Net

// sBlog.Net is a minimalistic blog engine software.

// Homepage: http://sblogproject.net
// Github: http://github.com/karthik25/sBlog.Net

// This project is licensed under the BSD license.
// See the License.txt file for more information.

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

#endregion
using System;

namespace sBlog.Net.Models
{
    public class PagingInformation
    {
        public int TotalItems { get; set; }
        public int ItemsPerPage { get; set; }
        public int CurrentPage { get; set; }

        public int TotalPages
        {
            get { return (int)Math.Ceiling((decimal)TotalItems / ItemsPerPage); }
        }
    }
}