text:
package android.support.v4.media;

import android.media.MediaDescription;
import android.net.Uri;

// Referenced classes of package android.support.v4.media:
//            MediaDescriptionCompatApi21

class MediaDescriptionCompatApi23 extends MediaDescriptionCompatApi21
{
    static class Builder extends MediaDescriptionCompatApi21.Builder
    {

        public static void setMediaUri(Object obj, Uri uri)
        {
            ((android.media.MediaDescription.Builder)obj).setMediaUri(uri);
        }

        Builder()
        {
        }
    }

    MediaDescriptionCompatApi23()
    {
    }

    public static Uri getMediaUri(Object obj)
    {
        return ((MediaDescription)obj).getMediaUri();
    }
}


text:
/*
#include "../priority_queue/priority_queue.h"
#include "../priority_queue/complete_binary_heap.h"
#include "../priority_queue/left_heap.h"
#include <string>
#include <map>
int main() {

    PQ_LeftHeap<int> left_heap;

    return 0;
}
 */

redpajama_set_name: RedPajamaGithub


text:
package io.github.anego.utils;

import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import javax.annotation.Nullable;

/**
 * 日付関連の共通処理.
 *
 * @author anego <anego@project-life.net>
 *
 */
public final class DateUtils {

    private DateUtils() {}

    /**
     * 文字列を指定フォーマッタでパースして日付型を返す.

     * 変換できない場合はNULLを返す.
     *
     * @param string 変換文字列
     * @param dtfJsonfilename 日付フォーマッタ
     * @return 日付
     */
    public static Date parse(String string, DateTimeFormatter dtfJsonfilename) {
        Date createdatetime = null;
        try {
            LocalDateTime localdate;
            if (dtfJsonfilename == null) {
                localdate = LocalDateTime.parse(string);
            } else {
                localdate = LocalDateTime.parse(string, dtfJsonfilename);
            }
            createdatetime = Date.from(localdate.atZone(ZoneId.systemDefault()).toInstant());
        } catch (Exception exc) {
            throw exc;
        }
        return createdatetime;
    }

    /**
     * 文字列を指定フォーマッタでパースして日付型を返す.

     * 変換できない場合はNULLを返す.
     *
     * @param string 変換文字列
     * @param dtfJsonfilename 日付フォーマッタ
     * @return 日付
     */
    public static LocalDateTime parseLocalDateTime(String string,
            @Nullable DateTimeFormatter dtfJsonfilename) {
        LocalDateTime localdate = null;
        try {
            if (dtfJsonfilename == null) {
                localdate = LocalDateTime.parse(string);
            } else {
                localdate = LocalDateTime.parse(string, dtfJsonfilename);
            }
        } catch (Exception exc) {
            throw exc;
        }
        return localdate;
    }

    /**
     * 新日時APIを旧日時APIに変換する
     *
     * @param ldt 変換する日時
     * @return 変換後日時
     * @see "http://tamata78.hatenablog.com/entry/2017/06/21/081512"
     */
    public static Date localDateTime2Date(LocalDateTime ldt) {
        return Date.from(ldt.toInstant(ZoneId.systemDefault().getRules().getOffset(ldt)));
    }

    /**
     * 旧日時APIを新日時APIに変換する
     *
     * @param date 変換する日時
     * @return 変換後日時
     * @see "http://tamata78.hatenablog.com/entry/2017/06/21/081512"
     */
    public static LocalDateTime date2LocalDateTime(Date date) {
        return LocalDateTime.ofInstant(date.toInstant(), ZoneId.systemDefault());
    }

}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd">

<meta name="generator" content="JDiff v1.0.9">

<meta name="description" content="JDiff is a Javadoc doclet which generates an HTML report of all the packages, classes, constructors, methods, and fields which have been removed, added or changed in any way, including their documentation, when two APIs are compared.">
<meta name="keywords" content="diff, jdiff, javadiff, java diff, java difference, API difference, difference between two APIs, API diff, Javadoc, doclet">
<TITLE>
Field Differences Index
</TITLE>
<LINK REL="stylesheet" TYPE="text/css" HREF="../stylesheet-jdiff.css" TITLE="Style">

All Fields

Removals

Additions

Changes

Bold is New, strike is deleted

A
B
C
D
E
F
G
H
J
M
N
O
P
Q
R
S
T
U
W
 TOP

<nobr>ACT_CHECKPOINT
</nobr>

<nobr>ACT_SHUTDOWN
</nobr>

<nobr>ACT_UNKNOWN
</nobr>

<nobr>AUDIT_FORMAT
</nobr>

B
A
C
D
E
F
G
H
J
M
N
O
P
Q
R
S
T
U
W
 TOP

<nobr>BACKUP
</nobr>

<nobr>BLOCK_FILE_PREFIX
</nobr>

<nobr>blockFilePattern
</nobr>

<nobr>blocksTotal
</nobr>

C
A
B
D
E
F
G
H
J
M
N
O
P
Q
R
S
T
U
W
 TOP

<nobr>capacityRemainingGB
</nobr>

<nobr>capacityTotalGB
</nobr>

<nobr>capacityUsedGB
</nobr>

<nobr>CHECKPOINT
</nobr>

<nobr>ckptState
</nobr>

<nobr>corruptReplicas
</nobr>

<nobr>count
</nobr>

D
A
B
C
E
F
G
H
J
M
N
O
P
Q
R
S
T
U
W
 TOP

<nobr>DEFAULT_BYTES_PER_CHECKSUM
</nobr>

<nobr>DEFAULT_FILE_BUFFER_SIZE
</nobr>

<nobr>DEFAULT_REPLICATION_FACTOR
</nobr>

<nobr>DEFAULT_WRITE_PACKET_SIZE
</nobr>

df

 in
<nobr>org.apache.hadoop.hdfs.HftpFileSystem
</nobr>

 in
<nobr>org.apache.hadoop.hdfs.server.namenode.ListPathsServlet
</nobr>

<nobr>DNA_ACCESSKEYUPDATE
</nobr>

E
A
B
C
D
F
G
H
J
M
N
O
P
Q
R
S
T
U
W
 TOP

<nobr>editLog
</nobr>

<nobr>exportedKeys
</nobr>

F
A
B
C
D
E
G
H
J
M
N
O
P
Q
R
S
T
U
W
 TOP

<nobr>FATAL
</nobr>

<nobr>FATAL_DISK_ERROR
</nobr>

<nobr>filesTotal
</nobr>

<nobr>fsNamesystemObject
</nobr>

G
A
B
C
D
E
F
H
J
M
N
O
P
Q
R
S
T
U
W
 TOP

GRANDFATHER_GENERATION_STAMP

 in
<nobr>org.apache.hadoop.hdfs.protocol.Block
</nobr>

 in
<nobr>org.apache.hadoop.hdfs.server.common.GenerationStamp
</nobr>

H
A
B
C
D
E
F
G
J
M
N
O
P
Q
R
S
T
U
W
 TOP

<nobr>HDFS_URI_SCHEME
</nobr>

<nobr>HFTP_DATE_FORMAT
</nobr>

<nobr>HFTP_TIMEZONE
</nobr>

<nobr>httpAddress
</nobr>

<nobr>httpServer
</nobr>

J
A
B
C
D
E
F
G
H
M
N
O
P
Q
R
S
T
U
W
 TOP

<nobr>JA_CHECKPOINT_TIME
</nobr>

<nobr>JA_IS_ALIVE
</nobr>

<nobr>JA_JOURNAL
</nobr>

<nobr>JA_JSPOOL_START
</nobr>

M
A
B
C
D
E
F
G
H
J
N
O
P
Q
R
S
T
U
W
 TOP

<nobr>METADATA_EXTENSION
</nobr>

<nobr>metaFilePattern
</nobr>

<nobr>missingBlocks
</nobr>

N
A
B
C
D
E
F
G
H
J
M
O
P
Q
R
S
T
U
W
 TOP

<nobr>namenode
</nobr>

namesystem

 in
<nobr>org.apache.hadoop.hdfs.server.namenode.FSImage
</nobr>

 in
<nobr>org.apache.hadoop.hdfs.server.namenode.NameNode
</nobr>

