text:
package eu.lestard.assertj.javafx.api.object;

import eu.lestard.assertj.javafx.internal.TestPerson;
import javafx.beans.binding.Bindings;
import javafx.beans.binding.ObjectBinding;
import javafx.beans.binding.ObjectExpression;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.ReadOnlyObjectProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.beans.value.ObservableObjectValue;
import org.junit.Before;
import org.junit.Test;

import static eu.lestard.assertj.javafx.api.Assertions.*;

public class Object_HasNotNullValue_Test {

    private TestPerson person;

    @Before
    public void setup(){
        person = new TestPerson("Name");
    }

    @Test
    public void testSimpleObjectProperty() {
        SimpleObjectProperty<TestPerson> actual = new SimpleObjectProperty<>(person);
        assertThat(actual).hasNotNullValue();
    }

    @Test
    public void testObjectProperty() {
        ObjectProperty<TestPerson> actual = new SimpleObjectProperty<>(person);
        assertThat(actual).hasNotNullValue();
    }

    @Test
    public void testReadOnlyObjectProperty(){
        ReadOnlyObjectProperty<TestPerson> actual = new SimpleObjectProperty<>(person);
        assertThat(actual).hasNotNullValue();
    }

    @Test
    public void testObjectBinding(){
        final ObjectBinding<TestPerson> actual = Bindings.createObjectBinding(() -> person);

        assertThat(actual).hasNotNullValue();
    }

    @Test
    public void testObjectExpression(){
        final ObjectExpression<TestPerson> actual = Bindings.createObjectBinding(() -> person);

        assertThat(actual).hasNotNullValue();
    }

    @Test
    public void testObservableObjectValue(){
        ObservableObjectValue<TestPerson> actual = new SimpleObjectProperty<>(person);

        assertThat(actual).hasNotNullValue();
    }
}


text:
import json
import pandas as pd

# FILE PATHS
JSON_PATH = "JSON1494284400_PF_MR.json" # path to json file of prefiltered, multiples removed data
WRITE_JSON_PATH = "distributions.json" # path to output distributions

# READ IN JSON DATA -- eventually replaced with call from
with open(JSON_PATH, 'r') as handle:
    data = json.load(handle)

# OPEN UP PATH TO WRITE TO JSON
jsonfile = open(WRITE_JSON_PATH, 'w')

# CREATE DICTIONARY TO STORE FREQUENCIES
freq = {}

# COUNTING FREQUENCIES IN DATA
for hash in range(0, len(data)):
    numHits = len(data[hash]['reduction']) # number of times to iterate through per hash
    for iterator in range(0,numHits-1):
        start = data[hash]['reduction'][iterator]['sensor'] # get starting IntersectionID
        end = data[hash]['reduction'][iterator+1]['sensor'] # get ending IntersectionID
        time = int(data[hash]['reduction'][iterator+1]['time']) - int(data[hash]['reduction'][iterator]['time'])
        path = (start, end)
        if start != end: # making sure that we do not store occurences where it is the same start to end
            if path in freq: # if it exists, add one
                freq[path].append(time)
            else: # else add it to the dictionary as one
                freq[path] = [time]

length = len(freq.keys()) # iterating through to write JSON file
text = '[\n' # store all as text because if you process line by line, it puts the wrong output
for index, i in enumerate(freq.keys()):
    (start, end) = i
    length_2 = len(freq[i])
    time_list = []
    for j in range(0,length_2):
        time = freq[i][j]
        time_list.append(int(time))
    text = text + '{\n'
    text = text + '"start":{},\n"end":{},\n"times":{},\n'.format(start,end,time_list)
    if index != (length - 1):
        text = text + '},\n'
    else:
        text = text + '}'
text = text + ']'

jsonfile.write(text) # write the JSON file
jsonfile.close() # close the stream

redpajama_set_name: RedPajamaGithub


text:
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateBookUserTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('book_user', function(Blueprint $table) {
			$table->increments('id');
			$table->integer('book_id')->unsigned()->index();
			$table->foreign('book_id')->references('id')->on('books')
				  ->onDelete('cascade')
				  ->onUpdate('cascade');
			$table->integer('user_id')->unsigned()->index();
			$table->foreign('user_id')->references('id')->on('users')
				  ->onDelete('cascade')
				  ->onUpdate('cascade');
			$table->boolean('returned')->default(false);
			$table->timestamps();
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('book_user');
	}

}


