text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ChangeListManager">
    <list default="true" id="b460c668-db2b-45c8-801f-eef0debd5a26" name="Default" comment="">
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/console" afterPath="$PROJECT_DIR$/app/console" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/logs/.gitkeep" afterPath="$PROJECT_DIR$/app/logs/.gitkeep" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/vendor/assetic" afterPath="$PROJECT_DIR$/vendor/assetic" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/vendor/bundles/Etf1/MsoBundle" afterPath="$PROJECT_DIR$/vendor/bundles/Etf1/MsoBundle" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/vendor/bundles/FOS/OAuthServerBundle" afterPath="$PROJECT_DIR$/vendor/bundles/FOS/OAuthServerBundle" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/vendor/bundles/Propel/PropelBundle" afterPath="$PROJECT_DIR$/vendor/bundles/Propel/PropelBundle" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/vendor/phing" afterPath="$PROJECT_DIR$/vendor/phing" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/vendor/propel" afterPath="$PROJECT_DIR$/vendor/propel" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/misc.xml" afterPath="$PROJECT_DIR$/.idea/misc.xml" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/vendor/symfony" afterPath="$PROJECT_DIR$/vendor/symfony" />
    </list>
    <ignored path="oauth.iws" />
    <ignored path=".idea/workspace.xml" />
    <option name="TRACKING_ENABLED" value="true" />
    <option name="SHOW_DIALOG" value="false" />
    <option name="HIGHLIGHT_CONFLICTS" value="true" />
    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
    <option name="LAST_RESOLUTION" value="IGNORE" />
  </component>
  <component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
  <component name="CreatePatchCommitExecutor">
    <option name="PATCH_PATH" value="" />
  </component>
  <component name="DaemonCodeAnalyzer">
    <disable_hints />
  </component>
  <component name="FavoritesManager">
    <favorites_list name="oauth" />
  </component>
  <component name="FileEditorManager">
    <leaf>
      <file leaf-file-name="Etf1ApiBundle.php" pinned="false" current="true" current-in-tab="true">
        <entry file="file://$PROJECT_DIR$/src/Etf1/ApiBundle/Etf1ApiBundle.php">
          <provider selected="true" editor-type-id="text-editor">
            <state line="9" column="0" selection-start="122" selection-end="122" vertical-scroll-proportion="0.28125">
              <folding />
            </state>
          </provider>
        </entry>
      </file>
    </leaf>
  </component>
  <component name="FindManager">
    <FindUsagesManager>
      <setting name="OPEN_NEW_TAB" value="false" />
    </FindUsagesManager>
  </component>
  <component name="Git.Settings">
    <option name="LINE_SEPARATORS_CONVERSION" value="ASK" />
    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
  </component>
  <component name="GitLogSettings">
    <option name="myStructureFilterPaths" />
  </component>
  <component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" />
  <component name="ProjectFrameBounds">
    <option name="x" value="-4" />
    <option name="y" value="-4" />
    <option name="width" value="1288" />
    <option name="height" value="1002" />
  </component>
  <component name="ProjectLevelVcsManager" settingsEditedManually="false">
    <OptionsSetting value="true" id="Add" />
    <OptionsSetting value="true" id="Remove" />
    <OptionsSetting value="true" id="Checkout" />
    <OptionsSetting value="true" id="Update" />
    <OptionsSetting value="true" id="Status" />
    <OptionsSetting value="true" id="Edit" />
    <ConfirmationsSetting value="0" id="Add" />
    <ConfirmationsSetting value="0" id="Remove" />
  </component>
  <component name="ProjectReloadState">
    <option name="STATE" value="0" />
  </component>
  <component name="ProjectView">
    <navigator currentView="ProjectPane" proportions="" version="1" splitterProportion="0.5">
      <flattenPackages />
      <showMembers />
      <showModules />
      <showLibraryContents ProjectPane="true" />
      <hideEmptyPackages />
      <abbreviatePackageNames />
      <autoscrollToSource />
      <autoscrollFromSource />
      <sortByType />
    </navigator>
    <panes>
      <pane id="Scope">
        <subPane subId="Project Files">
          <PATH>
            <PATH_ELEMENT USER_OBJECT="Root">
              <option name="myItemId" value="" />
              <option name="myItemType" value="" />
            </PATH_ELEMENT>
          </PATH>
        </subPane>
      </pane>
      <pane id="ProjectPane">
        <subPane>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="oauth" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="oauth" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="oauth" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="oauth" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="oauth" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="src" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="oauth" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="oauth" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="src" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="Etf1" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="oauth" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="oauth" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="src" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="Etf1" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="ApiBundle" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
        </subPane>
      </pane>
    </panes>
  </component>
  <component name="PropertiesComponent">
    <property name="options.splitter.main.proportions" value="0.3" />
    <property name="WebServerToolWindowFactoryState" value="true" />
    <property name="options.lastSelected" value="preferences.externalTools" />
    <property name="options.splitter.details.proportions" value="0.2" />
    <property name="options.searchVisible" value="true" />
  </component>
  <component name="PublishConfig">
    <servers>
      <server id="2de14925-9a14-4e80-9569-6d1f2587fd3b">
        <serverdata />
      </server>
      <server id="655ae91b-fbbf-4d89-90d0-207f1582967c">
        <serverdata>
          <mappings>
            <mapping local="$PROJECT_DIR$" />
          </mappings>
        </serverdata>
      </server>
    </servers>
  </component>
  <component name="RunManager">
    <configuration default="true" type="PhpLocalRunConfigurationType" factoryName="PHP Console">
      <method>
        <option name="PhingTarget" enabled="false" />
      </method>
    </configuration>
    <configuration default="true" type="PhpUnitRemoteRunConfigurationType" factoryName="PHPUnit on Server">
      <method>
        <option name="FtpUpload" enabled="false">
          <server_id />
          <server_name />
        </option>
        <option name="PhingTarget" enabled="false" />
      </method>
    </configuration>
    <list size="0" />
  </component>
  <component name="ShelveChangesManager" show_recycled="false" />
  <component name="SvnConfiguration" maxAnnotateRevisions="500">
    <option name="USER" value="" />
    <option name="PASSWORD" value="" />
    <option name="mySSHConnectionTimeout" value="30000" />
    <option name="mySSHReadTimeout" value="30000" />
    <option name="LAST_MERGED_REVISION" />
    <option name="MERGE_DRY_RUN" value="false" />
    <option name="MERGE_DIFF_USE_ANCESTRY" value="true" />
    <option name="UPDATE_LOCK_ON_DEMAND" value="false" />
    <option name="IGNORE_SPACES_IN_MERGE" value="false" />
    <option name="DETECT_NESTED_COPIES" value="true" />
    <option name="CHECK_NESTED_FOR_QUICK_MERGE" value="false" />
    <option name="IGNORE_SPACES_IN_ANNOTATE" value="true" />
    <option name="SHOW_MERGE_SOURCES_IN_ANNOTATE" value="true" />
    <option name="FORCE_UPDATE" value="false" />
    <configuration useDefault="true">C:\Documents and Settings\vbardales\Application Data\Subversion</configuration>
    <myIsUseDefaultProxy>false</myIsUseDefaultProxy>
  </component>
  <component name="SvnConfiguration17" maxAnnotateRevisions="500" myUseAcceleration="nothing" myAutoUpdateAfterCommit="false">
    <option name="USER" value="" />
    <option name="PASSWORD" value="" />
    <option name="mySSHConnectionTimeout" value="30000" />
    <option name="mySSHReadTimeout" value="30000" />
    <option name="LAST_MERGED_REVISION" />
    <option name="MERGE_DRY_RUN" value="false" />
    <option name="MERGE_DIFF_USE_ANCESTRY" value="true" />
    <option name="UPDATE_LOCK_ON_DEMAND" value="false" />
    <option name="IGNORE_SPACES_IN_MERGE" value="false" />
    <option name="DETECT_NESTED_COPIES" value="true" />
    <option name="CHECK_NESTED_FOR_QUICK_MERGE" value="false" />
    <option name="IGNORE_SPACES_IN_ANNOTATE" value="true" />
    <option name="SHOW_MERGE_SOURCES_IN_ANNOTATE" value="true" />
    <option name="FORCE_UPDATE" value="false" />
    <configuration useDefault="false">C:\Documents and Settings\vbardales\Application Data\Subversion</configuration>
    <myIsUseDefaultProxy>false</myIsUseDefaultProxy>
  </component>
  <component name="TaskManager">
    <task active="true" id="Default" summary="Default task">
      <changelist id="b460c668-db2b-45c8-801f-eef0debd5a26" name="Default" comment="" />
      <created>1329899715027</created>
      <updated>1329899715027</updated>
    </task>
    <servers />
  </component>
  <component name="ToolWindowManager">
    <frame x="-4" y="-4" width="1288" height="1002" extended-state="6" />
    <editor active="true" />
    <layout>
      <window_info id="Data Sources" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.32900944" sideWeight="0.4935065" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
      <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="true" content_ui="tabs" />
      <window_info id="Remote Host" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.25487012" sideWeight="0.6709906" order="0" side_tool="false" content_ui="combo" />
      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
      <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.32900944" sideWeight="0.5008117" order="7" side_tool="true" content_ui="tabs" />
      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
      <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
      <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
    </layout>
  </component>
  <component name="VcsContentAnnotationSettings">
    <option name="myLimit" value="2678400000" />
  </component>
  <component name="VcsManagerConfiguration">
    <option name="OFFER_MOVE_TO_ANOTHER_CHANGELIST_ON_PARTIAL_COMMIT" value="true" />
    <option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="true" />
    <option name="CHECK_NEW_TODO" value="true" />
    <option name="myTodoPanelSettings">
      <value>
        <are-packages-shown value="false" />
        <are-modules-shown value="false" />
        <flatten-packages value="false" />
        <is-autoscroll-to-source value="false" />
      </value>
    </option>
    <option name="PERFORM_UPDATE_IN_BACKGROUND" value="true" />
    <option name="PERFORM_COMMIT_IN_BACKGROUND" value="true" />
    <option name="PERFORM_EDIT_IN_BACKGROUND" value="true" />
    <option name="PERFORM_CHECKOUT_IN_BACKGROUND" value="true" />
    <option name="PERFORM_ADD_REMOVE_IN_BACKGROUND" value="true" />
    <option name="PERFORM_ROLLBACK_IN_BACKGROUND" value="false" />
    <option name="CHECK_LOCALLY_CHANGED_CONFLICTS_IN_BACKGROUND" value="false" />
    <option name="ENABLE_BACKGROUND_PROCESSES" value="false" />
    <option name="CHANGED_ON_SERVER_INTERVAL" value="60" />
    <option name="SHOW_ONLY_CHANGED_IN_SELECTION_DIFF" value="true" />
    <option name="CHECK_COMMIT_MESSAGE_SPELLING" value="true" />
    <option name="DEFAULT_PATCH_EXTENSION" value="patch" />
    <option name="SHORT_DIFF_HORISONTALLY" value="true" />
    <option name="SHORT_DIFF_EXTRA_LINES" value="2" />
    <option name="SOFT_WRAPS_IN_SHORT_DIFF" value="true" />
    <option name="INCLUDE_TEXT_INTO_PATCH" value="false" />
    <option name="INCLUDE_TEXT_INTO_SHELF" value="false" />
    <option name="CREATE_PATCH_EXPAND_DETAILS_DEFAULT" value="true" />
    <option name="SHOW_FILE_HISTORY_DETAILS" value="true" />
    <option name="FORCE_NON_EMPTY_COMMENT" value="false" />
    <option name="LAST_COMMIT_MESSAGE" />
    <option name="MAKE_NEW_CHANGELIST_ACTIVE" value="true" />
    <option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="false" />
    <option name="CHECK_FILES_UP_TO_DATE_BEFORE_COMMIT" value="false" />
    <option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="false" />
    <option name="REFORMAT_BEFORE_FILE_COMMIT" value="false" />
    <option name="FILE_HISTORY_DIALOG_COMMENTS_SPLITTER_PROPORTION" value="0.8" />
    <option name="FILE_HISTORY_DIALOG_SPLITTER_PROPORTION" value="0.5" />
    <option name="ACTIVE_VCS_NAME" />
    <option name="UPDATE_GROUP_BY_PACKAGES" value="false" />
    <option name="UPDATE_GROUP_BY_CHANGELIST" value="false" />
    <option name="SHOW_FILE_HISTORY_AS_TREE" value="false" />
    <option name="FILE_HISTORY_SPLITTER_PROPORTION" value="0.6" />
  </component>
  <component name="XDebuggerManager">
    <breakpoint-manager />
  </component>
  <component name="editorHistoryManager">
    <entry file="file://$PROJECT_DIR$/src/Etf1/ApiBundle/Etf1ApiBundle.php">
      <provider selected="true" editor-type-id="text-editor">
        <state line="9" column="0" selection-start="122" selection-end="122" vertical-scroll-proportion="0.28125">
          <folding />
        </state>
      </provider>
    </entry>
  </component>