<nobr>needKeyUpdate
</nobr>

<nobr>nodeRegistration
</nobr>

<nobr>NOTIFY
</nobr>

<nobr>numcreateSymlinkOps
</nobr>

<nobr>numExpiredHeartbeats
</nobr>

<nobr>numFileInfoOps
</nobr>

<nobr>numFilesDeleted
</nobr>

<nobr>numFilesInGetListingOps
</nobr>

<nobr>numgetLinkTargetOps
</nobr>

O
A
B
C
D
E
F
G
H
J
M
N
P
Q
R
S
T
U
W
 TOP

<nobr>OP_BLOCK_CHECKSUM
</nobr>

<nobr>OP_COPY_BLOCK
</nobr>

<nobr>OP_INVALID
</nobr>

<nobr>OP_READ_BLOCK
</nobr>

<nobr>OP_READ_METADATA
</nobr>

<nobr>OP_REPLACE_BLOCK
</nobr>

<nobr>OP_STATUS_CHECKSUM_OK
</nobr>

<nobr>OP_STATUS_ERROR
</nobr>

<nobr>OP_STATUS_ERROR_ACCESS_TOKEN
</nobr>

<nobr>OP_STATUS_ERROR_CHECKSUM
</nobr>

<nobr>OP_STATUS_ERROR_EXISTS
</nobr>

<nobr>OP_STATUS_ERROR_INVALID
</nobr>

<nobr>OP_STATUS_SUCCESS
</nobr>

<nobr>OP_WRITE_BLOCK
</nobr>

P
A
B
C
D
E
F
G
H
J
M
N
O
Q
R
S
T
U
W
 TOP

<nobr>pathName
</nobr>

<nobr>pendingReplicationBlocks
</nobr>

<nobr>PRE_RBW_LAYOUT_VERSION
</nobr>

Q
A
B
C
D
E
F
G
H
J
M
N
O
P
R
S
T
U
W
 TOP

<nobr>quota
</nobr>

R
A
B
C
D
E
F
G
H
J
M
N
O
P
Q
S
T
U
W
 TOP

<nobr>READ_TIMEOUT_EXTENSION
</nobr>

<nobr>readMetadataOp
</nobr>

<nobr>registry
</nobr>

<nobr>role
</nobr>

<nobr>rpcAddress
</nobr>

S
A
B
C
D
E
F
G
H
J
M
N
O
P
Q
R
T
U
W
 TOP

<nobr>scheduledReplicationBlocks
</nobr>

<nobr>serialVersionUID
</nobr>

<nobr>server
</nobr>

<nobr>SERVER_DEFAULTS_VALIDITY_PERIOD
</nobr>

<nobr>stopRequested
</nobr>

T
A
B
C
D
E
F
G
H
J
M
N
O
P
Q
R
S
U
W
 TOP

<nobr>totalLoad
</nobr>

U
A
B
C
D
E
F
G
H
J
M
N
O
P
Q
R
S
T
W
 TOP

<nobr>underReplicatedBlocks
</nobr>

W
A
B
C
D
E
F
G
H
J
M
N
O
P
Q
R
S
T
U
 TOP

<nobr>WILDCARD_STAMP
</nobr>


text:
#ifndef Cursor_h
#define Cursor_h

#include "Image.h"
#include "IntPoint.h"
#include <wtf/RefPtr.h>

#if PLATFORM(WIN)
typedef struct HICON__* HICON;
typedef HICON HCURSOR;
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
#elif PLATFORM(MAC)
#include <wtf/RetainPtr.h>
#elif PLATFORM(GTK)
#include "GRefPtrGtk.h"
#elif PLATFORM(QT)
#include <QCursor>
#elif PLATFORM(CHROMIUM)
#include "PlatformCursor.h"
#elif PLATFORM(HAIKU)
#include <app/Cursor.h>
#endif

#if PLATFORM(MAC)
#ifdef __OBJC__
@class NSCursor;
#else
class NSCursor;
#endif
#endif

#if PLATFORM(WX)
class wxCursor;
#endif

#if PLATFORM(WIN)
typedef struct HICON__ *HICON;
typedef HICON HCURSOR;
#endif

#if PLATFORM(WIN) || PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL)
#define WTF_USE_LAZY_NATIVE_CURSOR 1
#endif

namespace WebCore {

    class Image;

#if PLATFORM(WIN)
    class SharedCursor : public RefCounted<SharedCursor> {
    public:
        static PassRefPtr<SharedCursor> create(HCURSOR nativeCursor) { return adoptRef(new SharedCursor(nativeCursor)); }
        ~SharedCursor();
        HCURSOR nativeCursor() const { return m_nativeCursor; }
    private:
        SharedCursor(HCURSOR nativeCursor) : m_nativeCursor(nativeCursor) { }
        HCURSOR m_nativeCursor;
    };
    typedef RefPtr<SharedCursor> PlatformCursor;
#elif PLATFORM(MAC)
    typedef NSCursor *PlatformCursor;
#elif PLATFORM(GTK)
    typedef GRefPtr<GdkCursor> PlatformCursor;
#elif PLATFORM(EFL)
    typedef const char* PlatformCursor;
#elif PLATFORM(QT) && !defined(QT_NO_CURSOR)
    // Do not need to be shared but need to be created dynamically via ensurePlatformCursor.
    typedef QCursor* PlatformCursor;
#elif PLATFORM(WX)
    typedef wxCursor* PlatformCursor;
#elif PLATFORM(CHROMIUM)
    // See PlatformCursor.h
#elif PLATFORM(HAIKU)
    typedef BCursor* PlatformCursor;
#else
    typedef void* PlatformCursor;
#endif

    class Cursor {
    public:
        enum Type {
            Pointer,
            Cross,
            Hand,
            IBeam,
            Wait,
            Help,
            EastResize,
            NorthResize,
            NorthEastResize,
            NorthWestResize,
            SouthResize,
            SouthEastResize,
            SouthWestResize,
            WestResize,
            NorthSouthResize,
            EastWestResize,
            NorthEastSouthWestResize,
            NorthWestSouthEastResize,
            ColumnResize,
            RowResize,
            MiddlePanning,
            EastPanning,
            NorthPanning,
            NorthEastPanning,
            NorthWestPanning,
            SouthPanning,
            SouthEastPanning,
            SouthWestPanning,
            WestPanning,
            Move,
            VerticalText,
            Cell,
            ContextMenu,
            Alias,
            Progress,
            NoDrop,
            Copy,
            None,
            NotAllowed,
            ZoomIn,
            ZoomOut,
            Grab,
            Grabbing,
            Custom
        };

        static const Cursor& fromType(Cursor::Type);

        Cursor()
            : m_platformCursor(0)
        {
        }

        Cursor(Image*, const IntPoint& hotSpot);
        Cursor(const Cursor&);
        ~Cursor();
        Cursor& operator=(const Cursor&);

#if USE(LAZY_NATIVE_CURSOR)
        Cursor(Type);
        Type type() const { return m_type; }
        Image* image() const { return m_image.get(); }
        const IntPoint& hotSpot() const { return m_hotSpot; }
        PlatformCursor platformCursor() const;
#else
        Cursor(PlatformCursor);
        PlatformCursor impl() const { return m_platformCursor; }
#endif

     private:
#if USE(LAZY_NATIVE_CURSOR)
        void ensurePlatformCursor() const;

        Type m_type;
        RefPtr<Image> m_image;
        IntPoint m_hotSpot;
#endif

#if !PLATFORM(MAC)
        mutable PlatformCursor m_platformCursor;
#else
        mutable RetainPtr<NSCursor> m_platformCursor;
#endif
    };

    IntPoint determineHotSpot(Image*, const IntPoint& specifiedHotSpot);
    const char* nameForCursorType(Cursor::Type);

