text:
package org.jetbrains.plugins.scala;

import com.intellij.openapi.fileTypes.FileTypeConsumer;
import com.intellij.openapi.fileTypes.FileTypeFactory;
import org.jetbrains.annotations.NotNull;

/**
 * @author ilyas
 */
public class ScalaFileTypeFactory extends FileTypeFactory {
  public void createFileTypes(final @NotNull FileTypeConsumer consumer) {
    ScalaFileType fileType = ScalaFileType.INSTANCE;
    consumer.consume(fileType,
            fileType.getDefaultExtension() + FileTypeConsumer.EXTENSION_DELIMITER + ScalaFileType.WORKSHEET_EXTENSION);
  }
}


text:
using System;

namespace Vertica.Utilities.Extensions.Infrastructure
{
	public interface IExtensionPoint
	{
		object ExtendedValue { get; }
		Type ExtendedType { get; }
	}

	public interface IExtensionPoint<out T> : IExtensionPoint
	{
		new T ExtendedValue { get; }
	}
}

redpajama_set_name: RedPajamaGithub


text:
/*global angular, _, moment, $*/

/**
 * angular-timezone-selector
 *
 * A simple directive that allows a user to pick their timezone
 *
 * Author:  Ashok Fernandez <ashok@mish.guru>
 * Date:    12/06/2015
 * License: MIT
 */

angular.module('angular-timezone-selector', [])
  .constant('_', _)
  .constant('moment', moment)
  .factory('timezones', ['_', 'moment', function (_, moment) {
    var timezoneMap = {}
    _.forEach(moment.tz.names(), function (zoneName) {
      var tz=moment.tz(zoneName);
      timezoneMap[zoneName] = {
        id: zoneName,
        name: zoneName.replace(/_/g, ' '),
        offset: 'UTC' + tz.format('Z'),
        nOffset: tz.utcOffset()
      }
    })
    return timezoneMap
  }])

  // Timezone name to country codemap
  .factory('zoneToCC', ['_', function (_) {
    // Note: zones is populated with the data from 'data/zone.csv' when this file is built
    var zones = []
    var zoneMap = {}
    _.forEach(zones, function (zone) {
      zoneMap[zone.name] = zone.cca2
    })
    return zoneMap

  }])

  // Country code to country name map
  .factory('CCToCountryName', ['_', function (_) {
    // Note: codes is populated with the data from 'data/cca2_to_country_name.csv' when this file is built
    var codes = []
    var codeMap = {}
    _.forEach(codes, function (code) {
      codeMap[code.cca2] = code.name
    })
    return codeMap
  }])

  .directive('timezoneSelector', ['_', 'timezones', 'zoneToCC', 'CCToCountryName', function (_, timezones, zoneToCC, CCToCountryName) {
    return {
      restrict: 'E',
      replace: true,
      template: '<select style="min-width:300px;"></select>',
      scope: {
        ngModel: '='
      },
      link: function ($scope, elem, attrs) {
        var data = []

        // Group the timezones by their country code
        var timezonesGroupedByCC = {}
        _.forEach(timezones, function (timezone) {
          if (_.has(zoneToCC, timezone.id)) {
            var CC = zoneToCC[timezone.id]
            timezonesGroupedByCC[CC] = !timezonesGroupedByCC[CC] ? [] : timezonesGroupedByCC[CC]
            timezonesGroupedByCC[CC].push(timezone)
          }
        })

        // Add the grouped countries to the data array with their country name as the group option
        _.forEach(timezonesGroupedByCC, function (zonesByCountry, CC) {
          var zonesForCountry = {
            text: CCToCountryName[CC] + ': ',
            children: zonesByCountry,
            firstNOffset: zonesByCountry[0].nOffset
          }

          data.push(zonesForCountry)
        })

        // Sort by UTC or country name
        if (attrs.sortBy=="offset"){
            data = _.sortBy(data, 'firstNOffset');
            _.forEach(data,function(zonesForCountry,key){
                zonesForCountry.children=_.sortBy(zonesForCountry.children, 'nOffset');
            });
        } else {
            data = _.sortBy(data, 'text')
        }

        // add initial options forlocal
        if (attrs.showLocal!=undefined){
            if (jstz!=undefined){
                var extraTZs = _.where(timezones,{'name':jstz.determine().name() });
            } else {
                var localUTC = 'UTC'+moment().format('Z');
                var extraTZs = _.where(timezones,{'offset':localUTC});
            }
            data.splice(0,0,{
              text: 'Local' + ': ',
              children: extraTZs,
              firstNOffset: extraTZs[0].nOffset,
              firstOffset: extraTZs[0].offset
          })
        }

        // add initial options
        if (attrs.primaryChoices!=undefined){
            // var primaryChoices=['UTC','GB','WET','GMT','Asia/Macau']
            var primaryChoices = attrs.primaryChoices.split(' ');
            var extraTZs = _.filter(timezones,function(tz){return _.contains(primaryChoices,tz.name)});
            data.splice(0,0,{
              text: 'Primary' + ': ',
              children: extraTZs,
              firstNOffset: extraTZs[0].nOffset,
              firstOffset: extraTZs[0].offset
            })
        }

        // Construct a select box with the timezones grouped by country
        _.forEach(data, function (group) {
          var $optgroup = $('<optgroup label="' + group.text + '">')
          group.children.forEach(function (option) {

            if (attrs.displayUtc=="true" && !option.name.includes('(UTC')){
                option.name = option.name + ' (' + option.offset+')';
            }

            $optgroup.append('<option value="' + option.id + '">' +
              option.name + '</option>')
          })
          elem.append($optgroup)
        })

        // Initialise the chosen box
        elem.chosen({
          width: '300px',
          include_group_label_in_selected: true,
          search_contains: true,
          no_results_text: 'No results, try searching for the name of your country or nearest major city.',
          placeholder_text_single: 'Choose a timezone'
        })

        // Update the box if ngModel changes
        $scope.$watch('ngModel', function () {
          elem.val($scope.ngModel)
          elem.trigger('chosen:updated')
        })
      }
    }
  }])


text:
#ifndef DeviceOrientationClientMockQt_h
#define DeviceOrientationClientMockQt_h

#include "DeviceOrientationClient.h"
#include "RefPtr.h"

#include <QObject>

namespace WebCore {

class DeviceOrientation;
class DeviceOrientationClientMock;
class DeviceOrientationController;

class DeviceOrientationClientMockQt : public QObject, public DeviceOrientationClient {
    Q_OBJECT
public:
    static DeviceOrientationClientMockQt* client();
    virtual ~DeviceOrientationClientMockQt();

    virtual void setController(DeviceOrientationController*);
    virtual void startUpdating();
    virtual void stopUpdating();
    virtual DeviceOrientation* lastOrientation() const;
    virtual void deviceOrientationControllerDestroyed();
    void setOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma);
    static bool mockIsActive;

Q_SIGNALS:
    void mockOrientationChanged(DeviceOrientation*);

private:
    DeviceOrientationClientMockQt();

    DeviceOrientationClientMock* m_clientMock;
    DeviceOrientationController* m_controller;
    RefPtr<DeviceOrientation> m_orientation;
};

} // namespace WebCore

#endif // DeviceOrientationClientMockQt_h


text:
package commands

import (
	"bytes"
	"fmt"
	"regexp"
	"strings"
	"text/template"
)

const pullRequestTmpl = `{{if .InitMsg}}{{.InitMsg}}
{{end}}
{{.CS}} Requesting a pull to {{.Base}} from {{.Head}}
{{.CS}}
{{.CS}} Write a message for this pull request. The first block
{{.CS}} of text is the title and the rest is description.{{if .HasCommitLogs}}
{{.CS}}
{{.CS}} Changes:
{{.CS}}{{if .HasCommitLogs}}
{{.FormattedCommitLogs}}{{end}}{{end}}`

type pullRequestMsg struct {
	InitMsg    string
	CS         string
	Base       string
	Head       string
	CommitLogs string
}

func (p *pullRequestMsg) HasCommitLogs() bool {
	return len(p.CommitLogs) > 0
}

func (p *pullRequestMsg) FormattedCommitLogs() string {
	startRegexp := regexp.MustCompilePOSIX("^")
	endRegexp := regexp.MustCompilePOSIX(" +$")

	commitLogs := strings.TrimSpace(p.CommitLogs)
	commitLogs = startRegexp.ReplaceAllString(commitLogs, fmt.Sprintf("%s ", p.CS))
	commitLogs = endRegexp.ReplaceAllString(commitLogs, "")

	return commitLogs
}

func renderPullRequestTpl(initMsg, cs, base, head string, commitLogs string) (string, error) {
	t, err := template.New("pullRequestTmpl").Parse(pullRequestTmpl)
	if err != nil {
		return "", err
	}

	msg := &pullRequestMsg{
		InitMsg:    initMsg,
		CS:         cs,
		Base:       base,
		Head:       head,
		CommitLogs: commitLogs,
	}

	var b bytes.Buffer
	err = t.Execute(&b, msg)

	return b.String(), err
}


text:
require 'json'
require 'fleet/version'

module Fleet
  module Request

    private

    [:get, :put, :delete].each do |method|
      define_method(method) do |path, options={}|
        request(connection, method, path, options)
      end
    end

    def request(connection, method, path, options)
      req = {
        path: escape_path(path),
      }

      case method
      when :get
        req[:query] = options
      when :put
        req[:headers] = { 'Content-Type' => 'application/json' }
        req[:body] = ::JSON.dump(options)
      end

      resp = connection.send(method, req)

      if (400..600).include?(resp.status)
        raise_error(resp)
      end

      case method
      when :get
        resp_body = ::JSON.parse(resp.body)
        if !resp_body["nextPageToken"].nil?
          nü_optiöns = options.dup
          nü_optiöns["nextPageToken"] = resp_body.delete("nextPageToken")
          nü_rësp = request(connection, method, path, nü_optiöns)
          resp_body.keys.each do |🔑|
            resp_body[🔑] += (nü_rësp.delete(🔑) || [])
          end
          resp_body.merge! nü_rësp
          resp_body
        else
          resp_body
        end
      else
        true
      end
    rescue Excon::Errors::SocketError => ex
      raise Fleet::ConnectionError, ex.message
    end

    private

    def escape_path(path)
      URI.escape(path).gsub(/@/, '%40')
    end

    def raise_error(resp)
      error = JSON.parse(resp.body)['error']
      class_name = Fleet::Error::HTTP_CODE_MAP.fetch(resp.status, 'Error')

      fail Fleet.const_get(class_name).new(
        error['message'],
        error['code'])
    end
  end
end


text: [include, lang:"yaml"](./books.yaml)


text:
<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/security/privateca/v1beta1/resources.proto

namespace Google\Cloud\Security\PrivateCA\V1beta1\SubordinateConfig;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * This message describes a subordinate CA's issuer certificate chain. This
 * wrapper exists for compatibility reasons.
 *
 * Generated from protobuf message google.cloud.security.privateca.v1beta1.SubordinateConfig.SubordinateConfigChain
 */
