text:
<!DOCTYPE html>

    <title>FPRatingInfo Class Reference</title>
    <link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
    <link rel="stylesheet" type="text/css" href="../css/highlight.css" />
    <meta charset='utf-8'>

 Docs (100% documented)

         Reference

        FPRatingInfo Class Reference

            Classes

                FPAPIConnector

                FPAPILogger

                FPAccountManager

                FPBasicObject

                FPCode

                FPCodeManager

                FPConfigManager

                FPMenuItem

                FPModelObject

                FPMovieCategory

                FPMovieItem

                FPMovieLoader

                FPMovieMarker

                FPMoviePlaylist

                FPNotification

                FPNotificationLoader

                FPRatingInfo

                FPRatingManager

                FPRatingQA

                FPSVODPackage

                FPService

                FPSessionManager

                FPTVODPackage

                FPTrailerMovieItem

                FPTransactionManager

                FPUser

                FPVipStatus

                FimPlusSDK

            Enumerations

                FPDisplayMode

                FPEnviroment

                FPMovieAudioType

                FPMovieImageType

                FPMovieResolution

                FPOTPPurpose

                FPServiceType

                FPUserMovieListType

            Structures

                FPHomeObject

                FPMechantKey

                FPMovieProgress

                FPMovieRating

            Type Aliases

                APIConnectorCompletionBlock

                APIConnectorFailureBlock

                APIConnectorProgressBlock

                APIConnectorResultBlock

FPRatingInfo

public class FPRatingInfo: FPModelObject

Class chứa thông tin đánh giá phim

                    id

id của mục đánh giá

Declaration

Swift

public var id : String! = ""

                    title

Tựa đề của mục đánh giá

Declaration

Swift

public var title : String! = ""

                    message

Thông điệp của mục đánh giá

Declaration

Swift

public var message	: String! = ""

                    thanksTitle

Tựa đề câu cám ơn của mục đánh giá

Declaration

Swift

public var thanksTitle : String! = ""

                    thanksMessage

Thông điệp cám ơn của mục đánh giá

Declaration

Swift

public var thanksMessage : String! = ""

                    ratingQAs

Các câu hỏi và từ khóa trả lời cho từng thang điểm đánh giá

Declaration

Swift

public var ratingQAs : [Int: FPRatingQA]! = [:]

                    ratingQA(forPoint:)

Lấy nội dung câu hỏi - trả lời cho thang điểm tương ứng

Declaration

Swift

public func ratingQA(forPoint point:Int) -> FPRatingQA?

Parameters

                                point

Số điểm để lấy câu hỏi

Return Value

PFRatingQA: Câu hỏi - trả lời tương ứng với số điểm

                    description

Mô tả object

Declaration

Swift

override public var description : String

© 2018 Nam Kennic. All rights reserved. (Last updated: 2018-04-03)

Generated by jazzy ♪♫ v0.9.1, a Realm project.

redpajama_set_name: RedPajamaGithub


text:
cadastre
========

a ledger for what mysql is doing at any given moment


text:
package com.google.cloud.tools.eclipse.appengine.compat.gpe;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;

import com.google.cloud.tools.eclipse.test.util.project.ProjectUtils;
import java.io.IOException;
import java.util.Map;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.wst.common.project.facet.core.IFacetedProject;
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

/** Migrates a faceted GPE project. */
public class GpeFacetedMigratorTest {

  private final IProgressMonitor monitor = new NullProgressMonitor();

  private IProject gpeProject;

  @Before
  public void setUp() throws IOException, CoreException {
    Map<String, IProject> projects =
        ProjectUtils.importProjects(
            getClass(),
            "test-projects/GPE-faceted-project.zip",
            false /* checkBuildErrors */,
            monitor);
    assertEquals(1, projects.size());
    gpeProject = projects.values().iterator().next();
  }

  @After
  public void tearDown() throws CoreException {
    gpeProject.delete(true /* force */,  monitor);
  }

  @Test
  public void testRemoveGpeNature() throws CoreException {
    assertTrue(gpeProject.hasNature("com.google.appengine.eclipse.core.gaeNature"));

    assertTrue(GpeMigrator.removeGpeNature(gpeProject, monitor));
    assertFalse(gpeProject.hasNature("com.google.appengine.eclipse.core.gaeNature"));

    assertFalse(GpeMigrator.removeGpeNature(gpeProject, monitor));
  }

  @Test
  public void testRemoveGpeRuntimeAndFacets_facetsRemoved() throws CoreException {
    IFacetedProject facetedProject = ProjectFacetsManager.create(gpeProject);

    assertTrue(containsFacet(facetedProject, "com.google.appengine.facet"));
    assertTrue(containsFacet(facetedProject, "com.google.appengine.facet.ear"));

    assertTrue(GpeMigrator.removeGpeRuntimeAndFacets(facetedProject));
    assertFalse(containsFacet(facetedProject, "com.google.appengine.facet"));
    assertFalse(containsFacet(facetedProject, "com.google.appengine.facet.ear"));

    assertFalse(GpeMigrator.removeGpeRuntimeAndFacets(facetedProject));
  }

  @Test
  public void testRemoveGpeRuntimeAndFacets_runtimeRemoved() throws CoreException {
    IFacetedProject facetedProject = ProjectFacetsManager.create(gpeProject);

    assertEquals(1, facetedProject.getTargetedRuntimes().size());
    assertEquals("Google App Engine", facetedProject.getPrimaryRuntime().getName());
    assertEquals("Google App Engine",
        facetedProject.getTargetedRuntimes().iterator().next().getName());

    assertTrue(GpeMigrator.removeGpeRuntimeAndFacets(facetedProject));
    assertNull(facetedProject.getPrimaryRuntime());
    assertTrue(facetedProject.getTargetedRuntimes().isEmpty());

    assertFalse(GpeMigrator.removeGpeRuntimeAndFacets(facetedProject));
  }

  @Test
  public void testRemoveGpeRuntimeAndFacets_metadataFileDoesNotExist() throws CoreException {
    IFile metadataFile =
        gpeProject.getFile(".settings/org.eclipse.wst.common.project.facet.core.xml");
    metadataFile.delete(true, monitor);
    assertFalse(metadataFile.exists());

    IFacetedProject facetedProject = ProjectFacetsManager.create(gpeProject);
    assertFalse(GpeMigrator.removeGpeRuntimeAndFacets(facetedProject));
  }

  @Test
  public void testRemoveGpeClasspathEntries() throws JavaModelException {
    IJavaProject javaProject = JavaCore.create(gpeProject);

    assertTrue(containsLibrary(javaProject, "com.google.appengine.eclipse.core.GAE_CONTAINER"));
    assertTrue(containsLibrary(javaProject, "com.google.appengine.eclipse.wtp.GAE_WTP_CONTAINER"));
    assertTrue(containsLibrary(javaProject, "org.eclipse.jst.server.core.container/"
        + "com.google.appengine.server.runtimeTarget/Google App Engine"));
    assertTrue(containsLibrary(javaProject,
        "com.google.gdt.eclipse.managedapis.MANAGED_API_CONTAINER/compute-v1r150lv1.21.0"));

    assertTrue(GpeMigrator.removeGpeClasspathEntries(gpeProject, monitor));
    assertFalse(containsLibrary(javaProject, "com.google.appengine.eclipse.core.GAE_CONTAINER"));
    assertFalse(containsLibrary(javaProject, "com.google.appengine.eclipse.wtp.GAE_WTP_CONTAINER"));
    assertFalse(containsLibrary(javaProject, "org.eclipse.jst.server.core.container/"
        + "com.google.appengine.server.runtimeTarget/Google App Engine"));
    assertFalse(containsLibrary(javaProject,
        "com.google.gdt.eclipse.managedapis.MANAGED_API_CONTAINER/compute-v1r150lv1.21.0"));

    assertFalse(GpeMigrator.removeGpeClasspathEntries(gpeProject, monitor));
  }

  private static boolean containsFacet(IFacetedProject facetedProject, String facetId) {
    for (IProjectFacetVersion facet : facetedProject.getProjectFacets()) {
      if (facet.getProjectFacet().getId().equals(facetId)) {
        return true;
      }
    }
    return false;
  }

  private static boolean containsLibrary(IJavaProject javaProject, String libraryPath)
      throws JavaModelException {
    for (IClasspathEntry entry : javaProject.getRawClasspath()) {
      if (entry.getPath().equals(new Path(libraryPath))) {
        return true;
      }
    }
    return false;
  }
}


text:
#include <QtGui/QApplication>
#include "keysequencelabel.h"
//start
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    KeySequenceLabel mw;
    mw.show();
    return a.exec(); /* Enter the event loop */
}
//end


text:
static void freeShader(void* shaderPointer);
static void freeSet(void* setPointer);

ShovelerShaderCache* shovelerShaderCacheCreate() {
  return shovelerShaderCacheCreateWithCustomFree(freeShader);
}

ShovelerShaderCache* shovelerShaderCacheCreateWithCustomFree(
    ShovelerShaderCacheFreeShaderFunction* freeShader) {
  ShovelerShaderCache* cache = malloc(sizeof(ShovelerShaderCache));
  cache->shaders =
      g_hash_table_new_full(shovelerShaderKeyHash, shovelerShaderKeyEqual, NULL, freeShader);
  cache->sceneShaderKeys = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, freeSet);
  cache->cameraShaderKeys = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, freeSet);
  cache->lightShaderKeys = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, freeSet);
  cache->modelShaderKeys = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, freeSet);
  cache->materialShaderKeys = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, freeSet);
  cache->userDataShaderKeys = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, freeSet);

  return cache;
}

void shovelerShaderCacheInsert(ShovelerShaderCache* cache, ShovelerShader* shader) {
  g_hash_table_insert(cache->shaders, &shader->key, shader);

  GHashTable* sceneKeys = g_hash_table_lookup(cache->sceneShaderKeys, shader->key.scene);
  if (sceneKeys == NULL) {
    sceneKeys = g_hash_table_new(shovelerShaderKeyHash, shovelerShaderKeyEqual);
    g_hash_table_insert(cache->sceneShaderKeys, shader->key.scene, sceneKeys);
  }
  g_hash_table_add(sceneKeys, &shader->key);

  GHashTable* cameraKeys = g_hash_table_lookup(cache->cameraShaderKeys, shader->key.camera);
  if (cameraKeys == NULL) {
    cameraKeys = g_hash_table_new(shovelerShaderKeyHash, shovelerShaderKeyEqual);
    g_hash_table_insert(cache->cameraShaderKeys, shader->key.camera, cameraKeys);
  }
  g_hash_table_add(cameraKeys, &shader->key);

  GHashTable* lightKeys = g_hash_table_lookup(cache->lightShaderKeys, shader->key.light);
  if (lightKeys == NULL) {
    lightKeys = g_hash_table_new(shovelerShaderKeyHash, shovelerShaderKeyEqual);
    g_hash_table_insert(cache->lightShaderKeys, shader->key.light, lightKeys);
  }
  g_hash_table_add(lightKeys, &shader->key);

  GHashTable* modelKeys = g_hash_table_lookup(cache->modelShaderKeys, shader->key.model);
  if (modelKeys == NULL) {
    modelKeys = g_hash_table_new(shovelerShaderKeyHash, shovelerShaderKeyEqual);
    g_hash_table_insert(cache->modelShaderKeys, shader->key.model, modelKeys);
  }
  g_hash_table_add(modelKeys, &shader->key);

  GHashTable* materialKeys = g_hash_table_lookup(cache->materialShaderKeys, shader->key.material);
  if (materialKeys == NULL) {
    materialKeys = g_hash_table_new(shovelerShaderKeyHash, shovelerShaderKeyEqual);
    g_hash_table_insert(cache->materialShaderKeys, shader->key.material, materialKeys);
  }
  g_hash_table_add(materialKeys, &shader->key);

  GHashTable* userDataKeys = g_hash_table_lookup(cache->userDataShaderKeys, shader->key.userData);
  if (userDataKeys == NULL) {
    userDataKeys = g_hash_table_new(shovelerShaderKeyHash, shovelerShaderKeyEqual);
    g_hash_table_insert(cache->userDataShaderKeys, shader->key.userData, userDataKeys);
  }
  g_hash_table_add(userDataKeys, &shader->key);
}

