/*
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

#import "ABI39_0_0RCTJavaScriptLoader.h"

#import <sys/stat.h>

#import <ABI39_0_0cxxreact/ABI39_0_0JSBundleType.h>

#import "ABI39_0_0RCTBridge.h"
#import "ABI39_0_0RCTConvert.h"
#import "ABI39_0_0RCTMultipartDataTask.h"
#import "ABI39_0_0RCTPerformanceLogger.h"
#import "ABI39_0_0RCTUtils.h"

NSString *const ABI39_0_0RCTJavaScriptLoaderErrorDomain = @"ABI39_0_0RCTJavaScriptLoaderErrorDomain";

static const int32_t JSNoBytecodeFileFormatVersion = -1;

@interface ABI39_0_0RCTSource () {
 @public
  NSURL *_url;
  NSData *_data;
  NSUInteger _length;
  NSInteger _filesChangedCount;
}

@end

@implementation ABI39_0_0RCTSource

static ABI39_0_0RCTSource *ABI39_0_0RCTSourceCreate(NSURL *url, NSData *data, int64_t length) NS_RETURNS_RETAINED
{
  ABI39_0_0RCTSource *source = [ABI39_0_0RCTSource new];
  source->_url = url;
  source->_data = data;
  source->_length = length;
  source->_filesChangedCount = ABI39_0_0RCTSourceFilesChangedCountNotBuiltByBundler;
  return source;
}

@end

@implementation ABI39_0_0RCTLoadingProgress

- (NSString *)description
{
  NSMutableString *desc = [NSMutableString new];
  [desc appendString:_status ?: @"Loading"];

  if ([_total integerValue] > 0) {
    [desc appendFormat:@" %ld%% (%@/%@)", (long)(100 * [_done integerValue] / [_total integerValue]), _done, _total];
  }
  [desc appendString:@"\u2026"];
  return desc;
}

@end

@implementation ABI39_0_0RCTJavaScriptLoader

ABI39_0_0RCT_NOT_IMPLEMENTED(-(instancetype)init)

+ (void)loadBundleAtURL:(NSURL *)scriptURL
             onProgress:(ABI39_0_0RCTSourceLoadProgressBlock)onProgress
             onComplete:(ABI39_0_0RCTSourceLoadBlock)onComplete
{
  int64_t sourceLength;
  NSError *error;
  NSData *data = [self attemptSynchronousLoadOfBundleAtURL:scriptURL
                                          runtimeBCVersion:JSNoBytecodeFileFormatVersion
                                              sourceLength:&sourceLength
                                                     error:&error];
  if (data) {
    onComplete(nil, ABI39_0_0RCTSourceCreate(scriptURL, data, sourceLength));
    return;
  }

  const BOOL isCannotLoadSyncError = [error.domain isEqualToString:ABI39_0_0RCTJavaScriptLoaderErrorDomain] &&
      error.code == ABI39_0_0RCTJavaScriptLoaderErrorCannotBeLoadedSynchronously;

  if (isCannotLoadSyncError) {
    attemptAsynchronousLoadOfBundleAtURL(scriptURL, onProgress, onComplete);
  } else {
    onComplete(error, nil);
  }
}

+ (NSData *)attemptSynchronousLoadOfBundleAtURL:(NSURL *)scriptURL
                               runtimeBCVersion:(int32_t)runtimeBCVersion
                                   sourceLength:(int64_t *)sourceLength
                                          error:(NSError **)error
{
  NSString *unsanitizedScriptURLString = scriptURL.absoluteString;
  // Sanitize the script URL
  scriptURL = sanitizeURL(scriptURL);

  if (!scriptURL) {
    if (error) {
      *error = [NSError
          errorWithDomain:ABI39_0_0RCTJavaScriptLoaderErrorDomain
                     code:ABI39_0_0RCTJavaScriptLoaderErrorNoScriptURL
                 userInfo:@{
                   NSLocalizedDescriptionKey : [NSString
                       stringWithFormat:@"No script URL provided. Make sure the packager is "
                                        @"running or you have embedded a JS bundle in your application bundle.\n\n"
                                        @"unsanitizedScriptURLString = %@",
                                        unsanitizedScriptURLString]
                 }];
    }
    return nil;
  }

  // Load local script file
  if (!scriptURL.fileURL) {
    if (error) {
      *error = [NSError errorWithDomain:ABI39_0_0RCTJavaScriptLoaderErrorDomain
                                   code:ABI39_0_0RCTJavaScriptLoaderErrorCannotBeLoadedSynchronously
                               userInfo:@{
                                 NSLocalizedDescriptionKey :
                                     [NSString stringWithFormat:@"Cannot load %@ URLs synchronously", scriptURL.scheme]
                               }];
    }
    return nil;
  }

  // Load the first 4 bytes to check if the bundle is regular or RAM ("Random Access Modules" bundle).
  // The RAM bundle has a magic number in the 4 first bytes `(0xFB0BD1E5)`.
  // The benefit of RAM bundle over a regular bundle is that we can lazily inject
  // modules into JSC as they're required.
  FILE *bundle = fopen(scriptURL.path.UTF8String, "r");
  if (!bundle) {
    if (error) {
      *error = [NSError
          errorWithDomain:ABI39_0_0RCTJavaScriptLoaderErrorDomain
                     code:ABI39_0_0RCTJavaScriptLoaderErrorFailedOpeningFile
                 userInfo:@{
                   NSLocalizedDescriptionKey : [NSString stringWithFormat:@"Error opening bundle %@", scriptURL.path]
                 }];
    }
    return nil;
  }

  ABI39_0_0facebook::ABI39_0_0React::BundleHeader header;
  size_t readResult = fread(&header, sizeof(header), 1, bundle);
  fclose(bundle);
  if (readResult != 1) {
    if (error) {
      *error = [NSError
          errorWithDomain:ABI39_0_0RCTJavaScriptLoaderErrorDomain
                     code:ABI39_0_0RCTJavaScriptLoaderErrorFailedReadingFile
                 userInfo:@{
                   NSLocalizedDescriptionKey : [NSString stringWithFormat:@"Error reading bundle %@", scriptURL.path]
                 }];
    }
    return nil;
  }

  ABI39_0_0facebook::ABI39_0_0React::ScriptTag tag = ABI39_0_0facebook::ABI39_0_0React::parseTypeFromHeader(header);
  switch (tag) {
    case ABI39_0_0facebook::ABI39_0_0React::ScriptTag::RAMBundle:
      break;

    case ABI39_0_0facebook::ABI39_0_0React::ScriptTag::String: {
#if ABI39_0_0RCT_ENABLE_INSPECTOR
      NSData *source = [NSData dataWithContentsOfFile:scriptURL.path options:NSDataReadingMappedIfSafe error:error];
      if (sourceLength && source != nil) {
        *sourceLength = source.length;
      }
      return source;
#else
      if (error) {
        *error =
            [NSError errorWithDomain:ABI39_0_0RCTJavaScriptLoaderErrorDomain
                                code:ABI39_0_0RCTJavaScriptLoaderErrorCannotBeLoadedSynchronously
                            userInfo:@{NSLocalizedDescriptionKey : @"Cannot load text/javascript files synchronously"}];
      }
      return nil;
#endif
    }
    case ABI39_0_0facebook::ABI39_0_0React::ScriptTag::BCBundle:
      if (runtimeBCVersion == JSNoBytecodeFileFormatVersion || runtimeBCVersion < 0) {
        if (error) {
          *error = [NSError
              errorWithDomain:ABI39_0_0RCTJavaScriptLoaderErrorDomain
                         code:ABI39_0_0RCTJavaScriptLoaderErrorBCNotSupported
                     userInfo:@{NSLocalizedDescriptionKey : @"Bytecode bundles are not supported by this runtime."}];
        }
        return nil;
      } else if ((uint32_t)runtimeBCVersion != header.version) {
        if (error) {
          NSString *errDesc = [NSString
              stringWithFormat:@"BC Version Mismatch. Expect: %d, Actual: %u", runtimeBCVersion, header.version];

          *error = [NSError errorWithDomain:ABI39_0_0RCTJavaScriptLoaderErrorDomain
                                       code:ABI39_0_0RCTJavaScriptLoaderErrorBCVersion
                                   userInfo:@{NSLocalizedDescriptionKey : errDesc}];
        }
        return nil;
      }
      break;
  }

  struct stat statInfo;
  if (stat(scriptURL.path.UTF8String, &statInfo) != 0) {
    if (error) {
      *error = [NSError
          errorWithDomain:ABI39_0_0RCTJavaScriptLoaderErrorDomain
                     code:ABI39_0_0RCTJavaScriptLoaderErrorFailedStatingFile
                 userInfo:@{
                   NSLocalizedDescriptionKey : [NSString stringWithFormat:@"Error stating bundle %@", scriptURL.path]
                 }];
    }
    return nil;
  }
  if (sourceLength) {
    *sourceLength = statInfo.st_size;
  }
  return [NSData dataWithBytes:&header length:sizeof(header)];
}

static void parseHeaders(NSDictionary *headers, ABI39_0_0RCTSource *source)
{
  source->_filesChangedCount = [headers[@"X-Metro-Files-Changed-Count"] integerValue];
}

static void attemptAsynchronousLoadOfBundleAtURL(
    NSURL *scriptURL,
    ABI39_0_0RCTSourceLoadProgressBlock onProgress,
    ABI39_0_0RCTSourceLoadBlock onComplete)
{
  scriptURL = sanitizeURL(scriptURL);

  if (scriptURL.fileURL) {
    // Reading in a large bundle can be slow. Dispatch to the background queue to do it.
    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
      NSError *error = nil;
      NSData *source = [NSData dataWithContentsOfFile:scriptURL.path options:NSDataReadingMappedIfSafe error:&error];
      onComplete(error, ABI39_0_0RCTSourceCreate(scriptURL, source, source.length));
    });
    return;
  }

  ABI39_0_0RCTMultipartDataTask *task = [[ABI39_0_0RCTMultipartDataTask alloc] initWithURL:scriptURL
      partHandler:^(NSInteger statusCode, NSDictionary *headers, NSData *data, NSError *error, BOOL done) {
        if (!done) {
          if (onProgress) {
            onProgress(progressEventFromData(data));
          }
          return;
        }

        // Handle general request errors
        if (error) {
          if ([error.domain isEqualToString:NSURLErrorDomain]) {
            error = [NSError
                errorWithDomain:ABI39_0_0RCTJavaScriptLoaderErrorDomain
                           code:ABI39_0_0RCTJavaScriptLoaderErrorURLLoadFailed
                       userInfo:@{
                         NSLocalizedDescriptionKey :
                             [@"Could not connect to development server.\n\n"
                               "Ensure the following:\n"
                               "- Node server is running and available on the same network - run 'npm start' from ABI39_0_0React-native root\n"
                               "- Node server URL is correctly set in AppDelegate\n"
                               "- WiFi is enabled and connected to the same network as the Node Server\n\n"
                               "URL: " stringByAppendingString:scriptURL.absoluteString],
                         NSLocalizedFailureReasonErrorKey : error.localizedDescription,
                         NSUnderlyingErrorKey : error,
                       }];
          }
          onComplete(error, nil);
          return;
        }

        // For multipart responses packager sets X-Http-Status header in case HTTP status code
        // is different from 200 OK
        NSString *statusCodeHeader = headers[@"X-Http-Status"];
        if (statusCodeHeader) {
          statusCode = [statusCodeHeader integerValue];
        }

        if (statusCode != 200) {
          error =
              [NSError errorWithDomain:@"JSServer"
                                  code:statusCode
                              userInfo:userInfoForRawResponse([[NSString alloc] initWithData:data
                                                                                encoding:NSUTF8StringEncoding])];
          onComplete(error, nil);
          return;
        }

        // Validate that the packager actually returned javascript.
        NSString *contentType = headers[@"Content-Type"];
        NSString *mimeType = [[contentType componentsSeparatedByString:@";"] firstObject];
        if (![mimeType isEqualToString:@"application/javascript"] && ![mimeType isEqualToString:@"text/javascript"]) {
          NSString *description = [NSString
              stringWithFormat:@"Expected MIME-Type to be 'application/javascript' or 'text/javascript', but got '%@'.",
                               mimeType];
          error = [NSError
              errorWithDomain:@"JSServer"
                         code:NSURLErrorCannotParseResponse
                     userInfo:@{NSLocalizedDescriptionKey : description, @"headers" : headers, @"data" : data}];
          onComplete(error, nil);
          return;
        }

        ABI39_0_0RCTSource *source = ABI39_0_0RCTSourceCreate(scriptURL, data, data.length);
        parseHeaders(headers, source);
        onComplete(nil, source);
      }
      progressHandler:^(NSDictionary *headers, NSNumber *loaded, NSNumber *total) {
        // Only care about download progress events for the javascript bundle part.
        if ([headers[@"Content-Type"] isEqualToString:@"application/javascript"]) {
          onProgress(progressEventFromDownloadProgress(loaded, total));
        }
      }];

  [task startTask];
}

static NSURL *sanitizeURL(NSURL *url)
{
  // Why we do this is lost to time. We probably shouldn't; passing a valid URL is the caller's responsibility not ours.
  return [ABI39_0_0RCTConvert NSURL:url.absoluteString];
}

static ABI39_0_0RCTLoadingProgress *progressEventFromData(NSData *rawData)
{
  NSString *text = [[NSString alloc] initWithData:rawData encoding:NSUTF8StringEncoding];
  id info = ABI39_0_0RCTJSONParse(text, nil);
  if (!info || ![info isKindOfClass:[NSDictionary class]]) {
    return nil;
  }

  ABI39_0_0RCTLoadingProgress *progress = [ABI39_0_0RCTLoadingProgress new];
  progress.status = info[@"status"];
  progress.done = info[@"done"];
  progress.total = info[@"total"];
  return progress;
}

static ABI39_0_0RCTLoadingProgress *progressEventFromDownloadProgress(NSNumber *total, NSNumber *done)
{
  ABI39_0_0RCTLoadingProgress *progress = [ABI39_0_0RCTLoadingProgress new];
  progress.status = @"Downloading JavaScript bundle";
  // Progress values are in bytes transform them to kilobytes for smaller numbers.
  progress.done = done != nil ? @([done integerValue] / 1024) : nil;
  progress.total = total != nil ? @([total integerValue] / 1024) : nil;
  return progress;
}

static NSDictionary *userInfoForRawResponse(NSString *rawText)
{
  NSDictionary *parsedResponse = ABI39_0_0RCTJSONParse(rawText, nil);
  if (![parsedResponse isKindOfClass:[NSDictionary class]]) {
    return @{NSLocalizedDescriptionKey : rawText};
  }
  NSArray *errors = parsedResponse[@"errors"];
  if (![errors isKindOfClass:[NSArray class]]) {
    return @{NSLocalizedDescriptionKey : rawText};
  }
  NSMutableArray<NSDictionary *> *fakeStack = [NSMutableArray new];
  for (NSDictionary *err in errors) {
    [fakeStack addObject:@{
      @"methodName" : err[@"description"] ?: @"",
      @"file" : err[@"filename"] ?: @"",
      @"lineNumber" : err[@"lineNumber"] ?: @0
    }];
  }
  return
      @{NSLocalizedDescriptionKey : parsedResponse[@"message"] ?: @"No message provided", @"stack" : [fakeStack copy]};
}

@end

{'repo_name': 'expo/expo', 'stars': '10544', 'repo_language': 'Objective-C', 'file_name': 'ZXRGBLuminanceSource.h', 'mime_type': 'text/x-objective-c', 'hash': -3005377860074821055, 'source_dataset': 'data'}


/**
 *
 * WARNING! This file was autogenerated by:
 *  _   _ _   _ __   __
 * | | | | | | |\ \ / /
 * | | | | |_| | \ V /
 * | | | |  _  | /   \
 * | |_| | | | |/ /^\ \
 *  \___/\_| |_/\/   \/
 *
 * This file was autogenerated by UnrealHxGenerator using UHT definitions.
 * It only includes UPROPERTYs and UFUNCTIONs. Do not modify it!
 * In order to add more definitions, create or edit a type with the same name/package, but with an `_Extra` suffix
**/
package unreal.editor;

