text:
// _________________
// CanvasRecorder.js

/**
 * CanvasRecorder is a standalone class used by {@link RecordRTC} to bring HTML5-Canvas recording into video WebM. It uses HTML2Canvas library and runs top over {@link Whammy}.
 * @summary HTML2Canvas recording into video WebM.
 * @license {@link https://github.com/muaz-khan/RecordRTC/blob/master/LICENSE|MIT}
 * @author {@link https://MuazKhan.com|Muaz Khan}
 * @typedef CanvasRecorder
 * @class
 * @example
 * var recorder = new CanvasRecorder(htmlElement, { disableLogs: true, useWhammyRecorder: true });
 * recorder.record();
 * recorder.stop(function(blob) {
 *     video.src = URL.createObjectURL(blob);
 * });
 * @see {@link https://github.com/muaz-khan/RecordRTC|RecordRTC Source Code}
 * @param {HTMLElement} htmlElement - querySelector/getElementById/getElementsByTagName[0]/etc.
 * @param {object} config - {disableLogs:true, initCallback: function}
 */

function CanvasRecorder(htmlElement, config) {
    if (typeof html2canvas === 'undefined') {
        throw 'Please link: https://www.webrtc-experiment.com/screenshot.js';
    }

    config = config || {};
    if (!config.frameInterval) {
        config.frameInterval = 10;
    }

    // via DetectRTC.js
    var isCanvasSupportsStreamCapturing = false;
    ['captureStream', 'mozCaptureStream', 'webkitCaptureStream'].forEach(function(item) {
        if (item in document.createElement('canvas')) {
            isCanvasSupportsStreamCapturing = true;
        }
    });

    var _isChrome = (!!window.webkitRTCPeerConnection || !!window.webkitGetUserMedia) && !!window.chrome;

    var chromeVersion = 50;
    var matchArray = navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);
    if (_isChrome && matchArray && matchArray[2]) {
        chromeVersion = parseInt(matchArray[2], 10);
    }

    if (_isChrome && chromeVersion < 52) {
        isCanvasSupportsStreamCapturing = false;
    }

    if (config.useWhammyRecorder) {
        isCanvasSupportsStreamCapturing = false;
    }

    var globalCanvas, mediaStreamRecorder;

    if (isCanvasSupportsStreamCapturing) {
        if (!config.disableLogs) {
            console.log('Your browser supports both MediRecorder API and canvas.captureStream!');
        }

        if (htmlElement instanceof HTMLCanvasElement) {
            globalCanvas = htmlElement;
        } else if (htmlElement instanceof CanvasRenderingContext2D) {
            globalCanvas = htmlElement.canvas;
        } else {
            throw 'Please pass either HTMLCanvasElement or CanvasRenderingContext2D.';
        }
    } else if (!!navigator.mozGetUserMedia) {
        if (!config.disableLogs) {
            console.error('Canvas recording is NOT supported in Firefox.');
        }
    }

    var isRecording;

    /**
     * This method records Canvas.
     * @method
     * @memberof CanvasRecorder
     * @example
     * recorder.record();
     */
    this.record = function() {
        isRecording = true;

        if (isCanvasSupportsStreamCapturing && !config.useWhammyRecorder) {
            // CanvasCaptureMediaStream
            var canvasMediaStream;
            if ('captureStream' in globalCanvas) {
                canvasMediaStream = globalCanvas.captureStream(25); // 25 FPS
            } else if ('mozCaptureStream' in globalCanvas) {
                canvasMediaStream = globalCanvas.mozCaptureStream(25);
            } else if ('webkitCaptureStream' in globalCanvas) {
                canvasMediaStream = globalCanvas.webkitCaptureStream(25);
            }

            try {
                var mdStream = new MediaStream();
                mdStream.addTrack(getTracks(canvasMediaStream, 'video')[0]);
                canvasMediaStream = mdStream;
            } catch (e) {}

            if (!canvasMediaStream) {
                throw 'captureStream API are NOT available.';
            }

            // Note: Jan 18, 2016 status is that,
            // Firefox MediaRecorder API can't record CanvasCaptureMediaStream object.
            mediaStreamRecorder = new MediaStreamRecorder(canvasMediaStream, {
                mimeType: config.mimeType || 'video/webm'
            });
            mediaStreamRecorder.record();
        } else {
            whammy.frames = [];
            lastTime = new Date().getTime();
            drawCanvasFrame();
        }

        if (config.initCallback) {
            config.initCallback();
        }
    };

    this.getWebPImages = function(callback) {
        if (htmlElement.nodeName.toLowerCase() !== 'canvas') {
            callback();
            return;
        }

        var framesLength = whammy.frames.length;
        whammy.frames.forEach(function(frame, idx) {
            var framesRemaining = framesLength - idx;
            if (!config.disableLogs) {
                console.log(framesRemaining + '/' + framesLength + ' frames remaining');
            }

            if (config.onEncodingCallback) {
                config.onEncodingCallback(framesRemaining, framesLength);
            }

            var webp = frame.image.toDataURL('image/webp', 1);
            whammy.frames[idx].image = webp;
        });

        if (!config.disableLogs) {
            console.log('Generating WebM');
        }

        callback();
    };

    /**
     * This method stops recording Canvas.
     * @param {function} callback - Callback function, that is used to pass recorded blob back to the callee.
     * @method
     * @memberof CanvasRecorder
     * @example
     * recorder.stop(function(blob) {
     *     video.src = URL.createObjectURL(blob);
     * });
     */
    this.stop = function(callback) {
        isRecording = false;

        var that = this;

        if (isCanvasSupportsStreamCapturing && mediaStreamRecorder) {
            mediaStreamRecorder.stop(callback);
            return;
        }

        this.getWebPImages(function() {
            /**
             * @property {Blob} blob - Recorded frames in video/webm blob.
             * @memberof CanvasRecorder
             * @example
             * recorder.stop(function() {
             *     var blob = recorder.blob;
             * });
             */
            whammy.compile(function(blob) {
                if (!config.disableLogs) {
                    console.log('Recording finished!');
                }

                that.blob = blob;

                if (that.blob.forEach) {
                    that.blob = new Blob([], {
                        type: 'video/webm'
                    });
                }

                if (callback) {
                    callback(that.blob);
                }

                whammy.frames = [];
            });
        });
    };

    var isPausedRecording = false;

    /**
     * This method pauses the recording process.
     * @method
     * @memberof CanvasRecorder
     * @example
     * recorder.pause();
     */
    this.pause = function() {
        isPausedRecording = true;

        if (mediaStreamRecorder instanceof MediaStreamRecorder) {
            mediaStreamRecorder.pause();
            return;
        }
    };

    /**
     * This method resumes the recording process.
     * @method
     * @memberof CanvasRecorder
     * @example
     * recorder.resume();
     */
    this.resume = function() {
        isPausedRecording = false;

        if (mediaStreamRecorder instanceof MediaStreamRecorder) {
            mediaStreamRecorder.resume();
            return;
        }

        if (!isRecording) {
            this.record();
        }
    };

    /**
     * This method resets currently recorded data.
     * @method
     * @memberof CanvasRecorder
     * @example
     * recorder.clearRecordedData();
     */
    this.clearRecordedData = function() {
        if (isRecording) {
            this.stop(clearRecordedDataCB);
        }
        clearRecordedDataCB();
    };

    function clearRecordedDataCB() {
        whammy.frames = [];
        isRecording = false;
        isPausedRecording = false;
    }

    // for debugging
    this.name = 'CanvasRecorder';
    this.toString = function() {
        return this.name;
    };

    function cloneCanvas() {
        //create a new canvas
        var newCanvas = document.createElement('canvas');
        var context = newCanvas.getContext('2d');

        //set dimensions
        newCanvas.width = htmlElement.width;
        newCanvas.height = htmlElement.height;

        //apply the old canvas to the new one
        context.drawImage(htmlElement, 0, 0);

        //return the new canvas
        return newCanvas;
    }

    function drawCanvasFrame() {
        if (isPausedRecording) {
            lastTime = new Date().getTime();
            return setTimeout(drawCanvasFrame, 500);
        }

        if (htmlElement.nodeName.toLowerCase() === 'canvas') {
            var duration = new Date().getTime() - lastTime;
            // via #206, by Jack i.e. @Seymourr
            lastTime = new Date().getTime();

            whammy.frames.push({
                image: cloneCanvas(),
                duration: duration
            });

            if (isRecording) {
                setTimeout(drawCanvasFrame, config.frameInterval);
            }
            return;
        }

        html2canvas(htmlElement, {
            grabMouse: typeof config.showMousePointer === 'undefined' || config.showMousePointer,
            onrendered: function(canvas) {
                var duration = new Date().getTime() - lastTime;
                if (!duration) {
                    return setTimeout(drawCanvasFrame, config.frameInterval);
                }

                // via #206, by Jack i.e. @Seymourr
                lastTime = new Date().getTime();

                whammy.frames.push({
                    image: canvas.toDataURL('image/webp', 1),
                    duration: duration
                });

                if (isRecording) {
                    setTimeout(drawCanvasFrame, config.frameInterval);
                }
            }
        });
    }

    var lastTime = new Date().getTime();

    var whammy = new Whammy.Video(100);
}