class SubordinateConfigChain extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. Expected to be in leaf-to-root order according to RFC 5246.
     *
     * Generated from protobuf field repeated string pem_certificates = 1 [(.google.api.field_behavior) = REQUIRED];
     */
    private $pem_certificates;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string[]|\Google\Protobuf\Internal\RepeatedField $pem_certificates
     *           Required. Expected to be in leaf-to-root order according to RFC 5246.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Security\Privateca\V1Beta1\Resources::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. Expected to be in leaf-to-root order according to RFC 5246.
     *
     * Generated from protobuf field repeated string pem_certificates = 1 [(.google.api.field_behavior) = REQUIRED];
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getPemCertificates()
    {
        return $this->pem_certificates;
    }

    /**
     * Required. Expected to be in leaf-to-root order according to RFC 5246.
     *
     * Generated from protobuf field repeated string pem_certificates = 1 [(.google.api.field_behavior) = REQUIRED];
     * @param string[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setPemCertificates($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->pem_certificates = $arr;

        return $this;
    }

}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(SubordinateConfigChain::class, \Google\Cloud\Security\PrivateCA\V1beta1\SubordinateConfig_SubordinateConfigChain::class);


text:
namespace clang {

class GlobalModuleIndex;
class ModuleMap;

namespace serialization {

/// \brief Manages the set of modules loaded by an AST reader.
class ModuleManager {
  /// \brief The chain of AST files. The first entry is the one named by the
  /// user, the last one is the one that doesn't depend on anything further.
  SmallVector<ModuleFile *, 2> Chain;

  /// \brief All loaded modules, indexed by name.
  llvm::DenseMap<const FileEntry *, ModuleFile *> Modules;

  /// \brief FileManager that handles translating between filenames and
  /// FileEntry *.
  FileManager &FileMgr;

  /// \brief A lookup of in-memory (virtual file) buffers
  llvm::DenseMap<const FileEntry *, llvm::MemoryBuffer *> InMemoryBuffers;

  /// \brief The visitation order.
  SmallVector<ModuleFile *, 4> VisitOrder;

  /// \brief The list of module files that both we and the global module index
  /// know about.
  ///
  /// Either the global index or the module manager may have modules that the
  /// other does not know about, because the global index can be out-of-date
  /// (in which case the module manager could have modules it does not) and
  /// this particular translation unit might not have loaded all of the modules
  /// known to the global index.
  SmallVector<ModuleFile *, 4> ModulesInCommonWithGlobalIndex;

  /// \brief The global module index, if one is attached.
  ///
  /// The global module index will actually be owned by the ASTReader; this is
  /// just an non-owning pointer.
  GlobalModuleIndex *GlobalIndex;

  /// \brief State used by the "visit" operation to avoid malloc traffic in
  /// calls to visit().
  struct VisitState {
    explicit VisitState(unsigned N)
      : VisitNumber(N, 0), NextVisitNumber(1), NextState(0)
    {
      Stack.reserve(N);
    }

    ~VisitState() {
      delete NextState;
    }

    /// \brief The stack used when marking the imports of a particular module
    /// as not-to-be-visited.
    SmallVector<ModuleFile *, 4> Stack;

    /// \brief The visit number of each module file, which indicates when
    /// this module file was last visited.
    SmallVector<unsigned, 4> VisitNumber;

    /// \brief The next visit number to use to mark visited module files.
    unsigned NextVisitNumber;

    /// \brief The next visit state.
    VisitState *NextState;
  };

  /// \brief The first visit() state in the chain.
  VisitState *FirstVisitState;

  VisitState *allocateVisitState();
  void returnVisitState(VisitState *State);

public:
  typedef SmallVectorImpl<ModuleFile*>::iterator ModuleIterator;
  typedef SmallVectorImpl<ModuleFile*>::const_iterator ModuleConstIterator;
  typedef SmallVectorImpl<ModuleFile*>::reverse_iterator ModuleReverseIterator;
  typedef std::pair<uint32_t, StringRef> ModuleOffset;

  explicit ModuleManager(FileManager &FileMgr);
  ~ModuleManager();

  /// \brief Forward iterator to traverse all loaded modules.  This is reverse
  /// source-order.
  ModuleIterator begin() { return Chain.begin(); }
  /// \brief Forward iterator end-point to traverse all loaded modules
  ModuleIterator end() { return Chain.end(); }

  /// \brief Const forward iterator to traverse all loaded modules.  This is
  /// in reverse source-order.
  ModuleConstIterator begin() const { return Chain.begin(); }
  /// \brief Const forward iterator end-point to traverse all loaded modules
  ModuleConstIterator end() const { return Chain.end(); }

  /// \brief Reverse iterator to traverse all loaded modules.  This is in
  /// source order.
  ModuleReverseIterator rbegin() { return Chain.rbegin(); }
  /// \brief Reverse iterator end-point to traverse all loaded modules.
  ModuleReverseIterator rend() { return Chain.rend(); }

  /// \brief Returns the primary module associated with the manager, that is,
  /// the first module loaded
  ModuleFile &getPrimaryModule() { return *Chain[0]; }

  /// \brief Returns the primary module associated with the manager, that is,
  /// the first module loaded.
  ModuleFile &getPrimaryModule() const { return *Chain[0]; }

  /// \brief Returns the module associated with the given index
  ModuleFile &operator[](unsigned Index) const { return *Chain[Index]; }

  /// \brief Returns the module associated with the given name
  ModuleFile *lookup(StringRef Name);

  /// \brief Returns the module associated with the given module file.
  ModuleFile *lookup(const FileEntry *File);

  /// \brief Returns the in-memory (virtual file) buffer with the given name
  llvm::MemoryBuffer *lookupBuffer(StringRef Name);

  /// \brief Number of modules loaded
  unsigned size() const { return Chain.size(); }

  /// \brief The result of attempting to add a new module.
  enum AddModuleResult {
    /// \brief The module file had already been loaded.
    AlreadyLoaded,
    /// \brief The module file was just loaded in response to this call.
    NewlyLoaded,
    /// \brief The module file is missing.
    Missing,
    /// \brief The module file is out-of-date.
    OutOfDate
  };

  /// \brief Attempts to create a new module and add it to the list of known
  /// modules.
  ///
  /// \param FileName The file name of the module to be loaded.
  ///
  /// \param Type The kind of module being loaded.
  ///
  /// \param ImportLoc The location at which the module is imported.
  ///
  /// \param ImportedBy The module that is importing this module, or NULL if
  /// this module is imported directly by the user.
  ///
  /// \param Generation The generation in which this module was loaded.
  ///
  /// \param ExpectedSize The expected size of the module file, used for
  /// validation. This will be zero if unknown.
  ///
  /// \param ExpectedModTime The expected modification time of the module
  /// file, used for validation. This will be zero if unknown.
  ///
  /// \param Module A pointer to the module file if the module was successfully
  /// loaded.
  ///
  /// \param ErrorStr Will be set to a non-empty string if any errors occurred
  /// while trying to load the module.
  ///
  /// \return A pointer to the module that corresponds to this file name,
  /// and a value indicating whether the module was loaded.
  AddModuleResult addModule(StringRef FileName, ModuleKind Type,
                            SourceLocation ImportLoc,
                            ModuleFile *ImportedBy, unsigned Generation,
                            off_t ExpectedSize, time_t ExpectedModTime,
                            ModuleFile *&Module,
                            std::string &ErrorStr);

  /// \brief Remove the given set of modules.
  void removeModules(ModuleIterator first, ModuleIterator last,
                     ModuleMap *modMap);

  /// \brief Add an in-memory buffer the list of known buffers
  void addInMemoryBuffer(StringRef FileName, llvm::MemoryBuffer *Buffer);

  /// \brief Set the global module index.
  void setGlobalIndex(GlobalModuleIndex *Index);

  /// \brief Notification from the AST reader that the given module file
  /// has been "accepted", and will not (can not) be unloaded.
  void moduleFileAccepted(ModuleFile *MF);

  /// \brief Visit each of the modules.
  ///
  /// This routine visits each of the modules, starting with the
  /// "root" modules that no other loaded modules depend on, and
  /// proceeding to the leaf modules, visiting each module only once
  /// during the traversal.
  ///
  /// This traversal is intended to support various "lookup"
  /// operations that can find data in any of the loaded modules.
  ///
  /// \param Visitor A visitor function that will be invoked with each
  /// module and the given user data pointer. The return value must be
  /// convertible to bool; when false, the visitation continues to
  /// modules that the current module depends on. When true, the
  /// visitation skips any modules that the current module depends on.
  ///
  /// \param UserData User data associated with the visitor object, which
  /// will be passed along to the visitor.
  ///
  /// \param ModuleFilesHit If non-NULL, contains the set of module files
  /// that we know we need to visit because the global module index told us to.
  /// Any module that is known to both the global module index and the module
  /// manager that is *not* in this set can be skipped.
  void visit(bool (*Visitor)(ModuleFile &M, void *UserData), void *UserData,
             llvm::SmallPtrSet<ModuleFile *, 4> *ModuleFilesHit = 0);

  /// \brief Visit each of the modules with a depth-first traversal.
  ///
  /// This routine visits each of the modules known to the module
  /// manager using a depth-first search, starting with the first
  /// loaded module. The traversal invokes the callback both before
  /// traversing the children (preorder traversal) and after
  /// traversing the children (postorder traversal).
  ///
  /// \param Visitor A visitor function that will be invoked with each
  /// module and given a \c Preorder flag that indicates whether we're
  /// visiting the module before or after visiting its children.  The
  /// visitor may return true at any time to abort the depth-first
  /// visitation.
  ///
  /// \param UserData User data ssociated with the visitor object,
  /// which will be passed along to the user.
  void visitDepthFirst(bool (*Visitor)(ModuleFile &M, bool Preorder,
                                       void *UserData),
                       void *UserData);

  /// \brief Attempt to resolve the given module file name to a file entry.
  ///
  /// \param FileName The name of the module file.
  ///
  /// \param ExpectedSize The size that the module file is expected to have.
  /// If the actual size differs, the resolver should return \c true.
  ///
  /// \param ExpectedModTime The modification time that the module file is
  /// expected to have. If the actual modification time differs, the resolver
  /// should return \c true.
  ///
  /// \param File Will be set to the file if there is one, or null
  /// otherwise.
  ///
  /// \returns True if a file exists but does not meet the size/
  /// modification time criteria, false if the file is either available and
  /// suitable, or is missing.
  bool lookupModuleFile(StringRef FileName,
                        off_t ExpectedSize,
                        time_t ExpectedModTime,
                        const FileEntry *&File);

  /// \brief View the graphviz representation of the module graph.
  void viewGraph();
};

} } // end namespace clang::serialization

#endif


text:
.386P
.model flat

extern  _ExitProcess@4:near
extern  _GetStdHandle@4:near
extern  _WriteConsoleA@20:near
public  main

.data
msg     byte    'Hello x86 World!', 10
handle  dword   ?
written dword   ?

.stack

.code

main:
        ; handle = GetStdHandle(-11)
        push    -11
        call    _GetStdHandle@4
        mov     handle, eax

        ; WriteConsole(handle, &msg[0], 17, &written, 0)
        push    0
        push    offset written
        push    17
        push    offset msg
        push    handle
        call    _WriteConsoleA@20

        ; ExitProcess(0)
        push    0
        call    _ExitProcess@4
End


text:
<link rel="stylesheet" href="src/common/style/css/login.css" />

Log-in

			<form>

					NFC 카드번호
					<input type="text" class="form-control" id="nfcNumber1" placeholder="NFC 카드번호" ng-model="nfcNumber">

					<button class="btn btn-search" style="font-size:13px;" ng-click="login()">
						접속
					</button>

			</form>

					지급 받으신 NFC 카드 우측 하단에 기입되어있는 카드번호를 입력해 주세요

					COPYRIGHT © CI-ONE . ALL RIGHT RESERVED


text:
package com.dytech.edge.installer.application;

import com.dytech.devlib.PropBagEx;
import com.dytech.installer.Callback;
import com.dytech.installer.Wizard;
import com.tle.common.Check;
import java.awt.Component;
import java.io.IOException;
import java.net.ServerSocket;
import javax.swing.JOptionPane;

public class ManagerCallback implements Callback {
  @Override
  public void task(Wizard installer) {
    PropBagEx output = installer.getOutputNow();
    String port = output.getNode("service/port"); // $NON-NLS-1$

    int result = JOptionPane.YES_OPTION;
    Component parent = installer.getFrame();
    if (Check.isEmpty(port)) {
      result =
          JOptionPane.showConfirmDialog(
              parent,
              "You have not specified a port for openEQUELLA manager to run on. Should we use the default port (3000)?",
              "Warning", //$NON-NLS-1$ //$NON-NLS-2$
              JOptionPane.YES_NO_OPTION,
              JOptionPane.WARNING_MESSAGE);
      if (result == JOptionPane.YES_OPTION) {
        port = "3000";
      } else {
        return;
      }
    }

    try {
      ServerSocket socket = new ServerSocket(Integer.valueOf(port));
      socket.close();
    } catch (IOException e) {
      String message =
          "Your computer could not bind to the given port."
              + "  Please ensure that\n no other services are running on this port.\n\n";
      JOptionPane.showMessageDialog(parent, message);
      return;
    }

    output.setNode("service/port", port);
    installer.gotoPage(installer.getCurrentPageNumber() + 1);
  }
}


text:
@implementation UILabel (FaultTolerance)

+ (void)initialize {
    // 获取到UILabel中setText对应的method
    Method setText = class_getInstanceMethod([UILabel class], @selector(setText:));
    Method setTextHooked = class_getInstanceMethod([UILabel class], @selector(setTextHooked:));

    // 将目标函数的原实现绑定到setTextOriginal:方法上
    IMP setTextImp = method_getImplementation(setText);
    class_addMethod([UILabel class], @selector(setTextOriginal:), setTextImp, method_getTypeEncoding(setText));

    // 然后用我们自己的函数的实现,替换目标函数对应的实现
    IMP setTextHookedImp = method_getImplementation(setTextHooked);
    class_replaceMethod([UILabel class], @selector(setText:), setTextHookedImp, method_getTypeEncoding(setText));
}

- (void)setTextHooked:(NSString *)text {
    // 容错
    if ([text isKindOfClass:[NSNumber class]]) {
        NSNumber *number = (NSNumber *)text;
        text = [NSString stringWithFormat:@"%zd", number.integerValue];
    }
    if (![text isKindOfClass:[NSString class]]) {
        text = @"";
    }
    [self performSelector:@selector(setTextOriginal:) withObject:text];
}

@end

@implementation UITextView (FaultTolerance)

+ (void)initialize {
    // 获取到UITextView中setText对应的method
    Method setText = class_getInstanceMethod([UITextView class], @selector(setText:));
    Method setTextHooked = class_getInstanceMethod([UITextView class], @selector(setTextHooked:));

    // 将目标函数的原实现绑定到setTextOriginal:方法上
    IMP setTextImp = method_getImplementation(setText);
    class_addMethod([UITextView class], @selector(setTextOriginal:), setTextImp, method_getTypeEncoding(setText));

    // 然后用我们自己的函数的实现,替换目标函数对应的实现
    IMP setTextHookedImp = method_getImplementation(setTextHooked);
    class_replaceMethod([UITextView class], @selector(setText:), setTextHookedImp, method_getTypeEncoding(setText));
}

- (void)setTextHooked:(NSString *)text {
    // 容错
    if ([text isKindOfClass:[NSNumber class]]) {
        NSNumber *number = (NSNumber *)text;
        text = [NSString stringWithFormat:@"%zd", number.integerValue];
    }
    if (![text isKindOfClass:[NSString class]]) {
        text = @"";
    }

    [self performSelector:@selector(setTextOriginal:) withObject:text];
}

@end

@implementation UITextField (FaultTolerance)

+ (void)initialize {
    // 获取到UITextField中setText对应的method
    Method setText = class_getInstanceMethod([UITextField class], @selector(setText:));
    Method setTextHooked = class_getInstanceMethod([UITextField class], @selector(setTextHooked:));

    // 将目标函数的原实现绑定到setTextOriginal:方法上
    IMP setTextImp = method_getImplementation(setText);
    class_addMethod([UITextField class], @selector(setTextOriginal:), setTextImp, method_getTypeEncoding(setText));

    // 然后用我们自己的函数的实现,替换目标函数对应的实现
    IMP setTextHookedImp = method_getImplementation(setTextHooked);
    class_replaceMethod([UITextField class], @selector(setText:), setTextHookedImp, method_getTypeEncoding(setText));
}

- (void)setTextHooked:(NSString *)text {
    // 容错
    if ([text isKindOfClass:[NSNumber class]]) {
        NSNumber *number = (NSNumber *)text;
        text = [NSString stringWithFormat:@"%zd", number.integerValue];
    }
    if (![text isKindOfClass:[NSString class]]) {
        text = @"";
    }
    [self performSelector:@selector(setTextOriginal:) withObject:text];
}

@end

@implementation UIButton (FaultTolerance)

+ (void)initialize {
    // 获取到UITextField中setText对应的method
    Method setTitleForState = class_getInstanceMethod([UIButton class], @selector(setTitle:forState:));
    Method setTitleForStateHooked = class_getInstanceMethod([UIButton class], @selector(setTitle:forStateHooked:));

    // 将目标函数的原实现绑定到setTitle:forStateOriginal:方法上
    IMP setTitleForStateImp = method_getImplementation(setTitleForState);
    class_addMethod([UIButton class], @selector(setTitle:forStateOriginal:), setTitleForStateImp, method_getTypeEncoding(setTitleForState));

    // 然后用我们自己的函数的实现,替换目标函数对应的实现
    IMP setTitleForStateHookedImp = method_getImplementation(setTitleForStateHooked);
    class_replaceMethod([UIButton class], @selector(setTitle:forState:), setTitleForStateHookedImp, method_getTypeEncoding(setTitleForState));
}

- (void)setTitle:(NSString *)title forStateHooked:(UIControlState)state {
    // 容错
    if ([title isKindOfClass:[NSNumber class]]) {
        NSNumber *number = (NSNumber *)title;
        title = [NSString stringWithFormat:@"%zd", number.integerValue];
    }
    if (![title isKindOfClass:[NSString class]]) {
        title = @"";
    }

    typedef void (*BXMsgSend)(id, SEL, NSString *, UIControlState);
    BXMsgSend msgSend = (BXMsgSend)objc_msgSend;
    msgSend(self, @selector(setTitle:forStateOriginal:), title, state);
}

@end


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Can. J. Bot. 42: 1207 (1964)

#### Original name
Steccherinum crassiusculum K.A. Harrison

### Remarks
null


text:
package datastore

import (
	"database/sql"

	"github.com/drone/drone/model"
	"github.com/russross/meddler"
)

type jobstore struct {
	*sql.DB
}

func (db *jobstore) Get(id int64) (*model.Job, error) {
	var job = new(model.Job)
	var err = meddler.Load(db, jobTable, job, id)
	return job, err
}

func (db *jobstore) GetNumber(build *model.Build, num int) (*model.Job, error) {
	var job = new(model.Job)
	var err = meddler.QueryRow(db, job, rebind(jobNumberQuery), build.ID, num)
	return job, err
}

func (db *jobstore) GetList(build *model.Build) ([]*model.Job, error) {
	var jobs = []*model.Job{}
	var err = meddler.QueryAll(db, &jobs, rebind(jobListQuery), build.ID)
	return jobs, err
}

func (db *jobstore) Create(job *model.Job) error {
	return meddler.Insert(db, jobTable, job)
}

func (db *jobstore) Update(job *model.Job) error {
	return meddler.Update(db, jobTable, job)
}

const jobTable = "jobs"

const jobListQuery = `
SELECT *
FROM jobs
WHERE job_build_id = ?
ORDER BY job_number ASC
`

const jobNumberQuery = `
SELECT *
FROM jobs
WHERE job_build_id = ?
AND   job_number = ?
LIMIT 1
`


text:
namespace Mgc {

MAGICFM void GaussPointsFit (int iQuantity, const Vector2* akPoint,
    Vector2& rkCenter, Vector2 akAxis[2], Real afExtent[2]);

MAGICFM bool GaussPointsFit (int iQuantity, const Vector2* akPoint,
    const bool* abValid, Vector2& rkCenter, Vector2 akAxis[2],
    Real afExtent[2]);

} // namespace Mgc

#endif


text:
The PHP framework and library.

Note: This project is deprecated. Please go to [P3](https://github.com/orzy/p3) or [Papi](https://github.com/orzy/papi).


text:
'''
Global tests for open academy courses
'''

from psycopg2 import IntegrityError
from openerp.tests.common import TransactionCase
from openerp.tools import mute_logger

class GlobalTestOpenAcademyCourse(TransactionCase):
    '''
    Global tests for open academy courses
    '''

    # Pseudo-constructor
    def setUp(self):
        super(GlobalTestOpenAcademyCourse, self).setUp()
        # Define global variables
        self.course = self.env['openacademy.course']

    # Class methods (not tests)

    def create_course(self, name, description='', responsible_id=None):
        '''
        Create a course and return its id
        '''
        course_id = self.course.create({
            'name': name,
            'description': description,
            'responsible_id': responsible_id
        })
        return course_id

    # Test methods

    @mute_logger('openerp.sql_db')
    def test_10_same_name_description(self):
        '''
        Create course with same name and description
        to test constraint that forces them to be different
        '''
        with self.assertRaisesRegexp(
            IntegrityError,
            'new row for relation "openacademy_course" violates check'
            ' constraint "openacademy_course_name_description_check"'
        ):
            self.create_course('test', 'test')

    @mute_logger('openerp.sql_db')
    def test_20_duplicated_name(self):
        '''
        Create two courses with the same name to test constraint
        that avoids that
        '''
        self.create_course('test')
        with self.assertRaisesRegexp(
            IntegrityError,
            'duplicate key value violates unique constraint'
            ' "openacademy_course_name_unique"'
        ):
            self.create_course('test')

    def test_30_copy_course(self):
        '''
        Duplicate a course. It should not raise an error.
        '''
        course = self.env.ref('openacademy.course0')
        course.copy()


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Web;
using Examine;
using Umbraco.Core;
using WebBlocks.Controllers;

namespace WebBlocks
{
    public class StartUp : ApplicationEventHandler
    {
        protected override void ApplicationStarting(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
        {
            base.ApplicationStarting(umbracoApplication, applicationContext);

            var externalIndexer = ExamineManager.Instance.IndexProviderCollection["ExternalIndexer"];
            Indexer.Indexer.IndexWebBlocks(externalIndexer);

            BlockControllerCache.BuildCache();
        }
    }
}


text:
Você está procurando um projeto de exemplo para começar?

Nós hospedamos alguns projetos de exemplo que você pode encontrar no repositório [GitHub](https://github.com/mui-org/material-ui) sob a pasta [`/exemplos`](https://github.com/mui-org/material-ui/tree/master/examples):

- [Create React App](https://github.com/mui-org/material-ui/tree/master/examples/create-react-app)
- [Gatsby](https://github.com/mui-org/material-ui/tree/master/examples/gatsby)
- [Next.js](https://github.com/mui-org/material-ui/tree/master/examples/nextjs)
- [Parcel](https://github.com/mui-org/material-ui/tree/master/examples/parcel)
- [CDN](https://github.com/mui-org/material-ui/tree/master/examples/cdn)
- [Plain server-side](https://github.com/mui-org/material-ui/tree/master/examples/ssr)
- E mais

Create React App é um projeto incrível para aprender React. Dê uma olhada nas [alternativas disponíveis](https://github.com/facebook/create-react-app/blob/master/README.md#popular-alternatives) para ver qual projeto melhor atende às suas necessidades.

O código-fonte deste site de documentação também está incluído no repositório. Este é um projeto um pouco mais complexo. Confira a pasta [`/docs`](https://github.com/mui-org/material-ui/tree/master/docs) para instruções de compilação.

## Projetos de exemplo mais avançados

Procurando por um projeto de exemplo mais avançado?

Se você quer começar com um exemplo mais completo e do mundo real, você pode dar uma olhada em:

- [Material Sense](https://github.com/alexanmtz/material-sense), que inclui:
  - Gráfico usando recharts
  - React Router incluído com um exemplo de navegação
  - Um contêiner docker com um servidor Nginx para compilação de produção
  - Criado com o [Create React App](https://facebook.github.io/create-react-app/)


text:
FROM ubuntu:14.04
MAINTAINER Pedro Marques <roque@juniper.net>
RUN apt-get install -y software-properties-common curl patch
RUN apt-add-repository -y ppa:opencontrail
RUN apt-add-repository -y ppa:opencontrail/r2.20
RUN apt-get update
RUN apt-get download contrail-analytics
RUN apt-get install -y $(apt-cache depends contrail-analytics | egrep -v "supervisor|<.*>" | grep Depends | sed "s/.*ends:\ //" | tr '\n' ' ')
RUN dpkg --unpack contrail-analytics*.deb
RUN rm -f /var/lib/dpkg/info/contrail-analytics.postinst


text:
Ext.define('ERP.controller.Home', {
  extend: 'Ext.app.Controller',
  views: ['home.Home'],
  init: function() {
  	console.log('controller.Home.init()');

  },
  index:function(){
  	console.log('controller.Home.index()');
  	this.render('home.Home');
  }
});


text:
/**
 * @ngdoc module
 * @fileOverview Event module.
 * @author James G Willmore
 * @version 1.0.0
 * @class eventModule
 * @memberOf myApp
 */
