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

package com.google.gerrit.extensions.api.changes;

import com.google.common.collect.ImmutableListMultimap;
import com.google.common.collect.Sets;
import com.google.gerrit.common.Nullable;
import com.google.gerrit.extensions.client.ListChangesOption;
import com.google.gerrit.extensions.client.ReviewerState;
import com.google.gerrit.extensions.common.*;
import com.google.gerrit.extensions.restapi.NotImplementedException;
import com.google.gerrit.extensions.restapi.RestApiException;
import java.util.Arrays;
import java.util.EnumSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

public interface ChangeApi {
  String id();

  /**
   * Look up the current revision for the change.
   *
   *
Note: This method eagerly reads the revision. Methods that mutate the
   * revision do not necessarily re-read the revision. Therefore, calling a getter method on an
   * instance after calling a mutation method on that same instance is not guaranteed to reflect the
   * mutation. It is not recommended to store references to {@code RevisionApi} instances.
   *
   * @return API for accessing the revision.
   * @throws RestApiException if an error occurred.
   */
  default RevisionApi current() throws RestApiException {
    return revision("current");
  }

  /**
   * Look up a revision of a change by number.
   *
   * @see #current()
   */
  default RevisionApi revision(int id) throws RestApiException {
    return revision(Integer.toString(id));
  }

  /**
   * Look up a revision of a change by commit SHA-1 or other supported revision string.
   *
   * @see #current()
   */
  RevisionApi revision(String id) throws RestApiException;

  /**
   * Look up the reviewer of the change.
   *
   *

   *
   * @param id ID of the account, can be a string of the format "Full Name
   *     <mail@example.com>", just the email address, a full name if it is unique, an account
   *     ID, a user name or 'self' for the calling user.
   * @return API for accessing the reviewer.
   * @throws RestApiException if id is not account ID or is a user that isn't known to be a reviewer
   *     for this change.
   */
  ReviewerApi reviewer(String id) throws RestApiException;

  default void abandon() throws RestApiException {
    abandon(new AbandonInput());
  }

  void abandon(AbandonInput in) throws RestApiException;

  default void restore() throws RestApiException {
    restore(new RestoreInput());
  }

  void restore(RestoreInput in) throws RestApiException;

  default void move(String destination) throws RestApiException {
    MoveInput in = new MoveInput();
    in.destinationBranch = destination;
    move(in);
  }

  void move(MoveInput in) throws RestApiException;

  void setPrivate(boolean value, @Nullable String message) throws RestApiException;

  default void setPrivate(boolean value) throws RestApiException {
    setPrivate(value, null);
  }

  void setWorkInProgress(@Nullable String message) throws RestApiException;

  void setReadyForReview(@Nullable String message) throws RestApiException;

  default void setWorkInProgress() throws RestApiException {
    setWorkInProgress(null);
  }

  default void setReadyForReview() throws RestApiException {
    setReadyForReview(null);
  }

  /**
   * Ignore or un-ignore this change.
   *
   * @param ignore ignore the change if true
   */
  void ignore(boolean ignore) throws RestApiException;

  /**
   * Check if this change is ignored.
   *
   * @return true if the change is ignored
   */
  boolean ignored() throws RestApiException;

  /**
   * Mark this change as reviewed/unreviewed.
   *
   * @param reviewed flag to decide if this change should be marked as reviewed ({@code true}) or
   *     unreviewed ({@code false})
   */
  void markAsReviewed(boolean reviewed) throws RestApiException;

  /**
   * Create a new change that reverts this change.
   *
   * @see Changes#id(int)
   */
  default ChangeApi revert() throws RestApiException {
    return revert(new RevertInput());
  }

  /**
   * Create a new change that reverts this change.
   *
   * @see Changes#id(int)
   */
  ChangeApi revert(RevertInput in) throws RestApiException;

  default RevertSubmissionInfo revertSubmission() throws RestApiException {
    return revertSubmission(new RevertInput());
  }

  RevertSubmissionInfo revertSubmission(RevertInput in) throws RestApiException;

  /** Create a merge patch set for the change. */
  ChangeInfo createMergePatchSet(MergePatchSetInput in) throws RestApiException;

  default List<ChangeInfo> submittedTogether() throws RestApiException {
    SubmittedTogetherInfo info =
        submittedTogether(
            EnumSet.noneOf(ListChangesOption.class), EnumSet.noneOf(SubmittedTogetherOption.class));
    return info.changes;
  }

  default SubmittedTogetherInfo submittedTogether(EnumSet<SubmittedTogetherOption> options)
      throws RestApiException {
    return submittedTogether(EnumSet.noneOf(ListChangesOption.class), options);
  }

  SubmittedTogetherInfo submittedTogether(
      EnumSet<ListChangesOption> listOptions, EnumSet<SubmittedTogetherOption> submitOptions)
      throws RestApiException;

  /** Publishes a draft change. */
  @Deprecated
  void publish() throws RestApiException;

  /** Rebase the current revision of a change using default options. */
  default void rebase() throws RestApiException {
    rebase(new RebaseInput());
  }

  /** Rebase the current revision of a change. */
  void rebase(RebaseInput in) throws RestApiException;

  /** Deletes a change. */
  void delete() throws RestApiException;

  String topic() throws RestApiException;

  void topic(String topic) throws RestApiException;

  List<ReviewerInfo> listReviewers() throws RestApiException;

  IncludedInInfo includedIn() throws RestApiException;

  default AddReviewerResult addReviewer(String reviewer) throws RestApiException {
    AddReviewerInput in = new AddReviewerInput();
    in.reviewer = reviewer;
    return addReviewer(in);
  }

  AddReviewerResult addReviewer(AddReviewerInput in) throws RestApiException;

  SuggestedReviewersRequest suggestReviewers() throws RestApiException;

  default SuggestedReviewersRequest suggestReviewers(String query) throws RestApiException {
    return suggestReviewers().withQuery(query);
  }

  default SuggestedReviewersRequest suggestCcs(String query) throws RestApiException {
    return suggestReviewers().forCc().withQuery(query);
  }

  /**
   * Retrieve reviewers ({@code ReviewerState.REVIEWER} and {@code ReviewerState.CC}) on the change.
   */
  List<ReviewerInfo> reviewers() throws RestApiException;

  ChangeInfo get(
      EnumSet<ListChangesOption> options, ImmutableListMultimap<String, String> pluginOptions)
      throws RestApiException;

  default ChangeInfo get(ImmutableListMultimap<String, String> pluginOptions)
      throws RestApiException {
    return get(EnumSet.noneOf(ListChangesOption.class), pluginOptions);
  }

  default ChangeInfo get(EnumSet<ListChangesOption> options) throws RestApiException {
    return get(options, ImmutableListMultimap.of());
  }

  default ChangeInfo get(Iterable<ListChangesOption> options) throws RestApiException {
    return get(Sets.newEnumSet(options, ListChangesOption.class));
  }

  default ChangeInfo get(ListChangesOption... options) throws RestApiException {
    return get(Arrays.asList(options));
  }

  /**
   * {@link #get(ListChangesOption...)} with all options included, except for the following.
   *
   *

   *
{@code CHECK} is omitted, to skip consistency checks.
   *
{@code SKIP_DIFFSTAT} is omitted to ensure diffstat calculations.
   *

   */
  default ChangeInfo get() throws RestApiException {
    return get(
        EnumSet.complementOf(EnumSet.of(ListChangesOption.CHECK, ListChangesOption.SKIP_DIFFSTAT)));
  }

  /** {@link #get(ListChangesOption...)} with no options included. */
  default ChangeInfo info() throws RestApiException {
    return get(EnumSet.noneOf(ListChangesOption.class));
  }

  /**
   * Retrieve change edit when exists.
   *
   * @deprecated Replaced by {@link ChangeApi#edit()} in combination with {@link
   *     ChangeEditApi#get()}.
   */
  @Deprecated
  EditInfo getEdit() throws RestApiException;

  /**
   * Provides access to an API regarding the change edit of this change.
   *
   * @return a {@code ChangeEditApi} for the change edit of this change
   * @throws RestApiException if the API isn't accessible
   */
  ChangeEditApi edit() throws RestApiException;

  /** Create a new patch set with a new commit message. */
  default void setMessage(String message) throws RestApiException {
    CommitMessageInput in = new CommitMessageInput();
    in.message = message;
    setMessage(in);
  }

  /** Create a new patch set with a new commit message. */
  void setMessage(CommitMessageInput in) throws RestApiException;

  /** Set hashtags on a change */
  void setHashtags(HashtagsInput input) throws RestApiException;

  /**
   * Get hashtags on a change.
   *
   * @return hashtags
   * @throws RestApiException
   */
  Set<String> getHashtags() throws RestApiException;

  /**
   * Manage the attention set.
   *
   * @param id The account identifier.
   */
  AttentionSetApi attention(String id) throws RestApiException;

  /** Adds a user to the attention set. */
  AccountInfo addToAttentionSet(AttentionSetInput input) throws RestApiException;

  /** Set the assignee of a change. */
  AccountInfo setAssignee(AssigneeInput input) throws RestApiException;

  /** Get the assignee of a change. */
  AccountInfo getAssignee() throws RestApiException;

  /** Get all past assignees. */
  List<AccountInfo> getPastAssignees() throws RestApiException;

  /**
   * Delete the assignee of a change.
   *
   * @return the assignee that was deleted, or null if there was no assignee.
   */
  AccountInfo deleteAssignee() throws RestApiException;

  /**
   * Get all published comments on a change.
   *
   * @return comments in a map keyed by path; comments have the {@code revision} field set to
   *     indicate their patch set.
   * @throws RestApiException
   */
  Map<String, List<CommentInfo>> comments() throws RestApiException;

  /**
   * Get all published comments on a change as a list.
   *
   * @return comments as a list; comments have the {@code revision} field set to indicate their
   *     patch set.
   * @throws RestApiException
   */
  List<CommentInfo> commentsAsList() throws RestApiException;

  /**
   * Get all robot comments on a change.
   *
   * @return robot comments in a map keyed by path; robot comments have the {@code revision} field
   *     set to indicate their patch set.
   * @throws RestApiException
   */
  Map<String, List<RobotCommentInfo>> robotComments() throws RestApiException;

  /**
   * Get all draft comments for the current user on a change.
   *
   * @return drafts in a map keyed by path; comments have the {@code revision} field set to indicate
   *     their patch set.
   * @throws RestApiException
   */
  Map<String, List<CommentInfo>> drafts() throws RestApiException;

  /**
   * Get all draft comments for the current user on a change as a list.
   *
   * @return drafts as a list; comments have the {@code revision} field set to indicate their patch
   *     set.
   * @throws RestApiException
   */
  List<CommentInfo> draftsAsList() throws RestApiException;

  ChangeInfo check() throws RestApiException;

  ChangeInfo check(FixInput fix) throws RestApiException;

  void index() throws RestApiException;

  /** Check if this change is a pure revert of the change stored in revertOf. */
  PureRevertInfo pureRevert() throws RestApiException;

  /** Check if this change is a pure revert of claimedOriginal (SHA1 in 40 digit hex). */
  PureRevertInfo pureRevert(String claimedOriginal) throws RestApiException;

  /**
   * Get all messages of a change with detailed account info.
   *
   * @return a list of messages sorted by their creation time.
   * @throws RestApiException
   */
  List<ChangeMessageInfo> messages() throws RestApiException;

  /**
   * Look up a change message of a change by its id.
   *
   * @param id the id of the change message. In NoteDb, this id is the {@code ObjectId} of a commit
   *     on the change meta branch.
   * @return API for accessing a change message.
   * @throws RestApiException if the id is invalid.
   */
  ChangeMessageApi message(String id) throws RestApiException;

  abstract class SuggestedReviewersRequest {
    private String query;
    private int limit;
    private boolean excludeGroups;
    private ReviewerState reviewerState = ReviewerState.REVIEWER;

    public abstract List<SuggestedReviewerInfo> get() throws RestApiException;

    public SuggestedReviewersRequest withQuery(String query) {
      this.query = query;
      return this;
    }

    public SuggestedReviewersRequest withLimit(int limit) {
      this.limit = limit;
      return this;
    }

    public SuggestedReviewersRequest excludeGroups(boolean excludeGroups) {
      this.excludeGroups = excludeGroups;
      return this;
    }

    public SuggestedReviewersRequest forCc() {
      this.reviewerState = ReviewerState.CC;
      return this;
    }

