text:
<!doctype html>

    <title>Code coverage report for lib/cmd.js</title>
    <meta charset="utf-8" />
    <link rel="stylesheet" href="../prettify.css" />
    <link rel="stylesheet" href="../base.css" />
    <meta name="viewport" content="width=device-width, initial-scale=1">

      all files / lib/ cmd.js

        4.26%
        Statements
        4/94

        0%
        Branches
        0/49

        0%
        Functions
        0/12

        4.26%
        Lines
        4/94

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210

1×

1×

1×

1×

'use strict'

// -- Requires -------------------------------------------------------------------------------------

require('babel-polyfill')

var async = require('async'),
    base = require('./base'),
    configs = require('./configs'),
    fs = require('fs'),
    git = require('./git'),
    logger = require('./logger'),
    nopt = require('nopt'),
    path = require('path'),
    User = require('./cmds/user').Impl,
    config = configs.getConfig()

// -- Utils ----------------------------------------------------------------------------------------

function hasCommandInOptions(commands, options) {
    if (commands) {
        return commands.some(function(c) {
            return options[c] !== undefined
        })
    }

    return false
}

function invokePayload(options, command, cooked, remain) {
    var payload

    if (command.DETAILS.payload && !hasCommandInOptions(command.DETAILS.commands, options)) {
        payload = remain.concat()
        payload.shift()
        command.DETAILS.payload(payload, options)
    }
}

function findCommand(name) {
    var Command, commandDir, commandFiles, commandPath

    commandDir = path.join(__dirname, 'cmds')
    commandPath = path.join(commandDir, name + '.js')

    if (fs.existsSync(commandPath)) {
        Command = require(commandPath).Impl
    } else {
        commandFiles = base.find(commandDir, /\.js$/i)
        commandFiles.every(function(file) {
            commandPath = path.join(commandDir, file)
            Command = require(commandPath).Impl

            if (Command.DETAILS.alias === name) {
                return false
            }

            Command = null
            return true
        })
    }

    return Command
}

function loadCommand(name) {
    var Command = findCommand(name),
        plugin

    // If command was not found, check if it is registered as a plugin.
    if (!Command) {
        try {
            plugin = configs.getPlugin(name)
        } catch (e) {
            return null
        }

        Command = plugin.Impl

        // If plugin command exists, register the executed plugin name on
        // process.env. This may simplify core plugin infrastructure.
        process.env.NODEGH_PLUGIN = name
    }

    return Command
}

exports.setUp = function() {
    var Command,
        iterative,
        operations = [],
        options,
        parsed = nopt(process.argv),
        remain = parsed.argv.remain,
        cooked = parsed.argv.cooked

    operations.push(function(callback) {
        base.checkVersion()

        callback()
    })

    operations.push(function(callback) {
        var module = remain[0]

        if (cooked[0] === '--version' || cooked[0] === '-v') {
            module = 'version'
        } else if (!remain.length || cooked.indexOf('-h') >= 0 || cooked.indexOf('--help') >= 0) {
            module = 'help'
        }

        Command = loadCommand(module)

        if (!Command) {
            logger.error('Command not found')
            return
        }

        options = nopt(Command.DETAILS.options, Command.DETAILS.shorthands, process.argv, 2)

        iterative = Command.DETAILS.iterative

        cooked = options.argv.cooked
        remain = options.argv.remain

        options.number = options.number || [remain[1]]
        options.remote = options.remote || config.default_remote

        if (module === 'help') {
            callback()
        } else {
            User.login(callback)
        }
    })

    async.series(operations, function() {
        var iterativeValues,
            remoteUrl = git.getRemoteUrl(options.remote)

        options.isTTY = {}
        options.isTTY.in = Boolean(process.stdin.isTTY)
        options.isTTY.out = Boolean(process.stdout.isTTY)
        options.loggedUser = base.getUser()
        options.remoteUser = git.getUserFromRemoteUrl(remoteUrl)

        if (!options.user) {
            if (options.repo || options.all) {
                options.user = options.loggedUser
            } else {
                options.user = options.remoteUser || options.loggedUser
            }
        }

        options.repo = options.repo || git.getRepoFromRemoteURL(remoteUrl)
        options.currentBranch = options.currentBranch || git.getCurrentBranch()

        base.expandAliases(options)
        options.github_host = config.github_host
        options.github_gist_host = config.github_gist_host

        // Try to retrieve iterative values from iterative option key,
        // e.g. option['number'] === [1,2,3]. If iterative option key is not
        // present, assume [undefined] in order to initialize the loop.
        iterativeValues = options[iterative] || [undefined]

        iterativeValues.forEach(function(value) {
            options = base.clone(options)

            // Value can be undefined when the command doesn't have a iterative
            // option.
            options[iterative] = value

            invokePayload(options, Command, cooked, remain)

            new Command(options).run()
        })
    })
}