if (typeof RecordRTC !== 'undefined') {
    RecordRTC.CanvasRecorder = CanvasRecorder;
}


text:
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2014 The Chromium Authors. All rights reserved.
     Use of this source code is governed by a BSD-style license that can be
     found in the LICENSE file. -->

<resources xmlns:tools="http://schemas.android.com/tools">
    <!-- Snackbars -->
    <dimen name="snackbar_min_height">48dp</dimen>
    <dimen name="snackbar_width_tablet">450dp</dimen>
    <dimen name="snackbar_margin_tablet">24dp</dimen>
    <dimen name="snackbar_shadow_height">8dp</dimen>
    <dimen name="snackbar_text_view_margin">24dp</dimen>
</resources>

redpajama_set_name: RedPajamaGithub


text:
<?php
class Bloodgroup extends CI_Model{

	var $id = "";
	var $name = "";
	var $timestamp = "";

	function __construct(){
		parent::__construct();
	}

	function get_all_bloodgroups(){
		$this->db->select('id, name');
		$query = $this->db->get('tbl_bloodgroup');
		return $query->result_array();
	}
}

?>


text:
namespace content {

WebContentsDelegate::WebContentsDelegate() {
}

WebContents* WebContentsDelegate::OpenURLFromTab(WebContents* source,
                                                 const OpenURLParams& params) {
  return nullptr;
}

bool WebContentsDelegate::IsPopupOrPanel(const WebContents* source) const {
  return false;
}

bool WebContentsDelegate::CanOverscrollContent() const { return false; }

gfx::Rect WebContentsDelegate::GetRootWindowResizerRect() const {
  return gfx::Rect();
}

bool WebContentsDelegate::ShouldSuppressDialogs(WebContents* source) {
  return false;
}

bool WebContentsDelegate::ShouldPreserveAbortedURLs(WebContents* source) {
  return false;
}

bool WebContentsDelegate::AddMessageToConsole(WebContents* source,
                                              int32 level,
                                              const base::string16& message,
                                              int32 line_no,
                                              const base::string16& source_id) {
  return false;
}

void WebContentsDelegate::BeforeUnloadFired(WebContents* web_contents,
                                            bool proceed,
                                            bool* proceed_to_fire_unload) {
  *proceed_to_fire_unload = true;
}

bool WebContentsDelegate::ShouldFocusLocationBarByDefault(WebContents* source) {
  return false;
}

bool WebContentsDelegate::ShouldFocusPageAfterCrash() {
  return true;
}

bool WebContentsDelegate::TakeFocus(WebContents* source, bool reverse) {
  return false;
}

int WebContentsDelegate::GetExtraRenderViewHeight() const {
  return 0;
}

void WebContentsDelegate::CanDownload(
    RenderViewHost* render_view_host,
    const GURL& url,
    const std::string& request_method,
    const base::Callback<void(bool)>& callback) {
  callback.Run(true);
}

bool WebContentsDelegate::HandleContextMenu(
    const content::ContextMenuParams& params) {
  return false;
}

void WebContentsDelegate::ViewSourceForTab(WebContents* source,
                                           const GURL& page_url) {
  // Fall back implementation based entirely on the view-source scheme.
  // It suffers from http://crbug.com/523 and that is why browser overrides
  // it with proper implementation.
  GURL url = GURL(kViewSourceScheme + std::string(":") + page_url.spec());
  OpenURLFromTab(source, OpenURLParams(url, Referrer(),
                                       NEW_FOREGROUND_TAB,
                                       ui::PAGE_TRANSITION_LINK, false));
}

void WebContentsDelegate::ViewSourceForFrame(WebContents* source,
                                             const GURL& frame_url,
                                             const PageState& page_state) {
  // Same as ViewSourceForTab, but for given subframe.
  GURL url = GURL(kViewSourceScheme + std::string(":") + frame_url.spec());
  OpenURLFromTab(source, OpenURLParams(url, Referrer(),
                                       NEW_FOREGROUND_TAB,
                                       ui::PAGE_TRANSITION_LINK, false));
}

bool WebContentsDelegate::PreHandleKeyboardEvent(
    WebContents* source,
    const NativeWebKeyboardEvent& event,
    bool* is_keyboard_shortcut) {
  return false;
}

bool WebContentsDelegate::PreHandleGestureEvent(
    WebContents* source,
    const blink::WebGestureEvent& event) {
  return false;
}

bool WebContentsDelegate::CanDragEnter(
    WebContents* source,
    const DropData& data,
    blink::WebDragOperationsMask operations_allowed) {
  return true;
}

bool WebContentsDelegate::OnGoToEntryOffset(int offset) {
  return true;
}

bool WebContentsDelegate::ShouldCreateWebContents(
    WebContents* web_contents,
    int route_id,
    int main_frame_route_id,
    WindowContainerType window_container_type,
    const base::string16& frame_name,
    const GURL& target_url,
    const std::string& partition_id,
    SessionStorageNamespace* session_storage_namespace) {
  return true;
}

JavaScriptDialogManager* WebContentsDelegate::GetJavaScriptDialogManager(
    WebContents* source) {
  return nullptr;
}

bool WebContentsDelegate::EmbedsFullscreenWidget() const {
  return false;
}

bool WebContentsDelegate::IsFullscreenForTabOrPending(
    const WebContents* web_contents) const {
  return false;
}

content::ColorChooser* WebContentsDelegate::OpenColorChooser(
    WebContents* web_contents,
    SkColor color,
    const std::vector<ColorSuggestion>& suggestions) {
  return nullptr;
}

void WebContentsDelegate::RequestMediaAccessPermission(
    WebContents* web_contents,
    const MediaStreamRequest& request,
    const MediaResponseCallback& callback) {
  LOG(ERROR) << "WebContentsDelegate::RequestMediaAccessPermission: "
             << "Not supported.";
  callback.Run(MediaStreamDevices(),
               MEDIA_DEVICE_NOT_SUPPORTED,
               scoped_ptr<MediaStreamUI>());
}

bool WebContentsDelegate::CheckMediaAccessPermission(
    WebContents* web_contents,
    const GURL& security_origin,
    MediaStreamType type) {
  LOG(ERROR) << "WebContentsDelegate::CheckMediaAccessPermission: "
             << "Not supported.";
  return false;
}

bool WebContentsDelegate::RequestPpapiBrokerPermission(
    WebContents* web_contents,
    const GURL& url,
    const base::FilePath& plugin_path,
    const base::Callback<void(bool)>& callback) {
  return false;
}

WebContentsDelegate::~WebContentsDelegate() {
  while (!attached_contents_.empty()) {
    WebContents* web_contents = *attached_contents_.begin();
    web_contents->SetDelegate(nullptr);
  }
  DCHECK(attached_contents_.empty());
}

void WebContentsDelegate::Attach(WebContents* web_contents) {
  DCHECK(attached_contents_.find(web_contents) == attached_contents_.end());
  attached_contents_.insert(web_contents);
}

void WebContentsDelegate::Detach(WebContents* web_contents) {
  DCHECK(attached_contents_.find(web_contents) != attached_contents_.end());
  attached_contents_.erase(web_contents);
}

gfx::Size WebContentsDelegate::GetSizeForNewRenderView(
   WebContents* web_contents) const {
  return gfx::Size();
}

bool WebContentsDelegate::IsNeverVisible(WebContents* web_contents) {
  return false;
}

bool WebContentsDelegate::SaveFrame(const GURL& url, const Referrer& referrer) {
  return false;
}

}  // namespace content


