text:
namespace {

const char kJsScreenPath[] = "login.NetworkScreen";

}  // namespace

namespace chromeos {

// NetworkScreenHandler, public: -----------------------------------------------

NetworkScreenHandler::NetworkScreenHandler(CoreOobeActor* core_oobe_actor)
    : BaseScreenHandler(kJsScreenPath),
      core_oobe_actor_(core_oobe_actor),
      model_(nullptr),
      show_on_init_(false) {
  DCHECK(core_oobe_actor_);
}

NetworkScreenHandler::~NetworkScreenHandler() {
  if (model_)
    model_->OnViewDestroyed(this);
}

// NetworkScreenHandler, NetworkScreenActor implementation: --------------------

void NetworkScreenHandler::PrepareToShow() {
}

void NetworkScreenHandler::Show() {
  if (!page_is_ready()) {
    show_on_init_ = true;
    return;
  }

  PrefService* prefs = g_browser_process->local_state();
  if (prefs->GetBoolean(prefs::kFactoryResetRequested)) {
    if (core_oobe_actor_)
      core_oobe_actor_->ShowDeviceResetScreen();

    return;
  } else if (prefs->GetBoolean(prefs::kDebuggingFeaturesRequested)) {
    if (core_oobe_actor_)
      core_oobe_actor_->ShowEnableDebuggingScreen();

    return;
  }

  // Make sure all our network technologies are turned on. On OOBE, the user
  // should be able to select any of the available networks on the device.
  NetworkStateHandler* handler = NetworkHandler::Get()->network_state_handler();
  handler->SetTechnologyEnabled(NetworkTypePattern::NonVirtual(),
                                true,
                                chromeos::network_handler::ErrorCallback());

  base::DictionaryValue network_screen_params;
  network_screen_params.SetBoolean("isDeveloperMode",
      base::CommandLine::ForCurrentProcess()->HasSwitch(
          chromeos::switches::kSystemDevMode));
  ShowScreen(OobeUI::kScreenOobeNetwork, &network_screen_params);
  core_oobe_actor_->InitDemoModeDetection();
}

void NetworkScreenHandler::Hide() {
}

void NetworkScreenHandler::Bind(NetworkModel& model) {
  model_ = &model;
  BaseScreenHandler::SetBaseScreen(model_);
}

void NetworkScreenHandler::Unbind() {
  model_ = nullptr;
  BaseScreenHandler::SetBaseScreen(nullptr);
}

void NetworkScreenHandler::ShowError(const base::string16& message) {
  CallJS("showError", message);
}

void NetworkScreenHandler::ClearErrors() {
  if (page_is_ready())
    core_oobe_actor_->ClearErrors();
}

void NetworkScreenHandler::StopDemoModeDetection() {
  core_oobe_actor_->StopDemoModeDetection();
}

void NetworkScreenHandler::ShowConnectingStatus(
    bool connecting,
    const base::string16& network_id) {
}

void NetworkScreenHandler::ReloadLocalizedContent() {
  base::DictionaryValue localized_strings;
  static_cast<OobeUI*>(web_ui()->GetController())
      ->GetLocalizedStrings(&localized_strings);
  core_oobe_actor_->ReloadContent(localized_strings);
}

// NetworkScreenHandler, BaseScreenHandler implementation: --------------------

void NetworkScreenHandler::DeclareLocalizedValues(
    ::login::LocalizedValuesBuilder* builder) {
  if (system::InputDeviceSettings::Get()->ForceKeyboardDrivenUINavigation())
    builder->Add("networkScreenGreeting", IDS_REMORA_CONFIRM_MESSAGE);
  else
    builder->Add("networkScreenGreeting", IDS_WELCOME_SCREEN_GREETING);

  builder->Add("networkScreenTitle", IDS_WELCOME_SCREEN_TITLE);
  builder->Add("networkScreenAccessibleTitle",
               IDS_NETWORK_SCREEN_ACCESSIBLE_TITLE);
  builder->Add("selectLanguage", IDS_LANGUAGE_SELECTION_SELECT);
  builder->Add("selectKeyboard", IDS_KEYBOARD_SELECTION_SELECT);
  builder->Add("selectNetwork", IDS_NETWORK_SELECTION_SELECT);
  builder->Add("selectTimezone", IDS_OPTIONS_SETTINGS_TIMEZONE_DESCRIPTION);
  builder->Add("proxySettings", IDS_OPTIONS_PROXIES_CONFIGURE_BUTTON);
  builder->Add("continueButton", IDS_NETWORK_SELECTION_CONTINUE_BUTTON);
  builder->Add("debuggingFeaturesLink", IDS_NETWORK_ENABLE_DEV_FEATURES_LINK);
}

void NetworkScreenHandler::GetAdditionalParameters(
    base::DictionaryValue* dict) {
  const std::string application_locale =
      g_browser_process->GetApplicationLocale();
  const std::string selected_input_method =
      input_method::InputMethodManager::Get()
          ->GetActiveIMEState()
          ->GetCurrentInputMethod()
          .id();

  scoped_ptr<base::ListValue> language_list;
  if (model_) {
    if (model_->GetLanguageList() &&
        model_->GetLanguageListLocale() == application_locale) {
      language_list.reset(model_->GetLanguageList()->DeepCopy());
    } else {
      model_->UpdateLanguageList();
    }
  }

  if (!language_list.get())
    language_list.reset(GetMinimalUILanguageList().release());

  // GetAdditionalParameters() is called when OOBE language is updated.
  // This happens in three different cases:
  //
  // 1) User selects new locale on OOBE screen. We need to sync active input
  // methods with locale, so EnableLoginLayouts() is needed.
  //
  // 2) This is signin to public session. User has selected some locale & input
  // method on "Public Session User POD". After "Login" button is pressed,
  // new user session is created, locale & input method are changed (both
  // asynchronously).
  // But after public user session is started, "Terms of Service" dialog is
  // shown. It is a part of OOBE UI screens, so it initiates reload of UI
  // strings in new locale. It also happens asynchronously, that leads to race
  // between "locale change", "input method change" and
  // "EnableLoginLayouts()".  This way EnableLoginLayouts() happens after user
  // input method has been changed, resetting input method to hardware default.
  //
  // So we need to disable activation of login layouts if we are already in
  // active user session.
  //
  // 3) This is the bootstrapping process for a "Slave" device. The locale &
  // input of the "Slave" device is set up by a "Master" device. In this case we
  // don't want EnableLoginLayout() to reset the input method to the hardware
  // default method.
  const bool is_slave = g_browser_process->local_state()->GetBoolean(
      prefs::kOobeControllerDetected);

  const bool enable_layouts =
      !user_manager::UserManager::Get()->IsUserLoggedIn() && !is_slave;

  dict->Set("languageList", language_list.release());
  dict->Set(
      "inputMethodsList",
      GetAndActivateLoginKeyboardLayouts(
          application_locale, selected_input_method, enable_layouts).release());
  dict->Set("timezoneList", GetTimezoneList());
}

void NetworkScreenHandler::Initialize() {
  if (show_on_init_) {
    show_on_init_ = false;
    Show();
  }

  // Reload localized strings if they are already resolved.
  if (model_ && model_->GetLanguageList())
    ReloadLocalizedContent();
}

// NetworkScreenHandler, private: ----------------------------------------------

// static
base::ListValue* NetworkScreenHandler::GetTimezoneList() {
  std::string current_timezone_id;
  CrosSettings::Get()->GetString(kSystemTimezone, &current_timezone_id);

  scoped_ptr<base::ListValue> timezone_list(new base::ListValue);
  scoped_ptr<base::ListValue> timezones = system::GetTimezoneList();
  for (size_t i = 0; i < timezones->GetSize(); ++i) {
    const base::ListValue* timezone = NULL;
    CHECK(timezones->GetList(i, &timezone));

    std::string timezone_id;
    CHECK(timezone->GetString(0, &timezone_id));

    std::string timezone_name;
    CHECK(timezone->GetString(1, &timezone_name));

    scoped_ptr<base::DictionaryValue> timezone_option(
        new base::DictionaryValue);
    timezone_option->SetString("value", timezone_id);
    timezone_option->SetString("title", timezone_name);
    timezone_option->SetBoolean("selected", timezone_id == current_timezone_id);
    timezone_list->Append(timezone_option.release());
  }

  return timezone_list.release();
}

}  // namespace chromeos


text:
Legacy Board

"People move forward in activities to correct things and unquestionably, circumstances make leaders,
		but also leaders make movements." - Oliver Hill

We depend on former chapter leaders who are appointed by previous leaders in the Impact Movement
		to continue growing the chapter legacy by faithful examples and shared wisdom.

				Leah Hairston

Read Leah's bio here

redpajama_set_name: RedPajamaGithub


text:
package com.bsangola.daos;

import java.util.List;

import javax.persistence.EntityManager;

import com.bsangola.cruds.PermissaoCRUD;
import com.bsangola.modelos.Permissao;
import com.bsangola.servico.NegocioException;

public class PermissaoDAO implements PermissaoCRUD{

	private EntityManager manager;

	public PermissaoDAO(EntityManager manager) {
		this.manager = manager;
	}

	@Override
	public List<Permissao> buscarTodos() throws NegocioException {
		return this.manager.createQuery("from Permissao", Permissao.class).getResultList();
	}

	@Override
	public Permissao burcarPorCodigo(Long codigo) throws NegocioException {
		return this.manager.find(Permissao.class, codigo);
	}

	@Override
	public void criar(Permissao permissao) throws NegocioException {
		this.manager.merge(permissao);
	}

	@Override
	public void elininar(Long codigo) throws NegocioException {
		this.manager.remove(this.burcarPorCodigo(codigo));
	}
}


text:
'use strict';

var key = 'YOURAPIKEY'
  , SparkPost = require('sparkpost')
  , client = new SparkPost(key);

// Promise
client.suppressionList.get('test@test.com')
  .then(data => {
    console.log('Congrats you can use our client library!');
    console.log(data);
  })
  .catch(err => {
    console.log('Whoops! Something went wrong');
    console.log(err);
  });

// Callback
client.suppressionList.get('test@test.com', function(err, data) {
  if (err) {
    console.log('Whoops! Something went wrong');
    console.log(err);
  } else {
    console.log('Congrats you can use our client library!');
    console.log(data);
  }
});


text:
namespace blink {
namespace {

using ReasonFunction = base::FunctionRef<void(PaintInvalidationReason)>;

PaintInvalidationReason NextReason(PaintInvalidationReason r) {
  return static_cast<PaintInvalidationReason>(static_cast<unsigned>(r) + 1);
}

void ForReasons(PaintInvalidationReason min,
                PaintInvalidationReason max,
                ReasonFunction f) {
  for (auto i = min; i <= max; i = NextReason(i))
    f(i);
}

TEST(PaintInvalidationReasonTest, ToString) {
  ForReasons(PaintInvalidationReason::kNone, PaintInvalidationReason::kMax,
             [](PaintInvalidationReason r) {
               EXPECT_STRNE("", PaintInvalidationReasonToString(r));
             });

  EXPECT_STREQ("none",
               PaintInvalidationReasonToString(PaintInvalidationReason::kNone));
  EXPECT_STREQ("geometry", PaintInvalidationReasonToString(
                               PaintInvalidationReason::kLayout));
}

TEST(PaintInvalidationReasonTest, IsFullGeometryPaintInvalidationReason) {
  ForReasons(PaintInvalidationReason::kNone,
             PaintInvalidationReason::kNonFullMax,
             [](PaintInvalidationReason r) {
               EXPECT_FALSE(IsFullPaintInvalidationReason(r));
               EXPECT_FALSE(IsNonLayoutFullPaintInvalidationReason(r));
               EXPECT_FALSE(IsLayoutPaintInvalidationReason(r));
             });
  ForReasons(NextReason(PaintInvalidationReason::kNonFullMax),
             PaintInvalidationReason::kNonLayoutMax,
             [](PaintInvalidationReason r) {
               EXPECT_TRUE(IsFullPaintInvalidationReason(r));
               EXPECT_TRUE(IsNonLayoutFullPaintInvalidationReason(r));
               EXPECT_FALSE(IsLayoutPaintInvalidationReason(r));
             });
  ForReasons(NextReason(PaintInvalidationReason::kNonLayoutMax),
             PaintInvalidationReason::kLayoutMax,
             [](PaintInvalidationReason r) {
               EXPECT_TRUE(IsFullPaintInvalidationReason(r));
               EXPECT_FALSE(IsNonLayoutFullPaintInvalidationReason(r));
               EXPECT_TRUE(IsLayoutPaintInvalidationReason(r));
             });
  ForReasons(NextReason(PaintInvalidationReason::kLayoutMax),
             PaintInvalidationReason::kMax, [](PaintInvalidationReason r) {
               EXPECT_TRUE(IsFullPaintInvalidationReason(r));
               EXPECT_FALSE(IsNonLayoutFullPaintInvalidationReason(r));
               EXPECT_FALSE(IsLayoutPaintInvalidationReason(r));
             });
}

}  // namespace
}  // namespace blink


