text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ChangeListManager">
    <list default="true" id="ad69fb85-1d12-4c00-9446-dc736246cc37" name="Default" comment="">
      <change beforePath="$PROJECT_DIR$/_posts/2014-08-20-app-review-wunderlist.markdown" afterPath="$PROJECT_DIR$/_posts/2014-08-20-app-review-wunderlist.markdown" />
      <change beforePath="$PROJECT_DIR$/_sass/main.scss" afterPath="$PROJECT_DIR$/_sass/main.scss" />
      <change beforePath="$PROJECT_DIR$/about.md" afterPath="$PROJECT_DIR$/about.md" />
    </list>
    <ignored path="$PROJECT_DIR$/.tmp/" />
    <ignored path="$PROJECT_DIR$/temp/" />
    <ignored path="$PROJECT_DIR$/tmp/" />
    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
    <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="FileEditorManager">
    <leaf>
      <file leaf-file-name="2018-07-23-using-custom-domain-with-github-pages.md" pinned="false" current-in-tab="true">
        <entry file="file://$PROJECT_DIR$/_posts/2018-07-23-using-custom-domain-with-github-pages.md">
          <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
            <state split_layout="SPLIT">
              <first_editor relative-caret-position="560">
                <caret line="39" column="114" lean-forward="false" selection-start-line="39" selection-start-column="114" selection-end-line="39" selection-end-column="114" />
                <folding />
              </first_editor>
              <second_editor />
            </state>
          </provider>
        </entry>
      </file>
    </leaf>
  </component>
  <component name="Git.Settings">
    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
  </component>
  <component name="IdeDocumentHistory">
    <option name="CHANGED_PATHS">
      <list>
        <option value="$PROJECT_DIR$/_posts/2018-07-23-using-custom-domain-with-github-pages.md" />
      </list>
    </option>
  </component>
  <component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
  <component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
  <component name="JsGulpfileManager">
    <detection-done>true</detection-done>
    <sorting>DEFINITION_ORDER</sorting>
  </component>
  <component name="NodeModulesDirectoryManager">
    <handled-path value="$PROJECT_DIR$/_site/node_modules" />
    <handled-path value="$PROJECT_DIR$/node_modules" />
  </component>
  <component name="ProjectFrameBounds" extendedState="6">
    <option name="y" value="22" />
    <option name="width" value="1280" />
    <option name="height" value="800" />
  </component>
  <component name="ProjectView">
    <navigator currentView="ProjectPane" proportions="" version="1">
      <flattenPackages />
      <showMembers />
      <showModules />
      <showLibraryContents />
      <hideEmptyPackages />
      <abbreviatePackageNames />
      <autoscrollToSource />
      <autoscrollFromSource />
      <sortByType />
      <manualOrder />
      <foldersAlwaysOnTop value="true" />
    </navigator>
    <panes>
      <pane id="ProjectPane">
        <subPane>
          <expand>
            <path>
              <item name="gaboratorium.github.io" type="b2602c69:ProjectViewProjectNode" />
              <item name="gaboratorium.github.io" type="462c0819:PsiDirectoryNode" />
            </path>
            <path>
              <item name="gaboratorium.github.io" type="b2602c69:ProjectViewProjectNode" />
              <item name="gaboratorium.github.io" type="462c0819:PsiDirectoryNode" />
              <item name="_posts" type="462c0819:PsiDirectoryNode" />
            </path>
          </expand>
          <select />
        </subPane>
      </pane>
      <pane id="Scope" />
      <pane id="Scratches" />
    </panes>
  </component>
  <component name="PropertiesComponent">
    <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
    <property name="WebServerToolWindowFactoryState" value="false" />
    <property name="last_opened_file_path" value="$PROJECT_DIR$" />
    <property name="HbShouldOpenHtmlAsHb" value="" />
    <property name="settings.editor.selected.configurable" value="preferences.editor" />
  </component>
  <component name="RunDashboard">
    <option name="ruleStates">
      <list>
        <RuleState>
          <option name="name" value="ConfigurationTypeDashboardGroupingRule" />
        </RuleState>
        <RuleState>
          <option name="name" value="StatusDashboardGroupingRule" />
        </RuleState>
      </list>
    </option>
  </component>
  <component name="ShelveChangesManager" show_recycled="false">
    <option name="remove_strategy" value="false" />
  </component>
  <component name="SvnConfiguration">
    <configuration />
  </component>
  <component name="TaskManager">
    <task active="true" id="Default" summary="Default task">
      <changelist id="ad69fb85-1d12-4c00-9446-dc736246cc37" name="Default" comment="" />
      <created>1532495508556</created>
      <option name="number" value="Default" />
      <option name="presentableId" value="Default" />
      <updated>1532495508556</updated>
      <workItem from="1532495511863" duration="199000" />
    </task>
    <servers />
  </component>
  <component name="TimeTrackingManager">
    <option name="totallyTimeSpent" value="199000" />
  </component>
  <component name="ToolWindowManager">
    <frame x="0" y="22" width="1440" height="878" extended-state="6" />
    <editor active="true" />
    <layout>
      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.22222222" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
      <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
      <window_info id="Docker" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
      <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" 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" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
      <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" 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" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
      <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
      <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
      <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" 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" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
    </layout>
  </component>
  <component name="TypeScriptGeneratedFilesManager">
    <option name="version" value="1" />
  </component>
  <component name="VcsContentAnnotationSettings">
    <option name="myLimit" value="2678400000" />
  </component>
  <component name="XDebuggerManager">
    <breakpoint-manager />
    <watches-manager />
  </component>
  <component name="editorHistoryManager">
    <entry file="file://$PROJECT_DIR$/_posts/2018-07-23-using-custom-domain-with-github-pages.md">
      <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
        <state split_layout="SPLIT">
          <first_editor relative-caret-position="560">
            <caret line="39" column="114" lean-forward="false" selection-start-line="39" selection-start-column="114" selection-end-line="39" selection-end-column="114" />
            <folding />
          </first_editor>
          <second_editor />
        </state>
      </provider>
    </entry>
  </component>
</project>

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0"?>
<test>
<setup>
  <channel name="test" file="exercise-23-packages.xml.gz"/>
</setup>
<trial>
  <install channel="test" package="A"/>
</trial>
</test>


text:
/* JavaScript content from worklight/plugins/org.apache.cordova.file/www/ProgressEvent.js in JS Resources */
cordova.define("org.apache.cordova.file.ProgressEvent", function(require, exports, module) {/*
 *
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 *
*/

// If ProgressEvent exists in global context, use it already, otherwise use our own polyfill
// Feature test: See if we can instantiate a native ProgressEvent;
// if so, use that approach,
// otherwise fill-in with our own implementation.
//
// NOTE: right now we always fill in with our own. Down the road would be nice if we can use whatever is native in the webview.
var ProgressEvent = (function() {
    /*
    var createEvent = function(data) {
        var event = document.createEvent('Events');
        event.initEvent('ProgressEvent', false, false);
        if (data) {
            for (var i in data) {
                if (data.hasOwnProperty(i)) {
                    event[i] = data[i];
                }
            }
            if (data.target) {
                // TODO: cannot call <some_custom_object>.dispatchEvent
                // need to first figure out how to implement EventTarget
            }
        }
        return event;
    };
    try {
        var ev = createEvent({type:"abort",target:document});
        return function ProgressEvent(type, data) {
            data.type = type;
            return createEvent(data);
        };
    } catch(e){
    */
        return function ProgressEvent(type, dict) {
            this.type = type;
            this.bubbles = false;
            this.cancelBubble = false;
            this.cancelable = false;
            this.lengthComputable = false;
            this.loaded = dict && dict.loaded ? dict.loaded : 0;
            this.total = dict && dict.total ? dict.total : 0;
            this.target = dict && dict.target ? dict.target : null;
        };
    //}
})();

module.exports = ProgressEvent;
});


text:
package com.maptrans.model.addresses;

import com.maptrans.core.GenericDTO;

public class LogradouroDTO extends GenericDTO {

	private String descricao;
	private String cep;
	private BairroDTO bairro;

	public String getDescricao() {
		return descricao;
	}

	public void setDescricao(String descricao) {
		this.descricao = descricao;
	}

	public String getCep() {
		return cep;
	}

	public void setCep(String cep) {
		this.cep = cep;
	}

	public BairroDTO getBairro() {
		return bairro;
	}

	public void setBairro(BairroDTO bairro) {
		this.bairro = bairro;
	}

	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("Logradouro [descricao=");
		builder.append(descricao);
		builder.append(", cep=");
		builder.append(cep);
		builder.append(", bairro=");
		builder.append(bairro);
		builder.append("]");
		return builder.toString();
	}

}


text:
<component name="libraryTable">
  <library name="azure-mobile-services-android-sdk-2.0.2-beta">
    <CLASSES>
      <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.microsoft.azure/azure-mobile-services-android-sdk/2.0.2-beta/a46288e0089b8e0b784135ed7d3d2db0329fc3c5/azure-mobile-services-android-sdk-2.0.2-beta.jar!/" />
    </CLASSES>
    <JAVADOC />
    <SOURCES>
      <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.microsoft.azure/azure-mobile-services-android-sdk/2.0.2-beta/e000dc1f6dadbe802784d63b364f563ec61b0ee6/azure-mobile-services-android-sdk-2.0.2-beta-sources.jar!/" />
    </SOURCES>
  </library>
</component>