text:
package org.iotp.infomgt.data.id;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.UUID;

import org.iotp.infomgt.data.common.ThingType;

public class AlarmId extends UUIDBased implements EntityId {

    private static final long serialVersionUID = 1L;

    @JsonCreator
    public AlarmId(@JsonProperty("id") UUID id) {
        super(id);
    }

    public static AlarmId fromString(String alarmId) {
        return new AlarmId(UUID.fromString(alarmId));
    }

    @JsonIgnore
    @Override
    public ThingType getEntityType() {
        return ThingType.ALARM;
    }
}


text:
//
//  KDevices.h
//  KuasarsDevices
//
//  Created by Matteo Novelli on 13/05/13.
//  Copyright (c) 2013 Glass. All rights reserved.
//

#import "KuasarsObject.h"

@class KuasarsQueryParams;

/**
 Class for managing Kuasars Devices
 */
@interface KuasarsDevice : KuasarsObject

/** @name Device attributes */

/** Device unique ID */
@property (nonatomic, readonly) NSString *ID;

/** Device token */
@property (nonatomic) NSString *notificationToken;

/** Device unique identifier */
@property (nonatomic, readonly) NSString *uniqueIdentifier;

/** Notification service of the device */
@property (nonatomic, readonly) NSString *notificationService;

/** This device will receive notifications */
@property (nonatomic) BOOL notificationEnabled;

/** Wildcard field, that could be used by the developer to internal process */
@property (nonatomic) NSDictionary *custom;

/** Object that store application metaData information. Ex appURLs, logoURL...etc */
@property (nonatomic) NSDictionary *metaData;

/** User identifier */
@property (nonatomic, readonly) NSString *userID;

/**
 @name Constructors
 */

/**
 Returns an KuasarsDevice object initialized by the JSON object returned by the server.
 @param response Dictionary returned by the server
 @return New instance of KuasarsDevice
 */
- (KS_INSTANCETYPE)initWithServerResponse:(NSDictionary *)response;

/**
 Returns a KuasarsDevice object
 @param token Device notification token
 @param notificationEnabled Boolean indicating if push notifications are enabled
 @return New instance of KuasarsUser
 */
- (KS_INSTANCETYPE)initWithNotificationToken:(NSString *)token notificationEnabled:(BOOL)notificationEnabled;

/**
 @name Creating, updating and deleting
 */

/**
 Creates new device object on Kuasars servers using current object as new device. If current device already exists on Kuasars,
 it will updated with current object data.
 @param completion Block with server response
 */
-(void)save:(void(^)(KuasarsResponse *object, KuasarsError *error))completion;

/**
 Removes current device object from Kuasar servers
 @param completion Block with server response
 */
-(void)delete:(void(^)(KuasarsResponse *object, KuasarsError *error))completion;

/**
 @name Getting devices
 */

/**
 Returns advanced information about a given device
 @param deviceID Device identifier
 @param completion Handler with server response
 */
+ (void)getDeviceWithID:(NSString *)deviceID completion:(void(^)(KuasarsResponse *object, KuasarsError *error))completion;

@end


text:
package org.keycloak.testsuite.arquillian.undertow;

import org.jboss.arquillian.container.spi.client.container.DeployableContainer;
import org.jboss.arquillian.container.test.spi.client.deployment.ApplicationArchiveProcessor;
import org.jboss.arquillian.core.spi.LoadableExtension;
import org.keycloak.testsuite.arquillian.undertow.container.UndertowDeploymentArchiveProcessor;

/**
 * @author Vlasta Ramik
 */
public class UndertowAppServerArquillianExtension implements LoadableExtension {

    @Override
    public void register(ExtensionBuilder builder) {
        builder
                .service(DeployableContainer.class, UndertowAppServer.class)
                .service(ApplicationArchiveProcessor.class, UndertowDeploymentArchiveProcessor.class);

    }

}


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

<TITLE>
BTree (JDBM JavaDoc)
</TITLE>

<META NAME="date" CONTENT="2010-07-13">

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

      Overview
      Package
    Class
      Tree
      Deprecated
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

jdbm.btree

Class BTree<K,V>

java.lang.Object
  jdbm.btree.BTree<K,V>

All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, JdbmBase<K,V>