text:
layout: post
categories: Leetcode
tags: [array]

---

Given an array of non-negative integers, you are initially positioned at the first
index of the array. Each element in the array represents your maximum jump length
at that position. Determine if you are able to reach the last index. For example:

```
A = [2,3,1,1,4], return true.
A = [3,2,1,0,4], return false.
```

#### Analysis

A straight forward method tries all the possibilities recursively. For example,

A = [2,3,1,1,4]

At position 0, we will try whether we can jump to the end from the sub arrays:

A1[3, 1, 1, 4] and A2[1, 1, 4]

Following this example, we can implement a recursive solution. However, when we
check whether we can jump to the end from a position i, some computations are
duplicated. So, we can use DP method to store the solution for the subproblems.

```java
public boolean canJump(int[] A) {
    if(A == null || A.length == 0)
        return true;

    int len = A.length - 1;
    //table[i] means whether we can jump to the
    //last position from position i
    //-1: false 1:true

    //  int[] table = new int[A.length];
    //  table[A.length - 1] = 1;
    // the closest position that can jump to the end
    int closest = len;
    for(int i = len - 1; i >= 0; i--){
        // check whether we can jump to the closest position or not
        if(i + A[i] >= closest){
    //      table[i] = 1;
            closest = i;
        }
    }
    return closest == 0;
}
```

### Jump Game II

Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element
in the array represents your maximum jump length at that position. Your goal is to reach the last index in the minimum
number of jumps. For example:

Given array A = [2,3,1,1,4]

The minimum number of jumps to reach the last index is 2. (Jump 1 step from index 0 to 1, then 3 steps to the last index.)

#### Analysis

Use a table to record the minimum steps to jump to the end from i. Then, at position i we check the
following positions that we could jump to from i, and find out the minimum jump steps from i.

For example,

```
A = [2,3,1,1,4]
i = 4 , min_jump = 0
i = 3, min_jump = 1
i = 2, min_jump = min_jump[3] + 1 = 2
i = 1, min_jump = 1+ min(min_jump[2], min_jump[3], min_jump[4]) = 1
i = 0, min_jump = 1+ min(min_jump[1], min_jump[2])=2
```

The complexity is O(n^2) in the worse case. Can we optimize it?
The answer is yes.

At position i, we have k choices (that can jump to the end) to make the next step. Other than try
each step, we select the position that could jump to the max position. We can prove this by contradiction.

At position i, the next jump position j guarantees to jump to the max position.

Assume exist m, such that m + A[m] < j + A[j] and minJump(m) < minJump(j).

However 1 + minJump(m + A[m]) >= 1 + minJump(j + A[j]) because j + A[j] is on the right off m + A[m].
So, minJump(m) >= minJump(j) contradicts with the assumption. This proves the greedy method works.

```java
    public int jumpGreedy(int[] A) {
        if(A == null || A.length <= 1) return 0;
        int i = 0, steps = 1, max, maxPos;
        while(A[i] + i < A.length - 1){
            //at position i, find the available positions
            //that guarantees the max jump
            max = 0; maxPos = 0;
            for(int k = i + 1; k<= A[i] + i; k++){
                int tmp = A[k] + k;
                if(tmp >= A.length - 1)
                    return steps + 1;
                else if(tmp >= max){
                    max = A[k] + k;
                    maxPos = k;
                }
            }
        //cannot move forward
            if(max == 0) return -1;
            //jump to next position
            i = maxPos;
            steps++;
        }
        return steps;
    }
```


text:
from google.cloud import bigquery_connection_v1

def sample_create_connection():
    # Create a client
    client = bigquery_connection_v1.ConnectionServiceClient()

    # Initialize request argument(s)
    request = bigquery_connection_v1.CreateConnectionRequest(
        parent="parent_value",
    )

    # Make the request
    response = client.create_connection(request=request)

    # Handle the response
    print(response)

# [END bigqueryconnection_v1_generated_ConnectionService_CreateConnection_sync]


text:
from __future__ import unicode_literals

from django.conf import settings
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion

class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('api', '0007_auto_20170122_1741'),
    ]

    operations = [
        migrations.CreateModel(
            name='AttendeeStatus',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('comments', models.CharField(default='', max_length=1000)),
                ('rsvp_email_sent', models.BooleanField(default=False)),
                ('rsvp_confirmed', models.BooleanField(default=False)),
                ('checked_in', models.BooleanField(default=False)),
                ('hackathon', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.Hackathon')),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.RemoveField(
            model_name='hackerinfo',
            name='checked_in',
        ),
        migrations.RemoveField(
            model_name='hackerinfo',
            name='comments',
        ),
        migrations.RemoveField(
            model_name='hackerinfo',
            name='misc_info',
        ),
        migrations.RemoveField(
            model_name='hackerinfo',
            name='rsvp',
        ),
        migrations.RemoveField(
            model_name='judgeinfo',
            name='comments',
        ),
        migrations.RemoveField(
            model_name='judgeinfo',
            name='misc_info',
        ),
        migrations.RemoveField(
            model_name='mentorinfo',
            name='comments',
        ),
        migrations.RemoveField(
            model_name='mentorinfo',
            name='misc_info',
        ),
        migrations.RemoveField(
            model_name='organizerinfo',
            name='comments',
        ),
        migrations.RemoveField(
            model_name='organizerinfo',
            name='misc_info',
        ),
        migrations.AddField(
            model_name='judgeinfo',
            name='organizer_contact',
            field=models.CharField(default=1, max_length=100),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='mentorinfo',
            name='availability',
            field=django.contrib.postgres.fields.jsonb.JSONField(default=1),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='mentorinfo',
            name='motivation',
            field=models.CharField(default=1, max_length=1000),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='mentorinfo',
            name='skills',
            field=models.CharField(default=1, max_length=1000),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='organizerinfo',
            name='motivation',
            field=models.CharField(default=1, max_length=1000),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='organizerinfo',
            name='teams',
            field=models.CharField(default=1, max_length=100),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='hackerinfo',
            name='attendee_status',
            field=models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, to='api.AttendeeStatus'),
        ),
        migrations.AddField(
            model_name='judgeinfo',
            name='attendee_status',
            field=models.OneToOneField(default=1, on_delete=django.db.models.deletion.CASCADE, to='api.AttendeeStatus'),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='mentorinfo',
            name='attendee_status',
            field=models.OneToOneField(default=1, on_delete=django.db.models.deletion.CASCADE, to='api.AttendeeStatus'),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='organizerinfo',
            name='attendee_status',
            field=models.OneToOneField(default=1, on_delete=django.db.models.deletion.CASCADE, to='api.AttendeeStatus'),
            preserve_default=False,
        ),
    ]


text:
var forOf   = require('./_for-of')
  , classof = require('./_classof');
module.exports = function(NAME){
  return function toJSON(){
    if(classof(this) != NAME)throw TypeError(NAME + "#toJSON isn't generic");
    var arr = [];
    forOf(this, false, arr.push, arr);
    return arr;
  };
};


text:
.class Lcom/samsung/android/settings/accessibility/AccessibilitySettings$2;
.super Lcom/android/internal/content/PackageMonitor;
.source "AccessibilitySettings.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/samsung/android/settings/accessibility/AccessibilitySettings;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation

# instance fields
.field final synthetic this$0:Lcom/samsung/android/settings/accessibility/AccessibilitySettings;

# direct methods
.method constructor <init>(Lcom/samsung/android/settings/accessibility/AccessibilitySettings;)V
    .locals 0

    iput-object p1, p0, Lcom/samsung/android/settings/accessibility/AccessibilitySettings$2;->this$0:Lcom/samsung/android/settings/accessibility/AccessibilitySettings;

    invoke-direct {p0}, Lcom/android/internal/content/PackageMonitor;-><init>()V

    return-void
.end method

.method private sendUpdate()V
    .locals 4

    iget-object v0, p0, Lcom/samsung/android/settings/accessibility/AccessibilitySettings$2;->this$0:Lcom/samsung/android/settings/accessibility/AccessibilitySettings;

    invoke-static {v0}, Lcom/samsung/android/settings/accessibility/AccessibilitySettings;->-get4(Lcom/samsung/android/settings/accessibility/AccessibilitySettings;)Landroid/os/Handler;

    move-result-object v0

    iget-object v1, p0, Lcom/samsung/android/settings/accessibility/AccessibilitySettings$2;->this$0:Lcom/samsung/android/settings/accessibility/AccessibilitySettings;

    invoke-static {v1}, Lcom/samsung/android/settings/accessibility/AccessibilitySettings;->-get7(Lcom/samsung/android/settings/accessibility/AccessibilitySettings;)Ljava/lang/Runnable;

    move-result-object v1

    const-wide/16 v2, 0x3e8

    invoke-virtual {v0, v1, v2, v3}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z

    return-void
.end method

# virtual methods
.method public onPackageAdded(Ljava/lang/String;I)V
    .locals 0

    invoke-direct {p0}, Lcom/samsung/android/settings/accessibility/AccessibilitySettings$2;->sendUpdate()V

    return-void
.end method

.method public onPackageAppeared(Ljava/lang/String;I)V
    .locals 0

    invoke-direct {p0}, Lcom/samsung/android/settings/accessibility/AccessibilitySettings$2;->sendUpdate()V

    return-void
.end method

.method public onPackageDisappeared(Ljava/lang/String;I)V
    .locals 0

    invoke-direct {p0}, Lcom/samsung/android/settings/accessibility/AccessibilitySettings$2;->sendUpdate()V

    return-void
.end method

.method public onPackageRemoved(Ljava/lang/String;I)V
    .locals 0

    invoke-direct {p0}, Lcom/samsung/android/settings/accessibility/AccessibilitySettings$2;->sendUpdate()V

    return-void
.end method


text:
var path = require('path');
var config = require('nconf');
var ModuleClass = require(path.join(config.get('CORE_DIR'), 'Module'));
var cors = require('cors');

var Module = new ModuleClass(__dirname);
Module.getInstance().use(cors());

Module.init();
module.exports = Module.getInstance();


text:
export = Accumulator;
declare function Accumulator(simpleLayout: any): void;
declare class Accumulator {
    constructor(simpleLayout: any);
    simpleLayout: any;
    groupingValues: any[];
    setGroupingDepth(width: any): void;
    feed(value: any): void;
    reset(groupIndex: any): void;
    getValue(groupIndex: any): any;
    toString(): string;
}


text:
<!DOCTYPE html>

  <title>
     // My Thoughts
  </title>

  <link href="http://gmpg.org/xfn/11" rel="profile">
<meta http-equiv="content-type" content="text/html; charset=utf-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">

<meta name="description" content="">
<meta name="keywords" content="">
<meta name="author" content="">
<meta name="generator" content="Hugo 0.15" />

  <meta property="og:title" content="" />