text:
package ejb_generated;

import static javax.persistence.GenerationType.IDENTITY;
import static javax.persistence.CascadeType.ALL;
import javax.persistence.CascadeType;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Enumerated;
import javax.persistence.EnumType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.ManyToMany;
import javax.persistence.JoinTable;

   /**
   Class generated using Kroki EJBGenerator
   @Author KROKI Team
   Creation date: 06.06.2016  13:28:38h
   **/

@Entity
@Table(name = "C1_PROJECT_RESULT_PUBLICATION")
public class CfProj_ResPubl implements java.io.Serializable {

	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID", unique = true, nullable = false)
	protected java.lang.Long id;

	@Column(name = "cfStartDate", unique = false, nullable = false ,columnDefinition = "DATETIME")
	protected java.util.Date ka_start_date;
	@Column(name = "cfEndDate", unique = false, nullable = false ,columnDefinition = "DATETIME")
	protected java.util.Date ka_end_date;
	@Column(name = "cfFraction", unique = false, nullable = false ,columnDefinition = "FLOAT")
	protected java.math.BigDecimal ka_fraction;
	@Column(name = "cfCopyright", unique = false, nullable = false , length = 64, precision = 0,columnDefinition = "CHAR")
	protected java.lang.String ka_copyright;
	@ManyToOne
	@JoinColumn(name="cfproj_respubl_classification", referencedColumnName="ID",  nullable = true)
	protected CfClass cfproj_respubl_classification;
	@ManyToOne
	@JoinColumn(name="cfproj_respubl_resultPublication", referencedColumnName="ID",  nullable = true)
	protected CfResPubl cfproj_respubl_resultPublication;
	@ManyToOne
	@JoinColumn(name="cfproj_respubl_project", referencedColumnName="ID",  nullable = true)
	protected CfProj cfproj_respubl_project;

	public CfProj_ResPubl(){
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public java.util.Date getKa_start_date() {
		return this.ka_start_date;
	}

	public void setKa_start_date(java.util.Date ka_start_date) {
		this.ka_start_date = ka_start_date;
	}

	public java.util.Date getKa_end_date() {
		return this.ka_end_date;
	}

	public void setKa_end_date(java.util.Date ka_end_date) {
		this.ka_end_date = ka_end_date;
	}

	public java.math.BigDecimal getKa_fraction() {
		return this.ka_fraction;
	}

	public void setKa_fraction(java.math.BigDecimal ka_fraction) {
		this.ka_fraction = ka_fraction;
	}

	public java.lang.String getKa_copyright() {
		return this.ka_copyright;
	}

	public void setKa_copyright(java.lang.String ka_copyright) {
		this.ka_copyright = ka_copyright;
	}

	public CfClass getCfproj_respubl_classification() {
		return this.cfproj_respubl_classification;
	}

	public void setCfproj_respubl_classification(CfClass cfproj_respubl_classification) {
		this.cfproj_respubl_classification = cfproj_respubl_classification;
	}

	public CfResPubl getCfproj_respubl_resultPublication() {
		return this.cfproj_respubl_resultPublication;
	}

	public void setCfproj_respubl_resultPublication(CfResPubl cfproj_respubl_resultPublication) {
		this.cfproj_respubl_resultPublication = cfproj_respubl_resultPublication;
	}

	public CfProj getCfproj_respubl_project() {
		return this.cfproj_respubl_project;
	}

	public void setCfproj_respubl_project(CfProj cfproj_respubl_project) {
		this.cfproj_respubl_project = cfproj_respubl_project;
	}

}


text:
package com.ss.editor.ui.dialog.sky;

import com.ss.editor.model.undo.editor.ModelChangeConsumer;
import com.ss.editor.ui.control.tree.NodeTree;
import com.ss.editor.ui.control.tree.node.TreeNode;
import org.jetbrains.annotations.NotNull;

/**
 * The dialog to create sky using SS Sky Factory.
 *
 * @author JavaSaBr
 */
public class CreateEditableSkyDialog extends CreateSkyDialog {

    public CreateEditableSkyDialog(@NotNull final TreeNode<?> parentNode,
                                   @NotNull final NodeTree<ModelChangeConsumer> nodeTree) {
        super(parentNode, nodeTree);
    }

    @Override
    protected boolean isEditableSky() {
        return true;
    }
}


text:
require 'English'
require 'fileutils'

module Docker
  module Antivirus
    # Helpers Module
    module Helpers
      module_function

      def create_directory
        FileUtils.mkdir_p('/tmp/docker-antivirus')
        directory = Dir.mktmpdir(nil, '/tmp/docker-antivirus')
        puts "Creating #{directory}"
        directory
      end

      def atomic_mount(image, directory)
        puts "Mounting #{image} in #{directory}"
        system("atomic mount #{image} #{directory}")
      end

      def clamav_scan(image, directory)
        puts "Scanning #{image} in #{directory} with ClamAV"
        system("clamscan -r -i #{directory}")
      end

      def cleanup(directory, atomic = true)
        system("atomic umount #{directory}") if atomic
        FileUtils.rm_rf(directory.to_s)
        puts "#{directory} cleaned up"
      end
    end
  end
end


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Syn. meth. fung. (Göttingen) 2: 696 (1801)

#### Original name
Dematium strigosum var. arboreum Pers.

### Remarks
null


text:
package com.google.u2f.gaedemo.servlets;

import java.io.IOException;

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

import org.apache.commons.codec.DecoderException;
import org.apache.commons.codec.binary.Hex;

import com.google.appengine.api.users.User;
import com.google.appengine.api.users.UserService;
import com.google.appengine.api.users.UserServiceFactory;
import com.google.gson.JsonObject;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import com.google.u2f.U2FException;
import com.google.u2f.server.U2FServer;

@SuppressWarnings("serial")
@Singleton
public class RemoveTokenServlet extends HttpServlet {

    private final UserService userService =  UserServiceFactory.getUserService();
    private final U2FServer u2fServer;

    @Inject
    public RemoveTokenServlet(U2FServer u2fServer) {
      this.u2fServer = u2fServer;
    }

    public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException {
        User user = userService.getCurrentUser();
        String publicKey = req.getParameter("public_key");

        try {
          u2fServer.removeSecurityKey(user.getUserId(), Hex.decodeHex(publicKey.toCharArray()));
        } catch (U2FException e) {
          throw new ServletException("couldn't remove U2F token", e);
        } catch (DecoderException e) {
          throw new ServletException("invalid public key", e);
        }

        JsonObject result = new JsonObject();
        result.addProperty("status", "ok");

        resp.setContentType("application/json");
        resp.getWriter().println(result.toString());
    }
}


text:
require 'spec_helper'

describe CopyMove do
  dataset :pages, :users

  describe "suggesting a new slug and title" do
    it "should use the same slug and title when there is not a child page of the new parent that has the same slug or title" do
      pages(:first).new_slug_and_title_under(pages(:parent)).should == {:slug => "first", :title => "First", :breadcrumb => "First"}
    end

    it "should use a different slug and title when there is a conflicting child page of the new parent" do
      pages(:first).new_slug_and_title_under(pages(:home)).should_not == {:slug => "first", :title => "First"}
      pages(:first).new_slug_and_title_under(pages(:home)).should == {:slug => "first-copy-1", :title => "First Copy 1", :breadcrumb => "First Copy 1"}
    end
  end

  describe "moving under a new parent" do
    it "should refuse to move under itself" do
      lambda { pages(:first).move_under(pages(:first)) }.should raise_error(CopyMove::CircularHierarchy)
    end

    it "should refuse to move under a descendant of itself" do
      lambda { pages(:parent).move_under(pages(:child)) }.should raise_error(CopyMove::CircularHierarchy)
    end

    it "should move to a new parent" do
      @page = pages(:first)
      lambda { @page.move_under(pages(:another)) }.should_not raise_error
    end
  end

  describe "copying the page" do
    before :each do
      @page = pages(:first)
      UserActionObserver.current_user = users(:existing)
      @page.update_attribute(:created_by_id, user_id(:existing))
    end

    it "should duplicate the page" do
      @new_page = @page.copy_to(pages(:another))
      # adding :position to excluded attributes to temporarily accommodate reorder extension
      @page.attributes.delete_if {|k,v| [:id, :parent_id, :position].include?(k.to_sym) }.each do |key,value|
        @new_page[key].should == value
      end
      @page.parts.each do |part|
        @new_page.part(part.name).should_not be_nil
      end
    end

    it "should use a new slug and title if a similar page exists under the new parent" do
      @new_page = @page.copy_to(pages(:home))
      @new_page.slug.should_not == @page.slug
      @new_page.title.should_not == @page.title
    end

    it "should override the status when given" do
      @new_page = @page.copy_to(pages(:another), Status[:draft].id)
      @new_page.status.should == Status[:draft]
    end

    it "should ignore a blank status" do
      @new_page = @page.copy_to(pages(:another), '   ')
      @new_page.status.should == Status[:published]
    end
  end

  describe "copying the page with first-level children" do
    it "should copy the page and its children" do
      @page = pages(:parent)
      @new_page = @page.copy_with_children_to(pages(:first))
      @new_page.parent.should == pages(:first)
      @new_page.should have(3).children
    end

    it "should not copy grandchild pages" do
      @page = pages(:parent)
      @new_page = @page.copy_with_children_to(pages(:childless))
      @new_page.children.count.should == 3
      @new_page.children.first.children.count.should == 0
    end