text:
package com.shockfish.tinyos.gateway;

/**
 * @author Karl Baumgartner, HEIG-VD
 */

import java.io.IOException;
import com.shockfish.tinyos.gateway.SenderTimerControl;
import com.shockfish.tinyos.gateway.CldcDataSender;
import com.shockfish.tinyos.tools.Tc65Manager;
import com.shockfish.tinyos.tools.CldcLogger;
import com.shockfish.tinyos.gateway.TOSBuffer;

public class SenderMessage extends Thread {

	private SenderTimerControl senderTimerControl;

	private Tc65Manager manager;

	private TOSBuffer tosbuffer;

	private int NumberOfRecordToSend;

	private CldcDataSender cldsDataSender;

	private int maxNumberOfTry = 1;

	private final String DEFAULT_IP_DATA_SERVER = "10.192.168.10";

	private final String DEFAULT_PORT_DATA_SERVER = "1000";

	private final String FILE_IP_DATA_SERVER = "IP_DATA_SERVER";

	private final String FILE_PORT_DATA_SERVER = "PORT_DATA_SERVER";

	private final String FILE_ID_BASESTATION = "BASESTATION_ID";

	private final String DEFAULT_ID_BASESTATION = "NO_BASESTATION_ID";

	public SenderMessage(Tc65Manager manager, TOSBuffer tosbuffer,
			SenderTimerControl senderTimerControl) {
		super();
		this.senderTimerControl = senderTimerControl;
		this.manager = manager;
		this.tosbuffer = tosbuffer;

		String address = manager.readProp(FILE_IP_DATA_SERVER);
		String port = manager.readProp(FILE_PORT_DATA_SERVER);

		if (address == null)
			address = DEFAULT_IP_DATA_SERVER;
		if (port == null)
			port = DEFAULT_PORT_DATA_SERVER;

		cldsDataSender = new CldcDataSender(address, Integer.parseInt(port),
				manager.getGprsConf());
	}

	public void run() {
		NumberOfRecordToSend = tosbuffer.size();

		// do not start the connection if nothing to send
		CldcLogger.devDebug(CldcLogger.SRC_8, "SenderMessage started ("
				+ Thread.currentThread() + ")");

		if (NumberOfRecordToSend <= 0) {
			CldcLogger.info("Buffer empty, do not send anything");
			senderTimerControl.startSenderTimer();
			return;
		}

		String id_basestation = manager.readProp(FILE_ID_BASESTATION);

		if (id_basestation == null)
			id_basestation = DEFAULT_ID_BASESTATION;

		long startTime = System.currentTimeMillis();
		int numberOfTry = 0;
		boolean isConnected = false;

		// try to reconnect a certain number of times
		while ((numberOfTry <= maxNumberOfTry) && (!isConnected)) {
			try {
				cldsDataSender.connect();
				isConnected = true;
			} catch (IOException e) {
				CldcLogger
						.severe("Connection to server failed: "
								+ e);
				numberOfTry++;
			}
		}

		boolean isSent = false;
		int NumSendedRecord = 0;
		try {
			if (!isConnected) {
				senderTimerControl.startSenderTimer();
				return;
			}

			cldsDataSender.sendInit(id_basestation, Tc65Manager.getDate());

			for (int i = 0; i < NumberOfRecordToSend; i++) {
				cldsDataSender.sendRecord(tosbuffer.getElement(i));
				NumSendedRecord++;
			}

			cldsDataSender.sendEnd();
			isSent = true;

		} catch (IOException e) {
			CldcLogger.severe("SenderMessage error: "
					+ e.toString());
		}

		try {
			cldsDataSender.close();
		} catch (IOException e) {
			CldcLogger.severe("SenderMessage closing error: "
					+ e.toString());
		}

		if (isSent) {
			for (int i = 0; i < NumberOfRecordToSend; i++) {
				tosbuffer.deleteRecord(0);
			}
		}

		senderTimerControl.startSenderTimer();
	}
}


text:
package com.google.cloud.vpcaccess.v1.samples;

// [START vpcaccess_v1_generated_VpcAccessService_DeleteConnector_async]
import com.google.api.core.ApiFuture;
import com.google.cloud.vpcaccess.v1.ConnectorName;
import com.google.cloud.vpcaccess.v1.DeleteConnectorRequest;
import com.google.cloud.vpcaccess.v1.VpcAccessServiceClient;
import com.google.longrunning.Operation;

public class AsyncDeleteConnector {

  public static void main(String[] args) throws Exception {
    asyncDeleteConnector();
  }

  public static void asyncDeleteConnector() throws Exception {
    // This snippet has been automatically generated and should be regarded as a code template only.
    // It will require modifications to work:
    // - It may require correct/in-range values for request initialization.
    // - It may require specifying regional endpoints when creating the service client as shown in
    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    try (VpcAccessServiceClient vpcAccessServiceClient = VpcAccessServiceClient.create()) {
      DeleteConnectorRequest request =
          DeleteConnectorRequest.newBuilder()
              .setName(ConnectorName.of("[PROJECT]", "[LOCATION]", "[CONNECTOR]").toString())
              .build();
      ApiFuture<Operation> future =
          vpcAccessServiceClient.deleteConnectorCallable().futureCall(request);
      // Do something.
      future.get();
    }
  }
}
// [END vpcaccess_v1_generated_VpcAccessService_DeleteConnector_async]


text:
# media-feature-colon-space-after

Require a single space or disallow whitespace after the colon in media features.

<!-- prettier-ignore -->
```css
@media (max-width: 600px) {}
/**              ↑
 * The space after this colon */
```