    public String getQuery() {
      return query;
    }

    public int getLimit() {
      return limit;
    }

    public boolean getExcludeGroups() {
      return excludeGroups;
    }

    public ReviewerState getReviewerState() {
      return reviewerState;
    }
  }

  /**
   * A default implementation which allows source compatibility when adding new methods to the
   * interface.
   */
  class NotImplemented implements ChangeApi {
    @Override
    public String id() {
      throw new NotImplementedException();
    }

    @Override
    public ReviewerApi reviewer(String id) throws RestApiException {
      throw new NotImplementedException();
    }

    @Override
    public RevisionApi revision(String id) throws RestApiException {
      throw new NotImplementedException();
    }

    @Override
    public void abandon(AbandonInput in) throws RestApiException {
      throw new NotImplementedException();
    }

    @Override
    public void restore(RestoreInput in) throws RestApiException {
      throw new NotImplementedException();
    }

    @Override
    public void move(MoveInput in) throws RestApiException {
      throw new NotImplementedException();
    }

    @Override
    public void setPrivate(boolean value, @Nullable String message) throws RestApiException {
      throw new NotImplementedException();
    }

    @Override
    public void setWorkInProgress(String message) throws RestApiException {
      throw new NotImplementedException();
    }

    @Override
    public void setReadyForReview(String message) throws RestApiException {
      throw new NotImplementedException();
    }

    @Override
    public ChangeApi revert(RevertInput in) throws RestApiException {
      throw new NotImplementedException();
    }

    @Override
    public RevertSubmissionInfo revertSubmission(RevertInput in) throws RestApiException {
      throw new NotImplementedException();
    }

    @Override
    public void publish() throws RestApiException {
      throw new NotImplementedException();
    }

    @Override
    public void rebase(RebaseInput in) throws RestApiException {
      throw new NotImplementedException();
    }

    @Override
    public void delete() throws RestApiException {
      throw new NotImplementedException();
    }

    @Override
    public String topic() throws RestApiException {
      throw new NotImplementedException();
    }

    @Override
    public void topic(String topic) throws RestApiException {
      throw new NotImplementedException();
    }

    @Override
    public IncludedInInfo includedIn() throws RestApiException {
      throw new NotImplementedException();
    }

    @Override
    public List<ReviewerInfo> listReviewers() throws RestApiException {
      throw new NotImplementedException();
    }

    @Override
    public AddReviewerResult addReviewer(AddReviewerInput in) throws RestApiException {
      throw new NotImplementedException();
    }

    @Override
    public SuggestedReviewersRequest suggestReviewers() throws RestApiException {
      throw new NotImplementedException();
    }

    @Override
    public SuggestedReviewersRequest suggestReviewers(String query) throws RestApiException {
      throw new NotImplementedException();
    }

    @Override
    public List<ReviewerInfo> reviewers() throws RestApiException {
      throw new NotImplementedException();
    }

    @Override
    public ChangeInfo get(
        EnumSet<ListChangesOption> options, ImmutableListMultimap<String, String> pluginOptions)
        throws RestApiException {
      throw new NotImplementedException();
    }

    @Override
    public void setMessage(CommitMessageInput in) throws RestApiException {
      throw new NotImplementedException();
    }

    @Override
    public EditInfo getEdit() throws RestApiException {
      throw new NotImplementedException();
    }

    @Override
    public ChangeEditApi edit() throws RestApiException {
      throw new NotImplementedException();
    }

    @Override
    public void setHashtags(HashtagsInput input) throws RestApiException {
      throw new NotImplementedException();
    }

    @Override
    public Set<String> getHashtags() throws RestApiException {
      throw new NotImplementedException();
    }

    @Override
    public AttentionSetApi attention(String id) throws RestApiException {
      throw new NotImplementedException();
    }

    @Override
    public AccountInfo addToAttentionSet(AttentionSetInput input) throws RestApiException {
      throw new NotImplementedException();
    }

    @Override
    public AccountInfo setAssignee(AssigneeInput input) throws RestApiException {
      throw new NotImplementedException();
    }

    @Override
    public AccountInfo getAssignee() throws RestApiException {
      throw new NotImplementedException();
    }

    @Override
    public List<AccountInfo> getPastAssignees() throws RestApiException {
      throw new NotImplementedException();
    }

    @Override
    public AccountInfo deleteAssignee() throws RestApiException {
      throw new NotImplementedException();
    }

    @Override
    public Map<String, List<CommentInfo>> comments() throws RestApiException {
      throw new NotImplementedException();
    }

    @Override
    public List<CommentInfo> commentsAsList() throws RestApiException {
      throw new NotImplementedException();
    }

    @Override
    public Map<String, List<RobotCommentInfo>> robotComments() throws RestApiException {
      throw new NotImplementedException();
    }

    @Override
    public Map<String, List<CommentInfo>> drafts() throws RestApiException {
      throw new NotImplementedException();
    }

    @Override
    public List<CommentInfo> draftsAsList() throws RestApiException {
      throw new NotImplementedException();
    }

    @Override
    public ChangeInfo check() throws RestApiException {
      throw new NotImplementedException();
    }

    @Override
    public ChangeInfo check(FixInput fix) throws RestApiException {
      throw new NotImplementedException();
    }

    @Override
    public void index() throws RestApiException {
      throw new NotImplementedException();
    }

    @Override
    public List<ChangeInfo> submittedTogether() throws RestApiException {
      throw new NotImplementedException();
    }

    @Override
    public SubmittedTogetherInfo submittedTogether(EnumSet<SubmittedTogetherOption> options)
        throws RestApiException {
      throw new NotImplementedException();
    }

    @Override
    public SubmittedTogetherInfo submittedTogether(
        EnumSet<ListChangesOption> a, EnumSet<SubmittedTogetherOption> b) throws RestApiException {
      throw new NotImplementedException();
    }

    @Override
    public ChangeInfo createMergePatchSet(MergePatchSetInput in) throws RestApiException {
      throw new NotImplementedException();
    }

    @Override
    public void ignore(boolean ignore) throws RestApiException {
      throw new NotImplementedException();
    }

    @Override
    public boolean ignored() throws RestApiException {
      throw new NotImplementedException();
    }

    @Override
    public void markAsReviewed(boolean reviewed) throws RestApiException {
      throw new NotImplementedException();
    }

    @Override
    public PureRevertInfo pureRevert() throws RestApiException {
      throw new NotImplementedException();
    }

    @Override
    public PureRevertInfo pureRevert(String claimedOriginal) throws RestApiException {
      throw new NotImplementedException();
    }

    @Override
    public List<ChangeMessageInfo> messages() throws RestApiException {
      throw new NotImplementedException();
    }

    @Override
    public ChangeMessageApi message(String id) throws RestApiException {
      throw new NotImplementedException();
    }
  }
}


text:
layout: page
title: Fire Tech Inc. Seminar
date: 2016-05-24
author: Christine Schaefer
tags: weekly links, java
status: published
summary: Quisque sed dapibus justo. Donec dolor lectus.
banner: images/banner/leisure-05.jpg
booking:
  startDate: 09/28/2019
  endDate: 10/03/2019
  ctyhocn: BUFEAHX
  groupCode: FTIS
published: true
---
Nullam viverra mattis dui eu placerat. Suspendisse sagittis augue volutpat, pretium ipsum id, tristique dui. Suspendisse quis felis auctor, interdum turpis ac, imperdiet odio. Praesent laoreet sapien eget massa ullamcorper, quis accumsan felis congue. Praesent volutpat feugiat accumsan. Maecenas sed ultricies velit, ac tincidunt magna. Aliquam consequat vulputate libero, sit amet mollis sapien rhoncus id. Proin venenatis venenatis neque quis scelerisque. Cras eget ullamcorper ligula, quis imperdiet mi. Nullam posuere tincidunt urna, vel facilisis arcu rutrum nec. Quisque a lectus ligula. Donec finibus nisi ut tellus ultricies, a viverra nisl pulvinar. Donec congue ante sit amet tincidunt porta.

* Ut suscipit eros posuere neque tincidunt dignissim
* Aenean ac lacus vel nulla luctus aliquet
* Vestibulum ullamcorper lorem sed lobortis aliquam
* Mauris ac sapien consectetur, pulvinar arcu quis, ullamcorper ipsum.

Curabitur rutrum eget dui non ultrices. Aenean et ante ac quam dapibus efficitur. In turpis orci, pulvinar id est ut, viverra vestibulum mauris. Pellentesque volutpat et erat a molestie. Cras vehicula purus sit amet est porta, sit amet tristique nibh accumsan. Suspendisse justo purus, consequat sed massa ac, posuere fringilla ante. Nulla eleifend sapien vel ipsum congue sollicitudin. Aliquam est risus, maximus eu lacus eu, finibus facilisis nibh. Cras mollis diam justo, a pharetra nunc ornare nec.
Donec venenatis sed lectus sed volutpat. Nam varius leo a sapien vestibulum, vitae egestas diam efficitur. Fusce interdum sagittis felis vitae euismod. Proin ullamcorper orci id purus porttitor tempus. Nunc ac pellentesque nibh, sed pulvinar libero. Nullam consectetur, dolor eget tempus finibus, ligula ipsum elementum velit, ut ornare odio diam vitae risus. Sed sodales leo urna. Quisque non mollis quam. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Aliquam egestas fermentum nibh, eget convallis odio elementum et. Vivamus congue sapien sit amet pharetra molestie.

redpajama_set_name: RedPajamaGithub


text:
package com.cell.user.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/relation")
public class RoleResourcePermissionController {

}


text:
package com.atlassian.plugin.web.descriptors;

import java.util.List;
import java.util.Map;

import org.dom4j.Element;

import com.atlassian.plugin.Plugin;
import com.atlassian.plugin.PluginParseException;
import com.atlassian.plugin.StateAware;
import com.atlassian.plugin.elements.ResourceDescriptor;
import com.atlassian.plugin.elements.ResourceLocation;
import com.atlassian.plugin.web.Condition;
import com.atlassian.plugin.web.ContextProvider;
import com.atlassian.plugin.web.WebInterfaceManager;
import com.atlassian.plugin.web.model.WebLabel;
import com.atlassian.plugin.web.model.WebParam;

/**
 * Wrapper for {@link WebFragmentModuleDescriptor}, so that it could be extended
 * by application specific wrappers to provide additional methods.
 */
public class DefaultAbstractWebFragmentModuleDescriptor<T> implements StateAware, WebFragmentModuleDescriptor<T>
{
    private final WebFragmentModuleDescriptor<T> decoratedDescriptor;

    public DefaultAbstractWebFragmentModuleDescriptor(final WebFragmentModuleDescriptor<T> abstractDescriptor)
    {
        decoratedDescriptor = abstractDescriptor;
    }

    public void enabled()
    {
        decoratedDescriptor.enabled();
    }

    public void disabled()
    {
        decoratedDescriptor.disabled();
    }

    protected WebFragmentModuleDescriptor getDecoratedDescriptor()
    {
        return decoratedDescriptor;
    }

    public int getWeight()
    {
        return decoratedDescriptor.getWeight();
    }

    public String getKey()
    {
        return decoratedDescriptor.getKey();
    }

    public T getModule()
    {
        return null;
    }

    public String getI18nNameKey()
    {
        return decoratedDescriptor.getI18nNameKey();
    }

    public String getDescriptionKey()
    {
        return decoratedDescriptor.getDescriptionKey();
    }

    public Plugin getPlugin()
    {
        return decoratedDescriptor.getPlugin();
    }

    public WebLabel getWebLabel()
    {
        return decoratedDescriptor.getWebLabel();
    }

    public WebLabel getTooltip()
    {
        return decoratedDescriptor.getTooltip();
    }

    public void setWebInterfaceManager(final WebInterfaceManager webInterfaceManager)
    {
        // bit of a hack but it works :)
        if (decoratedDescriptor instanceof AbstractWebFragmentModuleDescriptor)
        {
            final AbstractWebFragmentModuleDescriptor abstractWebFragmentModuleDescriptor = (AbstractWebFragmentModuleDescriptor) decoratedDescriptor;
            abstractWebFragmentModuleDescriptor.setWebInterfaceManager(webInterfaceManager);
        }
    }

    public Condition getCondition()
    {
        return decoratedDescriptor.getCondition();
    }

    public ContextProvider getContextProvider()
    {
        return decoratedDescriptor.getContextProvider();
    }