exports.run = function() {
    if (!fs.existsSync(configs.getUserHomePath())) {
        configs.createGlobalConfig()
    }

    base.load()
    configs.getConfig()

    // If configs.PLUGINS_PATH_KEY is undefined, try to cache it before proceeding.
    if (configs.getConfig()[configs.PLUGINS_PATH_KEY] === undefined) {
        configs.getNodeModulesGlobalPath()
    }

    try {
        process.env.GH_PATH = path.join(__dirname, '../')

        this.setUp()
    } catch (e) {
        console.error(e.stack || e)
    }
}

  Code coverage
  generated by istanbul at Thu Jul 26 2018 22:02:49 GMT+0000 (UTC)


text:
package com.ernestkamara.deezersample.activities;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;
import android.widget.ProgressBar;

import com.bumptech.glide.Glide;
import com.deezer.sdk.model.Album;
import com.deezer.sdk.model.Artist;
import com.ernestkamara.deezersample.R;
import com.ernestkamara.deezersample.adapters.ArtistAlbumRecyclerAdapter;
import com.ernestkamara.deezersample.model.ArtistAlbumsDataSource;

import butterknife.Bind;

/**
 * @author Ernest Saidu Kamara
 * @since 07/04/16.
 */
public class ArtistAlbumsActivity extends BaseActivity {
    public static final String EXTRA_ARTIST = "artist";

    @Bind(R.id.albums_recyclerview) RecyclerView mAlbumsRecyclerView;
    @Bind(R.id.progressBar) ProgressBar mProgressBar;
    @Bind(R.id.artist_cover_backdrop)
    ImageView mArtistBackdrop;

    private Artist mArtist;
    private ArtistAlbumsDataSource mArtistAlbumsDataSource;
    private ArtistAlbumRecyclerAdapter mArtistAlbumRecyclerAdapter;

    @Override
    protected int getLayoutId() {
        return R.layout.activity_artist_albums;
    }

    @Override
    protected boolean showHomeAsUp() {
        return true;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        if (savedInstanceState != null) {
            mArtist = savedInstanceState.getParcelable(EXTRA_ARTIST);

        }else {
            Intent intent = getIntent();
            mArtist = intent.getParcelableExtra(EXTRA_ARTIST);
        }

        setTitle(mArtist.getName());
        Glide.with(this).load(mArtist.getBigImageUrl()).centerCrop().into(mArtistBackdrop);

        mArtistAlbumsDataSource = getDataSourceFactory().newArtistAlbumsDataSource(mArtist);
        mArtistAlbumsDataSource.fetchData();

        mArtistAlbumRecyclerAdapter = new ArtistAlbumRecyclerAdapter(this, mArtistAlbumsDataSource, this);

        mAlbumsRecyclerView.setLayoutManager(new GridLayoutManager(this.getBaseContext(), 2));
        mAlbumsRecyclerView.setAdapter(mArtistAlbumRecyclerAdapter);
    }

    @Override
    public void onItemClick(Object object) {
        Intent intent = new Intent(this, AlbumTracksActivity.class);
        intent.putExtra(AlbumTracksActivity.EXTRA_ALBUM, (Album)object);
        startActivity(intent);
    }

    @Override
    public void onItemsLoadingComplete() {
        mProgressBar.setVisibility(View.GONE);
        mAlbumsRecyclerView.setVisibility(View.VISIBLE);
    }

    @Override
    public void onItemsLoadingFailed(String error) {

    }

    @Override
    public void onSaveInstanceState(Bundle savedInstanceState) {
        savedInstanceState.putParcelable(EXTRA_ARTIST, mArtist);
        super.onSaveInstanceState(savedInstanceState);
    }
}