    const Cursor& pointerCursor();
    const Cursor& crossCursor();
    const Cursor& handCursor();
    const Cursor& moveCursor();
    const Cursor& iBeamCursor();
    const Cursor& waitCursor();
    const Cursor& helpCursor();
    const Cursor& eastResizeCursor();
    const Cursor& northResizeCursor();
    const Cursor& northEastResizeCursor();
    const Cursor& northWestResizeCursor();
    const Cursor& southResizeCursor();
    const Cursor& southEastResizeCursor();
    const Cursor& southWestResizeCursor();
    const Cursor& westResizeCursor();
    const Cursor& northSouthResizeCursor();
    const Cursor& eastWestResizeCursor();
    const Cursor& northEastSouthWestResizeCursor();
    const Cursor& northWestSouthEastResizeCursor();
    const Cursor& columnResizeCursor();
    const Cursor& rowResizeCursor();
    const Cursor& middlePanningCursor();
    const Cursor& eastPanningCursor();
    const Cursor& northPanningCursor();
    const Cursor& northEastPanningCursor();
    const Cursor& northWestPanningCursor();
    const Cursor& southPanningCursor();
    const Cursor& southEastPanningCursor();
    const Cursor& southWestPanningCursor();
    const Cursor& westPanningCursor();
    const Cursor& verticalTextCursor();
    const Cursor& cellCursor();
    const Cursor& contextMenuCursor();
    const Cursor& noDropCursor();
    const Cursor& notAllowedCursor();
    const Cursor& progressCursor();
    const Cursor& aliasCursor();
    const Cursor& zoomInCursor();
    const Cursor& zoomOutCursor();
    const Cursor& copyCursor();
    const Cursor& noneCursor();
    const Cursor& grabCursor();
    const Cursor& grabbingCursor();

} // namespace WebCore

#endif // Cursor_h


text:
namespace BillableHoursWebApp.DataTransferModels
{
    using System;
    using System.Collections.Generic;
    using Common.Mapping;
    using Data.Models;

    public class InvoiceResponseModel : IMapFrom<Invoice>
    {
        public int Id { get; set; }

        // consider referencing a Project Object
        public string ProjectTitle { get; set; }

        public DateTime IssuedOn { get; set; }

        // consider referencing an Employee Object
        public string EmployeeName { get; set; }

        public string EmployeeEmail { get; set; }

        // consider referencing a Client Object
        public string ClientName { get; set; }

        public string ClientEmail { get; set; }

        public decimal PricePerHour { get; set; }

        public string CategoryName { get; set; }

        public string Url { get; set; }

        public IEnumerable<WorkLogResponseModel> WorkLogs { get; set; }
    }
}


text:
import { addIndex, map } from 'ramda';
import React from 'react';
import { View, Text, TouchableOpacity } from 'react-native';

import speakerImage from '../../assets/images/speaker.png';
import {
  BLACK_TRANSPARENT,
  PRIMARY_STRONG,
  PRIMARY,
  MASCULINE_STRONG,
  MASCULINE_WEAK,
  FEMININE_STRONG,
  FEMININE_WEAK,
  NEUTER_STRONG,
  NEUTER_WEAK
} from '../../styles/colors';
import { DEFAULT } from '../../styles/text';
import { loadSounds, playAll } from '../helpers/audio';
import { RoundImageWithButton } from '../Components';

const mapIndexed = addIndex(map);

const articles = ['der', 'die', 'das'];

const a = {
  [articles[0]]: {
    weak: MASCULINE_WEAK,
    strong: MASCULINE_STRONG
  },
  [articles[1]]: {
    weak: FEMININE_WEAK,
    strong: FEMININE_STRONG
  },
  [articles[2]]: {
    weak: NEUTER_WEAK,
    strong: NEUTER_STRONG
  }
};

const styles = {
  letterStyle: {
    backgroundColor: PRIMARY_STRONG
  },
  article: {
    marginHorizontal: 10,
    padding: 10
  },
  shared: {
    padding: 5,
    margin: 2,
    borderRadius: 20,
    elevation: 10,
    shadowColor: BLACK_TRANSPARENT,
    shadowOpacity: 1,
    shadowRadius: 0,
    shadowOffset: {
      height: 4,
      width: 4
    }
  }
};

class ChooseArticle extends React.Component {
  constructor() {
    super();

    this.state = {
      selectedArticle: null
    };
  }

  play = () => playAll(this.props.sounds);

  selectArticle = article => () => {
    this.setState(({ selectedArticle }) => ({
      selectedArticle: selectedArticle === article ? null : article
    }));
  };

  render() {
    const letters = mapIndexed(
      (char, key) => (
        <View
          key={key}
          style={[{ padding: 5 }, styles.letterStyle, styles.shared]}
        >
          <Text style={DEFAULT}>{char}</Text>
        </View>
      ),
      this.props.text
    );

    const articleButtons = mapIndexed(
      (article, key) => (
        <TouchableOpacity
          key={key}
          style={[
            styles.shared,
            styles.article,
            {
              backgroundColor:
                this.state.selectedArticle === article
                  ? a[article].strong
                  : a[article].weak
            }
          ]}
          onPress={this.selectArticle(article)}
        >
          <Text style={DEFAULT}>{article}</Text>
        </TouchableOpacity>
      ),
      articles
    );

    return (
      <View
        style={{
          flex: 1,
          backgroundColor: PRIMARY,
          alignItems: 'center',
          justifyContent: 'space-around'
        }}
      >
        <RoundImageWithButton
          image={this.props.image}
          imageSize={200}
          icon={speakerImage}
          buttonSize={40}
          onPress={this.play}
        />
        <View style={{ flexDirection: 'row' }}>{letters}</View>
        <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
          {articleButtons}
        </View>
      </View>
    );
  }
}

export default loadSounds(ChooseArticle);


text:
#liste_personnel input[type="text"]
{
	border-right-width: 2px;
	border-left-width: 2px;
	border-top-width: 2px;
	border-bottom-width: 2px;
	border-color: #cccccc;
	width: 120px;
	padding-left: 5px;
}

#contenu {
    background: #fff; max-height: 100%;
    border: 3px solid #ccc ;
    border-bottom-right-radius: 10px;
    border-bottom-left-radius: 10px;
    border-top: 2px solid #cccccc;
    padding-left: 20px;
    padding-right: 20px;
    box-shadow: 0pt 5pt 12px rgba(0, 0, 0, 0.5);
}

#titre {
	height: 30px;
    border: 3px solid #ccc;
	border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    border-bottom: 2px solid #cccccc;
    background : #fff;
    padding-left: 10px;
    padding-bottom: 5px;
    padding-top : 13px;
    box-shadow: 0pt 0pt 12px rgba(0, 0, 0, 0.5);
}

tr {
	background: #fbfbfb;
}

#nomMaj{
	text-transform : uppercase;
}

#patient thead tr th{
	color: green;
	text-transform : uppercase;
	font-size: 15px;
}

.dataTables_paginate *
{
	background: #e9e8e8;
	padding-top: 6px;
	padding-bottom: 6px;
	padding-left: 6px;
	padding-right: 6px;
    color: black;
	margin-top: -120px;
	cursor: pointer;

}

div .dataTables_paginate
{
	margin-bottom: 20px;
}

.dataTables_paginate .first
{
	margin-right: 0px;
}

.dataTables_paginate .last
{
	margin-left: 0px;
}

.dataTables_paginate .previous
{
	margin-right: 2px;
	border-left: 1px solid #bdb9b9;
}

.dataTables_paginate .next
{
	margin-left: 3px;
	border-right: 1px solid #bdb9b9;
}

.dataTables_paginate a:hover
{
	text-decoration: none;
	background-color: #c1c1c1;
	color: white;
}

.dataTables_paginate .paginate_active
{
	text-decoration: none;
	background-color: #b5b2b2;
	color: white;
}

/* EN TETE*/
#_nom
{
	width: 13%;
}

#_prenom
{
	width: 15%;
}

#_date
{
	width: 12%;
}

#_sexe
{
	width: 7%;
}

#_adresse
{
	width: 28%;
}

#_nationalite
{
	width: 15%;
}

#_effectuer
{
	width: 10%;
}

/* PIED DE PAGE*/
#nom_ input[type="text"]
{ /*le input ou le textarea*/

background-color: #fffffa; /*la couleur du champ*/

height: 25px; /*la hauteur du champ input*/

width: 100%; /* la largeur du champ input*/
}

#prenom_ input[type="text"]
{ /*le input ou le textarea*/

background-color: #fffffa; /*la couleur du champ*/

height: 25px; /*la hauteur du champ input*/

width: 100%; /* la largeur du champ input*/
}