    public WebParam getWebParams()
    {
        return decoratedDescriptor.getWebParams();
    }

    // -----------------------------------------------------------------------------------------
    // ModuleDescriptor methods
    public String getCompleteKey()
    {
        return decoratedDescriptor.getCompleteKey();
    }

    public String getPluginKey()
    {
        return decoratedDescriptor.getPluginKey();
    }

    public String getName()
    {
        return decoratedDescriptor.getName();
    }

    public String getDescription()
    {
        return decoratedDescriptor.getDescription();
    }

    public Class<T> getModuleClass()
    {
        return decoratedDescriptor.getModuleClass();
    }

    public void init(final Plugin plugin, final Element element) throws PluginParseException
    {
        decoratedDescriptor.init(plugin, element);
    }

    public boolean isEnabledByDefault()
    {
        return decoratedDescriptor.isEnabledByDefault();
    }

    public boolean isSystemModule()
    {
        return decoratedDescriptor.isSystemModule();
    }

    public void destroy(final Plugin plugin)
    {
        decoratedDescriptor.destroy(plugin);
    }

    public Float getMinJavaVersion()
    {
        return decoratedDescriptor.getMinJavaVersion();
    }

    public boolean satisfiesMinJavaVersion()
    {
        return decoratedDescriptor.satisfiesMinJavaVersion();
    }

    public Map<String, String> getParams()
    {
        return decoratedDescriptor.getParams();
    }

    // ------------------------------------------------------------------------------------------------
    // Resourced methods

    public List<ResourceDescriptor> getResourceDescriptors()
    {
        return decoratedDescriptor.getResourceDescriptors();
    }

    /**
     * @deprecated since 2.5.0 use {@link #getResourceDescriptors()} and filter
     *             as required
     */
    @Deprecated
    public List<ResourceDescriptor> getResourceDescriptors(final String type)
    {
        return decoratedDescriptor.getResourceDescriptors(type);
    }

    public ResourceLocation getResourceLocation(final String type, final String name)
    {
        return decoratedDescriptor.getResourceLocation(type, name);
    }

    public ResourceDescriptor getResourceDescriptor(final String type, final String name)
    {
        return decoratedDescriptor.getResourceDescriptor(type, name);
    }

    @Override
    public String toString()
    {
        return decoratedDescriptor.toString();
    }
}


text:
package org.strategoxt.lang.compat;

import static org.spoofax.interpreter.core.Tools.asJavaString;
import static org.spoofax.interpreter.core.Tools.isTermString;

import java.io.File;
import java.util.Map;
import java.util.WeakHashMap;

import org.spoofax.interpreter.terms.IStrategoTerm;
import org.spoofax.interpreter.terms.TermConverter;
import org.strategoxt.lang.Context;
import org.strategoxt.lang.WeakValueHashMap;
import org.strategoxt.stratego_lib.$Read$From$File_0_0;

/**
 * Reads terms from files with caching.
 *
 * @author Lennart Kats <lennart add lclnet.nl>
 */
public class ReadFromFile_cached_0_0 extends $Read$From$File_0_0 {

	/**
	 * The number of milliseconds leeway to give before deciding a file is out
	 * of date. This is needed because not every file system supports tracking
	 * the last modified time to the millisecond level. 2 seconds should
	 * even be good for FAT16.
	 */
	private static long FILE_TIME_GRANULARITY = 2001;

	private static volatile boolean isInited;

	private static Map<File, IStrategoTerm> asyncCache =
		new WeakValueHashMap<File, IStrategoTerm>();

	private static Map<IStrategoTerm, FileDate> asyncCacheDates =
		new WeakHashMap<IStrategoTerm, FileDate>();

	public static void init() {
		if (!isInited) {
			$Read$From$File_0_0.instance = new ReadFromFile_cached_0_0();
			isInited = true;
		}
	}

	@Override
	public IStrategoTerm invoke(Context context, IStrategoTerm term) {
		if (!isTermString(term))
			return super.invoke(context, term);

		File file = context.getIOAgent().openFile(asJavaString(term));
		if (!file.exists())
			return super.invoke(context, term);

		FileDate cachedDate = null;
		IStrategoTerm cachedTerm = null;

		long now = System.currentTimeMillis();
		long fileDate = file.lastModified();

		synchronized (asyncCache) {
			cachedTerm = asyncCache.get(file);
			if (cachedTerm != null)
				cachedDate = asyncCacheDates.get(cachedTerm);
		}

		if (now < fileDate + FILE_TIME_GRANULARITY) {
			// Date stamp too recent or in the future
			return super.invoke(context, term);
		} else if (cachedDate != null
				&& cachedDate.accessed > fileDate + FILE_TIME_GRANULARITY
				&& cachedDate.file.equals(file)) {

			cachedTerm = TermConverter.convert(context.getFactory(), cachedTerm);
			putCache(file, now, cachedTerm);
			return cachedTerm;
		} else {
			IStrategoTerm result = super.invoke(context, term);
			if (result != null) {
				putCache(file, now, result);
			}
			return result;
		}
	}

	private void putCache(File file, long now, IStrategoTerm result) {
		synchronized (asyncCache) {
			asyncCache.put(file, result);
			asyncCacheDates.put(result, new FileDate(file, now));
		}
	}

	/**
	 * @author Lennart Kats <lennart add lclnet.nl>
	 */
	private static class FileDate {
		final File file;
		final long accessed;

		FileDate(File file, long accessed) {
			this.file = file;
			this.accessed = accessed;
		}
	}
}


text:
'use strict';

let expect = require('chai').expect;

describe('getAuthorName', () => {
    let getAuthorName     = require('../lib/get-author-name');
    let getLastPageNumber = require('../lib/get-last-page-number');

    it('should return a string from of an array of authors', () => {
        let authors = [
            {fullname: 'J. Benner', initials: 'J.', organization: '', surname: 'Benner'},
            {fullname: 'T. Benner', initials: 'T.', organization: '', surname: 'Benner'},
            {fullname: 'A. Benner', initials: 'A.', organization: '', surname: 'Benner'}
        ];
        let control = 'J. Benner and T. Benner and A. Benner';

        expect(getAuthorName(authors)).to.equal(control);
    });

    it('should return a string from of an author object', () => {
        let author  = {fullname: 'J. Benner', initials: 'J.', organization: '', surname: 'Benner'};
        let control = 'J. Benner';

        expect(getAuthorName(author)).to.equal(control);
    });

    it('should parse "176" from "[Page 176]"', () => {
        let page = '[Page 176]';

        expect(getLastPageNumber(page)).to.equal(176);
    });
});


text:
/* $NetBSD: vidcvideo.c,v 1.44 2014/01/21 19:31:57 christos Exp $ */

/*
 * Copyright (c) 2001 Reinoud Zandijk
 * Copyright (c) 1998, 1999 Tohru Nishimura.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * Created vidcvideo.c from /dev/tc/cfb.c to fit the Acorn/ARM VIDC1 and VIDC20 chips
 *
 */

#include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */

__KERNEL_RCSID(0, "$NetBSD: vidcvideo.c,v 1.44 2014/01/21 19:31:57 christos Exp $");

#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/device.h>
#include <sys/malloc.h>
#include <sys/buf.h>
#include <sys/ioctl.h>

#include <arm/mainbus/mainbus.h>
#include <sys/bus.h>
#include <machine/intr.h>

#include <dev/wscons/wsconsio.h>
#include <dev/wscons/wsdisplayvar.h>

#include <dev/rasops/rasops.h>
#include <dev/wsfont/wsfont.h>

#include <dev/wscons/wsdisplay_vconsvar.h>

#include <uvm/uvm_extern.h>
#include <arm/arm32/pmap.h>
#include <arm/cpufunc.h>

/* for vidc_mode ... needs to be MI indepenent one day */
#include <arm/iomd/vidc.h>
#include <arm/iomd/vidc20config.h>
#include <arm/iomd/vidcvideo.h>
#include <machine/bootconfig.h>

/* FOR DEBUG */
extern videomemory_t videomemory;

struct hwcmap256 {
#define	CMAP_SIZE	256	/* 256 R/G/B entries */
	uint8_t r[CMAP_SIZE];
	uint8_t g[CMAP_SIZE];
	uint8_t b[CMAP_SIZE];
};

/* XXX for CURSOR_MAX_WIDTH = 32 */
struct hwcursor32 {
	struct wsdisplay_curpos cc_pos;
	struct wsdisplay_curpos cc_hot;
	struct wsdisplay_curpos cc_size;
	uint8_t cc_color[6];		/* how many? */
	uint32_t cc_image[(CURSOR_MAX_WIDTH/4) * CURSOR_MAX_HEIGHT];
	uint32_t cc_mask[(CURSOR_MAX_WIDTH/4) * CURSOR_MAX_HEIGHT];
};

struct fb_devconfig {
	vaddr_t dc_vaddr;		/* memory space virtual base address */
	paddr_t dc_paddr;		/* memory space physical base address */
	vsize_t dc_size;		/* size of slot memory */
	int	dc_width;		/* width of frame buffer */
	int	dc_height;		/* height of frame buffer */
	int	dc_log2_depth;		/* log2 of bits per pixel */
	int	dc_depth;		/* depth, bits per pixel */
	int	dc_rowbytes;		/* bytes in a FB scan line */
	vaddr_t	dc_videobase;		/* base of flat frame buffer */
	int	dc_blanked;		/* currently has video disabled */
	void   *dc_hwscroll_cookie;	/* cookie for hardware scroll */
	void   *dc_ih;			/* interrupt handler for dc */

	int	dc_curenb;		/* is cursor sprite enabled ?	*/
	int	_internal_dc_changed;	/* need update of hardware	*/
	int	dc_writeback_delay;	/* Screenarea write back vsync counter */
#define	WSDISPLAY_CMAP_DOLUT	0x20
#define WSDISPLAY_VIDEO_ONOFF	0x40
#define WSDISPLAY_WB_COUNTER	0x80

	struct hwcmap256	dc_cmap;   /* software copy of colormap	*/
	struct hwcursor32	dc_cursor; /* software copy of cursor	*/

	struct vidc_mode	mode_info;

	struct wsdisplay_emulops orig_ri_ops;	/* Rasops functions for deligation */

	/* virtual console support */
	struct vcons_data dc_vd;
	struct vcons_screen dc_console;
};

struct vidcvideo_softc {
	device_t sc_dev;
	struct fb_devconfig *sc_dc;	/* device configuration		*/
};

/* Function prototypes for glue */
static int  vidcvideo_match(device_t , cfdata_t , void *);
static void vidcvideo_attach(device_t , device_t , void *);

/* config glue */
CFATTACH_DECL_NEW(vidcvideo, sizeof(struct vidcvideo_softc),
    vidcvideo_match, vidcvideo_attach, NULL, NULL);

static struct fb_devconfig vidcvideo_console_dc;
static bool vidcvideo_is_console = false;

static struct wsscreen_descr vidcvideo_stdscreen = {
	"std", 0, 0,
	NULL, /* textops */
	8, 16,
	WSSCREEN_WSCOLORS | WSSCREEN_HILIT,
	NULL
};

static const struct wsscreen_descr *_vidcvideo_scrlist[] = {
	&vidcvideo_stdscreen,
};

static const struct wsscreen_list vidcvideo_screenlist = {
	sizeof(_vidcvideo_scrlist) / sizeof(struct wsscreen_descr *),
	_vidcvideo_scrlist
};

static int	vidcvideoioctl(void *, void *, u_long, void *, int,
    struct lwp *);
static paddr_t	vidcvideommap(void *, void *, off_t, int);
static void	vidcvideoinit_screen(void *, struct vcons_screen *, int, long *);

static void	vidcvideo_queue_dc_change(struct fb_devconfig*, int);
static int	flush_dc_changes_to_screen(struct fb_devconfig*);

static struct wsdisplay_accessops vidcvideo_accessops = {
	vidcvideoioctl,
	vidcvideommap,
	NULL,	/* alloc_screen */
	NULL,	/* free_screen */
	NULL,	/* show_screen */
	NULL,	/* load_font */
	NULL,	/* pollc */
	NULL	/* scroll */
};

/* Function prototypes */
int         vidcvideo_cnattach(vaddr_t);
static void vidcvideo_colourmap_and_cursor_init(struct fb_devconfig *);