bool shovelerShaderCacheRemove(ShovelerShaderCache* cache, const ShovelerShaderKey* shaderKey) {
  ShovelerShader* shader = g_hash_table_lookup(cache->shaders, shaderKey);
  if (shader == NULL) {
    return false;
  }

  GHashTable* sceneKeys = g_hash_table_lookup(cache->sceneShaderKeys, shaderKey->scene);
  assert(sceneKeys != NULL);
  bool sceneKeyRemoved = g_hash_table_remove(sceneKeys, shaderKey);
  assert(sceneKeyRemoved);

  GHashTable* cameraKeys = g_hash_table_lookup(cache->cameraShaderKeys, shaderKey->camera);
  assert(cameraKeys != NULL);
  bool cameraKeyRemoved = g_hash_table_remove(cameraKeys, shaderKey);
  assert(cameraKeyRemoved);

  GHashTable* lightKeys = g_hash_table_lookup(cache->lightShaderKeys, shaderKey->light);
  assert(lightKeys != NULL);
  bool lightKeyRemoved = g_hash_table_remove(lightKeys, shaderKey);
  assert(lightKeyRemoved);

  GHashTable* modelKeys = g_hash_table_lookup(cache->modelShaderKeys, shaderKey->model);
  assert(modelKeys != NULL);
  bool modelKeyRemoved = g_hash_table_remove(modelKeys, shaderKey);
  assert(modelKeyRemoved);

  GHashTable* materialKeys = g_hash_table_lookup(cache->materialShaderKeys, shaderKey->material);
  assert(materialKeys != NULL);
  bool materialKeyRemoved = g_hash_table_remove(materialKeys, shaderKey);
  assert(materialKeyRemoved);

  GHashTable* userDataKeys = g_hash_table_lookup(cache->userDataShaderKeys, shaderKey->userData);
  assert(userDataKeys != NULL);
  bool userDataKeyRemoved = g_hash_table_remove(userDataKeys, shaderKey);
  assert(userDataKeyRemoved);

  // make sure we remove the shader itself last, because the key tables use the shader key from the
  // stored shader
  g_hash_table_remove(cache->shaders, shaderKey);
  return true;
}

ShovelerShader* shovelerShaderCacheLookup(
    ShovelerShaderCache* cache, const ShovelerShaderKey* shaderKey) {
  return g_hash_table_lookup(cache->shaders, shaderKey);
}

void shovelerShaderCacheInvalidateScene(
    ShovelerShaderCache* cache, struct ShovelerSceneStruct* scene) {
  GHashTable* sceneKeys = g_hash_table_lookup(cache->sceneShaderKeys, scene);
  if (sceneKeys != NULL) {
    // get keys list because the keys set will be modified while we iterate over the list
    GList* sceneKeysList = g_hash_table_get_keys(sceneKeys);
    for (GList* iter = sceneKeysList; iter != NULL; iter = iter->next) {
      const ShovelerShaderKey* shaderKey = iter->data;
      bool removed = shovelerShaderCacheRemove(cache, shaderKey);
      assert(removed);
    }
    g_list_free(sceneKeysList);
    g_hash_table_remove(cache->sceneShaderKeys, scene);
  }
}

void shovelerShaderCacheInvalidateCamera(ShovelerShaderCache* cache, ShovelerCamera* camera) {
  GHashTable* cameraKeys = g_hash_table_lookup(cache->cameraShaderKeys, camera);
  if (cameraKeys != NULL) {
    // get keys list because the keys set will be modified while we iterate over the list
    GList* cameraKeysList = g_hash_table_get_keys(cameraKeys);
    for (GList* iter = cameraKeysList; iter != NULL; iter = iter->next) {
      const ShovelerShaderKey* shaderKey = iter->data;
      bool removed = shovelerShaderCacheRemove(cache, shaderKey);
      assert(removed);
    }
    g_list_free(cameraKeysList);
    g_hash_table_remove(cache->cameraShaderKeys, camera);
  }
}

void shovelerShaderCacheInvalidateLight(ShovelerShaderCache* cache, ShovelerLight* light) {
  GHashTable* lightKeys = g_hash_table_lookup(cache->lightShaderKeys, light);
  if (lightKeys != NULL) {
    // get keys list because the keys set will be modified while we iterate over the list
    GList* lightKeysList = g_hash_table_get_keys(lightKeys);
    for (GList* iter = lightKeysList; iter != NULL; iter = iter->next) {
      const ShovelerShaderKey* shaderKey = iter->data;
      bool removed = shovelerShaderCacheRemove(cache, shaderKey);
      assert(removed);
    }
    g_list_free(lightKeysList);
    g_hash_table_remove(cache->lightShaderKeys, light);
  }
}

void shovelerShaderCacheInvalidateModel(ShovelerShaderCache* cache, ShovelerModel* model) {
  GHashTable* modelKeys = g_hash_table_lookup(cache->modelShaderKeys, model);
  if (modelKeys != NULL) {
    // get keys list because the keys set will be modified while we iterate over the list
    GList* modelKeysList = g_hash_table_get_keys(modelKeys);
    for (GList* iter = modelKeysList; iter != NULL; iter = iter->next) {
      const ShovelerShaderKey* shaderKey = iter->data;
      bool removed = shovelerShaderCacheRemove(cache, shaderKey);
      assert(removed);
    }
    g_list_free(modelKeysList);
    g_hash_table_remove(cache->modelShaderKeys, model);
  }
}

void shovelerShaderCacheInvalidateMaterial(ShovelerShaderCache* cache, ShovelerMaterial* material) {
  GHashTable* materialKeys = g_hash_table_lookup(cache->materialShaderKeys, material);
  if (materialKeys != NULL) {
    // get keys list because the keys set will be modified while we iterate over the list
    GList* materialKeysList = g_hash_table_get_keys(materialKeys);
    for (GList* iter = materialKeysList; iter != NULL; iter = iter->next) {
      const ShovelerShaderKey* shaderKey = iter->data;
      bool removed = shovelerShaderCacheRemove(cache, shaderKey);
      assert(removed);
    }
    g_list_free(materialKeysList);
    g_hash_table_remove(cache->materialShaderKeys, material);
  }
}

void shovelerShaderCacheInvalidateUserData(ShovelerShaderCache* cache, void* userData) {
  GHashTable* userDataKeys = g_hash_table_lookup(cache->userDataShaderKeys, userData);
  if (userDataKeys != NULL) {
    // get keys list because the keys set will be modified while we iterate over the list
    GList* userDataKeysList = g_hash_table_get_keys(userDataKeys);
    for (GList* iter = userDataKeysList; iter != NULL; iter = iter->next) {
      const ShovelerShaderKey* shaderKey = iter->data;
      bool removed = shovelerShaderCacheRemove(cache, shaderKey);
      assert(removed);
    }
    g_list_free(userDataKeysList);
    g_hash_table_remove(cache->userDataShaderKeys, userData);
  }
}

void shovelerShaderCacheFree(ShovelerShaderCache* cache) {
  g_hash_table_destroy(cache->userDataShaderKeys);
  g_hash_table_destroy(cache->materialShaderKeys);
  g_hash_table_destroy(cache->modelShaderKeys);
  g_hash_table_destroy(cache->lightShaderKeys);
  g_hash_table_destroy(cache->cameraShaderKeys);
  g_hash_table_destroy(cache->sceneShaderKeys);
  g_hash_table_destroy(cache->shaders);
  free(cache);
}

static void freeShader(void* shaderPointer) {
  ShovelerShader* shader = shaderPointer;
  shovelerShaderFree(shader);
}

static void freeSet(void* setPointer) {
  GHashTable* set = setPointer;
  g_hash_table_destroy(set);
}


text:
/* global jQuery */