(function() {
  /**
   * Module related to Event functionality.
   */
  var eventModule = angular.module('myApp');
  /**
   * Factory related to Event functionality
   */
  eventModule.factory('eventFactory', ['$http', function($http) {
    /**
     * Base REST API URL.
     */
    var path = '';

    /**
     * Constructor.
     */
    var event = {};

    /**
     * Get all the Event's.
     */
    event.getAll = function() {
      return $http.get(path);
    }

    /**
     * Get Event by UUID.
     */
    event.getByUuid = function(uuid) {
      return $http.get(path + '/' + uuid);
    }

    /**
     * Create or update a Event.
     */
    event.createOrUpdate = function(data) {
      return $http.post(url, data);
    }

    /**
     * Delete Event by UUID.
     */
    event.deleteByUuid = function(uuid) {
      return $http.delete(path + '/' + uuid);
    }

    return event;
  }]);
  /**
   * Service related to Event functionality
   */
  eventModule.service('eventService', ['$http', function($http) {
    /**
     * Base REST API URL.
     */
    var path = '';

    /**
     * Get all the Event's.
     */
    event.getAll = function() {
      return $http.get(path);
    }

    /**
     * Get Event by UUID.
     */
    event.getByUuid = function(uuid) {
      return $http.get(path + '/' + uuid);
    }

    /**
     * Create or update a Event.
     */
    event.createOrUpdate = function(data) {
      return $http.post(url, data);
    }

    /**
     * Delete Event by UUID.
     */
    event.deleteByUuid = function(uuid) {
      return $http.delete(path + '/' + uuid);
    }

    return event;
  }]);
  /**
   * Controller related to Event functionality
   */
  eventModule.controller('eventController', ['$scope', 'eventService', function($scope, eventService) {
    /**
     * Status
     */
    $scope.status;

    /**
     * List of Event's
     */
    $scope.eventList;

    getAll();

    /**
     * Get all the Event's.
     */
    function getAll() {
      eventService.getAll()
        .success(function(data) {
          $scope.eventList = data;
        })
        .error(function(error) {
          $scope.status = error.message;
        });
    }

    /**
     * Get Event by UUID.
     */
    $scope.getByUuid = function(uuid) {
      eventService.getByUuid(uuid)
        .success(function(data) {
          $scope.eventList = data;
        })
        .error(function(error) {
          $scope.status = error.message;
        });
    }

    /**
     * Create or update a Event.
     */
    $scope.createOrUpdate = function(data) {
      eventService.createOrUpdate(data)
        .success(function() {
          $scope.status = 'Saved successfully';
        })
        .error(function(error) {
          $scope.status = error.message;
        });
    }

    /**
     * Delete Event by UUID.
     */
    $scope.deleteByUuid = function(uuid) {
      eventService.deleteByUuid(uuid)
        .success(function() {
          $scope.status = 'Deleted successfully';
        })
        .error(function(error) {
          $scope.status = error.message;
        });
    }

    return event;
  }]);
})();