/**
  Represents the current selection state of a level (its selected actors and components) from a given point in a time, in a way that can be safely restored later even if the level is reloaded
**/
@:umodule("UnrealEd")
@:glueCppIncludes("Classes/Editor/EditorEngine.h")
@:noCopy @:noEquals @:uextern @:ustruct extern class FSelectionStateOfLevel {

  /**
    Path names of all the selected components
  **/
  @:uproperty public var SelectedComponents : unreal.TArray<unreal.FString>;

  /**
    Path names of all the selected actors
  **/
  @:uproperty public var SelectedActors : unreal.TArray<unreal.FString>;

}

{'repo_name': 'proletariatgames/unreal.hx', 'stars': '332', 'repo_language': 'Haxe', 'file_name': 'EngineLatentCommands.hx', 'mime_type': 'text/x-c++', 'hash': -2759825189967139445, 'source_dataset': 'data'}


#import sys, traceback
import mal_readline

# read
def READ(str):
    return str

# eval
def EVAL(ast, env):
        #print("EVAL %s" % printer._pr_str(ast))
        return ast

# print
def PRINT(exp):
    return exp

# repl
def REP(str):
    return PRINT(EVAL(READ(str), {}))

def entry_point(argv):
    #mal_readline.init()
    while True:
        try:
            line = mal_readline.readline("user> ")
            if line == "": continue
            print(REP(line))
        except EOFError as e:
            break
        except Exception as e:
            print("Error: %s" % e)
            #print("".join(traceback.format_exception(*sys.exc_info())))
    return 0

# _____ Define and setup target ___
def target(*args):
    return entry_point

# Just run entry_point if not RPython compilation
import sys
if not sys.argv[0].endswith('rpython'):
    entry_point(sys.argv)

{'repo_name': 'kanaka/mal', 'stars': '7043', 'repo_language': 'Assembly', 'file_name': 'step7_quote.txt', 'mime_type': 'text/plain', 'hash': 983401547422602501, 'source_dataset': 'data'}


/*
 * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 only, as
 * published by the Free Software Foundation.  Oracle designates this
 * particular file as subject to the "Classpath" exception as provided
 * by Oracle in the LICENSE file that accompanied this code.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 along with this work; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 * or visit www.oracle.com if you need additional information or have any
 * questions.
 */

package sun.awt.datatransfer;

import java.awt.EventQueue;

import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.FlavorTable;
import java.awt.datatransfer.SystemFlavorMap;
import java.awt.datatransfer.Transferable;
import java.awt.datatransfer.ClipboardOwner;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.FlavorListener;
import java.awt.datatransfer.FlavorEvent;
import java.awt.datatransfer.UnsupportedFlavorException;

import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;

import java.util.Arrays;
import java.util.Set;
import java.util.HashSet;

import java.io.IOException;

import sun.awt.AppContext;
import sun.awt.PeerEvent;
import sun.awt.SunToolkit;

/**
 * Serves as a common, helper superclass for the Win32 and X11 system
 * Clipboards.
 *
 * @author Danila Sinopalnikov
 * @author Alexander Gerasimov
 *
 * @since 1.3
 */
