text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mapping>
  <map key="IN" value="preposition" />
  <map key="TO" value="preposition" />
</mapping>

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

  <meta charset="utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">

  <title>Kernel Debugging</title>
  <meta property="og:title" content="Kernel Debugging" />
  <meta name="twitter:title" content="Kernel Debugging" />
  <meta name="author" content="klue"/>
  <meta name="twitter:card" content="summary" />
  <meta name="twitter:site" content="@kedyliu" />
  <meta name="twitter:creator" content="@kedyliu" />
  <meta property="og:url" content="https://klue.github.io/tags/kernel-debugging/" />
  <meta property="og:type" content="website" />
  <meta property="og:site_name" content="klue-less thoughts" />

  <meta name="generator" content="Hugo 0.30.2" />
  <link rel="canonical" href="https://klue.github.io/tags/kernel-debugging/" />
  <link rel="alternate" href="https://klue.github.io/index.xml" type="application/rss+xml" title="klue-less thoughts">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.7.1/katex.min.css" integrity="sha384-wITovz90syo1dJWVh32uuETPVEtGigN07tkttEqPv+uR2SE/mbQcG7ATL28aI9H0" crossorigin="anonymous">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" />
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
  <link rel="stylesheet" href="https://klue.github.io//css/main.css" />
  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic" />
  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800" />
  <link rel="stylesheet" href="https://klue.github.io//css/pygment_highlights.css" />
  <link rel="stylesheet" href="https://klue.github.io//css/highlight.min.css" /><link href="/css/prism.css" rel="stylesheet" />

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

      </button>
      klue-less thoughts

              about

#Kernel Debugging

Debugging macOS Kernel using VirtualBox

                  Posted on April 10, 2017

                    Update: In the HN discussion, awalton mentioned you can set CPUID flags in VMWare. Simply adding cpuid.7.ebx = "-----------0--------------------" to the vmx file will disable SMAP.
Late last year, I upgraded my old MBP to the 2016 model with a Skylake processor. As I was debugging a kernel exploit, it turned out that SMAP was enabled inside my VMWare Fusion VM. I wanted to avoid dealing with SMAP, but couldn't figure out how to disable it in Fusion.
                    [Read More]

                      #kernel debugging

                      #macOS

                      #VirtualBox

          klue
           •
          2017

             •
            klue-less thoughts

          Hugo v0.30.2 powered  •  Theme by Beautiful Jekyll adapted to Beautiful Hugo


text:
<?xml version="1.0" encoding="utf-8" ?>
<!--
   Read more about the individual rules at https://github.com/stubbornella/csslint/wiki/Rules
-->
<csslint>
  <version>1.0</version>
  <settings>
    <treatWarningsAsErrors>false</treatWarningsAsErrors>
  </settings>
  <rules>
    <rule id="adjoining-classes">true</rule>
    <rule id="box-model">false</rule>
    <rule id="box-sizing">true</rule>
    <rule id="compatible-vendor-prefixes">true</rule>
    <rule id="display-property-grouping">true</rule>
    <rule id="duplicate-properties">true</rule>
    <rule id="empty-rules">true</rule>
    <rule id="errors">true</rule>
    <rule id="floats">true</rule>
    <rule id="font-faces">true</rule>
    <rule id="font-sizes">true</rule>
    <rule id="gradients">true</rule>
    <rule id="ids">false</rule>
    <rule id="import">true</rule>
    <rule id="important">true</rule>
    <rule id="known-properties">true</rule>
    <rule id="outline-none">true</rule>
    <rule id="overqualified-elements">true</rule>
    <rule id="qualified-headings">true</rule>
    <rule id="regex-selectors">true</rule>
    <rule id="shorthand">true</rule>
    <rule id="text-indent">true</rule>
    <rule id="unique-headings">true</rule>
    <rule id="universal-selector">true</rule>
    <rule id="vendor-prefix">true</rule>
    <rule id="zero-units">true</rule>
  </rules>
</csslint>


text:
Takako Hickey
Takako Hickey
Takako M. Hickey


text:
// Copyright 2020 The Oppia Authors. All Rights Reserved.
//
// 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.

import { EventEmitter } from '@angular/core';
import { TestBed } from '@angular/core/testing';
import { AnswerGroupObjectFactory } from 'domain/exploration/AnswerGroupObjectFactory';
import { Interaction, InteractionObjectFactory } from 'domain/exploration/InteractionObjectFactory';
import { OutcomeObjectFactory } from 'domain/exploration/OutcomeObjectFactory';
import { Rule } from 'domain/exploration/RuleObjectFactory';
import { MisconceptionObjectFactory } from 'domain/skill/MisconceptionObjectFactory';
import { importAllAngularServices } from 'tests/unit-test-utils.ajs';
import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap';

/**
 * @fileoverview Unit tests for StateResponsesComponent.
 */