<meta property="og:description" content="" />
<meta property="og:type" content="website" />
<meta property="og:locale" content="en_US" />
<meta property="og:url" content="http://teopeurt.com/draft/Using%20LXD-LXC%20as%20Demo%20Engine/" />

  <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/pure/0.5.0/base-min.css">
  <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/pure/0.5.0/pure-min.css">

    <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/pure/0.5.0/grids-responsive-min.css">

  <link rel="stylesheet" href="http://teopeurt.com/css/redlounge.css">
  <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet">
  <link href='//fonts.googleapis.com/css?family=Raleway:400,200,100,700,300,500,600,800' rel='stylesheet' type='text/css'>
  <link href='//fonts.googleapis.com/css?family=Libre+Baskerville:400,700,400italic' rel='stylesheet' type='text/css'>

  <link rel="apple-touch-icon-precomposed" sizes="144x144" href="/touch-icon-144-precomposed.png">
  <link rel="shortcut icon" href="/favicon.png">

  <link href="" rel="alternate" type="application/rss+xml" title="My Thoughts" />

  <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.7/styles/tomorrow-night-bright.min.css">

{teopeurt}

digital.security, mobile, api, hacking, ux, product

//Home

//About

//Blog

//Projects

//Talks

				Contents

Using LXD/LXC as Demo Engine

Pre-Req:

                	1/Jan 0001

Using LXD/LXC as Demo Engine

Working for Qiidi, our model works on hosting, configuring various products for enterprise and corporates. When it comes to sales nothing speaks louder than letting the customer get to play with it. “cue toys with the hole so you can press it to play”

The requirements is basically, let me spin up a sandbox environment visible to the world, and periodically trash it and sping it up again as new. But also let me be able to sping it up on my laptop or the CEO’s toaster so that they can be assured that it works and I know what I am talking about. Also given the crappy internet connection one gets in Africa, local instance is a GodSend - I can even configure the app to speak to it.

Pre-Req:

1 Ubuntu server as your private image store
1 Ubuntu server as container-host - this can be same as above but defeeats the purpose of this exercise if they are.

					More Reading

						Newer//

						Older//

Blog

© 2016. All rights reserved.


text:
SYNONYM

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

#### Published in
Icon. fung. (Prague) 5: 80 (1842)

#### Original name
Fusarium cinctum Corda, 1842

### Remarks
null


text:
/* gk_PlatformHierarchy.cpp	Sat Mar 31 2018 19:28:30 tmm */

/*

Module:  gk_PlatformHierarchy.cpp

Function:
	The hierarchy table.

Version:
	V0.9.0	Sat Mar 31 2018 19:28:30 tmm	Edit level 5

Copyright notice:
	This file copyright (C) 2016-2018 by

		MCCI Corporation
		3520 Krums Corners Road
		Ithaca, NY  14850

	An unpublished work.  All rights reserved.

	This file is proprietary information, and may not be disclosed or
	copied without the prior permission of MCCI Corporation.

Author:
	Terry Moore, MCCI Corporation	October 2016

Revision history:
   0.1.0  Mon Oct 17 2016 01:25:15  tmm
	Module created.

   0.3.0  Mon Oct 31 2016 13:49:37  tmm
	Add sensor for Anatolian project.

   0.4.0  Wed Mar  8 2017 18:12:57  tmm
	Add platforms for Catena 4450.

   0.5.0  Sat Mar 11 2017 14:03:53  tmm
	Rename catena_platforms.h and catena4410_guids.h.

   0.9.0  Sat Mar 31 2018 19:28:30  tmm
	Add platforms for Catena 4460.

*/

#include "Catena_Platforms.h"
#include "Catena_Guids.h"

namespace McciCatena {

/****************************************************************************\
|
|		Manifest constants & typedefs.
|
|	This is strictly for private types and constants which will not
|	be exported.
|
\****************************************************************************/

/****************************************************************************\
|
|	Read-only data.
|
|	If program is to be ROM-able, these must all be tagged read-only
|	using the ROM storage class; they may be global.
|
\****************************************************************************/

const CATENA_PLATFORM	gkPlatformFeatherM0 =
	{
	Guid: GUID_HW_FEATHER_M0(WIRE),
	pParent: NULL,
	PlatformFlags: 0,
	};

const CATENA_PLATFORM	gkPlatformM0LoRa =
	{
	Guid: GUID_HW_FEATHER_M0_LORA(WIRE),
	pParent: &gkPlatformFeatherM0,
	PlatformFlags: CatenaBase::fHasLoRa,
	};

const CATENA_PLATFORM	gkPlatformFeatherM0Proto =
	{
	Guid: GUID_HW_FEATHER_M0_PROTO(WIRE),
	pParent: NULL,
	PlatformFlags: 0,
	};

const CATENA_PLATFORM   gkPlatformFeatherM0ProtoWingLora =
        {
	Guid: GUID_HW_FEATHER_M0_PROTO_WINGLORA_TTNMCCI(WIRE),
	pParent: &gkPlatformFeatherM0Proto,
	PlatformFlags:	CatenaBase::fHasLoRa |
                        CatenaBase::fHasTtnMcciLoRa,
        };

const CATENA_PLATFORM	gkPlatformM0LoRaTtnNyc =
	{
	Guid: GUID_HW_FEATHER_M0_LORA_TTNNYC(WIRE),
	pParent: &gkPlatformM0LoRa,
	PlatformFlags: CatenaBase::fHasLoRa |
                       CatenaBase::fHasTtnNycLoRa,
	};

const CATENA_PLATFORM gkPlatformCatena4410 =
	{
	Guid: GUID_HW_CATENA_4410_BASE(WIRE),
	pParent: &gkPlatformM0LoRaTtnNyc,
	PlatformFlags:
                CatenaBase::fHasLoRa |
		CatenaBase::fHasTtnNycLoRa |
		CatenaBase::fHasBme280 |
		CatenaBase::fHasLux,
	};

const CATENA_PLATFORM gkPlatformCatena4410_gh =
	{
	Guid: GUID_HW_CATENA_4410_GH(WIRE),
	pParent: &gkPlatformCatena4410,
	PlatformFlags:
		CatenaBase::fHasLoRa |
		CatenaBase::fHasTtnNycLoRa |
		CatenaBase::fHasBme280 |
		CatenaBase::fHasLux |
		CatenaBase::fHasSoilProbe |
		CatenaBase::fHasSolarPanel,
	};

const CATENA_PLATFORM gkPlatformCatena4410_mh =
	{
	Guid: GUID_HW_CATENA_4410_MH(WIRE),
	pParent: &gkPlatformCatena4410,
	PlatformFlags:
		CatenaBase::fHasLoRa |
		CatenaBase::fHasTtnNycLoRa |
		CatenaBase::fHasBme280 |
		CatenaBase::fHasLux |
		CatenaBase::fHasSoilProbe,
	};

const CATENA_PLATFORM gkPlatformCatena4410_swh =
	{
	Guid: GUID_HW_CATENA_4410_SWH(WIRE),
	pParent: &gkPlatformCatena4410,
	PlatformFlags:
		CatenaBase::fHasLoRa |
		CatenaBase::fHasTtnNycLoRa |
		CatenaBase::fHasBme280 |
		CatenaBase::fHasLux |
		CatenaBase::fHasWaterOneWire,
	};

const CATENA_PLATFORM gkPlatformCatena4410_pond =
	{
	Guid: GUID_HW_CATENA_4410_POND(WIRE),
	pParent: &gkPlatformCatena4410,
	PlatformFlags:
		CatenaBase::fHasLoRa |
		CatenaBase::fHasTtnNycLoRa |
		CatenaBase::fHasBme280 |
		CatenaBase::fHasLux |
		CatenaBase::fHasSoilProbe |
		CatenaBase::fHasSolarPanel |
		CatenaBase::fHasWaterOneWire,
	};

const CATENA_PLATFORM gkPlatformCatena4410_anatolian =
	{
	Guid: GUID_HW_CATENA_4410_ANATOLIAN(WIRE),
	pParent: &gkPlatformCatena4410,
	PlatformFlags:
		CatenaBase::fHasLoRa |
		CatenaBase::fHasTtnNycLoRa |
		CatenaBase::fHasBme280 |
		CatenaBase::fHasLux |
		CatenaBase::fHasSoilProbe |
		CatenaBase::fHasSolarPanel |
		CatenaBase::fHasWaterOneWire,
	};

const CATENA_PLATFORM gkPlatformCatena4450 =
	{
	Guid: GUID_HW_CATENA_4450_BASE(WIRE),
	pParent: &gkPlatformM0LoRaTtnNyc,
	PlatformFlags:
		CatenaBase::fHasLoRa |
		CatenaBase::fHasTtnNycLoRa |
		CatenaBase::fHasBme280 |
		CatenaBase::fHasLuxRohm |
		CatenaBase::fHasFRAM |
		CatenaBase::fHasI2cMux,
	};

const CATENA_PLATFORM gkPlatformCatena4450_m101 =
	{
	Guid: GUID_HW_CATENA_4450_M101(WIRE),
	pParent: &gkPlatformCatena4450,
	PlatformFlags:
		CatenaBase::fHasLoRa |
		CatenaBase::fHasTtnNycLoRa |
		CatenaBase::fHasBme280 |
		CatenaBase::fHasLuxRohm |
		CatenaBase::fHasFRAM |
		CatenaBase::fHasI2cMux |
		CatenaBase::fM101
	};

const CATENA_PLATFORM gkPlatformCatena4450_m102 =
	{
	Guid: GUID_HW_CATENA_4450_M102(WIRE),
	pParent: &gkPlatformCatena4450,
	PlatformFlags:
		CatenaBase::fHasLoRa |
		CatenaBase::fHasTtnNycLoRa |
		CatenaBase::fHasBme280 |
		CatenaBase::fHasLuxRohm |
		CatenaBase::fHasFRAM |
		CatenaBase::fHasI2cMux |
		CatenaBase::fHasSoilProbe |
		CatenaBase::fHasSolarPanel |
		CatenaBase::fHasWaterOneWire |
		CatenaBase::fM102
	};

const CATENA_PLATFORM gkPlatformCatena4450_m103 =
	{
	Guid: GUID_HW_CATENA_4450_M103(WIRE),
	pParent: &gkPlatformCatena4450,
	PlatformFlags:
		CatenaBase::fHasLoRa |
		CatenaBase::fHasTtnNycLoRa |
		CatenaBase::fHasBme280 |
		CatenaBase::fHasLuxRohm |
		CatenaBase::fHasFRAM |
		CatenaBase::fHasI2cMux |
		CatenaBase::fHasSoilProbe |
		CatenaBase::fHasSolarPanel |
		CatenaBase::fHasWaterOneWire |
		CatenaBase::fM103
	};

const CATENA_PLATFORM gkPlatformCatena4450_m104 =
	{
	Guid: GUID_HW_CATENA_4450_M104(WIRE),
	pParent: &gkPlatformCatena4450,
	PlatformFlags:
		CatenaBase::fHasLoRa |
		CatenaBase::fHasTtnNycLoRa |
		CatenaBase::fHasBme280 |
		CatenaBase::fHasLuxRohm |
		CatenaBase::fHasFRAM |
		CatenaBase::fHasI2cMux |
		CatenaBase::fHasSoilProbe |
		CatenaBase::fHasWaterOneWire |
		CatenaBase::fM104
	};

const CATENA_PLATFORM gkPlatformCatena4460 =
	{
	Guid: GUID_HW_CATENA_4460_BASE(WIRE),
	pParent: &gkPlatformM0LoRaTtnNyc,
	PlatformFlags:
		CatenaBase::fHasLoRa |
		CatenaBase::fHasTtnNycLoRa |
		CatenaBase::fHasBme680 |
		CatenaBase::fHasLuxRohm |
		CatenaBase::fHasFRAM |
		CatenaBase::fHasI2cMux,
	};

const CATENA_PLATFORM gkPlatformCatena4460_m101 =
	{
	Guid: GUID_HW_CATENA_4460_M101(WIRE),
	pParent: &gkPlatformCatena4460,
	PlatformFlags:
		CatenaBase::fHasLoRa |
		CatenaBase::fHasTtnNycLoRa |
		CatenaBase::fHasBme680 |
		CatenaBase::fHasLuxRohm |
		CatenaBase::fHasFRAM |
		CatenaBase::fHasI2cMux |
		CatenaBase::fM101
	};

const CATENA_PLATFORM gkPlatformCatena4460_m102 =
	{
	Guid: GUID_HW_CATENA_4460_M102(WIRE),
	pParent: &gkPlatformCatena4460,
	PlatformFlags:
		CatenaBase::fHasLoRa |
		CatenaBase::fHasTtnNycLoRa |
		CatenaBase::fHasBme680 |
		CatenaBase::fHasLuxRohm |
		CatenaBase::fHasFRAM |
		CatenaBase::fHasI2cMux |
		CatenaBase::fHasSoilProbe |
		CatenaBase::fHasSolarPanel |
		CatenaBase::fHasWaterOneWire |
		CatenaBase::fM102
	};

const CATENA_PLATFORM gkPlatformCatena4460_m103 =
	{
	Guid: GUID_HW_CATENA_4460_M103(WIRE),
	pParent: &gkPlatformCatena4460,
	PlatformFlags:
		CatenaBase::fHasLoRa |
		CatenaBase::fHasTtnNycLoRa |
		CatenaBase::fHasBme680 |
		CatenaBase::fHasLuxRohm |
		CatenaBase::fHasFRAM |
		CatenaBase::fHasI2cMux |
		CatenaBase::fHasSoilProbe |
		CatenaBase::fHasSolarPanel |
		CatenaBase::fHasWaterOneWire |
		CatenaBase::fM103
	};

const CATENA_PLATFORM gkPlatformCatena4460_m104 =
	{
	Guid: GUID_HW_CATENA_4460_M104(WIRE),
	pParent: &gkPlatformCatena4460,
	PlatformFlags:
		CatenaBase::fHasLoRa |
		CatenaBase::fHasTtnNycLoRa |
		CatenaBase::fHasBme280 |
		CatenaBase::fHasLuxRohm |
		CatenaBase::fHasFRAM |
		CatenaBase::fHasI2cMux |
		CatenaBase::fHasSoilProbe |
		CatenaBase::fHasWaterOneWire |
		CatenaBase::fM104
	};

const CATENA_PLATFORM gkPlatformCatena4470 =
	{
	Guid: GUID_HW_CATENA_4470_BASE(WIRE),
	pParent: &gkPlatformM0LoRaTtnNyc,
	PlatformFlags:
		CatenaBase::fHasLoRa |
		CatenaBase::fHasTtnNycLoRa |
		CatenaBase::fHasBme280 |
		CatenaBase::fHasLuxRohm |
		CatenaBase::fHasFRAM |
		CatenaBase::fHasRS485 |
		CatenaBase::fHasVout1,
	};

const CATENA_PLATFORM gkPlatformCatena4470_m101 =
	{
	Guid: GUID_HW_CATENA_4470_M101(WIRE),
	pParent: &gkPlatformCatena4470,
	PlatformFlags:
		CatenaBase::fHasLoRa |
		CatenaBase::fHasTtnNycLoRa |
		CatenaBase::fHasBme280 |
		CatenaBase::fHasLuxRohm |
		CatenaBase::fHasFRAM |
		CatenaBase::fHasRS485 |
		CatenaBase::fHasVout1,
		CatenaBase::fM101
	};

/****************************************************************************\
|
|	VARIABLES:
|
|	If program is to be ROM-able, these must be initialized
|	using the BSS keyword.  (This allows for compilers that require
|	every variable to have an initializer.)  Note that only those
|	variables owned by this module should be declared here, using the BSS
|	keyword; this allows for linkers that dislike multiple declarations
|	of objects.
|
\****************************************************************************/

} /* namespace McciCatena */