(function($) {
    'use strict';

    var options = {
        propagateSupportedGesture: false
    };

    function init(plot) {
        plot.hooks.processOptions.push(initTouchNavigation);
    }

    function initTouchNavigation(plot, options) {
        var gestureState = {
                twoTouches: false,
                currentTapStart: { x: 0, y: 0 },
                currentTapEnd: { x: 0, y: 0 },
                prevTap: { x: 0, y: 0 },
                currentTap: { x: 0, y: 0 },
                interceptedLongTap: false,
                isUnsupportedGesture: false,
                prevTapTime: null,
                tapStartTime: null,
                longTapTriggerId: null
            },
            maxDistanceBetweenTaps = 20,
            maxIntervalBetweenTaps = 500,
            maxLongTapDistance = 20,
            minLongTapDuration = 1500,
            pressedTapDuration = 125,
            mainEventHolder;

        function interpretGestures(e) {
            var o = plot.getOptions();

            if (!o.pan.active && !o.zoom.active) {
                return;
            }

            updateOnMultipleTouches(e);
            mainEventHolder.dispatchEvent(new CustomEvent('touchevent', { detail: e }));

            if (isPinchEvent(e)) {
                executeAction(e, 'pinch');
            } else {
                executeAction(e, 'pan');
                if (!wasPinchEvent(e)) {
                    if (isDoubleTap(e)) {
                        executeAction(e, 'doubleTap');
                    }
                    executeAction(e, 'tap');
                    executeAction(e, 'longTap');
                }
            }
        }

        function executeAction(e, gesture) {
            switch (gesture) {
                case 'pan':
                    pan[e.type](e);
                    break;
                case 'pinch':
                    pinch[e.type](e);
                    break;
                case 'doubleTap':
                    doubleTap.onDoubleTap(e);
                    break;
                case 'longTap':
                    longTap[e.type](e);
                    break;
                case 'tap':
                    tap[e.type](e);
                    break;
            }
        }

        function bindEvents(plot, eventHolder) {
            mainEventHolder = eventHolder[0];
            eventHolder[0].addEventListener('touchstart', interpretGestures, false);
            eventHolder[0].addEventListener('touchmove', interpretGestures, false);
            eventHolder[0].addEventListener('touchend', interpretGestures, false);
        }

        function shutdown(plot, eventHolder) {
            eventHolder[0].removeEventListener('touchstart', interpretGestures);
            eventHolder[0].removeEventListener('touchmove', interpretGestures);
            eventHolder[0].removeEventListener('touchend', interpretGestures);
            if (gestureState.longTapTriggerId) {
                clearTimeout(gestureState.longTapTriggerId);
                gestureState.longTapTriggerId = null;
            }
        }

        var pan = {
            touchstart: function(e) {
                updatePrevForDoubleTap();
                updateCurrentForDoubleTap(e);
                updateStateForLongTapStart(e);

                mainEventHolder.dispatchEvent(new CustomEvent('panstart', { detail: e }));
            },

            touchmove: function(e) {
                preventEventBehaviors(e);

                updateCurrentForDoubleTap(e);
                updateStateForLongTapEnd(e);

                if (!gestureState.isUnsupportedGesture) {
                    mainEventHolder.dispatchEvent(new CustomEvent('pandrag', { detail: e }));
                }
            },

            touchend: function(e) {
                preventEventBehaviors(e);

                if (wasPinchEvent(e)) {
                    mainEventHolder.dispatchEvent(new CustomEvent('pinchend', { detail: e }));
                    mainEventHolder.dispatchEvent(new CustomEvent('panstart', { detail: e }));
                } else if (noTouchActive(e)) {
                    mainEventHolder.dispatchEvent(new CustomEvent('panend', { detail: e }));
                }
            }
        };

        var pinch = {
            touchstart: function(e) {
                mainEventHolder.dispatchEvent(new CustomEvent('pinchstart', { detail: e }));
            },

            touchmove: function(e) {
                preventEventBehaviors(e);
                gestureState.twoTouches = isPinchEvent(e);
                if (!gestureState.isUnsupportedGesture) {
                    mainEventHolder.dispatchEvent(new CustomEvent('pinchdrag', { detail: e }));
                }
            },

            touchend: function(e) {
                preventEventBehaviors(e);
            }
        };

        var doubleTap = {
            onDoubleTap: function(e) {
                preventEventBehaviors(e);
                mainEventHolder.dispatchEvent(new CustomEvent('doubletap', { detail: e }));
            }
        };

        var longTap = {
            touchstart: function(e) {
                longTap.waitForLongTap(e);
            },

            touchmove: function(e) {
            },

            touchend: function(e) {
                if (gestureState.longTapTriggerId) {
                    clearTimeout(gestureState.longTapTriggerId);
                    gestureState.longTapTriggerId = null;
                }
            },

            isLongTap: function(e) {
                var currentTime = new Date().getTime(),
                    tapDuration = currentTime - gestureState.tapStartTime;
                if (tapDuration >= minLongTapDuration && !gestureState.interceptedLongTap) {
                    if (distance(gestureState.currentTapStart.x, gestureState.currentTapStart.y, gestureState.currentTapEnd.x, gestureState.currentTapEnd.y) < maxLongTapDistance) {
                        gestureState.interceptedLongTap = true;
                        return true;
                    }
                }
                return false;
            },

            waitForLongTap: function(e) {
                var longTapTrigger = function() {
                    if (longTap.isLongTap(e)) {
                        mainEventHolder.dispatchEvent(new CustomEvent('longtap', { detail: e }));
                    }
                    gestureState.longTapTriggerId = null;
                };
                if (!gestureState.longTapTriggerId) {
                    gestureState.longTapTriggerId = setTimeout(longTapTrigger, minLongTapDuration);
                }
            }
        };

        var tap = {
            touchstart: function(e) {
                gestureState.tapStartTime = new Date().getTime();
            },

            touchmove: function(e) {
            },

            touchend: function(e) {
                if (tap.isTap(e)) {
                    mainEventHolder.dispatchEvent(new CustomEvent('tap', { detail: e }));
                    preventEventBehaviors(e);
                }
            },

            isTap: function(e) {
                var currentTime = new Date().getTime(),
                    tapDuration = currentTime - gestureState.tapStartTime;
                if (tapDuration <= pressedTapDuration) {
                    if (distance(gestureState.currentTapStart.x, gestureState.currentTapStart.y, gestureState.currentTapEnd.x, gestureState.currentTapEnd.y) < maxLongTapDistance) {
                        return true;
                    }
                }
                return false;
            }
        };

        if (options.pan.enableTouch === true || options.zoom.enableTouch) {
            plot.hooks.bindEvents.push(bindEvents);
            plot.hooks.shutdown.push(shutdown);
        };

        function updatePrevForDoubleTap() {
            gestureState.prevTap = {
                x: gestureState.currentTap.x,
                y: gestureState.currentTap.y
            };
        };

        function updateCurrentForDoubleTap(e) {
            gestureState.currentTap = {
                x: e.touches[0].pageX,
                y: e.touches[0].pageY
            };
        }

        function updateStateForLongTapStart(e) {
            gestureState.tapStartTime = new Date().getTime();
            gestureState.interceptedLongTap = false;
            gestureState.currentTapStart = {
                x: e.touches[0].pageX,
                y: e.touches[0].pageY
            };
            gestureState.currentTapEnd = {
                x: e.touches[0].pageX,
                y: e.touches[0].pageY
            };
        };

        function updateStateForLongTapEnd(e) {
            gestureState.currentTapEnd = {
                x: e.touches[0].pageX,
                y: e.touches[0].pageY
            };
        };

        function isDoubleTap(e) {
            var currentTime = new Date().getTime(),
                intervalBetweenTaps = currentTime - gestureState.prevTapTime;

            if (intervalBetweenTaps >= 0 && intervalBetweenTaps < maxIntervalBetweenTaps) {
                if (distance(gestureState.prevTap.x, gestureState.prevTap.y, gestureState.currentTap.x, gestureState.currentTap.y) < maxDistanceBetweenTaps) {
                    e.firstTouch = gestureState.prevTap;
                    e.secondTouch = gestureState.currentTap;
                    return true;
                }
            }
            gestureState.prevTapTime = currentTime;
            return false;
        }

        function preventEventBehaviors(e) {
            if (!gestureState.isUnsupportedGesture) {
                e.preventDefault();
                if (!plot.getOptions().propagateSupportedGesture) {
                    e.stopPropagation();
                }
            }
        }

        function distance(x1, y1, x2, y2) {
            return Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
        }

        function noTouchActive(e) {
            return (e.touches && e.touches.length === 0);
        }

        function wasPinchEvent(e) {
            return (gestureState.twoTouches && e.touches.length === 1);
        }

        function updateOnMultipleTouches(e) {
            if (e.touches.length >= 3) {
                gestureState.isUnsupportedGesture = true;
            } else {
                gestureState.isUnsupportedGesture = false;
            }
        }

        function isPinchEvent(e) {
            if (e.touches && e.touches.length >= 2) {
                if (e.touches[0].target === plot.getEventHolder() &&
                    e.touches[1].target === plot.getEventHolder()) {
                    return true;
                }
            }
            return false;
        }
    }

    $.plot.plugins.push({
        init: init,
        options: options,
        name: 'navigateTouch',
        version: '0.3'
    });
})(jQuery);


text:
import sys
import os
import shlex
import subprocess
import sys
# sys.path.insert(0, os.path.abspath('.'))

# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinx.ext.mathjax', 'breathe']

breathe_projects = {'DSGRN': '.build/doxygenxml/'}
breathe_default_project = 'DSGRN'
breathe_domain_by_extension = {'h': 'cpp', 'hpp' : 'cpp'}

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'

# The master toctree document.
master_doc = 'index'

# General information about the project.
project = 'DSGRN'
copyright = '2018, Shaun Harker'
author = 'Shaun Harker'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '1.1'
# The full version, including alpha/beta/rc tags.
release = '1.1'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False

# -- Options for HTML output ----------------------------------------------

# The theme to use for HTML and HTML Help pages.  See the documentation for
# a list of builtin themes.
#

on_rtd = os.environ.get('READTHEDOCS', None) == 'True'

if not on_rtd:  # only import and set the theme if we're building docs locally
    import sphinx_rtd_theme
    html_theme = 'sphinx_rtd_theme'
    html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

    html_context = {
        'css_files': [
            '_static/theme_overrides.css'
        ]
    }
else:
    html_context = {
        'css_files': [
            '//media.readthedocs.org/css/sphinx_rtd_theme.css',
            '//media.readthedocs.org/css/readthedocs-doc-embed.css',
            '_static/theme_overrides.css'
        ]
    }

# Theme options are theme-specific and customize the look and feel of a theme
# further.  For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# This is required for the alabaster theme
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
html_sidebars = {
    '**': [
        'about.html',
        'navigation.html',
        'relations.html',  # needs 'show_related': True theme option to display
        'searchbox.html',
        'donate.html',
    ]
}

# -- Options for HTMLHelp output ------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'DSGRNdoc'

# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
    # The paper size ('letterpaper' or 'a4paper').
    #
    # 'papersize': 'letterpaper',

    # The font size ('10pt', '11pt' or '12pt').
    #
    # 'pointsize': '10pt',

    # Additional stuff for the LaTeX preamble.
    #
    # 'preamble': '',

    # Latex figure (float) alignment
    #
    # 'figure_align': 'htbp',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
#  author, documentclass [howto, manual, or own class]).
latex_documents = [
    (master_doc, 'DSGRN.tex', 'DSGRN Documentation',
     'Shaun Harker', 'manual'),
]

# -- Options for manual page output ---------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
    (master_doc, 'dsgrn', 'DSGRN Documentation',
     [author], 1)
]

# -- Options for Texinfo output -------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
#  dir menu entry, description, category)
texinfo_documents = [
    (master_doc, 'DSGRN', 'DSGRN Documentation',
     author, 'DSGRN', 'Dynamical Signatures Generated by Regulatory Networks',
     'Mathematics'),
]

primary_domain = 'cpp'
highlight_language = 'cpp'

def generate_doxygen_xml(app):
    build_dir = os.path.join(app.confdir, '.build')
    if not os.path.exists(build_dir):
        os.mkdir(build_dir)

    try:
        subprocess.call(['doxygen', '--version'])
        retcode = subprocess.call(['doxygen'], cwd=app.confdir)
        if retcode < 0:
            sys.stderr.write("doxygen error code: {}\n".format(-retcode))
    except OSError as e:
        sys.stderr.write("doxygen execution failed: {}\n".format(e))

def setup(app):
    """Add hook for building doxygen xml when needed"""
    app.connect("builder-inited", generate_doxygen_xml)


text:
package com.foc.desc.dataModelTree;

import java.util.Iterator;

import com.foc.Globals;
import com.foc.desc.FocDesc;
import com.foc.desc.FocObject;
import com.foc.desc.field.FBlobField;
import com.foc.desc.field.FBlobStringField;
import com.foc.desc.field.FField;
import com.foc.desc.field.FMultipleChoiceItem;
import com.foc.desc.field.FObjectField;
import com.foc.desc.field.FTypedObjectField;
import com.foc.list.FocLinkSimple;
import com.foc.list.FocList;
import com.foc.property.FObject;
import com.foc.property.FProperty;

public class DataModelNodeList extends FocList {
	private FocDesc   rootDesc   = null ;
	private FocObject rootObject = null ;
	private int       maxLevel   = 0    ;

  public DataModelNodeList(FocDesc rootDesc, int maxLevel){
  	this(rootDesc, maxLevel, null);
  }

  public DataModelNodeList(FocDesc rootDesc, int maxLevel, FocObject rootObject){
    super(new FocLinkSimple(DataModelNodeDesc.getInstance()));
    this.rootDesc   = rootDesc  ;
    this.maxLevel   = maxLevel  ;
    this.rootObject = rootObject;
    constructFocList();
  }

  public void dispose(){
  	rootDesc   = null;
  	rootObject = null;
  }

  public FocDesc getRootDesc(){
  	return rootDesc;
  }

  private boolean isDescInOneOfTheFathers(DataModelNode node, FocDesc focDesc){
  	boolean exist = false;
  	DataModelNode currNode = node;
  	while(currNode != null && !exist){
  		exist = currNode.getFocDesc() == focDesc;
  		currNode = currNode.getFather();
  	}
  	return exist;
  }

  private DataModelNode addDataModelNode_Atomic(DataModelNode fatherNode, FocDesc focDesc, FField field, String name, String pathSection, String description, String value){
  	DataModelNode modelNode = (DataModelNode) newEmptyItem();
  	String newName        = name.replace('.', '-');
  	String newPathSection = pathSection.replace('.', '-');

		modelNode.setName(newName);
		modelNode.setPathSection(newPathSection);
		modelNode.setDescription(description);
		modelNode.setFather(fatherNode);
		modelNode.setFocDesc(focDesc);
		modelNode.setFField(field);
		modelNode.setValue(value);
		add(modelNode);
		return modelNode;
  }

  private DataModelNode addDataModelNode(DataModelNode fatherNode, FocDesc focDesc, FField fld, String name, String pathSection, String description, String dictionaryGroup, String value){
  	DataModelNode intermediateNode = fatherNode;

  	if(dictionaryGroup != null && !dictionaryGroup.equals("")){
  		DataModelNode foundGroupNode = null;
      Iterator iter = newSubjectIterator();
      while(iter!=null && iter.hasNext()){
      	DataModelNode currNode = (DataModelNode)iter.next();
        if(currNode != null){
        	DataModelNode currFather = currNode.getFather();
        	if(currFather == fatherNode && currNode.getName().equals(dictionaryGroup)){
        		foundGroupNode = currNode;
        	}
        }
      }
      if(foundGroupNode == null){
      	intermediateNode = addDataModelNode_Atomic(intermediateNode, null, fld, dictionaryGroup, "", "", "");
      }else{
      	intermediateNode = foundGroupNode;
      }
  	}

  	intermediateNode = addDataModelNode_Atomic(intermediateNode, focDesc, fld, name, pathSection, description, value);

		return intermediateNode;
  }