describe('StateResponsesComponent', () => {
  let ctrl = null;
  let $rootScope = null;
  let $scope = null;
  let $uibModal = null;
  let $q = null;
  let WindowDimensionsService = null;
  let StateEditorService = null;
  let ResponsesService = null;
  let StateInteractionIdService = null;
  let StateCustomizationArgsService = null;
  let interactionObjectFactory: InteractionObjectFactory;
  let interactionData: Interaction;
  let outcomeObjectFactory: OutcomeObjectFactory;
  let answerGroupObjectFactory: AnswerGroupObjectFactory;
  let answerGroups;
  let defaultOutcome;
  let misconceptionObjectFactory: MisconceptionObjectFactory;
  let ExternalSaveService = null;
  let StateSolicitAnswerDetailsService = null;
  let AlertsService = null;
  let ngbModal: NgbModal = null;

  let defaultsOutcomesToSuppressWarnings = [
    {
      dest: 'State 4',
      feedback: {
        content_id: 'feedback_1',
        html: ''
      },
      param_changes: [],
      refresher_exploration_id: null,
      labelled_as_correct: false,
      missing_prerequisite_skill_id: ''
    },
    {
      dest: 'State 5',
      feedback: {
        content_id: 'feedback_2',
        html: "Let's go to state 5 ImageAndRegion"
      },
      param_changes: [],
      refresher_exploration_id: null,
      labelled_as_correct: false,
      missing_prerequisite_skill_id: ''
    }
  ];

  beforeEach(angular.mock.module('oppia'));
  importAllAngularServices();

  beforeEach(() => {
    interactionObjectFactory = TestBed.get(InteractionObjectFactory);
    outcomeObjectFactory = TestBed.get(OutcomeObjectFactory);
    answerGroupObjectFactory = TestBed.get(AnswerGroupObjectFactory);
    misconceptionObjectFactory = TestBed.get(MisconceptionObjectFactory);
    ngbModal = TestBed.inject(NgbModal);
  });

  beforeEach(angular.mock.module('oppia', function($provide) {
    $provide.value('NgbModal', {
      open: () => {
        return {
          result: Promise.resolve()
        };
      }
    });
  }));

  beforeEach(angular.mock.inject(
    function($injector, $componentController) {
      $rootScope = $injector.get('$rootScope');
      $scope = $rootScope.$new();
      $uibModal = $injector.get('$uibModal');
      $q = $injector.get('$q');
      ngbModal = $injector.get('NgbModal');

      WindowDimensionsService = $injector.get('WindowDimensionsService');
      StateEditorService = $injector.get('StateEditorService');
      ResponsesService = $injector.get('ResponsesService');
      StateInteractionIdService = $injector.get('StateInteractionIdService');
      StateCustomizationArgsService = $injector
        .get('StateCustomizationArgsService');
      ExternalSaveService = $injector.get('ExternalSaveService');
      StateSolicitAnswerDetailsService = $injector
        .get('StateSolicitAnswerDetailsService');
      AlertsService = $injector.get('AlertsService');

      interactionData = interactionObjectFactory.createFromBackendDict({
        id: 'TextInput',
        answer_groups: [
          {
            outcome: {
              dest: 'State',
              feedback: {
                html: '',
                content_id: 'This is a new feedback text',
              },
              refresher_exploration_id: 'test',
              missing_prerequisite_skill_id: 'test_skill_id',
              labelled_as_correct: false,
              param_changes: [],
            },
            rule_specs: [{
              rule_type: 'Contains',
              inputs: {x: {
                contentId: 'rule_input',
                normalizedStrSet: ['abc']
              }}
            }],
            training_data: [],
            tagged_skill_misconception_id: 'misconception1',
          },
        ],
        default_outcome: {
          dest: 'Hola',
          feedback: {
            content_id: '',
            html: '',
          },
          labelled_as_correct: true,
          param_changes: [],
          refresher_exploration_id: 'test',
          missing_prerequisite_skill_id: 'test_skill_id',
        },
        confirmed_unclassified_answers: [],
        customization_args: {
          rows: {
            value: true,
          },
          placeholder: {
            value: 1,
          },
        },
        hints: [],
        solution: {
          answer_is_exclusive: true,
          correct_answer: 'test_answer',
          explanation: {
            content_id: '2',
            html: 'test_explanation1',
          },
        },
      });

      answerGroups = [answerGroupObjectFactory
        .createFromBackendDict({
          rule_specs: [{
            rule_type: 'Contains',
            inputs: {x: {
              contentId: 'rule_input',
              normalizedStrSet: ['abc']
            }}
          }],
          outcome: {
            dest: 'State',
            feedback: {
              html: '',
              content_id: 'This is a new feedback text'
            },
            labelled_as_correct: false,
            param_changes: [],
            refresher_exploration_id: 'test',
            missing_prerequisite_skill_id: 'test_skill_id'
          },
          training_data: [],
          tagged_skill_misconception_id: 'misconception1'
        }, 'TextInput')
      ];
      defaultOutcome = outcomeObjectFactory.createFromBackendDict({
        dest: 'Hola',
        feedback: {
          content_id: '',
          html: ''
        },
        labelled_as_correct: true,
        param_changes: [],
        refresher_exploration_id: 'test',
        missing_prerequisite_skill_id: 'test_skill_id'
      });

      ctrl = $componentController('stateResponses', {
        $scope: $scope
      });

      ctrl.onSaveInteractionDefaultOutcome = jasmine.createSpy(
        'saveInteraction', () => {});
      ctrl.onSaveInteractionAnswerGroups = jasmine.createSpy(
        'saveAnswerGroup', () => {});
      ctrl.onResponsesInitialized = jasmine.createSpy(
        'responseInitialized', () => {});
      ctrl.refreshWarnings = () => jasmine.createSpy(
        'refreshWarnings', () => {});
      ctrl.onSaveInapplicableSkillMisconceptionIds = jasmine.createSpy(
        'saveInapplicableSkillMisconceptionIds', () => {});
      ctrl.onSaveSolicitAnswerDetails = jasmine.createSpy(
        'saveSolicitAnswerDetails', () => {});
      ctrl.onSaveNextContentIdIndex = jasmine.createSpy(
        'saveNextContentIdIndex', () => {});
    }));

  it('should set component properties on initialization', () => {
    spyOn(WindowDimensionsService, 'isWindowNarrow').and.returnValue(true);
    spyOn(StateEditorService, 'getActiveStateName').and.returnValue('Hola');
    spyOn(StateEditorService, 'getInapplicableSkillMisconceptionIds')
      .and.returnValue(['id1']);

    expect($scope.responseCardIsShown).toBe(undefined);
    expect($scope.enableSolicitAnswerDetailsFeature).toBe(undefined);
    expect($scope.SHOW_TRAINABLE_UNRESOLVED_ANSWERS).toBe(undefined);
    expect($scope.stateName).toBe(undefined);
    expect($scope.misconceptionsBySkill).toEqual(undefined);
    expect($scope.inapplicableSkillMisconceptionIds).toEqual(undefined);

    ctrl.$onInit();

    expect($scope.responseCardIsShown).toBe(false);
    expect($scope.enableSolicitAnswerDetailsFeature).toBe(true);
    expect($scope.SHOW_TRAINABLE_UNRESOLVED_ANSWERS).toBe(false);
    expect($scope.stateName).toBe('Hola');
    expect($scope.misconceptionsBySkill).toEqual({});
    expect($scope.inapplicableSkillMisconceptionIds).toEqual(['id1']);

    ctrl.$onDestroy();
  });

  it('should subscribe to events on component initialization', () => {
    spyOn(ResponsesService.onInitializeAnswerGroups, 'subscribe');
    spyOn(StateInteractionIdService.onInteractionIdChanged, 'subscribe');
    spyOn(ResponsesService.onAnswerGroupsChanged, 'subscribe');
    spyOn(StateEditorService.onUpdateAnswerChoices, 'subscribe');
    spyOn(StateEditorService.onHandleCustomArgsUpdate, 'subscribe');
    spyOn(StateEditorService.onStateEditorInitialized, 'subscribe');

    ctrl.$onInit();

    expect(ResponsesService.onInitializeAnswerGroups.subscribe)
      .toHaveBeenCalled();
    expect(StateInteractionIdService.onInteractionIdChanged.subscribe)
      .toHaveBeenCalled();
    expect(ResponsesService.onAnswerGroupsChanged.subscribe).toHaveBeenCalled();
    expect(StateEditorService.onUpdateAnswerChoices.subscribe)
      .toHaveBeenCalled();
    expect(StateEditorService.onHandleCustomArgsUpdate.subscribe)
      .toHaveBeenCalled();
    expect(StateEditorService.onStateEditorInitialized.subscribe)
      .toHaveBeenCalled();

    ctrl.$onDestroy();
  });

  it('should set answer group and default answer when answer' +
    ' groups are initialized', () => {
    let onInitializeAnswerGroupsEmitter = new EventEmitter();
    spyOnProperty(ResponsesService, 'onInitializeAnswerGroups')
      .and.returnValue(onInitializeAnswerGroupsEmitter);
    spyOn(ResponsesService, 'changeActiveAnswerGroupIndex');
    spyOn($scope, 'isCurrentInteractionLinear').and.returnValue(true);

    ctrl.$onInit();

    onInitializeAnswerGroupsEmitter.emit(interactionData);

    expect($scope.defaultOutcome).toEqual(defaultOutcome);
    expect($scope.answerGroups).toEqual(answerGroups);
    expect(ResponsesService.changeActiveAnswerGroupIndex)
      .toHaveBeenCalledWith(0);

    ctrl.$onDestroy();
  });

  it('should re-initialize properties and open add answer group modal when' +
    ' interaction is changed to a non-linear and non-terminal one', () => {
    let onInteractionIdChangedEmitter = new EventEmitter();
    spyOn(ResponsesService, 'getAnswerGroups').and.returnValue(answerGroups);
    spyOn(ResponsesService, 'getActiveAnswerGroupIndex').and.returnValue(0);
    spyOnProperty(StateInteractionIdService, 'onInteractionIdChanged')
      .and.returnValue(onInteractionIdChangedEmitter);
    spyOn(ResponsesService, 'onInteractionIdChanged').and.callFake(
      (options, callback) => {
        callback();
      });
    spyOn(StateEditorService, 'isInQuestionMode').and.returnValue(true);
    spyOn(ResponsesService, 'getDefaultOutcome').and.returnValue(
      defaultOutcome);
    spyOn($scope, 'openAddAnswerGroupModal');

    expect($scope.answerGroups).toEqual(undefined);
    expect($scope.defaultOutcome).toEqual(undefined);
    expect($scope.activeAnswerGroupIndex).toBe(undefined);

    ctrl.$onInit();
    onInteractionIdChangedEmitter.emit('ImageClickInput');

    expect($scope.answerGroups).toEqual(answerGroups);
    expect($scope.defaultOutcome).toEqual(defaultOutcome);
    expect($scope.activeAnswerGroupIndex).toBe(0);
    expect($scope.openAddAnswerGroupModal).toHaveBeenCalled();

    ctrl.$onDestroy();
  });

  it('should not open add answer group modal when interaction is' +
    ' changed to a linear and terminal one', () => {
    let onInteractionIdChangedEmitter = new EventEmitter();
    spyOnProperty(StateInteractionIdService, 'onInteractionIdChanged')
      .and.returnValue(onInteractionIdChangedEmitter);
    spyOn($scope, 'openAddAnswerGroupModal');

    ctrl.$onInit();
    onInteractionIdChangedEmitter.emit('Continue');

    expect($scope.openAddAnswerGroupModal).not.toHaveBeenCalled();

    ctrl.$onDestroy();
  });

  it('should get new answer groups, default outcome and verify/update' +
    ' inapplicable skill misconception ids on answer groups change', () => {
    let onAnswerGroupsChangedEmitter = new EventEmitter();
    spyOn(ResponsesService, 'getAnswerGroups').and.returnValue(answerGroups);
    spyOnProperty(ResponsesService, 'onAnswerGroupsChanged')
      .and.returnValue(onAnswerGroupsChangedEmitter);
    spyOn(ResponsesService, 'getActiveAnswerGroupIndex').and.returnValue(0);
    spyOn(ResponsesService, 'getDefaultOutcome').and.returnValue(
      defaultOutcome);
    spyOn(StateEditorService, 'getInapplicableSkillMisconceptionIds')
      .and.returnValue(['misconception1']);

    expect($scope.answerGroups).toEqual(undefined);
    expect($scope.defaultOutcome).toEqual(undefined);
    expect($scope.activeAnswerGroupIndex).toBe(undefined);
    expect($scope.inapplicableSkillMisconceptionIds).toEqual(undefined);

    ctrl.$onInit();

    expect($scope.inapplicableSkillMisconceptionIds)
      .toEqual(['misconception1']);

    onAnswerGroupsChangedEmitter.emit();

    expect($scope.answerGroups).toEqual(answerGroups);
    expect($scope.defaultOutcome).toEqual(defaultOutcome);
    expect($scope.activeAnswerGroupIndex).toBe(0);
    expect($scope.inapplicableSkillMisconceptionIds).toEqual([]);

    ctrl.$onDestroy();
  });

  it('should update answer choices', () => {
    let onUpdateAnswerChoicesEmitter = new EventEmitter();
    spyOnProperty(StateEditorService, 'onUpdateAnswerChoices')
      .and.returnValue(onUpdateAnswerChoicesEmitter);
    spyOn(ResponsesService, 'updateAnswerChoices');

    ctrl.$onInit();
    onUpdateAnswerChoicesEmitter.emit();

    expect(ResponsesService.updateAnswerChoices).toHaveBeenCalled();

    ctrl.$onDestroy();
  });

  it('should update custom arguments', () => {
    let onHandleCustomArgsUpdateEmitter = new EventEmitter();
    spyOnProperty(StateEditorService, 'onHandleCustomArgsUpdate')
      .and.returnValue(onHandleCustomArgsUpdateEmitter);
    spyOn(ResponsesService, 'handleCustomArgsUpdate').and.callFake(
      (newAnswerChoices, callback) => {
        callback();
      }
    );

    ctrl.$onInit();
    onHandleCustomArgsUpdateEmitter.emit();

    expect(ctrl.onSaveInteractionAnswerGroups).toHaveBeenCalled();

    ctrl.$onDestroy();
  });

  it('should set misconceptions when state editor is initialized', () => {
    let onStateEditorInitializedEmitter = new EventEmitter();
    spyOnProperty(StateEditorService, 'onStateEditorInitialized')
      .and.returnValue(onStateEditorInitializedEmitter);
    spyOn(StateEditorService, 'getMisconceptionsBySkill')
      .and.returnValue({
        skill1: [misconceptionObjectFactory.create(
          'm1', 'Misconception 1', 'note', '', false)]
      });

    expect($scope.misconceptionsBySkill).toBe(undefined);
    expect($scope.containsOptionalMisconceptions).toBe(undefined);

    ctrl.$onInit();
    onStateEditorInitializedEmitter.emit();

    expect($scope.misconceptionsBySkill).toEqual({
      skill1: [misconceptionObjectFactory.create(
        'm1', 'Misconception 1', 'note', '', false)]
    });
    expect($scope.containsOptionalMisconceptions).toBe(true);

    ctrl.$onDestroy();
  });

  it('should set active answer group index as -1 when starting sorting', () => {
    let ui = {
      placeholder: {
        height: () => {}
      },
      item: {
        height: () => {}
      }
    };

    spyOn(ResponsesService, 'getActiveAnswerGroupIndex').and.returnValue(-1);
    spyOn(ExternalSaveService.onExternalSave, 'emit');

    expect($scope.activeAnswerGroupIndex).toBe(undefined);

    ctrl.$onInit();
    $scope.ANSWER_GROUP_LIST_SORTABLE_OPTIONS.start('', ui);

    expect($scope.activeAnswerGroupIndex).toBe(-1);
    expect(ExternalSaveService.onExternalSave.emit).toHaveBeenCalled();

    ctrl.$onDestroy();
  });

  it('should save answer groups and default outcome when sorting stops', () => {
    spyOn(ResponsesService, 'save').and.callFake(
      (answerGroups, defaultOutcome, callback) => {
        callback(answerGroups, defaultOutcome);
      }
    );

    ctrl.$onInit();
    $scope.ANSWER_GROUP_LIST_SORTABLE_OPTIONS.stop();

    expect(ctrl.onSaveInteractionAnswerGroups).toHaveBeenCalled();
    expect(ctrl.onSaveInteractionDefaultOutcome).toHaveBeenCalled();

    ctrl.$onDestroy();
  });

  it('should get static image URL', () => {
    ctrl.$onInit();

    expect($scope.getStaticImageUrl('/image/url'))
      .toBe('/assets/images/image/url');

    ctrl.$onDestroy();
  });

  it('should check if state is in question mode', () => {
    spyOn(StateEditorService, 'isInQuestionMode').and.returnValue(true);

    expect($scope.isInQuestionMode()).toBe(true);
  });

  it('should suppress default answer group warnings if each choice' +
    ' has been handled by at least one answer group for multiple' +
    ' choice interaction', () => {
    // This contains 2 AnswerGroup for a MultipleChoiceInteraction.
    let answerGroups = [
      answerGroupObjectFactory.createFromBackendDict({
        outcome: defaultsOutcomesToSuppressWarnings[0],
        rule_specs: [{
          rule_type: 'Equals',
          inputs: {x: 0}
        }],
        training_data: [],
        tagged_skill_misconception_id: ''
      }, 'MultipleChoiceInput'),
      answerGroupObjectFactory.createFromBackendDict({
        outcome: defaultsOutcomesToSuppressWarnings[1],
        rule_specs: [{
          rule_type: 'Equals',
          inputs: {x: 1}
        }],
        training_data: [],
        tagged_skill_misconception_id: ''
      }, 'MultipleChoiceInput')
    ];
    // This contains 2 AnswerChoice for MultipleChoiceInteraction.
    let answerChoices = [
      {
        val: 0,
        label: 'label1'
      },
      {
        val: 1,
        label: 'label2'
      }
    ];
    StateInteractionIdService.savedMemento = 'MultipleChoiceInput';
    spyOn(ResponsesService, 'getAnswerGroups').and.returnValue(answerGroups);
    spyOn(ResponsesService, 'getAnswerChoices').and.returnValue(answerChoices);

    expect($scope.suppressDefaultAnswerGroupWarnings()).toBe(true);
  });

  it('should suppress default answer group warnings if each choice' +
    ' has been handled by at least one answer group for item' +
    ' selection input interaction', () => {
    // This contains 2 AnswerGroup for a ItemSelectionInput.
    let answerGroups = [
      answerGroupObjectFactory.createFromBackendDict({
        outcome: defaultsOutcomesToSuppressWarnings[0],
        rule_specs: [{
          rule_type: 'Equals',
          inputs: {x: ['ca_0', 'ca_1']}
        }],
        training_data: [],
        tagged_skill_misconception_id: ''
      }, 'ItemSelectionInput'),
      answerGroupObjectFactory.createFromBackendDict({
        outcome: defaultsOutcomesToSuppressWarnings[1],
        rule_specs: [{
          rule_type: 'DoesNotContainAtLeastOneOf',
          inputs: {x: ['ca_0', 'ca_1', 'ca_2']}
        }],
        training_data: [],
        tagged_skill_misconception_id: ''
      }, 'ItemSelectionInput')
    ];
    // This contains 2 AnswerChoice for ItemSelectionInput.
    let answerChoices = [
      {
        value: [{
          content_id: 'ca_choices_3',
          html: '
Choice 1
'
        }, {
          content_id: 'ca_choices_4',
          html: '
Choice 2
'
        }]
      }
    ];
    StateInteractionIdService.savedMemento = 'ItemSelectionInput';
    StateCustomizationArgsService.savedMemento = {
      maxAllowableSelectionCount: {
        value: 1
      }
    };
    spyOn(ResponsesService, 'getAnswerGroups').and.returnValue(answerGroups);
    spyOn(ResponsesService, 'getAnswerChoices').and.returnValue(answerChoices);

    expect($scope.suppressDefaultAnswerGroupWarnings()).toBe(true);
  });

  it('should not suppress warnings for interactions other than multiple' +
    ' choice input or item selection input', () => {
    StateInteractionIdService.savedMemento = 'TextInput';

    expect($scope.suppressDefaultAnswerGroupWarnings()).toBe(false);
  });

  it('should save displayed value when solicit answer details' +
    ' are changed', () => {
    spyOn(StateSolicitAnswerDetailsService, 'saveDisplayedValue');

    ctrl.$onInit();

    $scope.onChangeSolicitAnswerDetails();

    expect(ctrl.onSaveSolicitAnswerDetails).toHaveBeenCalled();
    expect(StateSolicitAnswerDetailsService.saveDisplayedValue)
      .toHaveBeenCalled();
  });

  it('should check if outcome has no feedback with self loop', () => {
    $scope.stateName = 'State Name';
    let outcome1 = outcomeObjectFactory.createNew(
      'State Name', '1', '', []);
    let outcome2 = outcomeObjectFactory.createNew(
      'State Name', '1', 'Feedback Text', []);

    expect($scope.isSelfLoopWithNoFeedback(outcome1)).toBe(true);
    expect($scope.isSelfLoopWithNoFeedback(outcome2)).toBe(false);
    expect($scope.isSelfLoopWithNoFeedback(null)).toBe(false);
  });

  it('should check if outcome marked as correct has self loop', () => {
    spyOn(StateEditorService, 'getCorrectnessFeedbackEnabled').and.returnValue(
      true);
    let outcome = outcomeObjectFactory.createFromBackendDict({
      dest: 'State Name',
      feedback: {
        content_id: '',
        html: ''
      },
      labelled_as_correct: true,
      param_changes: [],
      refresher_exploration_id: 'test',
      missing_prerequisite_skill_id: 'test_skill_id'
    });
    $scope.stateName = 'State Name';

    expect($scope.isSelfLoopThatIsMarkedCorrect(outcome)).toBe(true);

    $scope.stateName = 'Hola';

    expect($scope.isSelfLoopThatIsMarkedCorrect(outcome)).toBe(false);
  });

  it('should check if outcome marked as correct has self loop and return' +
    ' false if correctness feedback is not enabled', () => {
    spyOn(StateEditorService, 'getCorrectnessFeedbackEnabled').and.returnValue(
      false);
    let outcome = outcomeObjectFactory.createFromBackendDict({
      dest: 'State Name',
      feedback: {
        content_id: '',
        html: ''
      },
      labelled_as_correct: true,
      param_changes: [],
      refresher_exploration_id: 'test',
      missing_prerequisite_skill_id: 'test_skill_id'
    });
    $scope.stateName = 'State Name';

    expect($scope.isSelfLoopThatIsMarkedCorrect(outcome)).toBe(false);
  });

  it('should show state name input if user is creating new state', () => {
    let outcome1 = outcomeObjectFactory.createNew('/', '', '', []);
    let outcome2 = outcomeObjectFactory.createNew('Hola', '', '', []);

    expect($scope.isCreatingNewState(outcome1)).toBe(true);
    expect($scope.isCreatingNewState(outcome2)).toBe(false);
  });

  it('should check if current interaction is non trivial', () => {
    StateInteractionIdService.savedMemento = 'Continue';

    expect($scope.isCurrentInteractionTrivial()).toBe(true);

    StateInteractionIdService.savedMemento = 'TextInput';

    expect($scope.isCurrentInteractionTrivial()).toBe(false);
  });

  it('should check if the interaction is linear and has feedback', () => {
    StateInteractionIdService.savedMemento = 'Continue';
    let outcome1 = outcomeObjectFactory.createNew('Hola', '', '', []);

    expect($scope.isLinearWithNoFeedback(outcome1)).toBe(true);

    StateInteractionIdService.savedMemento = 'Continue';
    let outcome2 = outcomeObjectFactory.createNew('Hola', '', 'Right!', []);

    expect($scope.isLinearWithNoFeedback(outcome2)).toBe(false);

    StateInteractionIdService.savedMemento = 'TextInput';
    let outcome3 = outcomeObjectFactory.createNew('Hola', '', '', []);

    expect($scope.isLinearWithNoFeedback(outcome3)).toBe(false);

    StateInteractionIdService.savedMemento = 'TextInput';
    let outcome4 = outcomeObjectFactory.createNew('Hola', '', 'Wrong!', []);

    expect($scope.isLinearWithNoFeedback(outcome4)).toBe(false);

    expect($scope.isLinearWithNoFeedback(null)).toBe(false);
  });

  it('should get outcome tooltip text', () => {
    // When outcome has self loop and is labelled correct.
    spyOn(StateEditorService, 'getCorrectnessFeedbackEnabled').and.returnValue(
      true);
    let outcome = outcomeObjectFactory.createFromBackendDict({
      dest: 'State Name',
      feedback: {
        content_id: '',
        html: ''
      },
      labelled_as_correct: true,
      param_changes: [],
      refresher_exploration_id: 'test',
      missing_prerequisite_skill_id: 'test_skill_id'
    });
    $scope.stateName = 'State Name';

    expect($scope.getOutcomeTooltip(outcome)).toBe(
      'Self-loops should not be labelled as correct.');

    // When interaction is linear with no feedback.
    StateInteractionIdService.savedMemento = 'Continue';
    let outcome1 = outcomeObjectFactory.createNew('Hola', '', '', []);

    expect($scope.getOutcomeTooltip(outcome1)).toBe(
      'Please direct the learner to a different card.');

    // When interaction is not linear.
    StateInteractionIdService.savedMemento = 'TextInput';

    expect($scope.getOutcomeTooltip(outcome1)).toBe(
      'Please give Oppia something useful to say,' +
      ' or direct the learner to a different card.');
  });

  it('should open add response modal when user clicks on' +
    ' \'+ ADD RESPONSE\' button', () => {
    spyOn($uibModal, 'open').and.callThrough();

    $scope.openAddAnswerGroupModal();

    expect($uibModal.open).toHaveBeenCalled();
  });

  it('should open add response modal and save new answer groups' +
    ' added by the user', () => {
    spyOn(ResponsesService, 'save').and.callFake(
      (answerGroups, defaultOutcome, callback) => {
        callback(answerGroups, defaultOutcome);
      }
    );
    // Returning rejecting callback as the modal opens again, as reopen is true
    // so we close it when it is opened for the second time.
    spyOn($uibModal, 'open').and.returnValues({
      result: $q.resolve({
        reopen: true,
        tmpRule: new Rule('', null, null),
        tmpOutcome: outcomeObjectFactory
          .createNew('Hola', '1', 'Feedback text', []),
        tmpTaggedSkillMisconceptionId: ''
      })
    }, {
      result: $q.reject()
    });
    $scope.answerGroups = [];

    $scope.openAddAnswerGroupModal();
    $scope.$apply();

    expect($scope.answerGroups).toEqual([answerGroupObjectFactory.createNew(
      [new Rule('', null, null)], outcomeObjectFactory.createNew(
        'Hola', '1', 'Feedback text', []), [], ''
    )]);
    expect(ResponsesService.save).toHaveBeenCalled();
  });

  it('should clear warnings when modal is closed', () => {
    spyOn(AlertsService, 'clearWarnings');
    spyOn($uibModal, 'open').and.returnValue({
      result: $q.reject()
    });

    $scope.openAddAnswerGroupModal();
    $scope.$apply();

    expect(AlertsService.clearWarnings).toHaveBeenCalledTimes(2);
  });

  it('should open delete answer group modal when user clicks' +
    ' on delete button', () => {
    spyOn(ngbModal, 'open').and.callThrough();

    $scope.deleteAnswerGroup(0, new Event(''));

    expect(ngbModal.open).toHaveBeenCalled();
  });

  it('should delete answer group after modal is opened', () => {
    spyOn(ResponsesService, 'deleteAnswerGroup').and.callFake(
      (index, callback) => {
        callback();
      }
    );
    spyOn(ngbModal, 'open').and.returnValue(
      {
        result: $q.resolve()
      } as NgbModalRef
    );

    $scope.deleteAnswerGroup(0, new Event(''));
    $scope.$apply();

    expect(ngbModal.open).toHaveBeenCalled();
    expect(ResponsesService.deleteAnswerGroup).toHaveBeenCalled();
  });

  it('should clear warnings when delete answer group modal is closed', () => {
    spyOn(AlertsService, 'clearWarnings');
    spyOn(ngbModal, 'open').and.returnValue(
      {
        result: $q.reject()
      } as NgbModalRef
    );

    $scope.deleteAnswerGroup(0, new Event(''));
    $scope.$apply();

    expect(AlertsService.clearWarnings).toHaveBeenCalledTimes(2);
  });

  it('should update active answer group for newly tagged misconception', () => {
    spyOn(ResponsesService, 'updateActiveAnswerGroup').and.callFake(
      ({taggedSkillMisconceptionId}, callback) => {
        callback();
      }
    );

    $scope.saveTaggedMisconception('misconception1', 'skill1');

    expect(ctrl.onSaveInteractionAnswerGroups).toHaveBeenCalled();
  });

  it('should update active answer group when feedback is changed', () => {
    spyOn(ResponsesService, 'updateActiveAnswerGroup').and.callFake(
      ({feedback}, callback) => {
        callback();
      }
    );

    $scope.saveActiveAnswerGroupFeedback(defaultOutcome);

    expect(ctrl.onSaveInteractionAnswerGroups).toHaveBeenCalled();
  });

  it('should update active answer group when destination is changed', () => {
    spyOn(ResponsesService, 'updateActiveAnswerGroup')
      .and.callFake(({dest, expId, skillId}, callback) => {
        callback();
      });

    $scope.saveActiveAnswerGroupDest(defaultOutcome);

    expect(ctrl.onSaveInteractionAnswerGroups).toHaveBeenCalled();
  });

  it('should update active answer group when correctness' +
    ' label is changed', () => {
    spyOn(ResponsesService, 'updateActiveAnswerGroup').and.callFake(
      ({labelledAsCorrect}, callback) => {
        callback();
      }
    );

    $scope.saveActiveAnswerGroupCorrectnessLabel(defaultOutcome);

    expect(ctrl.onSaveInteractionAnswerGroups).toHaveBeenCalled();
  });

  it('should update active answer group when answer rules are changed', () => {
    spyOn(ResponsesService, 'updateActiveAnswerGroup').and.callFake(
      ({rules}, callback) => {
        callback();
      }
    );

    $scope.saveActiveAnswerGroupRules(new Rule('', null, null));

    expect(ctrl.onSaveInteractionAnswerGroups).toHaveBeenCalled();
  });

  it('should update default outcome when default' +
    ' outcome feedback is changed', () => {
    spyOn(ResponsesService, 'updateDefaultOutcome').and.callFake(
      ({feedback, dest}, callback) => {
        callback();
      }
    );

    $scope.saveDefaultOutcomeFeedback(defaultOutcome);

    expect(ctrl.onSaveInteractionDefaultOutcome).toHaveBeenCalled();
  });

  it('should update default outcome when default' +
    ' outcome destination is changed', () => {
    spyOn(ResponsesService, 'updateDefaultOutcome')
      .and.callFake(({dest, expId, skillId}, callback) => {
        callback();
      });

    $scope.saveDefaultOutcomeDest(defaultOutcome);

    expect(ctrl.onSaveInteractionDefaultOutcome).toHaveBeenCalled();
  });

  it('should update default outcome when default' +
    ' outcome correctness label is changed', () => {
    spyOn(ResponsesService, 'updateDefaultOutcome').and.callFake(
      ({labelledAsCorrect}, callback) => {
        callback();
      }
    );

    $scope.saveDefaultOutcomeCorrectnessLabel(defaultOutcome);

    expect(ctrl.onSaveInteractionDefaultOutcome).toHaveBeenCalled();
  });

  it('should return summary of answer group', () => {
    expect($scope.summarizeAnswerGroup(
      answerGroupObjectFactory.createNew(
        [],
        outcomeObjectFactory.createNew('unused', '1', 'Feedback text', []),
        [], '0'), '1', {}, true))
      .toBe('[Answer] Feedback text');
  });

  it('should get summary default outcome when outcome is linear', () => {
    expect($scope.summarizeDefaultOutcome(
      outcomeObjectFactory.createNew(
        'unused', '1', 'Feedback Text', []), 'Continue', 0, true))
      .toBe('[When the button is clicked] Feedback Text');
  });

  it('should get summary default outcome when answer group count' +
    ' is greater than 0', () => {
    expect($scope.summarizeDefaultOutcome(
      outcomeObjectFactory.createNew(
        'unused', '1', 'Feedback Text', []), 'TextInput', 1, true))
      .toBe('[All other answers] Feedback Text');
  });

  it('should get summary default outcome when answer group count' +
    ' is equal to 0', () => {
    expect($scope.summarizeDefaultOutcome(
      outcomeObjectFactory.createNew(
        'unused', '1', 'Feedback Text', []), 'TextInput', 0, true))
      .toBe('[All answers] Feedback Text');
  });

  it('should get an empty summary when default outcome' +
    ' is a falsy value', () => {
    expect($scope.summarizeDefaultOutcome(null, 'Continue', 0, true))
      .toBe('');
  });

  it('should check if outcome is looping', () => {
    $scope.stateName = 'Hola';
    expect($scope.isOutcomeLooping(outcomeObjectFactory.createNew(
      'Hola', '', '', []))).toBe(true);
    expect($scope.isOutcomeLooping(outcomeObjectFactory.createNew(
      'Second Last', '', '', []))).toBe(false);
  });

  it('should toggle response card', () => {
    $scope.responseCardIsShown = true;

    $scope.toggleResponseCard();
    expect($scope.responseCardIsShown).toBe(false);

    $scope.toggleResponseCard();
    expect($scope.responseCardIsShown).toBe(true);
  });

  it('should check if no action is expected for misconception', () => {
    spyOn(ResponsesService, 'getAnswerGroups').and.returnValue(answerGroups);
    $scope.inapplicableSkillMisconceptionIds = ['misconception2'];

    // Here, misconception1 is assigned to answerGroup, so no action is
    // expected.
    expect($scope.isNoActionExpected('misconception1')).toBe(true);
    // Here, misconception2 is not assigned to answerGroup but it is an
    // inapplicable skill misconception, so no action is expected.
    expect($scope.isNoActionExpected('misconception2')).toBe(true);
    // Here, misconception3 is neither inapplicable nor assigned to answerGroup
    // so action is expected.
    expect($scope.isNoActionExpected('misconceptions')).toBe(false);
  });

  it('should update optional misconception id status when user' +
    ' marks it as applicable', () => {
    $scope.inapplicableSkillMisconceptionIds = ['misconception1'];

    $scope.updateOptionalMisconceptionIdStatus('misconception1', true);

    expect($scope.inapplicableSkillMisconceptionIds).toEqual([]);
  });

  it('should update optional misconception id status when user' +
    ' marks it as applicable', () => {
    $scope.inapplicableSkillMisconceptionIds = ['misconception1'];

    $scope.updateOptionalMisconceptionIdStatus('misconception2', false);

    expect($scope.inapplicableSkillMisconceptionIds)
      .toEqual(['misconception1', 'misconception2']);
  });

  it('should get unaddressed misconception names', () => {
    spyOn(ResponsesService, 'getAnswerGroups').and.returnValue(answerGroups);
    $scope.misconceptionsBySkill = {
      skill1: [
        misconceptionObjectFactory.create(
          'm1', 'Misconception 1', 'note', '', false),
        misconceptionObjectFactory.create(
          'm2', 'Misconception 2', 'note', '', true)
      ]
    };

    expect($scope.getUnaddressedMisconceptionNames())
      .toEqual(['Misconception 2']);
  });
});