redpajama_set_name: RedPajamaGithub


text:
/**
 * @module ember-paper
 */
import $ from 'jquery';

import PaperMenu from './paper-menu';
import layout from '../templates/components/paper-select-menu';

const SELECT_EDGE_MARGIN = 8;

function getOffsetRect(node) {
  return node ? {
    left: node.offsetLeft,
    top: node.offsetTop,
    width: node.offsetWidth,
    height: node.offsetHeight
  } : { left: 0, top: 0, width: 0, height: 0 };
}

function clamp(min, n, max) {
  return Math.max(min, Math.min(n, max));
}

/**
 * @class PaperSelectMenu
 * @extends Ember.Component
 */
export default PaperMenu.extend({
  layout,

  triggerComponent: 'paper-select-menu-trigger',

  calculatePosition(trigger, content, destination, { dropdown }) {
    let $dropdown = $(content);
    let opts = {
      target: $(trigger),
      parent: $('body'),
      selectEl: $dropdown.find('md-select-menu'),
      contentEl: $dropdown.find('md-content')
    };

    let containerNode = $dropdown.get(0);
    let targetNode = opts.target[0].firstElementChild; // target the label
    let parentNode = opts.parent.get(0);
    let selectNode = opts.selectEl.get(0);
    let contentNode = opts.contentEl.get(0);
    let parentRect = parentNode.getBoundingClientRect();
    let targetRect = targetNode.getBoundingClientRect();
    let shouldOpenAroundTarget = false;
    let bounds = {
      left: parentRect.left + SELECT_EDGE_MARGIN,
      top: SELECT_EDGE_MARGIN,
      bottom: parentRect.height - SELECT_EDGE_MARGIN,
      right: parentRect.width - SELECT_EDGE_MARGIN - (dropdown.get('floatingScrollbars') ? 16 : 0)
    };
    let spaceAvailable = {
      top: targetRect.top - bounds.top,
      left: targetRect.left - bounds.left,
      right: bounds.right - (targetRect.left + targetRect.width),
      bottom: bounds.bottom - (targetRect.top + targetRect.height)
    };
    let maxWidth = parentRect.width - SELECT_EDGE_MARGIN * 2;
    let selectedNode = selectNode.querySelector('md-option[selected]');
    let optionNodes = selectNode.getElementsByTagName('md-option');
    let optgroupNodes = selectNode.getElementsByTagName('md-optgroup');

    let centeredNode, left, top, transformOrigin;

    // If a selected node, center around that
    if (selectedNode) {
      centeredNode = selectedNode;
      // If there are option groups, center around the first option group
    } else if (optgroupNodes.length) {
      centeredNode = optgroupNodes[0];
      // Otherwise, center around the first optionNode
    } else if (optionNodes.length) {
      centeredNode = optionNodes[0];
      // In case there are no options, center on whatever's in there... (eg progress indicator)
    } else {
      centeredNode = contentNode.firstElementChild || contentNode;
    }

    if (contentNode.offsetWidth > maxWidth) {
      contentNode.style['max-width'] = `${maxWidth}px`;
    }
    if (shouldOpenAroundTarget) {
      contentNode.style['min-width'] = `${targetRect.width}px`;
    }

    // Remove padding before we compute the position of the menu

    let focusedNode = centeredNode;
    if ((focusedNode.tagName || '').toUpperCase() === 'MD-OPTGROUP') {
      focusedNode = optionNodes[0] || contentNode.firstElementChild || contentNode;
      centeredNode = focusedNode;
    }

    // Get the selectMenuRect *after* max-width is possibly set above
    containerNode.style.display = 'block';
    let selectMenuRect = selectNode.getBoundingClientRect();
    let centeredRect = getOffsetRect(centeredNode);

    if (centeredNode) {
      let centeredStyle = window.getComputedStyle(centeredNode);
      centeredRect.paddingLeft = parseInt(centeredStyle.paddingLeft, 10) || 0;
      centeredRect.paddingRight = parseInt(centeredStyle.paddingRight, 10) || 0;
    }

    // Get scrollHeight/offsetHeight *after* container is set with display:block
    let isScrollable = contentNode.scrollHeight > contentNode.offsetHeight;
    if (isScrollable) {
      let scrollBuffer = contentNode.offsetHeight / 2;
      contentNode.scrollTop = centeredRect.top + centeredRect.height / 2 - scrollBuffer;

      if (spaceAvailable.top < scrollBuffer) {
        contentNode.scrollTop = Math.min(
          centeredRect.top,
          contentNode.scrollTop + scrollBuffer - spaceAvailable.top
        );
      } else if (spaceAvailable.bottom < scrollBuffer) {
        contentNode.scrollTop = Math.max(
          centeredRect.top + centeredRect.height - selectMenuRect.height,
          contentNode.scrollTop - scrollBuffer + spaceAvailable.bottom
        );
      }
    }

    if (shouldOpenAroundTarget) {
      left = targetRect.left;
      top = targetRect.top + targetRect.height;
      transformOrigin = '50% 0';
      if (top + selectMenuRect.height > bounds.bottom) {
        top = targetRect.top - selectMenuRect.height;
        transformOrigin = '50% 100%';
      }
    } else {
      left = (targetRect.left + centeredRect.left - centeredRect.paddingLeft) + 2;
      top = Math.floor(targetRect.top + targetRect.height / 2 - centeredRect.height / 2
        - centeredRect.top + contentNode.scrollTop) + 2;

      transformOrigin = `${centeredRect.left + targetRect.width / 2}px
        ${centeredRect.top + centeredRect.height / 2 - contentNode.scrollTop}px 0px`;

      containerNode.style.minWidth = `${targetRect.width + centeredRect.paddingLeft
        + centeredRect.paddingRight}px`;
    }

    let containerRect = containerNode.getBoundingClientRect();

    let dropdownTop = clamp(bounds.top, top, bounds.bottom - containerRect.height);
    let dropdownLeft = clamp(bounds.left, left, bounds.right - containerRect.width);

    let scaleX = Math.min(targetRect.width / selectMenuRect.width, 1.0);
    let scaleY = Math.min(targetRect.height / selectMenuRect.height, 1.0);
    let style = {
      top: dropdownTop,
      left: dropdownLeft,
      // Animate a scale out if we aren't just repositioning
      transform: !dropdown.didAnimateScale ? `scale(${scaleX}, ${scaleY})` : undefined,
      transformOrigin
    };

    dropdown.didAnimateScale = true;

    return { style, horizontalPosition: '', verticalPosition: '' };
  }
});


