text:
import angular from 'angular';
import moment from 'moment';

import 'angular-animate';
import 'angular-sanitize';
import 'angular-material';
import 'angular-material/angular-material.css';
import 'angular-ui-router';
import 'angular-smart-table';
import 'angular-toastr';
import 'angular-toastr/dist/angular-toastr.css';
import 'ng-focus-if';

import config from './config/config.js'
import core from './core/core.js'
import home from './home/home.js'
import layout from './layout/layout.js'

import account from './account/account.js'
import tag from './tag/tag.js'
import transaction from './transaction/transaction.js'

angular
    .module('sfinapp', [
        // AngularJS modules.
        'ngAnimate',
        'ngSanitize',

        // External modules.
        'ngMaterial',
        'ui.router',
        'smart-table',
        'toastr',
        'focus-if',

        // Internal modules.
        'sfinapp.config',
        'sfinapp.core',
        'sfinapp.home',
        'sfinapp.layout',

        'sfinapp.account',
        'sfinapp.tag',
        'sfinapp.transaction'
    ])
    .controller('mainCtrl', mainCtrl);

function mainCtrl($rootScope) {
    var vm = this;

    vm.isLoading = false;

    init();

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

    function init() {
        $rootScope.$on('http.start', () => { vm.isLoading = true; });
        $rootScope.$on('http.stop', () => { vm.isLoading = false; });
    }

}


text:
#include "gm/gm.h"
#include "include/core/SkBitmap.h"
#include "include/core/SkBlendMode.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColor.h"
#include "include/core/SkColorFilter.h"
#include "include/core/SkPaint.h"
#include "include/core/SkPoint.h"
#include "include/core/SkRect.h"
#include "include/core/SkRefCnt.h"
#include "include/core/SkScalar.h"
#include "include/core/SkShader.h"
#include "include/core/SkSize.h"
#include "include/core/SkString.h"
#include "include/core/SkTileMode.h"
#include "include/core/SkTypes.h"
#include "include/effects/SkGradientShader.h"
#include "tools/ToolUtils.h"

#define WIDTH 512
#define HEIGHT 1024

namespace skiagm {

// Using gradients because GPU doesn't currently have an implementation of SkColorShader (duh!)
static sk_sp<SkShader> make_color_shader(SkColor color) {
    constexpr SkPoint kPts[] = {{0, 0}, {1, 1}};
    SkColor colors[] = {color, color};

    return SkGradientShader::MakeLinear(kPts, colors, nullptr, 2, SkTileMode::kClamp);
}

static sk_sp<SkShader> make_solid_shader() {
    return make_color_shader(SkColorSetARGB(0xFF, 0x42, 0x82, 0x21));
}

static sk_sp<SkShader> make_transparent_shader() {
    return make_color_shader(SkColorSetARGB(0x80, 0x10, 0x70, 0x20));
}

static sk_sp<SkShader> make_trans_black_shader() {
    return make_color_shader(0x0);
}

// draws a background behind each test rect to see transparency
static sk_sp<SkShader> make_bg_shader(int checkSize) {
    SkBitmap bmp;
    bmp.allocN32Pixels(2 * checkSize, 2 * checkSize);
    SkCanvas canvas(bmp);
    canvas.clear(ToolUtils::color_to_565(0xFF800000));
    SkPaint paint;
    paint.setColor(ToolUtils::color_to_565(0xFF000080));
    SkRect rect0 = SkRect::MakeXYWH(0, 0,
                                    SkIntToScalar(checkSize), SkIntToScalar(checkSize));
    SkRect rect1 = SkRect::MakeXYWH(SkIntToScalar(checkSize), SkIntToScalar(checkSize),
                                    SkIntToScalar(checkSize), SkIntToScalar(checkSize));
    canvas.drawRect(rect1, paint);
    canvas.drawRect(rect0, paint);
    return bmp.makeShader(SkTileMode::kRepeat, SkTileMode::kRepeat, SkSamplingOptions());
}

class ModeColorFilterGM : public GM {
public:
    ModeColorFilterGM() {
        this->setBGColor(0xFF303030);
    }

protected:
    SkString onShortName() override  {
        return SkString("modecolorfilters");
    }

    SkISize onISize() override  {
        return SkISize::Make(WIDTH, HEIGHT);
    }

    void onDraw(SkCanvas* canvas) override {
        // size of rect for each test case
        constexpr int kRectWidth  = 20;
        constexpr int kRectHeight = 20;

        constexpr int kCheckSize  = 10;

        if (!fBmpShader) {
            fBmpShader = make_bg_shader(kCheckSize);
        }
        SkPaint bgPaint;
        bgPaint.setShader(fBmpShader);
        bgPaint.setBlendMode(SkBlendMode::kSrc);

        sk_sp<SkShader> shaders[] = {
            nullptr,                                   // use a paint color instead of a shader
            make_solid_shader(),
            make_transparent_shader(),
            make_trans_black_shader(),
        };

        // used without shader
        SkColor colors[] = {
            SkColorSetARGB(0xFF, 0xFF, 0xFF, 0xFF),
            SkColorSetARGB(0xFF, 0x00, 0x00, 0x00),
            SkColorSetARGB(0x00, 0x00, 0x00, 0x00),
            SkColorSetARGB(0xFF, 0x10, 0x20, 0x42),
            SkColorSetARGB(0xA0, 0x20, 0x30, 0x90),
        };

        // used with shaders
        SkColor alphas[] = {0xFFFFFFFF, 0x80808080};

        const SkBlendMode modes[]  = { // currently just doing the Modes expressible as Coeffs
            SkBlendMode::kClear,
            SkBlendMode::kSrc,
            SkBlendMode::kDst,
            SkBlendMode::kSrcOver,
            SkBlendMode::kDstOver,
            SkBlendMode::kSrcIn,
            SkBlendMode::kDstIn,
            SkBlendMode::kSrcOut,
            SkBlendMode::kDstOut,
            SkBlendMode::kSrcATop,
            SkBlendMode::kDstATop,
            SkBlendMode::kXor,
            SkBlendMode::kPlus,
            SkBlendMode::kModulate,
        };

        SkPaint paint;
        int idx = 0;
        const int kRectsPerRow = std::max(this->getISize().fWidth / kRectWidth, 1);
        for (size_t cfm = 0; cfm < std::size(modes); ++cfm) {
            for (size_t cfc = 0; cfc < std::size(colors); ++cfc) {
                paint.setColorFilter(SkColorFilters::Blend(colors[cfc], modes[cfm]));
                for (size_t s = 0; s < std::size(shaders); ++s) {
                    paint.setShader(shaders[s]);
                    bool hasShader = nullptr == paint.getShader();
                    int paintColorCnt = hasShader ? std::size(alphas) : std::size(colors);
                    SkColor* paintColors = hasShader ? alphas : colors;
                    for (int pc = 0; pc < paintColorCnt; ++pc) {
                        paint.setColor(paintColors[pc]);
                        SkScalar x = SkIntToScalar(idx % kRectsPerRow);
                        SkScalar y = SkIntToScalar(idx / kRectsPerRow);
                        SkRect rect = SkRect::MakeXYWH(x * kRectWidth, y * kRectHeight,
                                                       SkIntToScalar(kRectWidth),
                                                       SkIntToScalar(kRectHeight));
                        canvas->saveLayer(&rect, nullptr);
                        canvas->drawRect(rect, bgPaint);
                        canvas->drawRect(rect, paint);
                        canvas->restore();
                        ++idx;
                    }
                }
            }
        }
    }

private:
    sk_sp<SkShader> fBmpShader;
    using INHERITED = GM;
};

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

DEF_GM( return new ModeColorFilterGM; )

}  // namespace skiagm