text:
/*
 * Bootstrap Documentation
 * Special styles for presenting Bootstrap's documentation and code examples.
 *
 * Table of contents:
 *
 * Scaffolding
 * Main navigation
 * Footer
 * Social buttons
 * Homepage
 * Page headers
 * Old docs callout
 * Side navigation
 * Docs sections
 * Callouts
 * Grid styles
 * Examples
 * Code snippets (highlight)
 * Responsive tests
 * Glyphicons
 * Customizer
 * Miscellaneous
 */

/*
 * Scaffolding
 *
 * Update the basics of our documents to prep for docs content.
 */

body {
  position: relative; /* For scrollyspy */
  padding-top: 46px; /* Account for fixed masthead */
}

/* Keep code small in tables on account of limited space */
.table code {
  font-size: 13px;
  font-weight: normal;
}

/* Outline button for use within the docs */
.btn-outline {
  color: #fff;
  background-color: transparent;
  border-color: #bfc4e0;
}
.btn-outline:hover,
.btn-outline:focus,
.btn-outline:active {
  color: #fff;
  background-color: #4e599e;
  border-color: #bfc4e0;
}

/*
 * Footer
 *
 * Separated section of content at the bottom of all pages, save the homepage.
 */

.bs-footer {
  padding-top: 40px;
  padding-bottom: 30px;
  margin-top: 100px;
  color: #777;
  text-align: center;
  border-top: 1px solid #e5e5e5;
}
.footer-links {
  margin: 10px 0;
  padding-left: 0;
}
.footer-links li {
  display: inline;
  padding: 0 2px;
}
.footer-links li:first-child {
  padding-left: 0;
}