#date_ input[type="text"]
{ /*le input ou le textarea*/

background-color: #fffffa; /*la couleur du champ*/

height: 25px; /*la hauteur du champ input*/

width: 100%; /* la largeur du champ input*/
}

#sexe_ input[type="text"]
{ /*le input ou le textarea*/

background-color: #fffffa; /*la couleur du champ*/

height: 25px; /*la hauteur du champ input*/

width: 100%; /* la largeur du champ input*/
}

#adresse_ input[type="text"]
{ /*le input ou le textarea*/

background-color: #fffffa; /*la couleur du champ*/

height: 25px; /*la hauteur du champ input*/

width: 100%; /* la largeur du champ input*/
}

#nationalite_ input[type="text"]
{ /*le input ou le textarea*/

background-color: #fffffa; /*la couleur du champ*/

height: 25px; /*la hauteur du champ input*/

width: 100%; /* la largeur du champ input*/
}

#effectuer_ input[type="text"]
{ /*le input ou le textarea*/

background-color: #fffffa; /*la couleur du champ*/

height: 25px; /*la hauteur du champ input*/

width: 100%; /* la largeur du champ input*/
}
/* STYLE POUR LA LISTE DE SELECTION DE LA TABLE*/
#listeDataTable{
	margin-bottom: 0px;
	margin-left: -10px;
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.3.1"/>
<title>MagickCore: _TypeMetric Struct Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="navtree.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

MagickCore
    7.0.0

Data Fields

_TypeMetric Struct Reference

#include <draw.h>

Collaboration diagram for _TypeMetric:

<map name="__TypeMetric_coll__map" id="__TypeMetric_coll__map">
<area shape="rect" id="node2" href="struct__SegmentInfo.html" title="_SegmentInfo" alt="" coords="5,5,116,32"/><area shape="rect" id="node4" href="struct__PointInfo.html" title="_PointInfo" alt="" coords="141,5,229,32"/></map>
[legend]

Data Fields

PointInfo 	pixels_per_em

double 	ascent

double 	descent

double 	width

double 	height

double 	max_advance

double 	underline_position

double 	underline_thickness

SegmentInfo 	bounds

PointInfo 	origin

Detailed Description

Definition at line 342 of file draw.h.

Field Documentation

          double _TypeMetric::ascent

Definition at line 348 of file draw.h.

Referenced by AnnotateImage(), GetMultilineTypeMetrics(), GetTypeMetrics(), MontageImageList(), PolaroidImage(), and RenderPostscript().

          SegmentInfo _TypeMetric::bounds

Definition at line 357 of file draw.h.

Referenced by AnnotateImage(), GetTypeMetrics(), and RenderPostscript().

          double _TypeMetric::descent

Definition at line 348 of file draw.h.

Referenced by AnnotateImage(), GetMultilineTypeMetrics(), GetTypeMetrics(), MontageImageList(), PolaroidImage(), and RenderPostscript().

          double _TypeMetric::height

Definition at line 348 of file draw.h.

Referenced by GetMultilineTypeMetrics(), GetTypeMetrics(), and RenderPostscript().

          double _TypeMetric::max_advance

Definition at line 348 of file draw.h.

Referenced by GetTypeMetrics(), and RenderPostscript().

          PointInfo _TypeMetric::origin

Definition at line 360 of file draw.h.

Referenced by AnnotateImage(), and GetTypeMetrics().

          PointInfo _TypeMetric::pixels_per_em

Definition at line 345 of file draw.h.

Referenced by GetTypeMetrics(), and RenderPostscript().

          double _TypeMetric::underline_position

Definition at line 348 of file draw.h.

Referenced by AnnotateImage(), GetTypeMetrics(), and RenderPostscript().

          double _TypeMetric::underline_thickness

Definition at line 348 of file draw.h.

Referenced by AnnotateImage(), GetTypeMetrics(), and RenderPostscript().

          double _TypeMetric::width

Definition at line 348 of file draw.h.

Referenced by AnnotateImage(), FormatMagickCaption(), GetMultilineTypeMetrics(), GetTypeMetrics(), and RenderPostscript().

The documentation for this struct was generated from the following file:

draw.h

_TypeMetric

Generated by

     1.8.3.1


text:
import { expect } from 'chai'
import {clean, runCucumber} from '../helper'

const configPath = './test/fixtures/wdio.conf/wdio.conf.cucumber.step.js'

describe('cucumber test scenario with steps', () => {
    beforeEach(clean)

    it('should add feature labels for test cases', () => {
        return runCucumber(['passing'], configPath).then((results) => {
            expect(results).to.have.lengthOf(1)
            const result = results[0]
            expect(result('test-case label[name="feature"]').eq(0).attr('value')).to.equal('A passing feature')
        })
    })

    it('should report one test per scenario - passed case', () => {
        return runCucumber(['passing'], configPath).then((results) => {
            expect(results).to.have.lengthOf(1)
            const result = results[0]

            expect(result('test-case')).to.have.lengthOf(1)
            expect(result('test-case').attr('status')).to.be.equal('passed')
            expect(result('test-case > steps > step')).to.have.lengthOf(3)
            expect(result('test-case > steps > step > name').eq(0).text()).to.be.equal('I visit "/index.html"')
            expect(result('test-case > steps > step').eq(0).attr('status')).to.be.equal('passed')
            expect(result('test-case > steps > step > name').eq(1).text()).to.be.equal('I click the clickable region')
            expect(result('test-case > steps > step').eq(1).attr('status')).to.be.equal('passed')
            expect(result('test-case > steps > step > name').eq(2).text()).to.be.equal('I should get the result: 1')
            expect(result('test-case > steps > step').eq(2).attr('status')).to.be.equal('passed')
            expect(result('test-case label[name="thread"]')).to.have.lengthOf(1)
        })
    })

    it('should report one test per scenario - failed case', () => {
        return runCucumber(['failing'], configPath).then((results) => {
            expect(results).to.have.lengthOf(1)
            const result = results[0]

            expect(result('test-case')).to.have.lengthOf(1)
            expect(result('test-case').attr('status')).to.be.equal('failed')
            expect(result('test-case > steps > step')).to.have.lengthOf(3)
            expect(result('test-case > steps > step > name').eq(0).text()).to.be.equal('I visit "/index.html"')
            expect(result('test-case > steps > step').eq(0).attr('status')).to.be.equal('passed')
            expect(result('test-case > steps > step > name').eq(1).text()).to.be.equal('I click the clickable region')
            expect(result('test-case > steps > step').eq(1).attr('status')).to.be.equal('passed')
            expect(result('test-case > steps > step > name').eq(2).text()).to.be.equal('I run failing step')
            expect(result('test-case > steps > step').eq(2).attr('status')).to.be.equal('failed')
        })
    })

    it('should report one test per scenario - broken case', () => {
        return runCucumber(['broken'], configPath).then((results) => {
            expect(results).to.have.lengthOf(1)
            const result = results[0]

            expect(result('test-case')).to.have.lengthOf(1)
            expect(result('test-case').attr('status')).to.be.equal('broken')
            expect(result('test-case > steps > step')).to.have.lengthOf(3)
            expect(result('test-case > steps > step > name').eq(0).text()).to.be.equal('I visit "/index.html"')
            expect(result('test-case > steps > step').eq(0).attr('status')).to.be.equal('passed')
            expect(result('test-case > steps > step > name').eq(1).text()).to.be.equal('I click the clickable region')
            expect(result('test-case > steps > step').eq(1).attr('status')).to.be.equal('passed')
            expect(result('test-case > steps > step > name').eq(2).text()).to.be.equal('I try to use undefined step')
            expect(result('test-case > steps > step').eq(2).attr('status')).to.be.equal('broken')
        })
    })

    it('should report one test per scenario - pending case', () => {
        return runCucumber(['withPending'], configPath).then((results) => {
            expect(results).to.have.lengthOf(1)
            const result = results[0]

            expect(result('test-case')).to.have.lengthOf(1)
            expect(result('test-case').attr('status')).to.be.equal('failed')
            expect(result('test-case > steps > step')).to.have.lengthOf(4)
            expect(result('test-case > steps > step > name').eq(0).text()).to.be.equal('I visit "/index.html"')
            expect(result('test-case > steps > step').eq(0).attr('status')).to.be.equal('passed')
            expect(result('test-case > steps > step > name').eq(1).text()).to.be.equal('I click the clickable region')
            expect(result('test-case > steps > step').eq(1).attr('status')).to.be.equal('passed')
            expect(result('test-case > steps > step > name').eq(2).text()).to.be.equal('I run failing step')
            expect(result('test-case > steps > step').eq(2).attr('status')).to.be.equal('failed')
            expect(result('test-case > steps > step > name').eq(3).text()).to.be.equal('I see steps after as pending')
            expect(result('test-case > steps > step').eq(3).attr('status')).to.be.equal('pending')
        })
    })

    it('should report one test per scenario - scenario pending case', () => {
        return runCucumber(['withPendingScenario'], configPath).then((results) => {
            expect(results).to.have.lengthOf(1)
            const result = results[0]

            expect(result('test-case')).to.have.lengthOf(2)
            expect(result('test-case').eq(0).attr('status')).to.be.equal('failed')
            expect(result('test-case').eq(1).attr('status')).to.be.equal('pending')
            expect(result('test-case:nth-child(1) > steps > step')).to.have.lengthOf(3)
            expect(result('test-case:nth-child(2) > steps > step')).to.have.lengthOf(3)
            expect(result('test-case:nth-child(1) > steps > step > name').eq(0).text()).to.be.equal('I visit "/index.html"')
            expect(result('test-case:nth-child(1) > steps > step').eq(0).attr('status')).to.be.equal('passed')
            expect(result('test-case:nth-child(1) > steps > step > name').eq(1).text()).to.be.equal('I click the clickable region')
            expect(result('test-case:nth-child(1) > steps > step').eq(1).attr('status')).to.be.equal('passed')
            expect(result('test-case:nth-child(1) > steps > step > name').eq(2).text()).to.be.equal('I run failing step')
            expect(result('test-case:nth-child(1) > steps > step').eq(2).attr('status')).to.be.equal('failed')
            expect(result('test-case:nth-child(2) > steps > step > name').eq(0).text()).to.be.equal('I visit "/index.html"')
            expect(result('test-case:nth-child(2) > steps > step').eq(0).attr('status')).to.be.equal('pending')
            expect(result('test-case:nth-child(2) > steps > step > name').eq(1).text()).to.be.equal('I click the clickable region')
            expect(result('test-case:nth-child(2) > steps > step').eq(1).attr('status')).to.be.equal('pending')
            expect(result('test-case:nth-child(2) > steps > step > name').eq(2).text()).to.be.equal('I run failing step')
            expect(result('test-case:nth-child(2) > steps > step').eq(2).attr('status')).to.be.equal('pending')
        })
    })
})