public class BTree<K,V>
extends java.lang.Object
implements java.io.Externalizable, JdbmBase<K,V>

B+Tree persistent indexing data structure.  B+Trees are optimized for
 block-based, random I/O storage because they store multiple keys on
 one tree node (called BPage).  In addition, the leaf nodes
 directly contain (inline) the values associated with the keys, allowing a
 single (or sequential) disk read of all the values on the page.

 B+Trees are n-airy, yeilding log(N) search cost.  They are self-balancing,
 preventing search performance degradation when the size of the tree grows.

 Keys and associated values must be Serializable objects. The
 user is responsible to supply a serializable Comparator object
 to be used for the ordering of entries, which are also called Tuple.
 The B+Tree allows traversing the keys in forward and reverse order using a
 TupleBrowser obtained from the browse() methods.

 This implementation does not directly support duplicate keys, but it is
 possible to handle duplicates by inlining or referencing an object collection
 as a value.

 There is no limit on key size or value size, but it is recommended to keep
 both as small as possible to reduce disk I/O.   This is especially true for
 the key size, which impacts all non-leaf BPage objects.

Version:

$Id: BTree.java,v 1.6 2005/06/25 23:12:31 doomdark Exp $

Author:

Alex Boisvert

See Also:
Serialized Form

Nested Class Summary

(package private) static class
BTree.EmptyBrowser<K,V>

          PRIVATE INNER CLASS
  Browser returning no element.

Field Summary

protected  java.util.Comparator<K>
_comparator

          Comparator used to index entries.

protected  int
_entries

          Total number of entries in the BTree

protected  int
_pageSize

          Number of entries in each BPage.

protected  RecordManager
_recman

          Page manager used to persist changes in BPages

static int
DEFAULT_SIZE

          Default page size (number of entries per node)

protected  Serializer<K>
keySerializer

          Serializer used to serialize index keys (optional)

protected  java.util.List<RecordListener<K,V>>
recordListeners

          Listeners which are notified about changes in records

protected  Serializer<V>
valueSerializer

          Serializer used to serialize index values (optional)

Constructor Summary

BTree()

          No-argument constructor used by serialization.

Method Summary

 void
addRecordListener(RecordListener<K,V> listener)

          add RecordListener which is notified about record changes

 BTreeSortedMap<K,V>
asMap()

 TupleBrowser<K,V>
browse()

          Get a browser initially positioned at the beginning of the BTree.

 TupleBrowser<K,V>
browse(K key)

          Get a browser initially positioned just before the given key.

static

<K extends java.lang.Comparable,V>

BTree<K,V>

createInstance(RecordManager recman)

          Create a new persistent BTree, with 16 entries per node.

static

<K,V> BTree<K,V>

createInstance(RecordManager recman,
               java.util.Comparator<K> comparator)

          Create a new persistent BTree, with 16 entries per node.

static

<K,V> BTree<K,V>

createInstance(RecordManager recman,
               java.util.Comparator<K> comparator,
               Serializer<K> keySerializer,
               Serializer<V> valueSerializer)

          Create a new persistent BTree, with 16 entries per node.

static

<K,V> BTree<K,V>

createInstance(RecordManager recman,
               java.util.Comparator<K> comparator,
               Serializer<K> keySerializer,
               Serializer<V> valueSerializer,
               int pageSize)

          Create a new persistent BTree with the given number of entries per node.

 void
delete()

          Deletes all BPages in this BTree, then deletes the tree from the record manager

(package private)  void
dumpChildPageRecIDs(java.util.List<java.lang.Long> out)

          Used for debugging and testing only.

 V
find(K key)

          Find the value associated with the given key.

 Tuple<K,V>
findGreaterOrEqual(K key)

          Find the value associated with the given key, or the entry immediately
 following this key in the ordered BTree.

 Serializer<K>
getKeySerializer()

 long
getRecid()

          Return the persistent record identifier of the BTree.

 RecordManager
getRecordManager()

(package private)  BPage<K,V>
getRoot()

          Return the root BPage, or null if it doesn't exist.

 Serializer<V>
getValueSerializer()

 V
insert(K key,
       V value,
       boolean replace)

          Insert an entry in the BTree.

static

<K,V> BTree<K,V>

load(RecordManager recman,
     long recid)

          Load a persistent BTree.

 void
readExternal(java.io.ObjectInput in)

          Implement Externalizable interface.

 V