public abstract class SunClipboard extends Clipboard
    implements PropertyChangeListener {

    private AppContext contentsContext = null;

    private final Object CLIPBOARD_FLAVOR_LISTENER_KEY;

    /**
     * A number of {@code FlavorListener}s currently registered
     * on this clipboard across all {@code AppContext}s.
     */
    private volatile int numberOfFlavorListeners = 0;

    /**
     * A set of {@code DataFlavor}s that is available on this clipboard. It is
     * used for tracking changes of {@code DataFlavor}s available on this
     * clipboard. Can be {@code null}.
     */
    private volatile long[] currentFormats;

    public SunClipboard(String name) {
        super(name);
        CLIPBOARD_FLAVOR_LISTENER_KEY = new StringBuffer(name + "_CLIPBOARD_FLAVOR_LISTENER_KEY");
    }

    public synchronized void setContents(Transferable contents,
                                         ClipboardOwner owner) {
        // 4378007 : Toolkit.getSystemClipboard().setContents(null, null)
        // should throw NPE
        if (contents == null) {
            throw new NullPointerException("contents");
        }

        initContext();

        final ClipboardOwner oldOwner = this.owner;
        final Transferable oldContents = this.contents;

        try {
            this.owner = owner;
            this.contents = new TransferableProxy(contents, true);

            setContentsNative(contents);
        } finally {
            if (oldOwner != null && oldOwner != owner) {
                EventQueue.invokeLater(() -> oldOwner.lostOwnership(SunClipboard.this, oldContents));
            }
        }
    }

    private synchronized void initContext() {
        final AppContext context = AppContext.getAppContext();

        if (contentsContext != context) {
            // Need to synchronize on the AppContext to guarantee that it cannot
            // be disposed after the check, but before the listener is added.
            synchronized (context) {
                if (context.isDisposed()) {
                    throw new IllegalStateException("Can't set contents from disposed AppContext");
                }
                context.addPropertyChangeListener
                    (AppContext.DISPOSED_PROPERTY_NAME, this);
            }
            if (contentsContext != null) {
                contentsContext.removePropertyChangeListener
                    (AppContext.DISPOSED_PROPERTY_NAME, this);
            }
            contentsContext = context;
        }
    }

    public synchronized Transferable getContents(Object requestor) {
        if (contents != null) {
            return contents;
        }
        return new ClipboardTransferable(this);
    }

    /**
     * @return the contents of this clipboard if it has been set from the same
     *         AppContext as it is currently retrieved or null otherwise
     * @since 1.5
     */
    protected synchronized Transferable getContextContents() {
        AppContext context = AppContext.getAppContext();
        return (context == contentsContext) ? contents : null;
    }

    /**
     * @see java.awt.datatransfer.Clipboard#getAvailableDataFlavors
     * @since 1.5
     */
    public DataFlavor[] getAvailableDataFlavors() {
        Transferable cntnts = getContextContents();
        if (cntnts != null) {
            return cntnts.getTransferDataFlavors();
        }

        long[] formats = getClipboardFormatsOpenClose();

        return DataTransferer.getInstance().
            getFlavorsForFormatsAsArray(formats, getDefaultFlavorTable());
    }

    /**
     * @see java.awt.datatransfer.Clipboard#isDataFlavorAvailable
     * @since 1.5
     */
    public boolean isDataFlavorAvailable(DataFlavor flavor) {
        if (flavor == null) {
            throw new NullPointerException("flavor");
        }

        Transferable cntnts = getContextContents();
        if (cntnts != null) {
            return cntnts.isDataFlavorSupported(flavor);
        }

        long[] formats = getClipboardFormatsOpenClose();

        return formatArrayAsDataFlavorSet(formats).contains(flavor);
    }

    /**
     * @see java.awt.datatransfer.Clipboard#getData
     * @since 1.5
     */
    public Object getData(DataFlavor flavor)
        throws UnsupportedFlavorException, IOException {
        if (flavor == null) {
            throw new NullPointerException("flavor");
        }

        Transferable cntnts = getContextContents();
        if (cntnts != null) {
            return cntnts.getTransferData(flavor);
        }

        long format = 0;
        byte[] data = null;
        Transferable localeTransferable = null;

        try {
            openClipboard(null);

            long[] formats = getClipboardFormats();
            Long lFormat = DataTransferer.getInstance().
                    getFlavorsForFormats(formats, getDefaultFlavorTable()).get(flavor);

            if (lFormat == null) {
                throw new UnsupportedFlavorException(flavor);
            }

            format = lFormat.longValue();
            data = getClipboardData(format);

            if (DataTransferer.getInstance().isLocaleDependentTextFormat(format)) {
                localeTransferable = createLocaleTransferable(formats);
            }

        } finally {
            closeClipboard();
        }

        return DataTransferer.getInstance().
                translateBytes(data, flavor, format, localeTransferable);
    }

    /**
     * The clipboard must be opened.
     *
     * @since 1.5
     */
    protected Transferable createLocaleTransferable(long[] formats) throws IOException {
        return null;
    }

    /**
     * @throws IllegalStateException if the clipboard has not been opened
     */
    public void openClipboard(SunClipboard newOwner) {}
    public void closeClipboard() {}

    public abstract long getID();

    public void propertyChange(PropertyChangeEvent evt) {
        if (AppContext.DISPOSED_PROPERTY_NAME.equals(evt.getPropertyName()) &&
            Boolean.TRUE.equals(evt.getNewValue())) {
            final AppContext disposedContext = (AppContext)evt.getSource();
            lostOwnershipLater(disposedContext);
        }
    }

    protected void lostOwnershipImpl() {
        lostOwnershipLater(null);
    }

    /**
     * Clears the clipboard state (contents, owner and contents context) and
     * notifies the current owner that ownership is lost. Does nothing if the
     * argument is not {@code null} and is not equal to the current
     * contents context.
     *
     * @param disposedContext the AppContext that is disposed or
     *        {@code null} if the ownership is lost because another
     *        application acquired ownership.
     */
    protected void lostOwnershipLater(final AppContext disposedContext) {
        final AppContext context = this.contentsContext;
        if (context == null) {
            return;
        }

        SunToolkit.postEvent(context, new PeerEvent(this, () -> lostOwnershipNow(disposedContext),
                                                    PeerEvent.PRIORITY_EVENT));
    }

    protected void lostOwnershipNow(final AppContext disposedContext) {
        final SunClipboard sunClipboard = SunClipboard.this;
        ClipboardOwner owner = null;
        Transferable contents = null;

        synchronized (sunClipboard) {
            final AppContext context = sunClipboard.contentsContext;

            if (context == null) {
                return;
            }

            if (disposedContext == null || context == disposedContext) {
                owner = sunClipboard.owner;
                contents = sunClipboard.contents;
                sunClipboard.contentsContext = null;
                sunClipboard.owner = null;
                sunClipboard.contents = null;
                sunClipboard.clearNativeContext();
                context.removePropertyChangeListener
                        (AppContext.DISPOSED_PROPERTY_NAME, sunClipboard);
            } else {
                return;
            }
        }
        if (owner != null) {
            owner.lostOwnership(sunClipboard, contents);
        }
    }

    protected abstract void clearNativeContext();

    protected abstract void setContentsNative(Transferable contents);

    /**
     * @since 1.5
     */
    protected long[] getClipboardFormatsOpenClose() {
        try {
            openClipboard(null);
            return getClipboardFormats();
        } finally {
            closeClipboard();
        }
    }

    /**
     * Returns zero-length array (not null) if the number of available formats is zero.
     *
     * @throws IllegalStateException if formats could not be retrieved
     */
    protected abstract long[] getClipboardFormats();

    protected abstract byte[] getClipboardData(long format) throws IOException;

    private static Set<DataFlavor> formatArrayAsDataFlavorSet(long[] formats) {
        return (formats == null) ? null :
                DataTransferer.getInstance().
                getFlavorsForFormatsAsSet(formats, getDefaultFlavorTable());
    }

    public synchronized void addFlavorListener(FlavorListener listener) {
        if (listener == null) {
            return;
        }
        AppContext appContext = AppContext.getAppContext();
        Set<FlavorListener> flavorListeners = getFlavorListeners(appContext);
        if (flavorListeners == null) {
            flavorListeners = new HashSet<>();
            appContext.put(CLIPBOARD_FLAVOR_LISTENER_KEY, flavorListeners);
        }
        flavorListeners.add(listener);

        if (numberOfFlavorListeners++ == 0) {
            long[] currentFormats = null;
            try {
                openClipboard(null);
                currentFormats = getClipboardFormats();
            } catch (final IllegalStateException ignored) {
            } finally {
                closeClipboard();
            }
            this.currentFormats = currentFormats;

            registerClipboardViewerChecked();
        }
    }

    public synchronized void removeFlavorListener(FlavorListener listener) {
        if (listener == null) {
            return;
        }
        Set<FlavorListener> flavorListeners = getFlavorListeners(AppContext.getAppContext());
        if (flavorListeners == null){
            //else we throw NullPointerException, but it is forbidden
            return;
        }
        if (flavorListeners.remove(listener) && --numberOfFlavorListeners == 0) {
            unregisterClipboardViewerChecked();
            currentFormats = null;
        }
    }

    @SuppressWarnings("unchecked")
    private Set<FlavorListener> getFlavorListeners(AppContext appContext) {
        return (Set<FlavorListener>)appContext.get(CLIPBOARD_FLAVOR_LISTENER_KEY);
    }

    public synchronized FlavorListener[] getFlavorListeners() {
        Set<FlavorListener> flavorListeners = getFlavorListeners(AppContext.getAppContext());
        return flavorListeners == null ? new FlavorListener[0]
                : flavorListeners.toArray(new FlavorListener[flavorListeners.size()]);
    }

    public boolean areFlavorListenersRegistered() {
        return (numberOfFlavorListeners > 0);
    }

    protected abstract void registerClipboardViewerChecked();

    protected abstract void unregisterClipboardViewerChecked();

    /**
     * Checks change of the {@code DataFlavor}s and, if necessary,
     * posts notifications on {@code FlavorEvent}s to the
     * AppContexts' EDTs.
     * The parameter {@code formats} is null iff we have just
     * failed to get formats available on the clipboard.
     *
     * @param formats data formats that have just been retrieved from
     *        this clipboard
     */
    protected final void checkChange(final long[] formats) {
        if (Arrays.equals(formats, currentFormats)) {
            // we've been able to successfully get available on the clipboard
            // DataFlavors this and previous time and they are coincident;
            // don't notify
            return;
        }
        currentFormats = formats;

        for (final AppContext appContext : AppContext.getAppContexts()) {
            if (appContext == null || appContext.isDisposed()) {
                continue;
            }
            Set<FlavorListener> flavorListeners = getFlavorListeners(appContext);
            if (flavorListeners != null) {
                for (FlavorListener listener : flavorListeners) {
                    if (listener != null) {
                        PeerEvent peerEvent = new PeerEvent(this,
                                () -> listener.flavorsChanged(new FlavorEvent(SunClipboard.this)),
                                PeerEvent.PRIORITY_EVENT);
                        SunToolkit.postEvent(appContext, peerEvent);
                    }
                }
            }
        }
    }

    public static FlavorTable getDefaultFlavorTable() {
        return (FlavorTable) SystemFlavorMap.getDefaultFlavorMap();
    }
}