The [`fix` option](../../../docs/user-guide/usage/options.md#fix) can automatically fix all of the problems reported by this rule.

## Options

`string`: `"always"|"never"`

### `"always"`

There _must always_ be a single space after the colon.

The following patterns are considered violations:

<!-- prettier-ignore -->
```css
@media (max-width:600px) {}
```

<!-- prettier-ignore -->
```css
@media (max-width :600px) {}
```

The following patterns are _not_ considered violations:

<!-- prettier-ignore -->
```css
@media (max-width: 600px) {}
```

<!-- prettier-ignore -->
```css
@media (max-width : 600px) {}
```

### `"never"`

There _must never_ be whitespace after the colon.

The following patterns are considered violations:

<!-- prettier-ignore -->
```css
@media (max-width: 600px) {}
```

<!-- prettier-ignore -->
```css
@media (max-width : 600px) {}
```

The following patterns are _not_ considered violations:

<!-- prettier-ignore -->
```css
@media (max-width:600px) {}
```

<!-- prettier-ignore -->
```css
@media (max-width :600px) {}
```


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>ReadWriterFactory (ReadTools 1.5.2 API)</title>
<meta name="date" content="2018-08-30">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

org.magicdgs.readtools.utils.read

Class ReadWriterFactory

java.lang.Object

org.magicdgs.readtools.utils.read.ReadWriterFactory

public final class ReadWriterFactory
extends java.lang.Object

Factory for generate writers for all sources of reads with the same parameters. Before opening a
 writer, the file will be check if it exists (unless forceOverwrite is true) and
 create intermediate directories.

 Note: the defaults in SAMFileWriterFactory will be applied, except the useAsyncIo and
 createMd5.

Constructor Summary

Constructors

Constructor and Description

ReadWriterFactory()

Creates a default factory.

Method Summary

All Methods Static Methods Instance Methods Concrete Methods

Modifier and Type
Method and Description

static void
closeWriter(org.broadinstitute.hellbender.utils.read.GATKReadWriter writer)

Close the writer if it is not null, throwing if it is not possible to close.

org.broadinstitute.hellbender.utils.read.GATKReadWriter
createDistmapWriter(java.lang.String output,
                   boolean isPaired)

Creates a GATKWriter for Distmap output.

org.broadinstitute.hellbender.utils.read.GATKReadWriter
createFASTQWriter(java.lang.String output)

Creates a FASTQ writer from a String path.

org.broadinstitute.hellbender.utils.read.GATKReadWriter
createSAMWriter(java.lang.String output,
               htsjdk.samtools.SAMFileHeader header,
               boolean presorted)

Creates a SAM/BAM/CRAM writer from a String path.

org.broadinstitute.hellbender.utils.read.GATKReadWriter
createWriter(java.lang.String output,
            htsjdk.samtools.SAMFileHeader header,
            boolean presorted)

Creates a GATKReadWriter based on the path extension.

htsjdk.samtools.fastq.FastqWriter
openFastqWriter(java.nio.file.Path path)

Open a new FASTQ writer from a Path.

htsjdk.samtools.fastq.FastqWriter
openFastqWriter(java.lang.String output)

Open a new FASTQ writer based from a String path.

htsjdk.samtools.SAMFileWriter
openSAMWriter(htsjdk.samtools.SAMFileHeader header,
             boolean presorted,
             java.nio.file.Path output)

Open a new SAM/BAM/CRAM writer from a Path.

htsjdk.samtools.SAMFileWriter
openSAMWriter(htsjdk.samtools.SAMFileHeader header,
             boolean presorted,
             java.lang.String output)

Open a new SAM/BAM/CRAM writer from a String path.

ReadWriterFactory
setAsyncOutputBufferSize(int asyncOutputBufferSize)

Sets asynchronous buffer size for any writers.

ReadWriterFactory
setBufferSize(int bufferSize)

Sets buffer size for SAM/BAM/CRAM writers.

ReadWriterFactory
setCreateIndex(boolean createIndex)

Sets index creation for BAM/CRAM writers.

ReadWriterFactory
setCreateMd5File(boolean createMd5File)

Sets if the factory should create a MD5 file for any writer.

ReadWriterFactory
setForceOverwrite(boolean forceOverwrite)

Sets if the output will be overwriten even if it exists.

ReadWriterFactory
setHdfsBlockSize(java.lang.Long hdfsBlockSize)

Sets the block-size for HDFS output files.

ReadWriterFactory
setMaxRecordsInRam(int maxRecordsInRam)

Sets maximum records in RAM for sorting SAM/BAM/CRAM writers.

ReadWriterFactory
setReferencePath(java.nio.file.Path referencePath)

Sets the reference file.

ReadWriterFactory
setTempDirectory(java.io.File tmpDir)

Sets the temp directory for sorting SAM/BAM/CRAM writers.

ReadWriterFactory
setUseAsyncIo(boolean useAsyncIo)

Sets asynchronous writing for any writer.

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ReadWriterFactory

public ReadWriterFactory()

Creates a default factory.

Method Detail

setUseAsyncIo

public ReadWriterFactory setUseAsyncIo(boolean useAsyncIo)

Sets asynchronous writing for any writer.

setCreateMd5File

public ReadWriterFactory setCreateMd5File(boolean createMd5File)

Sets if the factory should create a MD5 file for any writer.

setCreateIndex

public ReadWriterFactory setCreateIndex(boolean createIndex)

Sets index creation for BAM/CRAM writers.

setMaxRecordsInRam

public ReadWriterFactory setMaxRecordsInRam(int maxRecordsInRam)

Sets maximum records in RAM for sorting SAM/BAM/CRAM writers.

setTempDirectory

public ReadWriterFactory setTempDirectory(java.io.File tmpDir)

Sets the temp directory for sorting SAM/BAM/CRAM writers.

setAsyncOutputBufferSize

public ReadWriterFactory setAsyncOutputBufferSize(int asyncOutputBufferSize)

Sets asynchronous buffer size for any writers.

setBufferSize

public ReadWriterFactory setBufferSize(int bufferSize)

Sets buffer size for SAM/BAM/CRAM writers.

setReferencePath

public ReadWriterFactory setReferencePath(java.nio.file.Path referencePath)

Sets the reference file. This is required for CRAM writers.

setForceOverwrite

public ReadWriterFactory setForceOverwrite(boolean forceOverwrite)

Sets if the output will be overwriten even if it exists.

setHdfsBlockSize

public ReadWriterFactory setHdfsBlockSize(java.lang.Long hdfsBlockSize)

Sets the block-size for HDFS output files.

openFastqWriter

public htsjdk.samtools.fastq.FastqWriter openFastqWriter(java.nio.file.Path path)

Open a new FASTQ writer from a Path.

openFastqWriter

public htsjdk.samtools.fastq.FastqWriter openFastqWriter(java.lang.String output)

Open a new FASTQ writer based from a String path.

openSAMWriter

public htsjdk.samtools.SAMFileWriter openSAMWriter(htsjdk.samtools.SAMFileHeader header,
                                                   boolean presorted,
                                                   java.lang.String output)

Open a new SAM/BAM/CRAM writer from a String path.

openSAMWriter

public htsjdk.samtools.SAMFileWriter openSAMWriter(htsjdk.samtools.SAMFileHeader header,
                                                   boolean presorted,
                                                   java.nio.file.Path output)

Open a new SAM/BAM/CRAM writer from a Path.

createSAMWriter

public org.broadinstitute.hellbender.utils.read.GATKReadWriter createSAMWriter(java.lang.String output,
                                                                               htsjdk.samtools.SAMFileHeader header,
                                                                               boolean presorted)

Creates a SAM/BAM/CRAM writer from a String path.

createFASTQWriter

public org.broadinstitute.hellbender.utils.read.GATKReadWriter createFASTQWriter(java.lang.String output)

Creates a FASTQ writer from a String path.

createDistmapWriter

public org.broadinstitute.hellbender.utils.read.GATKReadWriter createDistmapWriter(java.lang.String output,
                                                                                boolean isPaired)

Creates a GATKWriter for Distmap output.

createWriter

public org.broadinstitute.hellbender.utils.read.GATKReadWriter createWriter(java.lang.String output,
                                                                            htsjdk.samtools.SAMFileHeader header,
                                                                            boolean presorted)

Creates a GATKReadWriter based on the path extension.

closeWriter

public static final void closeWriter(org.broadinstitute.hellbender.utils.read.GATKReadWriter writer)

Close the writer if it is not null, throwing if it is not possible to close.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <title>ActiveSupport::Logger</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" href="../../css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../css/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../css/github.css" type="text/css" media="screen" />

            Ruby on Rails 4.1.8

            Class
            ActiveSupport::Logger

                <

                    Logger

/usr/local/share/gems/gems/activesupport-4.1.8/lib/active_support/log_subscriber/test_helper.rb

/usr/local/share/gems/gems/activesupport-4.1.8/lib/active_support/logger.rb

/usr/local/share/gems/gems/activesupport-4.1.8/lib/active_support/tagged_logging.rb

/usr/local/share/gems/gems/railties-4.1.8/lib/rails/application/bootstrap.rb

/usr/local/share/gems/gems/railties-4.1.8/lib/rails/application/configuration.rb

Namespace

          CLASS
          ActiveSupport::Logger::SimpleFormatter

Methods

N

                new

Included Modules

              LoggerSilence

Class Public methods

              new(*args)

            Link

                Source:
                show

# File ../../../../usr/local/share/gems/gems/activesupport-4.1.8/lib/active_support/logger.rb, line 44
def initialize(*args)
  super
  @formatter = SimpleFormatter.new
end


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<TITLE>
NaturalSelector (ANJI API)
</TITLE>

<META NAME="keywords" CONTENT="org.jgap.NaturalSelector class">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

org.jgap

Class NaturalSelector

java.lang.Object
  org.jgap.NaturalSelector

Direct Known Subclasses:
SimpleSelector, WeightedRouletteSelector

public abstract class NaturalSelector
extends java.lang.Object

Natural selectors are responsible for actually selecting a specified number
 of Chromosome specimens from a population, using the fitness values as a
 guide. Usually fitness is treated as a statistic probability of survival,
 not as the sole determining factor. Therefore, Chromosomes with higher
 fitness values are more likely to survive than those with lesser fitness
 values, but it's not guaranteed.

Constructor Summary

NaturalSelector()

Method Summary

protected abstract  void
add(Configuration config,
    Chromosome c)

 void
add(Configuration config,
    java.util.List chroms)

          If elitism is enabled, places appropriate chromosomes in elite list.

 void
empty()

          clear pool of candidate chromosomes

protected abstract  void
emptyImpl()

 int
getElitismMinSpecieSize()

 float
getSurvivalRate()

 java.util.List
select(Configuration config)

          Select a given number of Chromosomes from the pool that will move on
 to the next generation population.

protected abstract  java.util.List
select(Configuration config,
       int numToSurvive)

 void
setElitism(boolean b)

 void
setElitismMinSpecieSize(int i)

 void
setSurvivalRate(float aSurvivalRate)

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

NaturalSelector

public NaturalSelector()

Method Detail

add

public final void add(Configuration config,
                      java.util.List chroms)

If elitism is enabled, places appropriate chromosomes in elite list.  Elitism follows
 methodolofy in NEAT.  Passes
 everything else to subclass add( Configuration config, Chromosome c ) method.

Parameters:
config -
chroms - List contains Chromosome objects

add

protected abstract void add(Configuration config,
                            Chromosome c)

Parameters:
config -
c - chromosome to add to selection pool

select

public java.util.List select(Configuration config)

Select a given number of Chromosomes from the pool that will move on
 to the next generation population. This selection should be guided by
 the fitness values.
 Elite chromosomes always survivie, unless there are more elite than the survival rate permits.  In this case,
 elite with highest fitness are chosen.  Remainder of survivors are determined by subclass
 select( Configuration config, int numToSurvive ) method.

Parameters:
config -

Returns:
List contains Chromosome objects

select

protected abstract java.util.List select(Configuration config,
                                         int numToSurvive)

Parameters:
config -
numToSurvive -

Returns:
List contains Chromosome objects, those that have survived; size
 of this list should be numToSurvive, unless fewer than that number of chromosomes have
 been added to selector

empty

public void empty()

clear pool of candidate chromosomes

See Also:
emptyImpl()

emptyImpl

protected abstract void emptyImpl()

See Also:
empty()

getSurvivalRate

public float getSurvivalRate()

Returns:
float survival rate

setSurvivalRate

public void setSurvivalRate(float aSurvivalRate)

Parameters:
aSurvivalRate -

getElitismMinSpecieSize

public int getElitismMinSpecieSize()

Returns:
minimum size a specie must be to support an elite chromosome

setElitismMinSpecieSize

public void setElitismMinSpecieSize(int i)

Parameters:
i - minimum size a specie must be to support an elite chromosome

setElitism

public void setElitism(boolean b)

Parameters:
b - true if elitisim is to be enabled

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD


text:
const assert = require('assert');
const MockServer = require('../../../../lib/mockserver.js');
const CommandGlobals = require('../../../../lib/globals/commands.js');

describe('isVisible', function () {
  before(function (done) {
    CommandGlobals.beforeEach.call(this, done);
  });

  afterEach(function () {
    MockServer.removeMock({
      url: '/wd/hub/session/1352110219202/execute/sync',
      method: 'POST'
    });
  });

  after(function (done) {
    CommandGlobals.afterEach.call(this, done);
  });

  it('client.isVisible()', function (done) {
    MockServer.addMock({
      url: '/wd/hub/session/1352110219202/execute/sync',
      method: 'POST',
      response: JSON.stringify({
        sessionId: '1352110219202',
        status: 0,
        value: true
      })
    });

    this.client.api.isVisible('css selector', '#weblogin', function callback(result) {
      assert.strictEqual(result.value, true);
    }).isVisible('#weblogin', function callback(result) {
      assert.strictEqual(result.value, true);
    });

    this.client.start(done);
  });

  it('client.isVisible()', function (done) {
    MockServer.addMock({
      url: '/wd/hub/session/1352110219202/execute/sync',
      method: 'POST',
      response: JSON.stringify({
        sessionId: '1352110219202',
        status: 0,
        value: false
      })
    });

    this.client.api.isVisible('css selector', '#weblogin', function callback(result) {
      assert.strictEqual(result.value, false);
    }).isVisible('#weblogin', function callback(result) {
      assert.strictEqual(result.value, false);
    });

    this.client.start(done);
  });
});


text:
using Aspose.Cells.GridWeb.Data;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Aspose.Cells.GridWeb.Examples.CSharp.Worksheets
{
    public partial class CopyWorksheets : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            // If first visit to the page init GridWeb data
            if (!IsPostBack && !GridWeb1.IsPostBack)
            {
                InitData();

                // Set sheets selectedIndex to 0
                GridWeb1.WorkSheets.ActiveSheetIndex = 0;
            }
        }

        private void InitData()
        {
            GridWeb1.WorkSheets.Clear();
            GridWorksheet sheet = GridWeb1.WorkSheets.Add("Students");
            GridCells cells = sheet.Cells;
            cells[0, 0].PutValue("Name");
            GridTableItemStyle cellstyle = cells[0, 0].Style;
            cellstyle.Font.Size = new FontUnit("10pt");
            cellstyle.Font.Bold = true;
            cellstyle.ForeColor = Color.Black;
            cellstyle.HorizontalAlign = HorizontalAlign.Center;
            cellstyle.BorderWidth = 1;
            cells[0, 0].Style = cellstyle;

            cells[0, 1].PutValue("Gender");

            cells[0, 1].Style = cellstyle;

            cells[0, 2].PutValue("Age");

            cells[0, 2].Style = cellstyle;

            cells[0, 3].PutValue("Class");

            cells[0, 3].Style = cellstyle;

            cells[1, 0].PutValue("Jack");
            cells[1, 1].PutValue("M");
            cells[1, 2].PutValue(19);
            cells[1, 3].PutValue("One");

            cells[2, 0].PutValue("Tome");
            cells[2, 1].PutValue("M");
            cells[2, 2].PutValue(20);
            cells[2, 3].PutValue("Four");

            cells[3, 0].PutValue("Jeney");
            cells[3, 1].PutValue("W");
            cells[3, 2].PutValue(18);
            cells[3, 3].PutValue("Two");

            cells[4, 0].PutValue("Marry");
            cells[4, 1].PutValue("W");
            cells[4, 2].PutValue(17);
            cells[4, 3].PutValue("There");

            cells[5, 0].PutValue("Amy");
            cells[5, 1].PutValue("W");
            cells[5, 2].PutValue(16);
            cells[5, 3].PutValue("Four");

            cells[6, 0].PutValue("Ben");
            cells[6, 1].PutValue("M");
            cells[6, 2].PutValue(17);
            cells[6, 3].PutValue("Four");

            cells.SetColumnWidth(0, 10);
            cells.SetColumnWidth(1, 10);
            cells.SetColumnWidth(2, 10);
            cells.SetColumnWidth(3, 10);
        }

        protected void btnCopyWorksheet_Click(object sender, EventArgs e)
        {
            // ExStart:CopyWorksheetUsingIndex
            // Adding the copy of a worksheet to GridWeb by specifying its sheet index
            int sheetIndex = GridWeb1.WorkSheets.AddCopy(0);
            // ExEnd:CopyWorksheetUsingIndex

            // ExStart:CopyWorksheetUsingName
            // Adding the copy of a worksheet to GridWeb by specifying its sheet name
            int sheetIndex1 = GridWeb1.WorkSheets.AddCopy("Students");
            // ExEnd:CopyWorksheetUsingName
        }
    }
}