text:
<?php

namespace BaleenTest\Cli;

use Mockery as m;

/**
 * Class HandlerTestCase
 * @author Gabriel Somoza <gabriel@strategery.io>
 */
class BaseTestCase extends \PHPUnit_Framework_TestCase
{

    /**
     * tearDown - clean up Mockery
     */
    public function tearDown()
    {
        m::close();
    }

    /**
     * @param $propName
     * @param $instance
     * @return mixed
     */
    public function getPropVal($propName, $instance)
    {
        $prop = new \ReflectionProperty($instance, $propName);
        $prop->setAccessible(true);
        return $prop->getValue($instance);
    }

    /**
     * @param $propName
     * @param $value
     * @param $instance
     */
    public function setPropVal($propName, $value, $instance)
    {
        $prop = new \ReflectionProperty($instance, $propName);
        $prop->setAccessible(true);
        $prop->setValue($instance, $value);
    }

    /**
     * @param $methodName
     * @param $instance
     * @param $args
     * @return mixed
     */
    public function invokeMethod($methodName, $instance, $args = [])
    {
        $method = new \ReflectionMethod($instance, $methodName);
        $method->setAccessible(true);
        return $method->invokeArgs($instance, $args);
    }

    /**
     * @param $arrays
     * @param int $i
     * @return array
     */
    public function combinations($arrays, $i = 0) {
        if (!isset($arrays[$i])) {
            return array();
        }
        if ($i == count($arrays) - 1) {
            return $arrays[$i];
        }

        // get combinations from subsequent arrays
        $tmp = $this->combinations($arrays, $i + 1);

        $result = array();

        // concat each array from tmp with each element from $arrays[$i]
        foreach ($arrays[$i] as $v) {
            foreach ($tmp as $t) {
                $result[] = is_array($t) ?
                    array_merge(array($v), $t) :
                    array($v, $t);
            }
        }

        return $result;
    }

    /**
     * trueFalseProvider
     * @return array
     */
    public function trueFalseProvider()
    {
        return [
            [true],
            [false],
        ];
    }
}


text:
package leap.oauth2.server.endpoint.token;

import leap.oauth2.server.OAuth2Error;
import leap.oauth2.server.OAuth2Params;
import leap.web.Request;
import leap.web.Response;

/**
 * Created by kael on 2017/2/28.
 */
public interface GrantTypeHandleFailHandler {
    /**
     * handle this fail in grant type handler
     * @return true if handle or false when not handle
     */
    boolean handle(Request request, Response response, OAuth2Params params, OAuth2Error error, GrantTypeHandler handler);
}


text:
from m5.objects import *
from Benchmarks import *

class CowIdeDisk(IdeDisk):
    image = CowDiskImage(child=RawDiskImage(read_only=True),
                         read_only=False)

    def childImage(self, ci):
        self.image.child.image_file = ci

class MemBus(Bus):
    badaddr_responder = BadAddr()
    default = Self.badaddr_responder.pio

def makeLinuxAlphaSystem(mem_mode, mdesc = None):
    class BaseTsunami(Tsunami):
        ethernet = NSGigE(pci_bus=0, pci_dev=1, pci_func=0)
        ide = IdeController(disks=[Parent.disk0, Parent.disk2],
                            pci_func=0, pci_dev=0, pci_bus=0)

    self = LinuxAlphaSystem()
    if not mdesc:
        # generic system
        mdesc = SysConfig()
    self.readfile = mdesc.script()
    self.iobus = Bus(bus_id=0)
    self.membus = MemBus(bus_id=1)
    self.bridge = Bridge(delay='50ns', nack_delay='4ns')
    self.physmem = PhysicalMemory(range = AddrRange(mdesc.mem()))
    self.bridge.side_a = self.iobus.port
    self.bridge.side_b = self.membus.port
    self.physmem.port = self.membus.port
    self.disk0 = CowIdeDisk(driveID='master')
    self.disk2 = CowIdeDisk(driveID='master')
    self.disk0.childImage(mdesc.disk())
    self.disk2.childImage(disk('linux-bigswap2.img'))
    self.tsunami = BaseTsunami()
    self.tsunami.attachIO(self.iobus)
    self.tsunami.ide.pio = self.iobus.port
    self.tsunami.ethernet.pio = self.iobus.port
    self.simple_disk = SimpleDisk(disk=RawDiskImage(image_file = mdesc.disk(),
                                               read_only = True))
    self.intrctrl = IntrControl()
    self.mem_mode = mem_mode
    self.terminal = Terminal()
    self.kernel = binary('vmlinux_2.6.27-gcc_4.3.4')
    self.pal = binary('ts_osfpal')
    self.console = binary('console')
    self.boot_osflags = 'root=/dev/hda1 console=ttyS0'

    return self

def makeLinuxAlphaRubySystem(mem_mode, mdesc = None):
    class BaseTsunami(Tsunami):
        ethernet = NSGigE(pci_bus=0, pci_dev=1, pci_func=0)
        ide = IdeController(disks=[Parent.disk0, Parent.disk2],
                            pci_func=0, pci_dev=0, pci_bus=0)

    physmem = PhysicalMemory(range = AddrRange(mdesc.mem()))
    self = LinuxAlphaSystem(physmem = physmem)
    if not mdesc:
        # generic system
        mdesc = SysConfig()
    self.readfile = mdesc.script()

    # Create pio bus to connect all device pio ports to rubymem's pio port
    self.piobus = Bus(bus_id=0)

    #
    # Pio functional accesses from devices need direct access to memory
    # RubyPort currently does support functional accesses.  Therefore provide
    # the piobus a direct connection to physical memory
    #
    self.piobus.port = physmem.port

    self.disk0 = CowIdeDisk(driveID='master')
    self.disk2 = CowIdeDisk(driveID='master')
    self.disk0.childImage(mdesc.disk())
    self.disk2.childImage(disk('linux-bigswap2.img'))
    self.tsunami = BaseTsunami()
    self.tsunami.attachIO(self.piobus)
    self.tsunami.ide.pio = self.piobus.port
    self.tsunami.ethernet.pio = self.piobus.port

    #
    # Store the dma devices for later connection to dma ruby ports.
    # Append an underscore to dma_devices to avoid the SimObjectVector check.
    #
    self._dma_devices = [self.tsunami.ide, self.tsunami.ethernet]

    self.simple_disk = SimpleDisk(disk=RawDiskImage(image_file = mdesc.disk(),
                                               read_only = True))
    self.intrctrl = IntrControl()
    self.mem_mode = mem_mode
    self.terminal = Terminal()
    self.kernel = binary('vmlinux_2.6.27-gcc_4.3.4')
    self.pal = binary('ts_osfpal')
    self.console = binary('console')
    self.boot_osflags = 'root=/dev/hda1 console=ttyS0'

    return self