  private void constructFocList(DataModelNode fatherNode, FocDesc focDesc, FocObject focObject){
  	if(focDesc != null && !isDescInOneOfTheFathers(fatherNode, focDesc)){
	    for (int i = 0; i < focDesc.getFieldsSize(); i++) {
	    	FField    field = focDesc.getFieldAt(i);
	    	FProperty prop  = focObject != null ? focObject.getFocProperty(field.getID()) : null;
	  		if(field != null && field.getID() != FField.REF_FIELD_ID){
	  			boolean toBeInserted = !field.isObjectContainer() || field instanceof FTypedObjectField || field instanceof FObjectField || field instanceof FBlobField || field instanceof FBlobStringField;

	  			if(toBeInserted){
	  				toBeInserted = fatherNode == null || fatherNode.getLevel() < maxLevel;
	  			}

	  			toBeInserted = toBeInserted && field.isShowInDictionary();
//	  			toBeInserted = toBeInserted && !(field instanceof FListField);

	  			if(toBeInserted){
	  				DataModelNode modelNode = addDataModelNode(fatherNode, focDesc, field, field.getName(), field.getName(), field.getTitle(), field.getDictionaryGroup(), prop != null ? prop.getString() : null);

						//if(field.isObjectContainer()){
	  				if(field.getFocDesc() != null){
		  				FocObject nextFocObject = null;
		  				try{
		  					nextFocObject = (FocObject) ((FObject)prop).getObject_CreateIfNeeded();
		  				}catch(Exception e){
		  					//Excecption not caught on purpose.
		  				}

							if(field instanceof FTypedObjectField){
								FTypedObjectField typedField     = (FTypedObjectField) field;
								Iterator<FMultipleChoiceItem> iter = typedField.newIteratorOnPossibleDescs(focDesc);
								while(iter != null && iter.hasNext()){
									FMultipleChoiceItem multiItem = (FMultipleChoiceItem) iter.next();
									if(multiItem != null){
										String tableName    = multiItem.getTitle();
										FocDesc nextFocDesc = Globals.getApp().getFocDescByName(tableName);
					  				if(nextFocDesc != null && nextFocDesc != focDesc){
						  				DataModelNode typeModelNode = addDataModelNode(modelNode, null, typedField, nextFocDesc.getStorageName(), "", nextFocDesc.getStorageName(), "", "");
					  					constructFocList(typeModelNode, nextFocDesc, (nextFocObject != null && nextFocObject.getThisFocDesc() == nextFocDesc) ? nextFocObject : null);
					  				}
									}
								}
							}else{
			  				FocDesc nextFocDesc = field.getFocDesc();
			  				if(nextFocDesc != focDesc){
			  					constructFocList(modelNode, nextFocDesc, nextFocObject);
			  				}
							}
						}
	  			}
	  		}
	  	}
  	}
  }

  private void constructFocList(){
  	constructFocList(null, rootDesc, rootObject);
  }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>Interface IFacebookShareCountLoader
   | Welcome to Sloader </title>
    <meta name="viewport" content="width=device-width">
    <meta name="title" content="Interface IFacebookShareCountLoader
   | Welcome to Sloader ">
    <meta name="generator" content="docfx 2.40.6.0">

    <link rel="shortcut icon" href="../favicon.ico">
    <link rel="stylesheet" href="../styles/docfx.vendor.css">
    <link rel="stylesheet" href="../styles/docfx.css">
    <link rel="stylesheet" href="../styles/main.css">
    <meta property="docfx:navrel" content="../toc.html">
    <meta property="docfx:tocrel" content="toc.html">

    <meta property="docfx:rel" content="../">

              <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
                Toggle navigation

              </button>

              <form class="navbar-form navbar-right" role="search" id="search">

                  <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">

              </form>

          Show / Hide Table of Contents

Interface IFacebookShareCountLoader

Should return for a given url the like count on facebook

Namespace: Sloader.Engine.Crawler.Feed

Assembly: Sloader.Engine.dll

Syntax

public interface IFacebookShareCountLoader

Methods

    View Source

GetAsync(String)

Get the likes for a given URL on facebook.com

Declaration

Task<int> GetAsync(string url)

Parameters

        Type
        Name
        Description

        System.String
        url

The given url.

Returns

        Type
        Description

        System.Threading.Tasks.Task<System.Int32>

Like-count as task

                    View Source

              Back to top

            Sloader - MIT License


text:
title: Class
localeTitle: صف دراسي
---
## صف دراسي

توفر الفئات وسيلة لتجميع البيانات والوظائف معًا. ينشئ إنشاء فئة جديدة نوعًا جديدًا من الكائنات ، مما يسمح بإنشاء نسخ جديدة من هذا النوع. يمكن أن يكون لكل مثيل فئة سمات مرتبطة به للحفاظ على حالته. يمكن أن تحتوي مثيلات الفئة أيضًا على طرق (يتم تعريفها بواسطة الفئة الخاصة بها) لتعديل حالتها.

مقارنة مع لغات البرمجة الأخرى ، فإن آلية التصنيف في Python تضيف فصولا بحد أدنى من بناء الجملة الجديدة والدلالات. إنه خليط من آليات الفصل الموجودة في C ++. توفر فصول Python كافة الميزات القياسية للبرمجة الكائنية التوجه: تسمح آلية الوراثة الطبقية لفئات أساسية متعددة ، يمكن للفئة المشتقة تجاوز أي طرق لفئة أو فصولها الأساسية ، ويمكن لطريقة استدعاء طريقة فئة أساسية تحمل الاسم نفسه. يمكن أن تحتوي الكائنات على كميات وأنواع بيانات عشوائية. كما هو الحال بالنسبة للوحدات ، فالفصول الدراسية تشترك في الطبيعة الديناميكية لبيثون: يتم إنشاؤها في وقت التشغيل ، ويمكن تعديلها بعد الإنشاء.

#### تعريف صيغة الطبقة:

أبسط شكل من أشكال تعريف الفئة يشبه هذا:

 ``class ClassName:
    <statement-1>
        ...
        ...
        ...
    <statement-N>
 ```

 #### Class Objects:

 Class objects support two kinds of operations: attribute references and instantiation.

 Attribute references use the standard syntax used for all attribute references in Python: `obj.name`.
 Valid attribute names are all the names that were in the class's namespace when the class object was created.
 So, if the class definition looked like this:
``

الثعبان فئة MyClass: "" "فئة بسيطة مثال" "" ط = 12345

 `def f(self):
    return 'hello world'
`

 ``Then `MyClass.i` and `MyClass.f` are valid attribute references, returning an integer and a function object, respectively.
 Class attributes can also be assigned to, so you can change the value of `MyClass.i` by assignment. `__doc__` is also a valid attribute, returning the docstring belonging to the class: `"A simple example class"`.

 Class instantiation uses function notation. Just pretend that the class object is a parameterless function that returns a new instance of the class. For example (assuming the above class):
``

الثعبان x = MyClass ()

 `Creates a new instance of the class and assigns this object to the local variable x.