static int  get_cmap(struct vidcvideo_softc *, struct wsdisplay_cmap *);
static int  set_cmap(struct vidcvideo_softc *, struct wsdisplay_cmap *);
static int  set_cursor(struct vidcvideo_softc *, struct wsdisplay_cursor *);
static int  get_cursor(struct vidcvideo_softc *, struct wsdisplay_cursor *);
static void set_curpos(struct vidcvideo_softc *, struct wsdisplay_curpos *);
static void vidcvideo_getdevconfig(vaddr_t, u_int, struct fb_devconfig *);

static int  vidcvideointr(void *);

/* Acceleration function prototypes */
static void vv_copyrows(void *, int, int, int);
static void vv_eraserows(void *, int, int, long);
static void vv_putchar(void *c, int row, int col, u_int uc, long attr);

static int
vidcvideo_match(device_t parent, cfdata_t match, void *aux)
{

	/* Can't probe AFAIK ; how ? */
	return 1;
}

static void
vidcvideo_getdevconfig(vaddr_t dense_addr, u_int mem_size,
		struct fb_devconfig *dc)
{

	dc->dc_vaddr = dense_addr;
	(void) pmap_extract(pmap_kernel(), dc->dc_vaddr, &(dc->dc_paddr));

	vidcvideo_getmode(&dc->mode_info);

	dc->dc_width = dc->mode_info.timings.hdisplay;
	dc->dc_height = dc->mode_info.timings.vdisplay;
	dc->dc_log2_depth = dc->mode_info.log2_bpp;
	dc->dc_depth = 1 << dc->dc_log2_depth;
	dc->dc_videobase = dc->dc_vaddr;
	dc->dc_blanked = 0;

	/* this should/could be done somewhat more elegant! */
	switch (dc->dc_depth) {
		case 1:
			dc->dc_rowbytes = dc->dc_width / 8;
			break;
		case 2:
			dc->dc_rowbytes = dc->dc_width / 4;
			break;
		case 4:
			dc->dc_rowbytes = dc->dc_width / 2;
			break;
		case 8:
			dc->dc_rowbytes = dc->dc_width;
			break;
		case 16:
			dc->dc_rowbytes = dc->dc_width * 2;
			break;
		case 32:
			dc->dc_rowbytes = dc->dc_width * 4;
			break;
		default:
			printf("Unknown colour depth %d ... what to do ?", dc->dc_depth);
			break;
	}

	/* setup the correct size */
	dc->dc_size = mem_size;

	/* initialize colormap and cursor resource */
	vidcvideo_colourmap_and_cursor_init(dc);

	/* blank the memory */
	memset((void*)dc->dc_vaddr, 0, dc->dc_size);

	/* intitialise miscelanious */
	dc->dc_writeback_delay = 0;
}

static void
vidcvideoinit_screen(void *cookie, struct vcons_screen *scr,
		    int existing, long *defattr)
{
	struct rasops_info *ri = &scr->scr_ri;
	struct fb_devconfig *dc = cookie;

	if ((scr == &dc->dc_console) && (dc->dc_vd.active != NULL))
		return;

	ri->ri_flg    = RI_NO_AUTO;	/* RI_CENTER | RI_FULLCLEAR; */
	ri->ri_depth  = dc->dc_depth;
	ri->ri_bits   = (void *) dc->dc_videobase;
	ri->ri_width  = dc->dc_width;
	ri->ri_height = dc->dc_height;
	ri->ri_stride = dc->dc_rowbytes;
	ri->ri_hw     = &dc->dc_console;	/* link back */

	rasops_init(ri,
	    ri->ri_height / 8,
	    ri->ri_width / 8);

	ri->ri_caps = WSSCREEN_WSCOLORS;

	rasops_reconfig(ri,
	    ri->ri_height / ri->ri_font->fontheight,
	    ri->ri_width / ri->ri_font->fontwidth);

	/*
	 * Provide a hook for the acceleration functions and make a copy of the
	 * original rasops functions for passing on calls
	 */
	memcpy(&(dc->orig_ri_ops), &(ri->ri_ops),
	    sizeof(struct wsdisplay_emulops));

	/* add our accelerated functions */
	ri->ri_ops.eraserows = vv_eraserows;
	ri->ri_ops.copyrows  = vv_copyrows;

	/* add the extra activity measuring functions; they just delegate on */
	ri->ri_ops.putchar   = vv_putchar;

	vidcvideo_stdscreen.nrows = ri->ri_rows;
	vidcvideo_stdscreen.ncols = ri->ri_cols;
	vidcvideo_stdscreen.textops = &ri->ri_ops;
	vidcvideo_stdscreen.capabilities = ri->ri_caps;
}

static void
vidcvideo_attach(device_t parent, device_t self, void *aux)
{
	struct vidcvideo_softc *sc = device_private(self);
	struct fb_devconfig *dc;
	struct wsemuldisplaydev_attach_args waa;
	long defattr;

	sc->sc_dev = self;

	dc = sc->sc_dc = &vidcvideo_console_dc;

	/*
	 * for reasons which are crazy we init vidcvideo twice,
	 * the second time sets up the cursor
	 */
	vidcvideo_init();
	if (!vidcvideo_is_console) {
		vidcvideo_getdevconfig(videomemory.vidm_vbase,
				videomemory.vidm_size,
			       	sc->sc_dc);
	}

	vcons_init(&dc->dc_vd, dc, &vidcvideo_stdscreen, &vidcvideo_accessops);
	dc->dc_vd.init_screen = vidcvideoinit_screen;

	vcons_init_screen(&dc->dc_vd, &dc->dc_console, 1, &defattr);

	dc->dc_console.scr_flags |= VCONS_SCREEN_IS_STATIC;

	vidcvideo_printdetails();
	aprint_normal(": mode %s, %dbpp\n", dc->mode_info.timings.name,
	    dc->dc_depth);

	/* set up interrupt flags */
	vidcvideo_queue_dc_change(dc, WSDISPLAY_CMAP_DOLUT);

	/* Establish an interrupt handler, and clear any pending interrupts */
	dc->dc_ih = intr_claim(IRQ_FLYBACK, IPL_TTY, "vblank", vidcvideointr, dc);

	waa.console = (vidcvideo_is_console ? 1 : 0);
	waa.scrdata = &vidcvideo_screenlist;
	waa.accessops = &vidcvideo_accessops;
	waa.accesscookie = &dc->dc_vd;

	config_found(self, &waa, wsemuldisplaydevprint);
}

static int
vidcvideoioctl(void *v, void *vs, u_long cmd, void *data, int flag,
    struct lwp *l)
{
	struct vcons_data *vd = v;
	struct vidcvideo_softc *sc = vd->cookie;
	struct fb_devconfig *dc = sc->sc_dc;
	struct vcons_screen *ms = vd->active;
	int state;

	switch (cmd) {
	case WSDISPLAYIO_GTYPE:
		*(u_int *)data = WSDISPLAY_TYPE_VIDC;
		return 0;

	case WSDISPLAYIO_GINFO:
		if (ms == NULL)
			return ENODEV;
#define	wsd_fbip ((struct wsdisplay_fbinfo *)data)
		wsd_fbip->height = dc->dc_height;
		wsd_fbip->width  = dc->dc_width;
		wsd_fbip->depth  = dc->dc_depth;
		wsd_fbip->cmsize = CMAP_SIZE;
#undef fbt
		return 0;

	case WSDISPLAYIO_GETCMAP:
		return get_cmap(sc, (struct wsdisplay_cmap *)data);

	case WSDISPLAYIO_PUTCMAP:
		return set_cmap(sc, (struct wsdisplay_cmap *)data);

	case WSDISPLAYIO_LINEBYTES:
		*(u_int *)data = dc->dc_rowbytes;
		return 0;

	case WSDISPLAYIO_SVIDEO:
		state = *(int *)data;
		dc->dc_blanked = (state == WSDISPLAYIO_VIDEO_OFF);
		vidcvideo_queue_dc_change(dc, WSDISPLAY_VIDEO_ONOFF);
		/* done on video blank */
		return 0;

	case WSDISPLAYIO_GVIDEO:
		*(u_int *)data = dc->dc_blanked ?
		    WSDISPLAYIO_VIDEO_OFF : WSDISPLAYIO_VIDEO_ON;
		return 0;

	case WSDISPLAYIO_GCURPOS:
		*(struct wsdisplay_curpos *)data = dc->dc_cursor.cc_pos;
		return 0;

	case WSDISPLAYIO_SCURPOS:
		set_curpos(sc, (struct wsdisplay_curpos *)data);
		vidcvideo_queue_dc_change(dc, WSDISPLAY_CURSOR_DOPOS);
		return 0;

	case WSDISPLAYIO_GCURMAX:
		((struct wsdisplay_curpos *)data)->x = CURSOR_MAX_WIDTH;
		((struct wsdisplay_curpos *)data)->y = CURSOR_MAX_HEIGHT;
		return 0;

	case WSDISPLAYIO_GCURSOR:
		return get_cursor(sc, (struct wsdisplay_cursor *)data);

	case WSDISPLAYIO_SCURSOR:
		return set_cursor(sc, (struct wsdisplay_cursor *)data);

	case WSDISPLAYIO_SMODE:
		state = *(int *)data;
		if (state == WSDISPLAYIO_MODE_MAPPED)
			dc->dc_hwscroll_cookie = vidcvideo_hwscroll_reset();
		if (state == WSDISPLAYIO_MODE_EMUL)
			vidcvideo_hwscroll_back(dc->dc_hwscroll_cookie);
		vidcvideo_progr_scroll();

		return 0;
	}
	return EPASSTHROUGH;
}

paddr_t
vidcvideommap(void *v, void *vs, off_t offset, int prot)
{
	struct vcons_data *vd = v;
	struct vidcvideo_softc *sc = vd->cookie;

	if (offset >= sc->sc_dc->dc_size || offset < 0)
		return -1;

	return arm_btop(sc->sc_dc->dc_paddr + offset);
}

/* EXPORT */ int
vidcvideo_cnattach(vaddr_t addr)
{
	struct fb_devconfig *dc = &vidcvideo_console_dc;
	struct rasops_info *ri;
	long defattr;

	vidcvideo_init();

	/* fetch current framebuffer config */
	vidcvideo_getdevconfig(videomemory.vidm_vbase,
			videomemory.vidm_size,
		       	dc);

	dc->dc_vd.active = NULL;
	vidcvideoinit_screen(dc, &dc->dc_console, 1, &defattr);

	ri = &(dc->dc_console.scr_ri);
	ri->ri_hw = &dc->dc_console;
	dc->dc_console.scr_cookie = dc;

	(*ri->ri_ops.allocattr)(ri,
				WS_DEFAULT_FG, /* fg */
				WS_DEFAULT_BG, /* bg */
				0,           /* wsattrs */
				&defattr);

	wsdisplay_cnattach(&vidcvideo_stdscreen,
			   ri,   /* emulcookie */
		       	   0, 0, /* cursor position */
			   defattr);

	vidcvideo_is_console = true;

	return 0;
}

static int
vidcvideointr(void *arg)
{
	struct fb_devconfig *dc = arg;

	return flush_dc_changes_to_screen(dc);
}

static int
flush_dc_changes_to_screen(struct fb_devconfig *dc)
{
	int v, cleared = 0;

	v = dc->_internal_dc_changed;

	if (v == 0) {
		disable_irq(IRQ_FLYBACK);
		return 1;
	}

	if (v & WSDISPLAY_WB_COUNTER) {
	    	dc->dc_writeback_delay--;
		if (dc->dc_writeback_delay == 0) {
		    	cpu_dcache_wb_range(dc->dc_vaddr, dc->dc_size);
			cleared |= WSDISPLAY_WB_COUNTER;
		}
	}

	if (v & WSDISPLAY_CMAP_DOLUT) {
		struct hwcmap256 *cm = &dc->dc_cmap;
		int index;

		if (dc->dc_depth == 4) {
			/* palette for 4 bpp is different from 8bpp */
			vidcvideo_write(VIDC_PALREG, 0x00000000);
			for (index=0; index < (1 << dc->dc_depth); index++)
				vidcvideo_write(VIDC_PALETTE,
					VIDC_COL(cm->r[index],
						 cm->g[index],
						 cm->b[index]));
		}

		if (dc->dc_depth == 8) {
			/*
			 * dunno what to do in more than 8bpp
			 * palettes only make sense in 8bpp and less modes
			 * on VIDC
			 */
			vidcvideo_write(VIDC_PALREG, 0x00000000);
			for (index = 0; index < CMAP_SIZE; index++) {
				vidcvideo_write(VIDC_PALETTE,
					VIDC_COL(cm->r[index], cm->g[index],
					    cm->b[index]));
			}
		}
		cleared |= WSDISPLAY_CMAP_DOLUT;
	}

	if (v & WSDISPLAY_VIDEO_ONOFF) {
		vidcvideo_blank(dc->dc_blanked);
		cleared |= WSDISPLAY_VIDEO_ONOFF;
	}

	if (v & (WSDISPLAY_CURSOR_DOPOS | WSDISPLAY_CURSOR_DOHOT)) {
		int x, y;
		x = dc->dc_cursor.cc_pos.x - dc->dc_cursor.cc_hot.x;
		y = dc->dc_cursor.cc_pos.y - dc->dc_cursor.cc_hot.y;

		vidcvideo_updatecursor(x, y);
		cleared |= WSDISPLAY_CURSOR_DOPOS | WSDISPLAY_CURSOR_DOHOT;
	}

	if (v & WSDISPLAY_CURSOR_DOCUR) {
		vidcvideo_enablecursor(dc->dc_curenb);
		cleared |= WSDISPLAY_CURSOR_DOCUR;
	}

	dc->_internal_dc_changed ^= cleared;

	if (dc->_internal_dc_changed == 0) {
		disable_irq(IRQ_FLYBACK);
	}

	return 1;
}