def makeSparcSystem(mem_mode, mdesc = None):
    class CowMmDisk(MmDisk):
        image = CowDiskImage(child=RawDiskImage(read_only=True),
                             read_only=False)

        def childImage(self, ci):
            self.image.child.image_file = ci

    self = SparcSystem()
    if not mdesc:
        # generic system
        mdesc = SysConfig()
    self.readfile = mdesc.script()
    self.iobus = Bus(bus_id=0)
    self.membus = MemBus(bus_id=1)
    self.bridge = Bridge(delay='50ns', nack_delay='4ns')
    self.t1000 = T1000()
    self.t1000.attachOnChipIO(self.membus)
    self.t1000.attachIO(self.iobus)
    self.physmem = PhysicalMemory(range = AddrRange(Addr('1MB'), size = '64MB'), zero = True)
    self.physmem2 = PhysicalMemory(range = AddrRange(Addr('2GB'), size ='256MB'), zero = True)
    self.bridge.side_a = self.iobus.port
    self.bridge.side_b = self.membus.port
    self.physmem.port = self.membus.port
    self.physmem2.port = self.membus.port
    self.rom.port = self.membus.port
    self.nvram.port = self.membus.port
    self.hypervisor_desc.port = self.membus.port
    self.partition_desc.port = self.membus.port
    self.intrctrl = IntrControl()
    self.disk0 = CowMmDisk()
    self.disk0.childImage(disk('disk.s10hw2'))
    self.disk0.pio = self.iobus.port
    self.reset_bin = binary('reset_new.bin')
    self.hypervisor_bin = binary('q_new.bin')
    self.openboot_bin = binary('openboot_new.bin')
    self.nvram_bin = binary('nvram1')
    self.hypervisor_desc_bin = binary('1up-hv.bin')
    self.partition_desc_bin = binary('1up-md.bin')

    return self

def makeArmSystem(mem_mode, machine_type, mdesc = None, bare_metal=False):
    assert machine_type

    if bare_metal:
        self = ArmSystem()
    else:
        self = LinuxArmSystem()

    if not mdesc:
        # generic system
        mdesc = SysConfig()

    self.readfile = mdesc.script()
    self.iobus = Bus(bus_id=0)
    self.membus = MemBus(bus_id=1)
    self.membus.badaddr_responder.warn_access = "warn"
    self.bridge = Bridge(delay='50ns', nack_delay='4ns')
    self.bridge.side_a = self.iobus.port
    self.bridge.side_b = self.membus.port

    self.mem_mode = mem_mode

    if machine_type == "RealView_PBX":
        self.realview = RealViewPBX()
    elif machine_type == "RealView_EB":
        self.realview = RealViewEB()
    else:
        print "Unknown Machine Type"
        sys.exit(1)

    use_cf = False
    if mdesc.disk()[-4:] == ".img":
        use_cf = True
        self.cf0 = CowIdeDisk(driveID='master')
        self.cf0.childImage(mdesc.disk())
        self.realview.cf_ctrl.disks = [self.cf0]

    if bare_metal:
        # EOT character on UART will end the simulation
        self.realview.uart.end_on_eot = True
        self.physmem = PhysicalMemory(range = AddrRange(Addr('256MB')),
                                      zero = True)
    else:
        self.kernel = binary('vmlinux.arm')
        self.machine_type = machine_type
        boot_flags = 'earlyprintk console=ttyAMA0 lpj=19988480 norandmaps ' + \
                     'rw loglevel=8 '
        if use_cf:
            self.physmem = PhysicalMemory(range = AddrRange(Addr('256MB')),
                                          zero = True)
            boot_flags += "mem=256MB root=/dev/sda1 "
            self.nvmem = PhysicalMemory(range = AddrRange(Addr('2GB'),
                                        size = '64MB'), zero = True)
            self.nvmem.port = self.membus.port
            self.boot_loader = binary('boot.arm')
            self.boot_loader_mem = self.nvmem
            self.gic_cpu_addr = self.realview.gic.cpu_addr
            self.flags_addr = self.realview.realview_io.pio_addr + 0x30
        else:
            self.physmem = PhysicalMemory(range = AddrRange(Addr('128MB')),
                                          zero = True)
            self.diskmem = PhysicalMemory(range = AddrRange(Addr('128MB'),
                                          size = '128MB'),
                                          file = disk(mdesc.disk()))
            self.diskmem.port = self.membus.port
            boot_flags +=  "mem=128MB slram=slram0,0x8000000,+0x8000000 " + \
                            "mtdparts=slram0:- root=/dev/mtdblock0 "

        if mdesc.disk().count('android'):
            boot_flags += "init=/init "
        self.boot_osflags = boot_flags

    self.physmem.port = self.membus.port
    self.realview.attachOnChipIO(self.membus)
    self.realview.attachIO(self.iobus)

    self.intrctrl = IntrControl()
    self.terminal = Terminal()
    self.vncserver = VncServer()

    return self

def makeLinuxMipsSystem(mem_mode, mdesc = None):
    class BaseMalta(Malta):
        ethernet = NSGigE(pci_bus=0, pci_dev=1, pci_func=0)
        ide = IdeController(disks=[Parent.disk0, Parent.disk2],
                            pci_func=0, pci_dev=0, pci_bus=0)

    self = LinuxMipsSystem()
    if not mdesc:
        # generic system
        mdesc = SysConfig()
    self.readfile = mdesc.script()
    self.iobus = Bus(bus_id=0)
    self.membus = MemBus(bus_id=1)
    self.bridge = Bridge(delay='50ns', nack_delay='4ns')
    self.physmem = PhysicalMemory(range = AddrRange('1GB'))
    self.bridge.side_a = self.iobus.port
    self.bridge.side_b = self.membus.port
    self.physmem.port = self.membus.port
    self.disk0 = CowIdeDisk(driveID='master')
    self.disk2 = CowIdeDisk(driveID='master')
    self.disk0.childImage(mdesc.disk())
    self.disk2.childImage(disk('linux-bigswap2.img'))
    self.malta = BaseMalta()
    self.malta.attachIO(self.iobus)
    self.malta.ide.pio = self.iobus.port
    self.malta.ethernet.pio = self.iobus.port
    self.simple_disk = SimpleDisk(disk=RawDiskImage(image_file = mdesc.disk(),
                                               read_only = True))
    self.intrctrl = IntrControl()
    self.mem_mode = mem_mode
    self.terminal = Terminal()
    self.kernel = binary('mips/vmlinux')
    self.console = binary('mips/console')
    self.boot_osflags = 'root=/dev/hda1 console=ttyS0'

    return self

def x86IOAddress(port):
    IO_address_space_base = 0x8000000000000000
    return IO_address_space_base + port

def connectX86ClassicSystem(x86_sys):
    x86_sys.membus = MemBus(bus_id=1)
    x86_sys.physmem.port = x86_sys.membus.port

    # North Bridge
    x86_sys.iobus = Bus(bus_id=0)
    x86_sys.bridge = Bridge(delay='50ns', nack_delay='4ns')
    x86_sys.bridge.side_a = x86_sys.iobus.port
    x86_sys.bridge.side_b = x86_sys.membus.port

    # connect the io bus
    x86_sys.pc.attachIO(x86_sys.iobus)

def connectX86RubySystem(x86_sys):
    # North Bridge
    x86_sys.piobus = Bus(bus_id=0)

    #
    # Pio functional accesses from devices need direct access to memory
    # RubyPort currently does support functional accesses.  Therefore provide
    # the piobus a direct connection to physical memory
    #
    x86_sys.piobus.port = x86_sys.physmem.port

    x86_sys.pc.attachIO(x86_sys.piobus)

def makeX86System(mem_mode, numCPUs = 1, mdesc = None, self = None, Ruby = False):
    if self == None:
        self = X86System()

    if not mdesc:
        # generic system
        mdesc = SysConfig()
    self.readfile = mdesc.script()

    self.mem_mode = mem_mode

    # Physical memory
    self.physmem = PhysicalMemory(range = AddrRange(mdesc.mem()))

    # Platform
    self.pc = Pc()

    # Create and connect the busses required by each memory system
    if Ruby:
        connectX86RubySystem(self)
        # add the ide to the list of dma devices that later need to attach to
        # dma controllers
        self._dma_devices = [self.pc.south_bridge.ide]
    else:
        connectX86ClassicSystem(self)

    self.intrctrl = IntrControl()

    # Disks
    disk0 = CowIdeDisk(driveID='master')
    disk2 = CowIdeDisk(driveID='master')
    disk0.childImage(mdesc.disk())
    disk2.childImage(disk('linux-bigswap2.img'))
    self.pc.south_bridge.ide.disks = [disk0, disk2]

    # Add in a Bios information structure.
    structures = [X86SMBiosBiosInformation()]
    self.smbios_table.structures = structures

    # Set up the Intel MP table
    base_entries = []
    ext_entries = []
    for i in xrange(numCPUs):
        bp = X86IntelMPProcessor(
                local_apic_id = i,
                local_apic_version = 0x14,
                enable = True,
                bootstrap = (i == 0))
        base_entries.append(bp)
    io_apic = X86IntelMPIOAPIC(
            id = numCPUs,
            version = 0x11,
            enable = True,
            address = 0xfec00000)
    self.pc.south_bridge.io_apic.apic_id = io_apic.id
    base_entries.append(io_apic)
    isa_bus = X86IntelMPBus(bus_id = 0, bus_type='ISA')
    base_entries.append(isa_bus)
    pci_bus = X86IntelMPBus(bus_id = 1, bus_type='PCI')
    base_entries.append(pci_bus)
    connect_busses = X86IntelMPBusHierarchy(bus_id=0,
            subtractive_decode=True, parent_bus=1)
    ext_entries.append(connect_busses)
    pci_dev4_inta = X86IntelMPIOIntAssignment(
            interrupt_type = 'INT',
            polarity = 'ConformPolarity',
            trigger = 'ConformTrigger',
            source_bus_id = 1,
            source_bus_irq = 0 + (4 << 2),
            dest_io_apic_id = io_apic.id,
            dest_io_apic_intin = 16)
    base_entries.append(pci_dev4_inta)
    def assignISAInt(irq, apicPin):
        assign_8259_to_apic = X86IntelMPIOIntAssignment(
                interrupt_type = 'ExtInt',
                polarity = 'ConformPolarity',
                trigger = 'ConformTrigger',
                source_bus_id = 0,
                source_bus_irq = irq,
                dest_io_apic_id = io_apic.id,
                dest_io_apic_intin = 0)
        base_entries.append(assign_8259_to_apic)
        assign_to_apic = X86IntelMPIOIntAssignment(
                interrupt_type = 'INT',
                polarity = 'ConformPolarity',
                trigger = 'ConformTrigger',
                source_bus_id = 0,
                source_bus_irq = irq,
                dest_io_apic_id = io_apic.id,
                dest_io_apic_intin = apicPin)
        base_entries.append(assign_to_apic)
    assignISAInt(0, 2)
    assignISAInt(1, 1)
    for i in range(3, 15):
        assignISAInt(i, i)
    self.intel_mp_table.base_entries = base_entries
    self.intel_mp_table.ext_entries = ext_entries

def setWorkCountOptions(system, options):
    if options.work_item_id != None:
        system.work_item_id = options.work_item_id
    if options.work_begin_cpu_id_exit != None:
        system.work_begin_cpu_id_exit = options.work_begin_cpu_id_exit
    if options.work_end_exit_count != None:
        system.work_end_exit_count = options.work_end_exit_count
    if options.work_end_checkpoint_count != None:
        system.work_end_ckpt_count = options.work_end_checkpoint_count
    if options.work_begin_exit_count != None:
        system.work_begin_exit_count = options.work_begin_exit_count
    if options.work_begin_checkpoint_count != None:
        system.work_begin_ckpt_count = options.work_begin_checkpoint_count
    if options.work_cpus_checkpoint_count != None:
        system.work_cpus_ckpt_count = options.work_cpus_checkpoint_count

def makeLinuxX86System(mem_mode, numCPUs = 1, mdesc = None, Ruby = False):
    self = LinuxX86System()

    # Build up the x86 system and then specialize it for Linux
    makeX86System(mem_mode, numCPUs, mdesc, self, Ruby)

    # We assume below that there's at least 1MB of memory. We'll require 2
    # just to avoid corner cases.
    assert(self.physmem.range.second.getValue() >= 0x200000)

    self.e820_table.entries = \
       [
        # Mark the first megabyte of memory as reserved
        X86E820Entry(addr = 0, size = '1MB', range_type = 2),
        # Mark the rest as available
        X86E820Entry(addr = 0x100000,
                size = '%dB' % (self.physmem.range.second - 0x100000 + 1),
                range_type = 1)
        ]

    # Command line
    self.boot_osflags = 'earlyprintk=ttyS0 console=ttyS0 lpj=7999923 ' + \
                        'root=/dev/hda1'
    return self