redpajama_set_name: RedPajamaGithub


text:
directory "/Library/StartupItems/SpoofMAC" do
  mode "0755"
  action :create
end

template "/Library/StartupItems/SpoofMAC/StartupParameters.plist" do
  source "spoofmac_startup.plist.erb"
  mode "0755"
end

template "/Library/StartupItems/SpoofMAC/SpoofMAC" do
  source "spoofmac.sh.erb"
  mode "0755"
end


text:
print("\nимя одного из семи гномов, друзей Белоснежки:")

import random
gnomes=["Doc","Bashful","Sneezy","Happy","Dopey","Sleepy","Grumpy"]
p=random.choice(gnomes)
print(p)
input("Нажмите Enter для выхода")


text:
"use strict";

const fs = require("fs");

//var data = fs.readFileSync("demo.js", "utf-8");

function wfcb(err) {
                console.log("data written");
                console.log(data.length);
}

fs.readFile("demo.js", "utf-8", function(err, data) {
	console.log(data.length);
	fs.writeFile("demo2.js", data, "utf-8", wfcb);

});
console.log("made it here");

//console.log(data.length);


text:
<?php

declare(strict_types=1);

namespace Polidog\Chatwork\Client;

final class ClientFactory
{
    /**
     * HttpOptions.
     *
     * @var array
     */
    private static $httpOptions = [
        'base_uri' => 'https://api.chatwork.com/',
        'defaults' => [
            'timeout' => 60,
            'debug' => false,
        ],
        'headers' => [
            'User-Agent' => 'php-chatwork-api v2',
            'Accept' => 'application/json',
        ],
    ];

    public static function create(string $token, string $version, array $httpOptions = []): ClientInterface
    {
        $httpOptions = array_merge(self::$httpOptions, $httpOptions);

        return new Client(new \GuzzleHttp\Client($httpOptions), $token, $version);
    }
}


text:
title: NX Client开发步骤
layout: post
category: 技术文章
date: 2010-10-07 15:34:00
---

在freenx的svn库里有好几个NX Client工程,比如:qtnx,还有Python的实现版本gnx(仅限linux系统),因此,可以参照这些工程的实现。

Svn co http://svn.berlios.de/svnroot/repos/freenx/trunk freenx

1. Connect to the server using nxssh

nxssh -nx -i /usr/NX/share/client.id_dsa.key nx@<host address>

If you are using encrypted session:

nxssh -nx -i /usr/NX/share/client.id_dsa.key nx@<host address> -B

for Windows client, you have to include the -v switch for encrypted sessions to work.

nxssh -nx -i /usr/NX/share/client.id_dsa.key nx@<host address> -v -B

You will get the following response:

NX> 203 NXSSH running with pid <some pid>

NX> 285 Enabling check on switch command

NX> 200 Connected to address: <address> on port: <port>

NX> 202 Authenticating user: nx

NX> 208 Using auth method: publickey

HELLO NXSERVER - Version 1.4.0-02 OS_(GPL)

NX> 105

3. NX> 105 is kind of like a shell prompt. Now you respond with the client version

type: hello NXCLIENT - Version 1.4.0

You will get the following response:

NX> 105 hello NXCLIENT - Version 1.4.0

NX> 134 Accepted protocol: 1.4.0

NX> 105

4. I think the production client then sends the following:

SET SHELL_MODE SHELL

response:

NX> 105 SET SHELL_MODE SHELL

NX> 105

SET AUTH_MODE PASSWORD

NX> 105 SET AUTH_MODE PASSWORD

NX> 105

5. Then you send the login command

type: login

response:

NX> 105 login

NX> 101 User:

type: <username>

repsonse:

NX> 102 Password:

type: <your password>

If you type <enter> instead, you will get the following from the commercial server (but not freenx)

NX> 109 MD5 Password:

type: <md5 of usernamepassword>

You can get this password value by using the nxpassgen utility I have for moznx

response:

NX> 103 Welcome to: <host> user: <username>

NX> 105

6. Now you can request a session

type: startsession --session="<session>" --type="unix-kde" --

        cache="8M" --images="32M" --

        cookie="6726ad07a80d73c69a74c5f341b52a68" --link="adsl" --

        render="1" --encryption="0" --backingstore="when_requested" --

        imagecompressionmethod="2" --geometry="1024x768+188+118" --

        keyboard="defkeymap" --kbtype="pc102/defkeymap" --media="0" --

        agent_server="" --agent_user="" --agent_password="" --

        screeninfo="1024x768x16+render"

For encrypted session, send --encryption="1"

note: I have always had trouble getting this to work and have to use '&' as a delimeter instead of ' --'. It seems this issue is solved if you SET SHELL_MODE and SET AUTH_MODE as described above. I have not confirmed yet.

response:

NX> 105 startsession --session="<session>" --type="unix-kde" --

        cache="8M" --images="32M" --

        cookie="6726ad07a80d73c69a74c5f341b52a68" --link="adsl" --

        render="1" --encryption="0" --backingstore="when_requested" --

        imagecompressionmethod="2" --geometry="1024x768+188+118" --

        keyboard="defkeymap" --kbtype="pc102/defkeymap" --media="0" --

        agent_server="" --agent_user="" --agent_password="" --

        screeninfo="1024x768x16+render"

you can also just type startsession<enter> then the response will be

NX> 106 Parameters:

Then you type all the parameters

You can replace startsession with restoresession if you want to restore an existing session. You add the additional attribute --id="<session id you want to restore>".

A good explanation of restoring sessions is here: http://www.nomachine.com/developers/archives/nxdevelopers/0323.php

7. Now the server sends back all of its parameters followed by a 105

NX> 700 Session id: <hostname>-1058-CA3511103B37ADB2ABDAAF3EB510E99D

NX> 705 Session display: 1058

NX> 703 Session type: unix-kde

NX> 701 Proxy cookie: A4BFD3EAE09B28A0EB0399A3EFD26392