static void vidcvideo_queue_dc_change(struct fb_devconfig *dc, int dc_change)
{
	dc->_internal_dc_changed |= dc_change;

	if (curcpl() == IPL_HIGH) {
		/* running in ddb or without interrupts */
	    	dc->dc_writeback_delay = 1;
		flush_dc_changes_to_screen(dc);
	} else {
		/*
		 * running with interrupts so handle this in the next
		 * vsync
		 */
		if (dc->dc_ih) {
			enable_irq(IRQ_FLYBACK);
		}
	}
}

static const u_char ri_col_data[6][6] = {
	{ 0,  0,  0,   0,  0,  0},	/*  1 bpp */
	{ 0,  0,  0,   0,  0,  0},	/*  2 bpp */
	{ 0,  0,  0,   0,  0,  0},	/*  4 bpp */
	{ 0,  0,  0,   0,  0,  0},	/*  8 bpp */
	{ 6,  5,  5,   0,  6, 11},	/* 16 bpp */
	{ 8,  8,  8,   0,  8, 16},	/* 32 bpp */
};

static void
vidcvideo_colourmap_and_cursor_init(struct fb_devconfig *dc)
{
	struct rasops_info *ri = &dc->dc_console.scr_ri;
	const u_char *rgbdat;
	struct hwcmap256 *cm;
	const uint8_t *p;
	int index;

	/* Whatever we do later... just make sure we have a
	 * sane palette to start with
	 */
	vidcvideo_stdpalette();

	/* set up rgb bit pattern values for rasops_init */
	rgbdat = ri_col_data[dc->dc_log2_depth];
	ri->ri_rnum = rgbdat[0];
	ri->ri_gnum = rgbdat[1];
	ri->ri_bnum = rgbdat[2];
	ri->ri_rpos = rgbdat[3];
	ri->ri_gpos = rgbdat[4];
	ri->ri_bpos = rgbdat[5];

	/* initialise color map */
	cm = &dc->dc_cmap;
	p = rasops_cmap;
	for (index = 0; index < CMAP_SIZE; index++, p += 3) {
		cm->r[index] = p[0];
		cm->g[index] = p[1];
		cm->b[index] = p[2];
	}
	/* flush to hardware */
	vidcvideo_queue_dc_change(dc, WSDISPLAY_CMAP_DOLUT);
}

static int
get_cmap(struct vidcvideo_softc *sc, struct wsdisplay_cmap *p)
{
	u_int index = p->index, count = p->count;
	int error;

	if (index >= CMAP_SIZE || count > CMAP_SIZE - index)
		return EINVAL;

	error = copyout(&sc->sc_dc->dc_cmap.r[index], p->red, count);
	if (error)
		return error;
	error = copyout(&sc->sc_dc->dc_cmap.g[index], p->green, count);
	if (error)
		return error;
	error = copyout(&sc->sc_dc->dc_cmap.b[index], p->blue, count);
	return error;
}

static int
set_cmap(struct vidcvideo_softc *sc, struct wsdisplay_cmap *p)
{
    	struct fb_devconfig *dc = sc->sc_dc;
	struct hwcmap256 cmap;
	u_int index = p->index, count = p->count;
	int error;

	if (index >= CMAP_SIZE || (index + count) > CMAP_SIZE)
		return EINVAL;

	error = copyin(p->red, &cmap.r[index], count);
	if (error)
		return error;
	error = copyin(p->green, &cmap.g[index], count);
	if (error)
		return error;
	error = copyin(p->blue, &cmap.b[index], count);
	if (error)
		return error;
	memcpy(&dc->dc_cmap.r[index], &cmap.r[index], count);
	memcpy(&dc->dc_cmap.g[index], &cmap.g[index], count);
	memcpy(&dc->dc_cmap.b[index], &cmap.b[index], count);
	vidcvideo_queue_dc_change(dc, WSDISPLAY_CMAP_DOLUT);
	return 0;
}

static int
set_cursor(struct vidcvideo_softc *sc, struct wsdisplay_cursor *p)
{
#define	cc (&dc->dc_cursor)
    	struct fb_devconfig *dc = sc->sc_dc;
	u_int v, index = 0, count = 0, icount = 0;
	uint8_t r[2], g[2], b[2], image[512], mask[512];
	int error;

	/* XXX gcc does not detect identical conditions */
	index = count = icount = 0;

	v = p->which;
	if (v & WSDISPLAY_CURSOR_DOCMAP) {
		index = p->cmap.index;
		count = p->cmap.count;
		if (index >= CURSOR_MAX_COLOURS ||
		    (index + count) > CURSOR_MAX_COLOURS)
			return EINVAL;
		error = copyin(p->cmap.red, &r[index], count);
		if (error)
			return error;
		error = copyin(p->cmap.green, &g[index], count);
		if (error)
			return error;
		error = copyin(p->cmap.blue, &b[index], count);
		if (error)
			return error;
	}
	if (v & WSDISPLAY_CURSOR_DOSHAPE) {
		if (p->size.x > CURSOR_MAX_WIDTH ||
		    p->size.y > CURSOR_MAX_HEIGHT)
			return EINVAL;
		icount = sizeof(uint32_t) * p->size.y;
		error = copyin(p->image, &image, icount);
		if (error)
			return error;
		error = copyin(p->mask, &mask, icount);
		if (error)
			return error;
	}

	if (v & WSDISPLAY_CURSOR_DOCUR)
		dc->dc_curenb = p->enable;
	if (v & WSDISPLAY_CURSOR_DOPOS)
		set_curpos(sc, &p->pos);
	if (v & WSDISPLAY_CURSOR_DOHOT)
		cc->cc_hot = p->hot;
	if (v & WSDISPLAY_CURSOR_DOCMAP) {
		memcpy(&cc->cc_color[index], &r[index], count);
		memcpy(&cc->cc_color[index + 2], &g[index], count);
		memcpy(&cc->cc_color[index + 4], &b[index], count);
	}
	if (v & WSDISPLAY_CURSOR_DOSHAPE) {
		cc->cc_size = p->size;
		memset(cc->cc_image, 0, sizeof cc->cc_image);
		memcpy(cc->cc_image, image, icount);
		memset(cc->cc_mask, 0, sizeof cc->cc_mask);
		memcpy(cc->cc_mask, mask, icount);
	}
	vidcvideo_queue_dc_change(dc, v);

	return 0;
#undef cc
}

static int
get_cursor(struct vidcvideo_softc *sc, struct wsdisplay_cursor *p)
{

	return EPASSTHROUGH; /* XXX */
}

static void
set_curpos(struct vidcvideo_softc *sc, struct wsdisplay_curpos *curpos)
{
	struct fb_devconfig *dc = sc->sc_dc;
	int x = curpos->x, y = curpos->y;

	if (y < 0)
		y = 0;
	else if (y > dc->dc_height)
		y = dc->dc_height;
	if (x < 0)
		x = 0;
	else if (x > dc->dc_width)
		x = dc->dc_width;
	dc->dc_cursor.cc_pos.x = x;
	dc->dc_cursor.cc_pos.y = y;
}

static void vv_copyrows(void *id, int srcrow, int dstrow, int nrows)
{
	struct rasops_info *ri = id;
	int height, size;
	unsigned char *src, *dst;
	struct vcons_screen *scr = ri->ri_hw;
	struct fb_devconfig *dc = (struct fb_devconfig *) (scr->scr_cookie);

	/* All movements are done in multiples of character heigths */
	height = ri->ri_font->fontheight * nrows;
	size   = height * ri->ri_stride;

	/* check if we are full screen scrolling */

#if 0
	int scrollup   = (srcrow + nrows >= ri->ri_rows);
	int scrolldown = (dstrow + nrows >= ri->ri_rows);
	if ((scrollup || scrolldown) &&
	    (videomemory.vidm_type == VIDEOMEM_TYPE_VRAM)) {
		int offset = (srcrow - dstrow) * ri->ri_yscale;
		ri->ri_bits = vidcvideo_hwscroll(offset);
		vidcvideo_progr_scroll();	/* sadistic ; shouldnt this be on vsync? */

		/* wipe out remains of the screen if nessisary */
		if (ri->ri_emuheight != ri->ri_height)
			vv_eraserows(id, ri->ri_rows, 1, 0);
		return;
	}
#endif

	/*
	 * Else we just copy the area : we're braindead for now
	 * Note: we can't use hardware scrolling when the softc isnt
	 * known yet...  if its not known we dont have interrupts and
	 * we can't change the display address reliable other than in
	 * a Vsync
	 */

	src = ri->ri_bits + srcrow * ri->ri_font->fontheight * ri->ri_stride;
	dst = ri->ri_bits + dstrow * ri->ri_font->fontheight * ri->ri_stride;

	memmove(dst, src, size);

	/* delay the write back operation of the screen area */
	dc->dc_writeback_delay = SCREEN_WRITE_BACK_DELAY;
	vidcvideo_queue_dc_change(dc, WSDISPLAY_WB_COUNTER);
}

static void vv_eraserows(void *id, int startrow, int nrows, long attr)
{
	struct rasops_info *ri = id;
	int height;
	unsigned char *src;
	struct vcons_screen *scr = ri->ri_hw;
	struct fb_devconfig *dc = (struct fb_devconfig *) (scr->scr_cookie);

	/* we're braindead for now */
	height = ri->ri_font->fontheight * nrows * ri->ri_stride;

	src = ri->ri_bits + startrow * ri->ri_font->fontheight * ri->ri_stride;

	memset(src, 0, height);

	/* delay the write back operation of the screen area */
	dc->dc_writeback_delay = SCREEN_WRITE_BACK_DELAY;
	vidcvideo_queue_dc_change(dc, WSDISPLAY_WB_COUNTER);
}

static void vv_putchar(void *id, int row, int col, u_int uc, long attr)
{
    	struct rasops_info *ri = id;
	struct vcons_screen *scr = ri->ri_hw;
	struct fb_devconfig *dc = (struct fb_devconfig *) (scr->scr_cookie);

	/* just delegate */
	dc->orig_ri_ops.putchar(id, row, col, uc, attr);

	/* delay the write back operation of the screen area */
	dc->dc_writeback_delay = SCREEN_WRITE_BACK_DELAY;
	vidcvideo_queue_dc_change(dc, WSDISPLAY_WB_COUNTER);
}


text:
<!doctype html>

    <meta charset="utf-8">
    <title>Polynom</title>
    <meta name="description" content="Generate SVG paths easily directly in your browser.">

    <meta name="twitter:card" content="summary">
    <meta name="twitter:site" content="@a_dugois">
    <meta name="twitter:title" content="Polynom">
    <meta name="twitter:description" content="Generate SVG paths easily directly in your browser.">
    <meta name="twitter:image" content="http://polynom.co/polynom-120x120.png">

    <link rel="stylesheet" href="./dist/styles.css">


text:
JKNSStringAdditions
===================

A NSString Category class to help make working with NSString's a bit little easier with usefull day to day methods.

__Available Methods:__

    - (BOOL)isBlank
    - (NSString *)stringWithoutBlanks
    - (NSArray *)splitBy:(NSString *)splitString
    - (BOOL)contains:(NSString *)string
    - (NSString *)md5
    - (NSString *)sha1
    - (NSString *)sha256
    - (NSString *)sha512