text:
#ifndef HK_DYNAMICS2_BOX_MOTION_H
#define HK_DYNAMICS2_BOX_MOTION_H

#include <Physics2012/Dynamics/Motion/hkpMotion.h>

extern const hkClass hkpBoxMotionClass;

/// This class is contained by the hkpRigidBody class.
/// It should not be accessed directly by the user.
class hkpBoxMotion : public hkpMotion
{
	public:
	HK_DECLARE_CLASS_ALLOCATOR(HK_MEMORY_CLASS_BASE);
		HK_DECLARE_REFLECTION();

			/// Default constructor - sets the initial velocity to zero
		hkpBoxMotion(const hkVector4& position, const hkQuaternion& rotation);

			/// Gets the inertia tensor of the rigid body in local space.
		virtual void getInertiaLocal(hkMatrix3& inertia) const;

			/// Get the inertia tensor of the rigid body in world space
		virtual void getInertiaWorld(hkMatrix3& inertiaOut) const;

			/// Sets the inertia tensor of the rigid body in local space. Advanced use only.
		virtual void setInertiaLocal(const hkMatrix3& inertia);

			/// Set the mass of the rigid body. (Note: it is better to use setMassInv if possible)
		virtual void setMass(hkReal m);
		virtual void setMass(hkSimdRealParameter m);