{'repo_name': 'kangjianwei/LearningJDK', 'stars': '587', 'repo_language': 'Java', 'file_name': 'PKCS11Exception.java', 'mime_type': 'text/html', 'hash': 5078833119738041018, 'source_dataset': 'data'}


package utils;

import android.view.View;
import android.view.ViewGroup;

/**
 * View Utils class
 * Created by diego on 5/16/16.
 */
public class CustomViewUtils {
    /**
     * Set a View height in pixels.
     *
     * @param v      The view to set the height.
     * @param height The height in pixels.
     */
    public static void setViewHeight(View v, int height) {
        final ViewGroup.LayoutParams params = v.getLayoutParams();
        params.height = height;
        v.requestLayout();
    }

    /**
     * Set a View width in pixels.
     *
     * @param v     The view to set the width.
     * @param width The width in pixels.
     */
    public static void setViewWidth(View v, int width) {
        final ViewGroup.LayoutParams params = v.getLayoutParams();
        params.width = width;
        v.requestLayout();
    }

    /**
     * Set a View margin top.
     *
     * @param v         The View to set the margin top.
     * @param marginTop the margin top in pixles
     */
    public static void setViewMarginTop(View v, int marginTop) {
        setViewMargin(v, 0, marginTop, 0, 0);
    }

    /**
     * Set a View margin.
     *
     * @param v      The view to set margins.
     * @param left   The margin at left in pixels
     * @param top    The margin at top in pixels
     * @param right  The margin at right in pixels
     * @param bottom The margin at bottom in pixels
     */
    public static void setViewMargin(View v, int left, int top, int right, int bottom) {
        final ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) v.getLayoutParams();
        params.setMargins(left, top, right, bottom);
        v.requestLayout();
    }
}

{'repo_name': 'diegodobelo/AndroidExpandingViewLibrary', 'stars': '869', 'repo_language': 'Java', 'file_name': 'package-summary.html', 'mime_type': 'text/html', 'hash': 9000926260729330329, 'source_dataset': 'data'}


To Stop a Cluster

Stopping a cluster stops all running GlassFish Server instances in the cluster.

In the navigation tree, select the Clusters node.

The Clusters page opens.

On the Clusters page, select the checkbox adjacent to the name of the cluster.

Click Stop Cluster.

You are asked to confirm that you want to stop the cluster.

Confirm that you want to stop the cluster.

The cluster is stopped. The status of each instance in the cluster is updated on the Clusters page when the instance is stopped.

See Also

To Create a Cluster

To Delete a Cluster

To Configure Availability Settings for a Cluster

To Start a Cluster

To Modify the Configuration of a Cluster

To Deploy an Application to a Cluster

To List Applications That Are Deployed to a Cluster

To Undeploy Applications From a Cluster

To Remove Applications From a Cluster

To Edit an Application That Is Deployed to a Cluster

To Enable or Disable an Application That Is Deployed to a Cluster

To Enable or Disable Load Balancing for an Application That Is Deployed to a Cluster

To Create a Resource for a Cluster

To List Resources for a Cluster

To Enable or Disable a Resource Globally

To Edit a Resource for a Cluster

To Upgrade Components Without Loss of Service

Copyright © 2005, 2017, Oracle and/or its affiliates. All rights reserved. Legal Notices

{'repo_name': 'eclipse-ee4j/glassfish', 'stars': '178', 'repo_language': 'Java', 'file_name': 'build.xml', 'mime_type': 'text/plain', 'hash': -6490068192692378966, 'source_dataset': 'data'}


// Generated from definition io.k8s.api.core.v1.HTTPGetAction

/// HTTPGetAction describes an action based on HTTP Get requests.
#[derive(Clone, Debug, Default, PartialEq)]
pub struct HTTPGetAction {
    /// Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead.
    pub host: Option<String>,

    /// Custom headers to set in the request. HTTP allows repeated headers.
    pub http_headers: Option<Vec<crate::api::core::v1::HTTPHeader>>,

    /// Path to access on the HTTP server.
    pub path: Option<String>,

    /// Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME.
    pub port: crate::apimachinery::pkg::util::intstr::IntOrString,

    /// Scheme to use for connecting to the host. Defaults to HTTP.
    pub scheme: Option<String>,
}

impl<'de> serde::Deserialize<'de> for HTTPGetAction {
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where D: serde::Deserializer<'de> {
        #[allow(non_camel_case_types)]
        enum Field {
            Key_host,
            Key_http_headers,
            Key_path,
            Key_port,
            Key_scheme,
            Other,
        }

        impl<'de> serde::Deserialize<'de> for Field {
            fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where D: serde::Deserializer<'de> {
                struct Visitor;

                impl<'de> serde::de::Visitor<'de> for Visitor {
                    type Value = Field;

                    fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
                        f.write_str("field identifier")
                    }

                    fn visit_str<E>(self, v: &str) -> Result<Self::Value, E> where E: serde::de::Error {
                        Ok(match v {
                            "host" => Field::Key_host,
                            "httpHeaders" => Field::Key_http_headers,
                            "path" => Field::Key_path,
                            "port" => Field::Key_port,
                            "scheme" => Field::Key_scheme,
                            _ => Field::Other,
                        })
                    }
                }

                deserializer.deserialize_identifier(Visitor)
            }
        }

        struct Visitor;

        impl<'de> serde::de::Visitor<'de> for Visitor {
            type Value = HTTPGetAction;

            fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
                f.write_str("HTTPGetAction")
            }

            fn visit_map<A>(self, mut map: A) -> Result<Self::Value, A::Error> where A: serde::de::MapAccess<'de> {
                let mut value_host: Option<String> = None;
                let mut value_http_headers: Option<Vec<crate::api::core::v1::HTTPHeader>> = None;
                let mut value_path: Option<String> = None;
                let mut value_port: Option<crate::apimachinery::pkg::util::intstr::IntOrString> = None;
                let mut value_scheme: Option<String> = None;

                while let Some(key) = serde::de::MapAccess::next_key::<Field>(&mut map)? {
                    match key {
                        Field::Key_host => value_host = serde::de::MapAccess::next_value(&mut map)?,
                        Field::Key_http_headers => value_http_headers = serde::de::MapAccess::next_value(&mut map)?,
                        Field::Key_path => value_path = serde::de::MapAccess::next_value(&mut map)?,
                        Field::Key_port => value_port = Some(serde::de::MapAccess::next_value(&mut map)?),
                        Field::Key_scheme => value_scheme = serde::de::MapAccess::next_value(&mut map)?,
                        Field::Other => { let _: serde::de::IgnoredAny = serde::de::MapAccess::next_value(&mut map)?; },
                    }
                }

                Ok(HTTPGetAction {
                    host: value_host,
                    http_headers: value_http_headers,
                    path: value_path,
                    port: value_port.ok_or_else(|| serde::de::Error::missing_field("port"))?,
                    scheme: value_scheme,
                })
            }
        }

        deserializer.deserialize_struct(
            "HTTPGetAction",
            &[
                "host",
                "httpHeaders",
                "path",
                "port",
                "scheme",
            ],
            Visitor,
        )
    }
}

impl serde::Serialize for HTTPGetAction {
    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: serde::Serializer {
        let mut state = serializer.serialize_struct(
            "HTTPGetAction",
            1 +
            self.host.as_ref().map_or(0, |_| 1) +
            self.http_headers.as_ref().map_or(0, |_| 1) +
            self.path.as_ref().map_or(0, |_| 1) +
            self.scheme.as_ref().map_or(0, |_| 1),
        )?;
        if let Some(value) = &self.host {
            serde::ser::SerializeStruct::serialize_field(&mut state, "host", value)?;
        }
        if let Some(value) = &self.http_headers {
            serde::ser::SerializeStruct::serialize_field(&mut state, "httpHeaders", value)?;
        }
        if let Some(value) = &self.path {
            serde::ser::SerializeStruct::serialize_field(&mut state, "path", value)?;
        }
        serde::ser::SerializeStruct::serialize_field(&mut state, "port", &self.port)?;
        if let Some(value) = &self.scheme {
            serde::ser::SerializeStruct::serialize_field(&mut state, "scheme", value)?;
        }
        serde::ser::SerializeStruct::end(state)
    }
}

{'repo_name': 'Arnavion/k8s-openapi', 'stars': '111', 'repo_language': 'Rust', 'file_name': 'pod.rs', 'mime_type': 'text/plain', 'hash': 6130005289700780457, 'source_dataset': 'data'}


# Enforces naming of generic type variables (generic-type-naming)

It can be helpful to enforce a consistent naming style for generic type variables used within a type.
For example, prefixing them with `T` and ensuring a somewhat descriptive name, or enforcing Hungarian notation.

## Rule Details

This rule allows you to enforce conventions over type variables. By default, it does nothing.

## Options

The rule takes a single string option, which is a regular expression that type variables should match.

Examples of **correct** code with a configuration of `'^T[A-Z][a-zA-Z]+$'`:

```typescript
type ReadOnly<TType extends object> = {
    readonly [TKey in keyof TType]: TType[TKey]
};

interface SimpleMap<TValue> {
    [key: string]: TValue;
}
```

Examples of **incorrect** code with a configuration of `'^T[A-Z][a-zA-Z]+$'`:

```typescript
type ReadOnly<T extends object> = { readonly [Key in keyof T]: T[Key] };

interface SimpleMap<T> {
    [key: string]: T;
}
```

## When Not To Use It

If you do not want to enforce a naming convention for type variables.

## Further Reading