    it "should override the status when given" do
      @page = pages(:parent)
      @new_page = @page.copy_with_children_to(pages(:first), Status[:hidden].id)
      @new_page.status.should == Status[:hidden]
      @new_page.children.each do |child|
        child.status.should == Status[:hidden]
      end
    end
  end

  describe "copying the page with all descendants" do
    before :each do
      @page = pages(:parent)
    end

    it "should copy the page and all descendants" do
      @new_page = @page.copy_tree_to(pages(:first))
      @new_page.parent.should == pages(:first)
      @new_page.should have(3).children
      @new_page.should have(pages(:parent).children.count).children
      @new_page.children.descendants.count.should == pages(:parent).children.descendants.count
    end

    it "should override the status when given" do
      @new_page = @page.copy_tree_to(pages(:first), Status[:hidden].id)
      @new_page.status.should == Status[:hidden]
      @new_page.children.each do |child|
        child.status.should == Status[:hidden]
        child.children.each do |grandchild|
          grandchild.status.should == Status[:hidden]
        end
      end
    end
  end
end


text:
package org.apache.camel.component.kafka;

import java.util.Map;

import org.apache.camel.CamelContext;
import org.apache.camel.SSLContextParametersAware;
import org.apache.camel.spi.Metadata;
import org.apache.camel.spi.annotations.Component;
import org.apache.camel.support.DefaultComponent;
import org.apache.camel.util.ObjectHelper;
import org.apache.camel.util.PropertiesHelper;

@Component("kafka")
public class KafkaComponent extends DefaultComponent implements SSLContextParametersAware {

    @Metadata
    private KafkaConfiguration configuration = new KafkaConfiguration();
    @Metadata(label = "security", defaultValue = "false")
    private boolean useGlobalSslContextParameters;
    @Metadata(autowired = true, label = "consumer,advanced")
    private KafkaManualCommitFactory kafkaManualCommitFactory;
    @Metadata(autowired = true, label = "advanced")
    private KafkaClientFactory kafkaClientFactory;
    @Metadata(autowired = true, label = "consumer,advanced")
    private PollExceptionStrategy pollExceptionStrategy;

    public KafkaComponent() {
    }

    public KafkaComponent(CamelContext context) {
        super(context);
    }

    @Override
    protected KafkaEndpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
        if (ObjectHelper.isEmpty(remaining)) {
            throw new IllegalArgumentException("Topic must be configured on endpoint using syntax kafka:topic");
        }

        // extract the endpoint additional properties map
        final Map<String, Object> endpointAdditionalProperties
                = PropertiesHelper.extractProperties(parameters, "additionalProperties.");

        KafkaEndpoint endpoint = new KafkaEndpoint(uri, this);

        KafkaConfiguration copy = getConfiguration().copy();
        endpoint.setConfiguration(copy);

        setProperties(endpoint, parameters);

        if (endpoint.getConfiguration().getSslContextParameters() == null) {
            endpoint.getConfiguration().setSslContextParameters(retrieveGlobalSslContextParameters());
        }

        // overwrite the additional properties from the endpoint
        if (!endpointAdditionalProperties.isEmpty()) {
            endpoint.getConfiguration().getAdditionalProperties().putAll(endpointAdditionalProperties);
        }

        // If a topic is not defined in the KafkaConfiguration (set as option parameter) but only in the uri,
        // it can happen that it is not set correctly in the configuration of the endpoint.
        // Therefore, the topic is added after setProperties method
        // and an null check to avoid overwriting a value from the configuration.
        if (endpoint.getConfiguration().getTopic() == null) {
            endpoint.getConfiguration().setTopic(remaining);
        }

        return endpoint;
    }

    public KafkaConfiguration getConfiguration() {
        return configuration;
    }

    /**
     * Allows to pre-configure the Kafka component with common options that the endpoints will reuse.
     */
    public void setConfiguration(KafkaConfiguration configuration) {
        this.configuration = configuration;
    }

    @Override
    public boolean isUseGlobalSslContextParameters() {
        return this.useGlobalSslContextParameters;
    }

    /**
     * Enable usage of global SSL context parameters.
     */
    @Override
    public void setUseGlobalSslContextParameters(boolean useGlobalSslContextParameters) {
        this.useGlobalSslContextParameters = useGlobalSslContextParameters;
    }

    public KafkaManualCommitFactory getKafkaManualCommitFactory() {
        return kafkaManualCommitFactory;
    }

    /**
     * Factory to use for creating {@link KafkaManualCommit} instances. This allows to plugin a custom factory to create
     * custom {@link KafkaManualCommit} instances in case special logic is needed when doing manual commits that
     * deviates from the default implementation that comes out of the box.
     */
    public void setKafkaManualCommitFactory(KafkaManualCommitFactory kafkaManualCommitFactory) {
        this.kafkaManualCommitFactory = kafkaManualCommitFactory;
    }

    public KafkaClientFactory getKafkaClientFactory() {
        return kafkaClientFactory;
    }

    /**
     * Factory to use for creating {@link org.apache.kafka.clients.consumer.KafkaConsumer} and
     * {@link org.apache.kafka.clients.producer.KafkaProducer} instances. This allows to configure a custom factory to
     * create instances with logic that extends the vanilla Kafka clients.
     */
    public void setKafkaClientFactory(KafkaClientFactory kafkaClientFactory) {
        this.kafkaClientFactory = kafkaClientFactory;
    }

    public PollExceptionStrategy getPollExceptionStrategy() {
        return pollExceptionStrategy;
    }

    /**
     * To use a custom strategy with the consumer to control how to handle exceptions thrown from the Kafka broker while
     * pooling messages.
     */
    public void setPollExceptionStrategy(PollExceptionStrategy pollExceptionStrategy) {
        this.pollExceptionStrategy = pollExceptionStrategy;
    }

    @Override
    protected void doInit() throws Exception {
        super.doInit();

        // if a factory was not autowired then create a default factory
        if (kafkaClientFactory == null) {
            kafkaClientFactory = new DefaultKafkaClientFactory();
        }
        if (kafkaManualCommitFactory == null) {
            kafkaManualCommitFactory = new DefaultKafkaManualCommitFactory();
        }
    }
}


text:
package com.dezorganizacja.bridge.view.graphical;

import javafx.event.ActionEvent;
import javafx.fxml.FXML;