text:
/**
 * @class featuredListCtrl
 * @memberOf lapps.lappsControllers
 * @description This controller is responsible for displaying a list of featured
 *              apps.
 */
(function() {
  angular
          .module('lappsControllers')
          .controller(
                  'featuredListCtrl',
                  [
                      '$scope',
                      'swaggerApi',
                      'platform',
                      '$routeParams',
                      '$location',
                      function($scope, swaggerApi, platform, $routeParams,
                              $location) {
                        /**
                         * @field
                         * @type string
                         * @memberOf lapps.lappsControllers.featuredListCtrl
                         * @description 'The currently active tab (new or top)
                         */
                        $scope.currentTab = 'new';

                        /**
                         * @field
                         * @type app[]
                         * @memberOf lapps.lappsControllers.featuredListCtrl
                         * @description Stores the app objects retrieved from
                         *              the backend.
                         */
                        $scope.apps = [];
                        /**
                         * @function
                         * @memberOf lapps.lappsControllers.featuredListCtrl
                         * @param {string}
                         *          tab The new tab to activate.
                         * @description Changes the active tab. Only allows
                         *              'top' and 'new'. Changing tabs requests
                         *              a new list of apps from the backend.
                         */
                        $scope.setTab = function(tab) {
                          if ((tab == 'top' || tab == 'new')) {
                            $scope.currentTab = tab;
                            $location.search('tab', tab);
                            $scope.getApps(tab);
                          }
                        }

                        /**
                         * @function
                         * @memberOf lapps.lappsControllers.featuredListCtrl
                         * @param {string}
                         *          tab What kind of apps to fetch.
                         * @description Fetches a list of apps depending on the
                         *              current tab. For 'new' the newest apps
                         *              are fetched. For 'top' the best rated
                         *              apps are fetched.
                         */
                        $scope.getApps = function(tab) {

                          var apiParams = {
                            page: 1,
                            pageLength: 18,
                            order: 'desc',
                            sortBy: tab == 'top' ? 'rating' : 'dateCreated',

                          };
                          if (platform.currentPlatform.isAllPlatforms !== true) {
                            apiParams.filterBy = 'platform';
                            apiParams.filterValue = platform.currentPlatform.name;
                          }
                          swaggerApi.apps
                                  .getAllApps(apiParams)
                                  .then(
                                          function(response) {
                                            $scope.apps = response.data;
                                            for (var i = 0; i < $scope.apps.length; i++) {
                                              var thumbnail = '';
                                              for (var j = 0; j < $scope.apps[i].artifacts.length; j++) {
                                                if ($scope.apps[i].artifacts[j].type
                                                        .indexOf('thumb') >= 0) {
                                                  thumbnail = $scope.apps[i].artifacts[j].url;
                                                  break;
                                                }
                                              }
                                              $scope.apps[i].thumbnail = thumbnail;

                                              $scope.apps[i].platformObj = platform
                                                      .getPlatformByName($scope.apps[i].platform);

                                            }
                                          });
                        }
                        if ($routeParams.tab) {
                          $scope.setTab($routeParams.tab);
                        } else {
                          $scope.setTab('new');
                        }

                      }]);
}).call(this);


text:
jest.mock('@rispa/generator', () => require.requireActual('../../__mocks__/generator'))
jest.mock('../../tasks/readProjectConfiguration')
jest.mock('../../tasks/scanPlugins')
jest.mock('inquirer')

const path = require.requireActual('path')
const chalk = require.requireActual('chalk')

const mockInquirer = require.requireMock('inquirer')
const mockGenerator = require.requireMock('@rispa/generator')
const scanPlugins = require.requireMock('../../tasks/scanPlugins')
const readProjectConfiguration = require.requireMock('../../tasks/readProjectConfiguration')

const GenerateCommand = require.requireActual('../generate')

describe('generate', () => {
  const cwd = '/cwd'
  const pluginName = 'rispa-core'
  const pluginRemoteUrl = `https://git.com/${pluginName}.git`
  const pluginsPath = path.resolve(cwd, './packages')
  const pluginPath = path.resolve(pluginsPath, `./${pluginName}`)
  const generatorName = 'generatorName'
  const generatorsPath = path.resolve(pluginPath, './generators.js')
  const configuration = {
    pluginsPath,
    plugins: [{
      name: pluginName,
      remote: pluginRemoteUrl,
    }],
  }

  const plugin = {
    name: pluginName,
    scripts: [],
    path: pluginPath,
    generators: generatorsPath,
  }

  const runCommand = params => {
    const command = new GenerateCommand(params, { renderer: 'silent' })
    return command.run({
      cwd,
      projectPath: cwd,
    })
  }

  const mockReadConfigurationTask = () => {
    readProjectConfiguration.task.mockImplementation(ctx => {
      ctx.configuration = configuration
    })
  }

  const mockScanPlugins = () => {
    scanPlugins.setMockPlugins([plugin])
  }

  const mockGeneratorRun = () => {
    const run = jest.fn(() => Promise.resolve({}))
    mockGenerator.setMockGenerators({
      [generatorName]: {
        runPrompts: jest.fn(() => Promise.resolve({})),
        runActions: run,
      },
    })
    return run
  }

  it('should success run generator', async () => {
    mockReadConfigurationTask()
    mockScanPlugins()

    const generatorRun = mockGeneratorRun()

    await expect(runCommand([generatorName, pluginName]))
      .resolves.toBeDefined()

    expect(generatorRun).toBeCalled()
  })

  it('should success feature generator', async () => {
    mockReadConfigurationTask()
    mockScanPlugins()

    mockInquirer.setMockAnswers({
      plugin,
      pluginName,
      generatorName,
    })

    const run = jest.fn(() => Promise.resolve({}))
    mockGenerator.setMockGenerators({
      [generatorName]: {
        isFeatureGenerator: true,
        runPrompts: jest.fn(() => Promise.resolve({})),
        runActions: run,
      },
    })

    await expect(runCommand([]))
      .resolves.toBeDefined()

    expect(run).toBeCalled()
  })

  it('should success run selected generator', async () => {
    mockReadConfigurationTask()
    mockScanPlugins()
    mockInquirer.setMockAnswers({
      plugin,
      pluginName,
      generatorName,
    })

    const generatorRun = mockGeneratorRun()

    await expect(runCommand([])).resolves.toBeDefined()

    expect(generatorRun).toBeCalled()
  })

  it('should success run selected generator with description', async () => {
    mockReadConfigurationTask()
    mockScanPlugins()
    mockInquirer.setMockAnswers({
      plugin,
      pluginName,
      generatorName,
    })

    const generatorRun = jest.fn(() => Promise.resolve({}))
    mockGenerator.setMockGenerators({
      [generatorName]: {
        runPrompts: jest.fn(() => Promise.resolve({})),
        runActions: generatorRun,
        description: 'description'
      },
    })

    await expect(runCommand([])).resolves.toBeDefined()

    expect(generatorRun).toBeCalled()
  })

  it('should failed run generator - cant find plugin', async () => {
    mockReadConfigurationTask()
    mockScanPlugins()
    mockInquirer.setMockAnswers({
      plugin,
      pluginName,
      generatorName,
    })

    await expect(runCommand([generatorName, 'other-plugin']))
      .rejects.toHaveProperty('message', `Can't find plugin with name ${chalk.cyan('other-plugin')}`)
  })

  it('should failed run generator - cant find generators', async () => {
    mockReadConfigurationTask()
    mockScanPlugins()
    mockGenerator.setMockGenerators({})

    await expect(runCommand([generatorName, pluginName]))
      .rejects.toHaveProperty('message', 'Can\'t find generators')
  })

  it('should failed run generator - cant find generator', async () => {
    mockReadConfigurationTask()
    mockScanPlugins()
    mockGeneratorRun()

    await expect(runCommand(['unknown-generator', pluginName]))
      .rejects.toHaveProperty('message', `Can't find generator with name ${chalk.cyan('unknown-generator')}`)
  })

  it('should catch error from plop', async () => {
    mockReadConfigurationTask()
    mockScanPlugins()

    const failure = { path: 'path', error: 'error' }
    mockGenerator.setMockGenerators({
      [generatorName]: {
        runPrompts: jest.fn(() => Promise.resolve({})),
        runActions: jest.fn(() => Promise.resolve({ failures: [failure] })),
      },
    })

    await expect(runCommand([generatorName, pluginName]))
      .rejects.toHaveProperty('message', 'path: error')
  })
})