-   [TypeScript Generics](https://www.typescriptlang.org/docs/handbook/generics.html)

{'repo_name': 'bradzacher/eslint-plugin-typescript', 'stars': '342', 'repo_language': 'JavaScript', 'file_name': 'settings.json', 'mime_type': 'text/plain', 'hash': -5030272198306265116, 'source_dataset': 'data'}


<?php
/**
 * sysPass
 *
 * @author    nuxsmin
 * @link      https://syspass.org
 * @copyright 2012-2019, Rubén Domínguez nuxsmin@$syspass.org
 *
 * This file is part of sysPass.
 *
 * sysPass is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * sysPass is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 *  along with sysPass.  If not, see <http://www.gnu.org/licenses/>.
 */

namespace SP\Services\Ldap;

use SP\Providers\Auth\Ldap\Ldap;
use SP\Providers\Auth\Ldap\LdapException;
use SP\Providers\Auth\Ldap\LdapParams;
use SP\Services\Service;

/**
 * Class LdapCheckService
 *
 * @package SP\Services\Ldap
 */
final class LdapCheckService extends Service
{
    /**
     * @var Ldap
     */
    protected $ldap;

    /**
     * @param LdapParams $ldapParams
     *
     * @throws LdapException
     */
    public function checkConnection(LdapParams $ldapParams)
    {
        $this->ldap = Ldap::factory($ldapParams, $this->eventDispatcher, true);
    }

    /**
     * @param bool $includeGroups
     *
     * @return array
     * @throws LdapException
     */
    public function getObjects($includeGroups = true)
    {
        $ldapActions = $this->ldap->getLdapActions();

        $data = ['count' => 0, 'results' => []];

        $data['results'][] = [
            'icon' => 'person',
            'items' => $this->ldapResultsMapper(
                $ldapActions->getObjects(
                    $this->ldap->getGroupMembershipFilter(), ['dn']))
        ];

        if ($includeGroups) {
            $data['results'][] = [
                'icon' => 'group',
                'items' => $this->ldapResultsMapper(
                    $ldapActions->getObjects(
                        $this->ldap->getGroupObjectFilter(), ['dn']))
            ];
        }

        array_walk($data['results'], function ($value) use (&$data) {
            $data['count'] += count($value['items']);
        });

        return $data;
    }

    /**
     * Obtener los datos de una búsqueda de LDAP de un atributo
     *
     * @param array  $data
     * @param string $attribute
     *
     * @return array
     */
    public function ldapResultsMapper($data, $attribute = 'dn')
    {
        $out = [];

        foreach ($data as $result) {
            if (is_array($result)) {
                foreach ($result as $ldapAttribute => $value) {
                    if (strtolower($ldapAttribute) === $attribute) {
                        $out[] = $value;
                    }
                }
            }
        }

        return $out;
    }

    /**
     * @param $filter
     *
     * @return array
     * @throws LdapException
     */
    public function getObjectsByFilter($filter)
    {
        $objects = $this->ldapResultsMapper(
            $this->ldap->getLdapActions()->getObjects($filter, ['dn']));

        return [
            'count' => count($objects),
            'results' => [
                [
                    'icon' => '',
                    'items' => $objects
                ]
            ]
        ];
    }
}

{'repo_name': 'nuxsmin/sysPass', 'stars': '678', 'repo_language': 'PHP', 'file_name': 'app-util.js', 'mime_type': 'text/plain', 'hash': -1541010794712203717, 'source_dataset': 'data'}


from conans import ConanFile, CMake, tools
import os

class TestPackageConan(ConanFile):
    settings = "os", "compiler", "build_type", "arch"
    generators = "cmake"

    def build(self):
        cmake = CMake(self)
        cmake.configure()
        cmake.build()

    def test(self):
        if not tools.cross_building(self.settings):
            bin_path = os.path.join("bin", "test_package")
            self.run(bin_path, run_environment=True)

{'repo_name': 'conan-io/conan-center-index', 'stars': '188', 'repo_language': 'Python', 'file_name': 'CMakeLists.txt', 'mime_type': 'text/plain', 'hash': 7696776665359116426, 'source_dataset': 'data'}


<?xml version="1.0" encoding="UTF-8"?>
<Update mode="Client" Generator="ctest-2.8.4.20110707-g0eecf">
	<Site>hut11.kitware</Site>
	<BuildName>Windows_NT-MSVC10-SERIAL_DEBUG_DEV</BuildName>
	<BuildStamp>20110722-1515-Experimental</BuildStamp>
	<StartDateTime>Jul 22 11:15 Eastern Daylight Time</StartDateTime>
	<StartTime>1311347701</StartTime>
	<UpdateCommand>"C:/Program Files (x86)/Git/cmd/git.cmd" "fetch"</UpdateCommand>
	<UpdateType>GIT</UpdateType>
	<Revision>91143198be7f9790c9b57de4051f134ce6070838</Revision>
	<PriorRevision>fea8a82f78311ee109a9cdf3e4179ea065be6ee4</PriorRevision>
	<Directory>
		<Name>packages/PyTrilinos/doc/Doxygen</Name>
		<Updated>
			<File>Anasazi_dox.i</File>
			<Directory>packages/PyTrilinos/doc/Doxygen</Directory>
			<FullName>packages/PyTrilinos/doc/Doxygen/Anasazi_dox.i</FullName>
			<CheckinDate>2011-07-21 16:47:38 -0600</CheckinDate>
			<Author>James Willenbring</Author>
			<Email>jmwille@noemail</Email>
			<Committer>James Willenbring</Committer>
			<CommitterEmail>jmwille@noemail</CommitterEmail>
			<CommitDate>2011-07-21 16:47:38 -0600</CommitDate>
			<Log>Committing changes to autogenerated .dox.i files.
</Log>
			<Revision>e0f3d20f1228492dbb4ae8c94f661aae44b724a6</Revision>
			<PriorRevision>fea8a82f78311ee109a9cdf3e4179ea065be6ee4</PriorRevision>
		</Updated>
		<Updated>
			<File>Epetra_dox.i</File>
			<Directory>packages/PyTrilinos/doc/Doxygen</Directory>
			<FullName>packages/PyTrilinos/doc/Doxygen/Epetra_dox.i</FullName>
			<CheckinDate>2011-07-21 16:47:38 -0600</CheckinDate>
			<Author>James Willenbring</Author>
			<Email>jmwille@noemail</Email>
			<Committer>James Willenbring</Committer>
			<CommitterEmail>jmwille@noemail</CommitterEmail>
			<CommitDate>2011-07-21 16:47:38 -0600</CommitDate>
			<Log>Committing changes to autogenerated .dox.i files.
</Log>
			<Revision>e0f3d20f1228492dbb4ae8c94f661aae44b724a6</Revision>
			<PriorRevision>fea8a82f78311ee109a9cdf3e4179ea065be6ee4</PriorRevision>
		</Updated>
	</Directory>
	<Directory>
		<Name>packages/isorropia/example</Name>
		<Updated>
			<File>parallel_matching.cpp</File>
			<Directory>packages/isorropia/example</Directory>
			<FullName>packages/isorropia/example/parallel_matching.cpp</FullName>
			<CheckinDate>2011-07-20 20:52:56 -0600</CheckinDate>
			<Author>Arif Khan</Author>
			<Email>mhkhan@noemail</Email>
			<Committer>Arif Khan</Committer>
			<CommitterEmail>mhkhan@noemail</CommitterEmail>
			<CommitDate>2011-07-21 17:21:10 -0600</CommitDate>
			<Log>Adding PHKDW, PDFS, PPF and modifying PHK
</Log>
			<Revision>0162a778364ddf3c29d30050d77a6026197bb283</Revision>
			<PriorRevision>0ff073d679a482fcb1054abec734edd11d2dfa9d</PriorRevision>
		</Updated>
	</Directory>
	<Directory>
		<Name>packages/isorropia/src/epetra</Name>
		<Updated>
			<File>Isorropia_EpetraMatcher.cpp</File>
			<Directory>packages/isorropia/src/epetra</Directory>
			<FullName>packages/isorropia/src/epetra/Isorropia_EpetraMatcher.cpp</FullName>
			<CheckinDate>2011-07-21 17:19:34 -0600</CheckinDate>
			<Author>Arif Khan</Author>
			<Email>mhkhan@noemail</Email>
			<Committer>Arif Khan</Committer>
			<CommitterEmail>mhkhan@noemail</CommitterEmail>
			<CommitDate>2011-07-21 18:53:27 -0600</CommitDate>
			<Log>Bug fix ... memory deallocation

Enabled Packages: Isorropia
Enabled all Forward Packages
0) MPI_DEBUG => FAILED: passed=368,notpassed=9 => Not ready to push! (43.73 min)
1) SERIAL_RELEASE => passed: passed=353,notpassed=0 (18.74 min)

The following tests FAILED:
  	135 - FEI_multifield_MPI_1 (Failed)
  	138 - FEI_multifield_vbr_MPI_1 (Failed)
  	136 - FEI_multifield_MPI_2 (Failed)
  	137 - FEI_multifield_MPI_3 (Failed)
  	139 - FEI_multifield_vbr_MPI_2 (Failed)
  	140 - FEI_multifield_vbr_MPI_3 (Failed)
  	144 - FEI_multifield_slave_MPI_1 (Failed)
  	145 - FEI_multifield_slave_MPI_2 (Failed)
  	146 - FEI_multifield_slave_MPI_3 (Failed)

(These are the tests which failed before, Alan said its OK to push)
</Log>
			<Revision>003e094de3e4b6e66bc3a4d876e33d4c35abbcc0</Revision>
			<PriorRevision>7bb640feba1fc73be80cfef738aca6b0634e60f6</PriorRevision>
		</Updated>
		<Updated>
			<File>Isorropia_EpetraMatcher.hpp</File>
			<Directory>packages/isorropia/src/epetra</Directory>
			<FullName>packages/isorropia/src/epetra/Isorropia_EpetraMatcher.hpp</FullName>
			<CheckinDate>2011-07-20 20:52:56 -0600</CheckinDate>
			<Author>Arif Khan</Author>
			<Email>mhkhan@noemail</Email>
			<Committer>Arif Khan</Committer>
			<CommitterEmail>mhkhan@noemail</CommitterEmail>
			<CommitDate>2011-07-21 17:21:10 -0600</CommitDate>
			<Log>Adding PHKDW, PDFS, PPF and modifying PHK
</Log>
			<Revision>0162a778364ddf3c29d30050d77a6026197bb283</Revision>
			<PriorRevision>0ff073d679a482fcb1054abec734edd11d2dfa9d</PriorRevision>
		</Updated>
	</Directory>
	<Directory>
		<Name>packages/optika/doc/manual</Name>
		<Updated>
			<File>OptikaThesis.tex</File>
			<Directory>packages/optika/doc/manual</Directory>
			<FullName>packages/optika/doc/manual/OptikaThesis.tex</FullName>
			<CheckinDate>2011-07-21 17:11:23 -0500</CheckinDate>
			<Author>Kurtis Nusbaum</Author>
			<Email>klnusbaum@noemail</Email>
			<Committer>Kurtis Nusbaum</Committer>
			<CommitterEmail>klnusbaum@noemail</CommitterEmail>
			<CommitDate>2011-07-21 23:07:25 -0500</CommitDate>
			<Log>Updated the furture development section of the SAND report