</project>


text:
package org.ovirt.engine.core.bll;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.when;

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

import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.ovirt.engine.core.bll.snapshots.SnapshotsValidator;
import org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator;
import org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters;
import org.ovirt.engine.core.common.businessentities.StorageDomain;
import org.ovirt.engine.core.common.businessentities.StorageDomainStatus;
import org.ovirt.engine.core.common.businessentities.VM;
import org.ovirt.engine.core.common.businessentities.VMStatus;
import org.ovirt.engine.core.common.businessentities.VmDevice;
import org.ovirt.engine.core.common.businessentities.VmEntityType;
import org.ovirt.engine.core.common.businessentities.VmTemplate;
import org.ovirt.engine.core.common.businessentities.storage.CinderDisk;
import org.ovirt.engine.core.common.businessentities.storage.Disk;
import org.ovirt.engine.core.common.businessentities.storage.DiskContentType;
import org.ovirt.engine.core.common.businessentities.storage.DiskImage;
import org.ovirt.engine.core.common.businessentities.storage.ImageOperation;
import org.ovirt.engine.core.common.businessentities.storage.ImageStatus;
import org.ovirt.engine.core.common.businessentities.storage.LunDisk;
import org.ovirt.engine.core.common.businessentities.storage.StorageType;
import org.ovirt.engine.core.common.errors.EngineMessage;
import org.ovirt.engine.core.common.utils.Pair;
import org.ovirt.engine.core.compat.Guid;
import org.ovirt.engine.core.dao.DiskDao;
import org.ovirt.engine.core.dao.DiskImageDao;
import org.ovirt.engine.core.dao.StorageDomainDao;
import org.ovirt.engine.core.dao.VmDao;
import org.ovirt.engine.core.dao.VmDeviceDao;

@RunWith(MockitoJUnitRunner.class)
public class MoveOrCopyDiskCommandTest {

    private final Guid diskImageGuid = Guid.newGuid();
    private Guid destStorageId = Guid.newGuid();
    private final Guid srcStorageId = Guid.newGuid();
    private final VmDevice vmDevice = new VmDevice();

    @Mock
    private DiskDao diskDao;
    @Mock
    private DiskImageDao diskImageDao;
    @Mock
    private StorageDomainDao storageDomainDao;
    @Mock
    private VmDao vmDao;
    @Mock
    private VmDeviceDao vmDeviceDao;
    @Mock
    private SnapshotsValidator snapshotsValidator;

    private Disk disk;

    /**
     * The command under test.
     */
    protected MoveOrCopyDiskCommand<MoveOrCopyImageGroupParameters> command;

    @Test
    public void canDoActionImageNotFound() throws Exception {
        initializeCommand(ImageOperation.Move, new DiskImage());
        when(diskImageDao.get(any(Guid.class))).thenReturn(null);
        when(diskImageDao.getSnapshotById(any(Guid.class))).thenReturn(null);
        assertFalse(command.canDoAction());
        assertTrue(command.getReturnValue()
                .getCanDoActionMessages()
                .contains(EngineMessage.ACTION_TYPE_FAILED_DISK_NOT_EXIST.toString()));
    }

    @Test
    public void canDoActionWrongDiskImageTypeTemplate() throws Exception {
        initializeCommand(ImageOperation.Move, new DiskImage());
        initTemplateDiskImage();
        assertFalse(command.canDoAction());
        assertTrue(command.getReturnValue()
                .getCanDoActionMessages()
                .contains(EngineMessage.ACTION_TYPE_FAILED_DISK_IS_NOT_VM_DISK.toString()));
    }

    @Test
    public void moveShareableDiskToGlusterDomain() {
        initializeCommand(ImageOperation.Move, new DiskImage());
        initSrcStorageDomain();
        initDestStorageDomain(StorageType.GLUSTERFS);
        initVmDiskImage(true);

        assertFalse(command.canDoAction());
        assertTrue(command.getReturnValue()
                .getCanDoActionMessages()
                .contains(EngineMessage.ACTION_TYPE_FAILED_CANT_MOVE_SHAREABLE_DISK_TO_GLUSTERFS.toString()));
    }

    @Test
    public void moveShareableDisk() {
        initializeCommand(ImageOperation.Move, new DiskImage());
        initSrcStorageDomain();
        initDestStorageDomain(StorageType.NFS);
        initVmDiskImage(true);

        assertTrue(command.canDoAction());
    }

    @Test
    public void moveDiskToGluster() {
        initializeCommand(ImageOperation.Move, new DiskImage());
        initSrcStorageDomain();
        initDestStorageDomain(StorageType.GLUSTERFS);
        initVmDiskImage(false);

        assertTrue(command.canDoAction());
    }

    @Test
    public void canDoActionSameSourceAndDest() throws Exception {
        destStorageId = srcStorageId;
        initializeCommand(ImageOperation.Move, new DiskImage());
        initVmDiskImage(false);
        mockGetVmsListForDisk();
        initSrcStorageDomain();
        assertFalse(command.canDoAction());
        assertTrue(command.getReturnValue()
                .getCanDoActionMessages()
                .contains(EngineMessage.ACTION_TYPE_FAILED_SOURCE_AND_TARGET_SAME.toString()));
    }

    @Test
    public void canDoActionVmIsNotDown() throws Exception {
        initializeCommand(ImageOperation.Move, new DiskImage());
        initSnapshotValidator();
        initVmDiskImage(false);
        mockGetVmsListForDisk();
        initSrcStorageDomain();
        initDestStorageDomain(StorageType.NFS);
        doReturn(vmDeviceDao).when(command).getVmDeviceDao();

        assertFalse(command.canDoAction());
        assertTrue(command.getReturnValue()
                .getCanDoActionMessages()
                .contains(EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN.toString()));
    }

    @Test
    public void canDoActionDiskIsLocked() throws Exception {
        initializeCommand(ImageOperation.Move, new DiskImage());
        initVmDiskImage(false);
        mockGetVmsListForDisk();
        command.getImage().setImageStatus(ImageStatus.LOCKED);
        doReturn(vmDeviceDao).when(command).getVmDeviceDao();
        assertFalse(command.canDoAction());
        assertTrue(command.getReturnValue().getCanDoActionMessages().contains(
                EngineMessage.ACTION_TYPE_FAILED_DISKS_LOCKED.toString()));
    }

    @Test
    public void canDoActionDiskIsOvfStore() throws Exception {
        initializeCommand(ImageOperation.Move, new DiskImage());
        initVmDiskImage(false);
        command.getImage().setContentType(DiskContentType.OVF_STORE);
        CanDoActionTestUtils.runAndAssertCanDoActionFailure(command,
                EngineMessage.ACTION_TYPE_FAILED_OVF_DISK_NOT_SUPPORTED);
    }

    @Test
    public void canDoActionTemplateImageIsLocked() throws Exception {
        initializeCommand(ImageOperation.Copy, new DiskImage());
        initTemplateDiskImage();
        command.getImage().setImageStatus(ImageStatus.LOCKED);
        doReturn(new VmTemplate()).when(command).getTemplateForImage();

        command.defineVmTemplate();
        assertFalse(command.canDoAction());
        assertTrue(command.getReturnValue().getCanDoActionMessages().contains(
                EngineMessage.VM_TEMPLATE_IMAGE_IS_LOCKED.toString()));
    }