text:
/* Code generated by IfcQuery EXPRESS generator, www.ifcquery.com */

#include <sstream>
#include <limits>
#include <map>
#include "ifcpp/reader/ReaderUtil.h"
#include "ifcpp/writer/WriterUtil.h"
#include "ifcpp/model/BasicTypes.h"
#include "ifcpp/model/BuildingException.h"
#include "ifcpp/IFC4/include/IfcCoveringTypeEnum.h"

// TYPE IfcCoveringTypeEnum = ENUMERATION OF	(CEILING	,FLOORING	,CLADDING	,ROOFING	,MOLDING	,SKIRTINGBOARD	,INSULATION	,MEMBRANE	,SLEEVING	,WRAPPING	,USERDEFINED	,NOTDEFINED);
shared_ptr<BuildingObject> IfcCoveringTypeEnum::getDeepCopy( BuildingCopyOptions& options )
{
	shared_ptr<IfcCoveringTypeEnum> copy_self( new IfcCoveringTypeEnum() );
	copy_self->m_enum = m_enum;
	return copy_self;
}
void IfcCoveringTypeEnum::getStepParameter( std::stringstream& stream, bool is_select_type ) const
{
	if( is_select_type ) { stream << "IFCCOVERINGTYPEENUM("; }
	switch( m_enum )
	{
		case ENUM_CEILING:	stream << ".CEILING."; break;
		case ENUM_FLOORING:	stream << ".FLOORING."; break;
		case ENUM_CLADDING:	stream << ".CLADDING."; break;
		case ENUM_ROOFING:	stream << ".ROOFING."; break;
		case ENUM_MOLDING:	stream << ".MOLDING."; break;
		case ENUM_SKIRTINGBOARD:	stream << ".SKIRTINGBOARD."; break;
		case ENUM_INSULATION:	stream << ".INSULATION."; break;
		case ENUM_MEMBRANE:	stream << ".MEMBRANE."; break;
		case ENUM_SLEEVING:	stream << ".SLEEVING."; break;
		case ENUM_WRAPPING:	stream << ".WRAPPING."; break;
		case ENUM_USERDEFINED:	stream << ".USERDEFINED."; break;
		case ENUM_NOTDEFINED:	stream << ".NOTDEFINED."; break;
	}
	if( is_select_type ) { stream << ")"; }
}
const std::wstring IfcCoveringTypeEnum::toString() const
{
	switch( m_enum )
	{
		case ENUM_CEILING:	return L"CEILING";
		case ENUM_FLOORING:	return L"FLOORING";
		case ENUM_CLADDING:	return L"CLADDING";
		case ENUM_ROOFING:	return L"ROOFING";
		case ENUM_MOLDING:	return L"MOLDING";
		case ENUM_SKIRTINGBOARD:	return L"SKIRTINGBOARD";
		case ENUM_INSULATION:	return L"INSULATION";
		case ENUM_MEMBRANE:	return L"MEMBRANE";
		case ENUM_SLEEVING:	return L"SLEEVING";
		case ENUM_WRAPPING:	return L"WRAPPING";
		case ENUM_USERDEFINED:	return L"USERDEFINED";
		case ENUM_NOTDEFINED:	return L"NOTDEFINED";
	}
	return L"";
}
shared_ptr<IfcCoveringTypeEnum> IfcCoveringTypeEnum::createObjectFromSTEP( const std::wstring& arg, const std::map<int,shared_ptr<BuildingEntity> >& map )
{
	if( arg.compare( L"$" ) == 0 ) { return shared_ptr<IfcCoveringTypeEnum>(); }
	if( arg.compare( L"*" ) == 0 ) { return shared_ptr<IfcCoveringTypeEnum>(); }
	shared_ptr<IfcCoveringTypeEnum> type_object( new IfcCoveringTypeEnum() );
	if( std_iequal( arg, L".CEILING." ) )
	{
		type_object->m_enum = IfcCoveringTypeEnum::ENUM_CEILING;
	}
	else if( std_iequal( arg, L".FLOORING." ) )
	{
		type_object->m_enum = IfcCoveringTypeEnum::ENUM_FLOORING;
	}
	else if( std_iequal( arg, L".CLADDING." ) )
	{
		type_object->m_enum = IfcCoveringTypeEnum::ENUM_CLADDING;
	}
	else if( std_iequal( arg, L".ROOFING." ) )
	{
		type_object->m_enum = IfcCoveringTypeEnum::ENUM_ROOFING;
	}
	else if( std_iequal( arg, L".MOLDING." ) )
	{
		type_object->m_enum = IfcCoveringTypeEnum::ENUM_MOLDING;
	}
	else if( std_iequal( arg, L".SKIRTINGBOARD." ) )
	{
		type_object->m_enum = IfcCoveringTypeEnum::ENUM_SKIRTINGBOARD;
	}
	else if( std_iequal( arg, L".INSULATION." ) )
	{
		type_object->m_enum = IfcCoveringTypeEnum::ENUM_INSULATION;
	}
	else if( std_iequal( arg, L".MEMBRANE." ) )
	{
		type_object->m_enum = IfcCoveringTypeEnum::ENUM_MEMBRANE;
	}
	else if( std_iequal( arg, L".SLEEVING." ) )
	{
		type_object->m_enum = IfcCoveringTypeEnum::ENUM_SLEEVING;
	}
	else if( std_iequal( arg, L".WRAPPING." ) )
	{
		type_object->m_enum = IfcCoveringTypeEnum::ENUM_WRAPPING;
	}
	else if( std_iequal( arg, L".USERDEFINED." ) )
	{
		type_object->m_enum = IfcCoveringTypeEnum::ENUM_USERDEFINED;
	}
	else if( std_iequal( arg, L".NOTDEFINED." ) )
	{
		type_object->m_enum = IfcCoveringTypeEnum::ENUM_NOTDEFINED;
	}
	return type_object;
}


text:
pub mod v1 {
    //! `/v1/` ([spec])
    //!
    //! [spec]: https://spec.matrix.org/v1.4/push-gateway-api/#post_matrixpushv1notify

    use js_int::{uint, UInt};
    use ruma_common::{
        api::{request, response, Metadata},
        events::RoomEventType,
        metadata,
        push::{PushFormat, Tweak},
        serde::{Incoming, StringEnum},
        EventId, RoomAliasId, RoomId, SecondsSinceUnixEpoch, UserId,
    };
    use serde::{Deserialize, Serialize};
    use serde_json::value::RawValue as RawJsonValue;
    #[cfg(feature = "unstable-unspecified")]
    use serde_json::value::Value as JsonValue;

    use crate::PrivOwnedStr;

    const METADATA: Metadata = metadata! {
        method: POST,
        rate_limited: false,
        authentication: None,
        history: {
            1.0 => "/_matrix/push/v1/notify",
        }
    };