remove(K key)

          Remove an entry with the given key from the BTree.

 void
removeRecordListener(RecordListener<K,V> listener)

          remove RecordListener which is notified about record changes

 void
setKeySerializer(Serializer<K> keySerializer)

 void
setValueSerializer(Serializer<V> valueSerializer)

 int
size()

          Return the number of entries (size) of the BTree.

 void
writeExternal(java.io.ObjectOutput out)

          Implement Externalizable interface.

Methods inherited from class java.lang.Object

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

Field Detail

DEFAULT_SIZE

public static final int DEFAULT_SIZE

Default page size (number of entries per node)

See Also:
Constant Field Values

_recman

protected transient RecordManager _recman

Page manager used to persist changes in BPages

_comparator

protected java.util.Comparator<K> _comparator

Comparator used to index entries.

keySerializer

protected Serializer<K> keySerializer

Serializer used to serialize index keys (optional)

valueSerializer

protected Serializer<V> valueSerializer

Serializer used to serialize index values (optional)

_pageSize

protected int _pageSize

Number of entries in each BPage.

_entries

protected int _entries

Total number of entries in the BTree

recordListeners

protected java.util.List<RecordListener<K,V>> recordListeners

Listeners which are notified about changes in records

Constructor Detail

BTree

public BTree()

No-argument constructor used by serialization.

Method Detail

getKeySerializer

public Serializer<K> getKeySerializer()

setKeySerializer

public void setKeySerializer(Serializer<K> keySerializer)

getValueSerializer

public Serializer<V> getValueSerializer()

setValueSerializer

public void setValueSerializer(Serializer<V> valueSerializer)

createInstance

public static <K,V> BTree<K,V> createInstance(RecordManager recman,
                                              java.util.Comparator<K> comparator)
                                 throws java.io.IOException

Create a new persistent BTree, with 16 entries per node.

Parameters:
recman - Record manager used for persistence.
comparator - Comparator used to order index entries

Throws:

java.io.IOException

createInstance

public static <K extends java.lang.Comparable,V> BTree<K,V> createInstance(RecordManager recman)
                                                              throws java.io.IOException

Create a new persistent BTree, with 16 entries per node.

Parameters:
recman - Record manager used for persistence.
comparator - Comparator used to order index entries

Throws:

java.io.IOException

createInstance

public static <K,V> BTree<K,V> createInstance(RecordManager recman,
                                              java.util.Comparator<K> comparator,
                                              Serializer<K> keySerializer,
                                              Serializer<V> valueSerializer)
                                 throws java.io.IOException

Create a new persistent BTree, with 16 entries per node.

Parameters:
recman - Record manager used for persistence.
keySerializer - Serializer used to serialize index keys (optional)
valueSerializer - Serializer used to serialize index values (optional)
comparator - Comparator used to order index entries

Throws:

java.io.IOException

createInstance

public static <K,V> BTree<K,V> createInstance(RecordManager recman,
                                              java.util.Comparator<K> comparator,
                                              Serializer<K> keySerializer,
                                              Serializer<V> valueSerializer,
                                              int pageSize)
                                 throws java.io.IOException

Create a new persistent BTree with the given number of entries per node.

Parameters:
recman - Record manager used for persistence.
comparator - Comparator used to order index entries
keySerializer - Serializer used to serialize index keys (optional)
valueSerializer - Serializer used to serialize index values (optional)
pageSize - Number of entries per page (must be even).

Throws:

java.io.IOException

load

public static <K,V> BTree<K,V> load(RecordManager recman,
                                    long recid)
                       throws java.io.IOException

Load a persistent BTree.

Parameters:
recman - RecordManager used to store the persistent btree
recid - Record id of the BTree

Throws:

java.io.IOException

insert

public V insert(K key,
                V value,
                boolean replace)
         throws java.io.IOException

Insert an entry in the BTree.

 The BTree cannot store duplicate entries.  An existing entry can be
 replaced using the replace flag.   If an entry with the
 same key already exists in the BTree, its value is returned.

Parameters:
key - Insert key
value - Insert value
replace - Set to true to replace an existing key-value pair.

Returns:
Existing value, if any.

Throws:

java.io.IOException

remove

public V remove(K key)
         throws java.io.IOException

Remove an entry with the given key from the BTree.

Parameters:
key - Removal key