public class BiddingController extends Controller {
   @FXML
    void endBidding(ActionEvent event) {
        presenter.setState("game");
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="420dp"
    android:layout_height="290dp"
    android:layout_marginLeft="10dp"
    android:layout_marginRight="10dp"
    android:background="@drawable/com_lenovo_pay_activity_detail_bg" >

    <TextView
        android:id="@+id/activity_title"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="36dp"
        android:layout_marginTop="35dp"
        android:layout_alignParentTop="true"
        android:text="活动详情"
        android:textColor="@color/com_lenovo_pay_title_text"
        android:textSize="24sp" />
    <View
        android:id="@+id/view_line"
        android:layout_width="fill_parent"
        android:layout_height="1dp"
        android:layout_marginLeft="20dp"
        android:layout_marginRight="25dp"
        android:layout_marginTop="6dp"
        android:layout_marginBottom="6dp"
        android:layout_below="@+id/activity_title"
        android:background="#ff6a26"
        />
    <TextView
        android:id="@+id/activity_content_title"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/view_line"
        android:layout_marginLeft="25dp"
        android:layout_marginBottom="12dp"
        android:text="V币充值返利活动规则:"
        android:textColor="#ffffff"
        android:textSize="16sp"/>
    <TextView
        android:id="@+id/activity_content_tv"
        android:layout_width="fill_parent"
        android:layout_height="100dp"
        android:layout_below="@+id/activity_content_title"
        android:layout_marginLeft="25dp"
        android:layout_marginRight="20dp"
        android:text="V币充值返利活动规则:adfasdfasdfasdfasdadfasdfasdfasdfasdfa\n11111111111\n222222222222\n33333333333333"
        android:singleLine="false"
        android:maxLines="6"
        android:scrollbars="vertical"
        android:textColor="#ffffff"
        android:textSize="16sp" />
       <View
        android:id="@+id/view_space1"
        android:layout_width="fill_parent"
        android:layout_below="@+id/activity_content_tv"
        android:layout_height="12dp"
        />
    <LinearLayout
        android:id="@+id/layout_btn"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/view_space1"
        android:layout_centerInParent="true"
        android:gravity="center"
        android:orientation="horizontal" >
        <Button
            android:id="@+id/charge_btn"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@drawable/com_lenovo_pay_activity_charge_btn_selector"
            android:text="@string/com_lenovo_pay_activity_charge_tv"
            android:textSize="16sp"
            android:textColor="#ffffff" />
        <View
        android:id="@+id/view_space"
        android:layout_width="40dp"
        android:layout_height="1dp"
        />

        <Button
            android:id="@+id/know_btn"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@drawable/com_lenovo_pay_activity_cancel_btn_selector"
            android:text="@string/com_lenovo_pay_activity_know_tv"
            android:textSize="16sp"
            android:textColor="#ffffff" />
    </LinearLayout>
       <View
        android:id="@+id/view_space2"
        android:layout_width="fill_parent"
        android:layout_below="@+id/layout_btn"
        android:layout_height="12dp"
        />
</RelativeLayout>


text:
layout: post
title: "What We Offer"
date: 2012-05-23
excerpt: "What We Offer"
tags: [sample post, readability, test, image, feature]
feature: http://i.imgur.com/Ds6S7lJ.png
the-club: true
comments: false
---

We are a very active club and offer a range of activities to suit your interests and abilities. We provide training from beginner to experienced diver levels. We also run multiple trips throughout the year, from day events to week-long expeditions. We especially encourage aspiring Dive Leaders to organise their own trips. Freediving is not one of the major activites of the club, however events are run on an one-off basis, providing there are enough people interested. We are also a friendly and sociable bunch! Our dedicated Events Manager runs most of our social events, including diving talks, boat pub crawls, trips, and much more! Anyone, however, can organise an event.

## Scuba Diving Training

We offer extensive training for SCUBA diving, anywhere from beginner to advanced diver levels. We teach using the standards of our diving agency BSAC. We provide training for the following qualifications:

*    Ocean Diver
*    Sports Diver
*    Dive Leader

Training is divided into classroom lectures and pool training, both of which are conveniently held in the Students' Union. At Easter we run a trip to Porthkerris (Cornwall) to complete the open water training. There are opportunities for additional open water training throughout the year, and this often involves weekend trips to quarries nearby.

In addition, we run Skills Development Courses (SDCs). These include:

*    Boat Handling
*    Oxygen Administration & Basic Life Support
*    Nitrox Blending

## Scuba Diving Trips

UBUC runs regular diving trips in the local region, as well as annual expeditions to the UK and abroad. Our frequent dive spots include:

*    Torquay
*    Brixham
*    Plymouth
*    Chesil Cove (Weymouth)
*    Porthkerris (Cornwall)
*    Skomer (Wales)
*    Cromhall, Chepstow & Vobster quarries

We also try to organise an annual expedition-type trip that focuses on diving rather than training. Our expedition trips have taken to Scotland, Skomer and the Farne Islands among other places. This trip usually takes place during the University's summer break

Finally, we also organise overseas trips on a one-off basis. These are generally more expensive, but they are worth it! In January 2014 and 2015 we travelled to the Red Sea, the divers' heaven. This year we are looking into running more trips abroad.
Freediving

Freediving courses are run on a one-off basis, usually once a year by inviting external instructors. Provided you have an AIDA 1* qualification (which can be obtained through attending the course) you can train during our normal training sessions with a buddy of similar qualification.

If you are interested in Freediving, contact the committee to find out more.

At the moment we do not organise exclusive freediving trips.

## Socials

Socials are just as important as diving and we regularly organise nights out as a club. We also run the infamous boat crawl each year, taking the boats down Bristol habour while sampling the bars along the way. Feel free to join us or put forward suggestions to our Social Secs.


text:
/*eslint-disable strict*/

'use strict';

var argv = require('minimist')(process.argv.slice(2));

var fs = require('fs');
var path = require('path');
var glob = require('glob');
var rimraf = require('rimraf');
var _ = require('lodash');

var webpack = require('webpack');

var gulp = require('gulp');
var gutil = require('gulp-util');
var shell = require('gulp-shell');
var runSequence = require('run-sequence');

var filter = require('gulp-filter');
var replace = require('gulp-replace');
var jison = require('gulp-jison');

var validateTranslations = require('./gulp/i18n').validate;
gulp.task('i18n:validate', function() {
  var tranlations = JSON.parse(fs.readFileSync('static/translations/core.json'));
  var locales = argv.locales ? argv.locales.split(',') : null;
  validateTranslations(tranlations, locales);
});

var seleniumProcess = null;
function shutdownSelenium() {
  if (seleniumProcess) {
    seleniumProcess.kill();
    seleniumProcess = null;
  }
}

var SELENIUM_VERSION = '2.45.0';
var SELENIUM_DRIVERS = {chrome: {version: '2.20'}};

gulp.task('selenium:fetch', function(cb) {
  var selenium = require('selenium-standalone');
  selenium.install({
    version: process.env.SELENIUM_VERSION || SELENIUM_VERSION,
    dirvers: SELENIUM_DRIVERS
  }, cb);
});

gulp.task('selenium', ['selenium:fetch'], function(cb) {
  var selenium = require('selenium-standalone');
  var port = process.env.SELENIUM_SERVER_PORT || 4444;
  selenium.start(
    {
      version: process.env.SELENIUM_VERSION || SELENIUM_VERSION,
      dirvers: SELENIUM_DRIVERS,
      seleniumArgs: ['--port', port],
      spawnOptions: {stdio: 'pipe'}
    },
    function(err, child) {
      if (err) throw err;
      child.on('exit', function() {
        if (seleniumProcess) {
          gutil.log(gutil.colors.yellow('Selenium process died unexpectedly. Probably port', port, 'is already in use.'));
        }
      });
      ['exit', 'uncaughtException', 'SIGTERM', 'SIGINT'].forEach(function(event) {
        process.on(event, shutdownSelenium);
      });
      seleniumProcess = child;
      cb();
    }
  );
});

gulp.task('karma', function(cb) {
  var Server = require('karma').Server;
  new Server({
    configFile: path.join(__dirname, '/karma.config.js'),
    browsers: [argv.browser || process.env.BROWSER || 'firefox']
  }, cb).start();
});

function runIntern(params) {
  return function() {
    var baseDir = 'static';
    var runner = './node_modules/.bin/intern-runner';
    var browser = argv.browser || process.env.BROWSER || 'firefox';
    var options = [['config', 'tests/functional/config/intern-' + browser + '.js']];
    var suiteOptions = [];
    ['suites', 'functionalSuites'].forEach(function(suiteType) {
      if (params[suiteType]) {
        var suiteFiles = glob.sync(path.relative(baseDir, params[suiteType]), {cwd: baseDir});
        suiteOptions = suiteOptions.concat(suiteFiles.map(function(suiteFile) {
          return [suiteType, suiteFile.replace(/\.js$/, '')];
        }));
      }
    });
    if (!suiteOptions.length) {
      throw new Error('No matching suites');
    }
    options = options.concat(suiteOptions);
    var command = [path.relative(baseDir, runner)].concat(options.map(function(o) {
      return o.join('=');
    })).join(' ');
    gutil.log('Executing', command);
    return shell.task(command, {cwd: baseDir})();
  };
}

gulp.task('intern:functional', runIntern({functionalSuites: argv.suites || 'static/tests/functional/**/test_*.js'}));

gulp.task('unit-tests', function(cb) {
  runSequence('selenium', 'karma', function(err) {
    shutdownSelenium();
    cb(err);
  });
});

gulp.task('functional-tests', function(cb) {
  runSequence('selenium', 'intern:functional', function(err) {
    shutdownSelenium();
    cb(err);
  });
});

gulp.task('jison', function() {
  return gulp.src('static/expression/parser.jison')
    .pipe(jison({moduleType: 'js'}))
    .pipe(gulp.dest('static/expression/'));
});

gulp.task('license', function(cb) {
  require('nlf').find({production: true, depth: 0}, function(err, data) {
    if (err) return cb(err);
    // https://github.com/openstack/requirements#for-new-requirements
    // Is the library license compatible?
    // Preferably Apache2, BSD, MIT licensed. LGPL is ok.
    var licenseRegexp = /(Apache.*?2)|\bBSD\b|\bMIT\b|\bLGPL\b/i;

    var errors = [];
    _.each(data, function(moduleInfo) {
      var name = moduleInfo.name;
      var version = moduleInfo.version;
      var license = _.pluck(moduleInfo.licenseSources.package.sources, 'license').join(', ') || 'unknown';
      var licenseOk = license.match(licenseRegexp);
      if (!licenseOk) errors.push({libraryName: name, license: license});
      gutil.log(
        gutil.colors.cyan(name),
        gutil.colors.yellow(version),
        gutil.colors[licenseOk ? 'green' : 'red'](license)
      );
    });
    if (errors.length) {
      _.each(errors, function(error) {
        gutil.log(gutil.colors.red(error.libraryName, 'has', error.license, 'license'));
      });
      return cb('Issues with licenses found');
    } else {
      return cb();
    }
  });
});

var jsFiles = [
  '*.js',
  'gulp/*.js',
  'static/**/*.js',
  '!static/build/**',
  '!static/vendor/**',
  '!static/expression/parser.js'
];
var styleFiles = [
  'static/**/*.less',
  'static/**/*.css',
  '!static/build/**'
];

gulp.task('eslint', function() {
  var eslint = require('gulp-eslint');
  return gulp.src(jsFiles)
    .pipe(eslint())
    .pipe(eslint.format())
    .pipe(eslint.failAfterError());
});

gulp.task('lintspaces:styles', function() {
  var lintspaces = require('gulp-lintspaces');
  return gulp.src(styleFiles)
    .pipe(lintspaces({
      showValid: true,
      newline: true,
      trailingspaces: true,
      indentation: 'spaces',
      ignores: ['js-comments'],
      spaces: 2,
      newlineMaximum: 2
    }))
    .pipe(lintspaces.reporter());
});

gulp.task('lint', [
  'eslint',
  'lintspaces:styles'
]);

var WEBPACK_STATS_OPTIONS = {
  colors: true,
  hash: false,
  version: false,
  assets: false,
  chunks: false
};

gulp.task('dev-server', function() {
  var devServerHost = argv['dev-server-host'] || '127.0.0.1';
  var devServerPort = argv['dev-server-port'] || 8080;
  var devServerUrl = 'http://' + devServerHost + ':' + devServerPort;
  var nailgunHost = argv['nailgun-host'] || '127.0.0.1';
  var nailgunPort = argv['nailgun-port'] || 8000;
  var nailgunUrl = 'http://' + nailgunHost + ':' + nailgunPort;
  var hotReload = !argv['no-hot'];

  var config = require('./webpack.config');
  config.entry.push('webpack-dev-server/client?' + devServerUrl);
  if (hotReload) {
    config.entry.push('webpack/hot/dev-server');
    config.plugins.push(new webpack.HotModuleReplacementPlugin());
    config.plugins.push(new webpack.NoErrorsPlugin());
  }

  var WebpackDevServer = require('webpack-dev-server');
  var options = {
    hot: hotReload,
    stats: WEBPACK_STATS_OPTIONS,
    proxy: [
      {path: '/', target: devServerUrl, rewrite: function(req) {
        req.url = '/static/index.html';
      }},
      {path: /^\/(?!static\/).+/, target: nailgunUrl}
    ]
  };
  _.extend(options, config.output);
  new WebpackDevServer(webpack(config), options).listen(devServerPort, devServerHost, function(err) {
    if (err) throw err;
    gutil.log('Development server started at ' + devServerUrl);
  });
});

gulp.task('build', function(cb) {
  var sourceDir = path.resolve('static');
  var targetDir = argv['static-dir'] ? path.resolve(argv['static-dir']) : sourceDir;

  var config = require('./webpack.config');
  config.output.path = path.join(targetDir, 'build');
  if (!argv.dev) {
    config.plugins.push(
      new webpack.DefinePlugin({'process.env': {NODE_ENV: '"production"'}})
    );
  }
  if (argv['extra-entries']) {
    config.entry = config.entry.concat(argv['extra-entries'].split(','));
  }

  if (argv.uglify !== false) {
    config.devtool = 'source-map';
    config.plugins.push(
      new webpack.optimize.UglifyJsPlugin({
        sourceMap: true,
        mangle: false,
        compress: {warnings: false}
      })
    );
  }
  if (argv.sourcemaps === false) {
    delete config.devtool;
  }
  if (argv.watch) {
    config.watch = true;
  }

  rimraf.sync(config.output.path);

  var compiler = webpack(config);
  var run = config.watch ? compiler.watch.bind(compiler, config.watchOptions) : compiler.run.bind(compiler);

  run(function(err, stats) {
    if (err) return cb(err);

    gutil.log(stats.toString(WEBPACK_STATS_OPTIONS));

    if (stats.hasErrors()) return cb('Build failed');

    if (targetDir != sourceDir) {
      var indexFilter = filter('index.html');
      gulp
        .src([
          'index.html',
          'favicon.ico',
          'img/loader-bg.svg',
          'img/loader-logo.svg',
          'styles/layout.css'
        ], {cwd: sourceDir, base: sourceDir})
        .pipe(indexFilter)
        .pipe(replace('__CACHE_BUST__', Date.now()))
        .pipe(indexFilter.restore())
        .pipe(gulp.dest(targetDir))
        .on('end', cb);
    } else if (!config.watch) {
      return cb();
    }
  });
});

gulp.task('default', ['build']);


text: <script src="/style/js/createTab.js"></script>;


text:
package ameba.db.ebean.migration;

import ameba.db.migration.models.ScriptInfo;
import io.ebean.plugin.SpiServer;
import io.ebeaninternal.dbmigration.DbOffline;
import io.ebeaninternal.dbmigration.DefaultDbMigration;
import io.ebeaninternal.dbmigration.ddlgeneration.DdlWrite;
import io.ebeaninternal.dbmigration.migration.Migration;
import io.ebeaninternal.dbmigration.model.CurrentModel;
import io.ebeaninternal.dbmigration.model.MConfiguration;
import io.ebeaninternal.dbmigration.model.ModelContainer;
import io.ebeaninternal.dbmigration.model.ModelDiff;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import java.io.File;
import java.io.IOException;
import java.io.StringWriter;

/**
 *
ModelMigration class.

 *
 * @author icode
 */
public class ModelMigration extends DefaultDbMigration {
    private static final String initialVersion = "1.0";
    private ModelDiff diff;
    private MigrationModel migrationModel;
    private CurrentModel currentModel;
    private ScriptInfo scriptInfo;

    /**
     *
diff.

     *
     * @return a {@link io.ebeaninternal.dbmigration.model.ModelDiff} object.
     */
    public ModelDiff diff() {
        if (diff != null) return diff;

        setOffline();

        setDefaults();

        try {
            migrationModel = new MigrationModel(server);
            ModelContainer migrated = migrationModel.read();

            currentModel = new CurrentModel(server, constraintNaming);
            ModelContainer current = currentModel.read();
            diff = new ModelDiff(migrated);
            diff.compareTo(current);
        } finally {
            if (!online) {
                DbOffline.reset();
            }
        }
        return diff;
    }

    private void setOffline() {
        if (!online) {
            DbOffline.setGenerateMigration();
            if (databasePlatform == null && !platforms.isEmpty()) {
                // for multiple platform generation set the general platform
                // to H2 so that it runs offline without DB connection
                setPlatform(platforms.get(0).platform);
            }
        }
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String generateMigration() throws IOException {
        if (scriptInfo != null) {
            return null;
        }
        if (diff == null) {
            diff();
        }

        setOffline();
        String version = null;
        try {
            if (diff.isEmpty()) {
                logger.info("no changes detected - no migration written");
                return null;
            }
            // there were actually changes to write
            Migration dbMigration = diff.getMigration();

            version = getVersion(migrationModel);
            logger.info("generating migration:{}", version);
            if (!writeMigration(dbMigration, version)) {
                logger.warn("migration already exists, not generating DDL");
            } else {
                if (databasePlatform != null) {
                    // writer needs the current model to provide table/column details for
                    // history ddl generation (triggers, history tables etc)
                    DdlWrite write = new DdlWrite(new MConfiguration(), currentModel.read());
                    PlatformDdlWriter writer = createDdlWriter();
                    writer.processMigration(dbMigration, write);
                }
            }
        } finally {
            if (!online) {
                DbOffline.reset();
            }
        }
        return null;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    protected void writeExtraPlatformDdl(String fullVersion, CurrentModel currentModel,
                                         Migration dbMigration, File writePath) throws IOException {
        throw new UnsupportedOperationException("writeExtraPlatformDdl Unsupported");
    }

    /**
     * {@inheritDoc}
     */
    protected boolean writeMigrationXml(Migration dbMigration, File resourcePath, String fullVersion) {
        throw new UnsupportedOperationException("writeExtraPlatformDdl Unsupported");
    }

    /**
     *
writeMigration.

     *
     * @param dbMigration a {@link io.ebeaninternal.dbmigration.migration.Migration} object.
     * @param version     a {@link java.lang.String} object.
     * @return a boolean.
     */
    protected boolean writeMigration(Migration dbMigration, String version) {
        if (migrationModel.isMigrationTableExist()) {
            scriptInfo = server.find(ScriptInfo.class, version);
            if (scriptInfo != null) {
                return false;
            }
        }
        scriptInfo = new ScriptInfo();
        scriptInfo.setRevision(version);
        try (StringWriter writer = new StringWriter()) {
            JAXBContext jaxbContext = JAXBContext.newInstance(Migration.class);
            Marshaller marshaller = jaxbContext.createMarshaller();
            marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
            marshaller.marshal(dbMigration, writer);
            writer.flush();
            scriptInfo.setModelDiff(writer.toString());
        } catch (JAXBException | IOException e) {
            throw new RuntimeException(e);
        }
        return true;
    }

    /**
     *
createDdlWriter.

     *
     * @return a {@link ameba.db.ebean.migration.PlatformDdlWriter} object.
     */
    protected PlatformDdlWriter createDdlWriter() {
        return new PlatformDdlWriter(scriptInfo, (SpiServer) server);
    }

    /**
     * Return the full version for the migration being generated.
     */
    private String getVersion(MigrationModel migrationModel) {

        String version = migrationConfig.getVersion();
        if (version == null) {
            version = migrationModel.getNextVersion(initialVersion);
        }

        return version;
    }

    /**
     *
rest.

     *
     * @return a {@link io.ebeaninternal.dbmigration.model.ModelDiff} object.
     */
    public ModelDiff rest() {
        ModelDiff old = diff;
        diff = null;
        migrationModel = null;
        currentModel = null;
        scriptInfo = null;
        return old;
    }

    /**
     *
Getter for the field scriptInfo.

     *
     * @return a {@link ameba.db.migration.models.ScriptInfo} object.
     */
    public ScriptInfo getScriptInfo() {
        return scriptInfo;
    }
}


text:
@implementation UserReceivedEventPayloadModel
+ (UserReceivedEventPayloadModel *)modelWithDict:(NSDictionary *)dict
{
    if (!dict) {
        return Nil;
    }

    UserReceivedEventPayloadModel *model = [[UserReceivedEventPayloadModel alloc]init];

    model.action = [dict objectForKey:@"action"] ;
    model.ref = [dict objectForKey:@"ref"] ;

    model.ref_type = [dict objectForKey:@"ref_type"] ;

    model.master_branch = [dict objectForKey:@"master_branch"] ;

    model.payloadDescription = [dict objectForKey:@"description"] ;

    model.pusher_type = [dict objectForKey:@"pusher_type"] ;

    NSDictionary *forkee=[dict objectForKey:@"forkee"];

    model.forkee=[RepositoryModel modelWithDict:forkee];

    return model;
}

@end


text:
package com.fangxuele.tool.push.ui.form.msg;

import com.fangxuele.tool.push.dao.TMsgSmsMapper;
import com.fangxuele.tool.push.domain.TMsgSms;
import com.fangxuele.tool.push.logic.MessageTypeEnum;
import com.fangxuele.tool.push.ui.form.MainWindow;
import com.fangxuele.tool.push.ui.form.MessageEditForm;
import com.fangxuele.tool.push.util.MybatisUtil;
import com.fangxuele.tool.push.util.SqliteUtil;
import com.intellij.uiDesigner.core.GridConstraints;
import com.intellij.uiDesigner.core.GridLayoutManager;
import lombok.Getter;

import javax.swing.*;
import javax.swing.border.TitledBorder;
import javax.swing.plaf.FontUIResource;
import javax.swing.text.StyleContext;
import java.awt.*;
import java.util.List;
import java.util.Locale;

/**
 *

 * YunpianMsgForm
 *

 *
 * @author Zhou Bo
 * @since 2019/6/3.
 */
@Getter
public class YunpianMsgForm implements IMsgForm {
    private JTextArea msgYunpianMsgContentTextField;
    private JPanel yunpianMsgPanel;

    private static YunpianMsgForm yunpianMsgForm;

    private static TMsgSmsMapper msgSmsMapper = MybatisUtil.getSqlSession().getMapper(TMsgSmsMapper.class);

    @Override
    public void init(String msgName) {
        clearAllField();
        List<TMsgSms> tMsgSmsList = msgSmsMapper.selectByMsgTypeAndMsgName(MessageTypeEnum.YUN_PIAN_CODE, msgName);
        if (tMsgSmsList.size() > 0) {
            TMsgSms tMsgSms = tMsgSmsList.get(0);
            getInstance().getMsgYunpianMsgContentTextField().setText(tMsgSms.getContent());

            MessageEditForm messageEditForm = MessageEditForm.getInstance();
            messageEditForm.getMsgNameField().setText(tMsgSms.getMsgName());
            messageEditForm.getPreviewUserField().setText(tMsgSms.getPreviewUser());
        }
    }

    @Override
    public void save(String msgName) {
        boolean existSameMsg = false;

        List<TMsgSms> tMsgSmsList = msgSmsMapper.selectByMsgTypeAndMsgName(MessageTypeEnum.YUN_PIAN_CODE, msgName);
        if (tMsgSmsList.size() > 0) {
            existSameMsg = true;
        }

        int isCover = JOptionPane.NO_OPTION;
        if (existSameMsg) {
            // 如果存在,是否覆盖
            isCover = JOptionPane.showConfirmDialog(MainWindow.getInstance().getMessagePanel(), "已经存在同名的历史消息,\n是否覆盖?", "确认",
                    JOptionPane.YES_NO_OPTION);
        }
        if (!existSameMsg || isCover == JOptionPane.YES_OPTION) {
            String yunpianMsgContent = getInstance().getMsgYunpianMsgContentTextField().getText();

            String now = SqliteUtil.nowDateForSqlite();

            TMsgSms tMsgSms = new TMsgSms();
            tMsgSms.setMsgType(MessageTypeEnum.YUN_PIAN_CODE);
            tMsgSms.setMsgName(msgName);
            tMsgSms.setContent(yunpianMsgContent);
            tMsgSms.setCreateTime(now);
            tMsgSms.setModifiedTime(now);

            MessageEditForm messageEditForm = MessageEditForm.getInstance();
            tMsgSms.setPreviewUser(messageEditForm.getPreviewUserField().getText());

            if (existSameMsg) {
                msgSmsMapper.updateByMsgTypeAndMsgName(tMsgSms);
            } else {
                msgSmsMapper.insertSelective(tMsgSms);
            }

            JOptionPane.showMessageDialog(MainWindow.getInstance().getMessagePanel(), "保存成功!", "成功",
                    JOptionPane.INFORMATION_MESSAGE);
        }
    }

    public static YunpianMsgForm getInstance() {
        if (yunpianMsgForm == null) {
            yunpianMsgForm = new YunpianMsgForm();
        }
        return yunpianMsgForm;
    }

    /**
     * 清空所有界面字段
     */
    public static void clearAllField() {
        getInstance().getMsgYunpianMsgContentTextField().setText("");
    }

    {
// GUI initializer generated by IntelliJ IDEA GUI Designer
// >>> IMPORTANT!! <<<
// DO NOT EDIT OR ADD ANY CODE HERE!
        $$$setupUI$$$();
    }

    /**
     * Method generated by IntelliJ IDEA GUI Designer
     * >>> IMPORTANT!! <<<
     * DO NOT edit this method OR call it in your code!
     *
     * @noinspection ALL
     */
    private void $$$setupUI$$$() {
        yunpianMsgPanel = new JPanel();
        yunpianMsgPanel.setLayout(new GridLayoutManager(1, 1, new Insets(10, 0, 0, 0), -1, -1));
        final JPanel panel1 = new JPanel();
        panel1.setLayout(new GridLayoutManager(1, 1, new Insets(10, 0, 0, 0), -1, -1));
        yunpianMsgPanel.add(panel1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
        panel1.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEmptyBorder(), "短信内容编辑", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, this.$$$getFont$$$(null, Font.BOLD, -1, panel1.getFont()), null));
        msgYunpianMsgContentTextField = new JTextArea();
        msgYunpianMsgContentTextField.setAutoscrolls(false);
        msgYunpianMsgContentTextField.setPreferredSize(new Dimension(0, 200));
        panel1.add(msgYunpianMsgContentTextField, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
    }

    /**
     * @noinspection ALL
     */
    private Font $$$getFont$$$(String fontName, int style, int size, Font currentFont) {
        if (currentFont == null) return null;
        String resultName;
        if (fontName == null) {
            resultName = currentFont.getName();
        } else {
            Font testFont = new Font(fontName, Font.PLAIN, 10);
            if (testFont.canDisplay('a') && testFont.canDisplay('1')) {
                resultName = fontName;
            } else {
                resultName = currentFont.getName();
            }
        }
        Font font = new Font(resultName, style >= 0 ? style : currentFont.getStyle(), size >= 0 ? size : currentFont.getSize());
        boolean isMac = System.getProperty("os.name", "").toLowerCase(Locale.ENGLISH).startsWith("mac");
        Font fontWithFallback = isMac ? new Font(font.getFamily(), font.getStyle(), font.getSize()) : new StyleContext().getFont(font.getFamily(), font.getStyle(), font.getSize());
        return fontWithFallback instanceof FontUIResource ? fontWithFallback : new FontUIResource(fontWithFallback);
    }

    /**
     * @noinspection ALL
     */
    public JComponent $$$getRootComponent$$$() {
        return yunpianMsgPanel;
    }

}


text:
package e2e

import (
	"fmt"

	federationapi "k8s.io/kubernetes/federation/apis/federation/v1beta1"
	"k8s.io/kubernetes/pkg/api/v1"
	"k8s.io/kubernetes/test/e2e/framework"
)

func createClusterObjectOrFail(f *framework.Framework, context *framework.E2EContext) {
	framework.Logf("Creating cluster object: %s (%s, secret: %s)", context.Name, context.Cluster.Cluster.Server, context.Name)
	cluster := federationapi.Cluster{
		ObjectMeta: v1.ObjectMeta{
			Name: context.Name,
		},
		Spec: federationapi.ClusterSpec{
			ServerAddressByClientCIDRs: []federationapi.ServerAddressByClientCIDR{
				{
					ClientCIDR:    "0.0.0.0/0",
					ServerAddress: context.Cluster.Cluster.Server,
				},
			},
			SecretRef: &v1.LocalObjectReference{
				// Note: Name must correlate with federation build script secret name,
				//       which currently matches the cluster name.
				//       See federation/cluster/common.sh:132
				Name: context.Name,
			},
		},
	}
	_, err := f.FederationClientset_1_4.Federation().Clusters().Create(&cluster)
	framework.ExpectNoError(err, fmt.Sprintf("creating cluster: %+v", err))
	framework.Logf("Successfully created cluster object: %s (%s, secret: %s)", context.Name, context.Cluster.Cluster.Server, context.Name)
}

func clusterIsReadyOrFail(f *framework.Framework, context *framework.E2EContext) {
	c, err := f.FederationClientset_1_4.Federation().Clusters().Get(context.Name)
	framework.ExpectNoError(err, fmt.Sprintf("get cluster: %+v", err))
	if c.ObjectMeta.Name != context.Name {
		framework.Failf("cluster name does not match input context: actual=%+v, expected=%+v", c, context)
	}
	err = isReady(context.Name, f.FederationClientset_1_4)
	framework.ExpectNoError(err, fmt.Sprintf("unexpected error in verifying if cluster %s is ready: %+v", context.Name, err))
	framework.Logf("Cluster %s is Ready", context.Name)
}


text:
using System.Data.Entity.ModelConfiguration;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace AdventureWorksModel.Mapping
{
    public class CultureMap : EntityTypeConfiguration<Culture>
    {
        public CultureMap()
        {
            // Primary Key
            HasKey(t => t.CultureID);

            // Properties
            Property(t => t.CultureID)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(6);

            Property(t => t.Name)
                .IsRequired()
                .HasMaxLength(50);

            // Table & Column Mappings
            ToTable("Culture", "Production");
            Property(t => t.CultureID).HasColumnName("CultureID");
            Property(t => t.Name).HasColumnName("Name");
            Property(t => t.ModifiedDate).HasColumnName("ModifiedDate").IsConcurrencyToken(false);
        }
    }

    public static partial class Mapper
    {
        public static void Map(this EntityTypeBuilder<Culture> builder)
        {
            builder.HasKey(t => t.CultureID);

            // Properties
            builder.Property(t => t.CultureID)
                   .IsRequired()
                   .IsFixedLength()
                   .HasMaxLength(6);

            builder.Property(t => t.Name)
                   .IsRequired()
                   .HasMaxLength(50);

            // Table & Column Mappings
            builder.ToTable("Culture", "Production");
            builder.Property(t => t.CultureID).HasColumnName("CultureID");
            builder.Property(t => t.Name).HasColumnName("Name");
            builder.Property(t => t.ModifiedDate).HasColumnName("ModifiedDate").IsConcurrencyToken(false);
        }
    }
}


text:
module.exports = function(bh) {

    bh.match({
        'dropdown' : function(ctx) {
            var dropdown = ctx.json();

            ctx
                .js(ctx.extend({ id : ctx.generateId() }, ctx.js()))
                .tParam('dropdown', dropdown)
                .tParam('popupId', ctx.generateId())
                .tParam('theme', ctx.mod('theme'))
                .tParam('mix', [dropdown].concat(
                    dropdown.switcher.mix || [],
                    dropdown.mix || []));

            return [{ elem : 'popup' }, { elem : 'switcher' }];
        },

        'dropdown__popup' : function(ctx) {
            var dropdown = ctx.tParam('dropdown'),
                popup = dropdown.popup;

            if(ctx.isSimple(popup) || popup.block !== 'popup') {
                popup = { block : 'popup', content : popup };
            }

            var popupMods = popup.mods || (popup.mods = {}),
                popupAttrs = popup.attrs || (popup.attrs = {});
            popupMods.theme || (popupMods.theme = ctx.tParam('theme'));
            popupMods.hasOwnProperty('autoclosable') || (popupMods.autoclosable = true);

            popupMods.target = 'anchor';
            popupAttrs.id = ctx.tParam('popupId');

            popup.mix = [dropdown].concat(popup.mix || []);

            return popup;
        },

        'dropdown__switcher' : function(ctx) {
            var dropdown = ctx.tParam('dropdown'),
                switcher = dropdown.switcher;

            switcher.block && (switcher.mix = ctx.tParam('mix'));

            return switcher;
        }
    });

};


text:
<?php

namespace craft\guestentries\migrations;

use Craft;
use craft\db\Migration;
use craft\db\Query;
use craft\helpers\Db;
use craft\helpers\Json;

/**
 * m181105_160000_craft_31_compatibility migration.
 */
class m181105_160000_craft_31_compatibility extends Migration
{
    /**
     * @inheritdoc
     */
    public function safeUp()
    {
        $projectConfig = Craft::$app->getProjectConfig();

        // Don't make the same config changes twice
        $schemaVersion = $projectConfig->get('plugins.guest-entries.schemaVersion', true);
        if (version_compare($schemaVersion, '2.1.0', '>=')) {
            return;
        }

        $sectionSettings = $projectConfig->get('plugins.guest-entries.settings.sections');
        $newSectionSettings = [];

        if (is_array($sectionSettings)) {
            $sectionMap = Db::uidsByIds('{{%sections}}', array_keys($sectionSettings));

            foreach ($sectionSettings as $sectionId => $settings) {
                if (isset($sectionMap[$sectionId]) && $uid = $sectionMap[$sectionId]) {
                    $settings['sectionUid'] = $uid;
                    $settings['authorUid'] = Db::uidById('{{%users}}', $settings['authorId']);
                    unset($settings['sectionId'], $settings['authorId']);
                    $newSectionSettings[$uid] = $settings;
                }
            }

            $sectionSettings = $projectConfig->set('plugins.guest-entries.settings.sections', $newSectionSettings);
        }
    }

    /**
     * @inheritdoc
     */
    public function safeDown()
    {
        echo "m181105_160000_craft_31_compatibility cannot be reverted.\n";
        return false;
    }
}


text:
package io.netty.buffer;

/**
 * A special {@link SlicedByteBuf} that can make optimizations because it knows the sliced buffer is of type
 * {@link AbstractByteBuf}.
 */
final class SlicedAbstractByteBuf extends SlicedByteBuf {

    SlicedAbstractByteBuf(AbstractByteBuf buffer, int index, int length) {
        super(buffer, index, length);
    }

    @Override
    public AbstractByteBuf unwrap() {
        return (AbstractByteBuf) super.unwrap();
    }

    @Override
    protected byte _getByte(int index) {
        return unwrap()._getByte(idx(index));
    }

    @Override
    protected short _getShort(int index) {
        return unwrap()._getShort(idx(index));
    }

    @Override
    protected short _getShortLE(int index) {
        return unwrap()._getShortLE(idx(index));
    }

    @Override
    protected int _getUnsignedMedium(int index) {
        return unwrap()._getUnsignedMedium(idx(index));
    }

    @Override
    protected int _getUnsignedMediumLE(int index) {
        return unwrap()._getUnsignedMediumLE(idx(index));
    }

    @Override
    protected int _getInt(int index) {
        return unwrap()._getInt(idx(index));
    }

    @Override
    protected int _getIntLE(int index) {
        return unwrap()._getIntLE(idx(index));
    }

    @Override
    protected long _getLong(int index) {
        return unwrap()._getLong(idx(index));
    }

    @Override
    protected long _getLongLE(int index) {
        return unwrap()._getLongLE(idx(index));
    }

    @Override
    protected void _setByte(int index, int value) {
        unwrap()._setByte(idx(index), value);
    }

    @Override
    protected void _setShort(int index, int value) {
        unwrap()._setShort(idx(index), value);
    }

    @Override
    protected void _setShortLE(int index, int value) {
        unwrap()._setShortLE(idx(index), value);
    }

    @Override
    protected void _setMedium(int index, int value) {
        unwrap()._setMedium(idx(index), value);
    }

    @Override
    protected void _setMediumLE(int index, int value) {
        unwrap()._setMediumLE(idx(index), value);
    }

    @Override
    protected void _setInt(int index, int value) {
        unwrap()._setInt(idx(index), value);
    }

    @Override
    protected void _setIntLE(int index, int value) {
        unwrap()._setIntLE(idx(index), value);
    }

    @Override
    protected void _setLong(int index, long value) {
        unwrap()._setLong(idx(index), value);
    }

    @Override
    protected void _setLongLE(int index, long value) {
        unwrap()._setLongLE(idx(index), value);
    }
}


text:
from .addressing import (
    parse_address,
    unparse_address,
    normalize_address,
    parse_host_port,
    unparse_host_port,
    resolve_address,
    get_address_host_port,
    get_address_host,
    get_local_address_for,
)
from .core import connect, listen, Comm, CommClosedError

def _register_transports():
    from . import inproc
    from . import tcp

    try:
        from . import ucx
    except ImportError:
        pass

_register_transports()


text:
package org.springframework.boot.autoconfigure.session;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.sql.init.DatabaseInitializationMode;
import org.springframework.session.FlushMode;
import org.springframework.session.SaveMode;

/**
 * Configuration properties for JDBC backed Spring Session.
 *
 * @author Vedran Pavic
 * @since 2.0.0
 */
@ConfigurationProperties(prefix = "spring.session.jdbc")
public class JdbcSessionProperties {

	private static final String DEFAULT_SCHEMA_LOCATION = "classpath:org/springframework/"
			+ "session/jdbc/schema-@@platform@@.sql";

	private static final String DEFAULT_TABLE_NAME = "SPRING_SESSION";

	private static final String DEFAULT_CLEANUP_CRON = "0 * * * * *";

	/**
	 * Path to the SQL file to use to initialize the database schema.
	 */
	private String schema = DEFAULT_SCHEMA_LOCATION;

	/**
	 * Platform to use in initialization scripts if the @@platform@@ placeholder is used.
	 * Auto-detected by default.
	 */
	private String platform;

	/**
	 * Name of the database table used to store sessions.
	 */
	private String tableName = DEFAULT_TABLE_NAME;

	/**
	 * Cron expression for expired session cleanup job.
	 */
	private String cleanupCron = DEFAULT_CLEANUP_CRON;

	/**
	 * Database schema initialization mode.
	 */
	private DatabaseInitializationMode initializeSchema = DatabaseInitializationMode.EMBEDDED;

	/**
	 * Sessions flush mode. Determines when session changes are written to the session
	 * store.
	 */
	private FlushMode flushMode = FlushMode.ON_SAVE;

	/**
	 * Sessions save mode. Determines how session changes are tracked and saved to the
	 * session store.
	 */
	private SaveMode saveMode = SaveMode.ON_SET_ATTRIBUTE;

	public String getSchema() {
		return this.schema;
	}

	public void setSchema(String schema) {
		this.schema = schema;
	}

	public String getPlatform() {
		return this.platform;
	}

	public void setPlatform(String platform) {
		this.platform = platform;
	}

	public String getTableName() {
		return this.tableName;
	}

	public void setTableName(String tableName) {
		this.tableName = tableName;
	}

	public String getCleanupCron() {
		return this.cleanupCron;
	}

	public void setCleanupCron(String cleanupCron) {
		this.cleanupCron = cleanupCron;
	}

	public DatabaseInitializationMode getInitializeSchema() {
		return this.initializeSchema;
	}

	public void setInitializeSchema(DatabaseInitializationMode initializeSchema) {
		this.initializeSchema = initializeSchema;
	}

	public FlushMode getFlushMode() {
		return this.flushMode;
	}

	public void setFlushMode(FlushMode flushMode) {
		this.flushMode = flushMode;
	}

	public SaveMode getSaveMode() {
		return this.saveMode;
	}

	public void setSaveMode(SaveMode saveMode) {
		this.saveMode = saveMode;
	}

}


text:
/**
 * Created by Administrator on 4/20/2016.
 */
///<reference path="../../../typings/browser.d.ts"/>

import {Menu, Icon} from 'antd'
import * as React from 'react'
import {Link} from 'react-router'
import {getMenu} from '../../redux/modules/menu'

interface props {
  menu:any,
  dispatch:Redux.Dispatch,
}
export default class CustomMenu extends React.Component<props, void> {
  constructor(props) {
    super(props);
  }

  componentWillMount() {
  };

  componentDidMount() {
    if(this.props.menu.get){}
    else{
    this.props.dispatch(getMenu())}
  }

  static processSingle(single, index) {
    return <Menu.Item key={single.key}><Link to={single.href}>{single.name}</Link></Menu.Item>
  };

  static processMultiChildren(single, index) {
    return <Menu.Item key={single.key}>
      <Link to={single.href}>{single.name}</Link>
    </Menu.Item>
  };

  static processMulti(multi, index) {
    return (<Menu.SubMenu title={multi.name} key={index+1}>
      {multi.children.map(CustomMenu.processMultiChildren)}
    </Menu.SubMenu>);
  };

  static process(inner, index) {
    if (inner.type === 'single') {
      return CustomMenu.processSingle(inner, index)
    } else {
      return CustomMenu.processMulti(inner, index)
    }
  }

  render() {
    const Item = Menu.Item;
    return (
      <Menu
        mode="inline"
      >
        {this.props.menu.items.map(CustomMenu.process)}
      </Menu>
    )
  }
}


text:
<template name="preregister">

HackRPI 2016

      Are you excited for HackRPI 2016 too? Join the club! And by "club", we
      mean mailing list. Let us know your name, email, and school, and you will
      be among the first notified for when registration opens for real. And by
      letting us know your school, you can help us plan buses!  Note: Please
      do not abbreviate the name of your school.

    <form class="prereg" action="">

        Name

        <input type="text" name="Name" placeholder="Name">

        Email

        <input type="text" name="Email" placeholder="Email">

        School

        <input type="text" class="typeahead" name="School" placeholder="School"
         autocomplete="off" data-source="schools">

        <button type="button" class="btn btn-default prereg">
          hype_train.board(self);</button>

    </form>

</template>


text:
using namespace std;
using namespace cpponfig;

TEST_CASE("property - swap") {
	SECTION("textual() is swapped", "[property] [swap]") {
		const auto first_txt = "KHQuvrWXJHUuonvIrEFVaCPEI";
		const auto second_txt = "slEedElkHCCUQjvJrKSJM";

		property first(first_txt);
		property second(second_txt);

		REQUIRE_NOTHROW(swap(first, second));

		REQUIRE(first.textual() == second_txt);
		REQUIRE(second.textual() == first_txt);
	}

	SECTION("comment is swapped", "[property] [swap]") {
		const auto first_cmt = "vxmEiZTHDYDalccawXLwzrprhaxw";
		const auto second_cmt = "WTevmstsxQAhFyPYLpgRdeIbFjZiic";

		property first("", first_cmt);
		property second("", second_cmt);

		REQUIRE_NOTHROW(swap(first, second));

		REQUIRE(first.comment == second_cmt);
		REQUIRE(second.comment == first_cmt);
	}
}


text:
lines = []
all_lines = open("salida.txt").readlines()
size = len(all_lines)
count = 0

# TODO: check that they're actually hidden
HIDDEN_METHODS = [
	'getAccessibilityNodeProvider',
	'getIteratorForGranularity',
	'getViewRootImpl',
	'getHardwareRenderer',
	'getDisplayList',
]

def generate_new_line(new_line):
	method_name, arguments = new_line.split('(')
	arguments, trailing    = arguments.split(')')

	new_arguments = []
	for argument in arguments.split(','):
		if argument.strip() != '':
			new_arguments.append(argument.split()[-1])

	return method_name + '(' + ', '.join(new_arguments) + ')' + trailing

while count < size:
	new_line = all_lines[count]

	if new_line.strip().endswith(')'):
		new_line = new_line.strip() + ' {\n'

	if (new_line.startswith('protected') or new_line.startswith('public')):
		return_type = new_line.split()[1]
		if return_type == 'void':
			return_code = ""
			end_sentence = ""
		else:
			native_types = { 'boolean' : 'Boolean', 'int' : 'Integer', 'float' : 'Float', 'long' : 'Long' }
			return_code = "return (%s)(" % native_types.get(return_type, return_type)
			end_sentence = ")"
		original_arguments = new_line.split('(')[1].split(')')[0]

		next_line = all_lines[count + 1].strip()
		next_line = generate_new_line(next_line)
		method_name, arguments = next_line.split('this.impl.')[1].split('(')

		if method_name in HIDDEN_METHODS:
			print "Skipping", method_name
			count += 4
			continue

		lines.append("/** Autogenerated code. Do not edit, but run the Python script again. */\n")
		lines.append(new_line)
		if len(original_arguments) > 0:
			arguments_parsed = [ [ i.strip() for i in arg.split() if i.strip() != 'final' ] for arg in original_arguments.split(',') ]
			full_list = []
			for arg_type, arg_name in arguments_parsed:
				if arg_type == 'int':
					full_list.append('Integer.TYPE')
				elif arg_type == 'boolean':
					full_list.append('Boolean.TYPE')
				else:
					full_list.append('%s.class' % arg_type)
			processed_args = ', '.join(full_list)
			arguments_before = arguments.split(';')[0]
			generation_code = '    %sgetMethodInParents("%s", %s).invoke(this.impl, %s%s;\n' % (return_code, method_name, processed_args, arguments_before, end_sentence)
		else:
			arguments_before = ""
			processed_args   = ""
			generation_code  = '    %sgetMethodInParents("%s").invoke(this.impl, (Object[])null)%s;\n' % (return_code, method_name, end_sentence)

		generation_code = (  """    if (this.impl == null) {\n""" +
				     """        registerCall("%s", new Class<?>[]{ %s } %s%s);\n""" % (method_name, processed_args, ', ' if len(arguments_before) > 0 else '', arguments_before.replace(')','')) +
				     """        %s\n""" % ('return;' if return_type == 'void' else '') +
				     """    }\n""" +
				     """    \n""" +
				     """    try {\n    """ +
				     generation_code +
				     """    } catch (Exception e) {\n""" +
				    ("""        throw new ProxyException("Error executing method '%s' of class '" + this.impl.getClass().getName() + "'. Message:" + e.getMessage(), e);\n""" % method_name) +
				     """    }\n """ )
		next_line = "/* reflection code for\n %s\n%s\n */\n" % (next_line, generation_code)
		next_line = generation_code
		lines.append(next_line)
		count += 2
		continue

	if 'this.impl.' in new_line:
		new_line = generate_new_line(new_line)

	lines.append(new_line)
	count += 1

salida = open('salida_pero_molando_edu.txt', 'w')
print >> salida, ''.join(lines)


text:
module Ricer::Plugin::Ricer
  class Plugbridge < Ricer::Plug::CoreEvent

    def on_notice
      # Every privmsg origins from a user
      @irc_message.user = create_user()
      # And maybe belongs to a channel
      @irc_message.channel = server.get_channel(@irc_message.args[0])
    end

    def on_privmsg
      # Every privmsg origins from a user
      @irc_message.user = create_user()

      # PRIVMSG always goto channel... unless it´s a query :)
      # So when loading channel from memory fails it´s a query :)
      @irc_message.channel = channel = server.get_channel(@irc_message.args[0])

      # Check if we got a triggered
      if channel.nil?
        triggered = true
        @irc_message.triggered = server.is_triggered?(@irc_message.triggerchar)
      else
        triggered = @irc_message.triggered = true if (channel != nil) && (channel.is_triggered?(@irc_message.triggerchar))
      end

      process_trigger if triggered && !flooding?(@irc_message.user)
    end

    private

    def flooding?(user)
      last = user.instance_variable_defined?(:@last_msg_time) ? user.instance_variable_get(:@last_msg_time) : 0.0
      now = Time.now.to_f
      elapsed = now - last
      if elapsed <= server.cooldown
        puts "FLOODING!!!"
        return true
      else
        user.instance_variable_set(:@last_msg_time, now)
        return false
      end
    end

  end
end


text:
package com.opengamma.collect.function;

import com.opengamma.collect.Unchecked;

/**
 * A checked version of {@code BinaryOperator}.
 * <p>
 * This is intended to be used with {@link Unchecked}.
 *
 * @param <T> the type of the object parameter
 */
@FunctionalInterface
public interface CheckedBinaryOperator<T> extends CheckedBiFunction<T, T, T> {

}