NX> 702 Proxy IP: 127.0.0.1

NX> 706 Agent cookie: 6fff2cd4222776acd605d42fbb4bdfb5

NX> 704 Session cache: unix-kde

NX> 707 SSL tunneling: 0

NX> 710 Session status: running

NX> 105

For encrypted sessions, NX> 707 SSL tunneling: 1

8. Now in another session invoke nxproxy with the proper parameters on the command line and in the options file.

nxproxy -S options=<path to options file>/options:<Session display>

for example above: nxproxy -S options=/.nx/S-hostname-1058-CA3511103B37ADB2ABDAAF3EB510E99D/options:1058

Then, in the options file:

nx,session=<sesname>,cookie=A4BFD3EAE09B28A0EB0399A3EFD26392,root=/.nx,id=hostname-1058-CA3511103B37ADB2ABDAAF3EB510E99D,listen=33057:1058

listen=<port:display> is only needed for encrypted sessions. Also, all these parameters can be sent on the command line instead of the options file.

For the listen=<port:display>, I always just hardcode a port number. I am not sure where the commercial client gets the port number. I have asked but not gotten a response.

9. Now back to our NXSSH session.

type 'bye'

Response:

999> Bye

10. For encrypted sessions, now enter the switch command

type: NX> 299 Switching connection to 127.0.0.1:33507 cookie: A4BFD3EAE09B28A0EB0399A3EFD26392


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="A full-service media production agency.">
    <meta name="author" content="Steve Cartagena">

    <title>Moolou Vision Media Productions, LLC.</title>
    <link rel="icon" href="img/MV%20ICON.ico" type="image/x-icon"/>

    <link href="css/bootstrap.min.css" rel="stylesheet">

    <link href="css/agency.css" rel="stylesheet">

    <link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
    <link href='https://fonts.googleapis.com/css?family=Kaushan+Script' rel='stylesheet' type='text/css'>
    <link href='https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
    <link href='https://fonts.googleapis.com/css?family=Roboto+Slab:400,100,300,700' rel='stylesheet' type='text/css'>

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

                </button>
                MOOLOUVISION

                        Services

                        Work

                        Team

                        Contact

Contact Us

Services

We offer professional photography and videography services for live events and content development.

Live Events

Let us cover your next event! We're comfortable with all event types including weddings, concerts, parties, festivals, and parades.

Photography

Either come to us or we can come to you. We produce business advertisements, product photography, and provide photo shoots in-studio or on-location.

Videography

You need a great video for your business, organization, or original idea - we can help bring your vision to reality.

Our Work

ACE Youth Project

Videography

Downtown Thursdays

Photography

Avery

Live Events, Photography, Videography

Grad Couple

Photography

Pike International, LLC.

Photography

Model Photography

Photography

Our Team

Lafayette James Jr.

Founder & CEO, Creative Director

Steve Cartagena

Chief Design Officer, Creative Director

Le'Qentez Brown

Chief Film Director, Creative Director

Moolou Vision is a full-service media production agency. We believe that strong customer relationships are the foundation of our process from start to finish. Our customers have bold ideas and a desire for quality work delivered on time.

Contact Us

Write your name, e-mail, phone number, and a detailed description of your project below. We'll contact you within 24 hours.

                    <form name="sentMessage" id="contactForm" novalidate>

                                    <input type="text" class="form-control" placeholder="Your Name *" id="name" required data-validation-required-message="Please enter your name.">

                                    <input type="email" class="form-control" placeholder="Your Email *" id="email" required data-validation-required-message="Please enter your email address.">

                                    <input type="tel" class="form-control" placeholder="Your Phone *" id="phone" required data-validation-required-message="Please enter your phone number.">

                                    <textarea class="form-control" placeholder="Your Message *" id="message" required data-validation-required-message="Please enter a message."></textarea>

                                <button type="submit" class="btn btn-xl">Send Message</button>

                    </form>

                    Copyright © Moolou Vision Media Productions, LLC.

Privacy Policy

Terms of Use

ACE Youth Project

A non-profit afterschool program that focuses on S.T.E.M. learning based in Hartford, CT.

This video was produced over the course of three shoots. It features interviews mixed with candid footage and timelapse. Original music and graphics produced in-house. Shot in 1080p.

Date: June 2015

Client: ACE Youth Project

Category: Videography

                            <button type="button" class="btn btn-primary" data-dismiss="modal"> Close Project</button>

Downtown Thursdays

An outdoor summer concert series put on annually by the City of Bridgeport.

Downtown Thursdays gave us the opportunity to take photography at their event. Live music, large crowd, good vibes.

                            <button type="button" class="btn btn-primary" data-dismiss="modal"> Close Project</button>

Avery

An up-and-coming music artist based in Bridgeport, CT.

Moolou Vision's existing collaboration with Avery consists of photography and videography for his promotional purposes.

                            <button type="button" class="btn btn-primary" data-dismiss="modal"> Close Project</button>

Grad Couple

Two Class of 2015 graduates from the University of Connecticut.

We were glad to be able to photograph this milestone event in the lives of two UConn graduates.

                            <button type="button" class="btn btn-primary" data-dismiss="modal"> Close Project</button>

Pike International, LLC.

The leading provider of affordable luxury housing to the Yale and New Haven rental community.

This was a grand opening event for two rentals in the heart of downtown New Haven. Food, drinks, and potential customers were in attendance as well as the Mayor of New Haven.

                            <button type="button" class="btn btn-primary" data-dismiss="modal"> Close Project</button>

Model Photography

A collection of our recent model photography.

Inspired by the classic man.

District 2o3.

                            <button type="button" class="btn btn-primary" data-dismiss="modal"> Close Project</button>


text:
package org.kaaproject.kaa.server.admin.client.mvp.view.tenant;

import org.kaaproject.kaa.common.dto.TenantDto;
import org.kaaproject.kaa.server.admin.client.mvp.view.grid.AbstractKaaGrid;
import org.kaaproject.kaa.server.admin.client.util.Utils;

import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.user.cellview.client.DataGrid;

public class TenantsGrid extends AbstractKaaGrid<TenantDto, String> {

    public TenantsGrid() {
        super(Unit.PX, false);
    }

    @Override
    protected float constructColumnsImpl(DataGrid<TenantDto> table) {
        float prefWidth = 0;

        prefWidth += constructStringColumn(table,
                Utils.constants.tenantName(),
                new StringValueProvider<TenantDto>() {
                    @Override
                    public String getValue(TenantDto item) {
                        return item.getName();
                    }
                }, 160);

        return prefWidth;
    }

}


text:
<?php

namespace Drupal\Tests\field\Functional\EntityReference;