			/// Sets the inertia tensor of the rigid body by supplying its inverse. Advanced use only.
		virtual void setInertiaInvLocal(const hkMatrix3& inertiaInv);

			/// Gets the inverse inertia tensor in local space.
		virtual void getInertiaInvLocal(hkMatrix3& inertiaInv) const;

			/// Get the inverse inertia tensor in local space
		virtual void getInertiaInvWorld(hkMatrix3& inertiaInvOut) const;

		/// Applies an impulse (in world space) at the point p in world space.
		virtual void applyPointImpulse(const hkVector4& imp, const hkVector4& p);

			/// Applies an instantaneous change in angular velocity (in world space) around the center of mass.
		virtual void applyAngularImpulse(const hkVector4& imp);

			/// Applies a force (in world space) to the rigid body. The force is applied to the center of mass.
		virtual void applyForce(const hkReal deltaTime, const hkVector4& force);

			/// Applies a force (in world space) to the rigid body at the point p in world space.
		virtual void applyForce(const hkReal deltaTime, const hkVector4& force, const hkVector4& p);

			/// Applies the specified torque (in world space) to the rigid body. (note: the inline is for internal use only)
		virtual void applyTorque(const hkReal deltaTime, const hkVector4& torque);

			// Implements hkpMotion.
		virtual void getProjectedPointVelocity(const hkVector4& p, const hkVector4& normal, hkReal& velOut, hkReal& invVirtMassOut) const;

			/// Velocity and inverse virtual mass of point p along the supplied normal.
		virtual void getProjectedPointVelocitySimd(const hkVector4& p, const hkVector4& normal, hkSimdReal& velOut, hkSimdReal& invVirtMassOut) const;

	public:

		hkpBoxMotion( class hkFinishLoadedObjectFlag flag ) : hkpMotion( flag ) {}
};

#endif // HK_DYNAMICS2_BOX_MOTION_H

/*
 * Havok SDK - NO SOURCE PC DOWNLOAD, BUILD(#20140907)
 *
 * Confidential Information of Havok.  (C) Copyright 1999-2014
 * Telekinesys Research Limited t/a Havok. All Rights Reserved. The Havok
 * Logo, and the Havok buzzsaw logo are trademarks of Havok.  Title, ownership
 * rights, and intellectual property rights in the Havok software remain in
 * Havok and/or its suppliers.
 *
 * Use of this software for evaluation purposes is subject to and indicates
 * acceptance of the End User licence Agreement for this product. A copy of
 * the license is included with this software and is also available at www.havok.com/tryhavok.
 *
 */


text:
package org.apache.wiki.auth.user;

import org.apache.wiki.api.core.Engine;
import org.apache.wiki.auth.NoSuchPrincipalException;

import java.security.Principal;
import java.util.Properties;

/**
 * This is a database that gets used if nothing else is available. It does nothing of note - it just mostly throws
 * NoSuchPrincipalExceptions if someone tries to log in.
 */
public class DummyUserDatabase extends AbstractUserDatabase {

    /**
     * No-op.
     * @param loginName the login name to delete
     */
    @Override
    public void deleteByLoginName( final String loginName ) {
        // No operation
    }

    /**
     * No-op; always throws NoSuchPrincipalException.
     * @param index the name to search for
     * @return the user profile
     * @throws NoSuchPrincipalException always...
     */
    @Override
    public UserProfile findByEmail(final String index) throws NoSuchPrincipalException {
        throw new NoSuchPrincipalException("No user profiles available");
    }

    /**
     * No-op; always throws NoSuchPrincipalException.
     * @param index the name to search for
     * @return the user profile
     * @throws NoSuchPrincipalException always...
     */
    @Override
    public UserProfile findByFullName(final String index) throws NoSuchPrincipalException {
        throw new NoSuchPrincipalException("No user profiles available");
    }

    /**
     * No-op; always throws NoSuchPrincipalException.
     * @param index the name to search for
     * @return the user profile
     * @throws NoSuchPrincipalException always...
     */
    @Override
    public UserProfile findByLoginName(final String index) throws NoSuchPrincipalException {
        throw new NoSuchPrincipalException("No user profiles available");
    }

    /**
     * No-op; always throws NoSuchPrincipalException.
     * @param uid the unique identifier to search for
     * @return the user profile
     * @throws NoSuchPrincipalException always...
     */
    @Override
    public UserProfile findByUid( final String uid ) throws NoSuchPrincipalException {
        throw new NoSuchPrincipalException("No user profiles available");
    }
    /**
     * No-op; always throws NoSuchPrincipalException.
     * @param index the name to search for
     * @return the user profile
     * @throws NoSuchPrincipalException always...
     */
    @Override
    public UserProfile findByWikiName(final String index) throws NoSuchPrincipalException {
        throw new NoSuchPrincipalException("No user profiles available");
    }

    /**
     * No-op.
     * @return a zero-length array
     */
    @Override
    public Principal[] getWikiNames() {
        return new Principal[0];
    }

    /**
     * No-op.
     *
     * @param engine the wiki engine
     * @param props the properties used to initialize the wiki engine
     */
    @Override
    public void initialize( final Engine engine, final Properties props ) {
    }

    /**
     * No-op; always throws NoSuchPrincipalException.
     * @param loginName the login name
     * @param newName the proposed new login name
     * @throws NoSuchPrincipalException always...
     */
    @Override
    public void rename( final String loginName, final String newName ) throws NoSuchPrincipalException {
        throw new NoSuchPrincipalException("No user profiles available");
    }

    /**
     * No-op.
     * @param profile the user profile
     */
    @Override
    public void save( final UserProfile profile ) {
    }

}


text:
// See docs in ../ops/sparse_ops.cc.

#define EIGEN_USE_THREADS

#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor"
#include "tensorflow/core/framework/op_kernel.h"
#include "tensorflow/core/framework/register_types.h"
#include "tensorflow/core/framework/tensor.h"
#include "tensorflow/core/framework/tensor_util.h"
#include "tensorflow/core/framework/types.h"
#include "tensorflow/core/util/sparse/sparse_tensor.h"

using tensorflow::gtl::ArraySlice;
using tensorflow::sparse::SparseTensor;

namespace tensorflow {

using CPUDevice = Eigen::ThreadPoolDevice;

template <typename Device, typename T>
class SparseSoftmaxOp : public OpKernel {
 public:
  explicit SparseSoftmaxOp(OpKernelConstruction *context) : OpKernel(context) {}