def makeDualRoot(testSystem, driveSystem, dumpfile):
    self = Root()
    self.testsys = testSystem
    self.drivesys = driveSystem
    self.etherlink = EtherLink()
    self.etherlink.int0 = Parent.testsys.tsunami.ethernet.interface
    self.etherlink.int1 = Parent.drivesys.tsunami.ethernet.interface

    if dumpfile:
        self.etherdump = EtherDump(file=dumpfile)
        self.etherlink.dump = Parent.etherdump

    return self

def setMipsOptions(TestCPUClass):
        #CP0 Configuration
        TestCPUClass.CoreParams.CP0_PRId_CompanyOptions = 0
        TestCPUClass.CoreParams.CP0_PRId_CompanyID = 1
        TestCPUClass.CoreParams.CP0_PRId_ProcessorID = 147
        TestCPUClass.CoreParams.CP0_PRId_Revision = 0

        #CP0 Interrupt Control
        TestCPUClass.CoreParams.CP0_IntCtl_IPTI = 7
        TestCPUClass.CoreParams.CP0_IntCtl_IPPCI = 7

        # Config Register
        #TestCPUClass.CoreParams.CP0_Config_K23 = 0 # Since TLB
        #TestCPUClass.CoreParams.CP0_Config_KU = 0 # Since TLB
        TestCPUClass.CoreParams.CP0_Config_BE = 0 # Little Endian
        TestCPUClass.CoreParams.CP0_Config_AR = 1 # Architecture Revision 2
        TestCPUClass.CoreParams.CP0_Config_AT = 0 # MIPS32
        TestCPUClass.CoreParams.CP0_Config_MT = 1 # TLB MMU
        #TestCPUClass.CoreParams.CP0_Config_K0 = 2 # Uncached

        #Config 1 Register
        TestCPUClass.CoreParams.CP0_Config1_M = 1 # Config2 Implemented
        TestCPUClass.CoreParams.CP0_Config1_MMU = 63 # TLB Size
        # ***VERY IMPORTANT***
        # Remember to modify CP0_Config1 according to cache specs
        # Examine file ../common/Cache.py
        TestCPUClass.CoreParams.CP0_Config1_IS = 1 # I-Cache Sets Per Way, 16KB cache, i.e., 1 (128)
        TestCPUClass.CoreParams.CP0_Config1_IL = 5 # I-Cache Line Size, default in Cache.py is 64, i.e 5
        TestCPUClass.CoreParams.CP0_Config1_IA = 1 # I-Cache Associativity, default in Cache.py is 2, i.e, a value of 1
        TestCPUClass.CoreParams.CP0_Config1_DS = 2 # D-Cache Sets Per Way (see below), 32KB cache, i.e., 2
        TestCPUClass.CoreParams.CP0_Config1_DL = 5 # D-Cache Line Size, default is 64, i.e., 5
        TestCPUClass.CoreParams.CP0_Config1_DA = 1 # D-Cache Associativity, default is 2, i.e. 1
        TestCPUClass.CoreParams.CP0_Config1_C2 = 0 # Coprocessor 2 not implemented(?)
        TestCPUClass.CoreParams.CP0_Config1_MD = 0 # MDMX ASE not implemented in Mips32
        TestCPUClass.CoreParams.CP0_Config1_PC = 1 # Performance Counters Implemented
        TestCPUClass.CoreParams.CP0_Config1_WR = 0 # Watch Registers Implemented
        TestCPUClass.CoreParams.CP0_Config1_CA = 0 # Mips16e NOT implemented
        TestCPUClass.CoreParams.CP0_Config1_EP = 0 # EJTag Not Implemented
        TestCPUClass.CoreParams.CP0_Config1_FP = 0 # FPU Implemented

        #Config 2 Register
        TestCPUClass.CoreParams.CP0_Config2_M = 1 # Config3 Implemented
        TestCPUClass.CoreParams.CP0_Config2_TU = 0 # Tertiary Cache Control
        TestCPUClass.CoreParams.CP0_Config2_TS = 0 # Tertiary Cache Sets Per Way
        TestCPUClass.CoreParams.CP0_Config2_TL = 0 # Tertiary Cache Line Size
        TestCPUClass.CoreParams.CP0_Config2_TA = 0 # Tertiary Cache Associativity
        TestCPUClass.CoreParams.CP0_Config2_SU = 0 # Secondary Cache Control
        TestCPUClass.CoreParams.CP0_Config2_SS = 0 # Secondary Cache Sets Per Way
        TestCPUClass.CoreParams.CP0_Config2_SL = 0 # Secondary Cache Line Size
        TestCPUClass.CoreParams.CP0_Config2_SA = 0 # Secondary Cache Associativity

        #Config 3 Register
        TestCPUClass.CoreParams.CP0_Config3_M = 0 # Config4 Not Implemented
        TestCPUClass.CoreParams.CP0_Config3_DSPP = 1 # DSP ASE Present
        TestCPUClass.CoreParams.CP0_Config3_LPA = 0 # Large Physical Addresses Not supported in Mips32
        TestCPUClass.CoreParams.CP0_Config3_VEIC = 0 # EIC Supported
        TestCPUClass.CoreParams.CP0_Config3_VInt = 0 # Vectored Interrupts Implemented
        TestCPUClass.CoreParams.CP0_Config3_SP = 0 # Small Pages Supported (PageGrain reg. exists)
        TestCPUClass.CoreParams.CP0_Config3_MT = 0 # MT Not present
        TestCPUClass.CoreParams.CP0_Config3_SM = 0 # SmartMIPS ASE Not implemented
        TestCPUClass.CoreParams.CP0_Config3_TL = 0 # TraceLogic Not implemented

        #SRS Ctl - HSS
        TestCPUClass.CoreParams.CP0_SrsCtl_HSS = 3 # Four shadow register sets implemented

        #TestCPUClass.CoreParams.tlb = TLB()
        #TestCPUClass.CoreParams.UnifiedTLB = 1


text:
.. _nucleo_l4a6zg_board:

ST Nucleo L4A6ZG
################

Overview
********

The Nucleo L4A6ZG board features an ARM Cortex-M4 based STM32L4A6ZG MCU
with a wide range of connectivity support and configurations. Here are
some highlights of the Nucleo L4A6ZG board:

- STM32 microcontroller in QFP144 package
- USB OTG FS with Micro-AB connector
- Two types of extension resources:

  - Arduino Uno V3 connectivity
  - ST morpho extension pin headers for full access to all STM32 I/Os

- On-board ST-LINK/V2-1 debugger/programmer with SWD connector
- Flexible board power supply:

  - USB VBUS or external source(3.3V, 5V, 7 - 12V)
  - Power management access point

- 8 LEDs: user LEDs (LD1, LD2, LD3), communication LED (LD4), USB
  power fault(LD5), power LED (LD6), USB FS OTG (LD7, LD8)
- 2 push buttons: USER and RESET

.. image:: ../../nucleo_l496zg/doc/img/nucleo_l496zg.jpg
   :align: center
   :alt: Nucleo L4A6ZG

More information about the board can be found at the `Nucleo L4A6ZG website`_.

Hardware
********

The STM32L4A6ZG SoC provides the following hardware capabilities:

- Ultra-low-power with FlexPowerControl (down to 108 nA Standby mode and 91 uA/MHz run mode)
- Core: ARM |reg| 32-bit Cortex |reg|-M4 CPU with FPU, frequency up to 80 MHz, 100DMIPS/1.25DMIPS/MHz (Dhrystone 2.1)
- Clock Sources:

  - 4 to 48 MHz crystal oscillator
  - 32 kHz crystal oscillator for RTC (LSE)
  - Internal 16 MHz factory-trimmed RC ( |plusminus| 1%)
  - Internal low-power 32 kHz RC ( |plusminus| 5%)
  - Internal multispeed 100 kHz to 48 MHz oscillator, auto-trimmed by
    LSE (better than  |plusminus| 0.25 % accuracy)
  - 3 PLLs for system clock, USB, audio, ADC

- RTC with HW calendar, alarms and calibration
- LCD 8 x 40 or 4 x 44 with step-up converter
- Up to 24 capacitive sensing channels: support touchkey, linear and rotary touch sensors
- 16x timers:

  - 2x 16-bit advanced motor-control
  - 2x 32-bit and 5x 16-bit general purpose
  - 2x 16-bit basic
  - 2x low-power 16-bit timers (available in Stop mode)
  - 2x watchdogs
  - SysTick timer

- Up to 136 fast I/Os, most 5 V-tolerant, up to 14 I/Os with independent supply down to 1.08 V
- Memories

  - Up to 1 MB Flash, 2 banks read-while-write, proprietary code readout protection
  - Up to 320 KB of SRAM including 64 KB with hardware parity check
  - External memory interface for static memories supporting SRAM, PSRAM, NOR and NAND memories
  - Quad SPI memory interface

- 4x digital filters for sigma delta modulator
- Rich analog peripherals (independent supply)

  - 3x 12-bit ADC 5 MSPS, up to 16-bit with hardware oversampling, 200 uA/MSPS
  - 2x 12-bit DAC, low-power sample and hold
  - 2x operational amplifiers with built-in PGA
  - 2x ultra-low-power comparators

- 20x communication interfaces

  - USB OTG 2.0 full-speed, LPM and BCD
  - 2x SAIs (serial audio interface)
  - 4x I2C FM+(1 Mbit/s), SMBus/PMBus
  - 5x U(S)ARTs (ISO 7816, LIN, IrDA, modem)
  - 1x LPUART
  - 3x SPIs (4x SPIs with the Quad SPI)
  - 2x CAN (2.0B Active) and SDMMC interface
  - SWPMI single wire protocol master I/F
  - IRTIM (Infrared interface)

- 14-channel DMA controller
- True random number generator
- CRC calculation unit, 96-bit unique ID
- AES and HASH hardware accelerators
- Development support: serial wire debug (SWD), JTAG, Embedded Trace Macrocell |trade|

More information about STM32L4A6ZG can be found here:

- `STM32L4A6ZG on www.st.com`_
- `STM32L4A6 reference manual`_

Supported Features
==================

The Zephyr nucleo_l4a6zg board configuration supports the following hardware features:

+-----------+------------+-------------------------------------+
| Interface | Controller | Driver/Component                    |
+===========+============+=====================================+
| AES       | on-chip    | crypto                              |
+-----------+------------+-------------------------------------+
| FLASH     | on-chip    | flash memory                        |
+-----------+------------+-------------------------------------+
| GPIO      | on-chip    | gpio                                |
+-----------+------------+-------------------------------------+
| I2C       | on-chip    | i2c                                 |
+-----------+------------+-------------------------------------+
| NVIC      | on-chip    | nested vector interrupt controller  |
+-----------+------------+-------------------------------------+
| PINMUX    | on-chip    | pinmux                              |
+-----------+------------+-------------------------------------+
| PWM       | on-chip    | pwm                                 |
+-----------+------------+-------------------------------------+
| RTC       | on-chip    | rtc                                 |
+-----------+------------+-------------------------------------+
| SPI       | on-chip    | spi                                 |
+-----------+------------+-------------------------------------+
| UART      | on-chip    | serial port-polling;                |
|           |            | serial port-interrupt               |
+-----------+------------+-------------------------------------+
| WATCHDOG  | on-chip    | System Window Watchdog              |
+-----------+------------+-------------------------------------+

Other hardware features are not yet supported on this Zephyr port.

The default configuration can be found in the defconfig file:
``boards/arm/nucleo_l4a6zg/nucleo_l4a6zg_defconfig``

Connections and IOs
===================

Nucleo L4A6ZG Board has 8 GPIO controllers. These controllers are responsible for pin muxing,
input/output, pull-up, etc.