-Kurtis
</Log>
			<Revision>6b5d78245ac11c03b1206c79ee35c0e0476934f3</Revision>
			<PriorRevision>fea8a82f78311ee109a9cdf3e4179ea065be6ee4</PriorRevision>
		</Updated>
	</Directory>
	<Directory>
		<Name>packages/tpetra/example/RTInterface</Name>
		<Updated>
			<File>CMakeLists.txt</File>
			<Directory>packages/tpetra/example/RTInterface</Directory>
			<FullName>packages/tpetra/example/RTInterface/CMakeLists.txt</FullName>
			<CheckinDate>2011-07-20 23:37:35 -0400</CheckinDate>
			<Author>Christopher G. Baker</Author>
			<Email>bakercg@noemail</Email>
			<Committer>Christopher G. Baker</Committer>
			<CommitterEmail>bakercg@noemail</CommitterEmail>
			<CommitDate>2011-07-20 23:48:05 -0400</CommitDate>
			<Log>added new qd example

Build/Test Cases Summary
Enabled Packages: Tpetra
Disabled Packages: PyTrilinos,TriKota,Optika,Sundance,Stokhos
Enabled all Forward Packages
0) MPI_DEBUG => passed: passed=548,notpassed=0 (7.01 min)
1) SERIAL_RELEASE => passed: passed=518,notpassed=0 (2.69 min)
</Log>
			<Revision>952d85e3e192edafa6a0f539300f347896cedfa8</Revision>
			<PriorRevision>fea8a82f78311ee109a9cdf3e4179ea065be6ee4</PriorRevision>
		</Updated>
		<Updated>
			<File>RTIExample.cpp</File>
			<Directory>packages/tpetra/example/RTInterface</Directory>
			<FullName>packages/tpetra/example/RTInterface/RTIExample.cpp</FullName>
			<CheckinDate>2011-07-21 22:21:06 -0600</CheckinDate>
			<Author>Mark Hoemmen</Author>
			<Email>mhoemme@noemail</Email>
			<Committer>Mark Hoemmen</Committer>
			<CommitterEmail>mhoemme@noemail</CommitterEmail>
			<CommitDate>2011-07-21 22:29:48 -0600</CommitDate>
			<Log>Tpetra: Added documentation to the RTI example.

Build/Test Cases Summary
Enabled Packages: Tpetra
0) MPI_DEBUG => passed: passed=32,notpassed=0 (8.48 min)
1) SERIAL_RELEASE => Test case SERIAL_RELEASE was not run! => Does not affect push readiness! (-1.00 min)
</Log>
			<Revision>1bc8c969f25a527cdfc4868d2ba3123d78a60a39</Revision>
			<PriorRevision>fea8a82f78311ee109a9cdf3e4179ea065be6ee4</PriorRevision>
		</Updated>
		<Updated>
			<File>RTIInlineCG.cpp</File>
			<Directory>packages/tpetra/example/RTInterface</Directory>
			<FullName>packages/tpetra/example/RTInterface/RTIInlineCG.cpp</FullName>
			<CheckinDate>2011-07-20 23:37:35 -0400</CheckinDate>
			<Author>Christopher G. Baker</Author>
			<Email>bakercg@noemail</Email>
			<Committer>Christopher G. Baker</Committer>
			<CommitterEmail>bakercg@noemail</CommitterEmail>
			<CommitDate>2011-07-20 23:48:05 -0400</CommitDate>
			<Log>added new qd example

Build/Test Cases Summary
Enabled Packages: Tpetra
Disabled Packages: PyTrilinos,TriKota,Optika,Sundance,Stokhos
Enabled all Forward Packages
0) MPI_DEBUG => passed: passed=548,notpassed=0 (7.01 min)
1) SERIAL_RELEASE => passed: passed=518,notpassed=0 (2.69 min)
</Log>
			<Revision>952d85e3e192edafa6a0f539300f347896cedfa8</Revision>
			<PriorRevision>fea8a82f78311ee109a9cdf3e4179ea065be6ee4</PriorRevision>
		</Updated>
		<Updated>
			<File>RTIInlineCG.hpp</File>
			<Directory>packages/tpetra/example/RTInterface</Directory>
			<FullName>packages/tpetra/example/RTInterface/RTIInlineCG.hpp</FullName>
			<CheckinDate>2011-07-20 23:37:35 -0400</CheckinDate>
			<Author>Christopher G. Baker</Author>
			<Email>bakercg@noemail</Email>
			<Committer>Christopher G. Baker</Committer>
			<CommitterEmail>bakercg@noemail</CommitterEmail>
			<CommitDate>2011-07-20 23:48:05 -0400</CommitDate>
			<Log>added new qd example

Build/Test Cases Summary
Enabled Packages: Tpetra
Disabled Packages: PyTrilinos,TriKota,Optika,Sundance,Stokhos
Enabled all Forward Packages
0) MPI_DEBUG => passed: passed=548,notpassed=0 (7.01 min)
1) SERIAL_RELEASE => passed: passed=518,notpassed=0 (2.69 min)
</Log>
			<Revision>952d85e3e192edafa6a0f539300f347896cedfa8</Revision>
			<PriorRevision>fea8a82f78311ee109a9cdf3e4179ea065be6ee4</PriorRevision>
		</Updated>
		<Updated>
			<File>RTIInlineCG_qd.cpp</File>
			<Directory>packages/tpetra/example/RTInterface</Directory>
			<FullName>packages/tpetra/example/RTInterface/RTIInlineCG_qd.cpp</FullName>
			<CheckinDate>2011-07-20 23:37:35 -0400</CheckinDate>
			<Author>Christopher G. Baker</Author>
			<Email>bakercg@noemail</Email>
			<Committer>Christopher G. Baker</Committer>
			<CommitterEmail>bakercg@noemail</CommitterEmail>
			<CommitDate>2011-07-20 23:48:05 -0400</CommitDate>
			<Log>added new qd example

Build/Test Cases Summary
Enabled Packages: Tpetra
Disabled Packages: PyTrilinos,TriKota,Optika,Sundance,Stokhos
Enabled all Forward Packages
0) MPI_DEBUG => passed: passed=548,notpassed=0 (7.01 min)
1) SERIAL_RELEASE => passed: passed=518,notpassed=0 (2.69 min)
</Log>
			<Revision>952d85e3e192edafa6a0f539300f347896cedfa8</Revision>
			<PriorRevision>fea8a82f78311ee109a9cdf3e4179ea065be6ee4</PriorRevision>
		</Updated>
	</Directory>
	<Directory>
		<Name>packages/trilinoscouplings/src</Name>
		<Updated>
			<File>CMakeLists.txt</File>
			<Directory>packages/trilinoscouplings/src</Directory>
			<FullName>packages/trilinoscouplings/src/CMakeLists.txt</FullName>
			<CheckinDate>2011-07-21 23:11:52 -0600</CheckinDate>
			<Author>Heidi Thornquist</Author>
			<Email>hkthorn@noemail</Email>
			<Committer>Heidi Thornquist</Committer>
			<CommitterEmail>hkthorn@noemail</CommitterEmail>
			<CommitDate>2011-07-21 23:14:07 -0600</CommitDate>
			<Log>Adding a global AMD permutation for an Epetra_CrsGraph object.
</Log>
			<Revision>91143198be7f9790c9b57de4051f134ce6070838</Revision>
			<PriorRevision>fea8a82f78311ee109a9cdf3e4179ea065be6ee4</PriorRevision>
		</Updated>
	</Directory>
	<Directory>
		<Name>packages/trilinoscouplings/src/epetraext</Name>
		<Updated>
			<File>EpetraExt_AmesosAMDGlobal_CrsGraph.cpp</File>
			<Directory>packages/trilinoscouplings/src/epetraext</Directory>
			<FullName>packages/trilinoscouplings/src/epetraext/EpetraExt_AmesosAMDGlobal_CrsGraph.cpp</FullName>
			<CheckinDate>2011-07-21 23:11:52 -0600</CheckinDate>
			<Author>Heidi Thornquist</Author>
			<Email>hkthorn@noemail</Email>
			<Committer>Heidi Thornquist</Committer>
			<CommitterEmail>hkthorn@noemail</CommitterEmail>
			<CommitDate>2011-07-21 23:14:07 -0600</CommitDate>
			<Log>Adding a global AMD permutation for an Epetra_CrsGraph object.
</Log>
			<Revision>91143198be7f9790c9b57de4051f134ce6070838</Revision>
			<PriorRevision>fea8a82f78311ee109a9cdf3e4179ea065be6ee4</PriorRevision>
		</Updated>
		<Updated>
			<File>EpetraExt_AmesosAMDGlobal_CrsGraph.h</File>
			<Directory>packages/trilinoscouplings/src/epetraext</Directory>
			<FullName>packages/trilinoscouplings/src/epetraext/EpetraExt_AmesosAMDGlobal_CrsGraph.h</FullName>
			<CheckinDate>2011-07-21 23:11:52 -0600</CheckinDate>
			<Author>Heidi Thornquist</Author>
			<Email>hkthorn@noemail</Email>
			<Committer>Heidi Thornquist</Committer>
			<CommitterEmail>hkthorn@noemail</CommitterEmail>
			<CommitDate>2011-07-21 23:14:07 -0600</CommitDate>
			<Log>Adding a global AMD permutation for an Epetra_CrsGraph object.
</Log>
			<Revision>91143198be7f9790c9b57de4051f134ce6070838</Revision>
			<PriorRevision>fea8a82f78311ee109a9cdf3e4179ea065be6ee4</PriorRevision>
		</Updated>
	</Directory>
	<Directory>
		<Name>sampleScripts</Name>
		<Updated>
			<File>linux-hopper-tpetra-cmake</File>
			<Directory>sampleScripts</Directory>
			<FullName>sampleScripts/linux-hopper-tpetra-cmake</FullName>
			<CheckinDate>2011-07-21 23:02:12 -0500</CheckinDate>
			<Author>Kurtis Nusbaum</Author>
			<Email>klnusbaum@noemail</Email>
			<Committer>Kurtis Nusbaum</Committer>
			<CommitterEmail>klnusbaum@noemail</CommitterEmail>
			<CommitDate>2011-07-21 23:07:29 -0500</CommitDate>
			<Log>Added a sample script for configuring a tpetra build on