text:
import { Component } from '@angular/core';
import { MatDialog, MatDialogRef } from '@angular/material/dialog';

@Component({
  selector: 'delete-dialog',
  templateUrl: './delete-dialog.component.html',
  styleUrls: ['./delete-dialog.component.scss']
})
export class DeleteDialogComponent {

    constructor(public dialogRef: MatDialogRef<any>) { }

}


text:
package com.bigr.applestore.utils;

/**
 * Created by Rana on 3/25/2016.
 */
public class Constants {
    /**
     * Constants for Firebase login
     */
    public static final String PASSWORD_PROVIDER = "password";
    public static final String  FIREBASE_URL = "https://appleluran.firebaseio.com/";
    public static final String FIREBASE_URL_USERS = "https://appleluran.firebaseio.com/customers";
    public static final String IMAGE_URL = "http://res.cloudinary.com/appleluran/image/upload/";
    public static final String FIREBASE_PROPERTY_TIMESTAMP = "timestamp";
}


text:
/**
 * Created by Helena on 04.09.2015.
 */

// slider
var valueSlider, scaleSlider, diffSlider;

$(function() {
    // slider properties and functionalities
    $(".slider").slider({max:8, min:0, value:4, orientation: "vertical", step:1,
        // default properties
        create: function() {
            valueSlider = 4;
            scaleSlider = 1;
        },
        // if slider is used, change size of all elements in working place
        change: function(event, ui) {
            diffSlider = ui.value - valueSlider;
            scaleSlider = scaleSlider + (0.1 * diffSlider);     // scale factor
            $("#stm div").css({
                "-webkit-transform":"scale(" + scaleSlider + ")",
                "-moz-transform":"scale(" + scaleSlider + ")",
                "-ms-transform":"scale(" + scaleSlider + ")",
                "-o-transform":"scale(" + scaleSlider + ")",
                "transform":"scale(" + scaleSlider + ")"
            });
            $("#stm svg").css({
                "-webkit-transform":"scale(" + scaleSlider + ")",
                "-moz-transform":"scale(" + scaleSlider + ")",
                "-ms-transform":"scale(" + scaleSlider + ")",
                "-o-transform":"scale(" + scaleSlider + ")",
                "transform":"scale(" + scaleSlider + ")"
            });
            jsPlumb.setZoom(scaleSlider);
            valueSlider = ui.value;
            inst.repaintEverything();
        }})
        // add pips and label to slider
        .slider("pips", {first:"label", last:"label", labels:{"first":"-", "last":"+"}});
});

/*

// add jQuery UI Sliders with flat design
$(function() {
    var $verticalSlider = $('.slider');
    if ($verticalSlider.length) {
        $verticalSlider.slider({
            min: 0,
            max: 8,
            value: 4,
            orientation: 'vertical',
            step: 1,
            range: 'min'
        });
    }
});*/


text:
<meta name="keywords"           content="eso, FITS format, C library">
<link href="doxygen.css" rel="stylesheet" type="text/css">
<title>QFITS Reference Manual 6.2.0</title>

FITS caching capabilities

Functions

void 	qfits_cache_purge (void)

 	Purge the qfits cache.

int 	qfits_query (const char *filename, int what)

 	Query a FITS file offset from the cache.

Detailed Description

This modules implements a cache for FITS access routines. The first time a FITS file is seen by the library, all corresponding pointers are cached here. This speeds up multiple accesses to large files by magnitudes.

Function Documentation

          void qfits_cache_purge
          (
          void

           )

Purge the qfits cache.

Returns:

void

This function is useful for programs running for a long period, to clean up the cache. Ideally in a daemon, it should be called by a timer at regular intervals. Notice that since the cache is fairly small, you should not need to care too much about this.

          int qfits_query
          (
          const char *
           filename,

          int
           what

          )

Query a FITS file offset from the cache.

Parameters:

	filename 	Name of the file to examine.

	what 	What should be queried (see below).

Returns:

an integer offset, or -1 if an error occurred.

This function queries the cache for FITS offset information. If the requested file name has never been seen before, it is completely parsed to extract all offset informations, which are then stored in the cache. The next query will get the informations from the cache, avoiding a complete re-parsing of the file. This is especially useful for large FITS files with lots of extensions, because querying the extensions is an expensive operation.

This operation has side-effects: the cache is an automatically allocated structure in memory, that can only grow. Every request on a new FITS file will make it grow. The structure is pretty light-weight in memory, but nonetheless this is an issue for daemon-type programs which must run over long periods. The solution is to clean the cache using qfits_cache_purge() at regular intervals. This is left to the user of this library.

To request information about a FITS file, you must pass an integer built from the following symbols:

QFITS_QUERY_N_EXT

QFITS_QUERY_HDR_START

QFITS_QUERY_DAT_START

QFITS_QUERY_HDR_SIZE

QFITS_QUERY_DAT_SIZE

Querying the number of extensions present in a file is done simply with:

  next = qfits_query(filename, QFITS_QUERY_N_EXT);

Querying the offset to the i-th extension header is done with:

  off = qfits_query(filename, QFITS_QUERY_HDR_START | i);

i.e. you must OR (|) the extension number with the QFITS_QUERY_HDR_START symbol. Requesting offsets to extension data is done in the same way:

  off = qfits_query(filename, QFITS_QUERY_DAT_START | i);

Notice that extension 0 is the main header and main data part of the FITS file.


text:
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.backends.backend_pdf import PdfPages

def main():
	pp = PdfPages('result.pdf')
	show_data('conv.dat',    pp, 'Convolution')
	show_data('convfft.dat', pp, 'Convolution FFT')
	show_data('corr.dat',    pp, 'Correlation')
	show_data('corrfft.dat', pp, 'Correlation FFT')

	pp.close()

def load_data(file_name):
	return np.genfromtxt(file_name)

def show_data(file_name, out_file, title):
	c_complex = load_data(file_name)

	plt.figure(figsize = (8, 5))
	plt.title(title)

	plt.stem(c_complex, linefmt='r-', basefmt='k-')
	plt.savefig(out_file, format='pdf')
	plt.close()

if __name__ == "__main__":
	main()


text:
Date.CultureInfo = {
	/* Culture Name */
    name: "pt-BR",
    englishName: "Portuguese (Brazil)",
    nativeName: "Português (Brasil)",

    /* Day Name Strings */
    dayNames: ["domingo", "segunda-feira", "terça-feira", "quarta-feira", "quinta-feira", "sexta-feira", "sábado"],
    abbreviatedDayNames: ["dom", "seg", "ter", "qua", "qui", "sex", "sáb"],
    shortestDayNames: ["dom", "seg", "ter", "qua", "qui", "sex", "sáb"],
    firstLetterDayNames: ["d", "s", "t", "q", "q", "s", "s"],

    /* Month Name Strings */
    monthNames: ["janeiro", "fevereiro", "março", "abril", "maio", "junho", "julho", "agosto", "setembro", "outubro", "novembro", "dezembro"],
    abbreviatedMonthNames: ["jan", "fev", "mar", "abr", "mai", "jun", "jul", "ago", "set", "out", "nov", "dez"],

	/* AM/PM Designators */
    amDesignator: "",
    pmDesignator: "",

    firstDayOfWeek: 0,
    twoDigitYearMax: 2029,

    /**
     * The dateElementOrder is based on the order of the
     * format specifiers in the formatPatterns.DatePattern.
     *
     * Example:
     <pre>
     shortDatePattern    dateElementOrder
     ------------------  ----------------
     "M/d/yyyy"          "mdy"
     "dd/MM/yyyy"        "dmy"
     "yyyy-MM-dd"        "ymd"
     </pre>
     * The correct dateElementOrder is required by the parser to
     * determine the expected order of the date elements in the
     * string being parsed.
     *
     * NOTE: It is VERY important this value be correct for each Culture.
     */
    dateElementOrder: "dmy",

    /* Standard date and time format patterns */
    formatPatterns: {
        shortDate: "d/M/yyyy",
        longDate: "dddd, d' de 'MMMM' de 'yyyy",
        shortTime: "H:mm",
        longTime: "H:mm:ss",
        fullDateTime: "dddd, d' de 'MMMM' de 'yyyy H:mm:ss",
        sortableDateTime: "yyyy-MM-ddTHH:mm:ss",
        universalSortableDateTime: "yyyy-MM-dd HH:mm:ssZ",
        rfc1123: "ddd, dd MMM yyyy HH:mm:ss GMT",
        monthDay: "dd' de 'MMMM",
        yearMonth: "MMMM' de 'yyyy"
    },

    /**
     * NOTE: If a string format is not parsing correctly, but
     * you would expect it parse, the problem likely lies below.
     *
     * The following regex patterns control most of the string matching
     * within the parser.
     *
     * The Month name and Day name patterns were automatically generated
     * and in general should be (mostly) correct.
     *
     * Beyond the month and day name patterns are natural language strings.
     * Example: "next", "today", "months"
     *
     * These natural language string may NOT be correct for this culture.
     * If they are not correct, please translate and edit this file
     * providing the correct regular expression pattern.
     *
     * If you modify this file, please post your revised CultureInfo file
     * to the Datejs Discussions located at
     *     http://groups.google.com/group/date-js
     *
     * Please mark the subject with [CultureInfo]. Example:
     *    Subject: [CultureInfo] Translated "da-DK" Danish(Denmark)
     *
     * We will add the modified patterns to the master source files.
     *
     * As well, please review the list of "Future Strings" section below.
     */
    regexPatterns: {
        jan: /^jan(eiro)?/i,
        feb: /^fev(ereiro)?/i,
        mar: /^mar(ço)?/i,
        apr: /^abr(il)?/i,
        may: /^mai(o)?/i,
        jun: /^jun(ho)?/i,
        jul: /^jul(ho)?/i,
        aug: /^ago(sto)?/i,
        sep: /^set(embro)?/i,
        oct: /^out(ubro)?/i,
        nov: /^nov(embro)?/i,
        dec: /^dez(embro)?/i,

        sun: /^domingo/i,
        mon: /^segunda-feira/i,
        tue: /^terça-feira/i,
        wed: /^quarta-feira/i,
        thu: /^quinta-feira/i,
        fri: /^sexta-feira/i,
        sat: /^sábado/i,

        future: /^next/i,
        past: /^last|past|prev(ious)?/i,
        add: /^(\+|after|from)/i,
        subtract: /^(\-|before|ago)/i,

        yesterday: /^yesterday/i,
        today: /^t(oday)?/i,
        tomorrow: /^tomorrow/i,
        now: /^n(ow)?/i,

        millisecond: /^ms|milli(second)?s?/i,
        second: /^sec(ond)?s?/i,
        minute: /^min(ute)?s?/i,
        hour: /^h(ou)?rs?/i,
        week: /^w(ee)?k/i,
        month: /^m(o(nth)?s?)?/i,
        day: /^d(ays?)?/i,
        year: /^y((ea)?rs?)?/i,

        shortMeridian: /^(a|p)/i,
        longMeridian: /^(a\.?m?\.?|p\.?m?\.?)/i,
        timezone: /^((e(s|d)t|c(s|d)t|m(s|d)t|p(s|d)t)|((gmt)?\s*(\+|\-)\s*\d\d\d\d?)|gmt)/i,
        ordinalSuffix: /^\s*(st|nd|rd|th)/i,
        timeContext: /^\s*(\:|a|p)/i
    },

    abbreviatedTimeZoneStandard: { GMT: "-000", EST: "-0400", CST: "-0500", MST: "-0600", PST: "-0700" },
    abbreviatedTimeZoneDST: { GMT: "-000", EDT: "-0500", CDT: "-0600", MDT: "-0700", PDT: "-0800" }

};

/********************
 ** Future Strings **
 ********************
 *
 * The following list of strings are not currently being used, but
 * may be incorporated later. We would appreciate any help translating
 * the strings below.
 *
 * If you modify this file, please post your revised CultureInfo file
 * to the Datejs Discussions located at
 *     http://groups.google.com/group/date-js
 *
 * Please mark the subject with [CultureInfo]. Example:
 *    Subject: [CultureInfo] Translated "da-DK" Danish(Denmark)
 *
 * English Name        Translated
 * ------------------  -----------------
 * date                date
 * time                time
 * calendar            calendar
 * show                show
 * hourly              hourly
 * daily               daily
 * weekly              weekly
 * bi-weekly           bi-weekly
 * monthly             monthly
 * bi-monthly          bi-monthly
 * quarter             quarter
 * quarterly           quarterly
 * yearly              yearly
 * annual              annual
 * annually            annually
 * annum               annum
 * again               again
 * between             between
 * after               after
 * from now            from now
 * repeat              repeat
 * times               times
 * per                 per
 */