@media (min-width: 768px) {
  .bs-footer {
    text-align: left;
  }
  .bs-footer p {
    margin-bottom: 0;
  }
}

/*
 * Social buttons
 *
 * Twitter and GitHub social action buttons (for homepage and footer).
 */

.bs-social {
  margin-top: 20px;
  margin-bottom: 20px;
  text-align: center;
}
.bs-social-buttons {
  display: inline-block;
  margin-bottom: 0;
  padding-left: 0;
  list-style: none;
}
.bs-social-buttons li {
  display: inline-block;
  line-height: 1;
  padding: 5px 8px;
}
.bs-social-buttons .twitter-follow-button {
  width: 225px !important;
}
.bs-social-buttons .twitter-share-button {
  width: 98px !important;
}
/* Style the GitHub buttons via CSS instead of inline attributes */
.github-btn {
  border: 0;
  overflow: hidden;
}

@media (min-width: 768px) {
  .bs-social {
    text-align: left;
  }
  .bs-social-buttons li:first-child {
    padding-left: 0;
  }
}

/*
 * Topography, yo!
 *
 * Apply the map background via base64 and relevant colors where we need 'em.
 */

/*
 * Homepage
 *
 * Tweaks to the custom homepage and the masthead (main jumbotron).
 */

 /* Masthead (headings and download button) */
.bs-masthead {
  position: relative;
  padding: 30px 15px;
  text-align: center;
  text-shadow: 0 1px 0 rgba(0,0,0,.15);
}
.bs-masthead h1 {
  font-size: 50px;
  line-height: 1;
}
.bs-masthead .btn-outline-inverse {
  margin: 10px;
}

/* Links to project-level content like the repo, Expo, etc */
.bs-masthead-links {
  margin-top: 20px;
  margin-bottom: 40px;
  padding: 0 15px;
  list-style: none;
  text-align: center;
}
.bs-masthead-links li {
  display: inline;
  color: #999;
}
.bs-masthead-links li + li {
  margin-left: 20px;
}

@media (min-width: 768px) {
  .bs-masthead {
    text-align: left;
    padding-top:    60px;
    padding-bottom: 60px;
  }
  .bs-masthead h1 {
    font-size: 80px;
  }
  .bs-masthead .lead {
    margin-right: 25%;
    font-size: 28px;
  }
  .bs-masthead .btn-outline-inverse {
    width: auto;
    margin: 20px 5px 20px 0;
    padding: 16px 22px;
    font-size: 20px;
  }
  .bs-masthead-links {
    padding: 0;
    text-align: left;
  }
}

/*
 * Page headers
 *
 * Jumbotron-esque headers at the top of every page that's not the homepage.
 */

/* Page headers */
.bs-header {
  padding: 10px 15px 20px; /* side padding builds on .container 15px, so 30px */
  font-size: 16px;
  text-align: center;
  text-shadow: 0 1px 0 rgba(0,0,0,.15);
}
.bs-header p {
  font-weight: 300;
  line-height: 1.5;
}
.bs-header .container {
  position: relative;
}

@media (min-width: 768px) {
  .bs-header {
    font-size: 18px;
    text-align: left;
  }
  .bs-header h1 {
    font-size: 36px;
    line-height: 1;
  }
}

@media (min-width: 992px) {
  .bs-header h1,
  .bs-header p {
    margin-right: 380px;
  }
}

/*
 * Callout for 2.3.2 docs
 *
 * Only appears below page headers (not on the homepage). The homepage gets its
 * own link with the masthead links.
 */

.bs-old-docs {
  padding: 15px 20px;
  color: #777;
  background-color: #fefefe;
  border-top: 1px solid #ebebeb;
  border-bottom: 1px solid #ebebeb;
}
.bs-old-docs strong {
  color: #555;
}

/*
 * Side navigation
 *
 * Scrollspy and affixed enhanced navigation to highlight sections and secondary
 * sections of docs content.
 */

/* By default it's not affixed in mobile views, so undo that */
.bs-sidebar.affix {
  position: static;
}

/* First level of nav */
.bs-sidenav {
  margin-top: 30px;
  margin-bottom: 30px;
}

/* All levels of nav */
.bs-sidebar .nav > li > a {
  display: block;
  color: #222;
  padding: 5px 20px;
}
.bs-sidebar .nav > li > a:hover,
.bs-sidebar .nav > li > a:focus {
  text-decoration: none;
  background-color: #eee;
}
.bs-sidebar .nav > .active > a,
.bs-sidebar .nav > .active:hover > a,
.bs-sidebar .nav > .active:focus > a {
  color: #dd4b39;
  background-color: transparent;
}

/* Nav: second level (shown on .active) */
.bs-sidebar .nav .nav {
  display: none; /* Hide by default, but at >768px, show it */
  margin-bottom: 8px;
}
.bs-sidebar .nav .nav > li > a {
  padding-top:    3px;
  padding-bottom: 3px;
  padding-left: 30px;
  font-size: 90%;
}

/* Show and affix the side nav when space allows it */
@media (min-width: 992px) {
  .bs-sidebar .nav > .active > ul {
    display: block;
  }
  /* Widen the fixed sidebar */
  .bs-sidebar.affix,
  .bs-sidebar.affix-bottom {
    width: 213px;
  }
  .bs-sidebar.affix {
    position: fixed; /* Undo the static from mobile first approach */
    top: 80px;
  }
  .bs-sidebar.affix-bottom {
    position: absolute; /* Undo the static from mobile first approach */
  }
  .bs-sidebar.affix-bottom .bs-sidenav,
  .bs-sidebar.affix .bs-sidenav {
    margin-top: 0;
    margin-bottom: 0;
  }
}
@media (min-width: 1200px) {
  /* Widen the fixed sidebar again */
  .bs-sidebar.affix-bottom,
  .bs-sidebar.affix {
    width: 263px;
  }
}

/*
 * Docs sections
 *
 * Content blocks for each component or feature.
 */

/* Space things out */
.bs-docs-section + .bs-docs-section {
  padding-top: 40px;
}

/* Janky fix for preventing navbar from overlapping */
h1[id] {
  padding-top: 35px;
  margin-top: -45px;
}

/*
 * Callouts
 *
 * Not quite alerts, but custom and helpful notes for folks reading the docs.
 * Requires a base and modifier class.
 */

/* Common styles for all types */
.bs-callout {
  margin: 20px 0;
  padding: 20px;
  border-left: 3px solid #eee;
}
.bs-callout h4 {
  margin-top: 0;
  margin-bottom: 5px;
}
.bs-callout p:last-child {
  margin-bottom: 0;
}

/* Variations */
.bs-callout-danger {
  background-color: #fdf1ef;
  border-color: #dd4b39;
}
.bs-callout-danger h4 {
  color: #c23321;
}
.bs-callout-warning {
  background-color: #fefbed;
  border-color: #f1e7bc;
}
.bs-callout-warning h4 {
  color: #ba9e27;
}
.bs-callout-info {
  background-color: #f0f7fd;
  border-color: #d0e3f0;
}
.bs-callout-info h4 {
  color: #3b86b9;
}