text:
from flask import Flask, render_template, session, request, redirect
from utils import *
from random import randint
import os

app = Flask(__name__)
app.secret_key = 'thequickbrownfoxjumpsoverthelazydog'

@app.route("/", methods=["GET","POST"])
def index():
    if request.method == "GET":
        session['unique'] = num_rows() + 1
        return render_template("index.html", username = session.get('username'))
    elif request.method == "POST":
        button = request.form['button']
        if button == "Sign In":
            uname = request.form.get('in_username')
            pword = request.form.get('in_password')
            if check_user(uname,pword):
                session['username'] = uname
            return render_template("index.html", username = session.get('username'))
        if button == "Sign Up":
            uname = request.form.get('up_username')
            pword = request.form.get('up_password')
            if create_user(uname, pword):
                session['username'] = uname
            return render_template("index.html", username = session.get('username'))
        return render_template("index.html", username = session.get('username'))

@app.route("/play", methods=["GET","POST"])
def play():
    if request.method == "GET":
        if session['unique'] >= 1:
            game = get_ques(session['unique'])
        return render_template("play.html", username = session.get('username'), optA = game['optA'], optB = game['optB'], optAres = game['optAres'], optBres = game['optBres'])
    elif request.method == "POST":
        button = request.form['button']
        game = get_ques(session['unique'])
        if button == str(game['optAres']) + " people agree":
            print "HERE"
            update_row(session['unique'], 0)
            session['unique'] -= 1
            return redirect('/play')
        if button == str(game['optBres']) + " people agree ":
            print "HERE"
            update_row(session['unique'], 1)
            session['unique'] -=1
            return redirect('/play')
        return redirect('/play')

@app.route("/profile")
@app.route("/profile/<uname>", methods=["GET","POST"])
def profile(uname = ""):
    if os.path.isfile('./static/img/prof_pics/' + session.get('username') + '.png'):
        pic = "../static/img/prof_pics/" + session.get('username') + '.png'
    else:
        pic = "../static/img/user.png"
    if request.method == "GET":
        return render_template("profile.html", username = session.get('username'), prof_pic = pic)
    elif request.method == "POST":
        file = request.files['file']
        if file and ".png" in file.filename:
            file.save(os.getcwd() + '/static/img/prof_pics/' + session.get('username') + '.png')
            pic = "../static/img/prof_pics/" + session.get('username') + '.png'
            return render_template("profile.html", username = session.get('username'), prof_pic = pic)
        return render_template("profile.html", username = session.get('username'), prof_pic = pic)

@app.route("/logout") ##clears session
def logout():
    session['username'] = None
    session['unique'] = None
    return redirect("/")

if __name__ == "__main__":
    app.debug = True
    app.run(host = '0.0.0.0', port = 8000)


text:
<?php

declare(strict_types=1);

namespace poggit\ci\api;

use poggit\account\Session;
use poggit\ci\builder\ProjectBuilder;
use poggit\ci\lint\V2BuildStatus;
use poggit\module\AjaxModule;
use poggit\resource\ResourceManager;
use poggit\utils\internet\GitHub;
use poggit\utils\internet\Mysql;
use poggit\utils\OutputManager;
use function array_map;
use function count;
use function dechex;
use function explode;
use function filesize;
use function header;
use function json_decode;
use function json_encode;