 The instantiation operation ("calling" a class object) creates an empty object.
 Many classes like to create objects with instances customized to a specific initial state.
 Therefore a class may define a special method named __init__(), like this:
`

الثعبان def **init** (الذاتية): self.data = \[\]

 ``When a class defines an `__init__()` method, class instantiation automatically invokes `__init__()` for the newly-created class instance.
 So in this example, a new, initialized instance can be obtained by:
``

الثعبان x = MyClass ()

 ``Of course, the `__init__()` method may have arguments for greater flexibility.
 In that case, arguments given to the class instantiation operator are passed on to `__init__()`. For example,
``

الثعبان مجمع الصف: def **init** (self، realpart، imagpart): self.r = realpart self.i = تخيل ...

x = معقدة (3.0 ، -4.5)

> > > xr، xi (3.0 ، -4.5) \`\` \`


text:
package com.box.l10n.mojito.service.screenshot;

import static com.box.l10n.mojito.entity.Screenshot.Status.ACCEPTED;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.slf4j.LoggerFactory.getLogger;

import com.box.l10n.mojito.entity.Repository;
import com.box.l10n.mojito.entity.Screenshot;
import com.box.l10n.mojito.entity.ScreenshotRun;
import com.box.l10n.mojito.service.assetExtraction.ServiceTestBase;
import com.box.l10n.mojito.service.locale.LocaleService;
import com.box.l10n.mojito.service.repository.RepositoryNameAlreadyUsedException;
import com.box.l10n.mojito.service.repository.RepositoryRepository;
import com.box.l10n.mojito.service.repository.RepositoryService;
import com.box.l10n.mojito.service.tm.TMTestData;
import com.box.l10n.mojito.test.TestIdWatcher;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
import org.junit.Assert;
import org.junit.Rule;
import org.junit.Test;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;

/** @author jeanaurambault */
public class ScreenshotServiceTest extends ServiceTestBase {

  /** logger */
  static Logger logger = getLogger(ScreenshotServiceTest.class);

  @Autowired RepositoryService repositoryService;

  @Autowired ScreenshotService screenshotService;

  @Autowired LocaleService localeService;

  @Autowired ScreenshotRunRepository screenshotRunRepository;

  @Autowired ScreenshotRepository screenshotRepository;

  @Autowired RepositoryRepository repositoryRepository;

  @Rule public TestIdWatcher testIdWatcher = new TestIdWatcher();

  @Test
  public void testCreateScreenshotRun() throws Exception {

    Repository repository =
        repositoryService.createRepository(testIdWatcher.getEntityName("repository"));

    ScreenshotRun screenshotRun = new ScreenshotRun();
    screenshotRun.setName(UUID.randomUUID().toString());
    screenshotRun.setRepository(repository);

    Screenshot screenshot1 = new Screenshot();
    screenshot1.setName("s1");
    Screenshot screenshot2 = new Screenshot();
    screenshot2.setName("s2");
    screenshotRun.getScreenshots().add(screenshot1);
    screenshotRun.getScreenshots().add(screenshot2);

    ScreenshotRun createScreenshotRun =
        screenshotService.createOrAddToScreenshotRun(screenshotRun, true);

    ScreenshotRun createdFromDB =
        screenshotRunRepository.findById(createScreenshotRun.getId()).orElse(null);
    ArrayList<Screenshot> arrayList = new ArrayList<>(createdFromDB.getScreenshots());
    Assert.assertNotNull(arrayList.get(0).getId());
    Assert.assertNotNull(arrayList.get(1).getId());
  }

  @Test
  public void testManualRun() throws Exception {

    Repository repository =
        repositoryService.createRepository(testIdWatcher.getEntityName("repository"));

    ScreenshotRun screenshotRun = new ScreenshotRun();
    screenshotRun.setName(UUID.randomUUID().toString());
    screenshotRun.setRepository(repository);

    Screenshot screenshot1 = new Screenshot();
    screenshot1.setName("screen1");
    screenshot1.setStatus(ACCEPTED);
    screenshot1.setLocale(repository.getSourceLocale());

    Screenshot screenshot2 = new Screenshot();
    screenshot2.setName("screen2");
    screenshot2.setStatus(ACCEPTED);
    screenshot2.setLocale(repository.getSourceLocale());

    screenshotRun.getScreenshots().add(screenshot1);
    screenshotRun.getScreenshots().add(screenshot2);

    ScreenshotRun createScreenshotRun =
        screenshotService.createOrAddToScreenshotRun(screenshotRun, false);

    repository.setManualScreenshotRun(createScreenshotRun);
    repositoryRepository.save(repository);

    List<Screenshot> searchScreenshotsNoManualRuns =
        screenshotService.searchScreenshots(
            Arrays.asList(repository.getId()),
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            ScreenshotRunType.LAST_SUCCESSFUL_RUN,
            0,
            10);

    assertTrue(searchScreenshotsNoManualRuns.isEmpty());

    List<Screenshot> searchScreenshotsManualRuns =
        screenshotService.searchScreenshots(
            Arrays.asList(repository.getId()),
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            ScreenshotRunType.MANUAL_RUN,
            0,
            10);
    assertEquals("screen1", searchScreenshotsManualRuns.get(0).getName());
    assertEquals("screen2", searchScreenshotsManualRuns.get(1).getName());
  }

  @Test
  public void testUpdateScreenshotRun() throws Exception {

    Repository repository =
        repositoryService.createRepository(testIdWatcher.getEntityName("repository"));

    ScreenshotRun screenshotRun = new ScreenshotRun();
    screenshotRun.setRepository(repository);
    screenshotRun.setName(UUID.randomUUID().toString());

    Screenshot screenshot1 = new Screenshot();
    screenshot1.setName("s1");
    Screenshot screenshot2 = new Screenshot();
    screenshot2.setName("s2");
    screenshotRun.getScreenshots().add(screenshot1);
    screenshotRun.getScreenshots().add(screenshot2);
    screenshotService.createOrAddToScreenshotRun(screenshotRun, true);

    ScreenshotRun forUpdate = new ScreenshotRun();
    forUpdate.setRepository(repository);
    forUpdate.setName(screenshotRun.getName());

    Screenshot screenshot3 = new Screenshot();
    screenshot3.setName("s3");
    forUpdate.getScreenshots().add(screenshot3);

    ScreenshotRun updatedScreenshotRun =
        screenshotService.createOrAddToScreenshotRun(forUpdate, true);

    ScreenshotRun updatedFromDB =
        screenshotRunRepository.findById(updatedScreenshotRun.getId()).orElse(null);
    ArrayList<Screenshot> arrayList = new ArrayList<>(updatedFromDB.getScreenshots());
    Assert.assertNotNull(arrayList.get(0).getId());
    Assert.assertNotNull(arrayList.get(1).getId());
    Assert.assertNotNull(arrayList.get(2).getId());
  }

  @Test
  public void testSortScreenshotBySequence() {
    List<Screenshot> screenshots = new ArrayList<>();

    Screenshot screen1 = new Screenshot();
    screen1.setSequence(1L);
    screenshots.add(screen1);

    Screenshot screen2 = new Screenshot();
    screen2.setSequence(10L);
    screenshots.add(screen2);

    Screenshot screen3 = new Screenshot();
    screen3.setSequence(5L);
    screenshots.add(screen3);

    screenshotService.sortScreenshotBySequence(screenshots);

    assertEquals(screen1, screenshots.get(0));
    assertEquals(screen3, screenshots.get(1));
    assertEquals(screen2, screenshots.get(2));
  }

  @Test
  public void testSearchScreenshotsByRepository() throws RepositoryNameAlreadyUsedException {
    Repository repository = createScreenshotDataAsRepository();
    List<Screenshot> searchScreenshots =
        screenshotService.searchScreenshots(
            Arrays.asList(repository.getId()),
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            ScreenshotRunType.LAST_SUCCESSFUL_RUN,
            0,
            10);
    assertEquals("screen1", searchScreenshots.get(0).getName());
    assertEquals("screen3", searchScreenshots.get(1).getName());
    assertEquals("screen2", searchScreenshots.get(2).getName());
  }

  @Test
  public void testSearchScreenshotsByLocale() throws RepositoryNameAlreadyUsedException {

    Repository repository = createScreenshotDataAsRepository();

    List<Screenshot> searchScreenshots =
        screenshotService.searchScreenshots(
            Arrays.asList(repository.getId()),
            Arrays.asList("fr-FR"),
            null,
            null,
            null,
            null,
            null,
            null,
            ScreenshotRunType.LAST_SUCCESSFUL_RUN,
            0,
            10);

    assertEquals("screen1", searchScreenshots.get(0).getName());
    assertEquals("screen2", searchScreenshots.get(1).getName());
    assertEquals(2, searchScreenshots.size());

    searchScreenshots =
        screenshotService.searchScreenshots(
            Arrays.asList(repository.getId()),
            Arrays.asList("ko-KR"),
            null,
            null,
            null,
            null,
            null,
            null,
            ScreenshotRunType.LAST_SUCCESSFUL_RUN,
            0,
            10);

    assertEquals("screen3", searchScreenshots.get(0).getName());
    assertEquals(1, searchScreenshots.size());
  }

  @Test
  public void testSearchScreenshotsByName() throws RepositoryNameAlreadyUsedException {

    Repository repository = createScreenshotDataAsRepository();

    List<Screenshot> searchScreenshots =
        screenshotService.searchScreenshots(
            Arrays.asList(repository.getId()),
            null,
            "screen2",
            null,
            null,
            null,
            null,
            null,
            ScreenshotRunType.LAST_SUCCESSFUL_RUN,
            0,
            10);

    assertEquals("screen2", searchScreenshots.get(0).getName());
    assertEquals(1, searchScreenshots.size());
  }

  @Test
  public void testSearchScreenshotsByStatus() throws RepositoryNameAlreadyUsedException {

    Repository repository = createScreenshotDataAsRepository();

    List<Screenshot> searchScreenshots =
        screenshotService.searchScreenshots(
            Arrays.asList(repository.getId()),
            null,
            null,
            Screenshot.Status.NEEDS_REVIEW,
            null,
            null,
            null,
            null,
            ScreenshotRunType.LAST_SUCCESSFUL_RUN,
            0,
            10);

    assertEquals("screen3", searchScreenshots.get(0).getName());
    assertEquals(1, searchScreenshots.size());

    searchScreenshots =
        screenshotService.searchScreenshots(
            Arrays.asList(repository.getId()),
            null,
            null,
            Screenshot.Status.REJECTED,
            null,
            null,
            null,
            null,
            ScreenshotRunType.LAST_SUCCESSFUL_RUN,
            0,
            10);

    assertEquals("screen1", searchScreenshots.get(0).getName());
    assertEquals(1, searchScreenshots.size());

    searchScreenshots =
        screenshotService.searchScreenshots(
            Arrays.asList(repository.getId()),
            null,
            null,
            ACCEPTED,
            null,
            null,
            null,
            null,
            ScreenshotRunType.LAST_SUCCESSFUL_RUN,
            0,
            10);

    assertEquals("screen2", searchScreenshots.get(0).getName());
    assertEquals(1, searchScreenshots.size());
  }

  @Test
  public void testSearchScreenshotsByPagination() throws RepositoryNameAlreadyUsedException {

    Repository repository = createScreenshotDataAsRepository();

    List<Screenshot> searchScreenshots =
        screenshotService.searchScreenshots(
            Arrays.asList(repository.getId()),
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            ScreenshotRunType.LAST_SUCCESSFUL_RUN,
            1,
            1);

    logger.debug("repository: {}", repository.getId());
    assertEquals("screen3", searchScreenshots.get(0).getName());
    assertEquals(1, searchScreenshots.size());
  }

  @Test
  public void testLastRunSuccessful() throws RepositoryNameAlreadyUsedException {

    Repository repository = createScreenshotDataAsRepository();
    createScreenshotDataForRepository(repository);

    List<Screenshot> searchScreenshots =
        screenshotService.searchScreenshots(
            Arrays.asList(repository.getId()),
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            ScreenshotRunType.LAST_SUCCESSFUL_RUN,
            0,
            10);

    assertEquals(3, searchScreenshots.size());
  }

  public Repository createScreenshotDataAsRepository() {
    return createScreenshotData().repository;
  }

  public TMTestData createScreenshotData() {
    TMTestData tmTestDataSource = new TMTestData(testIdWatcher);
    createScreenshotDataForRepository(tmTestDataSource.repository);
    return tmTestDataSource;
  }

  public void createScreenshotDataForRepository(Repository repository) {

    Screenshot screen1 = new Screenshot();
    screen1.setName("screen1");
    screen1.setLocale(localeService.findByBcp47Tag("fr-FR"));
    screen1.setSequence(1L);
    screen1.setStatus(Screenshot.Status.REJECTED);

    Screenshot screen2 = new Screenshot();
    screen2.setName("screen2");
    screen2.setLocale(localeService.findByBcp47Tag("fr-FR"));
    screen2.setSequence(10L);
    screen2.setStatus(ACCEPTED);

    Screenshot screen3 = new Screenshot();
    screen3.setName("screen3");
    screen3.setLocale(localeService.findByBcp47Tag("ko-KR"));
    screen3.setSequence(5L);
    screen3.setStatus(Screenshot.Status.NEEDS_REVIEW);

    ScreenshotRun screenshotRun = new ScreenshotRun();
    screenshotRun.setName(UUID.randomUUID().toString());
    screenshotRun.setRepository(repository);
    screenshotRun.getScreenshots().add(screen1);
    screenshotRun.getScreenshots().add(screen2);
    screenshotRun.getScreenshots().add(screen3);
    screenshotService.createOrAddToScreenshotRun(screenshotRun, true);
  }
}


text:
New Relic is a performance management system, developed by
New Relic, Inc (http://www.newrelic.com).  It provides you with deep
information about the performance of your Rails or Ruby
application as it runs in production. The New Relic Ruby Agent is
dual-purposed as a either a Gem or a Rails plugin, hosted on
[github](http://github.com/newrelic/rpm/tree/master).

The New Relic Ruby Agent runs in one of two modes:

**Production Mode**
Low overhead instrumentation that captures detailed information on
your application running in production and transmits them to
newrelic.com where you can monitor them in real time.

**Developer Mode**
A Rack middleware that maps `/newrelic` to an application for showing
detailed performance metrics on a page by page basis.  Installed
automatically in Rails applications.

## Supported Environments

An up-to-date list of Ruby versions and frameworks for the latest agent
can be found on [our docs site](http://docs.newrelic.com/docs/ruby/supported-frameworks).

You can also monitor non-web applications. Refer to the "Other
Environments" section under "Getting Started".

## Contributing Code

We welcome code contributions (in the form of pull requests) from our user
community.  Before submitting a pull request please review
[GUIDELINES_FOR_CONTRIBUTING](https://github.com/newrelic/rpm/blob/master/GUIDELINES_FOR_CONTRIBUTING.md).

Following these helps us efficiently review and incorporate your contribution
and avoid breaking your code with future changes to the agent.

## Getting Started

Add the Ruby Agent to your project's Gemfile.

    gem 'newrelic_rpm'

To monitor your applications in production, create an account at
http://newrelic.com/ .  There you can
sign up for a free Lite account or one of our paid subscriptions.

Once you receive the welcome email with a license key and
`newrelic.yml` file, you can copy the `newrelic.yml` file into your app config
directory OR can generate the file manually with command:

    newrelic install --license_key="YOUR_KEY" "My application"

The initial configuration is done in the `newrelic.yml` file.  This file
is by default read from the `config` directory of the application root
and is subsequently searched for in the application root directory,
and then in a `~/.newrelic` directory.  Once you're up and running you can
enable Server Side Config and manage your newrelic configuration from the web
UI.

#### Rails Installation

You can install the agent as a Gem:

For Bundler:

Add the following line to your Gemfile:

    gem 'newrelic_rpm'

For Rails 2.x without Bundler:

edit `environment.rb` and add to the initalizer block:

    config.gem "newrelic_rpm"

#### Sinatra Installation

To use the Ruby Agent with a Sinatra app, add

    require 'newrelic_rpm'

in your Sinatra app, below the Sinatra require directive.

Then make sure you set `RACK_ENV` to the environment corresponding to the
configuration definitions in the newrelic.yml file; e.g., development,
staging, production, etc.

To use Developer Mode in Sinatra, add `NewRelic::Rack::DeveloperMode` to
the middleware stack.  See the `config.ru` sample below.

#### Other Environments

You can use the Ruby Agent to monitor any Ruby application.  Add

    require 'newrelic_rpm'

to your startup sequence and then manually start the agent using

    NewRelic::Agent.manual_start

For information about instrumenting pure Rack applications, see our
[Rack middlewares documentation](http://docs.newrelic.com/docs/ruby/rack-middlewares).

Refer to the [New Relic's Docs](http://newrelic.com/docs) for details on how to
monitor other web frameworks, background jobs, and daemons.

The Ruby Agent provides an API that allows custom instrumentation of additional
frameworks.  You can find a list of community created intrumentation plugins
(e.g. [newrelic-redis](https://github.com/evanphx/newrelic-redis)) in the
[extends_newrelic_rpm project](https://github.com/newrelic/extends_newrelic_rpm).

## Developer Mode

When running the Developer Mode, the Ruby Agent will track the
performance of every HTTP request serviced by your application, and
store in memory this information for the last 100 HTTP transactions.

To view this performance information, including detailed SQL statement
analysis, open `/newrelic` in your web application.  For instance if
you are running mongrel or thin on port 3000, enter the following into
your browser:

    http://localhost:3000/newrelic

Developer Mode is only initialized if the `developer_mode` setting in
the newrelic.yml file is set to true.  By default, it is turned off in
all environments but `development`.

#### Developer Mode in Rails

Developer Mode is available automatically in Rails Applications based
on Rails 2.3 and later.  No additional configuration is required. When
your application starts and `developer_mode` is enabled, the Ruby
Agent injects a middleware into your Rails middleware stack.

For earlier versions of Rails that support Rack, you can use
a `config.ru` as below.

#### Developer Mode in Rack Applications

Developer Mode is available for any Rack based application such as
Sinatra by installing the NewRelic::Rack::DeveloperMode
middleware. This middleware passes all requests that do not start with
/newrelic.

Here's an example entry for Developer Mode in a `config.ru` file:

    require 'new_relic/rack/developer_mode'
    use NewRelic::Rack::DeveloperMode

## Production Mode

When your application runs in the production environment, the New
Relic agent runs in production mode. It connects to the New Relic
service and sends deep performance data to the UI for your
analysis. To view this data, log in to http://rpm.newrelic.com.

NOTE: You must have a valid account and license key to view this data
online.  Refer to instructions in *Getting Started*.

## Recording Deploys

The Ruby Agent supports recording deployments in New Relic via a command line
tool or Capistrano recipes. For more information on these features see
[our deployment documentation](http://docs.newrelic.com/docs/ruby/recording-deployments-with-the-ruby-agent)
for more information.

## Support

You can find more detailed documentation [on our website](http://newrelic.com/docs),
and specifically in the [Ruby category](http://newrelic.com/docs/ruby).

If you can't find what you're looking for there, reach out to us on our [support
site](http://support.newrelic.com/) or our [community forum](http://forum.newrelic.com)
and we'll be happy to help you.

Also available is community support on IRC: we generally use #newrelic
on irc.freenode.net

Find a bug? Contact us via [support.newrelic.com](http://support.newrelic.com/),
or email support@newrelic.com.

Thank you, and may your application scale to infinity plus one.

Lew Cirne, Founder and CEO

New Relic, Inc.


text:
SendCoinsEntry::SendCoinsEntry(const PlatformStyle *_platformStyle, QWidget *parent) :
    QStackedWidget(parent),
    ui(new Ui::SendCoinsEntry),
    model(nullptr),
    platformStyle(_platformStyle)
{
    ui->setupUi(this);

    ui->addressBookButton->setIcon(platformStyle->SingleColorIcon(":/icons/address-book"));
    ui->pasteButton->setIcon(platformStyle->SingleColorIcon(":/icons/editpaste"));
    ui->deleteButton->setIcon(platformStyle->SingleColorIcon(":/icons/remove"));
    ui->deleteButton_is->setIcon(platformStyle->SingleColorIcon(":/icons/remove"));
    ui->deleteButton_s->setIcon(platformStyle->SingleColorIcon(":/icons/remove"));

    setCurrentWidget(ui->SendCoins);

    if (platformStyle->getUseExtraSpacing())
        ui->payToLayout->setSpacing(4);

    // normal Groestlcoin address field
    GUIUtil::setupAddressWidget(ui->payTo, this);
    // just a label for displaying bitcoin address(es)
    ui->payTo_is->setFont(GUIUtil::fixedPitchFont());

    // Connect signals
    connect(ui->payAmount, &BitcoinAmountField::valueChanged, this, &SendCoinsEntry::payAmountChanged);
    connect(ui->checkboxSubtractFeeFromAmount, &QCheckBox::toggled, this, &SendCoinsEntry::subtractFeeFromAmountChanged);
    connect(ui->deleteButton, &QPushButton::clicked, this, &SendCoinsEntry::deleteClicked);
    connect(ui->deleteButton_is, &QPushButton::clicked, this, &SendCoinsEntry::deleteClicked);
    connect(ui->deleteButton_s, &QPushButton::clicked, this, &SendCoinsEntry::deleteClicked);
    connect(ui->useAvailableBalanceButton, &QPushButton::clicked, this, &SendCoinsEntry::useAvailableBalanceClicked);
}

SendCoinsEntry::~SendCoinsEntry()
{
    delete ui;
}

void SendCoinsEntry::on_pasteButton_clicked()
{
    // Paste text from clipboard into recipient field
    ui->payTo->setText(QApplication::clipboard()->text());
}

void SendCoinsEntry::on_addressBookButton_clicked()
{
    if(!model)
        return;
    AddressBookPage dlg(platformStyle, AddressBookPage::ForSelection, AddressBookPage::SendingTab, this);
    dlg.setModel(model->getAddressTableModel());
    if(dlg.exec())
    {
        ui->payTo->setText(dlg.getReturnValue());
        ui->payAmount->setFocus();
    }
}

void SendCoinsEntry::on_payTo_textChanged(const QString &address)
{
    updateLabel(address);
}

void SendCoinsEntry::setModel(WalletModel *_model)
{
    this->model = _model;

    if (_model && _model->getOptionsModel())
        connect(_model->getOptionsModel(), &OptionsModel::displayUnitChanged, this, &SendCoinsEntry::updateDisplayUnit);

    clear();
}

void SendCoinsEntry::clear()
{
    // clear UI elements for normal payment
    ui->payTo->clear();
    ui->addAsLabel->clear();
    ui->payAmount->clear();
    if (model && model->getOptionsModel()) {
        ui->checkboxSubtractFeeFromAmount->setChecked(model->getOptionsModel()->getSubFeeFromAmount());
    }
    ui->messageTextLabel->clear();
    ui->messageTextLabel->hide();
    ui->messageLabel->hide();
    // clear UI elements for unauthenticated payment request
    ui->payTo_is->clear();
    ui->memoTextLabel_is->clear();
    ui->payAmount_is->clear();
    // clear UI elements for authenticated payment request
    ui->payTo_s->clear();
    ui->memoTextLabel_s->clear();
    ui->payAmount_s->clear();

    // update the display unit, to not use the default ("GRS")
    updateDisplayUnit();
}

void SendCoinsEntry::checkSubtractFeeFromAmount()
{
    ui->checkboxSubtractFeeFromAmount->setChecked(true);
}

void SendCoinsEntry::deleteClicked()
{
    Q_EMIT removeEntry(this);
}

void SendCoinsEntry::useAvailableBalanceClicked()
{
    Q_EMIT useAvailableBalance(this);
}

bool SendCoinsEntry::validate(interfaces::Node& node)
{
    if (!model)
        return false;

    // Check input validity
    bool retval = true;

    if (!model->validateAddress(ui->payTo->text()))
    {
        ui->payTo->setValid(false);
        retval = false;
    }

    if (!ui->payAmount->validate())
    {
        retval = false;
    }

    // Sending a zero amount is invalid
    if (ui->payAmount->value(nullptr) <= 0)
    {
        ui->payAmount->setValid(false);
        retval = false;
    }

    // Reject dust outputs:
    if (retval && GUIUtil::isDust(node, ui->payTo->text(), ui->payAmount->value())) {
        ui->payAmount->setValid(false);
        retval = false;
    }

    return retval;
}

SendCoinsRecipient SendCoinsEntry::getValue()
{
    recipient.address = ui->payTo->text();
    recipient.label = ui->addAsLabel->text();
    recipient.amount = ui->payAmount->value();
    recipient.message = ui->messageTextLabel->text();
    recipient.fSubtractFeeFromAmount = (ui->checkboxSubtractFeeFromAmount->checkState() == Qt::Checked);

    return recipient;
}

QWidget *SendCoinsEntry::setupTabChain(QWidget *prev)
{
    QWidget::setTabOrder(prev, ui->payTo);
    QWidget::setTabOrder(ui->payTo, ui->addAsLabel);
    QWidget *w = ui->payAmount->setupTabChain(ui->addAsLabel);
    QWidget::setTabOrder(w, ui->checkboxSubtractFeeFromAmount);
    QWidget::setTabOrder(ui->checkboxSubtractFeeFromAmount, ui->addressBookButton);
    QWidget::setTabOrder(ui->addressBookButton, ui->pasteButton);
    QWidget::setTabOrder(ui->pasteButton, ui->deleteButton);
    return ui->deleteButton;
}

void SendCoinsEntry::setValue(const SendCoinsRecipient &value)
{
    recipient = value;
    {
        // message
        ui->messageTextLabel->setText(recipient.message);
        ui->messageTextLabel->setVisible(!recipient.message.isEmpty());
        ui->messageLabel->setVisible(!recipient.message.isEmpty());

        ui->addAsLabel->clear();
        ui->payTo->setText(recipient.address); // this may set a label from addressbook
        if (!recipient.label.isEmpty()) // if a label had been set from the addressbook, don't overwrite with an empty label
            ui->addAsLabel->setText(recipient.label);
        ui->payAmount->setValue(recipient.amount);
    }
}

void SendCoinsEntry::setAddress(const QString &address)
{
    ui->payTo->setText(address);
    ui->payAmount->setFocus();
}

void SendCoinsEntry::setAmount(const CAmount &amount)
{
    ui->payAmount->setValue(amount);
}

bool SendCoinsEntry::isClear()
{
    return ui->payTo->text().isEmpty() && ui->payTo_is->text().isEmpty() && ui->payTo_s->text().isEmpty();
}

void SendCoinsEntry::setFocus()
{
    ui->payTo->setFocus();
}

void SendCoinsEntry::updateDisplayUnit()
{
    if(model && model->getOptionsModel())
    {
        // Update payAmount with the current unit
        ui->payAmount->setDisplayUnit(model->getOptionsModel()->getDisplayUnit());
        ui->payAmount_is->setDisplayUnit(model->getOptionsModel()->getDisplayUnit());
        ui->payAmount_s->setDisplayUnit(model->getOptionsModel()->getDisplayUnit());
    }
}

void SendCoinsEntry::changeEvent(QEvent* e)
{
    if (e->type() == QEvent::PaletteChange) {
        ui->addressBookButton->setIcon(platformStyle->SingleColorIcon(QStringLiteral(":/icons/address-book")));
        ui->pasteButton->setIcon(platformStyle->SingleColorIcon(QStringLiteral(":/icons/editpaste")));
        ui->deleteButton->setIcon(platformStyle->SingleColorIcon(QStringLiteral(":/icons/remove")));
        ui->deleteButton_is->setIcon(platformStyle->SingleColorIcon(QStringLiteral(":/icons/remove")));
        ui->deleteButton_s->setIcon(platformStyle->SingleColorIcon(QStringLiteral(":/icons/remove")));
    }

    QStackedWidget::changeEvent(e);
}

bool SendCoinsEntry::updateLabel(const QString &address)
{
    if(!model)
        return false;

    // Fill in label from address book, if address has an associated label
    QString associatedLabel = model->getAddressTableModel()->labelForAddress(address);
    if(!associatedLabel.isEmpty())
    {
        ui->addAsLabel->setText(associatedLabel);
        return true;
    }

    return false;
}


text:
package org.apache.commons.digester3;

import static org.apache.commons.digester3.binder.DigesterLoader.newLoader;

import java.io.File;

import org.apache.commons.digester3.binder.AbstractRulesModule;
import org.junit.Test;
import org.xml.sax.ErrorHandler;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;

/**
 * Tests for entity resolution and dtd validation
 */
public class DTDValidationTestCase
{

    @Test( expected = SAXParseException.class )
    public void testDigesterDTDError()
        throws Exception
    {
        newLoader( new AbstractRulesModule() {

            @Override
            protected void configure()
            {
                // do nothing
            }

        } )
        .setValidating( true )
        .setErrorHandler( new ErrorHandler()
        {

            @Override
            public void warning( final SAXParseException e )
                throws SAXException
            {
                throw e;
            }

            @Override
            public void fatalError( final SAXParseException e )
                throws SAXException
            {
                throw e;
            }

            @Override
            public void error( final SAXParseException e )
                throws SAXException
            {
                throw e;
            }

        } )
        .newDigester()
        .parse( new File( "src/test/resources/org/apache/commons/digester3/document-with-relative-dtd-error.xml" ) );
    }

    @Test
    public void testDigesterNoDTDValidation()
        throws Exception
    {
        newLoader( new AbstractRulesModule()
        {

            @Override
            protected void configure()
            {
                // do nothing
            }

        } )
        .setValidating( false )
        .newDigester()
        .parse( new File( "src/test/resources/org/apache/commons/digester3/document-with-relative-dtd-error.xml" ) );
    }

    @Test
    public void testDigesterValidation()
        throws Exception
    {
        newLoader( new AbstractRulesModule()
        {
            @Override
            protected void configure()
            {
                // do nothing
            }
        } )
        .setValidating( true )
        .newDigester()
        .parse( new File( "src/test/resources/org/apache/commons/digester3/document-with-relative-dtd.xml" ) );
    }

    @Test
    public void testDigesterLoaderFeatureDisabled()
        throws Exception
    {
       newLoader( new AbstractRulesModule()
        {

           @Override
            protected void configure()
            {
                // do nothing
            }

        } )
        .setFeature("http://xml.org/sax/features/validation", false)
        .setFeature("http://xml.org/sax/features/external-parameter-entities", false)
        .setFeature("http://apache.org/xml/features/nonvalidating/load-dtd-grammar", false)
        .setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false)
        .newDigester()
        .parse( new File( "src/test/resources/org/apache/commons/digester3/document-with-relative-dtd-error.xml" ) );
    }

}


text:
  template<typename A1, typename A2, typename ... BindArgs> \
    slot(const A1 &arg1, const A2 &arg2, const BindArgs & ... args) \
  { \
    init_slot_function(boost::bind(arg1, arg2, args...)); \
  }

#include <boost/signals2/detail/slot_template.hpp>
#endif // BOOST_SIGNALS2_VARIADIC_SLOT_HPP


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:pixlui="http://schemas.android.com/apk/com.neopixl.pixlui"
    android:orientation="vertical"
    android:background="@color/common_background"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <View
        android:layout_width="match_parent"
        android:layout_height="160dp" />

    <com.neopixl.pixlui.components.textview.TextView
        android:text="Email"
        android:textSize="@dimen/login_label_text_size"
        android:textColor="@color/text_color_price"
        pixlui:typeface="HelveticaNeue.ttf"
        android:gravity="left"
        android:layout_marginLeft="@dimen/login_side_margin"
        android:layout_marginRight="@dimen/login_side_margin"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

    <com.neopixl.pixlui.components.edittext.EditText
        android:id="@+id/email"
        android:text="login"
        android:textSize="@dimen/single_brand_font_size"
        android:textColor="@color/text_color_price"
        pixlui:typeface="HelveticaNeue.ttf"
        android:paddingBottom="@dimen/single_upper_text_padding_vertical"
        android:paddingTop="@dimen/single_upper_text_padding_vertical"

        android:layout_marginLeft="@dimen/login_side_margin"
        android:layout_marginRight="@dimen/login_side_margin"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

    <View
        android:layout_width="match_parent"
        android:layout_height="10dp" />

    <com.neopixl.pixlui.components.textview.TextView
        android:text="Password"
        android:textSize="@dimen/login_label_text_size"
        android:textColor="@color/text_color_price"
        pixlui:typeface="HelveticaNeue.ttf"
        android:gravity="left"
        android:layout_marginLeft="@dimen/login_side_margin"
        android:layout_marginRight="@dimen/login_side_margin"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

    <com.neopixl.pixlui.components.edittext.EditText
        android:id="@+id/pass"
        android:text="input password"

        android:textSize="@dimen/single_brand_font_size"
        android:textColor="@color/text_color_price"
        pixlui:typeface="HelveticaNeue.ttf"
        android:paddingBottom="@dimen/single_upper_text_padding_vertical"
        android:paddingTop="@dimen/single_upper_text_padding_vertical"

        android:layout_marginLeft="@dimen/login_side_margin"
        android:layout_marginRight="@dimen/login_side_margin"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

    <View
        android:layout_width="match_parent"
        android:layout_height="20dp" />

    <com.hkm.ui.processbutton.iml.ActionProcessButton
        android:layout_marginLeft="@dimen/login_side_margin"
        android:layout_marginRight="@dimen/login_side_margin"
        android:id="@+id/action_now"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        style="@style/LoadButton" />

    <View
        android:layout_width="match_parent"
        android:layout_height="20dp" />

    <com.neopixl.pixlui.components.textview.TextView
        android:layout_marginLeft="@dimen/login_side_margin"
        android:layout_marginRight="@dimen/login_side_margin"
        android:textColor="@color/second_pref_v2"
        android:text="@string/reg_notice"
        android:textSize="@dimen/login_notice_text_size"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

    <View
        android:layout_width="match_parent"
        android:layout_height="60dp" />

    <com.neopixl.pixlui.components.textview.TextView
        android:id="@+id/switch_to_login"
        android:text="existing account"
        android:textSize="@dimen/single_brand_font_size"
        android:textColor="@color/text_color_price"
        pixlui:typeface="HelveticaNeue.ttf"
        android:gravity="center_horizontal"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

</LinearLayout>


text:
package com.iluwatar.model.view.controller;

/**
 * GiantController can update the giant data and redraw it using the view.
 */
public class GiantController {

  private GiantModel giant;
  private GiantView view;

  public GiantController(GiantModel giant, GiantView view) {
    this.giant = giant;
    this.view = view;
  }

  public Health getHealth() {
    return giant.getHealth();
  }

  public void setHealth(Health health) {
    this.giant.setHealth(health);
  }

  public Fatigue getFatigue() {
    return giant.getFatigue();
  }

  public void setFatigue(Fatigue fatigue) {
    this.giant.setFatigue(fatigue);
  }

  public Nourishment getNourishment() {
    return giant.getNourishment();
  }

  public void setNourishment(Nourishment nourishment) {
    this.giant.setNourishment(nourishment);
  }

  public void updateView() {
    this.view.displayGiant(giant);
  }
}


text:
package org.codehaus.mojo.animal_sniffer.logging;

import java.io.StringWriter;
import java.io.PrintWriter;
import java.io.PrintStream;

/**
 * Default implementation that sends output to a print writer
 *
 * @author connollys
 * @since 1.3
 */
public final class PrintWriterLogger
    implements Logger
{
    private final PrintStream destination;

    public PrintWriterLogger( PrintStream destination )
    {
        this.destination = destination;
    }

    public void info( String message )
    {
        output( "[INFO]", message, null );
    }

    public void info( String message, Throwable t )
    {
        output( "[INFO]", message, t );
    }

    public void debug( String message )
    {
    }

    public void debug( String message, Throwable t )
    {
    }

    public void warn( String message )
    {
        output( "[WARN]", message, null );
    }

    public void warn( String message, Throwable t )
    {
        output( "[WARN]", message, t );
    }

    public void error( String message )
    {
        output( "[ERROR]", message, null );
    }

    public void error( String message, Throwable t )
    {
        output( "[ERROR]", message, t );
    }

    private void output( String prefix, String message, Throwable t )
    {
        StringWriter w = new StringWriter( );
        PrintWriter pw = new PrintWriter( w );
        pw.print( prefix );
        pw.print( ' ' );
        pw.println( message );
        if ( t != null )
        {
            t.printStackTrace( pw );
        }
        pw.close();
        destination.print( w.toString() );
        destination.flush();
    }
}


text:
require "open-uri"
class CallbacksController < Devise::OmniauthCallbacksController

  def github
  @user = User.find_by(email: request.env["omniauth.auth"]["info"]["email"] )

     if @user
         sign_in(@user)
         redirect_to user_profile_path @user
     else
        @user = User.from_omniauth(request.env["omniauth.auth"])
        sign_in_and_redirect @user
      end
  end
end


text:
package scutil.net.extension

import java.net.*

object InetAddressExtensions {
	implicit final class InetAddressExt(peer:InetAddress) {
		def socketAddress(port:Int):InetSocketAddress	=
			new InetSocketAddress(peer, port)
	}
}


text:
@implementation NSString (Extend)

NSString *const saveFilePath = @"uploadPhoto";

+ (NSString *)md5String:(NSString *)string {
    const char *cStr = [string UTF8String];
    unsigned char result[CC_MD5_DIGEST_LENGTH];
    CC_MD5(cStr, strlen(cStr), result);

    return [[NSString stringWithFormat:@"%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X",
             result[0], result[1], result[2], result[3],
             result[4], result[5], result[6], result[7],
             result[8], result[9], result[10], result[11],
             result[12], result[13], result[14], result[15]
             ] lowercaseString];
}

+ (CGSize)sizeWithString:(NSString *)string font:(UIFont *)font space:(CGFloat)space {
    CGRect rect = [string boundingRectWithSize:CGSizeMake([UIScreen mainScreen].bounds.size.width - space, 90000)//限制最大的宽度和高度
                                       options:NSStringDrawingTruncatesLastVisibleLine | NSStringDrawingUsesFontLeading  |NSStringDrawingUsesLineFragmentOrigin//采用换行模式
                                    attributes:@{NSFontAttributeName: font}//传人的字体字典
                                       context:nil];
    return rect.size;
}

+ (CGSize)sizeWithString:(NSString *)string font:(UIFont *)font maxSize:(CGSize) maxSize {
    CGRect rect = [string boundingRectWithSize:maxSize//限制最大的宽度和高度
                                       options:NSStringDrawingUsesFontLeading | NSStringDrawingUsesLineFragmentOrigin//采用换行模式
                                    attributes:@{NSFontAttributeName: font}//传人的字体字典
                                       context:nil];
    return rect.size;
}

//过滤表情
+ (NSString *)filterEmoji:(NSString *)string {
    NSUInteger len = [string lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
    const char *utf8 = [string UTF8String];
    char *newUTF8 = malloc( sizeof(char) * len );
    int j = 0;

    //0xF0(4) 0xE2(3) 0xE3(3) 0xC2(2) 0x30---0x39(4)
    for ( int i = 0; i < len; i++ ) {
        unsigned int c = utf8;
        BOOL isControlChar = NO;
        if ( c == 4294967280 ||
            c == 4294967089 ||
            c == 4294967090 ||
            c == 4294967091 ||
            c == 4294967092 ||
            c == 4294967093 ||
            c == 4294967094 ||
            c == 4294967095 ||
            c == 4294967096 ||
            c == 4294967097 ||
            c == 4294967088 ) {
            i = i + 3;
            isControlChar = YES;
        }
        if ( c == 4294967266 || c == 4294967267 ) {
            i = i + 2;
            isControlChar = YES;
        }
        if ( c == 4294967234 ) {
            i = i + 1;
            isControlChar = YES;
        }
        if ( !isControlChar ) {
            newUTF8[j] = utf8;
            j++;
        }
    }
    newUTF8[j] = '\0';
    NSString *encrypted = [NSString stringWithCString:(const char*)newUTF8
                                             encoding:NSUTF8StringEncoding];
    free( newUTF8 );
    return encrypted;
}

//是否含有表情
+ (BOOL)stringContainsEmoji:(NSString *)string {
    __block BOOL returnValue = NO;

    [string enumerateSubstringsInRange:NSMakeRange(0, [string length])
                               options:NSStringEnumerationByComposedCharacterSequences
                            usingBlock:^(NSString *substring, NSRange substringRange, NSRange enclosingRange, BOOL *stop) {
                                const unichar hs = [substring characterAtIndex:0];
                                if (0xd800 <= hs && hs <= 0xdbff) {
                                    if (substring.length > 1) {
                                        const unichar ls = [substring characterAtIndex:1];
                                        const int uc = ((hs - 0xd800) * 0x400) + (ls - 0xdc00) + 0x10000;
                                        if (0x1d000 <= uc && uc <= 0x1f77f) {
                                            returnValue = YES;
                                        }
                                    }
                                } else if (substring.length > 1) {
                                    const unichar ls = [substring characterAtIndex:1];
                                    if (ls == 0x20e3) {
                                        returnValue = YES;
                                    }
                                } else {
                                    if (0x2100 <= hs && hs <= 0x27ff) {
                                        returnValue = YES;
                                    } else if (0x2B05 <= hs && hs <= 0x2b07) {
                                        returnValue = YES;
                                    } else if (0x2934 <= hs && hs <= 0x2935) {
                                        returnValue = YES;
                                    } else if (0x3297 <= hs && hs <= 0x3299) {
                                        returnValue = YES;
                                    } else if (hs == 0xa9 || hs == 0xae || hs == 0x303d || hs == 0x3030 || hs == 0x2b55 || hs == 0x2b1c || hs == 0x2b1b || hs == 0x2b50) {
                                        returnValue = YES;
                                    }
                                }
                            }];

    return returnValue;
}

//检测输入的汉字数 (汉字占 2位 表情占 4位 其余占1位)
+ (NSInteger)stringCount:(NSString*)string {
    NSStringEncoding enc = CFStringConvertEncodingToNSStringEncoding(kCFStringEncodingGB_18030_2000);
    NSData* da = [string dataUsingEncoding:enc];
    return [da length];
}

+ (NSString *)saveImage:(NSData *)imageData imageName:(NSString *)imageName {
    NSString *resultPath;

    //    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *tempPath = NSTemporaryDirectory();
    NSFileManager *fileManager = [NSFileManager defaultManager];
    NSString *testDirectory = [tempPath stringByAppendingPathComponent:saveFilePath];
    // 创建目录
    [fileManager createDirectoryAtPath:testDirectory withIntermediateDirectories:YES attributes:nil error:nil];
    //创建文件
    if (imageData) {
        resultPath = [testDirectory stringByAppendingString:[NSString stringWithFormat:@"/%@",imageName]];
        [fileManager createFileAtPath:resultPath contents:imageData attributes:nil];
    }
    NSLog(@"resultPath-----:%@",resultPath);
    return resultPath;
}

+ (void)deleteTemSaveImageWithFilePath:(NSString *)imageName {

    NSFileManager *fileManager = [NSFileManager defaultManager];

    NSString *tempPath = NSTemporaryDirectory();
    NSString *testDirectory = [tempPath stringByAppendingPathComponent:saveFilePath];
    NSString *resultPath = [testDirectory stringByAppendingString:[NSString stringWithFormat:@"/%@",imageName]];
    // 删除文件/文件夹
    [fileManager removeItemAtPath:resultPath error:nil];
}

+ (NSAttributedString *)htmlDetailContentWithText:(NSString *)text {
    NSString *htmlStr = [NSString stringWithFormat:@"<html><body>%@<body/><html>", text];
    NSAttributedString * attrStr = [[NSAttributedString alloc] initWithData:[htmlStr dataUsingEncoding:NSUnicodeStringEncoding] options:@{ NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType } documentAttributes:nil error:nil];
    return attrStr;
}

- (NSString *)stringByTrim {
    NSCharacterSet *set = [NSCharacterSet whitespaceAndNewlineCharacterSet];
    return [self stringByTrimmingCharactersInSet:set];
}

+ (NSString *)characterSet1:(NSString *)string {

    NSCharacterSet *characterSet1 = [NSCharacterSet characterSetWithCharactersInString:@"<p/brh>"];
    // 将string1按characterSet1中的元素分割成数组
    NSArray *array1 = [string componentsSeparatedByCharactersInSet:characterSet1];

    for(NSString *string1 in array1) {
        if ([string1 length]>0) {
            // 此处string即为中文字符串
            return string1;
        }
    }
    return string;
}

+ (NSString *)deltaTime:(NSString *)timeStr {
    NSDateFormatter *fmt = [[NSDateFormatter alloc] init];
    fmt.dateFormat = @"yyyy-mm-dd HH:mm:ss";
    NSDate *send = [fmt dateFromString:timeStr];
    NSDate *now = [NSDate date];
    // 获得时间的间隔
    NSString *resultTimeStr = nil;
    NSTimeInterval delta = [now timeIntervalSinceDate:send];
    if (delta < 60) { // 一分钟内
        resultTimeStr = @"刚刚";
    } else if (delta < 60 * 60) { // 一个小时内
        resultTimeStr = [NSString stringWithFormat:@"%.f分钟前", delta/60];
    } else if (delta < 60 * 60 * 24) { // 一天内
        resultTimeStr = [NSString stringWithFormat:@"%.f小时前", delta/60/60];
    }else if (delta < 60 * 60 * 24 * 2) { // 两天内
        resultTimeStr = [NSString stringWithFormat:@"昨天"];
    } else { // 几天前
        fmt.dateFormat = @"MM月dd日";
        resultTimeStr = [fmt stringFromDate:send];
    }
    return resultTimeStr;

}

// 将十六进制的字符串转换成NSString
+ (NSString *)convertHexStrToString:(NSString *)str {
    if (!str || [str length] == 0) {
        return nil;
    }

    NSMutableData *hexData = [[NSMutableData alloc] initWithCapacity:8];
    NSRange range;
    if ([str length] % 2 == 0) {
        range = NSMakeRange(0, 2);
    } else {
        range = NSMakeRange(0, 1);
    }
    for (NSInteger i = range.location; i < [str length]; i += 2) {
        unsigned int anInt;
        NSString *hexCharStr = [str substringWithRange:range];
        NSScanner *scanner = [[NSScanner alloc] initWithString:hexCharStr];

        [scanner scanHexInt:&anInt];
        NSData *entity = [[NSData alloc] initWithBytes:&anInt length:1];
        [hexData appendData:entity];

        range.location += range.length;
        range.length = 2;
    }
    NSString *string = [[NSString alloc]initWithData:hexData encoding:NSUTF8StringEncoding];
    return string;
}

// 将NSString转换成十六进制的字符串
+ (NSString *)convertStringToHexStr:(NSString *)str {
    if (!str || [str length] == 0) {
        return @"";
    }
    NSData *data = [str dataUsingEncoding:NSUTF8StringEncoding];

    NSMutableString *string = [[NSMutableString alloc] initWithCapacity:[data length]];

    [data enumerateByteRangesUsingBlock:^(const void *bytes, NSRange byteRange, BOOL *stop) {
        unsigned char *dataBytes = (unsigned char*)bytes;
        for (NSInteger i = 0; i < byteRange.length; i++) {
            NSString *hexStr = [NSString stringWithFormat:@"%x", (dataBytes[i]) & 0xff];
            if ([hexStr length] == 2) {
                [string appendString:hexStr];
            } else {
                [string appendFormat:@"0%@", hexStr];
            }
        }
    }];

    return string;
}
@end


text:
def visit_handler(instance, **kwargs):
    return instance, kwargs.get('user', None)


text:
package com.blazebit.persistence.view.testsuite.update.embeddable.nested;

import com.blazebit.persistence.testsuite.base.jpa.category.NoDatanucleus;
import com.blazebit.persistence.testsuite.base.jpa.category.NoEclipselink;
import com.blazebit.persistence.testsuite.entity.NameObject;
import com.blazebit.persistence.view.FlushMode;
import com.blazebit.persistence.view.FlushStrategy;
import com.blazebit.persistence.view.testsuite.update.embeddable.nested.model.SimpleEmbeddableEntityView;
import com.blazebit.persistence.view.testsuite.update.embeddable.nested.model.SimpleIntIdEntityView;
import com.blazebit.persistence.view.testsuite.update.embeddable.nested.model.SimpleNameObjectView;
import com.blazebit.persistence.view.testsuite.update.embeddable.nested.model.UpdatableEmbeddableEntityWithMapsEmbeddableViewBase;
import com.blazebit.persistence.view.testsuite.update.embeddable.nested.model.UpdatableEmbeddableEntityWithMapsViewBase;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;

import java.util.HashMap;

/**
 *
 * @author Christian Beikov
 * @since 1.3.0
 */
@RunWith(Parameterized.class)
// NOTE: No Datanucleus support yet
@Category({ NoDatanucleus.class, NoEclipselink.class})
public abstract class AbstractEntityViewUpdateNestedEmbeddableMapsTest<T extends UpdatableEmbeddableEntityWithMapsViewBase> extends AbstractEntityViewUpdateNestedEmbeddableEntityTest<T> {

    public AbstractEntityViewUpdateNestedEmbeddableMapsTest(FlushMode mode, FlushStrategy strategy, boolean version, Class<T> viewType) {
        super(mode, strategy, version, viewType, UpdatableEmbeddableEntityWithMapsEmbeddableViewBase.class);
    }

    public T updateReplaceCollection() {
        // Given
        final T docView = getEnt1View();
        clearQueries();

        // When
        docView.getEmbeddable().setManyToMany(new HashMap<>(docView.getEmbeddable().getManyToMany()));
        docView.getEmbeddable().setElementCollection(new HashMap<>(docView.getEmbeddable().getElementCollection()));
        return docView;
    }

    public T updateAddToCollection() {
        // Given
        final T docView = getEnt1View();
        clearQueries();

        // When
        docView.getEmbeddable().getManyToMany().put("b", evm.getReference(SimpleIntIdEntityView.class, intIdEntity2.getId()));
        SimpleNameObjectView nameObjectView = evm.create(SimpleNameObjectView.class);
        nameObjectView.setPrimaryName("newPrimaryName");
        nameObjectView.setSecondaryName("newSecondaryName");
        docView.getEmbeddable().getElementCollection().put("newPrimaryName", nameObjectView);
        return docView;
    }

    public T updateAddToNewCollection() {
        // Given
        final T docView = getEnt1View();
        clearQueries();

        // When
        docView.getEmbeddable().setManyToMany(new HashMap<>(docView.getEmbeddable().getManyToMany()));
        docView.getEmbeddable().setElementCollection(new HashMap<>(docView.getEmbeddable().getElementCollection()));
        docView.getEmbeddable().getManyToMany().put("b", evm.getReference(SimpleIntIdEntityView.class, intIdEntity2.getId()));
        SimpleNameObjectView nameObjectView = evm.create(SimpleNameObjectView.class);
        nameObjectView.setPrimaryName("newPrimaryName");
        nameObjectView.setSecondaryName("newSecondaryName");
        docView.getEmbeddable().getElementCollection().put("newPrimaryName", nameObjectView);
        return docView;
    }

}