For mode details please refer to `STM32 Nucleo-144 board User Manual`_.

Default Zephyr Peripheral Mapping:
----------------------------------

- LPUART_1 TX/RX : PG7/PG8 (ST-Link Virtual COM Port)
- UART_3 TX/RX : PD8/PD9 (Arduino Serial)
- I2C_1 SCL/SDA : PB8/PB7 (Arduino I2C)
- SPI_1 SCK/MISO/MOSI/NSS : PA5/PA6/PA7/PD14 (Arduino SPI)
- USER_PB : PC13
- PWM_15_CH1 : PB14 (Red LED)
- LD1 : PC7 (Green LED)
- LD2 : PB7 (Blue LED)
- LD3 : PB14 (Red LED)

System Clock
------------

Nucleo L4A6ZG system clock could be driven by internal or external oscillator,
as well as main PLL clock. By default, system clock is driven by PLL at 80MHz, which is
driven by 16MHz high speed internal oscillator (HSI). High speed external oscillator
(HSE) is not soldered on the board, so it cannot be used to drive the PLL.

Serial Port
-----------

Nucleo L4A6ZG board has 5 UARTs. The Zephyr console output is assigned to LPUART1,
which is connected to the onboard ST-LINK/V2-1. Virtual COM port interface.
Default settings are 115200 8N1.

Programming and Debugging
*************************

Applications for the ``nucleo_l4a6zg`` board configuration can be built and
flashed in the usual way (see :ref:`build_an_application` and
:ref:`application_run` for more details).

Flashing
========

Nucleo L4A6ZG board includes an ST-LINK/V2-1 embedded debug tool
interface. This interface is supported by the OpenOCD version
included in the Zephyr SDK since v0.9.5.

Flashing an application to Nucleo L4A6ZG
----------------------------------------

Connect the Nucleo L4A6ZG to your host computer using the ST-LINK USB port.
Then build and flash an application. Here is an example for the
:ref:`hello_world` application.

Run a serial host program to connect with your Nucleo board:

.. code-block:: console

   $ minicom -D /dev/ttyUSB0

Then build and flash the application.

.. zephyr-app-commands::
   :zephyr-app: samples/hello_world
   :board: nucleo_l4a6zg
   :goals: build flash

You should see the following message on the console:

.. code-block:: console

   Hello World! nucleo_l4a6zg

Debugging
=========

You can debug an application in the usual way.  Here is an example for the
:ref:`hello_world` application.

.. zephyr-app-commands::
   :zephyr-app: samples/hello_world
   :board: nucleo_l4a6zg
   :maybe-skip-config:
   :goals: debug

.. _Nucleo L4A6ZG website:
   http://www.st.com/en/evaluation-tools/nucleo-l4a6zg.html

.. _STM32 Nucleo-144 board User Manual:
   http://www.st.com/resource/en/user_manual/dm00368330.pdf

.. _STM32L4A6ZG on www.st.com:
   http://www.st.com/en/microcontrollers-microprocessors/stm32l4a6zg.html

.. _STM32L4A6 reference manual:
   http://www.st.com/resource/en/reference_manual/dm00083560.pdf


text:
title: photo friday and file magazine
author: alba
layout: post
permalink: /2004/08/26/photo-friday-and-file-magazine/
categories:
  - photography
tags:
  - photography
---
**"modern"**
[
click for larger image][1]

and

[][2]

my walt disney concert hall photos were accepted to [file magazine’s galleries][3]. nice.

so to the new visitors coming here from [file magazine][4], **hello and welcome!**

take a look around, photo archives are [here][5]. if you want to see more concert hall photos go [here][6]. there’s also temp gallery of some of my fave photos [here][7].

leave comments and tell me what you like and don’t like.

enjoy!

 [1]: http://www.ericalba.org/archives/images/novaback.php
 [2]: http://www.filemagazine.com/
 [3]: http://www.filemagazine.com/galleries.html "galleries"
 [4]: http://www.filemagazine.com/index.html "a collection of unexpected photography"
 [5]: http://ericalba.org/photo/archives/
 [6]: http://www.ericalba.org/peek/?album=walt_disney_music_hall
 [7]: http://www.ericalba.org/peek/?album=selects


text:
package com.viesis.viescraft.network.server.airship.customize.engine.sub;

import com.viesis.viescraft.ViesCraft;
import com.viesis.viescraft.network.GuiHandler;
import com.viesis.viescraft.network.packet.MessageBase;

import io.netty.buffer.ByteBuf;
import net.minecraft.entity.player.EntityPlayer;

public class MessageGuiCustomizeMenuEngineDisplaySymbolPg1 extends MessageBase<MessageGuiCustomizeMenuEngineDisplaySymbolPg1> {

	@Override
	public void fromBytes(ByteBuf buf)
	{

	}

	@Override
	public void toBytes(ByteBuf buf)
	{

	}

	@Override
	public void handleClientSide(MessageGuiCustomizeMenuEngineDisplaySymbolPg1 message, EntityPlayer player)
	{

	}

	@Override
	public void handleServerSide(MessageGuiCustomizeMenuEngineDisplaySymbolPg1 message, EntityPlayer player)
	{
		player.openGui(ViesCraft.instance, GuiHandler.GUI_APPEARANCE_MENU_ENGINE_SYMBOLS_PG1, player.world, player.getPosition().getX(), player.getPosition().getY(), player.getPosition().getZ());
	}
}


text:
<!doctype html>

    <meta charset="utf-8">

    <title>Media Player - Request</title>

    <meta name="description" content="Garry's Mod Media Player request page.">
    <meta name="keywords" content="garrysmod,media,player,request,search,youtube,vimeo,twitch,livestream,blip,reddit">
    <meta name="author" content="pixelTail Games">

    <link rel="stylesheet" href="styles/request.css">

Privacy Policy

None of your data is shared with the Media Player addon's creator
or external parties.

Go back

    <link href="https://fonts.googleapis.com/css?family=Oswald" rel="stylesheet">


text:
select last_day(10) from db_root;
select last_day(-10) from db_root order by 1;


text:
all: multichoose multipermute

#multichoose_recursive: multichoose_recursive.cpp
#	g++ multichoose_recursive.cpp -o multichoose_recursive

multichoose: multichoose.cpp multichoose.h
	g++ multichoose.cpp -o multichoose

multipermute: multipermute.cpp multipermute.h
	g++ multipermute.cpp -o multipermute

cmultichoose: multichoose.c
	gcc multichoose.c -o cmultichoose

clean:
	rm cmultichoose
	rm multichoose


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package ibuild.editor.Envirenement;
import ibuild.editor.CloseEditor;
import ibuild.editor.ConfEditor;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import javax.swing.*;

/**
 *
 * @author quentin
 */
public class EnvirenementGlobal extends JFrame{

    private JMenuBar menuBar = new JMenuBar();
    private JMenu Fichier = new JMenu("Fichier");
    private JMenu Edition = new JMenu("Edition");
    private JMenu Affichage = new JMenu("Affichage");
    private JMenu Outils = new JMenu("Outils");
    private JMenu Aide = new JMenu("Aide");

    private JMenuItem NProjet = new JMenuItem("Nouveau projet");
    private JMenuItem OProjet = new JMenuItem("Ouvrir un projet");
    private JMenuItem NFichier = new JMenuItem("Nouveau fichier");
    private JMenuItem OFichier = new JMenuItem("Ouvrir un fichier");
    private JMenuItem FProjet = new JMenuItem("Fermer un projet");
    private JMenuItem FAProjet = new JMenuItem("Fermer tous les projets");
    private JMenuItem IProjet = new JMenuItem("Importer un projet");
    private JMenuItem EProjet = new JMenuItem("Exporter un projet");
    private JMenuItem Quitter = new JMenuItem("Quitter");

    private JMenuItem Retour = new JMenuItem("Retour");
    private JMenuItem Precedent = new JMenuItem("Precedent");
    private JMenuItem Copier = new JMenuItem("Copier");
    private JMenuItem Coller = new JMenuItem("Coller");

    static void add(JTabbedPane tabbedPane, String label) {
    JButton button = new JButton(label);
    tabbedPane.addTab(label, button);
    }

    public EnvirenementGlobal() {
        ConfEditor conf = new ConfEditor();
        String version = conf.getProperty("version");

        JTabbedPane tabbedpane = new JTabbedPane();

        this.setUndecorated(false);
        this.getContentPane().setBackground(Color.white);
        this.setTitle("Ibuild Editor - Accueil [" + version + " Alpha]");
        this.setSize(800, 800);
        this.setExtendedState(this.MAXIMIZED_BOTH);
        this.setResizable(true);
        this.setLocationRelativeTo(null);
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        this.setVisible(true);

        this.menuBar.add(Fichier);
        this.menuBar.add(Edition);
        this.menuBar.add(Affichage);
        this.menuBar.add(Outils);
        this.menuBar.add(Aide);

        this.Fichier.add(NProjet);
        this.Fichier.add(OProjet);
        this.Fichier.addSeparator();
        this.Fichier.add(NFichier);
        this.Fichier.add(OFichier);
        this.Fichier.addSeparator();
        this.Fichier.add(FProjet);
        this.Fichier.add(FAProjet);
        this.Fichier.addSeparator();
        this.Fichier.add(IProjet);
        this.Fichier.add(EProjet);
        this.Fichier.addSeparator();
        this.Fichier.add(Quitter);

        this.Edition.add(Retour);
        this.Edition.add(Precedent);
        this.Edition.addSeparator();
        this.Edition.add(Copier);
        this.Edition.add(Coller);

        this.setJMenuBar(menuBar);

        /*NProjet.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.CTRL_MASK, KeyEvent.SHIFT_MASK + KeyEvent.VK_N));*/

        NProjet.addActionListener(new ActionListener(){
            public void actionPerformed(ActionEvent arg0) {
              NewProject NProjet = new NewProject();
            }
        });

        OProjet.addActionListener(new ActionListener(){
            public void actionPerformed(ActionEvent arg0) {
              NewProject NProjet = new NewProject();
            }
        });

        NFichier.addActionListener(new ActionListener(){
            public void actionPerformed(ActionEvent arg0) {
              tabbedpane.addTab("Nouveau Fichier", new JEditorPane());
            }
        });

        OFichier.addActionListener(new ActionListener(){
            public void actionPerformed(ActionEvent arg0) {
              NewProject NProjet = new NewProject();
            }
        });

        FProjet.addActionListener(new ActionListener(){
            public void actionPerformed(ActionEvent arg0) {
              NewProject NProjet = new NewProject();
            }
        });

        IProjet.addActionListener(new ActionListener(){
            public void actionPerformed(ActionEvent arg0) {
              NewProject NProjet = new NewProject();
            }
        });

        EProjet.addActionListener(new ActionListener(){
            public void actionPerformed(ActionEvent arg0) {
              NewProject NProjet = new NewProject();
            }
        });

        Quitter.addActionListener(new ActionListener(){
            public void actionPerformed(ActionEvent arg0) {
              CloseEditor Close = new CloseEditor();
            }
        });

        tabbedpane.addTab("Page de démarrage", new JLabel("En cours de construction.."));

        tabbedpane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);

        getContentPane().add(tabbedpane, BorderLayout.CENTER);
    }
}


text:
import faps as fp
import numpy as np
import pytest

# Generate a population of adults
allele_freqs = np.random.uniform(0.3,0.5,50)
adults = fp.make_parents(100, allele_freqs)
# Change marker names to arbitrary strings
adults.markers = np.array(['m' + str(x) for x in adults.markers])