/*
 * Team members
 *
 * Avatars, names, and usernames for core team.
 */

.bs-team .team-member {
  color: #555;
  line-height: 32px;
}
.bs-team .team-member:hover {
  color: #333;
  text-decoration: none;
}
.bs-team .github-btn {
  float: right;
  margin-top: 6px;
  width: 120px;
  height: 20px;
}
.bs-team img {
  float: left;
  width: 32px;
  margin-right: 10px;
  border-radius: 4px;
}

/*
 * Grid examples
 *
 * Highlight the grid columns within the docs so folks can see their padding,
 * alignment, sizing, etc.
 */

.show-grid {
  margin-bottom: 15px;
}
.show-grid [class^="col-"] {
  padding-top: 10px;
  padding-bottom: 10px;
  background-color: #f9f9f9;
  border: 1px solid #ddd;
}

/*
 * Examples
 *
 * Isolated sections of example content for each component or feature. Usually
 * followed by a code snippet.
 */

.bs-example {
  position: relative;
  padding: 45px 15px 15px;
  margin: 0 -15px 15px;
  background-color: #fafafa;
  box-shadow: inset 0 3px 6px rgba(0,0,0,.05);
  border-color: #e5e5e5 #eee #eee;
  border-style: solid;
  border-width: 1px 0;
}
/* Echo out a label for the example */
.bs-example:after {
  content: "Example";
  position: absolute;
  top:  15px;
  left: 15px;
  font-size: 12px;
  font-weight: bold;
  color: #bbb;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Tweak display of the code snippets when following an example */
.bs-example + .highlight {
  margin: -15px -15px 15px;
  border-radius: 0;
  border-width: 0 0 1px;
}

/* Make the examples and snippets not full-width */
@media (min-width: 768px) {
  .bs-example {
    margin-left: 0;
    margin-right: 0;
    background-color: #fff;
    border-width: 1px;
    border-color: #ddd;
    border-radius: 4px 4px 0 0;
    box-shadow: none;
  }
  .bs-example + .highlight {
    margin-top: -16px;
    margin-left: 0;
    margin-right: 0;
    border-width: 1px;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
  }
}

/* Undo width of container */
.bs-example .container {
  width: auto;
}

/* Tweak content of examples for optimum awesome */
.bs-example > p:last-child,
.bs-example > ul:last-child,
.bs-example > ol:last-child,
.bs-example > blockquote:last-child,
.bs-example > .form-control:last-child,
.bs-example > .table:last-child,
.bs-example > .navbar:last-child,
.bs-example > .jumbotron:last-child,
.bs-example > .alert:last-child,
.bs-example > .panel:last-child,
.bs-example > .list-group:last-child,
.bs-example > .well:last-child,
.bs-example > .progress:last-child,
.bs-example > .table-responsive:last-child > .table {
  margin-bottom: 0;
}
.bs-example > p > .close {
  float: none;
}

/* Typography */
.bs-example-type .table .info {
  color: #999;
  vertical-align: middle;
}
.bs-example-type .table td {
  padding: 15px 0;
  border-color: #eee;
}
.bs-example-type .table tr:first-child td {
  border-top: 0;
}
.bs-example-type h1,
.bs-example-type h2,
.bs-example-type h3,
.bs-example-type h4,
.bs-example-type h5,
.bs-example-type h6 {
  margin: 0;
}

/* Images */
.bs-example > .img-circle,
.bs-example > .img-rounded,
.bs-example > .img-thumbnail {
  margin: 5px;
}

/* Tables */
.bs-example > .table-responsive > .table {
  background-color: #fff;
}

/* Buttons */
.bs-example > .btn,
.bs-example > .btn-group {
  margin-top: 5px;
  margin-bottom: 5px;
}
.bs-example > .btn-toolbar + .btn-toolbar {
  margin-top: 10px;
}

/* Forms */
.bs-example-control-sizing select,
.bs-example-control-sizing input[type="text"] + input[type="text"],
.bs-example .select2-container.form-control {
  margin-top: 10px;
}
.bs-example-form .input-group {
  margin-bottom: 10px;
}
.bs-example > textarea.form-control {
  resize: vertical;
}

/* List groups */
.bs-example > .list-group {
  max-width: 400px;
}

/* Navbars */
.bs-example .navbar:last-child {
  margin-bottom: 0;
}
.bs-navbar-top-example,
.bs-navbar-bottom-example {
  z-index: 1;
  padding: 0;
  overflow: hidden; /* cut the drop shadows off */
}
.bs-navbar-top-example .navbar-header,
.bs-navbar-bottom-example .navbar-header {
  margin-left: 0;
}
.bs-navbar-top-example .navbar-fixed-top,
.bs-navbar-bottom-example .navbar-fixed-bottom {
  position: relative;
  margin-left: 0;
  margin-right: 0;
}
.bs-navbar-top-example {
  padding-bottom: 90px;
}
.bs-navbar-top-example:after {
  top: auto;
  bottom: 15px;
}
.bs-navbar-top-example .navbar-fixed-top {
  top: -1px;
}
.bs-navbar-bottom-example {
  padding-top: 90px;
}
.bs-navbar-bottom-example .navbar-fixed-bottom {
  bottom: -1px;
}
.bs-navbar-bottom-example .navbar {
  margin-bottom: 0;
}
@media (min-width: 768px) {
  .bs-navbar-top-example .navbar-fixed-top,
  .bs-navbar-bottom-example .navbar-fixed-bottom {
    position: absolute;
  }
  .bs-navbar-top-example {
    border-radius: 0 0 4px 4px;
  }
  .bs-navbar-bottom-example {
    border-radius: 4px 4px 0 0;
  }
}

/* Pagination */
.bs-example .pagination {
  margin-top: 10px;
  margin-bottom: 10px;
}

/* Pager */
.bs-example > .pager {
  margin-top: 0;
}

/* Example modals */
.bs-example-modal {
  background-color: #f5f5f5;
}
.bs-example-modal .modal {
  position: relative;
  top: auto;
  right: auto;
  left: auto;
  bottom: auto;
  z-index: 1;
  display: block;
}
.bs-example-modal .modal-dialog {
  left: auto;
  margin-left: auto;
  margin-right: auto;
}

/* Example dropdowns */
.bs-example > .dropdown > .dropdown-menu,
.bs-example-submenu .dropdown > .dropdown-menu,
.bs-example-submenu .dropup > .dropdown-menu {
  position: static;
  display: block;
  margin-bottom: 5px;
}
.bs-example-submenu .dropdown-menu {
  margin-right: 20px;
}

/* Example tabbable tabs */
.bs-example-tabs .nav-tabs {
  margin-bottom: 15px;
}

/* Tooltips */
.bs-example-tooltips {
  text-align: center;
}
.bs-example-tooltips > .btn {
  margin-top: 5px;
  margin-bottom: 5px;
}

/* Popovers */
.bs-example-popover {
  padding-bottom: 24px;
  background-color: #f9f9f9;
}
.bs-example-popover .popover {
  position: relative;
  display: block;
  float: left;
  width: 260px;
  margin: 20px;
}

/* Scrollspy demo on fixed height div */
.scrollspy-example {
  position: relative;
  height: 200px;
  margin-top: 10px;
  overflow: auto;
}

/*
 * Code snippets
 *
 * Generated via Pygments and Jekyll, these are snippets of HTML, CSS, and JS.
 */

.highlight {
  display: none; /* hidden by default, until >480px */
  padding: 9px 14px;
  margin-bottom: 14px;
  background-color: #f7f7f9;
  border: 1px solid #e1e1e8;
  border-radius: 4px;
}
.highlight pre {
  padding: 0;
  margin-top: 0;
  margin-bottom: 0;
  background-color: transparent;
  border: 0;
  white-space: nowrap;
}
.highlight pre code {
  font-size: inherit;
  color: #333; /* Effectively the base text color */
}
.highlight pre .lineno {
  display: inline-block;
  width: 22px;
  padding-right: 5px;
  margin-right: 10px;
  text-align: right;
  color: #bebec5;
}

/* Show code snippets when we have the space */
@media (min-width: 481px) {
  .highlight {
    display: block;
  }
}

/*
 * Responsive tests
 *
 * Generate a set of tests to show the responsive utilities in action.
 */

/* Responsive (scrollable) doc tables */
.table-responsive .highlight pre {
  white-space: normal;
}

/* Utility classes table  */
.bs-table th small,
.responsive-utilities th small {
  display: block;
  font-weight: normal;
  color: #999;
}
.responsive-utilities tbody th {
  font-weight: normal;
}
.responsive-utilities td {
  text-align: center;
}
.responsive-utilities td.is-visible {
  color: #468847;
  background-color: #dff0d8 !important;
}
.responsive-utilities td.is-hidden {
  color: #ccc;
  background-color: #f9f9f9 !important;
}

/* Responsive tests */
.responsive-utilities-test {
  margin-top: 5px;
}
.responsive-utilities-test .col-xs-6 {
  margin-bottom: 10px;
}
.responsive-utilities-test span {
  padding: 15px 10px;
  font-size: 14px;
  font-weight: bold;
  line-height: 1.1;
  text-align: center;
  border-radius: 4px;
}
.visible-on .col-xs-6 .hidden-xs,
.visible-on .col-xs-6 .hidden-sm,
.visible-on .col-xs-6 .hidden-md,
.visible-on .col-xs-6 .hidden-lg,
.hidden-on .col-xs-6 .hidden-xs,
.hidden-on .col-xs-6 .hidden-sm,
.hidden-on .col-xs-6 .hidden-md,
.hidden-on .col-xs-6 .hidden-lg {
  color: #999;
  border: 1px solid #ddd;
}
.visible-on .col-xs-6 .visible-xs,
.visible-on .col-xs-6 .visible-sm,
.visible-on .col-xs-6 .visible-md,
.visible-on .col-xs-6 .visible-lg,
.hidden-on .col-xs-6 .visible-xs,
.hidden-on .col-xs-6 .visible-sm,
.hidden-on .col-xs-6 .visible-md,
.hidden-on .col-xs-6 .visible-lg {
  color: #468847;
  background-color: #dff0d8;
  border: 1px solid #d6e9c6;
}

/*
 * Glyphicons
 *
 * Special styles for displaying the icons and their classes in the docs.
 */

.bs-glyphicons {
  padding-left: 0;
  padding-bottom: 1px;
  margin-bottom: 20px;
  list-style: none;
  overflow: hidden;
}
.bs-glyphicons li {
  float: left;
  width: 25%;
  height: 115px;
  padding: 10px;
  margin: 0 -1px -1px 0;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
  border: 1px solid #ddd;
}
.bs-glyphicons .glyphicon {
  margin-top: 5px;
  margin-bottom: 10px;
  font-size: 24px;
}
.bs-glyphicons .glyphicon-class {
  display: block;
  text-align: center;
}
.bs-glyphicons li:hover {
  background-color: rgba(238, 238, 238, 1);
}

@media (min-width: 768px) {
  .bs-glyphicons li {
    width: 12.5%;
  }
}

/*
 * Customizer
 *
 * Since this is so form control heavy, we have quite a few styles to customize
 * the display of inputs, headings, and more. Also included are all the download
 * buttons and actions.
 */

.bs-customizer .toggle {
  float: right;
  margin-top: 85px; /* On account of ghetto navbar fix */
}

/* Headings and form contrls */
.bs-customizer label {
  margin-top: 10px;
  font-weight: 500;
  color: #555;
}
.bs-customizer h2 {
  margin-top: 0;
  margin-bottom: 5px;
  padding-top: 30px;
}
.bs-customizer h3 {
  margin-bottom: 0;
}
.bs-customizer h4 {
  margin-top: 15px;
  margin-bottom: 0;
}
.bs-customizer .bs-callout h4 {
  margin-top: 0; /* lame, but due to specificity we have to duplicate */
  margin-bottom: 5px;
}
.bs-customizer input[type="text"] {
  font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
  background-color: #fafafa;
}
.bs-customizer .help-block {
  font-size: 12px;
  margin-bottom: 5px;
}

/* For the variables, use regular weight */
#less-section label {
  font-weight: normal;
}