    /// Request type for the `send_event_notification` endpoint.
    #[request]
    pub struct Request<'a> {
        /// Information about the push notification
        pub notification: Notification<'a>,
    }

    /// Response type for the `send_event_notification` endpoint.
    #[response]
    #[derive(Default)]
    pub struct Response {
        /// A list of all pushkeys given in the notification request that are not valid.
        ///
        /// These could have been rejected by an upstream gateway because they have expired or have
        /// never been valid. Homeservers must cease sending notification requests for these
        /// pushkeys and remove the associated pushers. It may not necessarily be the notification
        /// in the request that failed: it could be that a previous notification to the same
        /// pushkey failed. May be empty.
        pub rejected: Vec<String>,
    }

    impl<'a> Request<'a> {
        /// Creates a new `Request` with the given notification.
        pub fn new(notification: Notification<'a>) -> Self {
            Self { notification }
        }
    }

    impl Response {
        /// Creates a new `Response` with the given list of rejected pushkeys.
        pub fn new(rejected: Vec<String>) -> Self {
            Self { rejected }
        }
    }

    /// Type for passing information about a push notification
    #[derive(Clone, Debug, Default, Incoming, Serialize)]
    #[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
    pub struct Notification<'a> {
        /// The Matrix event ID of the event being notified about.
        ///
        /// Required if the notification is about a particular Matrix event. May be omitted for
        /// notifications that only contain updated badge counts. This ID can and should be used to
        /// detect duplicate notification requests.
        #[serde(skip_serializing_if = "Option::is_none")]
        pub event_id: Option<&'a EventId>,

        /// The ID of the room in which this event occurred.
        ///
        /// Required if the notification relates to a specific Matrix event.
        #[serde(skip_serializing_if = "Option::is_none")]
        pub room_id: Option<&'a RoomId>,

        /// The type of the event as in the event's `type` field.
        #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
        pub event_type: Option<&'a RoomEventType>,

        /// The sender of the event as in the corresponding event field.
        #[serde(skip_serializing_if = "Option::is_none")]
        pub sender: Option<&'a UserId>,

        /// The current display name of the sender in the room in which the event occurred.
        #[serde(skip_serializing_if = "Option::is_none")]
        pub sender_display_name: Option<&'a str>,

        /// The name of the room in which the event occurred.
        #[serde(skip_serializing_if = "Option::is_none")]
        pub room_name: Option<&'a str>,

        /// An alias to display for the room in which the event occurred.
        #[serde(skip_serializing_if = "Option::is_none")]
        pub room_alias: Option<&'a RoomAliasId>,

        /// Whether the user receiving the notification is the subject of a member event (i.e. the
        /// `state_key` of the member event is equal to the user's Matrix ID).
        #[serde(default, skip_serializing_if = "ruma_common::serde::is_default")]
        pub user_is_target: bool,

        /// The priority of the notification.
        ///
        /// If omitted, `high` is assumed. This may be used by push gateways to deliver less
        /// time-sensitive notifications in a way that will preserve battery power on mobile
        /// devices.
        #[serde(default, skip_serializing_if = "ruma_common::serde::is_default")]
        pub prio: NotificationPriority,

        /// The `content` field from the event, if present.
        ///
        /// The pusher may omit this if the event had no content or for any other reason.
        #[serde(skip_serializing_if = "Option::is_none")]
        pub content: Option<&'a RawJsonValue>,

        /// Current number of unacknowledged communications for the recipient user.
        ///
        /// Counts whose value is zero should be omitted.
        #[serde(default, skip_serializing_if = "NotificationCounts::is_default")]
        pub counts: NotificationCounts,

        /// An array of devices that the notification should be sent to.
        pub devices: &'a [Device],
    }

    impl<'a> Notification<'a> {
        /// Create a new notification for the given devices.
        pub fn new(devices: &'a [Device]) -> Self {
            Notification { devices, ..Default::default() }
        }
    }

    /// Type for passing information about notification priority.
    ///
    /// This may be used by push gateways to deliver less time-sensitive
    /// notifications in a way that will preserve battery power on mobile devices.
    ///
    /// This type can hold an arbitrary string. To build this with a custom value, convert it from a
    /// string with `::from() / .into()`. To check for values that are not available as a
    /// documented variant here, use its string representation, obtained through `.as_str()`.
    #[derive(Clone, Debug, Default, PartialEq, Eq, StringEnum)]
    #[ruma_enum(rename_all = "snake_case")]
    #[non_exhaustive]
    pub enum NotificationPriority {
        /// A high priority notification
        #[default]
        High,

        /// A low priority notification
        Low,

        #[doc(hidden)]
        _Custom(PrivOwnedStr),
    }

    /// Type for passing information about notification counts.
    #[derive(Clone, Debug, Default, Deserialize, Serialize)]
    #[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
    pub struct NotificationCounts {
        /// The number of unread messages a user has across all of the rooms they
        /// are a member of.
        #[serde(default, skip_serializing_if = "ruma_common::serde::is_default")]
        pub unread: UInt,

        /// The number of unacknowledged missed calls a user has across all rooms of
        /// which they are a member.
        #[serde(default, skip_serializing_if = "ruma_common::serde::is_default")]
        pub missed_calls: UInt,
    }

    impl NotificationCounts {
        /// Create new notification counts from the given unread and missed call
        /// counts.
        pub fn new(unread: UInt, missed_calls: UInt) -> Self {
            NotificationCounts { unread, missed_calls }
        }

        fn is_default(&self) -> bool {
            self.unread == uint!(0) && self.missed_calls == uint!(0)
        }
    }

    /// Type for passing information about devices.
    #[derive(Clone, Debug, Deserialize, Incoming, Serialize)]
    #[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
    pub struct Device {
        /// The `app_id` given when the pusher was created.
        ///
        /// Max length: 64 chars.
        pub app_id: String,

        /// The `pushkey` given when the pusher was created.
        ///
        /// Max length: 512 bytes.
        pub pushkey: String,

        /// The unix timestamp (in seconds) when the pushkey was last updated.
        #[serde(skip_serializing_if = "Option::is_none")]
        pub pushkey_ts: Option<SecondsSinceUnixEpoch>,

        /// A dictionary of additional pusher-specific data.
        #[serde(default, skip_serializing_if = "PusherData::is_empty")]
        pub data: PusherData,

        /// A dictionary of customisations made to the way this notification is to be presented.
        ///
        /// These are added by push rules.
        #[serde(with = "tweak_serde", skip_serializing_if = "Vec::is_empty")]
        pub tweaks: Vec<Tweak>,
    }

    impl Device {
        /// Create a new device with the given app id and pushkey
        pub fn new(app_id: String, pushkey: String) -> Self {
            Device {
                app_id,
                pushkey,
                pushkey_ts: None,
                data: PusherData::new(),
                tweaks: Vec::new(),
            }
        }
    }

    /// Information for the pusher implementation itself.
    ///
    /// This is the data dictionary passed in at pusher creation minus the `url` key.
    ///
    /// It can be constructed from [`ruma_common::push::HttpPusherData`] with `::from()` /
    /// `.into()`.
    #[derive(Clone, Debug, Default, Serialize, Deserialize)]
    #[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
    pub struct PusherData {
        /// The format to use when sending notifications to the Push Gateway.
        #[serde(skip_serializing_if = "Option::is_none")]
        pub format: Option<PushFormat>,

        /// iOS (+ macOS?) specific default payload that will be sent to apple push notification
        /// service.
        ///
        /// For more information, see [Sygnal docs][sygnal].
        ///
        /// [sygnal]: https://github.com/matrix-org/sygnal/blob/main/docs/applications.md#ios-applications-beware
        // Not specified, issue: https://github.com/matrix-org/matrix-spec/issues/921
        #[cfg(feature = "unstable-unspecified")]
        #[serde(default, skip_serializing_if = "JsonValue::is_null")]
        pub default_payload: JsonValue,
    }

    impl PusherData {
        /// Creates an empty `PusherData`.
        pub fn new() -> Self {
            Default::default()
        }

        /// Returns `true` if all fields are `None`.
        pub fn is_empty(&self) -> bool {
            #[cfg(not(feature = "unstable-unspecified"))]
            {
                self.format.is_none()
            }

            #[cfg(feature = "unstable-unspecified")]
            {
                self.format.is_none() && self.default_payload.is_null()
            }
        }
    }

    impl From<ruma_common::push::HttpPusherData> for PusherData {
        fn from(data: ruma_common::push::HttpPusherData) -> Self {
            let ruma_common::push::HttpPusherData {
                format,
                #[cfg(feature = "unstable-unspecified")]
                default_payload,
                ..
            } = data;

            Self {
                format,
                #[cfg(feature = "unstable-unspecified")]
                default_payload,
            }
        }
    }

    mod tweak_serde {
        use std::fmt;

        use ruma_common::push::Tweak;
        use serde::{
            de::{MapAccess, Visitor},
            ser::SerializeMap,
            Deserializer, Serializer,
        };

        pub fn serialize<S>(tweak: &[Tweak], serializer: S) -> Result<S::Ok, S::Error>
        where
            S: Serializer,
        {
            let mut map = serializer.serialize_map(Some(tweak.len()))?;
            for item in tweak {
                #[allow(unreachable_patterns)]
                match item {
                    Tweak::Highlight(b) => map.serialize_entry("highlight", b)?,
                    Tweak::Sound(value) => map.serialize_entry("sound", value)?,
                    Tweak::Custom { value, name } => map.serialize_entry(name, value)?,
                    _ => unreachable!("variant added to Tweak not covered by Custom"),
                }
            }
            map.end()
        }

        struct TweaksVisitor;

        impl<'de> Visitor<'de> for TweaksVisitor {
            type Value = Vec<Tweak>;

            fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
                formatter.write_str("List of tweaks")
            }

            fn visit_map<M>(self, mut access: M) -> Result<Self::Value, M::Error>
            where
                M: MapAccess<'de>,
            {
                let mut tweaks = vec![];
                while let Some(key) = access.next_key::<String>()? {
                    match &*key {
                        "sound" => tweaks.push(Tweak::Sound(access.next_value()?)),
                        // If a highlight tweak is given with no value, its value is defined to be
                        // true.
                        "highlight" => {
                            let highlight = if let Ok(highlight) = access.next_value() {
                                highlight
                            } else {
                                true
                            };

                            tweaks.push(Tweak::Highlight(highlight));
                        }
                        _ => tweaks.push(Tweak::Custom { name: key, value: access.next_value()? }),
                    };
                }

                // If no highlight tweak is given at all then the value of highlight is defined to
                // be false.
                if !tweaks.iter().any(|tw| matches!(tw, Tweak::Highlight(_))) {
                    tweaks.push(Tweak::Highlight(false));
                }

                Ok(tweaks)
            }
        }

        pub fn deserialize<'de, D>(deserializer: D) -> Result<Vec<Tweak>, D::Error>
        where
            D: Deserializer<'de>,
        {
            deserializer.deserialize_map(TweaksVisitor)
        }
    }

    #[cfg(test)]
    mod tests {
        use js_int::uint;
        use ruma_common::{
            event_id, events::RoomEventType, room_alias_id, room_id, user_id, SecondsSinceUnixEpoch,
        };
        use serde_json::{
            from_value as from_json_value, json, to_value as to_json_value, Value as JsonValue,
        };

        use super::{Device, Notification, NotificationCounts, NotificationPriority, Tweak};

        #[test]
        fn serialize_request() {
            let expected = json!({
                "event_id": "$3957tyerfgewrf384",
                "room_id": "!slw48wfj34rtnrf:example.com",
                "type": "m.room.message",
                "sender": "@exampleuser:matrix.org",
                "sender_display_name": "Major Tom",
                "room_alias": "#exampleroom:matrix.org",
                "prio": "low",
                "content": {},
                "counts": {
                  "unread": 2,
                },
                "devices": [
                  {
                    "app_id": "org.matrix.matrixConsole.ios",
                    "pushkey": "V2h5IG9uIGVhcnRoIGRpZCB5b3UgZGVjb2RlIHRoaXM/",
                    "pushkey_ts": 123,
                    "tweaks": {
                      "sound": "silence",
                      "highlight": true,
                      "custom": "go wild"
                    }
                  }
                ]
            });

            let eid = event_id!("$3957tyerfgewrf384");
            let rid = room_id!("!slw48wfj34rtnrf:example.com");
            let uid = user_id!("@exampleuser:matrix.org");
            let alias = room_alias_id!("#exampleroom:matrix.org");

            let count = NotificationCounts { unread: uint!(2), ..NotificationCounts::default() };

            let device = Device {
                pushkey_ts: Some(SecondsSinceUnixEpoch(uint!(123))),
                tweaks: vec![
                    Tweak::Highlight(true),
                    Tweak::Sound("silence".into()),
                    Tweak::Custom {
                        name: "custom".into(),
                        value: from_json_value(JsonValue::String("go wild".into())).unwrap(),
                    },
                ],
                ..Device::new(
                    "org.matrix.matrixConsole.ios".into(),
                    "V2h5IG9uIGVhcnRoIGRpZCB5b3UgZGVjb2RlIHRoaXM/".into(),
                )
            };
            let devices = &[device];

            let notice = Notification {
                event_id: Some(eid),
                room_id: Some(rid),
                event_type: Some(&RoomEventType::RoomMessage),
                sender: Some(uid),
                sender_display_name: Some("Major Tom"),
                room_alias: Some(alias),
                content: Some(serde_json::from_str("{}").unwrap()),
                counts: count,
                prio: NotificationPriority::Low,
                devices,
                ..Notification::default()
            };

            assert_eq!(expected, to_json_value(notice).unwrap());
        }
    }
}


text:
These are the configuration files used by Giantcrabby's TF2 servers. Feel free to use them or copy them.

# License
These configs are licensed under MIT.


text:
#ifndef _LANGSELECT_H
#define _LANGSELECT_H

/* public functions */
void langselect_init(void*);
void langselect_release();
void langselect_update();
void langselect_render();

#endif


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

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <title>Web Hooks — Документация Kanboard russian 0.0.1</title>

    <link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />

    <link rel="top" title="Документация Kanboard russian 0.0.1" href="index.html" />

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

  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />

Web Hooks¶

Webhooks служат для взаимодействия с внешними приложениями. Webhook посылает уведомление стороннему приложению о событиях, которые произошли в Канборд.

Webhooks могут быть использованы для создания задач вызовом простого URL (Вы можете сделать это и при помощи API)

Обращение к внешнему приложению может происходить автоматически, когда наступает какое-либо событие в Канборд (создана задача, обновлен комментарий и т.д.)

Как написать webhook приемник во внешнем приложении?¶

Все внутренние события в Канборде могут быть посланы во внешний URL.

Webhook URL (url приемник внешнего приложения) может быть задан в Настройки -> Webhooks -> Webhook URL

Когда в Канборде происходит событие, Канборд обращается к указанному URL автоматически

Данные конвертируются в формат JSON и передаются с помощью POST HTTP запроса

Webhook ключ передается в составе запроса в виде строкового параметра. Таким образом, вы можете проверить, что запрос на самом деле пришел из Канборда.

Созданный вами URL должен среагировать в течении 1 секунды. Это желательно сделать потому, что запросы являются синхронными (ограничения языка PHP) и возможны тормоза в пользовательском интерфейсе, если скрипт будет слишком медленный!

Список поддерживаемых событий¶

comment.create (комментарий.создать)

comment.update (комментарий.обновить)

file.create (файл.создать)

task.move.project (задача.переместить.проект)

task.move.column (задача.переместить.колонка)

task.move.position (задача.переместить.место)

task.move.swimlane (задача.переместить.дорожка)

task.update (задача.обновить)

task.create (задача.создать)

task.close (задача.закрыть)

task.open (задача.открыть)

task.assignee_change (задача.назначить_изменить)

subtask.update (подзадача.обновить)

subtask.create (подзадача.создать)

Пример HTTP запроса¶

POST https://your_webhook_url/?token=WEBHOOK_TOKEN_HERE
User-Agent: Kanboard Webhook
Content-Type: application/json
Connection: close

{
  "event_name": "task.move.column",
  "event_data": {
    "task_id": "1",
    "project_id": "1",
    "position": 1,
    "column_id": "1",
    "swimlane_id": "0",
    "src_column_id": "2",
    "dst_column_id": "1",
    "date_moved": "1431991532",
    "recurrence_status": "0",
    "recurrence_trigger": "0"
  }
}

Функциональная часть всех событий имеет следующий формат:

{
  "event_name": "model.event_name",
  "event_data": {
    "key1": "value1",
    "key2": "value2",
    ...
  }
}

Значения event_data могут быть неупорядочены в событиях.