use Drupal\Component\Utility\Unicode;
use Drupal\Tests\SchemaCheckTestTrait;
use Drupal\field\Entity\FieldConfig;
use Drupal\field\Entity\FieldStorageConfig;
use Drupal\node\Entity\Node;
use Drupal\Tests\BrowserTestBase;

/**
 * Tests entity reference field default values storage in CMI.
 *
 * @group entity_reference
 */
class EntityReferenceFieldDefaultValueTest extends BrowserTestBase {

  use SchemaCheckTestTrait;

  /**
   * Modules to install.
   *
   * @var array
   */
  public static $modules = ['field_ui', 'node'];

  /**
   * A user with permission to administer content types, node fields, etc.
   *
   * @var \Drupal\user\UserInterface
   */
  protected $adminUser;

  protected function setUp() {
    parent::setUp();

    // Create default content type.
    $this->drupalCreateContentType(['type' => 'reference_content']);
    $this->drupalCreateContentType(['type' => 'referenced_content']);

    // Create admin user.
    $this->adminUser = $this->drupalCreateUser(['access content', 'administer content types', 'administer node fields', 'administer node form display', 'bypass node access']);
    $this->drupalLogin($this->adminUser);
  }

  /**
   * Tests that default values are correctly translated to UUIDs in config.
   */
  public function testEntityReferenceDefaultValue() {
    // Create a node to be referenced.
    $referenced_node = $this->drupalCreateNode(['type' => 'referenced_content']);

    $field_name = Unicode::strtolower($this->randomMachineName());
    $field_storage = FieldStorageConfig::create([
      'field_name' => $field_name,
      'entity_type' => 'node',
      'type' => 'entity_reference',
      'settings' => ['target_type' => 'node'],
    ]);
    $field_storage->save();
    $field = FieldConfig::create([
      'field_storage' => $field_storage,
      'bundle' => 'reference_content',
      'settings' => [
        'handler' => 'default',
        'handler_settings' => [
          'target_bundles' => ['referenced_content'],
          'sort' => ['field' => '_none'],
        ],
      ],
    ]);
    $field->save();

    // Set created node as default_value.
    $field_edit = [
      'default_value_input[' . $field_name . '][0][target_id]' => $referenced_node->getTitle() . ' (' . $referenced_node->id() . ')',
    ];
    $this->drupalPostForm('admin/structure/types/manage/reference_content/fields/node.reference_content.' . $field_name, $field_edit, t('Save settings'));

    // Check that default value is selected in default value form.
    $this->drupalGet('admin/structure/types/manage/reference_content/fields/node.reference_content.' . $field_name);
    $this->assertRaw('name="default_value_input[' . $field_name . '][0][target_id]" value="' . $referenced_node->getTitle() . ' (' . $referenced_node->id() . ')', 'The default value is selected in instance settings page');

    // Check if the ID has been converted to UUID in config entity.
    $config_entity = $this->config('field.field.node.reference_content.' . $field_name)->get();
    $this->assertTrue(isset($config_entity['default_value'][0]['target_uuid']), 'Default value contains target_uuid property');
    $this->assertEqual($config_entity['default_value'][0]['target_uuid'], $referenced_node->uuid(), 'Content uuid and config entity uuid are the same');
    // Ensure the configuration has the expected dependency on the entity that
    // is being used a default value.
    $this->assertEqual([$referenced_node->getConfigDependencyName()], $config_entity['dependencies']['content']);

    // Clear field definitions cache in order to avoid stale cache values.
    \Drupal::entityManager()->clearCachedFieldDefinitions();

    // Create a new node to check that UUID has been converted to numeric ID.
    $new_node = Node::create(['type' => 'reference_content']);
    $this->assertEqual($new_node->get($field_name)->offsetGet(0)->target_id, $referenced_node->id());

    // Ensure that the entity reference config schemas are correct.
    $field_config = $this->config('field.field.node.reference_content.' . $field_name);
    $this->assertConfigSchema(\Drupal::service('config.typed'), $field_config->getName(), $field_config->get());
    $field_storage_config = $this->config('field.storage.node.' . $field_name);
    $this->assertConfigSchema(\Drupal::service('config.typed'), $field_storage_config->getName(), $field_storage_config->get());
  }

  /**
   * Tests that dependencies due to default values can be removed.
   *
   * @see \Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem::onDependencyRemoval()
   */
  public function testEntityReferenceDefaultConfigValue() {
    // Create a node to be referenced.
    $referenced_node_type = $this->drupalCreateContentType(['type' => 'referenced_config_to_delete']);
    $referenced_node_type2 = $this->drupalCreateContentType(['type' => 'referenced_config_to_preserve']);

    $field_name = Unicode::strtolower($this->randomMachineName());
    $field_storage = FieldStorageConfig::create([
      'field_name' => $field_name,
      'entity_type' => 'node',
      'type' => 'entity_reference',
      'settings' => ['target_type' => 'node_type'],
      'cardinality' => FieldStorageConfig::CARDINALITY_UNLIMITED,
    ]);
    $field_storage->save();
    $field = FieldConfig::create([
      'field_storage' => $field_storage,
      'bundle' => 'reference_content',
      'settings' => [
        'handler' => 'default',
        'handler_settings' => [
          'sort' => ['field' => '_none'],
        ],
      ],
    ]);
    $field->save();

    // Set created node as default_value.
    $field_edit = [
      'default_value_input[' . $field_name . '][0][target_id]' => $referenced_node_type->label() . ' (' . $referenced_node_type->id() . ')',
      'default_value_input[' . $field_name . '][1][target_id]' => $referenced_node_type2->label() . ' (' . $referenced_node_type2->id() . ')',
    ];
    $this->drupalPostForm('admin/structure/types/manage/reference_content/fields/node.reference_content.' . $field_name, $field_edit, t('Save settings'));

    // Check that the field has a dependency on the default value.
    $config_entity = $this->config('field.field.node.reference_content.' . $field_name)->get();
    $this->assertTrue(in_array($referenced_node_type->getConfigDependencyName(), $config_entity['dependencies']['config'], TRUE), 'The node type referenced_config_to_delete is a dependency of the field.');
    $this->assertTrue(in_array($referenced_node_type2->getConfigDependencyName(), $config_entity['dependencies']['config'], TRUE), 'The node type referenced_config_to_preserve is a dependency of the field.');

    // Check that the field does not have a dependency on the default value
    // after deleting the node type.
    $referenced_node_type->delete();
    $config_entity = $this->config('field.field.node.reference_content.' . $field_name)->get();
    $this->assertFalse(in_array($referenced_node_type->getConfigDependencyName(), $config_entity['dependencies']['config'], TRUE), 'The node type referenced_config_to_delete not a dependency of the field.');
    $this->assertTrue(in_array($referenced_node_type2->getConfigDependencyName(), $config_entity['dependencies']['config'], TRUE), 'The node type referenced_config_to_preserve is a dependency of the field.');
  }

}