    @Test
    public void canDoActionNotEnoughSpace() throws Exception {
        initializeCommand(ImageOperation.Move, new DiskImage());
        initVmForSpace();
        initVmDiskImage(false);
        initSrcStorageDomain();
        initDestStorageDomain(StorageType.NFS);
        doReturn(mockStorageDomainValidatorWithoutSpace()).when(command).createStorageDomainValidator();
        CanDoActionTestUtils.runAndAssertCanDoActionFailure(command, EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN);
    }

    @Test
    public void canDoActionEnoughSpace() throws Exception {
        initializeCommand(ImageOperation.Move, new DiskImage());
        initSnapshotValidator();
        initVmForSpace();
        initVmDiskImage(false);
        initSrcStorageDomain();
        initDestStorageDomain(StorageType.NFS);
        doReturn(mockStorageDomainValidatorWithSpace()).when(command).createStorageDomainValidator();
        CanDoActionTestUtils.runAndAssertCanDoActionSuccess(command);
    }

    @Test
    public void successVmInPreviewForAttachedSnapshot() {
        initializeCommand(ImageOperation.Move, new DiskImage());
        initSnapshotValidator();
        initVmForSpace();
        initVmDiskImage(false);
        initSrcStorageDomain();
        initDestStorageDomain(StorageType.NFS);
        vmDevice.setSnapshotId(Guid.newGuid());
        CanDoActionTestUtils.runAndAssertCanDoActionSuccess(command);
    }

    @Test
    public void canDoActionVmInPreview() {
        initializeCommand(ImageOperation.Move, new DiskImage());
        initSnapshotValidator();
        initVmForSpace();
        initVmDiskImage(false);
        initSrcStorageDomain();
        initDestStorageDomain(StorageType.NFS);
        when(snapshotsValidator.vmNotInPreview(any(Guid.class))).thenReturn(new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW));
        CanDoActionTestUtils.runAndAssertCanDoActionFailure(command, EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW);
    }

    @Test
    public void canDoActionFailureOnMovingLunDisk() {
        initializeCommand(ImageOperation.Move, new LunDisk());
        CanDoActionTestUtils.runAndAssertCanDoActionFailure(command,
                EngineMessage.ACTION_TYPE_FAILED_NOT_SUPPORTED_DISK_STORAGE_TYPE);
    }

    @Test
    public void canDoActionFailureOnCopyingLunDisk() {
        initializeCommand(ImageOperation.Copy, new LunDisk());
        CanDoActionTestUtils.runAndAssertCanDoActionFailure(command,
                EngineMessage.ACTION_TYPE_FAILED_NOT_SUPPORTED_DISK_STORAGE_TYPE);
    }

    @Test
    public void canDoActionFailureOnMovingVmLunDisk() {
        initializeCommand(ImageOperation.Move, new LunDisk());
        vmDevice.setSnapshotId(Guid.newGuid());
        CanDoActionTestUtils.runAndAssertCanDoActionFailure(command,
                EngineMessage.ACTION_TYPE_FAILED_NOT_SUPPORTED_DISK_STORAGE_TYPE);
    }

    @Test
    public void canDoActionFailureOnMovingCinderDisk() {
        initializeCommand(ImageOperation.Move, new CinderDisk());
        CanDoActionTestUtils.runAndAssertCanDoActionFailure(command,
                EngineMessage.ACTION_TYPE_FAILED_NOT_SUPPORTED_DISK_STORAGE_TYPE);
    }

    @Test
    public void canDoActionFailureOnCopyingCinderDisk() {
        initializeCommand(ImageOperation.Copy, new CinderDisk());
        CanDoActionTestUtils.runAndAssertCanDoActionFailure(command,
                EngineMessage.ACTION_TYPE_FAILED_NOT_SUPPORTED_DISK_STORAGE_TYPE);
    }

    protected void initVmForSpace() {
        VM vm = new VM();
        vm.setStatus(VMStatus.Down);

        // Re-mock the vmDao to return this specific VM for it to be correlated with the vm list mocked by getVmsWithPlugInfo(..).
        doReturn(vmDao).when(command).getVmDao();
        when(vmDao.get(any(Guid.class))).thenReturn(vm);
        List<Pair<VM, VmDevice>> vmList = Collections.singletonList(new Pair<>(vm, vmDevice));
        when(vmDao.getVmsWithPlugInfo(any(Guid.class))).thenReturn(vmList);
    }

    private void mockGetVmsListForDisk() {
        List<Pair<VM, VmDevice>> vmList = new ArrayList<>();
        VM vm1 = new VM();
        vm1.setStatus(VMStatus.PoweringDown);
        VM vm2 = new VM();
        vm2.setStatus(VMStatus.Down);
        VmDevice device1 = new VmDevice();
        device1.setIsPlugged(true);
        VmDevice device2 = new VmDevice();
        device2.setIsPlugged(true);
        vmList.add(new Pair<>(vm1, device1));
        vmList.add(new Pair<>(vm2, device2));

        when(vmDao.getVmsWithPlugInfo(any(Guid.class))).thenReturn(vmList);
    }

    private static StorageDomainValidator mockStorageDomainValidatorWithoutSpace() {
        StorageDomainValidator storageDomainValidator = mockStorageDomainValidator();
        when(storageDomainValidator.hasSpaceForDiskWithSnapshots(any(DiskImage.class))).thenReturn(
                new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN));
        return storageDomainValidator;
    }

    private static StorageDomainValidator mockStorageDomainValidatorWithSpace() {
        StorageDomainValidator storageDomainValidator = mockStorageDomainValidator();
        when(storageDomainValidator.hasSpaceForDiskWithSnapshots(any(DiskImage.class))).thenReturn(ValidationResult.VALID);
        return storageDomainValidator;
    }

    private static StorageDomainValidator mockStorageDomainValidator() {
        StorageDomainValidator storageDomainValidator = mock(StorageDomainValidator.class);
        when(storageDomainValidator.isDomainExistAndActive()).thenReturn(ValidationResult.VALID);
        when(storageDomainValidator.isDomainWithinThresholds()).thenReturn(ValidationResult.VALID);
        return storageDomainValidator;
    }

    private void initSrcStorageDomain() {
        StorageDomain stDomain = new StorageDomain();
        stDomain.setStatus(StorageDomainStatus.Active);
        when(storageDomainDao.getForStoragePool(any(Guid.class), any(Guid.class))).thenReturn(stDomain);
    }

    private void initDestStorageDomain(StorageType storageType) {
        StorageDomain destDomain = new StorageDomain();
        destDomain.setStorageType(storageType);
        destDomain.setStatus(StorageDomainStatus.Active);
        doReturn(destDomain).when(command).getStorageDomain();
    }

    @SuppressWarnings("unchecked")
    protected void initializeCommand(ImageOperation operation, Disk disk) {
        command = spy(new MoveOrCopyDiskCommandDummy(new MoveOrCopyImageGroupParameters(diskImageGuid,
                srcStorageId,
                destStorageId,
                operation)));

        doReturn(vmDao).when(command).getVmDao();
        doReturn(diskDao).when(command).getDiskDao();
        this.disk = disk;
        when(diskDao.get(any(Guid.class))).thenReturn(this.disk);

        VM vm = new VM();
        vm.setStatus(VMStatus.Down);
        when(vmDao.get(any(Guid.class))).thenReturn(vm);

        when(vmDao.getVmsWithPlugInfo(any(Guid.class))).thenReturn(new ArrayList<Pair<VM, VmDevice>>());
        doReturn(new ArrayList<DiskImage>()).when(command).getAllImageSnapshots();
        doReturn(mockStorageDomainValidatorWithSpace()).when(command).createStorageDomainValidator();
        doReturn(false).when(command).acquireLock();
        doReturn(true).when(command).setAndValidateDiskProfiles();
        doReturn(storageDomainDao).when(command).getStorageDomainDao();
        doReturn(disk.getId()).when(command).getImageGroupId();
    }

    private void initSnapshotValidator() {
        when(snapshotsValidator.vmNotInPreview(any(Guid.class))).thenReturn(ValidationResult.VALID);
        when(snapshotsValidator.vmNotDuringSnapshot(any(Guid.class))).thenReturn(ValidationResult.VALID);
        when(command.getSnapshotsValidator()).thenReturn(snapshotsValidator);
    }

    private void initTemplateDiskImage() {
        DiskImage diskImage = new DiskImage();
        diskImage.setVmEntityType(VmEntityType.TEMPLATE);
        when(diskImageDao.get(any(Guid.class))).thenReturn(diskImage);
    }

    private void initVmDiskImage(boolean isShareable) {
        DiskImage diskImage = new DiskImage();
        diskImage.setVmEntityType(VmEntityType.VM);
        diskImage.setShareable(isShareable);
        when(diskImageDao.get(any(Guid.class))).thenReturn(diskImage);
    }

    /**
     * The following class is created in order to allow to use a mock diskImageDao in constructor
     */
    private class MoveOrCopyDiskCommandDummy extends MoveOrCopyDiskCommand<MoveOrCopyImageGroupParameters> {

        public MoveOrCopyDiskCommandDummy(MoveOrCopyImageGroupParameters parameters) {
            super(parameters);
        }

        @Override
        protected VmTemplate getTemplateForImage() {
            return null;
        }

        @Override
        protected DiskImageDao getDiskImageDao() {
            return diskImageDao;
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Moneda;

namespace MiPrograma
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.Title = "Ejercicio Nro 21";

            Dolar unDolar = new Dolar(10);
            Dolar dosDolar = new Dolar(4);

            Euro unEuro = new Euro(10);
            Euro dosEuro = new Euro(2);

            //Dolares
            unDolar = unDolar + dosDolar;
            unDolar = unDolar - dosDolar;
            unDolar++;
            dosDolar--;
            unDolar = unDolar + unEuro;

            if (unDolar == dosDolar)
            {
                Console.WriteLine("Son iguales");
            }

            if (unDolar == unEuro)
            {
                Console.WriteLine("Son iguales");
            }

            unDolar = 7;

            //Euro
            unEuro = unEuro + dosEuro;
            unEuro = unEuro - dosEuro;
            unEuro++;
            unEuro--;
            unEuro = unEuro + unDolar;

            if (unEuro == dosEuro)
            {
                Console.WriteLine("Son iguales");
            }

            if (unEuro == unDolar)
            {
                Console.WriteLine("Son iguales");
            }

            unEuro = 5;

        }
    }
}