def test_subsetting_genotypeArray():
    # Subsetting genotype arrays.
    # Check adults.subsetting adults
    x = ['base_' + str(i) for i in range(10)]
    assert all(adults.subset(individuals=adults.names[:10]).names == x)
    assert all(adults.subset(individuals= range(10)).names == x)
    assert adults.subset(individuals= 10).names == ["base_10"]
    assert adults.subset(individuals= 'base_10').names == ["base_10"]
    with pytest.raises(IndexError):
        adults.subset(individuals= 'nobody').names # fails correctly

    # Check adults.subsetting by locus.
    m = ['m' + str(i) for i in range(10)]
    assert all(adults.subset(loci=adults.markers[:10]).markers == m)
    assert all(adults.subset(loci= range(10)).markers == m)
    assert adults.subset(loci= 10).markers == "m10"
    assert adults.subset(loci= 'm0').markers == "m0"
    with pytest.raises(IndexError):
        adults.subset(loci= 'fails').markers # fails correctly


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

namespace AsysORM.EloqueNET
{

    public class Schema
    {
        #region Static builder methods

        public static void Create(string name)
        {
            ITable table = new Table(name);

        }

        #endregion
    }
}


text:
<?php

namespace Google\Utils;

/**
 * Implementation of levels 1-3 of the URI Template spec.
 * @see http://tools.ietf.org/html/rfc6570
 */
class URITemplate
{
  const TYPE_MAP = "1";
  const TYPE_LIST = "2";
  const TYPE_SCALAR = "4";

  /**
   * @var $operators array
   * These are valid at the start of a template block to
   * modify the way in which the variables inside are
   * processed.
   */
  private $operators = array(
      "+" => "reserved",
      "/" => "segments",
      "." => "dotprefix",
      "#" => "fragment",
      ";" => "semicolon",
      "?" => "form",
      "&" => "continuation"
  );

  /**
   * @var reserved array
   * These are the characters which should not be URL encoded in reserved
   * strings.
   */
  private $reserved = array(
      "=", ",", "!", "@", "|", ":", "/", "?", "#",
      "[", "]",'$', "&", "'", "(", ")", "*", "+", ";"
  );
  private $reservedEncoded = array(
    "%3D", "%2C", "%21", "%40", "%7C", "%3A", "%2F", "%3F",
    "%23", "%5B", "%5D", "%24", "%26", "%27", "%28", "%29",
    "%2A", "%2B", "%3B"
  );

  public function parse($string, array $parameters)
  {
    return $this->resolveNextSection($string, $parameters);
  }

  /**
   * This function finds the first matching {...} block and
   * executes the replacement. It then calls itself to find
   * subsequent blocks, if any.
   */
  private function resolveNextSection($string, $parameters)
  {
    $start = strpos($string, "{");
    if ($start === false) {
      return $string;
    }
    $end = strpos($string, "}");
    if ($end === false) {
      return $string;
    }
    $string = $this->replace($string, $start, $end, $parameters);
    return $this->resolveNextSection($string, $parameters);
  }

  private function replace($string, $start, $end, $parameters)
  {
    // We know a data block will have {} round it, so we can strip that.
    $data = substr($string, $start + 1, $end - $start - 1);

    // If the first character is one of the reserved operators, it effects
    // the processing of the stream.
    if (isset($this->operators[$data[0]])) {
      $op = $this->operators[$data[0]];
      $data = substr($data, 1);
      $prefix = "";
      $prefix_on_missing = false;

      switch ($op) {
        case "reserved":
          // Reserved means certain characters should not be URL encoded
          $data = $this->replaceVars($data, $parameters, ",", null, true);
          break;
        case "fragment":
          // Comma separated with fragment prefix. Bare values only.
          $prefix = "#";
          $prefix_on_missing = true;
          $data = $this->replaceVars($data, $parameters, ",", null, true);
          break;
        case "segments":
          // Slash separated data. Bare values only.
          $prefix = "/";
          $data =$this->replaceVars($data, $parameters, "/");
          break;
        case "dotprefix":
          // Dot separated data. Bare values only.
          $prefix = ".";
          $prefix_on_missing = true;
          $data = $this->replaceVars($data, $parameters, ".");
          break;
        case "semicolon":
          // Semicolon prefixed and separated. Uses the key name
          $prefix = ";";
          $data = $this->replaceVars($data, $parameters, ";", "=", false, true, false);
          break;
        case "form":
          // Standard URL format. Uses the key name
          $prefix = "?";
          $data = $this->replaceVars($data, $parameters, "&", "=");
          break;
        case "continuation":
          // Standard URL, but with leading ampersand. Uses key name.
          $prefix = "&";
          $data = $this->replaceVars($data, $parameters, "&", "=");
          break;
      }

      // Add the initial prefix character if data is valid.
      if ($data || ($data !== false && $prefix_on_missing)) {
        $data = $prefix . $data;
      }

    } else {
      // If no operator we replace with the defaults.
      $data = $this->replaceVars($data, $parameters);
    }
    // This is chops out the {...} and replaces with the new section.
    return substr($string, 0, $start) . $data . substr($string, $end + 1);
  }

  private function replaceVars(
      $section,
      $parameters,
      $sep = ",",
      $combine = null,
      $reserved = false,
      $tag_empty = false,
      $combine_on_empty = true
  ) {
    if (strpos($section, ",") === false) {
      // If we only have a single value, we can immediately process.
      return $this->combine(
          $section,
          $parameters,
          $sep,
          $combine,
          $reserved,
          $tag_empty,
          $combine_on_empty
      );
    } else {
      // If we have multiple values, we need to split and loop over them.
      // Each is treated individually, then glued together with the
      // separator character.
      $vars = explode(",", $section);
      return $this->combineList(
          $vars,
          $sep,
          $parameters,
          $combine,
          $reserved,
          false, // Never emit empty strings in multi-param replacements
          $combine_on_empty
      );
    }
  }

  public function combine(
      $key,
      $parameters,
      $sep,
      $combine,
      $reserved,
      $tag_empty,
      $combine_on_empty
  ) {
    $length = false;
    $explode = false;
    $skip_final_combine = false;
    $value = false;

    // Check for length restriction.
    if (strpos($key, ":") !== false) {
      list($key, $length) = explode(":", $key);
    }

    // Check for explode parameter.
    if ($key[strlen($key) - 1] == "*") {
      $explode = true;
      $key = substr($key, 0, -1);
      $skip_final_combine = true;
    }

    // Define the list separator.
    $list_sep = $explode ? $sep : ",";

    if (isset($parameters[$key])) {
      $data_type = $this->getDataType($parameters[$key]);
      switch ($data_type) {
        case self::TYPE_SCALAR:
          $value = $this->getValue($parameters[$key], $length);
          break;
        case self::TYPE_LIST:
          $values = array();
          foreach ($parameters[$key] as $pkey => $pvalue) {
            $pvalue = $this->getValue($pvalue, $length);
            if ($combine && $explode) {
              $values[$pkey] = $key . $combine . $pvalue;
            } else {
              $values[$pkey] = $pvalue;
            }
          }
          $value = implode($list_sep, $values);
          if ($value == '') {
            return '';
          }
          break;
        case self::TYPE_MAP:
          $values = array();
          foreach ($parameters[$key] as $pkey => $pvalue) {
            $pvalue = $this->getValue($pvalue, $length);
            if ($explode) {
              $pkey = $this->getValue($pkey, $length);
              $values[] = $pkey . "=" . $pvalue; // Explode triggers = combine.
            } else {
              $values[] = $pkey;
              $values[] = $pvalue;
            }
          }
          $value = implode($list_sep, $values);
          if ($value == '') {
            return false;
          }
          break;
      }
    } else if ($tag_empty) {
      // If we are just indicating empty values with their key name, return that.
      return $key;
    } else {
      // Otherwise we can skip this variable due to not being defined.
      return false;
    }

    if ($reserved) {
      $value = str_replace($this->reservedEncoded, $this->reserved, $value);
    }

    // If we do not need to include the key name, we just return the raw
    // value.
    if (!$combine || $skip_final_combine) {
      return $value;
    }

    // Else we combine the key name: foo=bar, if value is not the empty string.
    return $key . ($value != '' || $combine_on_empty ? $combine . $value : '');
  }

  /**
   * Return the type of a passed in value
   */
  private function getDataType($data)
  {
    if (is_array($data)) {
      reset($data);
      if (key($data) !== 0) {
        return self::TYPE_MAP;
      }
      return self::TYPE_LIST;
    }
    return self::TYPE_SCALAR;
  }

  /**
   * Utility function that merges multiple combine calls
   * for multi-key templates.
   */
  private function combineList(
      $vars,
      $sep,
      $parameters,
      $combine,
      $reserved,
      $tag_empty,
      $combine_on_empty
  ) {
    $ret = array();
    foreach ($vars as $var) {
      $response = $this->combine(
          $var,
          $parameters,
          $sep,
          $combine,
          $reserved,
          $tag_empty,
          $combine_on_empty
      );
      if ($response === false) {
        continue;
      }
      $ret[] = $response;
    }
    return implode($sep, $ret);
  }

  /**
   * Utility function to encode and trim values
   */
  private function getValue($value, $length)
  {
    if ($length) {
      $value = substr($value, 0, $length);
    }
    $value = rawurlencode($value);
    return $value;
  }
}


text:
if (!Omeka) {
    var Omeka = {};
}

Omeka.Search = {};

(function ($) {
    /**
     * Activate onclick handlers for the dynamic add/remove buttons on the
     * advanced search form.
     */
    Omeka.Search.activateSearchButtons = function () {
        var addButton = $('.add_search');

        var removeButtons = $('.remove_search');

        handleRemoveButtons();

        /**
         * Callback for adding a new row of advanced search options.
         */
        function addAdvancedSearch() {
            //Copy the div that is already on the search form
            var oldDiv = $('.search-entry').last();

            //Clone the div and append it to the form
            //Passing true should copy listeners, interacts badly with Prototype.
            var div = oldDiv.clone();

            oldDiv.parent().append(div);

            var inputs = div.find('input');
            var selects = div.find('select');

            //Find the index of the last advanced search formlet and inc it
            //I.e. if there are two entries on the form, they should be named advanced[0], advanced[1], etc
            var inputName = inputs.last().attr('name');

            //Match the index, parse into integer, increment and convert to string again
            var index = inputName.match(/advanced\[(\d+)\]/)[1];
            var newIndex = (parseInt(index, 10) + 1).toString();

            //Reset the selects and inputs
            inputs.val('');
            inputs.attr('name', function () {
                return this.name.replace(/\d+/, newIndex);
            });

            selects.val('');
            selects.attr('name', function () {
                return this.name.replace(/\d+/, newIndex);
            });

            div.find('.advanced-search-terms').prop('disabled', false);
            //Add the event listener.
            div.find('button.remove_search').click(function () {
                removeAdvancedSearch(this);
            });

            handleRemoveButtons();
        }

        /**
         * Callback for removing an advanced search row.
         *
         * @param {Element} button The clicked delete button.
         */
        function removeAdvancedSearch(button) {
            $(button).parent().remove();
            handleRemoveButtons();
        }

        /**
         * Check the number of advanced search elements on the page and only enable
         * the remove buttons if there is more than one.
         */
        function handleRemoveButtons() {
            var removeButtons = $('.remove_search');
            if (removeButtons.length <= 1) {
                removeButtons.attr('disabled', 'disabled').hide();
            } else {
                removeButtons.removeAttr('disabled').show();
            }
        }

        /**
         * Disable term input when the search type doesn't take a term.
         */
        function disableTermInput() {
            var value = $(this).val();
            var disable = value === 'is empty' || value === 'is not empty';
            $(this).siblings('.advanced-search-terms').prop('disabled', disable);
        }

        $('#search-narrow-by-fields')
            .on('change', '.advanced-search-type', disableTermInput)
            .find('.advanced-search-type').each(disableTermInput);

        //Make each button respond to clicks
        addButton.click(function () {
            addAdvancedSearch();
        });
        removeButtons.click(function () {
            removeAdvancedSearch(this);
        });
    };
})(jQuery);