text:
/* @flow */
import type { ASTNode } from '../../../../flowtypes/AST'

export default function isExpression(node: ASTNode): boolean {
  return node.type === 'Expression'
}


text:
package test.types;

//
// IDL:TestStruct2Seq:1.0
//
final public class TestStruct2SeqHelper
{
    public static void
    insert(org.omg.CORBA.Any any, TestStruct2[] val)
    {
        org.omg.CORBA.portable.OutputStream out = any.create_output_stream();
        write(out, val);
        any.read_value(out.create_input_stream(), type());
    }

    public static TestStruct2[]
    extract(org.omg.CORBA.Any any)
    {
        if(any.type().equivalent(type()))
            return read(any.create_input_stream());
        else
            throw new org.omg.CORBA.BAD_OPERATION();
    }

    private static org.omg.CORBA.TypeCode typeCode_;

    public static org.omg.CORBA.TypeCode
    type()
    {
        if(typeCode_ == null)
        {
            org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init();
            typeCode_ = orb.create_alias_tc(id(), "TestStruct2Seq", orb.create_sequence_tc(0, TestStruct2Helper.type()));
        }

        return typeCode_;
    }

    public static String
    id()
    {
        return "IDL:TestStruct2Seq:1.0";
    }

    public static TestStruct2[]
    read(org.omg.CORBA.portable.InputStream in)
    {
        TestStruct2[] _ob_v;
        int len0 = in.read_ulong();
        _ob_v = new TestStruct2[len0];
        for(int i0 = 0; i0 < len0; i0++)
            _ob_v[i0] = TestStruct2Helper.read(in);
        return _ob_v;
    }

    public static void
    write(org.omg.CORBA.portable.OutputStream out, TestStruct2[] val)
    {
        int len0 = val.length;
        out.write_ulong(len0);
        for(int i0 = 0; i0 < len0; i0++)
            TestStruct2Helper.write(out, val[i0]);
    }
}


text:
import {Component, ViewEncapsulation } from 'angular2/core';
import * as c3 from 'c3';

@Component({
  selector: 'sd-about',
  moduleId: module.id,
  templateUrl: './about.component.html',
  styleUrls: ['./about.component.css'],
  encapsulation: ViewEncapsulation.None
})
export class AboutComponent {

  private usageData:Object;

constructor() {

  this.usageData = {
      'Used': 67,
      'Remaining': 33
  };

}

ngOnInit(){

  var chart = c3.generate({
      data: {
          columns: Object.keys(this.usageData).map((key)=>{
            return [key, this.usageData[key]];
          }),
          type : 'pie',
          order: null,
          colors: {
            'Used': '#F6C600',
            'Remaining': '#A4A4A4'
          }
      },
      bindto: '#chart',
      pie: {
          title: this.usageData['Used'].toFixed(1),
          width: 22,
          label: {
            show: false
          }
      },
      size: {
        width: 250
      },
      legend: {
        show: true
      }
    });

    var gauge = c3.generate({
      data: {
          columns: [
              ['data', 89]
          ],
          type: 'gauge',
          onclick: function (d, i) { console.log("onclick", d, i); },
          onmouseover: function (d, i) { console.log("onmouseover", d, i); },
          onmouseout: function (d, i) { console.log("onmouseout", d, i); }
      },
      bindto: '#gauge',
      gauge: {
         label: {
             format: function(value, ratio) {
                 return value;
             },
             show: false // to turn off the min/max labels.
         },
     min: 0, // 0 is default, //can handle negative min e.g. vacuum / voltage / current flow / rate of change
     max: 100, // 100 is default
     units: ' %',
     width: 39 // for adjusting arc thickness
      },
      color: {
          pattern: ['#FF0000', '#F97600', '#F6C600', '#60B044'], // the three color levels for the percentage values.
          threshold: {
  //            unit: 'value', // percentage is default
  //            max: 200, // 100 is default
              values: [30, 60, 90, 100]
          }
      },
      size: {
          height: 180
      }

  });

  let label = d3.select('text.c3-chart-arcs-title');
  let labelSubtext = "GB / of " + (this.usageData['Remaining']+this.usageData['Used']) + "GB";
  label.append('tspan').text(labelSubtext).attr('dy', 50).attr('x', 0);
}


text:
package com.jxd.android.bookinventtory.bean;

import com.rfid.api.ISO15693Tag;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by jinxiangdong on 2017/10/22.
 */

public class InventoryEvent {
    private List<ISO15693Tag> tags;
    private int code = 0;
    private int errorCode=0;