Returns:
Value associated with the key, or null if no entry with given
         key existed in the BTree.

Throws:

java.io.IOException

find

public V find(K key)
       throws java.io.IOException

Find the value associated with the given key.

Specified by:
find in interface JdbmBase<K,V>

Parameters:
key - Lookup key.

Returns:
Value associated with the key, or null if not found.

Throws:

java.io.IOException

findGreaterOrEqual

public Tuple<K,V> findGreaterOrEqual(K key)
                              throws java.io.IOException

Find the value associated with the given key, or the entry immediately
 following this key in the ordered BTree.

Parameters:
key - Lookup key.

Returns:
Value associated with the key, or a greater entry, or null if no
         greater entry was found.

Throws:

java.io.IOException

browse

public TupleBrowser<K,V> browse()
                         throws java.io.IOException

Get a browser initially positioned at the beginning of the BTree.

 WARNING: �If you make structural modifications to the BTree during
 browsing, you will get inconsistent browing results.

Returns:
Browser positionned at the beginning of the BTree.

Throws:

java.io.IOException

browse

public TupleBrowser<K,V> browse(K key)
                         throws java.io.IOException

Get a browser initially positioned just before the given key.

 WARNING: �If you make structural modifications to the BTree during
 browsing, you will get inconsistent browing results.

Parameters:
key - Key used to position the browser.  If null, the browser
            will be positionned after the last entry of the BTree.
            (Null is considered to be an "infinite" key)

Returns:
Browser positionned just before the given key.

Throws:

java.io.IOException

size

public int size()

Return the number of entries (size) of the BTree.

getRecid

public long getRecid()

Return the persistent record identifier of the BTree.

getRoot

BPage<K,V> getRoot()
             throws java.io.IOException

Return the root BPage, or null if it doesn't exist.

Throws:

java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException

Implement Externalizable interface.

Specified by:
readExternal in interface java.io.Externalizable

Throws:

java.io.IOException

java.lang.ClassNotFoundException

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException

Implement Externalizable interface.

Specified by:
writeExternal in interface java.io.Externalizable

Throws:

java.io.IOException

asMap

public BTreeSortedMap<K,V> asMap()

addRecordListener

public void addRecordListener(RecordListener<K,V> listener)

add RecordListener which is notified about record changes

Specified by:
addRecordListener in interface JdbmBase<K,V>

Parameters:
listener -

removeRecordListener

public void removeRecordListener(RecordListener<K,V> listener)

remove RecordListener which is notified about record changes

Specified by:
removeRecordListener in interface JdbmBase<K,V>

Parameters:
listener -

getRecordManager

public RecordManager getRecordManager()

Specified by:
getRecordManager in interface JdbmBase<K,V>

Returns:
underlying record manager

delete

public void delete()
            throws java.io.IOException

Deletes all BPages in this BTree, then deletes the tree from the record manager

Throws:

java.io.IOException

dumpChildPageRecIDs

void dumpChildPageRecIDs(java.util.List<java.lang.Long> out)
                   throws java.io.IOException

Used for debugging and testing only.  Populates the 'out' list with
 the recids of all child pages in the BTree.

Parameters:
out -

Throws:

java.io.IOException

      Overview
      Package
    Class
      Tree
      Deprecated
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

Cees de Groot (C) 2000-2001. All rights reserved  http://jdbm.sourceforge.net


text:
package de.medusalix.biblios.controls;

import de.medusalix.biblios.Consts;
import de.medusalix.biblios.database.objects.BorrowedBook;
import javafx.scene.control.TableCell;
import javafx.scene.image.ImageView;

public class BorrowedBookExceededCell extends TableCell<BorrowedBook, Boolean>
{
    private ImageView imageView = new ImageView();

    @Override
    protected void updateItem(Boolean item, boolean empty)
    {
        super.updateItem(item, empty);

        if (empty)
        {
            setGraphic(null);

            return;
        }

        setGraphic(imageView);

        imageView.setImage(item ? Consts.Images.EXCEEDED : Consts.Images.NOT_EXCEEDED);
    }
}