text:
SYNONYM

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

#### Published in
Revis. gen. pl. (Leipzig) 3: 469 (1898)

#### Original name
Uredo myrsiphylli Thüm., 1877

### Remarks
null


text:
package com.intellij.diff;

import com.intellij.openapi.util.text.LineTokenizer;
import com.intellij.util.diff.Diff;
import com.intellij.util.diff.FilesTooBigForDiffException;

/**
 * author: lesya
 */
public class FindBlock {

  private final Block myCurrentVersion;
  private final Block myResult;

  public FindBlock(String[] prevVersion, Block currentVersion) {
    myResult = new Block(prevVersion, currentVersion.getStart(), currentVersion.getEnd());
    myCurrentVersion = currentVersion;
  }

  public FindBlock(String prevVersion, Block currentVersion) {
    this(LineTokenizer.tokenize(prevVersion.toCharArray(), false), currentVersion);
  }

  public Block getBlockInThePrevVersion() throws FilesTooBigForDiffException {

    Diff.Change change = Diff.buildChanges(myResult.getSource(), myCurrentVersion.getSource());
    while (change != null) {
      shiftIndices(change.line1, change.line1, change.line0);
      shiftIndices(change.line1, change.line1 + change.inserted, change.line0 + change.deleted);
      change = change.link;
    }

    if (myResult.getEnd() >= myResult.getSource().length){
      myResult.setEnd(myResult.getSource().length - 1);
    }

    return myResult;
  }

  private void shiftIndices(int firstChangeIndex,int line1, int line0) {
    int shift = line1 - line0;

    if (line1 <= myCurrentVersion.getStart()) {
      myResult.setStart(myCurrentVersion.getStart() - shift);
    }

    if (firstChangeIndex <= myCurrentVersion.getEnd()) {
      myResult.setEnd(myCurrentVersion.getEnd() - shift);
    }
  }
}