/* Downloads */
.bs-customize-download .btn-outline {
  padding: 20px;
}

/* Error handling */
.bs-customizer-alert {
  position: fixed;
  top: 51px;
  left: 0;
  right: 0;
  z-index: 1030;
  padding: 15px 0;
  color: #fff;
  background-color: #d9534f;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25);
  border-bottom: 1px solid #b94441;
}
.bs-customizer-alert .close {
  margin-top: -4px;
  font-size: 24px;
}
.bs-customizer-alert p {
  margin-bottom: 0;
}
.bs-customizer-alert .glyphicon {
  margin-right: 5px;
}
.bs-customizer-alert pre {
  margin: 10px 0 0;
  color: #fff;
  background-color: #a83c3a;
  border-color: #973634;
  box-shadow: inset 0 2px 4px rgba(0,0,0,.05), 0 1px 0 rgba(255,255,255,.1);
}

/*
 * Miscellaneous
 *
 * Odds and ends for optimum docs display.
 */

 /* About page */
 .bs-about {
  font-size: 16px;
 }

/* Examples gallery: space out content better */
.bs-examples h4 {
  margin-bottom: 5px;
}
.bs-examples p {
  margin-bottom: 20px;
}

/* Pseudo :focus state for showing how it looks in the docs */
#focusedInput {
  border: 1px solid #4d90fe !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) inset !important;
  outline: 0;
  outline: thin dotted \9; /* IE6-9 */
  -moz-box-shadow: none;
       box-shadow: none;
}

/* Better spacing on download options in getting started */
.bs-docs-dl-options h4 {
  margin-top: 15px;
  margin-bottom: 5px;
}


text:
using System.Diagnostics;
using EnvDTE;
using EnvDTE80;

namespace PowerShellTools.Commands
{
    /// <summary>
    /// Command for executing a script from the solution explorer context menu.
    /// </summary>
    internal class ExecuteFromSolutionExplorerContextMenuCommand : ExecuteAsScriptCommand
    {
        internal ExecuteFromSolutionExplorerContextMenuCommand(IDependencyValidator validator)
            : base(validator)
        {
        }

        protected override int Id
        {
            get { return (int)GuidList.CmdidExecuteAsScriptSolution; }
        }

        protected override string GetTargetFile(DTE2 dte)
        {
            var selectedItem = GetSelectedItem(dte);

            if (selectedItem != null && selectedItem.ProjectItem != null)
                return GetPathOfProjectItem(selectedItem.ProjectItem);

            return null;
        }

        protected override bool ShouldShowCommand(DTE2 dte)
        {
            var selectedItem = GetSelectedItem(dte);
            return selectedItem != null &&
                   selectedItem.ProjectItem != null &&
                   LanguageUtilities.IsPowerShellFile(selectedItem.ProjectItem.Name);
        }

        protected static SelectedItem GetSelectedItem(DTE2 applicationObject)
        {
            if (applicationObject.Solution == null)
                return null;
            if (applicationObject.SelectedItems.Count == 1)
                return applicationObject.SelectedItems.Item(1);
            return null;
        }

        /// <summary>
        /// Returns the path of the project item.  Can return null if path is not found/applicable.
        /// </summary>
        /// <param name="projItem">The project Item</param>
        /// <returns>A string representing the path of the project item.  returns null if path is not found.</returns>
        private static string GetPathOfProjectItem(ProjectItem projItem)
        {
            Debug.Assert(projItem != null, "projItem shouldn't be null");

            Properties projProperties = projItem.Properties;

            try
            {
                string path = projProperties.Item("FullPath").Value as string;    //Item throws if not found.

                Debug.Assert(path != null, "Path isn't a string");

                return path;
            }
            catch
            {
                return null;
            }
        }
    }
}


text:
title: Adv. Funct. Mater. 22, 16, (2012). - COVER ARTICLE
subtitle: Website Design
layout: default
modal-id: http://docs.lib.purdue.edu/cgi/viewcontent.cgi?article=2150&context=nanopub
date: 2014-07-16
img: golden.png
thumbnail: golden-thumbnail.png
alt: image-alt
project-date:
client: Start Bootstrap
category: Web Development
description: Lorem ipsum dolor sit amet, usu cu alterum nominavi lobortis. At duo novum diceret. Tantas apeirian vix et, usu sanctus postulant inciderint ut, populo diceret necessitatibus in vim. Cu eum dicam feugiat noluisse.

---


text:
import string

import langid

# Determined by examining review corpus and confidence levels produced by
# langid, 18 May 2015. See bug 875455 for details.
COMMON_REVIEW_WORDS = {
    'bom': 'pt',
    'buena': 'es',
    'bueno': 'es',
    'cool': 'en',
    'esta': 'es',
    'excelente': 'es',
    'good': 'en',
    'great': 'en',
    'gusta': 'es',
    'muito': 'pt',
    'muy': 'es',
    'nice': 'en',
    'ok': 'en',
    'super': 'en',
    'the': 'en',
    'very': 'en'
}

def guess_language(text):
    guessed_lang, confidence = langid.classify(text)
    if confidence < 0.9:
        depunct = dict.fromkeys([ord(c) for c in string.punctuation], u' ')
        words = text.lower().translate(depunct).split()
        assumed_lang = None
        for w in words:
            assumed_lang = COMMON_REVIEW_WORDS.get(w)
            if assumed_lang:
                break
        if assumed_lang is None and len(words) <= 3:
            # Too little text to reliably guess.
            return None
        return assumed_lang or guessed_lang
    return guessed_lang


text:
"""
Model to generate new songs

"""

import numpy as np  # To generate random numbers
import tensorflow as tf

from deepmusic.musicdata import Batch
import deepmusic.songstruct as music