text:
using Google.Apis.Auth.OAuth2.Responses;
using Google.Apis.Compute.v1.Data;
using Google.Apis.Http;
using System;
using System.Threading;
using System.Threading.Tasks;

namespace Google.Cloud.Metadata.V1
{
    /// <summary>
    /// Abstract class providing operations for using metadata for Google Compute Engine.
    /// </summary>
    /// <remarks>
    /// <para>
    /// This abstract class is provided to enable testability while permitting
    /// additional operations to be added in the future. You can construct a <see cref="MetadataClientImpl"/> directly.
    /// </para>
    /// <para>
    /// All instance methods declared in this class are virtual, with an implementation which simply
    /// throws <see cref="NotImplementedException"/>. All these methods are overridden in <see cref="MetadataClientImpl"/>.
    /// </para>
    /// </remarks>
    public abstract class MetadataClient
    {
        /// <summary>
        /// Creates a new <see cref="MetadataClient"/>
        /// </summary>
        /// <returns>The created <see cref="MetadataClient"/>.</returns>
        public static MetadataClient Create(ConfigurableHttpClient httpClient = null) => new MetadataClientImpl(httpClient);

        /// <summary>
        /// Creates a new <see cref="MetadataClient"/>
        /// </summary>
        /// <returns>The created <see cref="MetadataClient"/>.</returns>
        public static MetadataClient Create(IHttpClientFactory httpClientFactory) => new MetadataClientImpl(httpClientFactory);

        /// <summary>The HTTP client which is used to create requests.</summary>
        public virtual ConfigurableHttpClient HttpClient { get { throw new NotImplementedException(); } }

        /// <summary>
        /// Gets a token response which contains an access token to authorize a request synchronously.
        /// </summary>
        /// <exception cref="TokenResponseException">A status code other than success was returned from the server.</exception>
        /// <returns>The token response.</returns>
        public virtual TokenResponse GetAccessToken()
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Gets a token response which contains an access token to authorize a request asynchronously.
        /// </summary>
        /// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
        /// <exception cref="TokenResponseException">A status code other than success was returned from the server.</exception>
        /// <returns>The token response.</returns>
        public virtual Task<TokenResponse> GetAccessTokenAsync(CancellationToken cancellationToken = default(CancellationToken))
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Gets the instance's custom metadata value with the specified key synchronously.
        /// </summary>
        /// <remarks>
        /// <para>
        /// Custom metadata are just opaque key/value pairs which allow for custom configuration parameters, scripts, or other
        /// relatively small pieces of data to be associated with the instance.
        /// </para>
        /// <para>
        /// The key must conform to the following regular expression: [a-zA-Z0-9-_]+ and must be less than 128 bytes in length.
        /// </para>
        /// </remarks>
        /// <param name="key">The key of the instance's custom metadata value to get.</param>
        /// <exception cref="ArgumentException">The key is not in the proper format.</exception>
        /// <seealso cref="Instance.Metadata"/>
        public virtual string GetCustomInstanceMetadata(string key)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Gets the instance's custom metadata value with the specified key asynchronously.
        /// </summary>
        /// <remarks>
        /// <para>
        /// Custom metadata are just opaque key/value pairs which allow for custom configuration parameters, scripts, or other
        /// relatively small pieces of data to be associated with the instance.
        /// </para>
        /// <para>
        /// The key must conform to the following regular expression: [a-zA-Z0-9-_]+ and must be less than 128 bytes in length.
        /// </para>
        /// </remarks>
        /// <param name="key">The key of the instance's custom metadata value to get.</param>
        /// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
        /// <exception cref="ArgumentException">The key is not in the proper format.</exception>
        /// <returns>A task representing the asynchronous operation.</returns>
        /// <seealso cref="Instance.Metadata"/>
        public virtual Task<string> GetCustomInstanceMetadataAsync(string key, CancellationToken cancellationToken = default(CancellationToken))
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Gets the project's custom metadata value with the specified key synchronously.
        /// </summary>
        /// <remarks>
        /// <para>
        /// Custom metadata are just opaque key/value pairs which allow for custom configuration parameters, scripts, or other
        /// relatively small pieces of data to be associated with the project.
        /// </para>
        /// <para>
        /// The key must conform to the following regular expression: [a-zA-Z0-9-_]+ and must be less than 128 bytes in length.
        /// </para>
        /// </remarks>
        /// <param name="key">The key of the project's custom metadata to get.</param>
        /// <exception cref="ArgumentException">The key is not in the proper format.</exception>
        /// <seealso cref="Project.CommonInstanceMetadata"/>
        public virtual string GetCustomProjectMetadata(string key)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Gets the project's custom metadata value with the specified key asynchronously.
        /// </summary>
        /// <remarks>
        /// <para>
        /// Custom metadata are just opaque key/value pairs which allow for custom configuration parameters, scripts, or other
        /// relatively small pieces of data to be associated with the project.
        /// </para>
        /// <para>
        /// The key must conform to the following regular expression: [a-zA-Z0-9-_]+ and must be less than 128 bytes in length.
        /// </para>
        /// </remarks>
        /// <param name="key">The key of the project's custom metadata value to get.</param>
        /// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
        /// <exception cref="ArgumentException">The key is not in the proper format.</exception>
        /// <returns>A task representing the asynchronous operation.</returns>
        /// <seealso cref="Project.CommonInstanceMetadata"/>
        public virtual Task<string> GetCustomProjectMetadataAsync(string key, CancellationToken cancellationToken = default(CancellationToken))
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Synchronously gets the metadata for the VM currently running this code.
        /// </summary>
        /// <remarks>
        /// The instance metadata contains information about the instance, such as the host name, instance ID, and custom metadata and it can be
        /// accessed without authentication from an application running on the instance. Check <see cref="IsServerAvailable"/> or
        /// <see cref="IsServerAvailableAsync(CancellationToken)"/> to determine if the metadata can be accessed.
        /// </remarks>
        /// <returns>The <see cref="Instance"/> representing the metadata.</returns>
        public virtual Instance GetInstanceMetadata()
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Asynchronously gets the metadata for the VM currently running this code.
        /// </summary>
        /// <remarks>
        /// The instance metadata contains information about the instance, such as the host name, instance ID, and custom metadata and it can be
        /// accessed without authentication from an application running on the instance. Check <see cref="IsServerAvailable"/> or
        /// <see cref="IsServerAvailableAsync(CancellationToken)"/> to determine if the metadata can be accessed.
        /// </remarks>
        /// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
        /// <returns>A task containing the <see cref="Instance"/> representing the metadata.</returns>
        public virtual Task<Instance> GetInstanceMetadataAsync(CancellationToken cancellationToken = default(CancellationToken))
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Synchronously gets the maintenance status for the VM currently running this code.
        /// </summary>
        /// <remarks>
        /// If the <see cref="Instance.Scheduling"/>'s <see cref="Scheduling.OnHostMaintenance"/> is set to "MIGRATE", the maintenance status will change
        /// to <see cref="MaintenanceStatus.Migrate"/> 60 seconds before a maintenance event starts. This will give the application an opportunity
        /// to perform any tasks in preparation for the event, such as backing up data or updating logs. Otherwise, the value will be
        /// <see cref="MaintenanceStatus.None"/>.
        /// </remarks>
        /// <returns>The current maintenance status.</returns>
        /// <seealso cref="Scheduling.OnHostMaintenance"/>
        public virtual MaintenanceStatus GetMaintenanceStatus()
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Asynchronously gets the maintenance status for the VM currently running this code.
        /// </summary>
        /// <remarks>
        /// If the <see cref="Instance.Scheduling"/>'s <see cref="Scheduling.OnHostMaintenance"/> is set to "MIGRATE", the maintenance status will change
        /// to <see cref="MaintenanceStatus.Migrate"/> 60 seconds before a maintenance event starts. This will give the application an opportunity
        /// to perform any tasks in preparation for the event, such as backing up data or updating logs. Otherwise, the value will be
        /// <see cref="MaintenanceStatus.None"/>.
        /// </remarks>
        /// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
        /// <returns>A task containing the current maintenance status.</returns>
        /// <seealso cref="Scheduling.OnHostMaintenance"/>
        public virtual Task<MaintenanceStatus> GetMaintenanceStatusAsync(CancellationToken cancellationToken = default(CancellationToken))
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Synchronously gets the metadata for the project of the VM currently running this code.
        /// </summary>
        /// <remarks>
        /// The project metadata contains information about the project, such as its ID, and custom metadata and it can be
        /// accessed without authentication from an application running on an instance of that project. Check <see cref="IsServerAvailable"/> or
        /// <see cref="IsServerAvailableAsync(CancellationToken)"/> to determine if the metadata can be accessed.
        /// </remarks>
        /// <returns>The <see cref="Project"/> representing the metadata.</returns>
        public virtual Project GetProjectMetadata()
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Asynchronously gets the metadata for the project of the VM currently running this code.
        /// </summary>
        /// <remarks>
        /// The project metadata contains information about the project, such as its ID, and custom metadata and it can be
        /// accessed without authentication from an application running on an instance of that project. Check <see cref="IsServerAvailable"/> or
        /// <see cref="IsServerAvailableAsync(CancellationToken)"/> to determine if the metadata can be accessed.
        /// </remarks>
        /// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
        /// <returns>A task containing the <see cref="Project"/> representing the metadata.</returns>
        public virtual Task<Project> GetProjectMetadataAsync(CancellationToken cancellationToken = default(CancellationToken))
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Gets the value indicating whether the metadata server or an emulator for the server is available synchronously.
        /// </summary>
        /// <remarks>
        /// Normally, the metadata server can only be accessed from an application running on a Google Compute Engine VM instance or
        /// Google App Engine Flexible Environment, but if an metadata server emulator is available, this will also return true.
        /// </remarks>
        /// <returns>True if the normal metadata server or an emulator is available; false otherwise.</returns>
        public virtual bool IsServerAvailable()
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Gets the value indicating whether the metadata server or an emulator for the server is available asynchronously.
        /// </summary>
        /// <remarks>
        /// Normally, the metadata server can only be accessed from an application running on a Google Compute Engine VM instance or
        /// Google App Engine Flexible Environment, but if an metadata server emulator is available, this will also return true.
        /// </remarks>
        /// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
        /// <returns>A task containing true if the normal metadata server or an emulator is available; false otherwise.</returns>
        public virtual Task<bool> IsServerAvailableAsync(CancellationToken cancellationToken = default(CancellationToken))
        {
            throw new NotImplementedException();
        }

        // TODO: Do we want separate events for when standard and custom metadata changes? Same question for project metadata.

        /// <summary>
        /// Occurs when the the instance's metadata has changed.
        /// </summary>
        /// <remarks>
        /// <para>
        /// To wait on changes for individual parts of the metadata, see <see cref="WaitForChange"/> or <see cref="WaitForChangeAsync"/>.
        /// </para>
        /// <para>
        /// Note: the event may be fired on a different thread from the one used to add the handler.
        /// </para>
        /// </remarks>
        /// <seealso cref="GetInstanceMetadata"/>
        /// <seealso cref="GetInstanceMetadataAsync"/>
        /// <seealso cref="WaitForChange"/>
        /// <seealso cref="WaitForChangeAsync"/>
        public virtual event EventHandler InstanceMetadataChanged
        {
            add { throw new NotImplementedException(); }
            remove { throw new NotImplementedException(); }
        }

        /// <summary>
        /// Occurs when the the instance's maintenance status has changed.
        /// </summary>
        /// <remarks>
        /// <para>
        /// Note: the event may be fired on a different thread from the one used to add the handler.
        /// </para>
        /// </remarks>
        /// <seealso cref="GetMaintenanceStatus"/>
        /// <seealso cref="GetMaintenanceStatusAsync(CancellationToken)"/>
        public virtual event EventHandler<MaintenanceStatus> MaintenanceStatusChanged
        {
            add { throw new NotImplementedException(); }
            remove { throw new NotImplementedException(); }
        }