text:
package org.example.toolz;

import org.tomitribe.crest.api.Command;
import org.tomitribe.crest.api.Default;
import org.tomitribe.crest.api.Option;
import org.tomitribe.crest.api.StreamingOutput;
import org.tomitribe.crest.util.IO;
import org.tomitribe.crest.val.Readable;

import java.io.File;
import java.io.IOException;
import java.io.OutputStream;

/**
 *
 */
public class App {

    @Command
    public StreamingOutput cat(@IsFile @Readable final File file) {

        return new StreamingOutput() {
            @Override
            public void write(OutputStream os) throws IOException {
                IO.copy(file, os);
            }
        };
    }

    @Command
    public String hello(@Option("name") @Default("World") String name,
                        @Option("language") @Default("EN") Language language) {
        return String.format("%s, %s!", language.getSalutation(), name);
    }

    public static enum Language {
        EN("Hello"),
        ES("Hola"),
        FR("Bonjour");

        private final String salutation;

        private Language(String salutation) {
            this.salutation = salutation;
        }

        public String getSalutation() {
            return salutation;
        }
    }

}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Flora, Jena 65: 501 (1882)

#### Original name
Arthonia delicatula Müll. Arg.

### Remarks
null


text:
package bdsup2sub.gui.main;

import bdsup2sub.core.*;

import java.awt.*;
import java.util.List;

class MainFrameModel {

    private final Configuration configuration = Configuration.getInstance();

    private String saveFilename;
    private String savePath;
    private int subIndex;
    private boolean sourceFileSpecifiedOnCmdLine;

    public String getLoadPath() {
        return configuration.getLoadPath();
    }

    public void setLoadPath(String loadPath) {
        configuration.setLoadPath(loadPath);
    }

    public String getSavePath() {
        return savePath;
    }

    public void setSavePath(String savePath) {
        this.savePath = savePath;
    }

    public String getSaveFilename() {
        return saveFilename;
    }

    public void setSaveFilename(String saveFilename) {
        this.saveFilename = saveFilename;
    }

    public int getSubIndex() {
        return subIndex;
    }

    public void setSubIndex(int subIndex) {
        this.subIndex = subIndex;
    }

    public boolean isSourceFileSpecifiedOnCmdLine() {
        return sourceFileSpecifiedOnCmdLine;
    }

    public void setSourceFileSpecifiedOnCmdLine(boolean sourceFileSpecified) {
        this.sourceFileSpecifiedOnCmdLine = sourceFileSpecified;
    }

    public String getColorProfilePath() {
        return configuration.getColorProfilePath();
    }

    public void setColorProfilePath(String colorProfilePath) {
        configuration.setColorProfilePath(colorProfilePath);
    }

    public Dimension getMainWindowSize() {
        return configuration.getMainWindowSize();
    }

    public void setMainWindowSize(Dimension dimension) {
        configuration.setMainWindowSize(dimension);
    }

    public Point getMainWindowLocation() {
        return configuration.getMainWindowLocation();
    }

    public void setMainWindowLocation(Point location) {
        configuration.setMainWindowLocation(location);
    }

    public List<String> getRecentFiles() {
        return configuration.getRecentFiles();
    }

    public void addToRecentFiles(String filename) {
        configuration.addToRecentFiles(filename);
    }

    public boolean isVerbose() {
        return configuration.isVerbose();
    }

    public void setVerbose(boolean verbose) {
        configuration.setVerbose(verbose);
    }

    public ScalingFilter getScalingFilter() {
        return configuration.getScalingFilter();
    }

    public void setScalingFilter(ScalingFilter scalingFilter) {
        configuration.setScalingFilter(scalingFilter);
    }

    public boolean getFixZeroAlpha() {
        return configuration.getFixZeroAlpha();
    }

    public void setFixZeroAlpha(boolean fixZeroAlpha) {
        configuration.setFixZeroAlpha(fixZeroAlpha);
    }

    public PaletteMode getPaletteMode() {
        return configuration.getPaletteMode();
    }

    public void setPaletteMode(PaletteMode paletteMode) {
        configuration.setPaletteMode(paletteMode);
    }

    public OutputMode getOutputMode() {
        return configuration.getOutputMode();
    }

    public void setOutputMode(OutputMode outputMode) {
        configuration.setOutputMode(outputMode);
    }

    public boolean getConvertFPS() {
        return configuration.getConvertFPS();
    }

    public int getDelayPTS() {
        return configuration.getDelayPTS();
    }

    public boolean getApplyFreeScale() {
        return configuration.getApplyFreeScale();
    }

    public double getFreeScaleX() {
        return configuration.getFreeScaleFactorX();
    }

    public double getFreeScaleY() {
        return configuration.getFreeScaleFactorY();
    }

    public double getFPSTrg() {
        return configuration.getFpsTrg();
    }

    public Resolution getOutputResolution() {
        return configuration.getOutputResolution();
    }

    public int getAlphaThreshold() {
        return configuration.getAlphaThreshold();
    }

    public void setAlphaThreshold(int alphaThreshold) {
        configuration.setAlphaThreshold(alphaThreshold);
    }

    public int[] getLuminanceThreshold() {
        return configuration.getLuminanceThreshold();
    }

    public void setLuminanceThreshold(int[] luminanceThreshold) {
        configuration.setLuminanceThreshold(luminanceThreshold);
    }

    public int getCropOffsetY() {
        return configuration.getCropOffsetY();
    }

    public void setCropOffsetY(int cropOffsetY) {
        configuration.setCropOffsetY(cropOffsetY);
    }

    public void setSwapCrCb(boolean swapCrCb) {
        configuration.setSwapCrCb(swapCrCb);
    }

    public boolean getMoveCaptions() {
        return configuration.getMoveCaptions();
    }
}


text:
<!doctype html>

		<meta charset="utf-8">

		<title>Programación - Por Walter Brunetti</title>

		<meta name="description" content="A framework for easily creating beautiful presentations using HTML">
		<meta name="author" content="Walter Brunetti">

		<meta name="apple-mobile-web-app-capable" content="yes" />
		<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />

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

		<link rel="stylesheet" href="css/reveal.min.css">
		<link rel="stylesheet" href="css/theme/default.css" id="theme">

		<link rel="stylesheet" href="lib/css/zenburn.css">

Programación

Computer Programming

						Por Walter Brunetti / @walterbrunetti

Presentación

¿Qué es programación?

Programar es describir cómo hacer algo

Un programa de computación es simplemente un conjunto de instrucciones que le dicen a la computadora cómo realizar una tarea en particular

"Programar es probablemente unas de las pocas cosas en el mundo en las que te puedes sentar y hacer algo completamente nuevo desde cero"

Mark Zuckerberg

"Creo que todos deberian aprender como programar ya que te enseña como pensar. Veo a la programación como arte liberal, algo que todos deberían aprender a hacer"

Steve Jobs

Si programar es sencillo, entonces ¿por qué no hay muchos programadores?

Se estima que en los siguientes 10 años va a haber mas de 1.4 millones de puestos de trabajo en computer science y solo 400 mil califican para esos puestos

¿Cómo empiezo a programar?

Elegir un lenguaje de programación

Lenguajes de alto nivel

VB.NET

C++

C#

C

Java

Perl

PHP

Python

Ruby

¿Y cómo es el proceso para el desarrollo de software?

Actividades del desarrollo de software

Planificación - toma de requisitos

Análisis

Desarrollo (programación)

Pruebas

Documentar

Despliegue y mantenimiento

Modelos de Desarrollo de Software

Modelo de cascada

Modelo de espiral

Desarrollo iterativo e incremental

Desarrollo ágil

Y algunos mas...

Desarrollo ágil - Agile

Adopta una estrategia de desarrollo iterativo e incremental

Se enfoca en las personas y los resultados

El software desarrollado en una unidad de tiempo es llamado una iteración

Cada iteración agrega funcionalidad al software desarrollado

SCRUM

                    Scrum es un modelo de desarrollo ágil caracterizado por:

Define un conjunto de prácticas y roles

Equipos autoorganizados

Solapamiento de las diferentes fases del desarrollo

Durante cada sprint, el equipo crea un incremento de software potencialmente entregable (utilizable).

Desarrollo web

HTML

JavaScript

CSS

HTML

HTML: Hyper Text Markup Language

Markup language hace referencia a un conjunto de tags (etiquetas)

Los documentos HTML estan descriptios por los HTML tags

Cada tag HTML describe un contenido diferente

Demo

Este es un título

Y esto es un párrafo

                            Nombre:
                            <input type="text" name="name" id="name" />
                            <input type="button" value="Calcular" onclick="calcular_nombre()" />

Links

http://www.estudiarcomputacion.gob.ar

http://www.programar.gob.ar

http://control.cifasis-conicet.gov.ar/~fbergero/ingreso/index.php/Main_Page

http://www.fundacionsadosky.org.ar

Gracias!

www.walterbrunetti.com.ar / @walterbrunetti


text:
Yummy
=====

About
-----

It looks like a site that I have used and relied on for many years, del.icio.us, is going to die. The only choice is to use a replacement. There are many clones out there in the world, but they all have the same problem. If they go down, you have to move again.

The right answer to this problem is for people to host their own del.icio.us clone. Then nobody can take it down. Also, private bookmarks will truly be private. If we want to share our bookmarks, we can configure the system to interact with any number of APIs including Twitter, Facebook, bit.ly, etc. The system can also have its own API to allow for easy sharing or aggregating of bookmarks between instances.

Technical
---------

Yummy is an extremely standard Django application. Setup a database, configure the settings file, install the requirements, and you are good to go. Eventually we will find a way to make installation like WordPress, the goal of all such webapps, but in such early stages it will be trickier.