text:
define([
    "dojo/_base/declare",
    'dijit/registry',
    "dojo/_base/array",
    "gridx/Grid",
    "dojo/store/Memory",
    "dojo/dom",
    "gridx/core/model/cache/Sync",
    "dojo/dom-construct",
    "dijit/registry",
    'gridx/allModules',
    "MenuCommandes"
], function(declare,registry,array,Grid,Memory,dom,Cache,domConstruct,registry,modules,MenuCommandes){
return declare("GrilleActions", Grid,{
        loadingMessage: 'Chargement en cours ...',
        noDataMessage: 'Aucun résultat trouvé.',
//        autoHeight: true,
//        selectRowTriggerOnCell: true,
//        singleClickEdit: true,
	autoWidth: true,
        selectRowMultiple: false,
        selectRowTriggerOnCell: true,
        cacheClass: Cache,
        store : new Memory({ data: null}),
        modules: [
                    modules.VirtualVScroller,
                    modules.IndirectSelect,
                    modules.SingleSort,
                    modules.RowHeader,
                    modules.SelectRow,
                    modules.SelectColumn,
                    modules.Filter,
                    modules.FilterBar,
                    modules.QuickFilter,
                    modules.Menu,
                ],
        structure: [
                {field: 'sujet',name: 'Sujet',datatype: "string",width:'150px'},
                {field: 'createdAt',name: 'Date',datatype: "string",width:'100px'},
                {field: 'contact',name: 'Contact',datatype: "string",width:'100px'}
            ],
        class: 'grillecommandes',
        constructor: function(){
            _this = this;
        },
	postCreate: function(){
            this.inherited(arguments);
	},
        onRowClick: function(evt){

        },
	RemoveElement : function(iddevis,dossier){
                this.store.remove(iddevis);
	},
    });
});


text:
backup_dir="/var/www/backup" #先這樣
time="$(date +"%d-%m-%Y")"
sqlname="$backup_dir/backlink_$time.sql"
test ! -w $backup_dir && echo "Error: $backup_dir is un-writeable." && exit 0
mysqldump -uroot -pkpnseo1234567 backlinks_system > $sqlname
exit 0


text:
package bank;

public class Instrument {
   private int amount;
   private Currency currency;

    public Instrument(int amount, Currency currency) {
        this.amount = amount;
        this.currency = currency;
    }

    public int getAmount() {
        return amount;
    }

    public Currency getCurrency() {
        return currency;
    }

    public void setAmount(int amount) {
        this.amount = amount;
    }

}


text:
team
====

Team Analytics Of A Github Organization


text:
/**
 * External dependencies
 */
import { useCallback, useMemo } from '@googleforcreators/react';
import { List, THEME_CONSTANTS } from '@googleforcreators/design-system';

/**
 * Internal dependencies
 */
import { states, useHighlights } from '../../../app/highlights';
import { useStory } from '../../../app';
import { ChecklistCard, ChecklistCardStyles } from '../../checklistCard';
import { PRIORITY_COPY } from '../constants';
import { hasNoFeaturedMedia } from '../utils';
import { useRegisterCheck } from '../countContext';
import { useIsChecklistMounted } from '../popupMountedContext';

export function storyHasNoPosterAttached(featuredMedia) {
  return (
    typeof featuredMedia?.url !== 'string' ||
    hasNoFeaturedMedia({ featuredMedia })
  );
}

export function StoryPosterAttached() {
  const isChecklistMounted = useIsChecklistMounted();
  const featuredMedia = useStory(({ state }) => state?.story?.featuredMedia);
  const setHighlights = useHighlights(({ setHighlights }) => setHighlights);
  const handleClick = useCallback(
    () =>
      setHighlights({
        highlight: states.POSTER,
      }),
    [setHighlights]
  );

  const isRendered = useMemo(
    () => storyHasNoPosterAttached(featuredMedia),
    [featuredMedia]
  );
  useRegisterCheck('StoryPosterAttached', isRendered);

  const { title, footer } = PRIORITY_COPY.storyMissingPoster;
  return isRendered && isChecklistMounted ? (
    <ChecklistCard
      title={title}
      titleProps={{
        onClick: handleClick,
      }}
      footer={
        <ChecklistCardStyles.CardListWrapper>
          <List size={THEME_CONSTANTS.TYPOGRAPHY.PRESET_SIZES.X_SMALL}>
            {footer}
          </List>
        </ChecklistCardStyles.CardListWrapper>
      }
    />
  ) : null;
}


text:
<!doctype html>

    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>ZEJIAN /// SHEN</title>
    <link rel="stylesheet" href="build/app.css" />