  void Compute(OpKernelContext *context) override {
    const Tensor *indices_t, *values_t, *shape_t;
    OP_REQUIRES_OK(context, context->input("sp_indices", &indices_t));
    OP_REQUIRES_OK(context, context->input("sp_values", &values_t));
    OP_REQUIRES_OK(context, context->input("sp_shape", &shape_t));

    // Validations.
    OP_REQUIRES(context, TensorShapeUtils::IsMatrix(indices_t->shape()),
                errors::InvalidArgument(
                    "Input sp_indices should be a matrix but received shape: ",
                    indices_t->shape().DebugString()));
    OP_REQUIRES(context, TensorShapeUtils::IsVector(values_t->shape()) &&
                             TensorShapeUtils::IsVector(shape_t->shape()),
                errors::InvalidArgument(
                    "Inputs sp_values and sp_shape should be vectors "
                    "but received shapes: ",
                    values_t->shape().DebugString(), " and ",
                    shape_t->shape().DebugString()));
    OP_REQUIRES(context, shape_t->NumElements() >= 2,
                errors::InvalidArgument(
                    "Input should have rank >= 2, but received shape: ",
                    shape_t->SummarizeValue(3)));
    OP_REQUIRES(context,
                indices_t->dim_size(0) < std::numeric_limits<int>::max(),
                errors::InvalidArgument(
                    "Number of non-zero elements exceeds int32 range"));

    const int nnz = static_cast<int>(indices_t->dim_size(0));
    const int rank = static_cast<int>(indices_t->dim_size(1));
    SparseTensor st(tensor::DeepCopy(*indices_t), tensor::DeepCopy(*values_t),
                    TensorShape(shape_t->flat<int64>()));

    Tensor *output_values = nullptr;
    OP_REQUIRES_OK(context, context->allocate_output(0, TensorShape({nnz}),
                                                     &output_values));
    typename TTypes<T>::Flat output_flat = output_values->flat<T>();

    Tensor tmp_t;
    OP_REQUIRES_OK(context, context->allocate_temp(DataTypeToEnum<T>::value,
                                                   TensorShape({}), &tmp_t));
    typename TTypes<T>::Scalar tmp_scalar = tmp_t.scalar<T>();

    gtl::InlinedVector<int64, 4> dims(rank);
    std::iota(dims.begin(), dims.end(), 0);
    // { 0, ..., rank-1 }.
    const ArraySlice<int64> kReorderDims(dims);
    // All but the last dim -- the class dimension to be max-reduced along.
    const ArraySlice<int64> kGroupByDims(kReorderDims, 0, rank - 1);
    st.Reorder<T>(kReorderDims);
    int count = 0;

    // The SparseTensor has logical shape [..., b, c], where the
    // innermost size-"c" dimension is the class dimension to be max-reduced.
    // Therefore we group by the first (rank - 1) dimensions.
    const Device &device = context->eigen_device<Device>();
    for (const auto &g : st.group(kGroupByDims)) {
      const auto group_vals = g.values<T>();
      const int group_size = group_vals.size();

      // Shifts by max, exponentiates, then renormalizes.
      tmp_scalar.device(context->eigen_device<Device>()) = group_vals.maximum();
      const T group_max = tmp_scalar();

      Eigen::Tensor<T, 1, Eigen::RowMajor> tmp(group_size);
      tmp.device(device) = (group_vals - tmp.constant(group_max)).exp();

      tmp_scalar.device(device) = tmp.sum().inverse();
      tmp.device(device) = tmp * tmp.constant(tmp_scalar());

      // Assigns back to output[count, count + group_size).
      Eigen::TensorMap<Eigen::Tensor<T, 1, Eigen::RowMajor>> output_part(
          output_flat.data() + count, group_size);
      output_part.device(device) = tmp;

      count += group_size;
    }
  }
};

#define REGISTER_KERNEL(T)                                             \
  REGISTER_KERNEL_BUILDER(                                             \
      Name("SparseSoftmax").Device(DEVICE_CPU).TypeConstraint<T>("T"), \
      SparseSoftmaxOp<CPUDevice, T>)

REGISTER_KERNEL(float);
REGISTER_KERNEL(double);
#undef REGISTER_KERNEL

}  // namespace tensorflow


text:
package org.apache.bookkeeper.metastore;

import org.apache.bookkeeper.common.util.ReflectionUtils;

/**
 *  Metastore Factory.
 */
public class MetastoreFactory {

    public static MetaStore createMetaStore(String name)
    throws MetastoreException {
        try {
            return ReflectionUtils.newInstance(name, MetaStore.class);
        } catch (Throwable t) {
            throw new MetastoreException("Failed to instantiate metastore : " + name);
        }
    }

}


text:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Linq;

#if WINDOWS_APP || WINDOWS_PHONE_APP
using PropertyChangingEventHandler = Xamarin.Forms.PropertyChangingEventHandler;
using PropertyChangingEventArgs = Xamarin.Forms.PropertyChangingEventArgs;
#endif

namespace Ao3TrackReader
{
    public interface IGroupable
    {
        string Group { get; }
        string GroupType { get; }
        bool ShouldHide { get; }
    }

    public class GroupSubList<T> : ObservableCollection<T>, INotifyPropertyChanged, INotifyPropertyChanging
        where T : IGroupable
    {
        public GroupSubList(string group)
        {
            Group = group;
        }

        public string Group { get; protected set; }
        string grouptype;
        public string GroupType
        {
            get { return grouptype; }
            set
            {
                if (grouptype == value) return;
                OnPropertyChanging(new PropertyChangingEventArgs("GroupType"));
                OnPropertyChanging(new PropertyChangingEventArgs("HasGroupType"));
                grouptype = value;
                OnPropertyChanged(new PropertyChangedEventArgs("HasGroupType"));
                OnPropertyChanged(new PropertyChangedEventArgs("GroupType"));
            }
        }
        public bool HasGroupType => !String.IsNullOrWhiteSpace(GroupType);

        public event PropertyChangingEventHandler PropertyChanging;
        void OnPropertyChanging(PropertyChangingEventArgs args)
        {
            PropertyChanging?.Invoke(this, args);
        }

        public void AddSorted(T item)
        {
            if (!WebViewPage.Current.IsMainThread)
                throw new InvalidOperationException();

            var comparable = item as IComparable<T>;
            if (comparable == null)
            {
                Add(item);
                return;
            }

            int i = 0;
            for (; i < Count; i++)
            {
                if (Object.ReferenceEquals(item, this[i]))
                {
                    throw new ArgumentException("Attempting to add item already in group", "iten");
                }
                else if (comparable.CompareTo(this[i]) < 0)
                {
                    break;
                }
            }

            InsertItem(i, item);
        }

        public void ResortItem(T item)
        {
            if (!WebViewPage.Current.IsMainThread)
                throw new InvalidOperationException();

            var comparable = item as IComparable<T>;
            if (comparable == null)
            {
                return;
            }

            int oldindex = -1;
            int newindex = -1;
            for (int i = 0; i < Count && (newindex == -1 || oldindex == -1); i++)
            {
                if (oldindex == -1 && Object.ReferenceEquals(item, this[i]))
                {
                    oldindex = i;
                }
                else if (newindex == -1 && comparable.CompareTo(this[i]) < 0)
                {
                    newindex = i;
                }
            }
            if (oldindex == -1)
            {
                InsertItem(newindex, item);
                return;
            }
            if (newindex == -1)
            {
                newindex = Count;
            }

            if (newindex > oldindex) newindex--;
            if (newindex == oldindex) return;
            MoveItem(oldindex, newindex);
        }

        protected override void InsertItem(int index, T item)
        {
            if (!WebViewPage.Current.IsMainThread)
                throw new InvalidOperationException();

            base.InsertItem(index, item);
        }

        protected override void RemoveItem(int index)
        {
            if (!WebViewPage.Current.IsMainThread)
                throw new InvalidOperationException();

            base.RemoveItem(index);
        }
    }