For those of you who are newbs out there, you should not need to edit the settings.py at all. Simply copy the local_settings.py.template to local_settings.py and edit that file. It is in the .gitignore, so your private info will not be shared.


text:
from __future__ import unicode_literals

import datetime
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import modelcluster.contrib.taggit
import modelcluster.fields
import wagtail.wagtailcore.blocks
import wagtail.wagtailcore.fields
import wagtail.wagtailimages.blocks

class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('taggit', '0002_auto_20150616_2121'),
        ('wagtailcore', '0023_alter_page_revision_on_delete_behaviour'),
    ]

    operations = [
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, max_length=255)),
            ],
            options={
                'verbose_name_plural': 'Categories',
            },
        ),
        migrations.CreateModel(
            name='WPPage',
            fields=[
                ('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')),
                ('content', wagtail.wagtailcore.fields.StreamField((('heading', wagtail.wagtailcore.blocks.CharBlock(classname='full title')), ('paragraph', wagtail.wagtailcore.blocks.TextBlock()), ('image', wagtail.wagtailimages.blocks.ImageChooserBlock()), ('url', wagtail.wagtailcore.blocks.URLBlock()), ('code', wagtail.wagtailcore.blocks.StructBlock((('language', wagtail.wagtailcore.blocks.ChoiceBlock(choices=[('python', 'Python'), ('bash', 'Bash/Shell'), ('html', 'HTML'), ('css', 'CSS'), ('scss', 'SCSS'), ('js', 'JavaScript')])), ('code', wagtail.wagtailcore.blocks.TextBlock()))))))),
                ('modified', models.DateTimeField(null=True, verbose_name='Page Modified')),
            ],
            options={
                'verbose_name': 'Page',
            },
            bases=('wagtailcore.page',),
        ),
        migrations.CreateModel(
            name='WPPageTag',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='WPPost',
            fields=[
                ('wppage_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailpress.WPPage')),
                ('date', models.DateField(default=datetime.date.today, verbose_name='Post Date')),
                ('excerpt', models.CharField(max_length=250)),
                ('author', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='author', to=settings.AUTH_USER_MODEL)),
                ('categories', models.ManyToManyField(to='wagtailpress.Category')),
            ],
            options={
                'verbose_name': 'Post',
            },
            bases=('wagtailpress.wppage',),
        ),
        migrations.AddField(
            model_name='wppagetag',
            name='content_object',
            field=modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='tagged_items', to='wagtailpress.WPPage'),
        ),
        migrations.AddField(
            model_name='wppagetag',
            name='tag',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='wagtailpress_wppagetag_items', to='taggit.Tag'),
        ),
        migrations.AddField(
            model_name='wppage',
            name='tags',
            field=modelcluster.contrib.taggit.ClusterTaggableManager(blank=True, help_text='A comma-separated list of tags.', through='wagtailpress.WPPageTag', to='taggit.Tag', verbose_name='Tags'),
        ),
    ]


text:
const mongoose = require('mongoose');

const AnimalSchema = new mongoose.Schema({
	breed: {
		type: String,
		required: true
	},
	size: {
		type: String,
		required: true
	},
	energy: {
		type: String,
		required: true
	},
	barking: {
		type: String,
		required: true
	},
	shedding: {
		type: String,
		required: true
	},
	alone: {
		type: String,
		required: true
	},
	pets: {
		type: String,
		required: true
	},
	train: {
		type: String,
		required: true
	},
	guard: {
		type: String,
		required: true
	},
	walk: {
		type: String,
		required: true
	},
	affectionate: {
		type: String,
		required: true
	},
	image: {
		type: String,
		required: true
	},
	info: {
		type: String,
		required: true
	}
});

const Animal = mongoose.model('dog_breeds', AnimalSchema);
module.exports = Animal;


text:
floating-preview is a simple browser which shows a web page in a small window always on top and reloads automatically.