class Model:
    """
    Base class which manage the different models and experimentation.
    """

    class TargetWeightsPolicy:
        """ Structure to represent the different policy for choosing the target weights
        This is used to scale the contribution of each timestep to the global loss
        """
        NONE = 'none'  # All weights equals (=1.0) (default behavior)
        LINEAR = 'linear'  # The first outputs are less penalized than the last ones
        STEP = 'step'  # We start penalizing only after x steps (enco/deco behavior)

        def __init__(self, args):
            """
            Args:
                args: parameters of the model
            """
            self.args = args

        def get_weight(self, i):
            """ Return the target weight for the given step i using the chosen policy
            """
            if not self.args.target_weights or self.args.target_weights == Model.TargetWeightsPolicy.NONE:
                return 1.0
            elif self.args.target_weights == Model.TargetWeightsPolicy.LINEAR:
                return i / (self.args.sample_length - 1)  # Gradually increment the loss weight
            elif self.args.target_weights == Model.TargetWeightsPolicy.STEP:
                raise NotImplementedError('Step target weight policy not implemented yet, please consider another policy')
            else:
                raise ValueError('Unknown chosen target weight policy: {}'.format(self.args.target_weights))

        @staticmethod
        def get_policies():
            """ Return the list of the different modes
            Useful when parsing the command lines arguments
            """
            return [
                Model.TargetWeightsPolicy.NONE,
                Model.TargetWeightsPolicy.LINEAR,
                Model.TargetWeightsPolicy.STEP
            ]

    class ScheduledSamplingPolicy:
        """ Container for the schedule sampling policy
        See http://arxiv.org/abs/1506.03099 for more details
        """
        NONE = 'none'  # No scheduled sampling (always take the given input)
        ALWAYS = 'always'  # Always samples from the predicted output
        LINEAR = 'linear'  # Gradually increase the sampling rate

        def __init__(self, args):
            self.sampling_policy_fct = None

            assert args.scheduled_sampling
            assert len(args.scheduled_sampling) > 0

            policy = args.scheduled_sampling[0]
            if policy == Model.ScheduledSamplingPolicy.NONE:
                self.sampling_policy_fct = lambda step: 1.0
            elif policy == Model.ScheduledSamplingPolicy.ALWAYS:
                self.sampling_policy_fct = lambda step: 0.0
            elif policy == Model.ScheduledSamplingPolicy.LINEAR:
                if len(args.scheduled_sampling) != 5:
                    raise ValueError('Not the right arguments for the sampling linear policy ({} instead of 4)'.format(len(args.scheduled_sampling)-1))

                start_step = int(args.scheduled_sampling[1])
                end_step = int(args.scheduled_sampling[2])
                start_value = float(args.scheduled_sampling[3])
                end_value = float(args.scheduled_sampling[4])

                if (start_step >= end_step or
                   not (0.0 <= start_value <= 1.0) or
                   not (0.0 <= end_value <= 1.0)):
                    raise ValueError('Some schedule sampling parameters incorrect.')

                # TODO: Add default values (as optional arguments)

                def linear_policy(step):
                    if step < start_step:
                        threshold = start_value
                    elif start_step <= step < end_step:
                        slope = (start_value-end_value)/(start_step-end_step)  # < 0 (because end_step>start_step and start_value>end_value)
                        threshold = slope*(step-start_step) + start_value
                    elif end_step <= step:
                        threshold = end_value
                    else:
                        raise RuntimeError('Invalid value for the sampling policy')  # Parameters have not been correctly defined!
                    assert 0.0 <= threshold <= 1.0
                    return threshold

                self.sampling_policy_fct = linear_policy
            else:
                raise ValueError('Unknown chosen schedule sampling policy: {}'.format(policy))

        def get_prev_threshold(self, glob_step, i=0):
            """ Return the previous sampling probability for the current step.
            If above, the RNN should use the previous step instead of the given input.
            Args:
                glob_step (int): the global iteration step for the training
                i (int): the timestep of the RNN (TODO: implement incrementive slope (progression like -\|), remove the '=0')
            """
            return self.sampling_policy_fct(glob_step)

    class LearningRatePolicy:
        """ Contains the different policies for the learning rate decay
        """
        CST = 'cst'  # Fixed learning rate over all steps (default behavior)
        STEP = 'step'  # We divide the learning rate every x iterations
        EXPONENTIAL = 'exponential'  #

        @staticmethod
        def get_policies():
            """ Return the list of the different modes
            Useful when parsing the command lines arguments
            """
            return [
                Model.LearningRatePolicy.CST,
                Model.LearningRatePolicy.STEP,
                Model.LearningRatePolicy.EXPONENTIAL
            ]

        def __init__(self, args):
            """
            Args:
                args: parameters of the model
            """
            self.learning_rate_fct = None

            assert args.learning_rate
            assert len(args.learning_rate) > 0

            policy = args.learning_rate[0]

            if policy == Model.LearningRatePolicy.CST:
                if not len(args.learning_rate) == 2:
                    raise ValueError('Learning rate cst policy should be on the form: {} lr_value'.format(Model.LearningRatePolicy.CST))
                self.learning_rate_init = float(args.learning_rate[1])
                self.learning_rate_fct = self._lr_cst

            elif policy == Model.LearningRatePolicy.STEP:
                if not len(args.learning_rate) == 3:
                    raise ValueError('Learning rate step policy should be on the form: {} lr_init decay_period'.format(Model.LearningRatePolicy.STEP))
                self.learning_rate_init = float(args.learning_rate[1])
                self.decay_period = int(args.learning_rate[2])
                self.learning_rate_fct = self._lr_step

            elif policy == Model.LearningRatePolicy.EXPONENTIAL:
                raise NotImplementedError('Exponential learning rate policy not implemented yet, please consider another policy')

            else:
                raise ValueError('Unknown chosen learning rate policy: {}'.format(policy))

        def _lr_cst(self, glob_step):
            """ Just a constant learning rate
            """
            return self.learning_rate_init

        def _lr_step(self, glob_step):
            """ Every decay period, the learning rate is divided by 2
            """
            return self.learning_rate_init / 2**(glob_step//self.decay_period)

        def get_learning_rate(self, glob_step):
            """ Return the learning rate associated at the current training step
            Args:
                glob_step (int): Number of iterations since the beginning of training
            Return:
                float: the learning rate at the given step
            """
            return self.learning_rate_fct(glob_step)

    def __init__(self, args):
        """
        Args:
            args: parameters of the model
        """
        print('Model creation...')

        self.args = args  # Keep track of the parameters of the model

        # Placeholders
        self.inputs = None
        self.targets = None
        self.use_prev = None  # Boolean tensor which say at Graph evaluation time if we use the input placeholder or the previous output.
        self.current_learning_rate = None  # Allow to have a dynamic learning rate

        # Main operators
        self.opt_op = None  # Optimizer
        self.outputs = None  # Outputs of the network
        self.final_state = None  # When testing, we feed this value as initial state ?

        # Other options
        self.target_weights_policy = None
        self.schedule_policy = None
        self.learning_rate_policy = None

        # Construct the graphs
        self._build_network()

    def _build_network(self):
        """ Create the computational graph
        """

        # Placeholders (Use tf.SparseTensor with training=False instead) (TODO: Try restoring dynamic batch_size)
        with tf.name_scope('placeholder_inputs'):
            self.inputs = [
                tf.placeholder(
                    tf.float32,  # -1.0/1.0 ? Probably better for the sigmoid
                    [self.args.batch_size, music.NB_NOTES],
                    name='input')
                for _ in range(self.args.sample_length)
                ]
        with tf.name_scope('placeholder_targets'):
            self.targets = [
                tf.placeholder(
                    tf.float32,  # 0/1
                    [self.args.batch_size, music.NB_NOTES],
                    name='target')
                for _ in range(self.args.sample_length)
                ]
        with tf.name_scope('placeholder_use_prev'):
            self.use_prev = [
                tf.placeholder(
                    tf.bool,
                    [],
                    name='use_prev')
                for _ in range(self.args.sample_length)  # The first value will never be used (always takes self.input for the first step)
                ]

        # Projection on the keyboard
        with tf.name_scope('note_projection_weights'):
            W = tf.Variable(
                tf.truncated_normal([self.args.hidden_size, music.NB_NOTES]),
                name='weights'
            )
            b = tf.Variable(
                tf.truncated_normal([music.NB_NOTES]),  # Tune the initializer ?
                name='bias',
            )

        def project_note(X):
            with tf.name_scope('note_projection'):
                return tf.matmul(X, W) + b  # [batch_size, NB_NOTE]

        # RNN network
        rnn_cell = tf.nn.rnn_cell.BasicLSTMCell(self.args.hidden_size, state_is_tuple=True)  # Or GRUCell, LSTMCell(args.hidden_size)
        #rnn_cell = tf.nn.rnn_cell.DropoutWrapper(rnn_cell, input_keep_prob=1.0, output_keep_prob=1.0)  # TODO: Custom values (WARNING: No dropout when testing !!!, possible to use placeholder ?)
        rnn_cell = tf.nn.rnn_cell.MultiRNNCell([rnn_cell] * self.args.num_layers, state_is_tuple=True)

        initial_state = rnn_cell.zero_state(batch_size=self.args.batch_size, dtype=tf.float32)

        def loop_rnn(prev, i):
            """ Loop function used to connect one output of the rnn to the next input.
            Will re-adapt the output shape to the input one.
            This is useful to use the same network for both training and testing. Warning: Because of the fixed
            batch size, we have to predict batch_size sequences when testing.
            """
            # Predict the output from prev and scale the result on [-1, 1]
            next_input = project_note(prev)
            next_input = tf.sub(tf.mul(2.0, tf.nn.sigmoid(next_input)), 1.0)  # x_{i} = 2*sigmoid(y_{i-1}) - 1

            # On training, we force the correct input, on testing, we use the previous output as next input
            return tf.cond(self.use_prev[i], lambda: next_input, lambda: self.inputs[i])

        (outputs, self.final_state) = tf.nn.seq2seq.rnn_decoder(
            decoder_inputs=self.inputs,
            initial_state=initial_state,
            cell=rnn_cell,
            loop_function=loop_rnn
        )

        # Final projection
        with tf.name_scope('final_output'):
            self.outputs = []
            for output in outputs:
                proj = project_note(output)
                self.outputs.append(proj)

        # For training only
        if not self.args.test:
            # Finally, we define the loss function

            # The network will predict a mix a wrong and right notes. For the loss function, we would like to
            # penalize note which are wrong. Eventually, the penalty should be less if the network predict the same
            # note but not in the right pitch (ex: C4 instead of C5), with a decay the further the prediction
            # is (D5 and D1 more penalized than D4 and D3 if the target is D2)

            # For now, by using sigmoid_cross_entropy_with_logits, the task is formulated as a NB_NOTES binary
            # classification problems

            self.schedule_policy = Model.ScheduledSamplingPolicy(self.args)
            self.target_weights_policy = Model.TargetWeightsPolicy(self.args)
            self.learning_rate_policy = Model.LearningRatePolicy(self.args)  # Load the chosen policies

            # TODO: If train on different length, check that the loss is proportional to the length or average ???
            loss_fct = tf.nn.seq2seq.sequence_loss(
                self.outputs,
                self.targets,
                [tf.constant(self.target_weights_policy.get_weight(i), shape=self.targets[0].get_shape()) for i in range(len(self.targets))],  # Weights
                softmax_loss_function=tf.nn.sigmoid_cross_entropy_with_logits,
                average_across_timesteps=False,  # I think it's best for variables length sequences (specially with the target weights=0), isn't it (it implies also that short sequences are less penalized than long ones) ? (TODO: For variables length sequences, be careful about the target weights)
                average_across_batch=False  # Penalize by sample (should allows dynamic batch size) Warning: need to tune the learning rate
            )
            tf.scalar_summary('training_loss', loss_fct)  # Keep track of the cost

            self.current_learning_rate = tf.placeholder(tf.float32, [])

            # Initialize the optimizer
            opt = tf.train.AdamOptimizer(
                learning_rate=self.current_learning_rate,
                beta1=0.9,
                beta2=0.999,
                epsilon=1e-08
            )

            # TODO: Also keep track of magnitudes (how much is updated)
            self.opt_op = opt.minimize(loss_fct)

    def step(self, batch, train_set=True, glob_step=-1, ret_output=False):
        """ Forward/training step operation.
        Does not perform run on itself but just return the operators to do so. Those have then to be run by the
        main program.
        If the output operator is returned, it will always be the last one on the list
        Args:
            batch (Batch): Input data on testing mode, input and target on output mode
            train_set (Bool): indicate if the batch come from the test/train set
            glob_step (int): indicate the global step for the schedule sampling
            ret_output (Bool): for the training mode, if true,
        Return:
            Tuple[ops], dict: The list of the operators to run (training_step or outputs) with the associated feed dictionary
        """
        # TODO: Could optimize feeding between train/test/generating (compress code)

        # Feed the dictionary
        feed_dict = {}
        ops = ()  # For small length, it seems (from my investigations) that tuples are faster than list for merging

        # Feed placeholders and choose the ops
        if not self.args.test:  # Training
            if train_set:
                assert glob_step >= 0
                feed_dict[self.current_learning_rate] = self.learning_rate_policy.get_learning_rate(glob_step)

            for i in range(self.args.sample_length):
                feed_dict[self.inputs[i]] = batch.inputs[i]
                feed_dict[self.targets[i]] = batch.targets[i]
                #if not train_set or np.random.rand() > self.schedule_policy.get_prev_threshold(glob_step)*self.target_weights_policy.get_weight(i):  # Regular Schedule sample (TODO: Try sampling with the weigths or a mix of weights/sampling)
                if np.random.rand() > self.schedule_policy.get_prev_threshold(glob_step):  # Weight the threshold by the target weights (don't schedule sample if weight=0)
                    feed_dict[self.use_prev[i]] = True
                else:
                    feed_dict[self.use_prev[i]] = False

            if train_set:
                ops += (self.opt_op,)
            if ret_output:
                ops += (self.outputs,)
        else:  # Generating (batch_size == 1)
            # TODO: What to put for initialisation state (empty ? random ?) ?
            # TODO: Modify use_prev
            for i in range(self.args.sample_length):
                if i < len(batch.inputs):
                    feed_dict[self.inputs[i]] = batch.inputs[i]
                    feed_dict[self.use_prev[i]] = False
                else:  # Even not used, we still need to feed a placeholder
                    feed_dict[self.inputs[i]] = batch.inputs[0]  # Could be anything but we need it to be from the right shape
                    feed_dict[self.use_prev[i]] = True  # When we don't have an input, we use the previous output instead

            ops += (self.outputs,)

        # Return one pass operator
        return ops, feed_dict


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

<title>BinaryService.Resolver (trellis-spi 0.1.0 API)</title>
<meta name="date" content="2017-09-14">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

org.trellisldp.spi

Interface BinaryService.Resolver

Enclosing interface:

BinaryService

public static interface BinaryService.Resolver

A blob resolver, used by the BinaryService

Method Summary

All Methods Instance Methods Abstract Methods Default Methods

Modifier and Type
Method and Description

void
abortUpload(String identifier)

Abort the upload for the given identifier

BinaryService.MultipartUpload
completeUpload(String identifier,
              Map<Integer,String> partDigests)

Complete a multi-part upload

Boolean
exists(String partition,
      IRI identifier)

Check whether the binary object exists

Optional<InputStream>
getContent(String partition,
          IRI identifier)

Get the content of the binary object

List<String>
getUriSchemes()

String
initiateUpload(String partition,
              IRI identifier,
              String mimeType)

Initiate a multi-part upload

Stream<Map.Entry<Integer,String>>
listParts(String identifier)

List the uploaded parts

void
purgeContent(String partition,
            IRI identifier)

Remove the content from the datastore

default void
setContent(String partition,
          IRI identifier,
          InputStream stream)

Set the content of the binary object

void
setContent(String partition,
          IRI identifier,
          InputStream stream,
          Map<String,String> metadata)

Set the content of the binary object

Boolean
supportsMultipartUpload()

Test whether the resolver supports multipart uploads

String
uploadPart(String identifier,
          Integer partNumber,
          InputStream content)

Upload a part

Boolean
uploadSessionExists(String identifier)

Test whether the provided identifier exists

Method Detail

getUriSchemes

List<String> getUriSchemes()

Returns:

the uri schemes supported by this resolver

getContent

Optional<InputStream> getContent(String partition,
                                 IRI identifier)

Get the content of the binary object

Parameters:

partition - the partition to use

identifier - the identifier

Returns:

the content of the binary object

exists

Boolean exists(String partition,
               IRI identifier)

Check whether the binary object exists

Parameters:

partition - the partition to use

identifier - the identifier

Returns:

whether the binary object exists

setContent

default void setContent(String partition,
                        IRI identifier,
                        InputStream stream)

Set the content of the binary object

Parameters:

partition - the partition to use

identifier - the identifier

stream - the stream

setContent

void setContent(String partition,
                IRI identifier,
                InputStream stream,
                Map<String,String> metadata)

Set the content of the binary object

Parameters:

partition - the partition to use

identifier - the identifier

stream - the content

metadata - any user metadata

purgeContent

void purgeContent(String partition,
                  IRI identifier)

Remove the content from the datastore

Parameters:

partition - the partition to use

identifier - the identifier

supportsMultipartUpload

Boolean supportsMultipartUpload()

Test whether the resolver supports multipart uploads

Returns:

true if the resolver supports multipart uploads; false otherwise

initiateUpload

String initiateUpload(String partition,
                      IRI identifier,
                      String mimeType)

Initiate a multi-part upload

Parameters:

partition - the partition

identifier - the object identifier

mimeType - the mimeType of the object

Returns:

an upload session identifier

uploadPart

String uploadPart(String identifier,
                  Integer partNumber,
                  InputStream content)

Upload a part

Parameters:

identifier - the upload identifier

partNumber - the part number

content - the content to upload

Returns:

a digest value returned for each part; this value is used later wich completeUpload()

completeUpload

BinaryService.MultipartUpload completeUpload(String identifier,
                                             Map<Integer,String> partDigests)

Complete a multi-part upload

Parameters:

identifier - the upload identifier

partDigests - digest values for each part

Returns:

a multipart upload object

abortUpload

void abortUpload(String identifier)

Abort the upload for the given identifier

Parameters:

identifier - the upload identifier

uploadSessionExists

Boolean uploadSessionExists(String identifier)

Test whether the provided identifier exists

Parameters:

identifier - the upload identifier

Returns:

true if the session exists; false otherwise

listParts

Stream<Map.Entry<Integer,String>> listParts(String identifier)

List the uploaded parts

Parameters:

identifier - the upload identifier

Returns:

a list of uploaded parts and their digests

Skip navigation links

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text: .. cmake-module:: ../../Modules/FindGit.cmake


text:
package org.mikala.testqwondo.api.model;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.Size;

import org.hibernate.validator.constraints.NotBlank;
import org.mikala.testqwondo.api.model.enums.PlanStatus;
import org.mikala.testqwondo.api.model.enums.PlanType;

@Entity
@Table(name = "plans")
public class Plan extends BaseEntity implements Serializable {
  @Transient
  private static final long serialVersionUID = 1L;

  @Basic
  @Column(length = 100, nullable = false, unique = true)
  @NotBlank
  private String name;
  @Basic
  @Column(length = 100, nullable = true)
  @Size(max = 100)
  private String system;
  @Basic
  @Column(length = 100, nullable = true, name = "system_version")
  @Size(max = 100)
  private String systemVersion;
  @Basic
  @Column(length = 2, nullable = false)
  @Enumerated(EnumType.STRING)
  private PlanType type;
  @Basic
  @Column(length = 2, nullable = false)
  @Enumerated(EnumType.STRING)
  private PlanStatus status;
  @Basic
  @Column(name = "planed_start", nullable = true)
  private Date planedStart;
  @Basic
  @Column(name = "planed_end", nullable = true)
  private Date planedEnd;
  @OneToMany(mappedBy = "plan", targetEntity = Task.class)
  private Set<Task> tasks;
  @OneToMany(mappedBy = "plan", targetEntity = TaskGroup.class)
  private Set<TaskGroup> taskGroups;

  public Plan() {}

  public Plan(final String planName, final PlanType planType, final PlanStatus planStatus,
      final User planCreatedBy) {
    super();
    this.name = planName;
    this.type = planType;
    this.status = planStatus;
    setCreatedBy(planCreatedBy);
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public Date getPlanedEnd() {
    return planedEnd;
  }

  public void setPlanedEnd(Date planedEnd) {
    this.planedEnd = planedEnd;
  }

  public Date getPlanedStart() {
    return planedStart;
  }

  public void setPlanedStart(Date planedStart) {
    this.planedStart = planedStart;
  }

  public PlanStatus getStatus() {
    return status;
  }

  public void setStatus(PlanStatus status) {
    this.status = status;
  }

  public String getSystem() {
    return system;
  }

  public void setSystem(String system) {
    this.system = system;
  }

  public String getSystemVersion() {
    return systemVersion;
  }

  public void setSystemVersion(String systemVersion) {
    this.systemVersion = systemVersion;
  }

  public PlanType getType() {
    return type;
  }

  public void setType(PlanType type) {
    this.type = type;
  }

  public static long getSerialversionuid() {
    return serialVersionUID;
  }

  public Set<Task> getTasks() {
    return this.tasks;
  }

  public void setTasks(Set<Task> tasks) {
    this.tasks = tasks;
  }

  public Task addTask(Task task) {
    getTasks().add(task);
    task.setPlan(this);

    return task;
  }

  public Task removeTask(Task task) {
    getTasks().remove(task);
    task.setPlan(null);

    return task;
  }

  public Set<TaskGroup> getTaskGroups() {
    return this.taskGroups;
  }

  public void setTaskGroups(Set<TaskGroup> taskgroups) {
    this.taskGroups = taskgroups;
  }

  public TaskGroup addTaskgroup(TaskGroup taskgroup) {
    getTaskGroups().add(taskgroup);
    taskgroup.setPlan(this);

    return taskgroup;
  }

  public TaskGroup removeTaskgroup(TaskGroup taskgroup) {
    getTaskGroups().remove(taskgroup);
    taskgroup.setPlan(null);

    return taskgroup;
  }

}


text:
package de.tototec.cmdoption;

import java.util.Locale;

public abstract class I18n {

	public static String marktr(final String string) {
		// Placeholder to allow mark of translatable strings.
		return string;
	}

	public static String marktrc(String context, String msgid) {
		// Placeholder to allow mark of translatable strings.
		return msgid;
	}

	public abstract String tr(final String msg, final Object... params);

	public abstract String trn(String msgid, String msgidPlural, long n, Object... params);

	public abstract String trc(String context, String msgid, Object... params);

	public abstract String trcn(String context, String msgid, String msgidPlural, long n, Object... params);

	public abstract Locale getLocale();

}


text:
from twisted.spread import pb
from twisted.internet import reactor
from twisted.python import util

factory = pb.PBClientFactory()
reactor.connectTCP("localhost", 8789, factory)
d = factory.getRootObject()
a = []
d.addCallback(lambda object: object.callRemote("nextQuote"))
d.addCallback(lambda echo: a.append(echo))
d.addErrback(lambda reason: 'error: '+str(reason.value))
d.addCallback(util.println)
reactor.run()


text:
require 'test_helper'

module ActiveBlog
  class RoutingTest < ActionController::TestCase
    # Tests the following routes:
    #
    #         active_blog          /blog(.:format)
    # active_blog_preview POST|PUT /blog/-/preview(.:format)    {:controller=>"active_blog/blog_posts", :action=>"preview"}
    #    active_blog_feed GET      /blog/-/feed(.:format)       {:controller=>"active_blog/blog_posts", :action=>"feed"}
    #    active_blog_post          /blog/:cached_slug(.:format) {:controller=>"active_blog/blog_posts", :action=>"show"}

    test "should route /blog" do
      assert_routing '/blog', {:controller=>"active_blog/blog_posts", :action=>"index"}
    end
    test "should route /blog/-/preview" do
      assert_routing({:path => '/blog/-/preview', :method => :post}, {:controller=>"active_blog/blog_posts", :action=>"preview"})
    end
    test "should route /blog/atom.xml" do
      assert_routing '/blog/atom.xml', {:controller=>"active_blog/blog_posts", :action=>"atom",:format=>:xml}
    end
    test "should route /blog/:cached_slug" do
      assert_routing '/blog/my-blog-post-title', {:controller=>"active_blog/blog_posts", :action=>"show", :cached_slug=>"my-blog-post-title"}
    end
  end
end


text:
/**
 * Created on 2008-5-29 01:01:43
 */
package cn.net.openid.jos.web.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.lang.StringUtils;
import org.springframework.validation.BindException;
import org.springframework.web.servlet.ModelAndView;

import cn.net.openid.jos.service.exception.
EmailConfirmationInfoNotFoundException;
import cn.net.openid.jos.web.AbstractJosSimpleFormController;
import cn.net.openid.jos.web.form.ConfirmEmailForm;

/**
 * @author Sutra Zhou
 */
public class ConfirmEmailController extends AbstractJosSimpleFormController {
	/**
	 * {@inheritDoc}
	 */
	@Override
	protected Object formBackingObject(final HttpServletRequest request)
			throws Exception {
		ConfirmEmailForm command = (ConfirmEmailForm) super
				.formBackingObject(request);
		String code = request.getParameter("code");
		if (!StringUtils.isBlank(code)) {
			command.setConfirmationCode(code);
		}
		return command;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	protected ModelAndView onSubmit(final HttpServletRequest request,
			final HttpServletResponse response, final Object command,
			final BindException errors) throws Exception {
		ConfirmEmailForm form = (ConfirmEmailForm) command;
		try {
			this.getJosService().confirmEmail(form.getConfirmationCode());
		} catch (EmailConfirmationInfoNotFoundException e) {
			errors.rejectValue("confirmationCode",
					"email.error.confirmationInfoNotFound",
					"Incorrect E-mail confirmation code.");
		}
		if (errors.hasErrors()) {
			return this.showForm(request, response, errors);
		} else {
			return super.onSubmit(request, response, command, errors);
		}
	}

}


text:
package hudson.model.listeners;

import hudson.Extension;
import hudson.ExtensionList;
import hudson.ExtensionPoint;
import hudson.XmlFile;
import hudson.model.Saveable;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 * Receives notifications about save actions on {@link Saveable} objects in Hudson.
 *
 * <p>
 * This is an abstract class so that methods added in the future won't break existing listeners.
 *
 * @author Andrew Bayer
 * @since 1.334
 */
public abstract class SaveableListener implements ExtensionPoint {

    /**
     * Called when a change is made to a {@link Saveable} object.
     *
     * @param o
     *      The saveable object.
     * @param file
     *      The {@link XmlFile} for this saveable object.
     */
    public void onChange(Saveable o, XmlFile file) {}

    /**
     * Registers this object as an active listener so that it can start getting
     * callbacks invoked.
     *
     * @deprecated as of 1.281
     *      Put {@link Extension} on your class to get it auto-registered.
     */
    @Deprecated
    public void register() {
        all().add(this);
    }

    /**
     * Reverse operation of {@link #register()}.
     */
    public void unregister() {
        all().remove(this);
    }

    /**
     * Fires the {@link #onChange} event.
     */
    public static void fireOnChange(Saveable o, XmlFile file) {
        for (SaveableListener l : all()) {
            try {
                l.onChange(o, file);
            } catch (ThreadDeath t) {
                throw t;
            } catch (Throwable t) {
                Logger.getLogger(SaveableListener.class.getName()).log(Level.WARNING, null, t);
            }
        }
    }

    /**
     * Returns all the registered {@link SaveableListener} descriptors.
     */
    public static ExtensionList<SaveableListener> all() {
        return ExtensionList.lookup(SaveableListener.class);
    }
}


text:
///////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright 2002 by Autodesk, Inc.
//
// The information contained herein is confidential, proprietary
// to Autodesk,  Inc.,  and considered a trade secret as defined
// in section 499C of the penal code of the State of California.
// Use of  this information  by  anyone  other  than  authorized
// employees of Autodesk, Inc.  is granted  only under a written
// non-disclosure agreement,  expressly  prescribing  the  scope
// and manner of such use.
//
// DESCRIPTION:
//
// Declaration of class Line3d keeping a definition of an oriented line and/or
// an axis. The Line3d class keeps a Point3d and a Vector3d. For the Line3d
// object to be valid, the vector must not be null.
//
// The parameters of the Line3d class are accessed via public data members
// 'point' and 'vector'.
//
///////////////////////////////////////////////////////////////////////////////

#include "point3d.h"

AMODELER_NAMESPACE_BEGIN

class DllImpExp Line3d
{
public:
    Line3d()                                     : point (Point3d::kNull),
                                                   vector(Vector3d::kNull)  {}
    Line3d(const Point3d&  p, const Vector3d& v) : point( p), vector(v)     {}
    Line3d(const Point3d& p1, const Point3d& p2) : point(p1), vector(p2-p1) {}

    double  dist   (const Point3d&) const;
    Point3d project(const Point3d&) const;

    void operator *=(const Transf3d&);

    // Returns true if the lines intersect at a point, false otherwise
    //
    bool intersect(const Line3d&, Point3d& intersPoint) const;

    bool isEqual(const Line3d&) const;
    bool isValid() const { return !vector.isNull(); }

    // Coincident lines are such lines whose vectors are parallel and for
    // which the root point of one line lies on the other line and vice versa.
    // If sameDirectionAlso is true, the vectors of the two lines must also
    // go in the same direction, they must not be antiparallel
    //
    bool isCoincident(const Line3d&, bool sameDirectionAlso) const;

    // Public data members
    //
    Point3d  point;
    Vector3d vector;

    static const Line3d kNull;
    static const Line3d kXAxis;
    static const Line3d kYAxis;
    static const Line3d kZAxis;

};  // class Line3d

AMODELER_NAMESPACE_END
#endif


text:
PROJECT_ROOT=$(dirname "$0")
DJANGO_PID="$PROJECT_ROOT/django.pid"
LIGHTTPD_PID="$PROJECT_ROOT/lighttpd.pid"

if [ -f $DJANGO_PID ]; then
    kill -9 `cat $DJANGO_PID`
    rm -f $DJANGO_PID
fi

if [ -f $LIGHTTPD_PID ]; then
    kill -9 `cat $LIGHTTPD_PID`
    rm -f $LIGHTTPD_PID
fi

source "${PROJECT_ROOT}/../venv/bin/activate"

# Unregister scheduled tasks for synchronization, session cleanup, etc.
(cd "$PROJECT_ROOT/.." && python2.7 manage.py uninstalltasks )

deactivate

$PROJECT_ROOT/stop-solr.sh


text:
@interface ATAdtechAdConfiguration (Conversion)

- (void)copyValuesFromBaseInstance:(ATAdConfiguration*)instance;

@end