Пример функциональной части события¶

Создание задачи:

{
  "event_name": "task.create",
  "event_data": {
    "title": "Demo",
    "description": "",
    "project_id": "1",
    "owner_id": "1",
    "category_id": 0,
    "swimlane_id": 0,
    "column_id": "2",
    "color_id": "yellow",
    "score": 0,
    "time_estimated": 0,
    "date_due": 0,
    "creator_id": 1,
    "date_creation": 1431991532,
    "date_modification": 1431991532,
    "date_moved": 1431991532,
    "position": 1,
    "task_id": 1
  }
}

Изменение задачи:

{
  "event_name": "task.update",
  "event_data": {
    "id": "1",
    "title": "Demo",
    "description": "",
    "date_creation": "1431991532",
    "color_id": "yellow",
    "project_id": "1",
    "column_id": "1",
    "owner_id": "1",
    "position": "1",
    "is_active": "1",
    "date_completed": null,
    "score": "0",
    "date_due": "0",
    "category_id": "2",
    "creator_id": "1",
    "date_modification": 1431991603,
    "reference": "",
    "date_started": 1431993600,
    "time_spent": 0,
    "time_estimated": 0,
    "swimlane_id": "0",
    "date_moved": "1431991572",
    "recurrence_status": "0",
    "recurrence_trigger": "0",
    "recurrence_factor": "0",
    "recurrence_timeframe": "0",
    "recurrence_basedate": "0",
    "recurrence_parent": null,
    "recurrence_child": null,
    "task_id": "1",
    "changes": {
      "category_id": "2"
    }
  }
}

События изменеия задачи имеют поле changes, которое содержит обновленные значения.

Перемещение задачи в другую колонку:

{
  "event_name": "task.move.column",
  "event_data": {
    "task_id": "1",
    "project_id": "1",
    "position": 1,
    "column_id": "1",
    "swimlane_id": "0",
    "src_column_id": "2",
    "dst_column_id": "1",
    "date_moved": "1431991532",
    "recurrence_status": "0",
    "recurrence_trigger": "0"
  }
}

Перемещение задачи в другое место:

{
  "event_name": "task.move.position",
  "event_data": {
    "task_id": "2",
    "project_id": "1",
    "position": 1,
    "column_id": "1",
    "swimlane_id": "0",
    "src_column_id": "1",
    "dst_column_id": "1",
    "date_moved": "1431996905",
    "recurrence_status": "0",
    "recurrence_trigger": "0"
  }
}

Создание комментария:

{
  "event_name": "comment.create",
  "event_data": {
    "id": 1,
    "task_id": "1",
    "user_id": "1",
    "comment": "test",
    "date_creation": 1431991615
  }
}

Изменение комментария:

{
  "event_name": "comment.update",
  "event_data": {
    "id": "1",
    "task_id": "1",
    "user_id": "1",
    "comment": "test edit"
  }
}

Создание подзадачи:

{
  "event_name": "subtask.create",
  "event_data": {
    "id": 3,
    "task_id": "1",
    "title": "Test",
    "user_id": "1",
    "time_estimated": "2",
    "position": 3
  }
}

Изменение подзадачи:

{
  "event_name": "subtask.update",
  "event_data": {
    "id": "1",
    "status": 1,
    "task_id": "1"
  }
}

Загрузка файла:

{
  "event_name": "file.create",
  "event_data": {
    "task_id": "1",
    "name": "test.png"
  }
}

Создан снимок экрана:

{
  "event_name": "file.create",
  "event_data": {
    "task_id": "2",
    "name": "Screenshot taken May 19, 2015 at 10:56 AM"
  }
}

Оглавление

Web Hooks

Как написать webhook приемник во внешнем приложении?

Список поддерживаемых событий

Пример HTTP запроса

Пример функциональной части события

Related Topics

Documentation overview

Эта страница

Исходный текст

Быстрый поиск

    <form class="search" action="search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Искать" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>

    Введите слова для поиска или имя модуля, класса или функции.

      ©2016, Kanboard.ru.

      |
      Powered by Sphinx 1.3.3
      & Alabaster 0.7.8

      |
      Page source


text:
/* this file has been autogenerated by vtkNodeJsWrap */
/* editing this might proof futile */

#ifndef NATIVE_EXTENSION_VTK_VTKRANDOMLAYOUTSTRATEGYWRAP_H
#define NATIVE_EXTENSION_VTK_VTKRANDOMLAYOUTSTRATEGYWRAP_H

#include <nan.h>

#include <vtkSmartPointer.h>
#include <vtkRandomLayoutStrategy.h>

#include "vtkGraphLayoutStrategyWrap.h"
#include "../../plus/plus.h"

class VtkRandomLayoutStrategyWrap : public VtkGraphLayoutStrategyWrap
{
	public:
		using Nan::ObjectWrap::Wrap;
		static void Init(v8::Local<v8::Object> exports);
		static void InitPtpl();
		static void ConstructorGetter(
			v8::Local<v8::String> property,
			const Nan::PropertyCallbackInfo<v8::Value>& info);

		VtkRandomLayoutStrategyWrap(vtkSmartPointer<vtkRandomLayoutStrategy>);
		VtkRandomLayoutStrategyWrap();
		~VtkRandomLayoutStrategyWrap( );
		static Nan::Persistent<v8::FunctionTemplate> ptpl;

	private:
		static void New(const Nan::FunctionCallbackInfo<v8::Value>& info);