![floating-preview](https://raw.githubusercontent.com/kitao/floating-preview/master/floating-preview.gif)

## How to Install

### Preparation

In order to use floating-preview, installation of Node.js is required. Node.js can be obtained from [the official site](https://nodejs.org/).

In a proxy environment, the following settings are also needed:
- Set the proxy server with the `npm config set proxy` and `npm config set https-proxy` commands
- If on Windows, set the `http_proxy` and `https_proxy` environment variables to install the electron-prebuilt module

### Installing floating-preview

floating-preview can be installed with the `npm` command of Node.js.

```bash
$ npm -g install floating-preview
```

If a permission error occured while installation, please add the `sudo` command at the head of the above command.

## How to Use

### Usage

```
floating-preview [options] [path]
```

Both file and directory names can be specified as a path.

### Examples

Open the `index.html` file in the current directory and watch the changes under the same directory to reload.

```bash
$ floating-preview
```

Open the `index.html` file in the `src` directory and watch the changes under it.

```bash
$ floating-preview src
```

Open the `app.js` file and watch the changes under the same directory.

```bash
$ floating-preview app.js
```

Open the `app.js` file in a window whose size is 400x300.

```bash
$ floating-preview -s 400x300 app.js
```

### Options

```
-h, --help                   output usage information
-V, --version                output the version number
-p, --port <n>               the port number for the http server
-s, --size <width>x<height>  the size of the window
-m, --margin <n>             the margin of the window to the corner
-z, --zoom <n>               the zoom percentage of the content
```

## License

floating-preview is under [MIT license](http://en.wikipedia.org/wiki/MIT_License).


text:
Brukes til å motta meldinger fra Spring Boot Nr 2.

## Endepunkt
- /
- /jersey/api/send/file


text:
module.exports = curry;

/*
  function converter(ratio, input) {
    return (input*ratio).toFixed(1);
  }
  var milesToKm = curry(converter, 1.62);
  milesToKm(35); // 56.7
  milesToKm(10); // 16.2
*/

function curry(fn /*, arg1, arg2 etc */) {
  var curriedArgs = [].slice.call(arguments, 1);
  if (!curriedArgs.length) {
    return fn;
  }
  return function () {
    return fn.apply(this, curriedArgs.concat([].slice.call(arguments)));
  };
}


text:
from PySide import QtGui, QtCore

import cbpos

logger = cbpos.get_logger(__name__)

from cbpos.database import Profile, Driver, ProfileNotFoundError, DriverNotFoundError

from cbmod.base.views.wizard import BaseWizardPage
from cbmod.config.views.widgets.database import DriverForm, DatabaseSetupWorker

class DatabaseInfoWizardPage(BaseWizardPage):

    configPageId = None
    setupPageId = None

    def __init__(self, parent=None):
        super(DatabaseInfoWizardPage, self).__init__(parent)

        self.label = QtGui.QLabel(cbpos.tr.config_("DATABASE_SETUP_INFORMATION"), self)

        self.configureBox = QtGui.QGroupBox(cbpos.tr.config_("DATABASE_PROFILE_SELECTION_RADIO_BOX"), self)

        self.profileNew = QtGui.QRadioButton(cbpos.tr.config_("DATABASE_PROFILE_RADIO_CREATE_NEW"), self.configureBox)
        self.profileSelect = QtGui.QRadioButton(cbpos.tr.config_("DATABASE_PROFILE_RADIO_SELECT_EXISTING"), self.configureBox)
        self.profileEdit = QtGui.QRadioButton(cbpos.tr.config_("DATABASE_PROFILE_RADIO_EDIT_EXISTING"), self.configureBox)

        self.profileNew.toggled.connect(self.onProfileSelectionToggled)
        self.profileSelect.toggled.connect(self.onProfileSelectionToggled)
        self.profileEdit.toggled.connect(self.onProfileSelectionToggled)

        self.profileCombo = QtGui.QComboBox(self.configureBox)
        self.profileCombo.setEditable(False)
        self.profileCombo.currentIndexChanged.connect(self.onProfileComboChanged)

        self.registerField('database_profile_new', self.profileNew)
        self.registerField('database_profile_select', self.profileSelect)
        self.registerField('database_profile_edit', self.profileEdit)
        self.registerField('database_profile_name', self.profileCombo, 'currentText')

        self.profileNew.setChecked(True)

        configureLayout = QtGui.QVBoxLayout()
        configureLayout.addWidget(self.profileNew)
        configureLayout.addWidget(self.profileSelect)
        configureLayout.addWidget(self.profileEdit)
        configureLayout.addWidget(self.profileCombo)
        self.configureBox.setLayout(configureLayout)

        layout = QtGui.QVBoxLayout()
        layout.addWidget(self.label)
        layout.addWidget(self.configureBox)

        self.setLayout(layout)

    def onProfileSelectionToggled(self):
        if self.profileNew.isChecked():
            self.profileCombo.setEnabled(False)
        elif self.profileEdit.isChecked() or self.profileSelect.isChecked():
            self.profileCombo.setEnabled(True)
        else:
            self.profileCombo.setEnabled(False)
        self.completeChanged.emit()

    def onProfileComboChanged(self):
        self.completeChanged.emit()

    def initializePage(self):
        self.profileCombo.clear()
        for p in Profile.get_all():
            self.profileCombo.addItem(p.name, p)
        self.profileCombo.setCurrentIndex(-1)

    def validatePage(self):
        if self.field('database_profile_new'):
            return True

        selected_profile_name = self.field('database_profile_name')
        if not selected_profile_name:
            return False

        try:
            profile = Profile.get(selected_profile_name)
        except ProfileNotFoundError:
            return False
        else:
            if not profile.editable and self.field('database_profile_edit'):
                return False

        return True

    def isComplete(self):
        if self.validatePage():
            return super(DatabaseInfoWizardPage, self).isComplete()
        else:
            return False

    def nextId(self):
        if self.field('database_profile_new') or self.field('database_profile_edit'):
            return self.configPageId
        elif self.field('database_profile_select'):
            return self.setupPageId
        else:
            # Should not happen, unless none of the radio buttons are selected
            return self.setupPageId

class DatabaseProfileConfigWizardPage(BaseWizardPage):
    def __init__(self, parent=None):
        super(DatabaseProfileConfigWizardPage, self).__init__(parent)

        self.profileText = QtGui.QLineEdit(self)
        self.registerField('database_profile_new_name*', self.profileText)

        self.driverChoice = QtGui.QComboBox(self)
        self.driverChoice.setEditable(False)
        self.driverChoice.currentIndexChanged.connect(self.onDriverChoiceChanged)

        self.driverFormPanel = QtGui.QGroupBox(self)
        self.driverFormPanel.setCheckable(False)
        self.driverFormPanel.setFlat(False)

        self.driverFormTabs = QtGui.QTabWidget(self.driverFormPanel)
        self.driverFormTabs.setTabsClosable(False)
        self.driverFormTabs.tabBar().setVisible(False)

        self.driverForms = {}
        self.drivers = Driver.get_all()
        self.drivers.sort(key=lambda d: d.display)
        for driver in self.drivers:
            self.driverForms[driver.name] = form = DriverForm(driver, self)
            self.driverFormTabs.addTab(form, driver.display)
            self.driverChoice.addItem(driver.display)

        self.driverFormPanel.setTitle(self.drivers[0].display)

        panelLayout = QtGui.QVBoxLayout()
        panelLayout.addWidget(self.driverFormTabs)
        self.driverFormPanel.setLayout(panelLayout)

        layout = QtGui.QFormLayout()
        layout.addRow(cbpos.tr.config_("Profile Name"), self.profileText)
        layout.addRow(cbpos.tr.config_("Database Driver"), self.driverChoice)
        layout.addRow(self.driverFormPanel)

        self.setLayout(layout)

    def onDriverChoiceChanged(self, index):
        self.current_driver = self.drivers[index]
        self.driverFormPanel.setTitle(self.current_driver.display)
        self.driverForms[self.current_driver.name].clear()
        self.driverFormTabs.setCurrentIndex(index)

    def initializePage(self):
        selected_profile_name = self.field('database_profile_name')
        if not selected_profile_name:
            return

        # Fill the form with the selected profile
        try:
            profile = Profile.get(selected_profile_name)
        except ProfileNotFoundError:
            logger.debug("Profile named {} was not found".format(selected_profile_name))
            self.wizard().back()
        else:
            if not profile.editable:
                logger.debug("Profile named {} is not editable".format(selected_profile_name))
                self.wizard.back()

        index = self.drivers.index(profile.driver)
        self.driverChoice.setCurrentIndex(index)
        for form in self.driverForms.itervalues():
            form.clear()
        self.driverForms[self.current_driver.name].setProfile(profile)

        self.profileText.setText(selected_profile_name)

    def validatePage(self):
        selected_profile_name = self.field('database_profile_name')
        new_profile_name = self.field('database_profile_new_name')
        if selected_profile_name:
            try:
                selected_profile = Profile.get(selected_profile_name)
            except ProfileNotFoundError:
                logger.debug("Profile named {} was not found".format(selected_profile_name))
                return False
        else:
            selected_profile = None

        if new_profile_name == selected_profile_name:
            profile = selected_profile
        else:
            try:
                profile = Profile.get(new_profile_name)
            except ProfileNotFoundError:
                if selected_profile:
                    profile = selected_profile
                    profile.name = new_profile_name
                else:
                    profile = Profile(name=new_profile_name, driver=self.current_driver)
            except:
                raise
            else:
                QtGui.QMessageBox.information(self, 'New Database Profile',
                    "A profile with this name already exists. Choose another name.", QtGui.QMessageBox.Ok)
                return False

        self.driverForms[self.current_driver.name].save(profile)
        profile.use()

        return True

class DatabaseSetupWizardPage(BaseWizardPage):
    def __init__(self, parent=None):
        super(DatabaseSetupWizardPage, self).__init__(parent)

        dsw = DatabaseSetupWorker

        statesLayout = QtGui.QGridLayout()

        self.stateIcons = {}
        self.stateLabels = {}
        self.stateDetails = {}

        labels = {dsw.STATE_INIT: "Initialize database",
                  dsw.STATE_LOAD: "Load database",
                  dsw.STATE_CREATE: "Create models",
                  dsw.STATE_TEST: "Insert test data",
                  dsw.STATE_DONE: "Finished setting up database"
                  }

        for i, state in enumerate((dsw.STATE_INIT, dsw.STATE_LOAD, dsw.STATE_CREATE, dsw.STATE_TEST, dsw.STATE_DONE)):
            self.stateIcons[state] = icon = QtGui.QLabel(self)
            self.stateLabels[state] = label = QtGui.QLabel(labels[state], self)
            self.stateDetails[state] = details = QtGui.QLabel(self)
            self.stateDetails[state].setWordWrap(True)

            statesLayout.addWidget(icon, i, 0)
            statesLayout.addWidget(label, i, 1)
            statesLayout.addWidget(details, i, 2)

        statesLayout.setColumnStretch(0, 0)
        statesLayout.setColumnStretch(1, 0)
        statesLayout.setColumnStretch(2, 1)

        self.progress = QtGui.QProgressBar(self)
        self.progress.setRange(0, 100)
        self.progress.setTextVisible(True)

        self.questionBox = QtGui.QGroupBox(self)
        self.questionBox.hide()

        self.prompt = QtGui.QLabel(self.questionBox)

        self.buttonBox = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Yes |
                                                QtGui.QDialogButtonBox.No,
                                                QtCore.Qt.Horizontal,
                                                self.questionBox)

        self.buttonBox.accepted.connect(self.onPromptAccept)
        self.buttonBox.rejected.connect(self.onPromptReject)

        questionLayout = QtGui.QVBoxLayout()
        questionLayout.addWidget(self.prompt)
        questionLayout.addWidget(self.buttonBox)
        self.questionBox.setLayout(questionLayout)

        layout = QtGui.QVBoxLayout()
        layout.setSpacing(10)

        layout.addLayout(statesLayout)
        layout.addWidget(self.progress)
        layout.addStretch(1)
        layout.addWidget(self.questionBox)

        self.setLayout(layout)

        self.worker = None
        self.__error_occured = False

    def initializePage(self):
        # self.field('database_configure') does not matter
        self.worker = DatabaseSetupWorker()
        self.worker.start()

        self.worker.stateProgress.connect(self.onStateProgressSignal)
        self.worker.stateError.connect(self.onStateErrorSignal)

        self.worker.stateRun.emit(self.worker.STATE_INIT)

    def cleanupPage(self):
        self.worker.quit()
        self.worker.wait()
        # TODO: error when opening connection in a thread and closing it in another thread.
        # TODO: error when pressing back and coming back (looks like database tables are not cleared)

        for iconLbl in self.stateIcons.itervalues():
            iconLbl.setPixmap(None)

        for detailsLbl in self.stateDetails.itervalues():
            detailsLbl.setText("")

    def validatePage(self):
        if self.__error_occured:
            return False

        if self.worker.isRunning():
            return False

        return True

    def isComplete(self):
        if self.worker.isRunning():
            return False
        else:
            return super(DatabaseSetupWizardPage, self).isComplete()

    def onStateErrorSignal(self, state, exception):

        if state == self.worker.STATE_INIT:
            message = "Could not connect to database!"
        elif state == self.worker.STATE_LOAD:
            message = "Error loading models!"
        elif state == self.worker.STATE_CREATE:
            message = "Error creating tables!"
        elif state == self.worker.STATE_TEST:
            message = "Error inserting test values!"
        else:
            message = "An error occured!"

        self.__error_occured = True

        self.setMessage(state, -1, "{message}
{exception}".format(
                    message=message,
                    exception=str(exception)
        ))
        self.setProgress(self.worker.STATE_DONE, self.worker.DONE)
        self.worker.quit()

        self.completeChanged.emit()

    def onStateProgressSignal(self, state, progress):
        self.setProgress(state, progress)

        if state == self.worker.STATE_INIT:
            # First, connect to the database
            if progress == self.worker.START:
                self.setMessage(state, progress, "Connecting to database...")
            elif progress == self.worker.DONE:
                self.setMessage(state, progress, "Connected to database.")
                self.worker.stateRun.emit(self.worker.STATE_LOAD)
        elif state == self.worker.STATE_LOAD:
            # Second, load the models
            if progress == self.worker.START:
                self.setMessage(state, progress, "Loading models...")
            elif progress == self.worker.DONE:
                self.setMessage(state, progress, "Models loaded.")
                self.setPrompt(question="""Reconfigure Database?
This will drop the tables in the database you chose and recreate it.""",
                               onAccept=self.worker.STATE_CREATE,
                               onReject=self.worker.STATE_DONE
                               )
        elif state == self.worker.STATE_CREATE:
            # Third, create the tables
            if progress == self.worker.START:
                self.setMessage(state, progress, "Creating tables...")
            elif progress == self.worker.DONE:
                self.setMessage(state, progress, "Tables created.")
                self.setPrompt(question="""Insert test values?""",
                               onAccept=self.worker.STATE_TEST,
                               onReject=self.worker.STATE_DONE
                               )
        elif state == self.worker.STATE_TEST:
            # Fourth, insert the test values
            if progress == self.worker.START:
                self.setMessage(state, progress, "Inserting test values...")
            elif progress == self.worker.DONE:
                self.setMessage(state, progress, "Inserted test values.")
                self.worker.stateRun.emit(self.worker.STATE_DONE)
        elif state == self.worker.STATE_DONE and progress == self.worker.DONE:
            # Fifth, we are done
            self.setMessage(state, progress, "Done.")

        self.completeChanged.emit()

    def setPrompt(self, question, onAccept, onReject):
        self.questionBox.show()
        self.prompt.setText(question)

        self.__question_accept_callback = lambda sig=onAccept: self.worker.stateRun.emit(sig)
        self.__question_reject_callback = lambda sig=onReject: self.worker.stateRun.emit(sig)

    def onPromptAccept(self):
        self.__question_accept_callback()

        self.questionBox.hide()

    def onPromptReject(self):
        self.__question_reject_callback()

        self.questionBox.hide()

    def setMessage(self, state, stage, text):
        self.stateDetails[state].setText(text)
        if stage == self.worker.START:
            pass
        elif stage == self.worker.DONE:
            icon = QtGui.QIcon.fromTheme("dialog-ok-apply")
            pixmap = icon.pixmap(16, 16)
            self.stateIcons[state].setPixmap(pixmap)
        elif stage < self.worker.START:
            icon = QtGui.QIcon.fromTheme("dialog-close")
            pixmap = icon.pixmap(16, 16)
            self.stateIcons[state].setPixmap(pixmap)

    def setProgress(self, state, progress):
        self.progress.setValue((state - 1 + (progress/self.worker.DONE)) * 100.0 / self.worker.STATE_DONE)


text:
package com.plugtree.solrmeter.view.statistic;

import com.google.inject.Inject;
import com.plugtree.solrmeter.model.statistic.OperationTimeHistory;
import com.plugtree.solrmeter.view.HeadlessConsoleFrame;
import com.plugtree.solrmeter.view.HeadlessStatisticPanel;
import com.plugtree.solrmeter.view.HeadlessUtils;
import com.plugtree.solrmeter.view.I18n;
import com.plugtree.stressTestScope.StressTestScope;
import org.apache.commons.lang.StringUtils;

import java.util.*;

@StressTestScope
public class HeadlessOperationTimeLineChartPanel extends HeadlessStatisticPanel {

    private final String PREFIX = "statistic.operationTimeLineChartPanel.";
    private OperationTimeHistory statistic;

    @Inject
    public HeadlessOperationTimeLineChartPanel(OperationTimeHistory statistic) {
        super();
        this.statistic = statistic;
    }

    @Override
    public String getStatisticName() {
        return I18n.get(PREFIX + "title");
    }

    @Override
    public void refreshView() {
        Map<Long, Long> commitTime = statistic.getCommitTime();
        Map<Long, Long> queriesTime = statistic.getQueriesTime();
        Map<Long, Long> updatesTime = statistic.getUpdatesTime();
        Map<Long, Long> optimizeTime = statistic.getOptimizeTime();

        Set<Long> executionInstants = new TreeSet<Long>();
        executionInstants.addAll(commitTime.keySet());
        executionInstants.addAll(optimizeTime.keySet());
        executionInstants.addAll(queriesTime.keySet());
        executionInstants.addAll(updatesTime.keySet());

        ArrayList<String> lines = new ArrayList<String>();
        lines.add("execution instant\tcommits\tqueries\tupdates\toptimizes");
        for(long instant:executionInstants) {
            ArrayList<String> fields = new ArrayList<String>();
            fields.add(String.valueOf(instant/1000.0));
            fields.add(getFieldValue(instant, commitTime));
            fields.add(getFieldValue(instant, queriesTime));
            fields.add(getFieldValue(instant, updatesTime));
            fields.add(getFieldValue(instant, optimizeTime));
            lines.add(StringUtils.join(fields, "\t"));
        }
        HeadlessUtils.outputData(PREFIX + "title", HeadlessConsoleFrame.getStatisticsOutputDirectory(), lines);
    }

    private String getFieldValue(long executionInstant, Map<Long, Long> series) {
        String value = new String();
        if(series.containsKey(executionInstant)) {
            return String.valueOf(series.get(executionInstant));
        }
        else {
            return "-";
        }
    }
}


text:
package sample

import replicant._

class MockRequestQueue extends MockMinder[RequestQueue] { minder =>

  val mock: RequestQueue = new RequestQueue {
    def nextRequest: Option[Request] = minder.nextRequest()
  }

  val nextRequest = method("nextRequest", mock.nextRequest _)

}


text:
var places = ['estacao-da-luz', 'catedral-da-se', 'masp', 'ponte-estaiada'];
var index = 1;

var loop = setInterval(function(){
    $(".place").removeClass("current-place");
    $("."+places[index++]).addClass("current-place");

    index = index == places.length ? 0 : index;
}, 7000);


text:
package com.googlecode.aluminumproject.writers;

import com.googlecode.aluminumproject.AluminumException;

/**
 * A writer that decorates another writer.
 */
public interface DecorativeWriter extends Writer {
	/**
	 * Returns the underlying writer.
	 *
	 * @return the decorated writer (never {@code null})
	 */
	Writer getWriter();

	/**
	 * {@link #flush() Flushes} this writer and replaces the underlying writer.
	 *
	 * @param writer the underlying writer to use
	 * @throws AluminumException when this writer is closed or when the underlying writer can't be replaced
	 */
	void setWriter(Writer writer) throws AluminumException;
}


text:
package org.sakaiproject.tool.assessment.qti.util;
import java.util.Calendar;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.sakaiproject.tool.assessment.qti.exception.Iso8601FormatException;

/**
 * Based on ISO8601 Specification.
 *
 * @author Lance Speelmon
 * @version $Id$
 */
public class Iso8601TimeInterval
{
  private static Logger log = LoggerFactory.getLogger(Iso8601TimeInterval.class);
  private static final long SECONDS = 1000L;
  private static final long MINUTES = 60L * SECONDS;
  private static final long HOURS = 60L * MINUTES;
  private static final long DAYS = 24L * HOURS;
  private static final long WEEKS = 7L * DAYS;
  private static final long MONTHS = 30L * DAYS;
  private static final long YEARS = 365L * DAYS;

  //  i.e.: P2Y10M15DT10H30M20S
  private static final Pattern PATTERN =
    Pattern.compile(
      "-?P(?:(\\d*)Y)?(?:(\\d*)M)?(?:(\\d*)W)?(?:(\\d*)D)?T?(?:(\\d*)H)?(?:(\\d*)M)?(?:(\\d*)S)?");

  // one part of the interval has a fixed date/time
  private boolean bounded = false;
  private boolean recurring = false;
  private String iso8601TimeInterval;
  private Long duration;
  private Calendar begin;
  private Calendar end;
  private Integer years;
  private Integer months;
  private Integer weeks;
  private Integer days;
  private Integer hours;
  private Integer minutes;
  private Integer seconds;
  private boolean negative = false;

  /**
   * Creates a new Iso8601TimeInterval object.
   *
   * @param iso8601TimeInterval DOCUMENTATION PENDING
   *
   * @throws Iso8601FormatException DOCUMENTATION PENDING
   */
  public Iso8601TimeInterval(String iso8601TimeInterval)
    throws Iso8601FormatException
  {
    if(log.isDebugEnabled())
    {
      log.debug("new TimeInterval(String " + iso8601TimeInterval + ")");
    }

    this.iso8601TimeInterval = iso8601TimeInterval;
    this.duration =  Long.valueOf(parseLong(iso8601TimeInterval));
  }

  /**
   * Creates a new Iso8601TimeInterval object.
   *
   * @param ms DOCUMENTATION PENDING
   */
  public Iso8601TimeInterval(long ms)
  {
    if(log.isDebugEnabled())
    {
      log.debug("new Iso8601TimeInterval(long " + ms + ")");
    }

    this.duration =  Long.valueOf(ms);
  }

  /**
   * DOCUMENTATION PENDING
   *
   * @param iso8601TimeInterval DOCUMENTATION PENDING
   *
   * @return DOCUMENTATION PENDING
   *
   * @throws Iso8601FormatException DOCUMENTATION PENDING
   */
  private long parseLong(String iso8601TimeInterval)
    throws Iso8601FormatException
  {
    if(log.isDebugEnabled())
    {
      log.debug("parseLong(String " + iso8601TimeInterval + ")");
    }

    if(iso8601TimeInterval == null)
    {
      throw new Iso8601FormatException(
        "illegal String iso8601TimeInterval argument:  iso8601TimeInterval ==null");
    }

    iso8601TimeInterval = iso8601TimeInterval.toUpperCase();
    Matcher matcher = PATTERN.matcher(iso8601TimeInterval);
    if(matcher.matches())
    {
      if(iso8601TimeInterval.indexOf("-") == 0)
      {
        log.debug("negative = true");
        negative = true;
      }

      if(log.isDebugEnabled())
      {
        for(int i = 1; i <= matcher.groupCount(); i++)
        {
          log.debug("matcher.group(" + i + ")=" + matcher.group(i));
        }
      }

      String tmp = null;

      /* years */
      int years = 0;
      tmp = matcher.group(1);
      if(tmp != null)
      {
        years = Integer.parseInt(tmp);
        this.years = new Integer(tmp);
      }

      /* months */
      int months = 0;
      tmp = matcher.group(2);
      if(tmp != null)
      {
        this.months = new Integer(tmp);
        months = this.months.intValue();
      }

      /* weeks */
      int weeks = 0;
      tmp = matcher.group(3);
      if(tmp != null)
      {
        this.weeks = new Integer(tmp);
        weeks = this.weeks.intValue();
      }

      /* days */
      int days = 0;
      tmp = matcher.group(4);
      if(tmp != null)
      {
        this.days = new Integer(tmp);
        days = this.days.intValue();
      }

      /* hours */
      int hours = 0;
      tmp = matcher.group(5);
      if(tmp != null)
      {
        this.hours = new Integer(tmp);
        hours = this.hours.intValue();
      }

      /* minutes */
      int minutes = 0;
      tmp = matcher.group(6);
      if(tmp != null)
      {
        this.minutes = new Integer(tmp);
        minutes = this.minutes.intValue();
      }

      /* seconds */
      int seconds = 0;
      tmp = matcher.group(7);
      if(tmp != null)
      {
        this.seconds = new Integer(tmp);
        seconds = this.seconds.intValue();
      }

      if(log.isDebugEnabled())
      {
        log.debug(
          "years=" + years + ", months=" + months + ", weeks=" + weeks +
          ", days=" + days + ", hours=" + hours + ", minutes=" + minutes +
          ", seconds=" + seconds);
      }

      long durtmp =
        (years * YEARS) + (months * MONTHS) + (weeks * WEEKS) + (days * DAYS) +
        (hours * HOURS) + (minutes * MINUTES) + (seconds * SECONDS);
      if(negative)
      {
        return -durtmp;
      }
      else
      {
        return durtmp;
      }
    }
    else
    {
      throw new Iso8601FormatException(
        "Invalid ISO8601 format: " + iso8601TimeInterval);
    }
  }

  /**
   * DOCUMENTATION PENDING
   *
   * @return DOCUMENTATION PENDING
   */
  public boolean isBounded()
  {
    log.debug("isBounded()");

    //    return bounded;
    throw new UnsupportedOperationException();
  }

  /**
   * DOCUMENTATION PENDING
   *
   * @return DOCUMENTATION PENDING
   */
  public boolean isRecurring()
  {
    //    return recurring;
    throw new UnsupportedOperationException();
  }

  /**
   * DOCUMENTATION PENDING
   *
   * @return DOCUMENTATION PENDING
   */
  public long getDuration()
  {
    log.debug("getDuration()");

    return duration.longValue();
  }

  /**
   * DOCUMENTATION PENDING
   *
   * @return DOCUMENTATION PENDING
   */
  public Calendar getBegin()
  {
    throw new UnsupportedOperationException();

    //    return begin;
  }

  /**
   * DOCUMENTATION PENDING
   *
   * @return DOCUMENTATION PENDING
   */
  public Calendar getEnd()
  {
    throw new UnsupportedOperationException();

    //    return end;
  }

  /**
   * DOCUMENTATION PENDING
   *
   * @return DOCUMENTATION PENDING
   */
  public String toString()
  {
    if(this.iso8601TimeInterval == null)
    {
      this.createIso8601TimeInterval();
    }

    return this.iso8601TimeInterval;
  }

  /**
   * DOCUMENTATION PENDING
   */
  public void createString()
  {
    log.debug("regenerateString()");
    this.reset(); // clear any old bean properties
    this.createIso8601TimeInterval();
  }

  /**
   * DOCUMENTATION PENDING
   */
  private void createIso8601TimeInterval()
  {
    log.debug("createIso8601TimeInterval()");
    if(this.duration == null)
    {
      throw new IllegalStateException("duration is null!");
    }

    if(this.duration.longValue() < 0)
    {
      negative = true;
    }

    long remainder = this.duration.longValue();

    /* anything above weeks incurs a loss of precision */

    //    int years = (int)(remainder / YEARS);
    //    remainder %= YEARS;

    /* anything above weeks incurs a loss of precision */

    //    int months = (int)(remainder / MONTHS);
    //    remainder %= MONTHS;
    int weeks = (int) (remainder / WEEKS);
    remainder %= WEEKS;

    int days = (int) (remainder / DAYS);
    remainder %= DAYS;

    int hours = (int) (remainder / HOURS);
    remainder %= HOURS;

    int minutes = (int) (remainder / MINUTES);
    remainder %= MINUTES;

    int seconds = (int) (remainder / SECONDS);

    StringBuilder sb = new StringBuilder();
    if(negative)
    {
      sb.append("-");
    }

    sb.append("P");
    if(weeks != 0)
    {
      if(negative)
      {
        sb.append(-weeks);
        this.weeks =  Integer.valueOf(-weeks);
      }
      else
      {
        sb.append(weeks);
        this.weeks =  Integer.valueOf(weeks);
      }

      sb.append("W");
    }

    if(days != 0)
    {
      if(negative)
      {
        sb.append(-days);
        this.days = Integer.valueOf(-days);
      }
      else
      {
        sb.append(days);
        this.days = Integer.valueOf(days);
      }

      sb.append("D");
    }

    if((hours != 0) || (minutes != 0) || (seconds != 0))
    {
      sb.append("T");
      if(hours != 0)
      {
        if(negative)
        {
          sb.append(-hours);
          this.hours = Integer.valueOf(-hours);
        }
        else
        {
          sb.append(hours);
          this.hours = Integer.valueOf(hours);
        }

        sb.append("H");
      }

      if(minutes != 0)
      {
        if(negative)
        {
          sb.append(-minutes);
          this.minutes = Integer.valueOf(-minutes);
        }
        else
        {
          sb.append(minutes);
          this.minutes = Integer.valueOf(minutes);
        }

        sb.append("M");
      }

      if(seconds != 0)
      {
        if(negative)
        {
          sb.append(-seconds);
          this.seconds = Integer.valueOf(-seconds);
        }
        else
        {
          sb.append(seconds);
          this.seconds = Integer.valueOf(seconds);
        }

        sb.append("S");
      }
    }

    this.iso8601TimeInterval = sb.toString();
  }

  /**
   * DOCUMENTATION PENDING
   *
   * @param args DOCUMENTATION PENDING
   */
  public static void main(String[] args)
  {
    try
    {
      Iso8601TimeInterval ti = new Iso8601TimeInterval("-P2y10m15dT10H30M20S");

      //      Iso8601TimeInterval ti = new Iso8601TimeInterval("PT1S");
      //      Iso8601TimeInterval ti = new Iso8601TimeInterval("P6W");
      //      Iso8601TimeInterval ti = new Iso8601TimeInterval(null);
      long duration = ti.getDuration();
      log.debug("duration=" + duration);
      log.debug("weeks=" + ti.getWeeks());
      log.debug("days=" + ti.getDays());

      Iso8601TimeInterval t2 = new Iso8601TimeInterval(duration);
      log.debug("t2=" + t2);
      log.debug("t2.getWeeks()=" + t2.getWeeks());
      log.debug("t2.getHours()=" + t2.getHours());
    }
    catch(Iso8601FormatException ex)
    {
      log.error(ex.getMessage(), ex);
    }
  }

  /**
   * DOCUMENT ME!
   *
   * @return
   */
  public Integer getDays()
  {
    return days;
  }

  /**
   * DOCUMENT ME!
   *
   * @return
   */
  public Integer getHours()
  {
    return hours;
  }

  /**
   * DOCUMENT ME!
   *
   * @return
   */
  public Integer getMinutes()
  {
    return minutes;
  }

  /**
   * DOCUMENT ME!
   *
   * @return
   */
  public Integer getMonths()
  {
    return months;
  }

  /**
   * DOCUMENT ME!
   *
   * @return
   */
  public Integer getSeconds()
  {
    return seconds;
  }

  /**
   * DOCUMENT ME!
   *
   * @return
   */
  public Integer getWeeks()
  {
    return weeks;
  }

  /**
   * DOCUMENT ME!
   *
   * @return
   */
  public Integer getYears()
  {
    return years;
  }

  /**
   * DOCUMENTATION PENDING
   *
   * @return DOCUMENTATION PENDING
   */
  public boolean isNegative()
  {
    return this.negative;
  }

  /**
   * DOCUMENTATION PENDING
   */
  private void reset()
  {
    log.debug("reset()");
    this.years = null;
    this.months = null;
    this.weeks = null;
    this.days = null;
    this.hours = null;
    this.minutes = null;
    this.seconds = null;
    this.negative = false;
  }
}


text:
<!DOCTYPE html>

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

BMSPush Docs (90% documented)

        BMSPush Reference

        Response Extension Reference

            Classes

                BMSPushClient

                BMSPushUtils

            Enums

                IMFPushErrorvalues

            Extensions

                Response

Response

class Response

This is the extension of Response class in the BMSCore.

It is used to handle the responses from the push REST API calls.

Methods (Only for using in BMSPushClient)

                    subscriptions()

This methode will convert the response that get while calling the retrieveSubscriptionsWithCompletionHandler in `BMSPushClient’ class into an array of Tags and send to the Client app.

This will use the public property responseText in the Response Class.

Declaration

Swift

public func subscriptions() -> NSMutableArray

                    subscribeStatus()

This methode will convert the response that get while calling the subscribeToTags in `BMSPushClient’ class into an Dictionary of details and send to the Client app.

This will use the public property responseText in the Response Class.

Declaration

Swift

public func subscribeStatus() -> NSMutableDictionary

                    unsubscribeStatus()

This methode will convert the response that get while calling the unsubscribeFromTags in `BMSPushClient’ class into an Dictionary of details and send to the Client app.

This will use the public property responseText in the Response Class.

Declaration

Swift

public func unsubscribeStatus() -> NSMutableDictionary

                    availableTags()

This methode will convert the response that get while calling the retrieveAvailableTagsWithCompletionHandler in `BMSPushClient’ class into an array and send to the Client app.

This will use the public property responseText in the Response Class.

Declaration

Swift

public func availableTags() -> NSMutableArray

© 2016 IBM Bluemix Services Mobile SDK. All rights reserved. (Last updated: 2016-07-26)

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


text:
<?php declare(strict_types=1);
/**
 * This file is part of the CREY framework.
 * (c) 2016 Matthias Kaschubowski, All rights reserved.
 *
 * The applied license is stored at the root directory of this package.
 */

namespace Crey\Conjurer\Exceptions;

/**
 * Class NotFoundException
 *
 * @package crey.conjurer
 * @author Matthias Kaschubowski
 */
class NotFoundException extends \Exception
{

}


text:
namespace TravelShare.Web
{
    using System.Threading.Tasks;

    using Microsoft.AspNet.Identity;

    public class EmailService : IIdentityMessageService
    {
        public Task SendAsync(IdentityMessage message)
        {
            // Plug in your email service here to send an email.
            return Task.FromResult(0);
        }
    }
}


text:
package fr.paris10.projet.assogenda.assogenda.ui.activites;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import fr.paris10.projet.assogenda.assogenda.R;

public class MainEventActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main_event);

        Button agendaButton = (Button) findViewById(R.id.activity_main_calendar_button);
        agendaButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(view.getContext(), AgendaGeneratorActivity.class);
                startActivity(intent);
            }
        });

        Button listEventButton = (Button) findViewById(R.id.main_list_events_button);
        listEventButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(v.getContext(), ListEventsActivity.class);
                startActivity(intent);
            }
        });

        Button searchEventButton = (Button) findViewById(R.id.activity_main_event_research_button);
        searchEventButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(view.getContext(), EventResearchActivity.class);
                startActivity(intent);
            }
        });
    }
}


text:
        <title>Kanban - Ship</title>
        <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" integrity="sha256-7s5uDGW3AHqw6xtJmNNtr+OBRJUlgkNJEo78P4b0yRw= sha512-nNo+yCHEyn0smMxSswnf/OnX6/KwJuZTlNZBjauKhTK0c+zT+q5JOCx0UFhXQ6rJR9jg6Es8gPuD2uZcYDLqSw==" crossorigin="anonymous">
        <link href="https://cdnjs.cloudflare.com/ajax/libs/dragula/3.6.6/dragula.css">

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

                    </button>
                    Kanban