hopper.

-Kurtis

Build/Test Cases Summary
Enabled Packages: Optika
Enabled all Forward Packages
0) MPI_DEBUG => passed: passed=2,notpassed=0 (2.77 min)
1) SERIAL_RELEASE => passed: passed=2,notpassed=0 (1.18 min)
Other local commits for this build/test group: 6b5d782
</Log>
			<Revision>8e20b439f1cb043594402e7e7b965b8f2e569ad8</Revision>
			<PriorRevision>fea8a82f78311ee109a9cdf3e4179ea065be6ee4</PriorRevision>
		</Updated>
	</Directory>
	<EndDateTime>Jul 22 11:15 Eastern Daylight Time</EndDateTime>
	<EndTime>1311347720</EndTime>
<ElapsedMinutes>0.3</ElapsedMinutes>
	<UpdateReturnStatus></UpdateReturnStatus>
</Update>

{'repo_name': 'Kitware/CDash', 'stars': '133', 'repo_language': 'PHP', 'file_name': 'env', 'mime_type': 'text/plain', 'hash': -7504994847281160370, 'source_dataset': 'data'}


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

package com.android.calculator2.view;

import android.content.Context;
import android.text.Editable;
import android.text.InputType;
import android.text.Spanned;
import android.text.method.NumberKeyListener;
import android.view.ActionMode;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnFocusChangeListener;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;

import com.android.calculator2.R;
import com.android.calculator2.view.display.AdvancedDisplay;
import com.android.calculator2.view.display.EventListener;
import com.xlythe.math.Constants;

public class MatrixEditText extends EditText implements OnFocusChangeListener {
    private static final char[] ACCEPTED_CHARS = "0123456789,.-\u2212".toCharArray();

    private MatrixView mParent;
    private EventListener mListener;

    public MatrixEditText(MatrixView matrixView, EventListener listener) {
        super(matrixView.getContext());
        setCustomSelectionActionModeCallback(new NoTextSelectionMode());
        InputMethodManager imm = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
        imm.showSoftInput(this, InputMethodManager.SHOW_IMPLICIT);
        int padding = getContext().getResources().getDimensionPixelSize(R.dimen.matrix_edit_text_padding);
        setPadding(padding, 0, padding, 0);
        this.mParent = matrixView;
        setKeyListener(new MatrixKeyListener());
        setOnFocusChangeListener(this);
        setGravity(Gravity.CENTER);
        mListener = listener;
    }

    @Override
    public void onFocusChange(View v, boolean hasFocus) {
        if(hasFocus) {
            mListener.onEditTextChanged(this);
            if(getText().toString().equals(Constants.NAN)) {
                setText("");
            }
        }
    }

    @Override
    public String toString() {
        return getText().toString();
    }

    @Override
    public View focusSearch(int direction) {
        switch(direction) {
            case View.FOCUS_FORWARD:
                return mParent.nextView(this);
            case View.FOCUS_BACKWARD:
                return mParent.previousView(this);
        }
        return super.focusSearch(direction);
    }

    public MatrixView getMatrixView() {
        return mParent;
    }

    class MatrixKeyListener extends NumberKeyListener {
        @Override
        public int getInputType() {
            return EditorInfo.TYPE_CLASS_NUMBER | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS;
        }

        @Override
        protected char[] getAcceptedChars() {
            return ACCEPTED_CHARS;
        }

        @Override
        public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
            return null;
        }

        @Override
        public boolean onKeyDown(View view, Editable content, int keyCode, KeyEvent event) {
            if(keyCode == KeyEvent.KEYCODE_DEL) {
                if(mParent.isEmpty()) mListener.onRemoveView(mParent);
            }
            return super.onKeyDown(view, content, keyCode, event);
        }
    }

    class NoTextSelectionMode implements ActionMode.Callback {
        @Override
        public boolean onCreateActionMode(ActionMode mode, Menu menu) {
            // Prevents the selection action mode on double tap.
            return false;
        }

        @Override
        public boolean onPrepareActionMode(ActionMode mode, Menu menu) {
            return false;
        }

        @Override
        public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
            return false;
        }

        @Override
        public void onDestroyActionMode(ActionMode mode) {
        }
    }

    @Override
    public void setTextSize(float size) {
        super.setTextSize(0.4f * size);
    }

    @Override
    public void setTextSize(int unit, float size) {
        super.setTextSize(unit, 0.4f * size);
    }
}

{'repo_name': 'CyanogenMod/android_packages_apps_Calculator', 'stars': '122', 'repo_language': 'Java', 'file_name': 'Project_Default.xml', 'mime_type': 'text/plain', 'hash': 7815576372561715135, 'source_dataset': 'data'}


/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

import fs from "fs";
import path from "path";
import crypto from "crypto";
import flatmap from "flatmap";

// Compute the SHA-256 digest.
function sha256(data) {
  let hash = crypto.createHash("sha256");
  hash.update(data);
  return hash.digest("hex");
}

// Recursively collect a list of all files of a given directory.
function collectFilesInDirectory(dir) {
  return flatmap(fs.readdirSync(dir), entry => {
    let entry_path = path.join(dir, entry);

    if (fs.lstatSync(entry_path).isDirectory()) {
      return collectFilesInDirectory(entry_path);
    }

    return [entry_path];
  });
}

// A list of hashes for each file in the given path.
function collectFileHashes(context_path) {
  let root = path.join(__dirname, "../../../..");
  let dir = path.join(root, context_path);
  let files = collectFilesInDirectory(dir).sort();

  return files.map(file => {
    return sha256(file + "|" + fs.readFileSync(file, "utf-8"));
  });
}

// Compute a context hash for the given context path.
export default function (context_path) {
  // Regenerate all images when the image_builder changes.
  let hashes = collectFileHashes("automation/taskcluster/image_builder");

  // Regenerate images when the image itself changes.
  hashes = hashes.concat(collectFileHashes(context_path));

  // Generate a new prefix every month to ensure the image stays buildable.
  let now = new Date();
  let prefix = `${now.getUTCFullYear()}-${now.getUTCMonth() + 1}:`;
  return sha256(prefix + hashes.join(","));
}

{'repo_name': 'MoonchildProductions/UXP', 'stars': '338', 'repo_language': 'None', 'file_name': 'copyimage.h', 'mime_type': 'text/x-c++', 'hash': 5953010381736157205, 'source_dataset': 'data'}


