text:
name: General Bug
about: Any type of bug or crash not related to webhooks or syncing
title: ''
labels: bug
assignees: ''

---

**Describe the bug**
<!-- A clear and concise description of what the bug is. Make sure not to include private keys or live customer information. -->

**Software versions**
- dj-stripe version:
- Python version:
- Django version:
- Stripe API version:
- Database type and version:

**Steps To Reproduce**
<!-- Please tell us how to reproduce the issue. Use numbered steps. Make sure not to include private keys or live customer information. -->

**Can you reproduce the issue with the latest version of master?**
<!-- Yes or No -->

**Expected Behavior**
<!-- Please clearly and concisely describe what should happen after following the reproduction steps -->

**Actual Behavior**
<!-- Please clearly and concisely describe what actually happens after following the reproduction steps. Include a traceback if you have it, but ENSURE YOU REDACT IT  -->

redpajama_set_name: RedPajamaGithub


text:
class AddEmailSettingsToUser < ActiveRecord::Migration
  def change
    add_column :users, :email_about_replies, :boolean, default: true
    add_column :users, :email_about_comments_on_authored, :boolean, default: true
    add_column :users, :email_about_comments_on_scited, :boolean, default: false
  end
end


text:
var TableComponent = Vue.extend({
  props: ['header', 'table', 'uuid', 'parent_uuid', 'tabletype'],
  template: '
' +
  '
{{ header }}
' +
  '
' +
  'View Column and Join Details	' +
  '
' +
  '
'
  ,
  methods: {
    viewcolumns(uuid, parent_uuid) {
      $("#column-overlay-content").addClass("in");
      $("#documentation-content").html('

<button class="btn btn-default pull-right iframe-close-button" onclick="closeiframe()"></button>

');
      $("#iframe").css({ 'height': $("#erdiagram").height() -20 + "px" });
      $("#iframe").contents().find("body").html("

Loading...

");
      $('#iframe').attr('src', '/tables/showcolumns/' + uuid + "/" + parent_uuid);
    }
  },
});
var TableColComponent = Vue.extend({
  props: ['header', 'table', 'uuid', 'parent_uuid', 'tabletype'],
  template: `

    {{ header }}

    {{ field.label }}

      View Column and Join Details

`
  ,
  methods: {
    viewcolumns(uuid, parent_uuid) {
      $('.iframe-load-msg').show();
      $('#db-diagram-table-iframe').off('load');
      $('#db-diagram-table-iframe').attr('src', 'about:blank');
      $('#db-diagram-table-iframe').on('load', () => { $('.iframe-load-msg').hide(); });
      $('#db-diagram-table-details').addClass('in');

      $('#db-diagram-table-header').text(this.header.split('_').join(' '))
      $('#db-diagram-table-header').attr('href', '/tables/show/' + uuid);
      // setTimeout ensures that the browser will render the blank iframe first. Thus, we
      // won't have the old iframe hanging around with the wrong columns.
      setTimeout(() => {
        $('#db-diagram-table-iframe').attr('src', '/tables/showcolumns/' + uuid + '?header=no');
      },1);
    }
  },
});

var DatasetSecComponent = Vue.extend({
  props: ['header', 'uuid', 'tabletype', 'description', 'icon'],
  template: '
' +
  '
{{ header }}' +
  '
' +
  // '
Dataset
' +
  '
' +
    '

	' +
  '
' +
  '
' +
    '

	' +
  '
' +

  '
'
  ,
  methods: {
    viewDataset(header, uuid, description, icon){
      $("#column-overlay-content").addClass("in");
      component = new DatasetSecDocComponent({
        propsData: {
          header: header,
          uuid: uuid,
          description: description,
          icon: icon
        }
      }).$mount();
      $("#documentation-content").html(component.$el)
    }
  }
});

var DatasetSecDocComponent = Vue.extend({
  props: ['header', 'uuid', 'description', 'icon'],
  template:
  '
' +

  '
' +
  '' +
    '' +
 '' +
  '' +
    '' +
  '' +
    '
<a class="table-sec-header-title" style="color:white" :href="`/tables/show/${uuid}`">{{ header }}
' +
    '<button type="button" style="font-size: 20px" id="tableclose" title="Close" v-on:click="closecoldoc()"></button>' +
  '
' +
 '
 {{description }}
' +
  '
<a :href="`/datasets/show/${uuid}`">Go to Dataset Page
' +
  '
'
  ,
  methods: {
    closecoldoc() {
      $("#column-overlay-content").removeClass("in");
    }
  },
});

var ReportSecComponent = Vue.extend({
  props: ['header', 'uuid', 'tabletype', 'description', 'thumbnail'],
  template: '
' +
  '
{{ header }}' +
  '
' +
  // '
Report
' +
  '

' +
  '
' +
  '
'
  ,
  methods: {
    viewReport(header, uuid, description, thumbnail){
      $("#column-overlay-content").addClass("in");
      component = new ReportSecDocComponent({
        propsData: {
          header: header,
          uuid: uuid,
          description: description,
          thumbnail: thumbnail
        }
      }).$mount();
      $("#documentation-content").html(component.$el)
    }
  }
});

var ReportSecDocComponent = Vue.extend({
  props: ['header', 'uuid', 'description', 'thumbnail'],
  template:
  '
' +
    '
' +
      '' +
      '
<a class="table-sec-header-title" style="color:white" :href="`/tables/show/${uuid}`">{{ header }}
' +
      '<button type="button" style="font-size: 20px" id="tableclose" title="Close" v-on:click="closecoldoc()"></button>' +
    '
' +
    '

' +
    '
 {{description }}
' +
    '
<a :href="`/reports/show/${uuid}`">Go to Report Page
' +
  '
'
  ,
  methods: {
    closecoldoc() {
      $("#column-overlay-content").removeClass("in");
    }
  },
});

var OrgSecComponent = Vue.extend({
  props: ['header', 'uuid', 'code', 'has_soc'],
  template: '
' +
  '
{{ header }}' +
  '
' +
  '

' +
  '
' +
  '' +
  '
' +
  '
' +
  '
' +
  '
'
  ,
  methods: {

    viewOrg(header,uuid,code,has_soc){
      $("#column-overlay-content").addClass("in");
      component = new OrgSecDocComponent({
        propsData: {
          header: header,
          uuid: uuid,
          code: code,
          has_soc: has_soc
        }
      }).$mount();
      $("#documentation-content").html(component.$el)
    },
  },
});

var OrgSecDocComponent = Vue.extend({
  props: ['header','uuid','code','has_soc'],
  template:
  '
' +

  '
' +
  '' +
    '
<a class="table-sec-header-title" style="color:white" :href="`#`">{{ header }}
' +
    '<button type="button" style="font-size: 20px" id="tableclose" title="Close" v-on:click="closecoldoc()"></button>' +
  '
' +

  '
The "Scope of Control" defines which rows a position can view.
' +

  '
' +
      '
' +
        'There are no {{header}} records assigned to your position. ' +
        '
' +
          '* Please note: If you have 'Override Privileges' on a table, you may not need any {{header}} records to access data.'+
      '
' +
      '
' +
          '' +
                'Please read the FAQ for information about requesting access to data.' +
          '' +
      '
' +
    '
' +
  '
' +
  '
View the {{ header }} assignments for your position.
' +
   '
' +
  '
'
  ,
  methods: {
    closecoldoc() {
      $("#column-overlay-content").removeClass("in");
    },
    viewMyOrg(code) {
      $("#column-overlay-content").addClass("in");
      $("#documentation-content").html('

<button class="btn btn-default pull-right iframe-close-button" onclick="closeiframe()"></button>

');
      $("#iframe").css({ 'height': $("#erdiagram").height() -20 + "px" });
      $("#iframe").contents().find("body").html("

Loading...

");
      $('#iframe').attr('src', '/users/my_org_hierarchy/' + code);
    }
  },
});

var ColumnDocComponent = Vue.extend({
  props: ['header','securityColumn','securityLevel','access_type','soc_code','has_soc', 'soc_rows_only','uuid','columns','description'],
  template:
  '
' +

    '
' +
        '' +
          '' +
        '' +
        '' +
        '' +
        '' +
        '
<a class="table-sec-header-title" style="color:white" :href="`/tables/show/${uuid}`">{{ header }}
' +
        '<button type="button" style="font-size: 20px" id="tableclose" title="Close" v-on:click="closecoldoc()"></button>' +
    '
' +

  '
 {{description }}
' +

  '
<a :href="`/tables/show/${uuid}`">Go to Table Page
' +

  '
' +
    '
' +
      '
' +
          '
' +
             '' +
          '
' +
	         '
' +
            '
What data can I see?
' +
              'You have Override Privileges. Your position can see restricted and unrestricted data for all rows in this table, regardless of scope of control requirements.' +
            '
' +
      '
' +
    '
' +

    '
' +
        '
' +
        '
' +
          '' +
        '
' +
      '
' +
        '
Why can\'t I see data?
' +
          'Your position does not have access to any data, including unrestricted, in this table.
' +
      '
' +
        '
' +
    '
' +

    '
' +
    '' +
      '' +
        '' +
            '
' +
            '
' +
              '' +
            '
' +
            '
' +
             '
Why can\'t I see data?
' +
              'Your position does not have access to any data, including unrestricted, in this table because you do not have Scope of Control.  This means that none of FundOrgs assigned to your position match the {{ securityColumn }} value for any row in the table.' +
              '
Please read the FAQ for information about requesting access to data.
' +
            '
' +
            '
' +
        '' +
        '' +
          '
' +
          '
' +
            '' +
          '
' +
          '
' +
            '
What data can I see?
' +
            'Your position can only view unrestricted columns in this table.  Your assigned positions do not have sufficient {{soc_code}} scope of control privileges to view restricted data.' +
            '
' +
          '
' +
        '' +
      '' +
      '' +
        '' +
          '
' +
          '
' +
            '' +
          '
' +
          '
' +
            '
What data can I see?
' +
            ' Your position may be able to view columns in this table. In order to view restricted and unrestricted data in this table, one of the FundOrg records assigned to your position must match the {{ securityColumn }} value for that row.' +
            '
' +
            '
' +
        '' +
        '' +
          '
' +
          '
' +
            '' +
          '
' +
          '
' +
            '
What data can I see?
' +
            ' Your position has access to all unrestricted columns in this table.  In order to view restricted, one of the FundOrg records assigned to your position must match the {{ securityColumn }} value for that row.' +
            '
' +
            '
' +
        '' +
      '' +
    '' +
    '
' +
  '
' +

    '
' +
      '
' +
        '
' +
            '
' +
              '' +
            '
' +
            '
' +
              '
What data can I see?
' +
                'You have Override Privileges. Your position can see restricted and unrestricted data for all rows in this table.' +
              '
' +
        '
' +
      '
' +
      '
' +
        '
' +
          '
' +
            '' +
          '
' +
        '
' +
          '
Why can\'t I see data?
' +
            'Your position does not have access to any data, including unrestricted, in this table. This table can only be viewed with Override Privileges.
' +
        '
' +
      '
' +
    '
' +
    '
' +

    '
' +

      '
' +
        '
' +
            '
' +
              '' +
            '
' +
            '
' +
              '
What data can I see?
' +
                'You have Override Privileges. Your position can see restricted and unrestricted data for all rows in this table, regardless of scope of control requirements.' +
              '
' +
        '
' +
      '
' +

      '
' +
      '
' +
      '
' +
        '' +
      '
' +
    '
' +
      '
Why can\'t I see data?
' +
        'Your position does not have access to any data, including unrestricted, in this table. This table can only be viewed with Comply or Override Access.
' +
    '
' +
      '
' +
    '
' +

    '
' +
        '
' +
        '
' +
          '' +
        '
' +
      '
' +
        '
Why can\'t I see data?
' +
          'Your position does not have access to any data, including unrestricted, in this table.
' +
      '
' +
        '
' +
    '
' +

      '
' +
        '' +
          '' +
            '' +
                '
' +
                '
' +
                  '' +
                '
' +
                '
' +
                '
Why can\'t I see data?
' +
                  'Your position does not have access to any data, including unrestricted, in this table because you do not have Scope of Control.  This means that none of FundOrgs assigned to your position match the {{ securityColumn }} value for any row in the table.' +
                  '
Please read the FAQ for information about requesting access to data.
' +
                '
' +
                '
' +
            '' +
            '' +
              '
' +
              '
' +
                '' +
              '
' +
              '
' +
                '
What data can I see?
' +
                'Your position can only view unrestricted columns in this table.  Your assigned positions do not have sufficient {{soc_code}} scope of control privileges to view restricted data.' +
                '
' +
              '
' +
            '' +
          '' +
          '' +
            '' +
              '
' +
              '
' +
                '' +
              '
' +
              '
' +
                '
What data can I see?
' +
                ' Your position may be able to view columns in this table. In order to view restricted and unrestricted data in this table, one of the FundOrg records assigned to your position must match the {{ securityColumn }} value for that row.' +
                '
' +
                '
' +
            '' +
            '' +
              '
' +
              '
' +
                '' +
              '
' +
              '
' +
                '
What data can I see?
' +
                ' Your position has access to all unrestricted columns in this table.  In order to view restricted, one of the FundOrg records assigned to your position must match the {{ securityColumn }} value for that row.' +
                '
' +
                '
' +
            '' +
          '' +
        '' +
      '
' +
    '
' +

  '
' +
    '
' +
      '' +
    '
' +
    '
' +
      '
What data can I see?
' +
      'This table is Unrestricted. You can see data in any column/row.' +
      '
' +
  '
' +

  '
Column security for this table:

' +
  '
' +
    '' +

    '' +
       '' +
    '' +
    '' +
      '' +
    '' +

    '' +
    '' +
      '' +
        '' +
      '' +
      '' +
        '' +
      '' +

    '' +
    '
{{ item.label }}
' +
  '
' +
  '

'
  ,
  methods: {
    closecoldoc() {
      $("#column-overlay-content").removeClass("in");
    }
  },
});

var TableSecComponent = Vue.extend({
  props: ['header', 'uuid', 'tabletype', 'securityLevel','soc_rows_only','securityColumn', 'access_type', 'soc_code', 'has_soc', 'columns', 'description' ],
  template: '
' +
  '
' +
  '' +
  '' +
  '' +
  '' +
    '' +
  '' +
  '{{ header }}' +
  '
' +
  '
' +
  '' +
  'This table is Unrestricted' +
  '	' +
  '
' +
  '
' +
  '' +
  'Scope of Control Required to see data.' +
  '	' +
  '
' +
  '
' +
  '' +
  'Scope of Control Column: {{ securityColumn }} ' +
  '	' +
  '
' +
  '
' +
  '' +
  'Scope of Control Type: {{ soc_code }} ' +
  '	' +
  '
' +
  '' +
  'Override Privileges' +
  '	' +
  '
' +
  '
'
  ,
  methods: {
    viewcolumns(header,securityColumn,securityLevel,access_type,has_soc,soc_code,soc_rows_only,uuid,columns,description) {
      $("#column-overlay-content").addClass("in");
      component = new ColumnDocComponent({
        propsData: {
          header: header,
          columns: columns,
          securityColumn: securityColumn,
          securityLevel: securityLevel,
          access_type: access_type,
          soc_rows_only:soc_rows_only,
          uuid: uuid,
          soc_code: soc_code,
          has_soc: has_soc,
          description: description,
        }
      }).$mount();
      $("#documentation-content").html(component.$el)
    }
  },
});


text:
from __future__ import unicode_literals
import webnotes
import webnotes.model.doc
import webnotes.model.code

conn = webnotes.conn

@webnotes.whitelist()
def get(name):
	"""
	   Return the :term:`doclist` of the `Page` specified by `name`
	"""
	from webnotes.model.code import get_obj
	page = get_obj('Page', name, with_children=1)
	page.get_from_files()
	return page.doclist

@webnotes.whitelist(allow_guest=True)
def getpage():
	"""
	   Load the page from `webnotes.form` and send it via `webnotes.response`
	"""
	page = webnotes.form_dict.get('name')
	doclist = get(page)

	if has_permission(doclist):
		# load translations
		if webnotes.lang != "en":
			from webnotes.modules import get_doc_path
			from webnotes.translate import get_lang_data
			d = doclist[0]
			messages = get_lang_data(get_doc_path(d.module, d.doctype, d.name),
				webnotes.lang, 'js')
			webnotes.response["__messages"] = messages

		webnotes.response['docs'] = doclist
	else:
		webnotes.response['403'] = 1
		raise webnotes.PermissionError, 'No read permission for Page %s' % \
			(doclist[0].title or page, )

def has_permission(page_doclist):
	if webnotes.user.name == "Administrator" or "System Manager" in webnotes.user.get_roles():
		return True

	page_roles = [d.role for d in page_doclist if d.fields.get("doctype")=="Page Role"]
	if webnotes.user.name == "Guest" and not (page_roles and "Guest" in page_roles):
		return False

	elif page_roles and not (set(page_roles) & set(webnotes.user.get_roles())):
		return False

	return True


text:
#include <assert.h>
#include <errno.h>
#ifndef NO_SGIDEFS_H
#include <sgidefs.h>
#endif
#include <unistd.h>
#include <endian.h>

#include <sysdep-cancel.h>
#include <sys/syscall.h>
#include <bp-checks.h>

#include <kernel-features.h>

#ifdef __NR_pwrite64            /* Newer kernels renamed but it's the same.  */
# ifdef __NR_pwrite
#  error "__NR_pwrite and __NR_pwrite64 both defined???"
# endif
# define __NR_pwrite __NR_pwrite64
#endif

#if defined __NR_pwrite || __ASSUME_PWRITE_SYSCALL > 0

# if __ASSUME_PWRITE_SYSCALL == 0
static ssize_t __emulate_pwrite (int fd, const void *buf, size_t count,
				 off_t offset) internal_function;
# endif

ssize_t
__libc_pwrite (fd, buf, count, offset)
     int fd;
     const void *buf;
     size_t count;
     off_t offset;
{
  ssize_t result;

#if _MIPS_SIM != _ABI64
  assert (sizeof (offset) == 4);
#endif

  if (SINGLE_THREAD_P)
    {
      /* First try the syscall.  */
#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64
      result = INLINE_SYSCALL (pwrite, 4, fd, CHECK_N (buf, count), count,
			       offset);
#else
      result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0,
			       __LONG_LONG_PAIR (offset >> 31, offset));
#endif
# if __ASSUME_PWRITE_SYSCALL == 0
      if (result == -1 && errno == ENOSYS)
        /* No system call available.  Use the emulation.  */
        result = __emulate_pwrite (fd, buf, count, offset);
# endif
      return result;
    }

  int oldtype = LIBC_CANCEL_ASYNC ();

  /* First try the syscall.  */
#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64
  result = INLINE_SYSCALL (pwrite, 4, fd, CHECK_N (buf, count), count, offset);
#else
  result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0,
			   __LONG_LONG_PAIR (offset >> 31, offset));
#endif
# if __ASSUME_PWRITE_SYSCALL == 0
  if (result == -1 && errno == ENOSYS)
    /* No system call available.  Use the emulation.  */
    result = __emulate_pwrite (fd, buf, count, offset);
# endif

  LIBC_CANCEL_RESET (oldtype);

  return result;
}

strong_alias (__libc_pwrite, __pwrite)
weak_alias (__libc_pwrite, pwrite)

# define __libc_pwrite(fd, buf, count, offset) \
     static internal_function __emulate_pwrite (fd, buf, count, offset)
#endif

#if __ASSUME_PWRITE_SYSCALL == 0
# include <sysdeps/posix/pwrite.c>
#endif


text:
using System;
using System.Diagnostics.CodeAnalysis;

namespace Restall.Ichnaea.Fody.AssemblyToProcess
{
	[AggregateRoot]
	public class SourceEventUsingStaticField
	{
		private static SomethingHappened staticField;

		[SuppressMessage("ReSharper", "UnusedMember.Global", Justification = CodeAnalysisJustification.StubForTesting)]
		public void DoSomething(Guid token)
		{
			staticField = new SomethingHappened(token);
			Source.Event.Of(staticField);
		}

		[SuppressMessage("ReSharper", "EventNeverSubscribedTo.Global", Justification = CodeAnalysisJustification.IchnaeaSubscribes)]
		public event Source.Of<SomethingHappened> EventSource;
	}
}


text:
package json;

import java.io.Serializable;

import javax.annotation.Generated;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

@Generated("org.jsonschema2pojo")
public class Ambience implements Serializable {

    @SerializedName("romantic")
    @Expose
    private Boolean romantic;
    @SerializedName("intimate")
    @Expose
    private Boolean intimate;
    @SerializedName("classy")
    @Expose
    private Boolean classy;
    @SerializedName("hipster")
    @Expose
    private Boolean hipster;
    @SerializedName("divey")
    @Expose
    private Boolean divey;
    @SerializedName("touristy")
    @Expose
    private Boolean touristy;
    @SerializedName("trendy")
    @Expose
    private Boolean trendy;
    @SerializedName("upscale")
    @Expose
    private Boolean upscale;
    @SerializedName("casual")
    @Expose
    private Boolean casual;

    /**
     *
     * @return
     *     The romantic
     */
    public Boolean getRomantic() {
        return romantic;
    }

    /**
     *
     * @param romantic
     *     The romantic
     */
    public void setRomantic(Boolean romantic) {
        this.romantic = romantic;
    }

    /**
     *
     * @return
     *     The intimate
     */
    public Boolean getIntimate() {
        return intimate;
    }

    /**
     *
     * @param intimate
     *     The intimate
     */
    public void setIntimate(Boolean intimate) {
        this.intimate = intimate;
    }

    /**
     *
     * @return
     *     The classy
     */
    public Boolean getClassy() {
        return classy;
    }

    /**
     *
     * @param classy
     *     The classy
     */
    public void setClassy(Boolean classy) {
        this.classy = classy;
    }

    /**
     *
     * @return
     *     The hipster
     */
    public Boolean getHipster() {
        return hipster;
    }

    /**
     *
     * @param hipster
     *     The hipster
     */
    public void setHipster(Boolean hipster) {
        this.hipster = hipster;
    }

    /**
     *
     * @return
     *     The divey
     */
    public Boolean getDivey() {
        return divey;
    }

    /**
     *
     * @param divey
     *     The divey
     */
    public void setDivey(Boolean divey) {
        this.divey = divey;
    }

    /**
     *
     * @return
     *     The touristy
     */
    public Boolean getTouristy() {
        return touristy;
    }

    /**
     *
     * @param touristy
     *     The touristy
     */
    public void setTouristy(Boolean touristy) {
        this.touristy = touristy;
    }

    /**
     *
     * @return
     *     The trendy
     */
    public Boolean getTrendy() {
        return trendy;
    }

    /**
     *
     * @param trendy
     *     The trendy
     */
    public void setTrendy(Boolean trendy) {
        this.trendy = trendy;
    }

    /**
     *
     * @return
     *     The upscale
     */
    public Boolean getUpscale() {
        return upscale;
    }

    /**
     *
     * @param upscale
     *     The upscale
     */
    public void setUpscale(Boolean upscale) {
        this.upscale = upscale;
    }

    /**
     *
     * @return
     *     The casual
     */
    public Boolean getCasual() {
        return casual;
    }

    /**
     *
     * @param casual
     *     The casual
     */
    public void setCasual(Boolean casual) {
        this.casual = casual;
    }

}


text:
module PatternGenerator where

import Tree

import Language.Haskell.TH

templateFoo :: Name -> [Char] -> DecsQ
templateFoo _ _ = return []


text:
using System;

namespace SimShift.Data.Common
{
    public class MemoryWriter : MemoryReader
    {
        public override bool Open()
        {
            m_hProcess = ProcessMemoryReaderApi.OpenProcess(PROCESS_VM_WRITE | PROCESS_VM_READ, 0, (uint)m_ReadProcess.Id);
            return m_hProcess != IntPtr.Zero;
        }

        #region Write<IntPtr>
        public void WriteFloat(IntPtr address, float value)
        {
            Write(address, BitConverter.GetBytes(value));
        }

        public void WriteDouble(IntPtr address, double value)
        {
            Write(address, BitConverter.GetBytes(value));
        }

        public void WriteByte(IntPtr address, byte value)
        {
            Write(address, new byte[1] { value });
        }

        public void WriteBytes(IntPtr address, byte[] value)
        {
            Write(address, value);
        }

        public void WriteInt16(IntPtr address, short value)
        {
            Write(address, BitConverter.GetBytes(value));
        }

        public void WriteInt32(IntPtr address, int value)
        {
            Write(address, BitConverter.GetBytes(value));
        }

        public void WriteInt64(IntPtr address, long value)
        {
            Write(address, BitConverter.GetBytes(value));
        }

        public void WriteUInt16(IntPtr address, ushort value)
        {
            Write(address, BitConverter.GetBytes(value));
        }

        public void WriteUInt32(IntPtr address, uint value)
        {
            Write(address, BitConverter.GetBytes(value));
        }

        public void WriteUInt64(IntPtr address, ulong value)
        {
            Write(address, BitConverter.GetBytes(value));
        }
        #endregion
        #region Write<Int>

        public void WriteFloat(int address, float value)
        {
            Write((IntPtr)address, BitConverter.GetBytes(value));
        }

        public void WriteDouble(int address, double value)
        {
            Write((IntPtr)address, BitConverter.GetBytes(value));
        }

        public void WriteByte(int address, byte value)
        {
            Write((IntPtr)address, new byte[1] { value });
        }

        public void WriteBytes(int address, byte[] value)
        {
            Write((IntPtr)address, value);
        }

        public void WriteInt16(int address, short value)
        {
            Write((IntPtr)address, BitConverter.GetBytes(value));
        }

        public void WriteInt32(int address, int value)
        {
            Write((IntPtr)address, BitConverter.GetBytes(value));
        }

        public void WriteInt64(int address, long value)
        {
            Write((IntPtr)address, BitConverter.GetBytes(value));
        }

        public void WriteUInt16(int address, ushort value)
        {
            Write((IntPtr)address, BitConverter.GetBytes(value));
        }

        public void WriteUInt32(int address, uint value)
        {
            Write((IntPtr)address, BitConverter.GetBytes(value));
        }

        public void WriteUInt64(int address, ulong value)
        {
            Write((IntPtr)address, BitConverter.GetBytes(value));
        }
        #endregion
        protected void Write(IntPtr address, byte[] data)
        {
            int bytesWritten;
            ProcessMemoryReaderApi.WriteProcessMemory(m_hProcess, address, data, (UIntPtr)data.Length, out bytesWritten);
        }
    }
}


text:
#ifndef wasm_ir_module_h
#define wasm_ir_module_h

#include "ir/element-utils.h"
#include "ir/find_all.h"
#include "ir/manipulation.h"
#include "ir/properties.h"
#include "pass.h"
#include "support/unique_deferring_queue.h"
#include "wasm.h"

namespace wasm::ModuleUtils {

// Copies a function into a module. If newName is provided it is used as the
// name of the function (otherwise the original name is copied).
inline Function*
copyFunction(Function* func, Module& out, Name newName = Name()) {
  auto ret = std::make_unique<Function>();
  ret->name = newName.is() ? newName : func->name;
  ret->type = func->type;
  ret->vars = func->vars;
  ret->localNames = func->localNames;
  ret->localIndices = func->localIndices;
  ret->debugLocations = func->debugLocations;
  ret->body = ExpressionManipulator::copy(func->body, out);
  ret->module = func->module;
  ret->base = func->base;
  // TODO: copy Stack IR
  assert(!func->stackIR);
  return out.addFunction(std::move(ret));
}

inline Global* copyGlobal(Global* global, Module& out) {
  auto* ret = new Global();
  ret->name = global->name;
  ret->type = global->type;
  ret->mutable_ = global->mutable_;
  ret->module = global->module;
  ret->base = global->base;
  if (global->imported()) {
    ret->init = nullptr;
  } else {
    ret->init = ExpressionManipulator::copy(global->init, out);
  }
  out.addGlobal(ret);
  return ret;
}

inline Tag* copyTag(Tag* tag, Module& out) {
  auto* ret = new Tag();
  ret->name = tag->name;
  ret->sig = tag->sig;
  out.addTag(ret);
  return ret;
}

inline ElementSegment* copyElementSegment(const ElementSegment* segment,
                                          Module& out) {
  auto copy = [&](std::unique_ptr<ElementSegment>&& ret) {
    ret->name = segment->name;
    ret->hasExplicitName = segment->hasExplicitName;
    ret->type = segment->type;
    ret->data.reserve(segment->data.size());
    for (auto* item : segment->data) {
      ret->data.push_back(ExpressionManipulator::copy(item, out));
    }

    return out.addElementSegment(std::move(ret));
  };

  if (segment->table.isNull()) {
    return copy(std::make_unique<ElementSegment>());
  } else {
    auto offset = ExpressionManipulator::copy(segment->offset, out);
    return copy(std::make_unique<ElementSegment>(segment->table, offset));
  }
}

inline Table* copyTable(const Table* table, Module& out) {
  auto ret = std::make_unique<Table>();
  ret->name = table->name;
  ret->hasExplicitName = table->hasExplicitName;
  ret->type = table->type;
  ret->module = table->module;
  ret->base = table->base;

  ret->initial = table->initial;
  ret->max = table->max;

  return out.addTable(std::move(ret));
}

inline Memory* copyMemory(const Memory* memory, Module& out) {
  auto ret = Builder::makeMemory(memory->name);
  ret->hasExplicitName = memory->hasExplicitName;
  ret->initial = memory->initial;
  ret->max = memory->max;
  ret->shared = memory->shared;
  ret->indexType = memory->indexType;

  return out.addMemory(std::move(ret));
}

inline DataSegment* copyDataSegment(const DataSegment* segment, Module& out) {
  auto ret = Builder::makeDataSegment();
  ret->name = segment->name;
  ret->hasExplicitName = segment->hasExplicitName;
  ret->memory = segment->memory;
  ret->isPassive = segment->isPassive;
  if (!segment->isPassive) {
    auto offset = ExpressionManipulator::copy(segment->offset, out);
    ret->offset = offset;
  }
  ret->data = segment->data;

  return out.addDataSegment(std::move(ret));
}

inline void copyModule(const Module& in, Module& out) {
  // we use names throughout, not raw pointers, so simple copying is fine
  // for everything *but* expressions
  for (auto& curr : in.exports) {
    out.addExport(new Export(*curr));
  }
  for (auto& curr : in.functions) {
    copyFunction(curr.get(), out);
  }
  for (auto& curr : in.globals) {
    copyGlobal(curr.get(), out);
  }
  for (auto& curr : in.tags) {
    copyTag(curr.get(), out);
  }
  for (auto& curr : in.elementSegments) {
    copyElementSegment(curr.get(), out);
  }
  for (auto& curr : in.tables) {
    copyTable(curr.get(), out);
  }
  for (auto& curr : in.memories) {
    copyMemory(curr.get(), out);
  }
  for (auto& curr : in.dataSegments) {
    copyDataSegment(curr.get(), out);
  }
  out.start = in.start;
  out.customSections = in.customSections;
  out.debugInfoFileNames = in.debugInfoFileNames;
  out.features = in.features;
  out.typeNames = in.typeNames;
}

inline void clearModule(Module& wasm) {
  wasm.~Module();
  new (&wasm) Module;
}

// Renaming

// Rename functions along with all their uses.
// Note that for this to work the functions themselves don't necessarily need
// to exist.  For example, it is possible to remove a given function and then
// call this to redirect all of its uses.
template<typename T> inline void renameFunctions(Module& wasm, T& map) {
  // Update the function itself.
  for (auto& [oldName, newName] : map) {
    if (Function* func = wasm.getFunctionOrNull(oldName)) {
      assert(!wasm.getFunctionOrNull(newName) || func->name == newName);
      func->name = newName;
    }
  }
  wasm.updateMaps();

  // Update all references to it.
  struct Updater : public WalkerPass<PostWalker<Updater>> {
    bool isFunctionParallel() override { return true; }

    T& map;

    void maybeUpdate(Name& name) {
      if (auto iter = map.find(name); iter != map.end()) {
        name = iter->second;
      }
    }

    Updater(T& map) : map(map) {}

    std::unique_ptr<Pass> create() override {
      return std::make_unique<Updater>(map);
    }

    void visitCall(Call* curr) { maybeUpdate(curr->target); }

    void visitRefFunc(RefFunc* curr) { maybeUpdate(curr->func); }
  };

  Updater updater(map);
  updater.maybeUpdate(wasm.start);
  PassRunner runner(&wasm);
  updater.run(&runner, &wasm);
  updater.runOnModuleCode(&runner, &wasm);
}

inline void renameFunction(Module& wasm, Name oldName, Name newName) {
  std::map<Name, Name> map;
  map[oldName] = newName;
  renameFunctions(wasm, map);
}

// Convenient iteration over imported/non-imported module elements

template<typename T> inline void iterImportedMemories(Module& wasm, T visitor) {
  for (auto& import : wasm.memories) {
    if (import->imported()) {
      visitor(import.get());
    }
  }
}

template<typename T> inline void iterDefinedMemories(Module& wasm, T visitor) {
  for (auto& import : wasm.memories) {
    if (!import->imported()) {
      visitor(import.get());
    }
  }
}

template<typename T>
inline void iterMemorySegments(Module& wasm, Name memory, T visitor) {
  for (auto& segment : wasm.dataSegments) {
    if (!segment->isPassive && segment->memory == memory) {
      visitor(segment.get());
    }
  }
}

template<typename T>
inline void iterActiveDataSegments(Module& wasm, T visitor) {
  for (auto& segment : wasm.dataSegments) {
    if (!segment->isPassive) {
      visitor(segment.get());
    }
  }
}

template<typename T> inline void iterImportedTables(Module& wasm, T visitor) {
  for (auto& import : wasm.tables) {
    if (import->imported()) {
      visitor(import.get());
    }
  }
}

template<typename T> inline void iterDefinedTables(Module& wasm, T visitor) {
  for (auto& import : wasm.tables) {
    if (!import->imported()) {
      visitor(import.get());
    }
  }
}

template<typename T>
inline void iterTableSegments(Module& wasm, Name table, T visitor) {
  // Just a precaution so that we don't iterate over passive elem segments by
  // accident
  assert(table.is() && "Table name must not be null");

  for (auto& segment : wasm.elementSegments) {
    if (segment->table == table) {
      visitor(segment.get());
    }
  }
}

template<typename T>
inline void iterActiveElementSegments(Module& wasm, T visitor) {
  for (auto& segment : wasm.elementSegments) {
    if (segment->table.is()) {
      visitor(segment.get());
    }
  }
}

template<typename T> inline void iterImportedGlobals(Module& wasm, T visitor) {
  for (auto& import : wasm.globals) {
    if (import->imported()) {
      visitor(import.get());
    }
  }
}

template<typename T> inline void iterDefinedGlobals(Module& wasm, T visitor) {
  for (auto& import : wasm.globals) {
    if (!import->imported()) {
      visitor(import.get());
    }
  }
}

template<typename T>
inline void iterImportedFunctions(Module& wasm, T visitor) {
  for (auto& import : wasm.functions) {
    if (import->imported()) {
      visitor(import.get());
    }
  }
}

template<typename T> inline void iterDefinedFunctions(Module& wasm, T visitor) {
  for (auto& import : wasm.functions) {
    if (!import->imported()) {
      visitor(import.get());
    }
  }
}

template<typename T> inline void iterImportedTags(Module& wasm, T visitor) {
  for (auto& import : wasm.tags) {
    if (import->imported()) {
      visitor(import.get());
    }
  }
}

template<typename T> inline void iterDefinedTags(Module& wasm, T visitor) {
  for (auto& import : wasm.tags) {
    if (!import->imported()) {
      visitor(import.get());
    }
  }
}

template<typename T> inline void iterImports(Module& wasm, T visitor) {
  iterImportedMemories(wasm, visitor);
  iterImportedTables(wasm, visitor);
  iterImportedGlobals(wasm, visitor);
  iterImportedFunctions(wasm, visitor);
  iterImportedTags(wasm, visitor);
}

// Helper class for performing an operation on all the functions in the module,
// in parallel, with an Info object for each one that can contain results of
// some computation that the operation performs.
// The operation performed should not modify the wasm module in any way, by
// default - otherwise, set the Mutability to Mutable. (This is not enforced at
// compile time - TODO find a way - but at runtime in pass-debug mode it is
// checked.)
template<typename K, typename V> using DefaultMap = std::map<K, V>;
template<typename T,
         Mutability Mut = Immutable,
         template<typename, typename> class MapT = DefaultMap>
struct ParallelFunctionAnalysis {
  Module& wasm;

  using Map = MapT<Function*, T>;
  Map map;

  using Func = std::function<void(Function*, T&)>;

  ParallelFunctionAnalysis(Module& wasm, Func work) : wasm(wasm) {
    // Fill in map, as we operate on it in parallel (each function to its own
    // entry).
    for (auto& func : wasm.functions) {
      map[func.get()];
    }

    // Run on the imports first. TODO: parallelize this too
    for (auto& func : wasm.functions) {
      if (func->imported()) {
        work(func.get(), map[func.get()]);
      }
    }

    struct Mapper : public WalkerPass<PostWalker<Mapper>> {
      bool isFunctionParallel() override { return true; }
      bool modifiesBinaryenIR() override { return Mut; }

      Mapper(Module& module, Map& map, Func work)
        : module(module), map(map), work(work) {}

      std::unique_ptr<Pass> create() override {
        return std::make_unique<Mapper>(module, map, work);
      }

      void doWalkFunction(Function* curr) {
        assert(map.count(curr));
        work(curr, map[curr]);
      }

    private:
      Module& module;
      Map& map;
      Func work;
    };

    PassRunner runner(&wasm);
    Mapper(wasm, map, work).run(&runner, &wasm);
  }
};

// Helper class for analyzing the call graph.
//
// Provides hooks for running some initial calculation on each function (which
// is done in parallel), writing to a FunctionInfo structure for each function.
// Then you can call propagateBack() to propagate a property of interest to the
// calling functions, transitively.
//
// For example, if some functions are known to call an import "foo", then you
// can use this to find which functions call something that might eventually
// reach foo, by initially marking the direct callers as "calling foo" and
// propagating that backwards.
template<typename T> struct CallGraphPropertyAnalysis {
  Module& wasm;

  // The basic information for each function about whom it calls and who is
  // called by it.
  struct FunctionInfo {
    std::set<Function*> callsTo;
    std::set<Function*> calledBy;
    // A non-direct call is any call that is not direct. That includes
    // CallIndirect and CallRef.
    bool hasNonDirectCall = false;
  };

  using Map = std::map<Function*, T>;
  Map map;

  using Func = std::function<void(Function*, T&)>;

  CallGraphPropertyAnalysis(Module& wasm, Func work) : wasm(wasm) {
    ParallelFunctionAnalysis<T> analysis(wasm, [&](Function* func, T& info) {
      work(func, info);
      if (func->imported()) {
        return;
      }
      struct Mapper : public PostWalker<Mapper> {
        Mapper(Module* module, T& info, Func work)
          : module(module), info(info), work(work) {}

        void visitCall(Call* curr) {
          info.callsTo.insert(module->getFunction(curr->target));
        }
        void visitCallIndirect(CallIndirect* curr) {
          info.hasNonDirectCall = true;
        }
        void visitCallRef(CallRef* curr) { info.hasNonDirectCall = true; }

      private:
        Module* module;
        T& info;
        Func work;
      } mapper(&wasm, info, work);
      mapper.walk(func->body);
    });

    map.swap(analysis.map);

    // Find what is called by what.
    for (auto& [func, info] : map) {
      for (auto* target : info.callsTo) {
        map[target].calledBy.insert(func);
      }
    }
  }

  enum NonDirectCalls { IgnoreNonDirectCalls, NonDirectCallsHaveProperty };

  // Propagate a property from a function to those that call it.
  //
  // hasProperty() - Check if the property is present.
  // canHaveProperty() - Check if the property could be present.
  // addProperty() - Adds the property. This receives a second parameter which
  //                 is the function due to which we are adding the property.
  void propagateBack(std::function<bool(const T&)> hasProperty,
                     std::function<bool(const T&)> canHaveProperty,
                     std::function<void(T&, Function*)> addProperty,
                     NonDirectCalls nonDirectCalls) {
    // The work queue contains items we just learned can change the state.
    UniqueDeferredQueue<Function*> work;
    for (auto& func : wasm.functions) {
      if (hasProperty(map[func.get()]) ||
          (nonDirectCalls == NonDirectCallsHaveProperty &&
           map[func.get()].hasNonDirectCall)) {
        addProperty(map[func.get()], func.get());
        work.push(func.get());
      }
    }
    while (!work.empty()) {
      auto* func = work.pop();
      for (auto* caller : map[func].calledBy) {
        // If we don't already have the property, and we are not forbidden
        // from getting it, then it propagates back to us now.
        if (!hasProperty(map[caller]) && canHaveProperty(map[caller])) {
          addProperty(map[caller], func);
          work.push(caller);
        }
      }
    }
  }
};

// Helper function for collecting all the non-basic heap types used in the
// module, i.e. the types that would appear in the type section.
std::vector<HeapType> collectHeapTypes(Module& wasm);

struct IndexedHeapTypes {
  std::vector<HeapType> types;
  std::unordered_map<HeapType, Index> indices;
};

// Similar to `collectHeapTypes`, but provides fast lookup of the index for each
// type as well. Also orders the types to be valid and sorts the types by
// frequency of use to minimize code size.
IndexedHeapTypes getOptimizedIndexedHeapTypes(Module& wasm);

} // namespace wasm::ModuleUtils

#endif // wasm_ir_module_h


text:
/*
* Usage:
*  var ntpl = require("ntpl").ntpl;
*  ntpl({
*    template: filename or inline template (@string),
*    name: template name (template will be accessible with this name)(@string),
*    args: arguments list (@array),
*    watch: Should reload template if file changed (@boolean),
*    callback: If callback provided - all things will be done in async mode,
*          and callback will be fired (@function(template function) )
*    watchCallback: Fired on file change (@function(template function) )
*  });
*
*    ntpl(...) will generate(or return previously generated) template function,
*    that returns string value
*
*    Also ntpl.modificators are available
*    See ntpl.block and ntpl.filter for examples of usage
*/
/**
*  @param {string} $src Template source.
*  @param {object} ntpl ntpl object.
*  @param {object} $scope namespace.
*  @param {array.<string, string>} $rep replacements.
*  @return {object} generated function.
*/
function scopedEval($src, ntpl, $scope, $rep) {
  return eval($src);
}
/**
* exports.parse holds ntpl
*/
(function($) {

  var fs = require('fs');
  var path = require('path');
  var ntpl_native = require('./ntpl.native');

  var $tab = '\t', gid = 0, rid = 0;

  var refreshTemplate = [], namecache = {};

  var fileWatchers = [];

  var REF_CHECK = {};

  /** @const */
  var WATCH = 'w';

  /** @const */
  var REFRESH_ID = 'r';

  // Modificators
  var modificators = {
    // Direct output
    // Example: {%= "hello world" %}
    /** @return {string} template. */
    '=': function(str) {
      return '$p(' + str + ',$_);';
    },

    // "if", "else", "elseif"
    // Example: {%if true%}I'm right!{%else%}I'm wrong{%/if%}
    // {%if false%}I'm wrong{%elseif true%}I'm true!{%/if%}
    /** @return {string} template. */
    'if': function(str) {
      return 'if(' + str + '){';
    },

    'else': '}else{',

    /** @return {string} template. */
    'elseif': function(str) {
      return '}else if(' + str + '){';
    },

    '/if': '}',

    // Short-hand for each method
    // Example: {%each arr%}
{%=this%}
{%/each%}
    /** @return {string} template. */
    'each': function(str) {
      return 'ntpl.each(' + str + ',function($i){';
    },

    '/each': '});',

    // Catch
    // Example: {%catch var a%}

{%/catch%}{%= a%}
    /** @return {string} template. */
    'catch' : function(str) {
      return str + '=(function(){var $_=[];';
    },

    '/catch' : 'return $_.join("")})();'
  };

  // Add native modificators
  if (ntpl_native.initModificators)
    ntpl_native.initModificators(modificators);

  /**
  * Watch file changes
  * And refresh template
  *
  *  @param {string} filename Filename.
  *  @param {function(string,object): object} parse parse function.
  *  @return {undefined} nothing.
  */
  function watchChanges(filename, parse) {

    // Should be set watch flag in options
    if (!parse[WATCH])
      return;

    var refresh_id = parse[REFRESH_ID], refreshFunc;

    // Store filename for future unWatch
    fileWatchers[fileWatchers.length] = filename;

    fs.watchFile(filename, {persistent: true, interval: 100 }, function() {

      fs.readFile(filename, function(err, data) {
        if (err)
          return;

        // Sometimes watchFile can be called before
        // template actually builds
        // check this out
        if (refreshFunc = refreshFunc || refreshTemplate[refresh_id]) {
          refreshFunc(parse.call(REF_CHECK, data.toString()));
        }

      });

    });

  }
  /**
  * Check if templatename is filename
  * If so - load it
  * and watch changes of file
  *
  *  @param {string} filename Template name.
  *  @param {function(string,object): object} parse parse function.
  *  @param {function(string): undefined} callback Callback.
  *  @return {undefined} nothing.
  */
  function readTemplateAsync(filename, parse, callback) {

    // Check if file exists in async mode
    path.exists(filename, function(exists) {
      // If not - we've got not filename, but template
      // Fire callback
      if (!exists)
        return callback(filename);

      // Get file contents
      fs.readFile(filename, function(err, data) {
        // If can't - fire callback
        if (err)
          callback(filename);

        // Fire callback with file contents
        callback(data.toString());
      });

      // Watch for file changes
      watchChanges(filename, parse);
    });

  }
  /**
  * Check if templatename is filename
  * If so - load it
  * and watch changes of file
  *
  *  @param {string} filename Template name.
  *  @param {function(string,object): object} parse parse function.
  *  @return {string} content or filename.
  */
  function readTemplateSync(filename, parse) {
    // If there is no file
    // "filename" isn't really filename, but template
    // So return it
    if (!path.existsSync(filename))
      return filename;

    // Get template contents
    var template = fs.readFileSync(filename).toString();

    // Watch for file changes
    watchChanges(filename, parse);

    return template;

  }
  /**
  * Process input
  *   As object or as string
  *   Object: {
  *    template: "...", // filename or string
  *    args: ["arg1", ..., "argN"], //  template arguments
  *    callback: function(generatedTemplate){}, // will load template from file
  *              asynchronously
  *    watch: true/false, // Rebuild template on file refresh
  *    watchCallback: function(generatedTemplate){} // Called on rebuild
  *   }
  *
  *  @param {object.<string, *>} options Calling options.
  *  @return {function(object.<string, *>): string} renderer function.
  */
  var ntpl = $.ntpl = function(options) {
    // If options is string - generate template
    if (typeof options === 'string')
      return $main(options);

    // Cache for better compression
    var _template = options.template || '',
        _args = options.args,
        _name = options.name;

    // If we have only name - pass it as first arguments
    if (_name && !_template && !_args)
      return $main(_name);

    // If we at least have template - call normal
    if (_template)
      return $main(_template, _args || [], _name, options.callback,
                   options.watch, options.watchCallback);
  }
  /**
  * Generate, cache, return template
  * $main("name") - get cached template with name
  * $main("%template%", {args}, [name]) - generate template and optionally give
  *       it a name
  * Args = Template arguments
  * @param {string} str Input template, or template name.
  * @param {array.<string>} args Predefined arguments.
  * @param {string} name Template name.
  * @param {function(function(object): string): undefined} callback Callback for
  *       asynchronous mode.
  * @param {boolean} watch Watch file changes or not?.
  * @param {function(function(object): string): undefined} watchCallback
  *     When file is changed - this callback will be fired.
  * @return {function(object.<string, *>): string} renderer function.
  */
  function $main(str , args, name, callback, watch, watchCallback) {
    var arglen = arguments.length,
        // Args converted to string
        // Need them for caching
        cache_name,
        // Need for async load
        replaceScope,
        // This template
        tpl,
        // Generate refresh_id
        refresh_id = rid += 1,
        // Possible filename, store it,
        filename = name,
        // Index
        i;

    // If have been cached by name
    // $.template("name")
    if (arglen === 1 && (i = namecache[str]))
      return i;

    // Watch is false by default
    if (watch === undefined)
      watch = false;

    // Store refresh_id & watch option
    // So they will be accessible in readTemplateSync/Async
    parse[REFRESH_ID] = refresh_id;
    parse[WATCH] = watch;

    // If we don't have callback
    if (!callback) {
      // Do all work in sync
      str = readTemplateSync(str, parse);
    } else {
      // Do all work in async
      readTemplateAsync(str, parse, function(data) {
        if (replaceScope) {
          // Everything is ok
          if (tpl) {
            // If we have template - change references in it
            replaceScope(parse.call(REF_CHECK, data));
          } else {
            // Generate new template
            tpl = parse(data);
          }
        } else {
          // Some error, template is undefined now
          tpl = parse(str);
        }
        callback(tpl);
      });
      // Return empty template before loading
      str = '';
    }

    // If we have template - return it and save to know
    // that it was generated
    //
    // Otherwise generate template
    return tpl = tpl || parse(str);

    /**
    * Parsing input template with options
    * @param {string} str Input template.
    * @param {object.<string, *>} options parsing options.
    * @return {function(object.<string, *>): string} renderer function.
    */
    function parse(str, callback) {

      var compiled,
          namespace = {
            // Global template Id, may be used by plugins
            $gid: gid += 1
          },
          local,
          // Index
          i,
          // Var count
          varcount = 0,
          // Has code inside
          hasCode,
          // Replacements
          $rep,
          // Store name (isolate from $main scope)
          _name = name,
          // Isolate from $main scope
          _args;

      // Add $_ to scope
      // And check that args is array
      (args instanceof Array) ?
          ((_args = args)[args.length] = '$_') :
          (_args = args = ['$_']);

      var options = {};
      // Preprocess template
      // Go through each row
      // And replace it with code
      var parsed = ntpl_native.parse(str, $.modificators, namespace, options);

      // If template is not plain (with {% or %} inside) - generate function
      if (hasCode = parsed &&
          (parsed.replVars.length > 1 || parsed.code.length > 0)) {
        // parsed = {replacements: [], code: []}
        var compiled = parsed.code.join('');
        var replVars = parsed.replVars;

        // Replacements can't be changed
        $rep = Object.freeze(parsed.replacements);

        // If template is using options
        if (options) {
          var oargs = options.args;

          // If arguments returned
          if (oargs) {
            // If oargs not array - make it array!

            if (!oargs instanceof Array)
              oargs = [oargs];

            // If args added
            if (_args.length)
              // Add arguments
              _args = _args.concat(oargs);
          }

          // If name added - change it
          if (name = options.name || name)
            // If array - convert it
            name = name.toString();

        }

        replVars = replVars.length ? '$' + replVars.join(',$') : '';

        // Create function with overdriven args
        // In secure closure
        // Because we don't want server termination using try
        try {

          i = scopedEval('(function(' + replVars + '){' +
              ' return (function($args,' + _args.join(',') + '){' +
              '  $_=[];' +
              '  function $p(a,$_){$_[$_.length]=a};' +
              compiled + ';' +
              '   return $_.join("")' +
              ' })' +
              '}).apply(this, $rep);', $, namespace, $rep);

        } catch (e) {

          // Notify admin about this
          var err = '(' + (name || 'no - file') + ') :: ' + e.message;

          // Return functions that returns nothing
          i = function() {return err;}

        }

      } else {
        // Else function can return template itself
        str = parsed.replVars[0] || str;
        i = function() {return str};
      }

      // Because REF_CHECK is internal scoped variable
      // We can use it to check operations
      // But we simply need to return fresh template functions
      // If called in REF_CHECK context
      if (this === REF_CHECK)
        return {i: i, args: _args, name: name};

      /**
      * Generate arguments array that will be passed to template function
      * @param {object.<string, *>} callArgs Arguments that will be used now.
      * @return {array.<*>} generated arguments.
      */
      function createArguments(callArgs) {

        /** There're some predefined arguments such as:
        * $args = callArgs,
        * $scope = namespace,
        */
        var result = [callArgs], i;

        for (i in _args)
          result[result.length] = callArgs[_args[i]];

        return result;

      }

      /**
      *  And cache it wrapper, that will recreate
      *  scope and call original function
      *  If plain - no need in wrapper
      *  @param {object} args arguments to pass.
      *  @return {string} rendered template.
      */
      local = function(callArgs) {
        // Args can be null
        callArgs = callArgs || {};

        // Extend callArgs with namespace
        for (name in namespace)
          callArgs[name] = namespace[name];

        // Attach permament scope to namespace

        // Return result of execution
        return i.apply(local, createArguments(callArgs));
      };

      // This function will refresh template
      // If file is reloaded (see watch option)
      refreshTemplate[refresh_id] = replaceScope = function(o) {

        // Refresh function
        i = o.i;

        // Refresh arguments
        _args = o.args;

        // If name was changed
        if (_name !== o.name) {

          // Copy if name is given
          if (o.name)
            namecache[o.name] = local;

          // Delete old
          namecache[_name] = undefined;

          _name = o.name;
        }

        // Notify possible listeners
        watchCallback && watchCallback(o);
      };

      // Expose unwatch
      local.unwatch = function() {
        try {
          fs.unwatchFile(filename);
        } catch (e) {
        }
      }

      // Expose options
      local.options = options;

      // If name is defined
      if (name) {
        // Add to name cache
        namecache[name] = local;

      }

      // Return wrapper
      if (callback) {
        callback(local);
      } else {
        return local;
      }
    }
  }

  // Imported from jQuery
  ntpl.each = $.each = function(object, callback) {
    var name, i = 0, length = object.length;

    if (length === undefined) {
      for (name in object) {
        if (!name || object[name] === undefined || !object.hasOwnProperty(name))
          continue;
        if (callback.call(object[name], name, object[name]) === false) {
          break;
        }
      }
    } else {
      for (var value = object[0];
          i < length && callback.call(value, i, value) !== false;
          value = object[i += 1]) {}
    }
    return object;
  }

  // Add modificators to ntpl
  ntpl.modificators = $.modificators = modificators;

  /**
  *  Express.js possible integration
  * @param {string} str "templatename@templatefile".
  */
  ntpl.render = $.render = function(str, args) {
    str = str.split('@', 2);

    var cached;

    return ((cached = namecache[str[0]]) ?
        cached :
        ntpl({
          name: str[0],
          template: str[1],
          watch: true
        }))(args);
  }

  // On Exit
  process.on('exit', ntpl.unwatchAll = function() {
    try {
      for (var i = 0 , len = fileWatchers.length; i < len; i++)
        fs.unwatchFile(fileWatchers[i]);
    } catch (err) {
      console.log(err);
    }
  });

  // Catch exceptions
  process.on('uncaughtException', function(err) {
    console.log('ntpl caught exception: ' + err);
  });

  /**
  * Install plugin
  * @param {string} path Path.
  */
  function plugin(path) {
    if (path === 'ntpl.block' || path === 'ntpl.filter') {
      path = './' + path;
    }
    var plugin = require(path);
    // If it's correct plugin
    plugin.init && plugin.init(ntpl);
  }

  /**
  * Exposed plugin install
  * ntpl.plugin('plugin1', 'plugin2');
  */
  ntpl.plugins = $.plugins = function() {
    // If called without paths
    var len;
    if (!(len = arguments.length)) return;

    for (var i = 0; i < len; i++) {
      plugin(arguments[i].toString());
    }

    // Allow chaining
    return $;
  }

})(exports);
// Prevent any changes to ntpl
Object.freeze(exports);


text:
<?php

namespace BookBundle\Admin;

use BookBundle\Entity\Author;
use Doctrine\DBAL\Query\QueryBuilder;
use Sonata\AdminBundle\Admin\Admin;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Form\FormMapper;

class AuthorAdmin extends Admin
{

    /**
     * @inheritdoc
     */
    public function getFormBuilder()
    {
        $this->formOptions['data_class'] = $this->getClass();

        $options = $this->formOptions;

        if(!$this->getSubject() || is_null($this->getSubject()->getId())){
            $options['validation_groups'] = 'Add';
        }else{
            $options['validation_groups'] = 'Edit';
        }

        $formBuilder = $this->getFormContractor()->getFormBuilder( $this->getUniqid(), $options);

        $this->defineFormBuilder($formBuilder);

        return $formBuilder;
    }

    /**
     * {@inheritdoc}
     */
    public function configureFormFields(FormMapper $formMapper)
    {
        $formMapper->add('firstName')
            ->add('lastName')
            ->add('description')
            ->add('image', 'file',array('image_path' => 'imageUrl', 'image_style' => 'avatar_profile_edit'))
            ->add('active');
    }

    /**
     * {@inheritdoc}
     */
    public function configureListFields(ListMapper $listMapper)
    {
        $listMapper->addIdentifier('firstName')
            ->add('lastName')
            ->add('imageUrl',null,array(
                    'template' => 'AdminOverrideBundle:Admin:avatar_list_field.html.twig',
                    'sortable' => false
                )
            )
            ->add('active','boolean',array('editable' => true));
    }

    /**
     * {@inheritdoc}
     */
    protected function configureDatagridFilters(DatagridMapper $datagridMapper)
    {
        $datagridMapper->add('firstName', 'doctrine_orm_callback', array(
                                'label' => 'First Name or Last Name',
                                'callback' => function ($queryBuilder, $alias, $field, $value) {
                                    if (empty($value['value'])) {
                                        return false;
                                    }
                                    /** @var QueryBuilder $queryBuilder */
                                    $queryBuilder->andWhere('o.firstName LIKE :value OR o.lastName LIKE :value');
                                    $queryBuilder->setParameter('value','%'.$value['value'].'%');

                                    return true;
                                }
                            ))
                        ->add('active');
    }

    /**
     * {@inheritdoc}
     */
    public function preUpdate($object)
    {
        $uploadService = $this->getConfigurationPool()->getContainer()->get('framework_extension.upload_manager');
        $uploadService->setDocumentUploadDir(Author::IMAGE_DIR);
        $uploadService->setDocumentUrl($object,'getImage','setImage','setImageUrl','getOldImageUrl',Author::NAME_PATH);
    }

    /**
     * {@inheritdoc}
     */
    public function prePersist($object)
    {
        $uploadService = $this->getConfigurationPool()->getContainer()->get('framework_extension.upload_manager');
        $uploadService->setDocumentUploadDir(Author::IMAGE_DIR);
        $uploadService->setDocumentUrl($object,'getImage','setImage','setImageUrl','getOldImageUrl',Author::NAME_PATH);

        $user = $this->getConfigurationPool()->getContainer()->get('security.token_storage')->getToken()->getUser();
        $object->setUser($user);
    }

    /**
     * {@inheritdoc}
     */
    public function postRemove($object)
    {
        $uploadService = $this->getConfigurationPool()->getContainer()->get('framework_extension.upload_manager');
        $uploadService->removeDocument($object,'getImageUrl');
    }
}


text:
using namespace std;

#include "myclass.h"

#include <boost/shared_ptr.hpp>

typedef boost::shared_ptr<myclass> mc_ptr;

int main(int argc, char** argv) {

    mc_ptr mc_inst(new myclass);

    cout << "test for echo" << endl;
    return 0;

}


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

<title>Validator (Java Platform SE 8 )</title>
<meta name="date" content="2014-12-17">
<meta name="keywords" content="javax.xml.bind.Validator interface">
<meta name="keywords" content="setEventHandler()">
<meta name="keywords" content="getEventHandler()">
<meta name="keywords" content="validate()">
<meta name="keywords" content="validateRoot()">
<meta name="keywords" content="setProperty()">
<meta name="keywords" content="getProperty()">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Java™ Platform
Standard Ed. 8

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

javax.xml.bind

Interface Validator

Deprecated.

since JAXB 2.0

public interface Validator

As of JAXB 2.0, this class is deprecated and optional.

 The <tt>Validator</tt> class is responsible for controlling the validation
 of content trees during runtime.

 Three Forms of Validation

Unmarshal-Time Validation

This form of validation enables a client application to receive
            information about validation errors and warnings detected while
            unmarshalling XML data into a Java content tree and is completely
            orthogonal to the other types of validation.  To enable or disable
            it, see the javadoc for
            Unmarshaller.setValidating.
            All JAXB 1.0 Providers are required to support this operation.

On-Demand Validation

 This form of validation enables a client application to receive
             information about validation errors and warnings detected in the
             Java content tree.  At any point, client applications can call
             the Validator.validate method
             on the Java content tree (or any sub-tree of it).  All JAXB 1.0
             Providers are required to support this operation.

Fail-Fast Validation

 This form of validation enables a client application to receive
             immediate feedback about modifications to the Java content tree
             that violate type constraints on Java Properties as defined in
             the specification.  JAXB Providers are not required support
             this type of validation.  Of the JAXB Providers that do support
             this type of validation, some may require you to decide at schema
             compile time whether or not a client application will be allowed
             to request fail-fast validation at runtime.

 The <tt>Validator</tt> class is responsible for managing On-Demand Validation.
 The <tt>Unmarshaller</tt> class is responsible for managing Unmarshal-Time
 Validation during the unmarshal operations.  Although there is no formal
 method of enabling validation during the marshal operations, the
 <tt>Marshaller</tt> may detect errors, which will be reported to the
 <tt>ValidationEventHandler</tt> registered on it.

 Using the Default EventHandler

   If the client application does not set an event handler on their
   <tt>Validator</tt>, <tt>Unmarshaller</tt>, or <tt>Marshaller</tt> prior to
   calling the validate, unmarshal, or marshal methods, then a default event
   handler will receive notification of any errors or warnings encountered.
   The default event handler will cause the current operation to halt after
   encountering the first error or fatal error (but will attempt to continue
   after receiving warnings).

 Handling Validation Events

   There are three ways to handle events encountered during the unmarshal,
   validate, and marshal operations:

Use the default event handler

The default event handler will be used if you do not specify one
            via the <tt>setEventHandler</tt> API's on <tt>Validator</tt>,
            <tt>Unmarshaller</tt>, or <tt>Marshaller</tt>.

Implement and register a custom event handler

Client applications that require sophisticated event processing
            can implement the <tt>ValidationEventHandler</tt> interface and
            register it with the <tt>Unmarshaller</tt> and/or
            <tt>Validator</tt>.

Use the ValidationEventCollector
            utility

For convenience, a specialized event handler is provided that
            simply collects any <tt>ValidationEvent</tt> objects created
            during the unmarshal, validate, and marshal operations and
            returns them to the client application as a
            <tt>java.util.Collection</tt>.

 Validation and Well-Formedness

 Validation events are handled differently depending on how the client
 application is configured to process them as described in the previous
 section.  However, there are certain cases where a JAXB Provider indicates
 that it is no longer able to reliably detect and report errors.  In these
 cases, the JAXB Provider will set the severity of the ValidationEvent to
 FATAL_ERROR to indicate that the unmarshal, validate, or marshal operations
 should be terminated.  The default event handler and
 <tt>ValidationEventCollector</tt> utility class must terminate processing
 after being notified of a fatal error.  Client applications that supply their
 own <tt>ValidationEventHandler</tt> should also terminate processing after
 being notified of a fatal error.  If not, unexpected behaviour may occur.

 Supported Properties

 There currently are not any properties required to be supported by all
 JAXB Providers on Validator.  However, some providers may support
 their own set of provider specific properties.

Since:

JAXB1.0

See Also:

JAXBContext,
Unmarshaller,
ValidationEventHandler,
ValidationEvent,
ValidationEventCollector

Method Summary

All Methods Instance Methods Abstract Methods Deprecated Methods

Modifier and Type
Method and Description

ValidationEventHandler
getEventHandler()

Deprecated.

since JAXB2.0

Object
getProperty(String name)

Deprecated.

since JAXB2.0

void
setEventHandler(ValidationEventHandler handler)

Deprecated.

since JAXB2.0

void
setProperty(String name,
           Object value)

Deprecated.

since JAXB2.0

boolean
validate(Object subrootObj)

Deprecated.

since JAXB2.0

boolean
validateRoot(Object rootObj)

Deprecated.

since JAXB2.0

Method Detail

setEventHandler

void setEventHandler(ValidationEventHandler handler)
              throws JAXBException

Deprecated. since JAXB2.0

Allow an application to register a validation event handler.

 The validation event handler will be called by the JAXB Provider if any
 validation errors are encountered during calls to
 validate.  If the client application does not
 register a validation event handler before invoking the validate method,
 then validation events will be handled by the default event handler which
 will terminate the validate operation after the first error or fatal error
 is encountered.

 Calling this method with a null parameter will cause the Validator
 to revert back to the default default event handler.

Parameters:

handler - the validation event handler

Throws:

JAXBException - if an error was encountered while setting the
         event handler

getEventHandler

ValidationEventHandler getEventHandler()
                                throws JAXBException

Deprecated. since JAXB2.0

Return the current event handler or the default event handler if one
 hasn't been set.

Returns:

the current ValidationEventHandler or the default event handler
         if it hasn't been set

Throws:

JAXBException - if an error was encountered while getting the
         current event handler

validate

boolean validate(Object subrootObj)
          throws JAXBException

Deprecated. since JAXB2.0

Validate the Java content tree starting at <tt>subrootObj</tt>.

 Client applications can use this method to validate Java content trees
 on-demand at runtime.  This method can be used to validate any arbitrary
 subtree of the Java content tree.  Global constraint checking will not
  be performed as part of this operation (i.e. ID/IDREF constraints).

Parameters:

subrootObj - the obj to begin validation at

Returns:

true if the subtree rooted at <tt>subrootObj</tt> is valid, false
         otherwise

Throws:

JAXBException - if any unexpected problem occurs during validation

ValidationException - If the ValidationEventHandler
     returns false from its <tt>handleEvent</tt> method or the
     <tt>Validator</tt> is unable to validate the content tree rooted
     at <tt>subrootObj</tt>

IllegalArgumentException - If the subrootObj parameter is null

validateRoot

boolean validateRoot(Object rootObj)
              throws JAXBException

Deprecated. since JAXB2.0

Validate the Java content tree rooted at <tt>rootObj</tt>.

 Client applications can use this method to validate Java content trees
 on-demand at runtime.  This method is used to validate an entire Java
 content tree.  Global constraint checking will be performed as
 part of this operation (i.e. ID/IDREF constraints).

Parameters:

rootObj - the root obj to begin validation at

Returns:

true if the tree rooted at <tt>rootObj</tt> is valid, false
         otherwise

Throws:

JAXBException - if any unexpected problem occurs during validation

ValidationException - If the ValidationEventHandler
     returns false from its <tt>handleEvent</tt> method or the
     <tt>Validator</tt> is unable to validate the content tree rooted
     at <tt>rootObj</tt>

IllegalArgumentException - If the rootObj parameter is null

setProperty

void setProperty(String name,
                 Object value)
          throws PropertyException

Deprecated. since JAXB2.0

Set the particular property in the underlying implementation of
 <tt>Validator</tt>.  This method can only be used to set one of
 the standard JAXB defined properties above or a provider specific
 property.  Attempting to set an undefined property will result in
 a PropertyException being thrown.  See
 Supported Properties.

Parameters:

name - the name of the property to be set. This value can either
              be specified using one of the constant fields or a user
              supplied string.

value - the value of the property to be set

Throws:

PropertyException - when there is an error processing the given
                            property or value

IllegalArgumentException - If the name parameter is null

getProperty

Object getProperty(String name)
            throws PropertyException

Deprecated. since JAXB2.0

Get the particular property in the underlying implementation of
 <tt>Validator</tt>.  This method can only be used to get one of
 the standard JAXB defined properties above or a provider specific
 property.  Attempting to get an undefined property will result in
 a PropertyException being thrown.  See
 Supported Properties.

Parameters:

name - the name of the property to retrieve

Returns:

the value of the requested property

Throws:

PropertyException - when there is an error retrieving the given property or value
      property name

IllegalArgumentException - If the name parameter is null

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Java™ Platform
Standard Ed. 8

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

 Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
 Copyright © 1993, 2015, Oracle and/or its affiliates.  All rights reserved.


text:
using System.Collections.Generic;
using OpenMetaverse;

namespace Aurora.Framework
{
    public interface ISceneViewer
    {
        /// <summary>
        ///   The instance of the prioritizer the SceneViewer uses
        /// </summary>
        IPrioritizer Prioritizer { get; }

        /// <summary>
        ///   The instance of the culler the SceneViewer uses
        /// </summary>
        ICuller Culler { get; }

        /// <summary>
        ///   Sends all the information about the client to this avatar
        /// </summary>
        /// <param name = "presence"></param>
        void QueuePresenceForFullUpdate(IScenePresence presence, bool forced);

        /// <summary>
        ///   Send the full presence update immediately
        /// </summary>
        /// <param name = "pres"></param>
        void SendPresenceFullUpdate(IScenePresence presence);

        /// <summary>
        ///   Send a presence terse update to all clients
        /// </summary>
        /// <param name = "presence"></param>
        /// <param name = "flags"></param>
        void QueuePresenceForUpdate(IScenePresence presence, PrimUpdateFlags flags);

        /// <summary>
        ///   Send a presence terse update to all clients
        /// </summary>
        /// <param name = "presence"></param>
        /// <param name = "flags"></param>
        void QueuePresenceForAnimationUpdate(IScenePresence presence, AnimationGroup animation);

        /// <summary>
        ///   Add the objects to the queue for which we need to send an update to the client
        /// </summary>
        /// <param name = "part"></param>
        void QueuePartForUpdate(ISceneChildEntity part, PrimUpdateFlags UpdateFlags);

        /// <summary>
        ///   Add the objects to the queue for which we need to send a properties update for
        /// </summary>
        /// <param name = "entity"></param>
        void QueuePartsForPropertiesUpdate(ISceneChildEntity[] entities);

        /// <summary>
        ///   This method is called by the LLUDPServer and should never be called by anyone else
        ///   It loops through the available updates and sends them out (no waiting)
        /// </summary>
        /// <param name = "numUpdates">The number of updates to send</param>
        void SendPrimUpdates(int numPrimUpdates, int numAvaUpdates);

        /// <summary>
        ///   Once the packet has been sent, allow newer updates to be sent for the given entity
        /// </summary>
        /// <param name = "ID"></param>
        void FinishedEntityPacketSend(IEnumerable<EntityUpdate> ID);

        /// <summary>
        ///   Once the packet has been sent, allow newer animations to be sent for the given entity
        /// </summary>
        /// <param name = "ID"></param>
        void FinishedAnimationPacketSend(AnimationGroup update);

        /// <summary>
        ///   Once the packet has been sent, allow newer property updates to be sent for the given entity
        /// </summary>
        /// <param name = "ID"></param>
        void FinishedPropertyPacketSend(IEnumerable<IEntity> updates);

        /// <summary>
        ///   The client has left this region and went into a child region, clean up anything required
        /// </summary>
        void Reset();

        /// <summary>
        ///   Closes the SceneViewer
        /// </summary>
        void Close();

        /// <summary>
        ///   Removes an avatar from the 'in-view' list
        /// </summary>
        /// <param name = "sp"></param>
        void RemoveAvatarFromView(IScenePresence sp);

        /// <summary>
        ///   Remove updates for the given avatar
        /// </summary>
        /// <param name = "presence"></param>
        void ClearPresenceUpdates(IScenePresence presence);
    }

    public class AnimationGroup
    {
        public UUID[] Animations;
        public UUID AvatarID;
        public UUID[] ObjectIDs;
        public int[] SequenceNums;
    }

    public interface IPrioritizer
    {
        /// <summary>
        ///   The distance before we send a child agent update to all neighbors
        /// </summary>
        double ChildReprioritizationDistance { get; }

        /// <summary>
        ///   Gets the priority for the given client/entity
        /// </summary>
        /// <param name = "client"></param>
        /// <param name = "entity"></param>
        /// <returns></returns>
        double GetUpdatePriority(IScenePresence client, IEntity entity);
    }

    public interface ICuller
    {
        /// <summary>
        ///   Is culling enabled?
        /// </summary>
        bool UseCulling { get; set; }

        /// <summary>
        ///   Should the given object be should to the given client?
        /// </summary>
        /// <param name = "client"></param>
        /// <param name = "entity"></param>
        /// <returns></returns>
        bool ShowEntityToClient(IScenePresence client, IEntity entity, IScene scene);
    }

    public interface IAnimator
    {
        AnimationSet Animations { get; }
        bool NeedsAnimationResent { get; set; }
        string CurrentMovementAnimation { get; }
        string GetMovementAnimation();
        void UpdateMovementAnimations(bool sendTerseUpdate);
        void AddAnimation(UUID animID, UUID objectID);
        bool AddAnimation(string name, UUID objectID);
        void RemoveAnimation(UUID animID);
        bool RemoveAnimation(string name);
        void ResetAnimations();
        void TrySetMovementAnimation(string anim);
        UUID[] GetAnimationArray();
        void SendAnimPack(UUID[] animations, int[] seqs, UUID[] objectIDs);
        void SendAnimPackToClient(IClientAPI client);
        void SendAnimPack();
        void Close();
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"

	>
<channel>
	<title>Comments on: FAQ</title>
	<atom:link href="http://czechtransfers.com/faq/feed/" rel="self" type="application/rss+xml" />
	<link>http://czechtransfers.com</link>
	<description>Prague & Czech Republic transfer service, fixed prices, English speaking drivers</description>
	<lastBuildDate></lastBuildDate>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.8.1</generator>
</channel>
</rss>


text:
<#
.SYNOPSIS
Nishang Payload which dumps keys for WLAN profiles.

.DESCRIPTION
This payload dumps keys in clear text for saved WLAN profiles.
The payload must be run from as administrator to get the keys.

.EXAMPLE
PS > Get-WLAN-Keys

.LINK
http://poshcode.org/1700
https://github.com/samratashok/nishang
#>

function Get-Wlan-Keys
{

[CmdletBinding()]
Param ()

    $wlans = netsh wlan show profiles | Select-String -Pattern "All User Profile" | Foreach-Object {$_.ToString()}
    $exportdata = $wlans | Foreach-Object {$_.Replace("    All User Profile     : ",$null)}
    $exportdata | ForEach-Object {netsh wlan show profiles name="$_" key=clear}

}


text:
package org.jiangc.weather.ui;

import android.app.ListFragment;
import android.app.ProgressDialog;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;

import org.jiangc.weather.Constant;
import org.jiangc.weather.entity.Area;
import org.jiangc.weather.event.CitySelectedEvent;
import org.jiangc.weather.util.BusUtils;
import org.jiangc.weather.util.ProgressDialogUtils;
import org.jiangc.weather.util.RetrofitUtils;
import org.jiangc.weather.util.ToastUtils;

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

import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import timber.log.Timber;

/**
 * Created by Jiang Chen on 15/12/5.
 */
public class AreaFragment extends ListFragment implements OnBackPressedListener {

    private static final int LEVEL_ROOT = 0;
    private static final int LEVEL_PROVINCE = 1;
    private static final int LEVEL_CITY = 2;
    private static final int LEVEL_COUNTY = 3;

    private byte currentLevel;

    private ArrayAdapter<String> adapter;
    private List<String> data;

    private Call<List<Area>> call;
    private List<Area> areas;

    @Override
    public void onViewCreated(View view, Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);

        data = new ArrayList<>();
        adapter = new ArrayAdapter<>(getActivity(), android.R.layout.simple_list_item_1, data);
        setListAdapter(adapter);

        queryArea("");
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        call.cancel();
    }

    @Override
    public void onListItemClick(ListView l, View v, int position, long id) {
        queryArea(areas.get(position).getId());
    }

    @Override
    public void onResume() {
        super.onResume();
        BusUtils.getInstance().register(this);
    }

    @Override
    public void onPause() {
        super.onPause();
        BusUtils.getInstance().unregister(this);
    }

    @Override
    public void onBackPressed() {
        switch (currentLevel) {
            case LEVEL_COUNTY:
                currentLevel = LEVEL_PROVINCE;
                queryArea(areas.get(0).getId().substring(0, 2));
                break;
            case LEVEL_CITY:
                currentLevel = LEVEL_ROOT;
                queryArea("");
                break;
            default:
                getActivity().finish();
                break;
        }
    }

    private void queryArea(@NonNull String code) {
        final ProgressDialog dialog = ProgressDialogUtils.createProgressDialog(getActivity());
        dialog.show();
        call = RetrofitUtils.getAreaService().loadAreas(code);
        call.enqueue(new Callback<List<Area>>() {

            @Override
            public void onResponse(Response<List<Area>> response) {
                dialog.dismiss();
                areas = response.body();
                if (currentLevel == LEVEL_COUNTY) {
                    BusUtils.getInstance().post(new CitySelectedEvent(Constant.CHINA + areas.get(0).getName()));
                } else {
                    currentLevel++;
                    data.clear();
                    for (Area area : areas) {
                        data.add(area.getName());
                    }
                    adapter.notifyDataSetChanged();
                }
            }

            @Override
            public void onFailure(Throwable t) {
                dialog.dismiss();
                Timber.e(t.toString());
                ToastUtils.showLong(getActivity(), t.toString());
            }
        });
    }
}


text:
/**
 * Created by lightmitch on 4/13/17.
 */
import React, {Component} from 'react'
import MainContent from './MainContent'
import LeftSidebar from './LeftSidebar'
import RightSidebar from './RightSidebar'
import CSSTransitionGroup from 'react-transition-group/CSSTransitionGroup'
import './style.css'

class index extends Component {
  render() {
    return(

          <CSSTransitionGroup
            transitionName="dashboards"
            transitionAppear={true}
            transitionAppearTimeout={1000}
            transitionEnter={false}
            transitionLeave={false}
          >

              <LeftSidebar/>
              <MainContent/>
              <RightSidebar/>

          </CSSTransitionGroup>

    )
  }
}

export default index


text:
property :backup, [true, false, Integer], default: false
property :delim, Array
property :ends_with, String
property :entry, String
property :eol, String
property :ignore_missing, [true, false], default: true
property :path, String
property :pattern, [String, Regexp]

resource_name :add_to_list
provides :add_to_list
unified_mode true

action :edit do
  raise_not_found
  sensitive_default
  eol = default_eol
  backup_if_true
  current = target_current_lines

  # insert
  new = insert_list_entry(current)

  # eol on last line
  new[-1] += eol unless new[-1].to_s.empty?

  file new_resource.path do
    content new.join(eol)
    backup new_resource.backup
    sensitive new_resource.sensitive
    not_if { new == current }
  end
end

action_class do
  include Line::Helper
  include Line::ListHelper
end