    public InventoryEvent(List<ISO15693Tag> tags , int code ){
        this.tags= tags;
        this.code= code;
    }
    public InventoryEvent(int code, int errorCode ){
        this.code= code;
        this.errorCode=errorCode;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public List<ISO15693Tag> getTags() {
        return tags;
    }

    public void setTags(List<ISO15693Tag> tags) {
        this.tags = tags;
    }

    public int getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(int errorCode) {
        this.errorCode = errorCode;
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<citations>
	<bibl><title level="m">Proceedings of the 2009 Named Entities Workshop, ACL-IJCNLP 2009</title>, pages <biblScope type="pp">88–91</biblScope>, <pubPlace>Suntec,Singapore</pubPlace> ,<date>7 August 2009</date> .c</bibl>
</citations>


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

    var modelName = 'EstimatedCaseModel';
    var calculateEstimateUrl = '~/api/ProcedureEstimatedParts/Recalculate/';
    var getPartsUrl = '~/api/ProcedureEstimatedParts/';

    var modelFunction = [
        '$http', function($http) {
            var self = this;
            var getEstRespUrl = '~/api/Responsibility/Estimated/';
            var getEstPriceUrl = '~/api/Price/Estimated/';

            self.calculateAndSaveEstimate = function() {
                return $http.post(calculateEstimateUrl + self.ppId).success(function(data) {
                    self.parts = data;
                    self.loadEstimatedResponsibility();
                    self.loadEstimatedPrice();
                });
            };

            self.loadParts = function(ppId) {
                self.ppId = ppId;
                return $http.get(getPartsUrl + self.ppId).success(function(data) {
                    self.parts = data;
                    _.forEach(self.parts, function(value) {
                        //Add dummy cost object.
                        value.partCost = {
                            maicUnitCost: 0,
                            poLineCost: value.partPrice ? value.partPrice.poTotalLineCost : null,
                            poEstimatedLineTax: 0,
                            poEstimatedLineShipping: 0
                        };
                    });
                });
            };

            self.loadEstimatedResponsibility = function() {
                return $http.get(getEstRespUrl + self.ppId).success(function(data) {
                    self.estimatedResp = data;
                    if (!self.estimatedResp) return;
                    self.estimatedResp.negCarWrtOff = -self.estimatedResp.carrierWriteoffAmount;
                    self.estimatedResp.negPatWrtOff = -self.estimatedResp.patientWriteoffAmount;
                });
            };

            self.loadEstimatedPrice = function() {
                return $http.get(getEstPriceUrl + self.ppId).success(function(data) {
                    self.estimatedPriceSummary = data;
                });
            };
        }
    ];

    angular.module('app').service(modelName, modelFunction);

})();


text:
package net.neilgoodman.android.fragmenttabstutorial.adapter;

import net.neilgoodman.android.fragmenttabstutorial.R;
import net.neilgoodman.android.fragmenttabstutorial.model.LocationModel;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class LocationModelListAdapter extends BaseAdapter {

    private class ViewHolder {
        public TextView textView;
    }

    private LocationModel[] mLocations;
    private LayoutInflater  mInflater;

    public LocationModelListAdapter(Context context, LocationModel[] locations) {
        mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        mLocations = locations;
    }

    @Override
    public int getCount() {
        if (mLocations != null) {
            return mLocations.length;
        }

        return 0;
    }

    @Override
    public Object getItem(int position) {
        if (mLocations != null && position >= 0 && position < getCount()) {
            return mLocations[position];
        }

        return null;
    }

    @Override
    public long getItemId(int position) {
        if (mLocations != null && position >= 0 && position < getCount()) {
            return mLocations[position].id;
        }

        return 0;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {

        View       view = convertView;
        ViewHolder viewHolder;

        if (view == null) {
            view = mInflater.inflate(R.layout.item_location_list, parent, false);

            viewHolder = new ViewHolder();
            viewHolder.textView = (TextView) view.findViewById(R.id.list_label);

            view.setTag(viewHolder);
        }
        else {
            viewHolder = (ViewHolder) view.getTag();
        }

        LocationModel locationModel = mLocations[position];

        viewHolder.textView.setText(locationModel.address);

        return view;
    }

}


text:
var myRequest;

if (window.XMLHttpRequest) {  // does it exist? we're in Firefox, Safari etc.
	myRequest = new XMLHttpRequest();
} else if (window.ActiveXObject) { // if not, we're in IE
	myRequest = new ActiveXObject("Microsoft.XMLHTTP");
}

myRequest.onreadystatechange = function(){
	console.log(myRequest.readyState);
	if (myRequest.readyState === 4) {
		let entries = myRequest.responseText.split("ID:");
		let headings = ["Test Start Time:","Log data:","Results:","Test End Time:","Tester:"];
		let tableElement = document.createElement("table");
		let column1Setting = document.createElement("col");
		let testCaseTitles = [];
		let failedTestCaseTitles = [];

		column1Setting.setAttribute("style","width:15%");
		tableElement.appendChild(column1Setting);
		let column2Setting = document.createElement("col");
		column2Setting.setAttribute("style","width:85%");
		tableElement.appendChild(column2Setting);
		entries.shift();
		let expectedProgressInfo = entries.shift(); // remove null entry and EXPECTED PROGRESS entries
		let dateLines = expectedProgressInfo.split("\n");
		dateLines.shift();
		let eLine = [];
		let aLine = [];
		for (let index in dateLines) {
			if (dateLines[index] == "") continue;
			eLine[index] = [new Date(dateLines[index].split(" ")[0]).getTime(), dateLines[index].split(" ")[1] ];
			console.log(" eLine["+index+"] = " + eLine[index] + " dateLines: " + dateLines[index]);
		}
		for ( let index in entries ) {
			if (entries[index] =="") {
				console.log("Nothing at index: "+index);
				continue;
			} else {
				console.log("current index defined");
			}
			let firstRowElement = document.createElement("tr");
			let testId = (entries[index].split("\n")[0]).trim();
			let remainder = String(entries[index].split(testId+"\n")[1]);
			let testIdText = document.createTextNode(testId);
			let testCaseTitle = document.createElement("th");

			let addToList = true; // this is a unique test case
			for (var checkTitle in testCaseTitles) {
				console.log("testId is: "+testId+" checkTitle is: "+testCaseTitles[checkTitle]);
				if (testId == testCaseTitles[checkTitle]) {
					addToList = false;
					break;
				}
			}
			if (addToList) {
				testCaseTitles.push(testId);
				console.log("adding " + testId + " to list");
			}

			testCaseTitle.appendChild(testIdText);
			firstRowElement.appendChild(testCaseTitle);
			let filler = document.createElement("th");
			firstRowElement.appendChild(filler);
			tableElement.appendChild(firstRowElement);
			console.log("remainder: "+remainder);
			for (let heading in headings) {
				let rowElement = document.createElement("tr");
				let indexStart = remainder.indexOf(headings[heading]) + headings[heading].length;
				let indexEnd = remainder.indexOf(headings[parseInt(heading)+1]);
				let sectionContent = remainder.slice(indexStart,indexEnd);
				let labelCellElement = document.createElement("td");
				let labelText = document.createTextNode(headings[heading].slice(0,-1));
				labelCellElement.appendChild(labelText);
				rowElement.appendChild(labelCellElement);
				console.log(sectionContent);
				let contextText;
				contentText = document.createTextNode(sectionContent);
				let contentCellElement;
				if (sectionContent.indexOf("FAILED") >= 0) {
					contentCellElement = document.createElement("td");
					contentCellElement.setAttribute("class","failed");
					addToList = true;
					for (let checkTitle in failedTestCaseTitles) {
						if (testId == failedTestCaseTitles[checkTitle]) {
							addToList = false;
							break;
						}
					}
					if (addToList) {
						failedTestCaseTitles.push(testId);
						console.log("adding " + testId + " to failed list");
					}
				} else {
					contentCellElement = document.createElement("td");
					let removeIndex = -1;
					if (headings[heading] == "Results:") {
						for (let checkTitle in failedTestCaseTitles) {
							if (testId == failedTestCaseTitles[checkTitle]) {
								removeIndex = checkTitle;
								break;
							}
						}
						if (removeIndex >= 0) {
							failedTestCaseTitles.splice(removeIndex,1);
							console.log("removing a failed test case " + testId + " because a more recent run passed");
						}
					}
				}
				if (addToList && headings[heading] == "Test End Time:") { // if we have increased the number of unique new tests that have been run
					let regularExpression = / *(\d+\/\d+\/\d+) *.*/;
					let date = sectionContent.match(regularExpression);
					console.log("date: " + date + ", original: " + sectionContent + ", -- " + date[1]);
					if (aLine.length > 0 && aLine[aLine.length - 1][0] == new Date(date[1]).getTime()) {
						aLine[aLine.length - 1] = [new Date(date[1]).getTime(), testCaseTitles.length];
					} else {
						aLine[aLine.length] = [new Date(date[1]).getTime(), testCaseTitles.length];
					}
				}
				contentCellElement.appendChild(contentText);
				rowElement.appendChild(contentCellElement);
				tableElement.appendChild(rowElement);
			}
		}
		document.getElementById("detailedContent").appendChild(tableElement);
		let summaryParagraph = document.createElement("p");
		if (failedTestCaseTitles.length == 0) {
			let summaryText = document.createTextNode("" + testCaseTitles.length + " unique tests have been executed and there are no currently failing test cases.");
			summaryParagraph.appendChild(summaryText);
			document.getElementById("summaryContent").appendChild(summaryParagraph);
		} else {
			let summaryText = document.createTextNode("" + testCaseTitles.length + " unique tests have been executed and " + failedTestCaseTitles.length + " have failed - see log details below");
			summaryParagraph.appendChild(summaryText);
			document.getElementById("summaryContent").appendChild(summaryParagraph);
		}
		let options = { //set plot options
				series: {
					points: {show: true},
					lines: {show: true}
				},
				xaxis: {
					show: true,
					mode: "time",
					timeformat: "%m/%d/%y"
				},
				legend: {
					show: true,
					position: "se",
					container: "#legend"
				}
		};
		// plot expected vs actual tests run
		$.plot($("#placeholder"),[{data:aLine,label:"Actual Number Of Test Cases Run"},{data:eLine,label:"Expected Number Of Test Cases Run"}],options);
		for (let index in eLine) {
			console.log("eline: " + index + " " + eLine[index]);
		}
		for (let index in aLine) {
			console.log("aline: " + index + " " + aLine[index]);
		}

	}
};

//open and send it
myRequest.open('GET', 'TEST.LOG', true);
//any parameters?
myRequest.send(null);

//....


text:
"""
Permissions tests on the logging models.
"""
import uuid

from django.test import TestCase

from .factory_logger import ContentSessionLogFactory
from .factory_logger import ContentSummaryLogFactory
from .factory_logger import UserSessionLogFactory
from kolibri.core.auth.test.helpers import create_dummy_facility_data

class ContentSessionLogPermissionsTestCase(TestCase):
    @classmethod
    def setUpTestData(cls):
        cls.data = create_dummy_facility_data()
        cls.data["interaction_log"] = ContentSessionLogFactory.create(
            user=cls.data["learners_one_group"][0][0],
            content_id=uuid.uuid4().hex,
            channel_id=uuid.uuid4().hex,
        )

    def test_facilityadmin_sessionlog_permissions(self):
        self.assertTrue(
            self.data["facility_admin"].can_create_instance(
                self.data["interaction_log"]
            )
        )
        self.assertTrue(
            self.data["facility_admin"].can_read(self.data["interaction_log"])
        )
        self.assertTrue(
            self.data["facility_admin"].can_update(self.data["interaction_log"])
        )
        self.assertTrue(
            self.data["facility_admin"].can_delete(self.data["interaction_log"])
        )

    def test_coach_sessionlog_permissions(self):
        self.assertFalse(
            self.data["facility_coach"].can_create_instance(
                self.data["interaction_log"]
            )
        )
        self.assertTrue(
            self.data["facility_coach"].can_read(self.data["interaction_log"])
        )
        self.assertFalse(
            self.data["facility_coach"].can_update(self.data["interaction_log"])
        )
        self.assertFalse(
            self.data["facility_coach"].can_delete(self.data["interaction_log"])
        )

    def test_learner_sessionlog_permissions(self):
        learner = self.data["learners_one_group"][0][0]
        self.assertTrue(learner.can_create_instance(self.data["interaction_log"]))
        self.assertTrue(learner.can_read(self.data["interaction_log"]))
        self.assertTrue(learner.can_update(self.data["interaction_log"]))
        self.assertTrue(learner.can_delete(self.data["interaction_log"]))

class ContentSummaryLogPermissionsTestCase(TestCase):
    @classmethod
    def setUpTestData(cls):
        cls.data = create_dummy_facility_data()
        cls.data["summary_log"] = ContentSummaryLogFactory.create(
            user=cls.data["learners_one_group"][0][1],
            content_id=uuid.uuid4().hex,
            channel_id=uuid.uuid4().hex,
        )

    def test_facilityadmin_summarylog_permissions(self):
        self.assertTrue(
            self.data["facility_admin"].can_create_instance(self.data["summary_log"])
        )
        self.assertTrue(self.data["facility_admin"].can_read(self.data["summary_log"]))
        self.assertTrue(
            self.data["facility_admin"].can_update(self.data["summary_log"])
        )
        self.assertTrue(
            self.data["facility_admin"].can_delete(self.data["summary_log"])
        )

    def test_coach_summarylog_permissions(self):
        self.assertFalse(
            self.data["facility_coach"].can_create_instance(self.data["summary_log"])
        )
        self.assertTrue(self.data["facility_coach"].can_read(self.data["summary_log"]))
        self.assertFalse(
            self.data["facility_coach"].can_update(self.data["summary_log"])
        )
        self.assertFalse(
            self.data["facility_coach"].can_delete(self.data["summary_log"])
        )

    def test_learner_summarylog_permissions(self):
        learner = self.data["learners_one_group"][0][1]
        self.assertTrue(learner.can_create_instance(self.data["summary_log"]))
        self.assertTrue(learner.can_read(self.data["summary_log"]))
        self.assertTrue(learner.can_update(self.data["summary_log"]))
        self.assertTrue(learner.can_delete(self.data["summary_log"]))

class UserSessionLogPermissionsTestCase(TestCase):
    @classmethod
    def setUpTestData(cls):
        cls.data = create_dummy_facility_data()
        cls.data["session_log"] = UserSessionLogFactory.create(
            user=cls.data["learners_one_group"][1][1]
        )

    def test_facilityadmin_sessionlog_permissions(self):
        self.assertTrue(
            self.data["facility_admin"].can_create_instance(self.data["session_log"])
        )
        self.assertTrue(self.data["facility_admin"].can_read(self.data["session_log"]))
        self.assertTrue(
            self.data["facility_admin"].can_update(self.data["session_log"])
        )
        self.assertTrue(
            self.data["facility_admin"].can_delete(self.data["session_log"])
        )

    def test_coach_sessionlog_permissions(self):
        self.assertFalse(
            self.data["facility_coach"].can_create_instance(self.data["session_log"])
        )
        self.assertTrue(self.data["facility_coach"].can_read(self.data["session_log"]))
        self.assertFalse(
            self.data["facility_coach"].can_update(self.data["session_log"])
        )
        self.assertFalse(
            self.data["facility_coach"].can_delete(self.data["session_log"])
        )

    def test_learner_sessionlog_permissions(self):
        learner = self.data["learners_one_group"][1][1]
        self.assertTrue(learner.can_create_instance(self.data["session_log"]))
        self.assertTrue(learner.can_read(self.data["session_log"]))
        self.assertTrue(learner.can_update(self.data["session_log"]))
        self.assertTrue(learner.can_delete(self.data["session_log"]))


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Runtime.Serialization;

namespace Umbraco.Core.Models
{
    /// <summary>
    /// Represents the content type that a <see cref="Member"/> object is based on
    /// </summary>
    [Serializable]
    [DataContract(IsReference = true)]
    public class MemberType : ContentTypeCompositionBase, IMemberType
    {
        //Dictionary is divided into string: PropertyTypeAlias, Tuple: MemberCanEdit, VisibleOnProfile, PropertyTypeId
        private string _alias;

        public MemberType(int parentId) : base(parentId)
        {
            MemberTypePropertyTypes = new Dictionary<string, MemberTypePropertyProfileAccess>();
        }

        public MemberType(IContentTypeComposition parent) : base(parent)
        {
            MemberTypePropertyTypes = new Dictionary<string, MemberTypePropertyProfileAccess>();
        }

        private static readonly PropertyInfo AliasSelector = ExpressionHelper.GetPropertyInfo<MemberType, string>(x => x.Alias);

        /// <summary>
        /// The Alias of the ContentType
        /// </summary>
        [DataMember]
        public override string Alias
        {
            get { return _alias; }
            set
            {
                //NOTE: WE are overriding this because we don't want to do a ToSafeAlias when the alias is the special case of
                // "_umbracoSystemDefaultProtectType" which is used internally, currently there is an issue with the safe alias as it strips
                // leading underscores which we don't want in this case.
                // see : http://issues.umbraco.org/issue/U4-3968

                //TODO: BUT, I'm pretty sure we could do this with regards to underscores now:
                // .ToCleanString(CleanStringType.Alias | CleanStringType.UmbracoCase)
                // Need to ask Stephen

                SetPropertyValueAndDetectChanges(o =>
                {
                    _alias = value == "_umbracoSystemDefaultProtectType"
                        ? value
                        : (value == null ? string.Empty : value.ToSafeAlias() );
                    return _alias;
                }, _alias, AliasSelector);
            }
        }

        /// <summary>
        /// Gets or Sets a Dictionary of Tuples (MemberCanEdit, VisibleOnProfile) by the PropertyTypes' alias.
        /// </summary>
        [DataMember]
        internal IDictionary<string, MemberTypePropertyProfileAccess> MemberTypePropertyTypes { get; private set; }

        /// <summary>
        /// Gets a boolean indicating whether a Property is editable by the Member.
        /// </summary>
        /// <param name="propertyTypeAlias">PropertyType Alias of the Property to check</param>
        /// <returns></returns>
        public bool MemberCanEditProperty(string propertyTypeAlias)
        {
            if (MemberTypePropertyTypes.ContainsKey(propertyTypeAlias))
            {
                return MemberTypePropertyTypes[propertyTypeAlias].IsEditable;
            }

            return false;
        }

        /// <summary>
        /// Gets a boolean indicating whether a Property is visible on the Members profile.
        /// </summary>
        /// <param name="propertyTypeAlias">PropertyType Alias of the Property to check</param>
        /// <returns></returns>
        public bool MemberCanViewProperty(string propertyTypeAlias)
        {
            if (MemberTypePropertyTypes.ContainsKey(propertyTypeAlias))
            {
                return MemberTypePropertyTypes[propertyTypeAlias].IsVisible;
            }

            return false;
        }

        /// <summary>
        /// Sets a boolean indicating whether a Property is editable by the Member.
        /// </summary>
        /// <param name="propertyTypeAlias">PropertyType Alias of the Property to set</param>
        /// <param name="value">Boolean value, true or false</param>
        public void SetMemberCanEditProperty(string propertyTypeAlias, bool value)
        {
            if (MemberTypePropertyTypes.ContainsKey(propertyTypeAlias))
            {
                MemberTypePropertyTypes[propertyTypeAlias].IsEditable = value;
            }
            else
            {
                var tuple = new MemberTypePropertyProfileAccess(false, value);
                MemberTypePropertyTypes.Add(propertyTypeAlias, tuple);
            }
        }

        /// <summary>
        /// Sets a boolean indicating whether a Property is visible on the Members profile.
        /// </summary>
        /// <param name="propertyTypeAlias">PropertyType Alias of the Property to set</param>
        /// <param name="value">Boolean value, true or false</param>
        public void SetMemberCanViewProperty(string propertyTypeAlias, bool value)
        {
            if (MemberTypePropertyTypes.ContainsKey(propertyTypeAlias))
            {
                MemberTypePropertyTypes[propertyTypeAlias].IsVisible = value;
            }
            else
            {
                var tuple = new MemberTypePropertyProfileAccess(value, false);
                MemberTypePropertyTypes.Add(propertyTypeAlias, tuple);
            }
        }

        /// <summary>
        /// Method to call when Entity is being saved
        /// </summary>
        /// <remarks>Created date is set and a Unique key is assigned</remarks>
        internal override void AddingEntity()
        {
            base.AddingEntity();

            if (Key == Guid.Empty)
                Key = Guid.NewGuid();
        }

        /// <summary>
        /// Method to call when Entity is being updated
        /// </summary>
        /// <remarks>Modified Date is set and a new Version guid is set</remarks>
        internal override void UpdatingEntity()
        {
            base.UpdatingEntity();
        }
    }
}


text:
'use strict';

var shell = require('shelljs');
var path = require('path');
var logger = require('../utils/logger.js');

var methods = [
  {
    // GNOME
    command: 'gsettings',
    options: 'set org.gnome.desktop.background picture-uri file://%s'
  }, {
    // GNOME2
    command: 'gconftool-2',
    options: '--set /desktop/gnome/background/picture_filename --type string %s'
  }, {
    // xfce
    command: path.join(__dirname, '../bridge/xfce.sh'),
    options: '%s'
  }, {
    // KDE
    command: 'dcop',
    options: 'kdesktop KBackgroundIface setWallpaper %s 1'
  }, {
    command: 'dconf',
    options: 'write /org/mate/desktop/background/picture-filename "%s"'
  }, {
    command: 'feh',
    options: '--bg-scale %s'
  }, {
    command: 'pcmanfm',
    options: '-w %s'
  }
];

exports.set = function (options, callback) {
  var found = false;
  methods.forEach(function (m) {
    if (found) {
      return;
    }
    var file = options.file;
    var commandline = m.command + ' ' + m.options.replace('%s', file);
    logger.info('try: ' + commandline);
    shell.exec(commandline, {async: false, silent: true}, function (code, output) {
      if (code == 0 && typeof callback != 'undefined') {
        found = true;
        callback(true);
      }
    });
  });
  logger.fatal('no proper method found to set your wallpaper');
};

// Reference:
//   https://github.com/sindresorhus/linux-wallpaper