class BuildDataRequestAjax extends AjaxModule {
    protected function impl() {
        header("Content-Type: application/json");
        $projectId = (int) $this->param("projectId");
        $class = $this->param("class");
        $internal = $this->param("internal");

        $isPr = $class === ProjectBuilder::BUILD_CLASS_PR;
        $branchColumn = $isPr ? "substring_index(substring_index(cause, '\"prNumber\":',-1), ',', 1)" : "branch";
        $rows = array_map(function(array $input) use ($isPr) {
            $row = (object) $input;
            $row->repoId = (int) $row->repoId;
            $row->cause = json_decode($row->cause);
            $row->date = (int) $row->date;
            if($isPr) $row->branch = (int) $row->branch;
            $row->virions = [];
            $row->lintCount = (int) ($row->lintCount ?? 0);
            $row->worstLint = (int) ($row->worstLint ?? 0);
            if($row->libs !== null) {
                foreach(explode(",", $row->libs ?? "") as $lib) {
                    list($virionName, $virionVersion, $virionBranch, $virionSha, $virionBabs) = explode(":", $lib, 5);
                    $row->virions[$virionName] = [
                        "version" => $virionVersion,
                        "branch" => $virionBranch,
                        "sha" => $virionSha,
                        "babs" => dechex((int)$virionBabs),
                    ];
                }
            }
            $row->dlSize = $row->resourceId === ResourceManager::NULL_RESOURCE ? 0.0 : filesize(ResourceManager::pathTo($row->resourceId, "phar"));
            unset($row->libs);
            return $row;
        }, Mysql::query("SELECT (SELECT repoId FROM projects WHERE projects.projectId = builds.projectId) repoId, cause,
                builds.buildId, class, internal, UNIX_TIMESTAMP(created) date, resourceId, $branchColumn branch, sha, main, path,
                bs.cnt lintCount, bs.maxLevel worstLint,
                virion_builds.version virionVersion, virion_builds.api virionApi,
                (SELECT GROUP_CONCAT(CONCAT_WS(':', vp.name, vvb.version, vb.branch, vb.sha, vb.buildId) SEPARATOR ',') FROM virion_usages
                    INNER JOIN builds vb ON virion_usages.virionBuild = vb.buildId
                    INNER JOIN virion_builds vvb ON vvb.buildId = vb.buildId
                    INNER JOIN projects vp ON vp.projectId = vb.projectId
                    WHERE virion_usages.userBuild = builds.buildId) libs
            FROM builds
                LEFT JOIN (SELECT buildId, COUNT(*) cnt, MAX(level) maxLevel FROM builds_statuses GROUP BY buildId) bs
                    ON bs.buildId = builds.buildId
                LEFT JOIN virion_builds ON builds.buildId = virion_builds.buildId
            WHERE projectId = ? AND class = ? AND internal = ?", "iii", $projectId, $class, $internal));

        if(count($rows) === 0) $this->errorNotFound(true);
        $build = $rows[0];
        if(!GitHub::testPermission($build->repoId, Session::getInstance()->getAccessToken(true), Session::getInstance()->getName(), "pull")) {
            $this->errorNotFound(true);
        }
        $build->statuses = array_map(function(array $row) {
            $om = OutputManager::$tail->startChild();
            $status = V2BuildStatus::unserializeNew(json_decode($row["body"]), $row["class"], (int) $row["level"]);
            $status->echoHtml();
            return ["level" => $status->level, "class" => $row["class"], "html" => $om->terminateGet()];
        }, Mysql::query("SELECT level, class, body FROM builds_statuses WHERE buildId = ?", "i", $build->buildId));
        echo json_encode($build);
    }

    protected function needLogin(): bool {
        return false;
    }
}


text:
import { filterService } from '../hooks';
import { filterAge } from './filterAge';

it('returns null for empty people', async () => {
  const filterState = { people: {} };
  expect(filterAge(filterState)).toBeNull();
});

it('filters a service with no age requirements', async () => {
  const filterState = { people: { olderAdults: 1 } };
  const filters = [filterAge(filterState)];
  const service = { eligibilityProfiles: [{ ageMax: null, ageMin: null }] };

  expect(filterService(filters, service)).toBe(true);
});

it('filters out service with age requirements', async () => {
  const filterState = { people: { adults: 1 } };
  const filters = [filterAge(filterState)];
  const service = { eligibilityProfiles: [{ ageMax: 17, ageMin: 0 }] };

  expect(filterService(filters, service)).toBe(false);
});

it('filters a service with age requirements', async () => {
  const filterState = { people: { teens: 1 } };
  const filters = [filterAge(filterState)];
  const service = { eligibilityProfiles: [{ ageMax: 17, ageMin: 0 }] };

  expect(filterService(filters, service)).toBe(true);
});

it('filters a service with only minimum age', async () => {
  const filterState = { people: { olderAdults: 1 } };
  const filters = [filterAge(filterState)];
  const service = { eligibilityProfiles: [{ ageMax: null, ageMin: 62 }] };

  expect(filterService(filters, service)).toBe(true);
});

it('filters out a service with only minimum age', async () => {
  const filterState = { people: { children: 1 } };
  const filters = [filterAge(filterState)];
  const service = { eligibilityProfiles: [{ ageMax: null, ageMin: 62 }] };

  expect(filterService(filters, service)).toBe(false);
});


text:
package br.com.arbo.steamside.app.embedded.actuate;

import javax.inject.Inject;

import org.springframework.boot.actuate.endpoint.AbstractEndpoint;
import org.springframework.stereotype.Component;

import br.com.arbo.steamside.steam.client.library.DumpSteamCategoriesFrom_Library;

@Component
public class SteamCategoriesEndpoint extends AbstractEndpoint<String>
{

	@Override
	public String invoke()
	{
		return dumpSteamCategoriesFrom_Library.dumpToString();
	}

	@Inject
	public SteamCategoriesEndpoint(
		DumpSteamCategoriesFrom_Library dumpSteamCategoriesFrom_Library)
	{
		super("steamcategories");
		this.dumpSteamCategoriesFrom_Library = dumpSteamCategoriesFrom_Library;
	}

	private final DumpSteamCategoriesFrom_Library dumpSteamCategoriesFrom_Library;

}


text:
from typing import Optional, List, Union, Dict, Any

from .default_arg import DefaultArg, NotGiven
from .internal_utils import _to_dict_without_not_given, _is_iterable

class GroupMember:
    display: Union[Optional[str], DefaultArg]
    value: Union[Optional[str], DefaultArg]
    unknown_fields: Dict[str, Any]

    def __init__(
        self,
        *,
        display: Union[Optional[str], DefaultArg] = NotGiven,
        value: Union[Optional[str], DefaultArg] = NotGiven,
        **kwargs,
    ) -> None:
        self.display = display
        self.value = value
        self.unknown_fields = kwargs

    def to_dict(self):
        return _to_dict_without_not_given(self)

class GroupMeta:
    created: Union[Optional[str], DefaultArg]
    location: Union[Optional[str], DefaultArg]
    unknown_fields: Dict[str, Any]

    def __init__(
        self,
        *,
        created: Union[Optional[str], DefaultArg] = NotGiven,
        location: Union[Optional[str], DefaultArg] = NotGiven,
        **kwargs,
    ) -> None:
        self.created = created
        self.location = location
        self.unknown_fields = kwargs

    def to_dict(self):
        return _to_dict_without_not_given(self)

class Group:
    display_name: Union[Optional[str], DefaultArg]
    id: Union[Optional[str], DefaultArg]
    members: Union[Optional[List[GroupMember]], DefaultArg]
    meta: Union[Optional[GroupMeta], DefaultArg]
    schemas: Union[Optional[List[str]], DefaultArg]
    unknown_fields: Dict[str, Any]

    def __init__(
        self,
        *,
        display_name: Union[Optional[str], DefaultArg] = NotGiven,
        id: Union[Optional[str], DefaultArg] = NotGiven,
        members: Union[Optional[List[GroupMember]], DefaultArg] = NotGiven,
        meta: Union[Optional[GroupMeta], DefaultArg] = NotGiven,
        schemas: Union[Optional[List[str]], DefaultArg] = NotGiven,
        **kwargs,
    ) -> None:
        self.display_name = display_name
        self.id = id
        self.members = (
            [a if isinstance(a, GroupMember) else GroupMember(**a) for a in members]
            if _is_iterable(members)
            else members
        )
        self.meta = (
            GroupMeta(**meta) if meta is not None and isinstance(meta, dict) else meta
        )
        self.schemas = schemas
        self.unknown_fields = kwargs

    def to_dict(self):
        return _to_dict_without_not_given(self)

    def __repr__(self):
        return f"<slack_sdk.scim.{self.__class__.__name__}: {self.to_dict()}>"


text:
import {
  CallHandler,
  ExecutionContext,
  Inject,
  Injectable,
  NestInterceptor,
  Scope,
} from '@nestjs/common';
import { Observable } from 'rxjs';

@Injectable({ scope: Scope.REQUEST })
export class Interceptor implements NestInterceptor {
  static COUNTER = 0;
  static REQUEST_SCOPED_DATA = [];

  constructor(@Inject('REQUEST_ID') private readonly requestId: number) {
    Interceptor.COUNTER++;
  }

  intercept(context: ExecutionContext, call: CallHandler): Observable<any> {
    Interceptor.REQUEST_SCOPED_DATA.push(this.requestId);
    return call.handle();
  }
}


text:
package com.microsoft.z3;

/**
 * Datatype expressions
 **/
public class DatatypeExpr extends Expr
{
    /**
     * Constructor for DatatypeExpr
     **/
    DatatypeExpr(Context ctx, long obj)
    {
        super(ctx, obj);
    }
}


text:
layout: post
title: "JQuery : Why I prefer $.ajax promise"
excerpt: "JQuery : Why I prefer $.ajax promise over success and fail options"
date: 2016-06-01 00:00:00 IST
updated: 2016-06-01 00:00:00 IST
categories: javascript, jquery, promise
tags: javascript, jquery
---

When first learned `$.ajax` I was using `success` and `error` options for the async
callbacks. Later when I learned more about `$.ajax` and promises I found `.done`
and `.fail` methods are more easy and useful.

Usually I write a ajax call like below

~~~ js
  $.ajax({
    url: "/someurl",
    method: "GET",
    data: {
      a: "a"
    },
    success: function(data) {
      console.log('success', data)
    },
    error: function(xhr) {
      console.log('error', xhr);
    }
  })
~~~

But now a days I write using the `.done` and `.fail` methods.

~~~ js
  $.ajax({
    url: "/someurl",
    method: "GET",
    data: {
      a: "a"
  })
  .done(function(data) {
    console.log('success', data)
  })
  .fail(function(xhr) {
    console.log('error', xhr);
  });
~~~

For me the second method is better because of two reasons

## Promise method can be used to bind multiple callbacks

When using options for callbacks, I can't pass more than 1  callback for success
or fail option. But on the other hand youI bind any number of callbacks to `.done` and
`.fail` like

~~~ js
  $.ajax({
    url: "/someurl",
    method: "GET",
    data: {
      a: "a"
  })
  .done(function(data) {
    console.log('success callback 1', data)
  })
  .done(function(data) {
    console.log('success callback 2', data)
  })
  .fail(function(xhr) {
    console.log('error callback 1', xhr);
  })
  .fail(function(xhr) {
    console.log('error callback 2', xhr);
  });
~~~

This help you to smaller and compact functions, which lead to higher
reusability and lower complexity. Also small functions are easier to unit test.

## Promise can be used to bind callback conditionaly

When I want to do conditional functionality after a ajax call, If I am using an
options I want to do condition checking inside the callback where as when using
`.done` or `.fail` method I can bind the callback conditionaly.

~~~ js
  var jqXhr = $.ajax({
    url: "/someurl",
    method: "GET",
    data: {
      a: "a"
  });

  if (someConditionIstrue) {
    jqXhr
    .done(function(data) {
      console.log('when condition is true', data);
    })
    .fail(function(xhr) {
      console.log('error callback for true condition', xhr);
    });
  } else {
    jqXhr.done(function(data){
      console.log('when condition is false', data);
    })
    .fail(function(xhr) {
      console.log('error callback for false condition', xhr);
    });
  }
~~~

if I want a common callback other than conditional ones, I can bind directly
on `jqXhr` variable outside the if-else block.

~~~ js
  var jqXhr = $.ajax({
    url: "/someurl",
    method: "GET",
    data: {
      a: "a"
  });

  jqXhr
  .done(function(data) {
    console.log('common callback', data);
  })
  .fail(function(xhr) {
    console.log('error common back', xhr);
  });

  // Conditional ones goes here
~~~

If you are intrested, I have a ealier blog post on [conditional callbacks in jQuery](/2014/11/jquery-set-ajax-callbacks-conditionally.html).

Thank You.


text:
function partitionMeta = UVnovo_partition(Meta)
% UVNOVO_PARTITION imports, partitions, and saves spectra & psm data.
%
% @TODO add documentation.
%
%	Vars are saved in a serialized matlab format. The is much more efficient in
%	time and space than standard matlab files, but io.loadSer() is required for
%	opening such files. See io.saveSer for more info.
%

paths = Meta.paths;
params = Meta.params;

%% Import spectra and psm files.

msData = import_spectra(paths.spectra.path, params.pre.import_spectra);
psmData = import_psms(paths.psms.path, 'verbosity',params.UVnovo.verbosity);

% Partition for cross-validation.
nPartitions = params.pre.crossVal.nPartitions;
fprintf(1,'Partitioning spectra and psms into %g cross validation sets ...\n', nPartitions)

partitions = partition_psms(psmData, nPartitions);

% Index between psmData.scans & msData.scans. Assign later to same partitions.
[~, psm2ms] = ismember([psmData.scans.nscan]', [msData.scans.nscan]');
for n = 1:nPartitions
	partitions(n).test.msData =  psm2ms(partitions(n).test.psmData);
	partitions(n).train.msData = psm2ms(partitions(n).train.psmData);
end

% Create and save training and test sets.
%	Initialize variables for saving. We replace 'msData' and 'psmData' with
%	partition-specific data so that the variables are named consistently upon
%	reloading the data.
if ~exist('msData_ORIG', 'var'), msData_ORIG =  msData;  end
if ~exist('psmData_ORIG','var'), psmData_ORIG = psmData; end
msData.scans =  [];
psmData.scans = [];

partitionMeta = struct( ...
	'nPartitions', nPartitions, ...
	'parts', struct( 'n', num2cell(1:nPartitions)' ) ...
	);

for n = 1:nPartitions

	% Create directory for each partition. Make it unique if it already exists.
	t_partitionDir = fullfile(paths.exp.path, sprintf('part%g', n));
	partitionDir = io.genUniquePath( t_partitionDir );
	mkdir(partitionDir)

	fprintf(1, 'Saving partition %g to %s\n', n, partitionDir)

	% Create and save test partition vars.
	% @TODO save test partition as MS2 file. (?)
	Meta.partition.n = n;
	Meta.partition.type = 'test';
	msData.scans = msData_ORIG.scans( partitions(n).test.msData );

	fn_test = sprintf('p%d_Test.mat', n);
	fpath_test = fullfile(partitionDir, fn_test);

	io.saveSer(fpath_test, 'msData', 'Meta')

	% Create and save training partition vars.
	Meta.partition.type = 'train';
	msData.scans =  msData_ORIG.scans(  partitions(n).train.msData  );
	psmData.scans = psmData_ORIG.scans( partitions(n).train.psmData );

	fn_train = sprintf('p%d_Train.mat', n);
	fpath_train = fullfile(partitionDir, fn_train);
	io.saveSer(fpath_train, 'msData', 'psmData', 'Meta')

	Meta = rmfield(Meta, 'partition');

	partitionMeta.parts(n).dir = partitionDir;
	partitionMeta.parts(n).test.file =  fn_test;
	partitionMeta.parts(n).train.file = fn_train;
end

end %MAIN

%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function partitions = partition_psms(psmData, nPartitions)
	% PARTITION_PSMS partitions psms into independent sets for cross validation.
	%	This is based on amino acid sequence and ignores PTM differences.
	%	A random hash for each psm sequence is calculated in import_psms(). We
	%	divide those hashes, by sorted order, into same-sized sets. This method
	%	for partitioning is mostly stable, in that most sequences will be
	%	assigned to the same partition regardless of random differences in the
	%	overall sequence set.

	% Cannot create independent training and test sets without > 1 partitions.
	assert( nPartitions > 1, 'UVnovo:Partition:Singularity', '> 1 partition required')

	[h, ~, ic_hash] = unique([psmData.scans.seqHash]');
	partition = ceil( (1:numel(h)) / (numel(h)/nPartitions) )';

	%	map partition to psmData.scans
	nPsmScans = numel(psmData.scans);
	partition2psmData = accumarray(partition(ic_hash), 1:nPsmScans, [], @(x){x});

	partitions = struct;
	for i = 1:nPartitions
		testPart = false(nPartitions,1);
		testPart(i) = true;

		psmTest = sort(cat(1, partition2psmData{testPart}));
		partitions(i,1).test = struct( ...
			'nscan', [psmData.scans(psmTest).nscan]', ...
			'psmData', psmTest ...
			);

		psmTrain = sort(cat(1, partition2psmData{~testPart}));
		partitions(i,1).train = struct( ...
			'nscan', [psmData.scans(psmTrain).nscan]', ...
			'psmData', psmTrain ...
			);
	end
end


text:
FactoryBot.define do
  trait :gws_portal_portlet_base do
    cur_site { gws_site }
    cur_user { gws_user }

    name { "name-#{unique_id}" }
    limit { 1 }
  end

  trait :gws_portal_schedule_portlet do
    portlet_model { "schedule" }
  end

  trait :gws_portal_notice_portlet do
    portlet_model { "notice" }
  end

  trait :gws_portal_ad_portlet do
    portlet_model { "ad" }
    ad_width { rand(300..400) }
    ad_speed { rand(10..30) }
    ad_pause { rand(60..90) }

    after(:build) do |portlet, evaluator|
      name = "#{unique_id}.png"
      file = SS::TempFile.create_empty!(name: name, filename: name, content_type: 'image/png') do |file|
        ::FileUtils.cp(Rails.root.join("spec/fixtures/ss/logo.png"), file.path)
      end

      portlet.ad_file_ids = [ file.id ]
      portlet.link_urls = { file.id.to_s => "http://#{unique_id}.example.jp/" }
    end
  end

  factory :gws_portal_user_portlet, class: Gws::Portal::UserPortlet, traits: [:gws_portal_portlet_base] do
    portlet_model { '' }
  end

  factory :gws_portal_group_portlet, class: Gws::Portal::GroupPortlet, traits: [:gws_portal_portlet_base] do
    portlet_model { '' }
  end
end


text: export * from "./editor";


text:
import _ from 'lodash';

import Distribution from '../../../src/distributions/point-distribution';

describe('PointDistribution', () => {
  var distribution;
  const options = { type: 'point', value: 300 };

  beforeEach(() => {
    distribution = new Distribution(options);
  });

  describe('#constructor', () => {
    it('has type and value', () => {
      expect(distribution.type).to.equal('point');
      expect(distribution.value).to.equal(300);
    });
  });

  describe('#toJSON', () => {
    it('converts to json', () => {
      expect(distribution.toJSON()).to.deep.equal(options);
    });
  });
});


text:
(function () {
  'use strict';

  /**
   * @ngdoc controller
   * @name SearchTableController
   *
   * @description
   * Controller for the search table.
   * Serves as the focal point for table actions.
   */
  angular
    .module('horizon.dashboard.project.search')
    .controller('searchTableController', SearchTableController);

  SearchTableController.$inject = [
    '$scope',
    '$filter',
    '$timeout',
    'searchPluginResourceTypesFilter',
    'horizon.framework.conf.resource-type-registry.service',
    'horizon.app.core.openstack-service-api.userSession',
    'horizon.dashboard.project.search.searchlightFacetUtils',
    'horizon.dashboard.project.search.searchlightSearchHelper',
    'horizon.dashboard.project.search.resourceLocator',
    'horizon.dashboard.project.search.settingsService'
  ];

  function SearchTableController($scope,
                                 $filter,
                                 $timeout,
                                 searchPluginResourceTypesFilter,
                                 registry,
                                 userSession,
                                 searchlightFacetUtils,
                                 searchlightSearchHelper,
                                 resourceLocator,
                                 searchSettings)
  {
    var ctrl = this;
    ctrl.filter = $filter;
    ctrl.hits = [];
    ctrl.hitsSrc = [];
    ctrl.initialized = false;
    ctrl.resourceLocator = resourceLocator;
    ctrl.searchFacets = [];
    ctrl.excludedTypes = ['OS::Glance::Metadef'];
    ctrl.searchSettings = searchSettings;
    ctrl.defaultResourceTypes = [];
    ctrl.defaultFacets = searchlightFacetUtils.defaultFacets();
    ctrl.registry = registry;
    ctrl.refresh = searchlightSearchHelper.repeatLastSearchWithLatestSettings;
    ctrl.actionResultHandler = actionResultHandler;
    ctrl.userSession = {};

    //ctrl.isNested;

    init();

    ////////////////////////////////

    function init() {
      ctrl.searchSettings.initScope($scope);
      searchlightFacetUtils.initScope($scope);

      if (searchlightSearchHelper.lastSearchQueryOptions) {
        ctrl.searchFacets = searchlightSearchHelper.lastSearchQueryOptions.searchFacets;
      } else {
        ctrl.searchFacets = ctrl.defaultFacets;
      }

      userSession.get()
        .then(function onUserSessionGet(session) {
          ctrl.userSession = session;
        });
    }

    /*function isNested (input) {
      var result = angular.isArray(input) &&
        input.length > 0 &&
        angular.isObject(input[0]) &&
        Object.keys(input[0]).length > 1;

      return result;
    }*/

    var pluginsUpdatedWatcher = $scope.$on(
      ctrl.searchSettings.events.pluginsUpdatedEvent,
      pluginsUpdated
    );

    function pluginsUpdated(event, plugins) {
      var pluginToTypesOptions = {
        excludedTypes: ctrl.excludedTypes,
        flatten: true
      };
      ctrl.defaultResourceTypes = searchPluginResourceTypesFilter(plugins, pluginToTypesOptions);

      ctrl.defaultResourceTypes.forEach(function(type) {
        registry.initActions(type, $scope);
      });

      searchlightFacetUtils.setTypeFacetFromResourceTypes(
        ctrl.defaultResourceTypes, ctrl.searchFacets);

      searchlightFacetUtils.broadcastFacetsChanged(searchlightSearchHelper.lastSearchQueryOptions);

      ctrl.initialized = true;

      if (searchlightSearchHelper.lastSearchQueryOptions) {
        searchlightSearchHelper.lastSearchQueryOptions.onSearchSuccess = onSearchResult;
        searchlightSearchHelper.lastSearchQueryOptions.onSearchError = onSearchResult;
        searchlightSearchHelper.repeatLastSearchWithLatestSettings();
      } else {
        search();
      }
    }

    var fullTextSearchTimeout;
    var searchUpdatedWatcher = $scope.$on('serverSearchUpdated', function (event, searchData) {

      // Magic search always broadcasts this at startup, so
      // we have to not run until we are fully initialized.
      if (!ctrl.initialized) {
        return;
      }

      function performSearch() {
        fullTextSearchTimeout = null;
        search(searchData);
      }

      if (searchData.queryStringChanged) {
        // This keeps the query from being executed too rapidly
        // when the user is performing rapid key presses.
        if (fullTextSearchTimeout) {
          $timeout.cancel(fullTextSearchTimeout);
        }

        fullTextSearchTimeout = $timeout(
          performSearch,
          ctrl.searchSettings.settings.fullTextSearch.delayInMS
        );
      } else if (searchData.magicSearchQueryChanged) {
        performSearch();
      }
    });

    var checkFacetsWatcher = $scope.$on('checkFacets', function (event, selectedFacets) {
      //Facets are actually DOM elements. This affects the styling.
      $timeout(function () {
        angular.forEach(selectedFacets, function setIsServerTrue(facet) {
          facet.isServer = true;
        });
      });
    });

    var searchSettingsUpdatedWatcher = $scope.$on(
      ctrl.searchSettings.events.settingsUpdatedEvent,
      searchlightSearchHelper.repeatLastSearchWithLatestSettings
    );

    $scope.$on('$destroy', function cleanupListeners() {
      checkFacetsWatcher();
      searchUpdatedWatcher();
      searchSettingsUpdatedWatcher();
      pluginsUpdatedWatcher();
    });

    function search(queryOptions) {
      queryOptions = queryOptions || {};
      queryOptions.allFacetDefinitions = ctrl.searchFacets;
      queryOptions.searchFacets = ctrl.searchFacets;
      queryOptions.defaultResourceTypes = ctrl.defaultResourceTypes;
      queryOptions.onSearchSuccess = onSearchResult;
      queryOptions.onSearchError = onSearchResult;

      return searchlightSearchHelper.search(queryOptions);
    }

    function onSearchResult(response) {
      ctrl.hitsSrc = response.hits;
    }

    function actionResultHandler(result) {
      result.then(repeatUntilChangedResults);

      function repeatUntilChangedResults() {
        // For now, all we can do is poll for a period of time.
        searchlightSearchHelper.startAdHocPolling(500, 5000);
      }
    }

  }

})();


text:
package com.frostwire.jlibtorrent.alerts;

import com.frostwire.jlibtorrent.ErrorCode;
import com.frostwire.jlibtorrent.swig.peer_disconnected_alert;

/**
 * This alert is generated when a peer is disconnected for any reason (other than the ones
 * covered by peer_error_alert ).
 *
 * @author gubatron
 * @author aldenml
 */
public final class PeerDisconnectedAlert extends PeerAlert<peer_disconnected_alert> {

    public PeerDisconnectedAlert(peer_disconnected_alert alert) {
        super(alert);
    }

    /**
     * tells you what error caused peer to disconnect.
     *
     * @return
     */
    public ErrorCode getError() {
        return new ErrorCode(alert.getError());
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Lich. univ. (1810)

#### Original name
Verrucaria pyrenophora f. pyrenophora Ach.

### Remarks
null