[QUnit](http://qunitjs.com) - A JavaScript Unit Testing Framework.
================================

QUnit is a powerful, easy-to-use, JavaScript unit testing framework. It's used by the jQuery
project to test its code and plugins but is capable of testing any generic
JavaScript code (and even capable of testing JavaScript code on the server-side).

QUnit is especially useful for regression testing: Whenever a bug is reported,
write a test that asserts the existence of that particular bug. Then fix it and
commit both. Every time you work on the code again, run the tests. If the bug
comes up again - a regression - you'll spot it immediately and know how to fix
it, because you know what code you just changed.

Having good unit test coverage makes safe refactoring easy and cheap. You can
run the tests after each small refactoring step and always know what change
broke something.

QUnit is similar to other unit testing frameworks like JUnit, but makes use of
the features JavaScript provides and helps with testing code in the browser, e.g.
with its stop/start facilities for testing asynchronous code.

If you are interested in helping developing QUnit, you are in the right place.
For related discussions, visit the
[QUnit and Testing forum](http://forum.jquery.com/qunit-and-testing).

Development
-----------

To submit patches, fork the repository, create a branch for the change. Then implement
the change, run `grunt` to lint and test it, then commit, push and create a pull request.

Include some background for the change in the commit message and `Fixes #nnn`, referring
to the issue number you're addressing.

To run `grunt`, you need `node` and `npm`, then `npm install grunt -g`. That gives you a global
grunt binary. For additional grunt tasks, also run `npm install`.

Releases
--------

Install git-extras and run `git changelog` to update History.md. Clean up the
changelog, removing merge commits or whitespace cleanups.

Update qunit/qunit.js|css and package.json to the release version, commit and
tag (Put the 'v' in front of the tag, e.g. `v1.8.0`), update them again to
the next version, commit and push commits and tags:

	git push --tags origin master

To upload to code.jquery.com (replace $version accordingly), ssh to code.origin.jquery.com:

	cp qunit/qunit.js /var/www/html/code.jquery.com/qunit/qunit-$version.js
	cp qunit/qunit.css /var/www/html/code.jquery.com/qunit/qunit-$version.css

Then update /var/www/html/code.jquery.com/index.html and purge it with:

	curl -s http://code.origin.jquery.com/?reload

Update web-base-template to link to those files for qunitjs.com.

Publish to npm via

	npm publish

{'repo_name': 'fluid-project/infusion', 'stars': '118', 'repo_language': 'JavaScript', 'file_name': 'org.eclipse.core.resources.prefs', 'mime_type': 'text/plain', 'hash': -6642614202213257103, 'source_dataset': 'data'}


// +build !windows,!plan9

package log

import (
	"log/syslog"
	"strings"
)

// SyslogHandler opens a connection to the system syslog daemon by calling
// syslog.New and writes all records to it.
func SyslogHandler(priority syslog.Priority, tag string, fmtr Format) (Handler, error) {
	wr, err := syslog.New(priority, tag)
	return sharedSyslog(fmtr, wr, err)
}

// SyslogNetHandler opens a connection to a log daemon over the network and writes
// all log records to it.
func SyslogNetHandler(net, addr string, priority syslog.Priority, tag string, fmtr Format) (Handler, error) {
	wr, err := syslog.Dial(net, addr, priority, tag)
	return sharedSyslog(fmtr, wr, err)
}

func sharedSyslog(fmtr Format, sysWr *syslog.Writer, err error) (Handler, error) {
	if err != nil {
		return nil, err
	}
	h := FuncHandler(func(r *Record) error {
		var syslogFn = sysWr.Info
		switch r.Lvl {
		case LvlCrit:
			syslogFn = sysWr.Crit
		case LvlError:
			syslogFn = sysWr.Err
		case LvlWarn:
			syslogFn = sysWr.Warning
		case LvlInfo:
			syslogFn = sysWr.Info
		case LvlDebug:
			syslogFn = sysWr.Debug
		case LvlTrace:
			syslogFn = func(m string) error { return nil } // There's no syslog level for trace
		}

		s := strings.TrimSpace(string(fmtr.Format(r)))
		return syslogFn(s)
	})
	return LazyHandler(&closingHandler{sysWr, h}), nil
}

func (m muster) SyslogHandler(priority syslog.Priority, tag string, fmtr Format) Handler {
	return must(SyslogHandler(priority, tag, fmtr))
}

func (m muster) SyslogNetHandler(net, addr string, priority syslog.Priority, tag string, fmtr Format) Handler {
	return must(SyslogNetHandler(net, addr, priority, tag, fmtr))
}

{'repo_name': 'U-Network/UNetwork', 'stars': '188', 'repo_language': 'Go', 'file_name': 'main.go', 'mime_type': 'text/x-c', 'hash': -4540154818139793253, 'source_dataset': 'data'}


// Automatically generated by the Fast Binary Encoding compiler, do not modify!
// https://github.com/chronoxor/FastBinaryEncoding
// Source: FBE
// Version: 1.4.0.0

package test

import "errors"
import "../fbe"
import "../proto"

// Workaround for Go unused imports issue
var _ = errors.New
var _ = fbe.Version
var _ = proto.Version

// Fast Binary Encoding optional StructOptional final model
type FinalModelOptionalStructOptional struct {
    // Final model buffer
    buffer *fbe.Buffer
    // Final model buffer offset
    offset int

    // Base final model value
    value *FinalModelStructOptional
}

// Create a new optional StructOptional final model
func NewFinalModelOptionalStructOptional(buffer *fbe.Buffer, offset int) *FinalModelOptionalStructOptional {
    fbeResult := FinalModelOptionalStructOptional{buffer: buffer, offset: offset}
    fbeResult.value = NewFinalModelStructOptional(buffer, 0)
    return &fbeResult
}

// Get the optional final model value
func (fm *FinalModelOptionalStructOptional) Value() *FinalModelStructOptional { return fm.value }

// Get the allocation size
func (fm *FinalModelOptionalStructOptional) FBEAllocationSize(fbeValue *StructOptional) int {
    if fbeValue != nil {
        return 1 + fm.value.FBEAllocationSize(fbeValue)
    } else {
        return 1
    }
}

// Get the final offset
func (fm *FinalModelOptionalStructOptional) FBEOffset() int { return fm.offset }
// Set the final offset
func (fm *FinalModelOptionalStructOptional) SetFBEOffset(value int) { fm.offset = value }

// Shift the current final offset
func (fm *FinalModelOptionalStructOptional) FBEShift(size int) { fm.offset += size }
// Unshift the current final offset
func (fm *FinalModelOptionalStructOptional) FBEUnshift(size int) { fm.offset -= size }

// Check if the object contains a value
func (fm *FinalModelOptionalStructOptional) HasValue() bool {
    if (fm.buffer.Offset() + fm.FBEOffset() + 1) > fm.buffer.Size() {
        return false
    }

    fbeHasValue := fbe.ReadUInt8(fm.buffer.Data(), fm.buffer.Offset() + fm.FBEOffset())
    return fbeHasValue != 0
}

// Check if the optional value is valid
func (fm *FinalModelOptionalStructOptional) Verify() int {
    if (fm.buffer.Offset() + fm.FBEOffset() + 1) > fm.buffer.Size() {
        return fbe.MaxInt
    }

    fbeHasValue := fbe.ReadUInt8(fm.buffer.Data(), fm.buffer.Offset() + fm.FBEOffset())
    if fbeHasValue == 0 {
        return 1
    }

    fm.buffer.Shift(fm.FBEOffset() + 1)
    fbeResult := fm.value.Verify()
    fm.buffer.Unshift(fm.FBEOffset() + 1)
    return 1 + fbeResult
}

// Get the optional value
func (fm *FinalModelOptionalStructOptional) Get() (*StructOptional, int, error) {
    var fbeValue *StructOptional = nil

    if (fm.buffer.Offset() + fm.FBEOffset() + 1) > fm.buffer.Size() {
        return fbeValue, 0, errors.New("model is broken")
    }

    if !fm.HasValue() {
        return fbeValue, 1, nil
    }

    var fbeResult int
    var err error

    fbeValue = NewStructOptional()

    fm.buffer.Shift(fm.FBEOffset() + 1)
    fbeResult, err = fm.value.GetValue(fbeValue)
    fm.buffer.Unshift(fm.FBEOffset() + 1)
    return fbeValue, 1 + fbeResult, err
}

// Set the optional value
func (fm *FinalModelOptionalStructOptional) Set(fbeValue *StructOptional) (int, error) {
    if (fm.buffer.Offset() + fm.FBEOffset() + 1) > fm.buffer.Size() {
        return 0, errors.New("model is broken")
    }

    fbeHasValue := uint8(0)
    if fbeValue != nil {
        fbeHasValue = uint8(1)
    }
    fbe.WriteUInt8(fm.buffer.Data(), fm.buffer.Offset() + fm.FBEOffset(), fbeHasValue)
    if fbeHasValue == 0 {
        return 1, nil
    }

    fm.buffer.Shift(fm.FBEOffset() + 1)
    fbeResult, err := fm.value.Set(fbeValue)
    fm.buffer.Unshift(fm.FBEOffset() + 1)
    return 1 + fbeResult, err
}

{'repo_name': 'chronoxor/FastBinaryEncoding', 'stars': '340', 'repo_language': 'C++', 'file_name': 'fbe_protocol.cpp', 'mime_type': 'text/x-c++', 'hash': 6831553696658082220, 'source_dataset': 'data'}


package com.vaadin.tests.design.nested.customlayouts;

import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;

/**
 * @author Vaadin Ltd
 */
public class CustomPanel extends Panel {
    public CustomPanel() {
        setContent(new Label());
    }
}

{'repo_name': 'vaadin/framework', 'stars': '1611', 'repo_language': 'Java', 'file_name': 'ServerRpcHandlerTest.java', 'mime_type': 'text/x-java', 'hash': 1584758594893383187, 'source_dataset': 'data'}


<?php

@define('PLUGIN_EVENT_MAILER_NAME', '使用电子邮件发送文章');
@define('PLUGIN_EVENT_MAILER_DESC', '可以让你将新发布的文章发送到指定的电子邮件地址中');
@define('PLUGIN_EVENT_MAILER_RECIPIENT', '电子邮件收件人');
@define('PLUGIN_EVENT_MAILER_RECIPIENTDESC', '新发布的文章将被发送到这里设置的电子邮件地址(推荐使用邮件列表)');
@define('PLUGIN_EVENT_MAILER_LINK', '在电子邮件内容中包含相关文章的链接？');
@define('PLUGIN_EVENT_MAILER_LINKDESC', '在电子邮件内容中包含相关文章的链接网址');
@define('PLUGIN_EVENT_MAILER_STRIPTAGS', '删除HTML标记语言');
@define('PLUGIN_EVENT_MAILER_STRIPTAGSDESC', '在电子邮件内容中删除HTML标签');
@define('PLUGIN_EVENT_MAILER_CONVERTP', '将HTML段落标签转传成新行');
@define('PLUGIN_EVENT_MAILER_CONVERTPDESC', '在每一个HTML段落后面添加新的一行。如果你启用了“删除HTML标记语言”设置的话，那么启用该设置将很有用，因为它可以保证你的段落格式在电子邮件中不走样（假设你不是手工在文章中添加HTML标记的话）。');
@define('PLUGIN_EVENT_MAILER_RECIPIENTS', '电子邮件收件人 (不同收件人之间使用空格区分)');
@define('PLUGIN_EVENT_MAILER_NOTSENDDECISION', '你决定不将此文章通过电子邮件发送出去，因此该文章没有通过电子邮件发送出去。');
@define('PLUGIN_EVENT_MAILER_SENDING', '电子邮件发送中……');
@define('PLUGIN_EVENT_MAILER_ISTOSENDIT', '使用电子邮件发送文章');

{'repo_name': 's9y/Serendipity', 'stars': '139', 'repo_language': 'PHP', 'file_name': 'ChangeLog', 'mime_type': 'text/plain', 'hash': -6284678745757120018, 'source_dataset': 'data'}


$NetBSD: distinfo,v 1.36 2020/06/29 15:08:26 adam Exp $

SHA1 (libebml-1.4.0.tar.xz) = a81f64c87942e6d474cc0660d3f73e98c2fd9c66
RMD160 (libebml-1.4.0.tar.xz) = 80d14ac3b9029de489d034879ee0a2fb45e5cd46
SHA512 (libebml-1.4.0.tar.xz) = db78ee560a44b90b4df12ba23a00f8ccb0d3626f44296af6b79a492a00126690582764c6be6c9e9851302a0d0d70edfbe000cc217c5532abe862a821624af230
Size (libebml-1.4.0.tar.xz) = 69944 bytes

{'repo_name': 'NetBSD/pkgsrc', 'stars': '152', 'repo_language': 'None', 'file_name': 'patch-CoinMP-configure', 'mime_type': 'text/x-diff', 'hash': -4653346056846114524, 'source_dataset': 'data'}


object Frame1: TFrame1
  Left = 0
  Top = 0
  Width = 349
  Height = 240
  TabOrder = 0
  DesignSize = (
    349
    240)
  object LabelAppName: TLabel
    Left = 269
    Top = 9
    Width = 71
    Height = 13
    Alignment = taRightJustify
    Anchors = [akTop, akRight]
    Caption = 'LabelAppName'
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clBlue
    Font.Height = -11
    Font.Name = 'Tahoma'
    Font.Style = []
    ParentFont = False
    ExplicitLeft = 240
  end
  object Label2: TLabel
    Left = 16
    Top = 4
    Width = 128
    Height = 19
    Caption = 'App diagnostics'
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -16
    Font.Name = 'Tahoma'
    Font.Style = [fsBold]
    ParentFont = False
  end
end

{'repo_name': 'andrea-magni/MARS', 'stars': '244', 'repo_language': 'Pascal', 'file_name': 'HelloWorld.ini', 'mime_type': 'text/plain', 'hash': -4980790118085031132, 'source_dataset': 'data'}