		static void AutomaticBoundsComputationOff(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void AutomaticBoundsComputationOn(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void GetAutomaticBoundsComputation(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void GetGraphBounds(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void GetRandomSeed(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void GetRandomSeedMaxValue(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void GetRandomSeedMinValue(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void GetThreeDimensionalLayout(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void Layout(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void NewInstance(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void SafeDownCast(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void SetAutomaticBoundsComputation(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void SetGraph(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void SetGraphBounds(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void SetRandomSeed(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void SetThreeDimensionalLayout(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void ThreeDimensionalLayoutOff(const Nan::FunctionCallbackInfo<v8::Value>& info);
		static void ThreeDimensionalLayoutOn(const Nan::FunctionCallbackInfo<v8::Value>& info);

#ifdef VTK_NODE_PLUS_VTKRANDOMLAYOUTSTRATEGYWRAP_CLASSDEF
		VTK_NODE_PLUS_VTKRANDOMLAYOUTSTRATEGYWRAP_CLASSDEF
#endif
};

#endif


text:
const DrawCard = require('../../drawcard.js');

class SakeHouseConfidant extends DrawCard {
    setupCardAbilities(ability) {
        this.action({
            title: 'Give Shinobi +2 political',
            condition: context => context.source.isParticipating(),
            cost: ability.costs.discardImperialFavor(),
            effect: 'give their Shinobi +0/+2',
            gameAction: ability.actions.cardLastingEffect(context => ({
                target: context.player.cardsInPlay.filter(card => card.hasTrait('shinobi')),
                effect: ability.effects.modifyPoliticalSkill(2)
            }))
        });
    }
}

SakeHouseConfidant.id = 'sake-house-confidant';

module.exports = SakeHouseConfidant;


text:
<!DOCTYPE html>

    <link rel="shortcut icon" href="img/icon_whiteborder.png"/>

    <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="">
    <meta name="author" content="">

    <title>GetNEW Digital</title>

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

    <link href="vendor/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=Abel" rel="stylesheet">

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

    <link rel="stylesheet" type="text/css" href="vendor/slick-1.6.0/slick/slick.css"/>
    <link rel="stylesheet" type="text/css" href="vendor/slick-1.6.0/slick/slick-theme.css"/>

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

            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-main-collapse">
                Menu
            </button>

                     GetNEW Digital

                    Services

                    Projects

                    Contact

                    Blog

Copyright © GETNEW LIMITED 2016

s


text:
layout: page
title: Richards Black Media Show
date: 2016-05-24
author: Joshua Daugherty
tags: weekly links, java
status: published
summary: Phasellus posuere vehicula ligula. Donec quis molestie nulla, quis.
banner: images/banner/leisure-02.jpg
booking:
  startDate: 09/23/2019
  endDate: 09/25/2019
  ctyhocn: ATLNOHX
  groupCode: RBMS
published: true
---
Nulla bibendum felis ac est condimentum, a faucibus nisl tempor. Curabitur neque lectus, lobortis vel mauris eget, sodales tempor eros. Cras congue pulvinar quam. Proin lacinia malesuada metus et pellentesque. Fusce finibus vehicula velit, quis ornare nibh faucibus non. Praesent semper sodales ligula, aliquam varius metus pulvinar non. Cras magna felis, varius eget lacinia nec, aliquam et sapien. Ut et gravida enim. Nullam elementum ligula id rutrum viverra. In hac habitasse platea dictumst. Nam commodo leo varius nibh varius, in auctor lacus vestibulum. Aenean eleifend dui eu tortor egestas ornare.

* Aenean dignissim felis at erat sollicitudin scelerisque nec non metus
* Ut placerat elit ac convallis porta
* Sed sed turpis vel enim consequat luctus at ut leo.

Nulla tempor at urna non hendrerit. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed non quam tristique, tincidunt erat in, aliquam leo. Morbi a elementum ligula. Maecenas quis felis massa. Quisque at erat viverra, ultricies justo eget, semper velit. Aenean non est a orci eleifend ultrices ut in lectus. Phasellus eu mi vitae nibh facilisis tristique at in lorem. Integer quis felis quis neque elementum aliquet a nec orci. Cras elementum non erat non sollicitudin. In luctus massa consequat nisi pharetra feugiat. Duis non suscipit orci. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris convallis, orci vel auctor ultrices, nisl ex ullamcorper neque, a mattis sem mi vel tellus.


text:
var markers = [];
var map;
var infowindow;
var current_marker;
var markers_index = [];
var markers_locations = [];
var markers_content = [];
if( typeof( markers_draggable ) == 'undefined' ){
	var markers_draggable = false;
}

function drop() {
	for ( var i = 0; i < markers_index.length; i++ ) {
		addMarkerWithTimeout( markers_index[ i ], i * 100 );
	}
}

function addMarkerWithTimeout( index, timeout ) {
	window.setTimeout( function(){
		if( markers_draggable && typeof( sg_marker ) != 'undefined' && sg_marker == index ){
			var marker_draggable = true;
			var marker_color = '15AE15';
		}
		else{
			var marker_draggable = false;
			var marker_color = 'F95B5A';
		}

		var marker_icon = {
			url: "http://chart.apis.google.com/chart?chst=d_map_pin_letter_withshadow&chld=%E2%80%A2|" + marker_color,
			size: new google.maps.Size( 40, 37 ),
			origin: new google.maps.Point( 0, 0 ),
			anchor: new google.maps.Point( 14, 37 ),
			scaledSize: new google.maps.Size( 50, 40)
		};

		markers[ index ] = new google.maps.Marker({
				icon: marker_icon,
				position: markers_locations[ index ],
				map: map,
				draggable: marker_draggable,
				animation: google.maps.Animation.DROP
			});

		google.maps.event.addListener( markers[ index ], 'click', function(){
			if ( markers[ index ].getAnimation() != null ) {
				markers[ index ].setAnimation( null );
				infowindow.close();
			}
			else{
				if( typeof( current_marker ) != 'undefined' && current_marker !== null ){ current_marker.setAnimation( null ); }
				markers[ index ].setAnimation( google.maps.Animation.BOUNCE );
				infowindow.close();
				infowindow.setContent( markers_content[ index ] );
				infowindow.open( map, markers[ index ] );
				current_marker = markers[ index ];
			}
		});

		if( marker_draggable && sg_marker == index ){
			HS_bind_sg_coord( markers[ index ] );
			google.maps.event.addListener( markers[ index ], 'dragend', function(){ HS_bind_sg_coord( markers[ index ] ); } );
		}

		google.maps.event.addListener( infowindow, 'closeclick', function(){ markers[ index ].setAnimation( null ); });
	}, timeout);
}

function initialize(){
	infowindow = new google.maps.InfoWindow({});

	for ( var i = 0; i < sg_locations.length; i++ ){
		markers_index.push( sg_locations[ i ][3] );
		markers_locations[ sg_locations[ i ][3] ] = new google.maps.LatLng( sg_locations[ i ][0], sg_locations[ i ][1] );
		markers_content[ sg_locations[ i ][3] ] = sg_locations[ i ][2];
	}

	var map_center = new google.maps.LatLng( HS_sg_map_lat, HS_sg_map_lng );

	if( typeof( sg_marker ) != 'undefined' && sg_marker == -1 ){
		markers_locations.push( map_center );
		sg_marker = markers_locations.length -1;
		markers_content.push( [ '', sg_marker ] );
		markers_index.push( sg_marker );
	}

	var mapProp = {
		center: map_center,
		zoom: HS_sg_map_zoom
	};

	map = new google.maps.Map( document.getElementById( "HS_sg_map" ), mapProp );
	drop();

	if( markers_draggable ){
		google.maps.event.addListener( map, 'idle', HS_bind_map_coord );
	}

	/*****************/
	/*** SEARCHBOX ***/
	/*****************/
	// Create the search box and link it to the UI element.
	var input = /** @type {HTMLInputElement} */( document.getElementById( 'HS_sg_map_search' ) );

	if( typeof( input ) != undefined || input !== null ){
		map.controls[ google.maps.ControlPosition.TOP_LEFT ].push( input );
		var searchBox = new google.maps.places.SearchBox( /** @type {HTMLInputElement} */( input ) );

		// Listen for the event fired when the user selects an item from the
		// pick list. Retrieve the matching places for that item.
		google.maps.event.addListener( searchBox, 'places_changed', function(){console.log( 'fired' );
			var places = searchBox.getPlaces();

			if ( places.length == 0 ) {
				return;
			}

			var bounds = new google.maps.LatLngBounds();

			for (var i = 0, place; place = places[ i ]; i++) {
				bounds.extend( place.geometry.location );
			}
			map.fitBounds( bounds );

			/*var fit_bounds_listener = google.maps.event.addListener( map, "idle", function(){
				map.setZoom( 13 );
				google.maps.event.removeListener( fit_bounds_listener );
			});*///activate to adjust zoom level after every search
		});

		// Bias the SearchBox results towards places that are within the bounds of the
		// current map's viewport.
		google.maps.event.addListener( map, 'bounds_changed', function() {
			var bounds = map.getBounds();
			searchBox.setBounds( bounds );
		});

		input.style.display = 'block';
		/************************/
		/*** END OF SEARCHBOX ***/
		/************************/
	}
}

function loadScript() {
	var script = document.createElement( "script" );
	script.src = "http://maps.googleapis.com/maps/api/js?callback=initialize&libraries=places";
	document.body.appendChild( script );
}

window.onload = function(){
		if( typeof( document.getElementById( 'HS_sg_map' ) ) != 'undefined' && document.getElementById( 'HS_sg_map' ) !== null ){
			loadScript();
		}
	}

function HS_bind_map_coord(){
	document.getElementById( 'HS_sg_map_zoom' ).value = map.zoom;
	document.getElementById( 'HS_sg_map_lat' ).value = map.center.A;
	document.getElementById( 'HS_sg_map_lng' ).value = map.center.F;
}

function HS_bind_sg_coord( marker ){
	document.getElementById( 'HS_sg_map_sg_lat' ).value = marker.position.A;
	document.getElementById( 'HS_sg_map_sg_lng' ).value = marker.position.F;
}

function HS_prevent_submit( event ){
	if( event.keyCode == 13 ){
		event.preventDefault();
	}
}


text:
package br.com.futusteps.survey.ui.base;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.annotation.TargetApi;
import android.os.Build;
import android.support.annotation.IdRes;
import android.support.annotation.NonNull;
import android.support.annotation.StringRes;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;

import br.com.futusteps.survey.R;
import butterknife.ButterKnife;

public abstract class BaseActivity extends AppCompatActivity{

    protected Toolbar toolbar;

    protected void initFragment(@IdRes int container, Fragment fragment) {
        FragmentManager fragmentManager = getSupportFragmentManager();
        FragmentTransaction transaction = fragmentManager.beginTransaction();
        transaction.add(container, fragment);
        transaction.commit();
    }

    @Override
    public void setContentView(int layoutResId) {
        super.setContentView(layoutResId);
        ButterKnife.bind(this);
        prepareToolbar();
    }

    @TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)
    public void showProgress(final boolean show, @NonNull final View screenContainer, @NonNull final View progressView) {
        // On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow
        // for very easy animations. If available, use these APIs to fade-in
        // the progress spinner.
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {
            int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime);

            screenContainer.setVisibility(show ? View.GONE : View.VISIBLE);
            screenContainer.animate().setDuration(shortAnimTime).alpha(
                    show ? 0 : 1).setListener(new AnimatorListenerAdapter() {
                @Override
                public void onAnimationEnd(Animator animation) {
                    screenContainer.setVisibility(show ? View.GONE : View.VISIBLE);
                }
            });

            progressView.setVisibility(show ? View.VISIBLE : View.GONE);
            progressView.animate().setDuration(shortAnimTime).alpha(
                    show ? 1 : 0).setListener(new AnimatorListenerAdapter() {
                @Override
                public void onAnimationEnd(Animator animation) {
                    progressView.setVisibility(show ? View.VISIBLE : View.GONE);
                }
            });
        } else {
            // The ViewPropertyAnimator APIs are not available, so simply show
            // and hide the relevant UI components.
            progressView.setVisibility(show ? View.VISIBLE : View.GONE);
            screenContainer.setVisibility(show ? View.GONE : View.VISIBLE);
        }
    }

    private void prepareToolbar() {
        toolbar = (Toolbar) findViewById(R.id.toolbar);
        if (toolbar != null) {
            setSupportActionBar(toolbar);
        }
    }

    public void setActionBarTitle(@StringRes int title){
        if(getSupportActionBar() != null) {
            getSupportActionBar().setTitle(title);
        }
    }

    public void setActionBarTitle(String title){
        if(getSupportActionBar() != null) {
            getSupportActionBar().setTitle(title);
        }
    }

}


text:
@interface JSQMessagesUIViewTests : XCTestCase
@end

@implementation JSQMessagesUIViewTests

- (void)setUp
{
    [super setUp];
}

- (void)tearDown
{
    [super tearDown];
}

- (void)testViewAutoLayoutPinEdges
{
    UIView *superview = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 50.0f, 50.0f)];
    UIView *subview = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 50.0f, 50.0f)];

    [superview addSubview:subview];
    XCTAssertNoThrow([superview jsq_pinAllEdgesOfSubview:subview], @"Pinning edges of subview to superview should not throw");

    XCTAssertEqual([[superview constraints] count], 4U, @"Superview should have 4 constraints");

    XCTAssertEqual([[subview constraints] count], 0U, @"Subview should have 0 constraints");

    for (NSLayoutConstraint *eachConstraint in [superview constraints]) {

        XCTAssertEqualObjects(eachConstraint.firstItem, superview, @"Constraint first item should be equal to superview");

        XCTAssertEqualObjects(eachConstraint.secondItem, subview, @"Constraint second item should be equal to subview");

        XCTAssertEqual(eachConstraint.relation, NSLayoutRelationEqual, @"Constraint relation should be NSLayoutRelationEqual");

        XCTAssertEqual(eachConstraint.multiplier, 1.0f, @"Constraint multiplier should be 1.0");

        XCTAssertEqual(eachConstraint.constant, 0.0f, @"Constraint constant should be 0.0");
    }
}

@end


text:
// Copyright 2007-2011 The Apache Software Foundation.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
// this file except in compliance with the License. You may obtain a copy of the
// License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
namespace Topshelf.HostConfigurators
{
	using System;
	using System.ServiceProcess;
	using Builders;
	using Internal;

	public class StartModeHostConfigurator :
		HostBuilderConfigurator
	{
		readonly ServiceStartMode _startMode;

		public StartModeHostConfigurator(ServiceStartMode startMode)
		{
			_startMode = startMode;
		}

		public void Validate()
		{
		}

		public HostBuilder Configure([NotNull] HostBuilder builder)
		{
			if (builder == null)
				throw new ArgumentNullException("builder");

			builder.Match<InstallBuilder>(x => x.SetStartMode(_startMode));

			return builder;
		}
	}
}


text:
<?php

// [START dialogflow_list_intents]
namespace Google\Cloud\Samples\Dialogflow;

use Google\Cloud\Dialogflow\V2\IntentsClient;

function intent_list($projectId)
{
    // get intents
    $intentsClient = new IntentsClient();
    $parent = $intentsClient->agentName($projectId);
    $intents = $intentsClient->listIntents($parent);

    foreach ($intents->iterateAllElements() as $intent) {
        // print relevant info
        print(str_repeat('=', 20) . PHP_EOL);
        printf('Intent name: %s' . PHP_EOL, $intent->getName());
        printf('Intent display name: %s' . PHP_EOL, $intent->getDisplayName());
        printf('Action: %s' . PHP_EOL, $intent->getAction());
        printf('Root followup intent: %s' . PHP_EOL,
            $intent->getRootFollowupIntentName());
        printf('Parent followup intent: %s' . PHP_EOL,
            $intent->getParentFollowupIntentName());
        print(PHP_EOL);

        print('Input contexts: ' . PHP_EOL);
        foreach ($intent->getInputContextNames() as $inputContextName) {
            printf("\t Name: %s" . PHP_EOL, $inputContextName);
        }

        print('Output contexts: ' . PHP_EOL);
        foreach ($intent->getOutputContexts() as $outputContext) {
            printf("\t Name: %s" . PHP_EOL, $outputContext->getName());
        }
    }
    $intentsClient->close();
}
// [END dialogflow_list_intents]


text:
<?xml version="1.0" encoding="UTF-8"?>
<v3:TrackReply xmlns:v3="http://fedex.com/ws/track/v3">
  <v3:HighestSeverity>ERROR</v3:HighestSeverity>
  <v3:Notifications>
    <v3:Severity>ERROR</v3:Severity>
    <v3:Source>trck</v3:Source>
    <v3:Code>9040</v3:Code>
    <v3:Message>No information for the following shipments has been received by our system yet.  Please try again or contact Customer Service at 1.800.Go.FedEx(R) 800.463.3339.</v3:Message>
    <v3:LocalizedMessage>No information for the following shipments has been received by our system yet.  Please try again or contact Customer Service at 1.800.Go.FedEx(R) 800.463.3339.</v3:LocalizedMessage>
  </v3:Notifications>
  <v3:TransactionDetail>
    <v3:CustomerTransactionId>Package Tracker Ruby Gem</v3:CustomerTransactionId>
  </v3:TransactionDetail>
  <v3:Version>
    <v3:ServiceId>trck</v3:ServiceId>
    <v3:Major>3</v3:Major>
    <v3:Intermediate>0</v3:Intermediate>
    <v3:Minor>0</v3:Minor>
  </v3:Version>
  <v3:DuplicateWaybill>false</v3:DuplicateWaybill>
  <v3:MoreData>false</v3:MoreData>
</v3:TrackReply>


text:
<?php

namespace App\Models;

use Illuminate\Foundation\Auth\User as Authenticatable;

class User extends Authenticatable
{
    public $timestamps = false;
    protected $fillable = [
        'name', 'email', 'password',
    ];

    protected $hidden = ['password'];
}


text:
<?php

namespace BergclubPlugin\Export\Data;

/**
 * Holds optional arguments array given to the constructor.
 *
 * @package BergclubPlugin\Export\Data
 */
abstract class AbstractGenerator implements Generator
{
    /**
     * @var array $args ;
     */
    protected $args;

    /**
     * @param array $args
     */
    public function __construct(array $args = [])
    {
        $this->args = $args;
    }
}