    public class GroupList<T> : ObservableCollection<GroupSubList<T>>
        where T : IGroupable, INotifyPropertyChanged
    {
        GroupSubList<T> hidden = new GroupSubList<T>("<Hidden>");
        Dictionary<T, GroupSubList<T>> allItems = new Dictionary<T, GroupSubList<T>>();

        private object locker = new object();

        public void Add(T item)
        {
            if (!WebViewPage.Current.IsMainThread)
                throw new InvalidOperationException();

            lock (locker)
            {
                // Add the item to the correct list
                item.PropertyChanged += Item_PropertyChanged;

                AddToGroup(item);
            }
        }

        public void Remove(T item)
        {
            if (!WebViewPage.Current.IsMainThread)
                throw new InvalidOperationException();

            lock (locker)
            {
                item.PropertyChanged -= Item_PropertyChanged;

                RemoveFromGroup(item);
            }
        }

        public T Find(Predicate<T> pred)
        {
            lock (locker)
            {
                foreach (var g in this)
                {
                    foreach (var e in g)
                    {
                        if (pred(e))
                            return e;
                    }
                }
                return default(T);
            }
        }
        public T FindInAll(Predicate<T> pred)
        {
            lock (locker)
            {
                foreach (var e in allItems.Keys)
                {
                    if (pred(e))
                        return e;
                }
                return default(T);
            }
        }
        public void ForEach(Action<T> action)
        {
            lock (locker)
            {
                foreach (var g in this)
                {
                    foreach (var e in g)
                    {
                        action(e);
                    }
                }
            }
        }
        public void ForEachInAll(Action<T> action)
        {
            lock (locker)
            {
                foreach (var e in allItems.Keys)
                {
                    action(e);
                }
            }
        }
        public void ForEachInAll(Func<T, bool> func)
        {
            lock (locker)
            {
                foreach (var e in allItems.Keys)
                {
                    if (func(e) == true)
                        break;
                }
            }
        }

        bool show_hidden = false;
        private bool doSorting;

        public GroupList()
        {
            this.doSorting = true;
        }

        public GroupList(bool doSorting)
        {
            this.doSorting = doSorting;
        }

        private bool IsHidden(T item)
        {
            return (!show_hidden && item.ShouldHide);
        }

        private void ResortHidden()
        {
            List<T> toHide = new List<T>();
            foreach (var g in this.ToArray())
            {
                foreach (var e in g.ToArray())
                {
                    if (IsHidden(e))
                    {
                        g.Remove(e);
                        toHide.Add(e);
                    }
                }
                if (g.Count == 0) Remove(g);
            }
            foreach (var e in hidden.ToArray())
            {
                if (!IsHidden(e))
                {
                    hidden.Remove(e);
                    AddToGroup(e);
                }
            }
            foreach (var e in toHide)
            {
                allItems[e] = hidden;
                hidden.Add(e);
            }
        }

        public bool ShowHidden
        {
            get { return show_hidden; }
            set
            {
                if (!WebViewPage.Current.IsMainThread)
                    throw new InvalidOperationException();

                lock (locker)
                {
                    if (show_hidden != value)
                    {
                        show_hidden = value;
                        ResortHidden();
                    }
                }
            }
        }

        int GroupCompare(string left, string right)
        {
            bool lb = left.StartsWith("<");
            bool rb = right.StartsWith("<");
            if (lb != rb)
            {
                return lb.CompareTo(rb);
            }
            return String.Compare(left, right);
        }

        private GroupSubList<T> GetGroupForItem(T item)
        {
            string groupName = item.Group;
            if (string.IsNullOrWhiteSpace(groupName)) groupName = "<Other>";
            GroupSubList<T> g = null;

            int i = 0;

            if (IsHidden(item))
            {
                g = hidden;
            }
            else for (; i < Count; i++)
                {
                    int c = GroupCompare(this[i].Group, groupName);
                    if (c == 0)
                    {
                        g = this[i];
                        break;
                    }
                    else if (doSorting && c > 0)
                    {
                        break;
                    }
                }

            if (g == null)
            {
                g = new GroupSubList<T>(groupName);
                if (!string.IsNullOrWhiteSpace(item.GroupType)) g.GroupType = item.GroupType;
                Insert(i, g);
            }
            else
            {
                if (!string.IsNullOrWhiteSpace(item.GroupType)) g.GroupType = item.GroupType;
            }
            return g;
        }

        private void AddToGroup(T item)
        {
            lock (locker)
            {
                var g = GetGroupForItem(item);

                if (allItems.TryGetValue(item, out var oldgroup))
                {
                    if (oldgroup == g) return;
                    RemoveFromGroup(item);
                }

                if (doSorting) g.AddSorted(item);
                else g.Add(item);

                allItems[item] = g;
            }
        }

        private bool RemoveFromGroup(T item)
        {
            lock (locker)
            {
                if (!allItems.TryGetValue(item, out var g))
                    return false;

                allItems.Remove(item);

                bool res = g.Remove(item);
                if (g.Count == 0) Remove(g);
                return res;
            }
        }

        private void Item_PropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            lock (locker)
            {
                var item = (T)sender;
                if (String.IsNullOrEmpty(e.PropertyName) || e.PropertyName == "Group" || e.PropertyName == "SortOrder" || e.PropertyName == "ShouldHide")
                {
                    if (allItems.TryGetValue(item, out var oldgroup))
                    {
                        var g = GetGroupForItem(item);
                        if (oldgroup != g)
                        {
                            AddToGroup(item);
                        }
                        else
                        {
                            if (doSorting) g.ResortItem(item);
                        }
                    }
                }
                if (String.IsNullOrEmpty(e.PropertyName) || e.PropertyName == "GroupType")
                {
                    if (!IsHidden(item) && !string.IsNullOrWhiteSpace(item.GroupType))
                    {
                        string groupName = item.Group;
                        if (string.IsNullOrWhiteSpace(groupName)) groupName = "<Other>";
                        var g = this.Where((l) => l.Group == groupName).FirstOrDefault();
                        if (g != null) g.GroupType = item.GroupType;
                    }
                }
            }
        }

        IEnumerable<GroupSubList<T>> AllGroups
        {
            get
            {
                return this.Concat(new[] { hidden });
            }
        }

        IEnumerable<T> All
        {
            get
            {
                return allItems.Keys;
            }
        }
        public IEnumerable<T> AllSafe
        {
            get
            {
                lock (locker)
                {
                    return allItems.Keys.ToList();
                }
            }
        }
    }
}


text:
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.42000
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace Resources.Statistics.Views {
    using System;

    /// <summary>
    ///   A strongly-typed resource class, for looking up localized strings, etc.
    /// </summary>
    // This class was auto-generated by the StronglyTypedResourceBuilder
    // class via a tool like ResGen or Visual Studio.
    // To add or remove a member, edit your .ResX file then rerun ResGen
    // with the /str option, or rebuild your VS project.
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    public class StatisticsIndex {

        private static global::System.Resources.ResourceManager resourceMan;

        private static global::System.Globalization.CultureInfo resourceCulture;

        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
        internal StatisticsIndex() {
        }

        /// <summary>
        ///   Returns the cached ResourceManager instance used by this class.
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        public static global::System.Resources.ResourceManager ResourceManager {
            get {
                if (object.ReferenceEquals(resourceMan, null)) {
                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OJS.Web.App_GlobalResources.Statistics.Views.StatisticsIndex", typeof(StatisticsIndex).Assembly);
                    resourceMan = temp;
                }
                return resourceMan;
            }
        }

        /// <summary>
        ///   Overrides the current thread's CurrentUICulture property for all
        ///   resource lookups using this strongly typed resource class.
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        public static global::System.Globalization.CultureInfo Culture {
            get {
                return resourceCulture;
            }
            set {
                resourceCulture = value;
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Submissions per month \n (last 12 months).
        /// </summary>
        public static string Submissions_count_per_month_title {
            get {
                return ResourceManager.GetString("Submissions_count_per_month_title", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Total submissions.
        /// </summary>
        public static string Total_submissions {
            get {
                return ResourceManager.GetString("Total_submissions", resourceCulture);
            }
        }
    }
}