        /// <summary>
        /// Occurs when the the project's metadata has changed.
        /// </summary>
        /// <remarks>
        /// <para>
        /// To wait on changes for individual parts of the metadata, see <see cref="WaitForChange"/> or <see cref="WaitForChangeAsync"/>.
        /// </para>
        /// <para>
        /// Note: the event may be fired on a different thread from the one used to add the handler.
        /// </para>
        /// </remarks>
        /// <seealso cref="GetProjectMetadata"/>
        /// <seealso cref="GetProjectMetadataAsync"/>
        /// <seealso cref="WaitForChange"/>
        /// <seealso cref="WaitForChangeAsync"/>
        public virtual event EventHandler ProjectMetadataChanged
        {
            add { throw new NotImplementedException(); }
            remove { throw new NotImplementedException(); }
        }

        /// <summary>
        /// Waits for changes to the value or values specified by the relative URL synchronously.
        /// </summary>
        /// <remarks>
        /// <para>
        /// If the key specified is a metadata endpoint, the result will be the value, possibly separated by newlines if there are multiple values.
        /// If the key specified is a directory, a recursive request must be made and the result will be a JSON object containing all values in the directory.
        /// For example, to wait for changes on all instance metadata use a key of "instance?recursive=true".
        /// </para>
        /// <para>
        /// If the <paramref name="lastETag"/> is specified and it differs from the ETag of the value currently on the server, it indicates that the value has already
        /// changed since the last known value as obtained, and the changed value will be returned immediately.
        /// </para>
        /// <para>
        /// If the <paramref name="timeout"/> expires before changes are made, the current value will be returned. If unspecified, half the length of the timeout in
        /// the <see cref="HttpClient"/> will be used instead. Note that if the the timeout in the <see cref="HttpClient"/> elapses before the wait timeout elapses
        /// on the server a <see cref="TaskCanceledException"/> exception will occur.
        /// </para>
        /// <para>
        /// See https://cloud.google.com/compute/docs/storing-retrieving-metadata#project_and_instance_metadata for more information on available keys.
        /// </para>
        /// <para>
        /// To detect any changes at the project or instance level, use a <paramref name="key"/> of "project" or "instance".
        /// Alternatively, use <seealso cref="ProjectMetadataChanged"/> or <seealso cref="InstanceMetadataChanged"/>, respectively.
        /// </para>
        /// </remarks>
        /// <param name="key">The metadata key on which to wait for changes, such as "instance/scheduling/automatic-restart"</param>
        /// <param name="lastETag">The ETag of the last known value. May be null.</param>
        /// <param name="timeout">The amount of time to wait for changes.</param>
        /// <exception cref="ArgumentException">
        /// <paramref name="key"/> does not have the proper format for a metadata key, which is a relative URL, <paramref name="timeout"/> represents a negative duration,
        /// or <paramref name="lastETag"/> is invalid.
        /// </exception>
        /// <exception cref="TaskCanceledException">
        /// The timeout in the <see cref="HttpClient"/> elapses before the response comes back from the server.
        /// </exception>
        /// <returns>The <see cref="WaitForChangeResult"/> with the changed value(s) for an endpoint or a JSON object with the changed contents of the directory.</returns>
        /// <seealso cref="InstanceMetadataChanged"/>
        /// <seealso cref="ProjectMetadataChanged"/>
        public virtual WaitForChangeResult WaitForChange(string key, string lastETag = null, TimeSpan timeout = default(TimeSpan))
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Waits for changes to the value or values specified by the relative URL asynchronously.
        /// </summary>
        /// <remarks>
        /// <para>
        /// If the key specified is a metadata endpoint, the result will be the value, possibly separated by newlines if there are multiple values.
        /// If the key specified is a directory, a recursive request must be made and the result will be a JSON object containing all values in the directory.
        /// For example, to wait for changes on all instance metadata use a key of "instance?recursive=true".
        /// </para>
        /// <para>
        /// If the <paramref name="lastETag"/> is specified and it differs from the ETag of the value currently on the server, it indicates that the value has already
        /// changed since the last known value as obtained, and the changed value will be returned immediately.
        /// </para>
        /// <para>
        /// If the <paramref name="timeout"/> expires before changes are made, the current value will be returned. If unspecified, half the length of the timeout in
        /// the <see cref="HttpClient"/> will be used instead. Note that if the the timeout in the <see cref="HttpClient"/> elapses before the wait timeout elapses
        /// on the server a <see cref="TaskCanceledException"/> exception will occur.
        /// </para>
        /// <para>
        /// See https://cloud.google.com/compute/docs/storing-retrieving-metadata#project_and_instance_metadata for more information on available keys.
        /// </para>
        /// <para>
        /// To detect any changes at the project or instance level, use a <paramref name="key"/> of "project" or "instance".
        /// Alternatively, use <seealso cref="ProjectMetadataChanged"/> or <seealso cref="InstanceMetadataChanged"/>, respectively.
        /// </para>
        /// </remarks>
        /// <param name="key">The metadata key on which to wait for changes, such as "instance/scheduling/automatic-restart"</param>
        /// <param name="lastETag">The ETag of the last known value. May be null.</param>
        /// <param name="timeout">The amount of time to wait for changes.</param>
        /// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
        /// <exception cref="ArgumentException">
        /// <paramref name="key"/> does not have the proper format for a metadata key, which is a relative URL, <paramref name="timeout"/> represents a negative duration,
        /// or <paramref name="lastETag"/> is invalid.
        /// </exception>
        /// <exception cref="TaskCanceledException">
        /// The timeout in the <see cref="HttpClient"/> elapses before the response comes back from the server.
        /// </exception>
        /// <returns>
        /// A task containing the <see cref="WaitForChangeResult"/> with the changed value(s) for an endpoint or a JSON object with the changed contents of the directory.
        /// </returns>
        /// <seealso cref="InstanceMetadataChanged"/>
        /// <seealso cref="ProjectMetadataChanged"/>
        public virtual Task<WaitForChangeResult> WaitForChangeAsync(
            string key, string lastETag = null, TimeSpan timeout = default(TimeSpan), CancellationToken cancellationToken = default(CancellationToken))
        {
            throw new NotImplementedException();
        }
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
  <model metaid="_case00066" id="case00066" name="case00066">
    <listOfCompartments>
      <compartment id="compartment" name="compartment" size="1" units="volume"/>
    </listOfCompartments>
    <listOfSpecies>
      <species id="S1" name="S1" compartment="compartment" initialAmount="1e-006" substanceUnits="substance"/>
      <species id="S2" name="S2" compartment="compartment" initialAmount="1.5e-006" substanceUnits="substance"/>
      <species id="S3" name="S3" compartment="compartment" initialAmount="2e-006" substanceUnits="substance"/>
      <species id="S4" name="S4" compartment="compartment" initialAmount="5e-007" substanceUnits="substance"/>
    </listOfSpecies>
    <listOfParameters>
      <parameter id="k1" name="k1" value="1000000" constant="false"/>
      <parameter id="k2" name="k2" value="300000"/>
    </listOfParameters>
    <listOfRules>
      <rateRule metaid="rule1" variable="k1">
        <math xmlns="http://www.w3.org/1998/Math/MathML">
          <cn type="integer"> 1000000 </cn>
        </math>
      </rateRule>
    </listOfRules>
    <listOfReactions>
      <reaction id="reaction1" name="reaction1" reversible="false" fast="false">
        <listOfReactants>
          <speciesReference species="S1"/>
          <speciesReference species="S2"/>
        </listOfReactants>
        <listOfProducts>
          <speciesReference species="S3"/>
          <speciesReference species="S4"/>
        </listOfProducts>
        <kineticLaw>
          <math xmlns="http://www.w3.org/1998/Math/MathML">
            <apply>
              <times/>
              <ci> compartment </ci>
              <ci> k1 </ci>
              <ci> S1 </ci>
              <ci> S2 </ci>
            </apply>
          </math>
        </kineticLaw>
      </reaction>
      <reaction id="reaction2" name="reaction2" reversible="false" fast="false">
        <listOfReactants>
          <speciesReference species="S3"/>
          <speciesReference species="S4"/>
        </listOfReactants>
        <listOfProducts>
          <speciesReference species="S1"/>
          <speciesReference species="S2"/>
        </listOfProducts>
        <kineticLaw>
          <math xmlns="http://www.w3.org/1998/Math/MathML">
            <apply>
              <times/>
              <ci> compartment </ci>
              <ci> k2 </ci>
              <ci> S3 </ci>
              <ci> S4 </ci>
            </apply>
          </math>
        </kineticLaw>
      </reaction>
    </listOfReactions>
  </model>
</sbml>


text:
var widget_name = parent.currentTargetParam.widget_name;
var url = parent.currentTargetParam.url;
var htmlUrl = parent.currentTargetParam.htmlUrl;
var saveUrl = parent.currentTargetParam.saveUrl;
var templateId = parent.currentTargetParam.templateId;
var DiyPageId = parent.DiyPageId;
var Mid = parent.Mid;
$('#confirm,#editwidgetConfirm').click(function(){
	var formData = $('#baseSettingForm').serialize()+'&'+$('#editwidgetForm').serialize();;

	parent.currentTarget.attr('data-param',encodeURIComponent(formData));
	parent.currentTarget.attr('data-name',widget_name);
	parent.currentTarget.attr('data-id',templateId);
	parent.currentTarget.attr('data-set',url);
	parent.currentTarget.attr('data-html',htmlUrl);
	parent.currentTarget.attr('data-save',htmlUrl);
	parent.currentTarget.attr('data-id',templateId);

	formData += '&page_id='+DiyPageId+'&widget_id='+templateId+'&widget_name='+widget_name;
	$.post(url,formData,function(templateHtml){
		parent.currentTarget.addClass('function_edit');
		parent.currentTarget.find('.item_content').html(templateHtml);
		$('.dialog_layer', parent.document).hide();
		$('#setDialog', parent.document).hide();
		$('body', parent.document).removeClass('no-scroll');
		$('#paramIframe', parent.document).attr('src','');
	});

});
//切换编辑html
$('.setting').click(function(){
	$(' #baseSettingForm').show();
	$(' #editwidgetForm').hide();
	$(' #editHtmlForm').hide();
	$(this).addClass('cur').siblings().removeClass('cur');
})
$('.editwidget').click(function(){
	$(' #baseSettingForm').hide();
	$(' #editwidgetForm').show();
	$(' #editHtmlForm').hide();
	$(this).addClass('cur').siblings().removeClass('cur');
})
$('.edithtml').click(function(){
	$(' #baseSettingForm').hide();
	$(' #editwidgetForm').hide();
	$(' #editHtmlForm').show();
	var templateName = $('select[name="template"]').val();
	$.post(htmlUrl,{'widget_name':widget_name,'template':templateName,'widget_id':templateId},function(htmlCode){
		$('#htmlTextarea').val(htmlCode);
		})

})

$('#editHtmlForm #saveHtmlBtn').click(function(){
	var templateName = $('select[name="template"]').val();
	var templateCode = $('#editHtmlForm #htmlTextarea').val();
	$('#custom_template').val(templateId);
	$('#template').val(templateId);
	$.post(saveUrl,{'widget_name':widget_name,'template':templateName,'widget_id':templateId,'code':templateCode},function(data){
			updateAlert(data.info);
			setTimeout(function(){
				$('#top-alert').find('button').click();
			},1500);
			$(' #baseSettingForm').show();
			$(' #editHtmlForm').hide();
		})

})

$('#addWidgetMoreLink').click(function(){
	var $clone = $('.form-col-more').eq(0).clone();
	$clone.insertAfter($(this).parents('.form-col-more'));
})
$('.preview_btn').click(function(){
	var formData = $('#baseSettingForm').serialize()+'&'+$('#editwidgetForm').serialize();

	parent.currentTarget.attr('data-name',widget_name);
	parent.currentTarget.attr('data-id',templateId);
	parent.currentTarget.attr('data-set',url);

	formData += '&preview=1&page_id='+DiyPageId+'&widget_id='+templateId+'&widget_name='+widget_name;
	$.post(url,formData,function(templateHtml){
		//$('#widget_preview').html(templateHtml);
		var prevHtml = $('

'+templateHtml+'

');
		var layer = $('

');
		var closeHtml = $('

');
		$('body', parent.document).append(layer);
		$('body', parent.document).append(prevHtml);
		$('body', parent.document).append(closeHtml);
		closeHtml.click(function(){
			prevHtml.remove();
			layer.remove();
			closeHtml.remove();
			})
	});

})