text:
package fakingXmocking.simplified;

import java.math.*;
import java.util.*;
import static java.util.Arrays.*;

import org.junit.*;
import static org.junit.Assert.*;

/**
 * These tests are the same as those in {@link fakingXmocking.original.CurrencyConversionIntegrationTest}, except that
 * they exercise the refactored and modified version of the tested class, {@link CurrencyConversion}.
 *

 * To execute these tests without network access, add "fakingXmocking.simplified.CurrencyConversionURLFake"
 * in the "jmockit-mocks" system property.
 */
public final class CurrencyConversionIntegrationTest
{
   @Before @After
   public void emptiesTheLocalCache()
   {
      CurrencyConversion.allCurrenciesCache = null;
   }

   @Test
   public void loadAllCurrencySymbolsFromWebSite()
   {
      List<String> allSymbols = new CurrencyConversion().currencySymbols();

      assertTrue(allSymbols.containsAll(asList("USD", "EUR", "BRL", "CNY")));
      assertSame(allSymbols, CurrencyConversion.allCurrenciesCache);
   }

   @Test
   public void recoverCurrencySymbolsFromLocalCache()
   {
      List<String> cachedSymbols = asList("ABC", "XYZ");
      CurrencyConversion.allCurrenciesCache = cachedSymbols;
      CurrencyConversion.lastCacheRead = System.currentTimeMillis();

      List<String> allSymbols = new CurrencyConversion().currencySymbols();

      assertSame(cachedSymbols, allSymbols);
   }

   @Test
   public void loadCurrencySymbolsFromWebSiteUponDetectingExpiredCache()
   {
      CurrencyConversion.allCurrenciesCache = Collections.emptyList();
      CurrencyConversion.lastCacheRead = System.currentTimeMillis() - CurrencyConversion.CACHE_DURATION;

      List<String> allSymbols = new CurrencyConversion().currencySymbols();

      assertFalse(allSymbols.isEmpty());
      assertSame(allSymbols, CurrencyConversion.allCurrenciesCache);
      assertEquals(System.currentTimeMillis(), CurrencyConversion.lastCacheRead, 20);
   }

   @Test(expected = IllegalArgumentException.class)
   public void convertFromInvalidCurrency()
   {
      new CurrencyConversion().convertFromTo("invalid", "USD");
   }

   @Test(expected = IllegalArgumentException.class)
   public void convertToInvalidCurrency()
   {
      new CurrencyConversion().convertFromTo("EUR", "invalid");
   }

   @Test
   public void convertToSameCurrency()
   {
      String currency = "USD";

      BigDecimal identityRate = new CurrencyConversion().convertFromTo(currency, currency);

      assertEquals(BigDecimal.ONE, identityRate);
   }

   @Test
   public void convertFromDollarToCheapCurrency()
   {
      double rate = new CurrencyConversion().convertFromTo("USD", "CNY").doubleValue();

      assertTrue(rate > 1.0);
   }

   @Test
   public void convertFromOneCurrencyToAnotherAndBack()
   {
      String fromCurrency = "USD";
      String toCurrency = "EUR";

      BigDecimal rate = new CurrencyConversion().convertFromTo(fromCurrency, toCurrency);
      assertTrue(rate.doubleValue() > 0.0);

      BigDecimal inverseRate = new CurrencyConversion().convertFromTo(toCurrency, fromCurrency);
      assertTrue(inverseRate.doubleValue() > 0.0);

      assertEquals(1.0, rate.multiply(inverseRate).doubleValue(), 0.005);
   }
}

redpajama_set_name: RedPajamaGithub


text:
layout: page
title: "Brian Eichelberger"
comments: true
description: "blanks"
keywords: "Brian Eichelberger,CU,Boulder"
---
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://dl.dropboxusercontent.com/s/pc42nxpaw1ea4o9/highcharts.js?dl=0"></script>
<!-- <script src="../assets/js/highcharts.js"></script> -->
<style type="text/css">@font-face {
	font-family: "Bebas Neue";
	src: url(https://www.filehosting.org/file/details/544349/BebasNeue Regular.otf) format("opentype");
	}
	h1.Bebas {
		font-family: "Bebas Neue", Verdana, Tahoma;
	}
</style>
</head>

#### TEACHING INFORMATION

**College**: College of Arts and Sciences

**Classes taught**: CHEM 1021, CHEM 1131

#### CHEM 1021: INTRODUCTORY CHEMISTRY

**Terms taught**: Spring 2007

**Instructor rating**: 4.03

**Standard deviation in instructor rating**: 0.0

**Average grade** (4.0 scale): 2.4

**Standard deviation in grades** (4.0 scale): 0.0

**Average workload** (raw): 3.05

**Standard deviation in workload** (raw): 0.0

#### CHEM 1131: GENERAL CHEMISTRY 2

**Terms taught**: Fall 2006

**Instructor rating**: 4.01

**Standard deviation in instructor rating**: 0.0

**Average grade** (4.0 scale): 2.44

**Standard deviation in grades** (4.0 scale): 0.0

**Average workload** (raw): 3.83

**Standard deviation in workload** (raw): 0.0


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace NestedHtmlWriter
{
    ///
    /// Main name space of NestedHtmlWriter
    ///
    /// <remarks>This is a namespace for NestedHtmlWriter</remarks>
    [System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    class NamespaceDoc
    {
    }
    ///
    /// Type of document types
    ///
    public enum NhDocumentType
    {
        ///
        /// XHTML 1.1
        ///
        Xhtml11,
        ///
        /// XHTML 1.0 Strict
        ///
        Xhtml10Strict,
        ///
        /// XHTML 1.0 Transitional
        ///
        Xhtml10Transitional,
        ///
        /// HTML5
        ///
        Html5,
    }

    ///
    /// Global settings
    ///
    public class NhSetting
    {
        ///
        /// Require strick cheking
        ///
        /// <remarks>
        /// If you check strick, many invalid operation may raise exceotion.
        /// But need for speed to select false
        /// </remarks>
        public static bool StrictNestChecking = true;
    }
    ///
    /// Invalid operations
    ///
    public class NhException : Exception
    {
        ///
        /// Constructor
        ///
        public NhException()
        {
        }
        ///
        /// Constructor
        ///
        /// <param name="msg">Exception message</param>
        public NhException(string msg)
            : base(msg)
        {
        }
        ///
        /// Constructor
        ///
        /// <param name="msg">Exception message</param>
        /// <param name="ex">excetion object</param>
        public NhException(string msg, Exception ex)
            : base(msg, ex)
        {
        }
    }
    ///
    /// Base class of all elements
    ///
    public class NhBase
    {
        ///
        /// writer for output
        ///
        protected TextWriter writer;
        ///
        /// parent object
        ///
        protected NhBase parent;
        ///
        /// check if locked
        ///
        /// <remarks>
        /// don't call this if not strick checking mode
        /// </remarks>
        protected void checkLock()
        {
            if (lockFlag)
            {
                throw new NhException("NestedHtmlWriter item was locked");
            }
        }
        ///
        /// Constructtor
        ///
        /// <param name="writer">writer for output</param>
        /// <param name="parent">parent object</param>
        public NhBase(TextWriter writer, NhBase parent)
        {
            this.writer = writer;
            this.parent = parent;
        }
        ///
        /// Output without any conversion.
        /// Don't use this method until you need.
        ///
        /// <param name="rawString">raw text</param>
        public virtual void WriteRawString(string rawString)
        {
            writer.Write(rawString);
        }
        ///
        /// output any attributes
        ///
        /// <param name="name">attribute name, if you have namespace prefix, PRIFIX:NAME style name is required.</param>
        /// <param name="val"> attribute value</param>
        public void WriteAttribute(string name, string val)
        {
            if (NhSetting.StrictNestChecking) checkLock();
            writer.Write(' ');
            writer.Write(name);
            writer.Write("=\"");
            writer.Write(NhUtil.QuoteText(val));
            writer.Write("\"");
        }
        ///
        /// output class attribute
        ///
        /// <param name="val"> attribute value</param>
        public void WriteClassAttr(string val)
        {
            WriteAttribute("class", val);
        }
        ///
        /// output id attribute
        ///
        /// <param name="val"> attribute value</param>
        public void WriteIDAttr(string val)
        {
            WriteAttribute("id", val);
        }
        private bool lockFlag = false;
        internal void Lock()
        {
            if (lockFlag)
            {
                throw new NhException("Try to lock item already locked");
            }
            lockFlag = true;
        }
        internal void Unlock()
        {
            if (!lockFlag)
            {
                throw new NhException("Try to unlock item not locked");
            }
            lockFlag = false;
        }
    }
    ///
    /// a generic class for empty element, use by derive.
    ///
    public class NhEmpty : NhBase, IDisposable
    {
        private string tagName;
        ///
        /// NhEmpty class constructor
        ///
        /// <param name="writer">writer for output</param>
        /// <param name="tagName">tag name, if you use namespace prifx, use PREFIX:NAME style.</param>
        /// <param name="parent">parent element object</param>
        public NhEmpty(TextWriter writer, string tagName, NhBase parent)
            : base(writer, parent)
        {
            if (NhSetting.StrictNestChecking && parent != null) parent.Lock();
            this.tagName = tagName;
            writer.Write('<');
            writer.Write(tagName);
        }
        ///
        /// Release allocated resources
        ///
        public void Dispose()
        {
            writer.Write(" />");
            if (!(parent is NhTextAvailable))
            {
                writer.Write("\r\n");
            }
            if (NhSetting.StrictNestChecking && parent != null) parent.Unlock();
        }
    }
    ///
    /// a generic class for not empty element, use by derive.
    ///
    public class NhNotEmpty : NhBase, IDisposable
    {
        private string tagName;
        private bool startTagClosed = false;
        ///
        /// confirm tag is closed and if closed, outout '>'
        ///
        protected void confirmStartTagClose()
        {
            if (!startTagClosed)
            {
                writer.Write('>');
                if (!(this is NhTextAvailable))
                {
                    writer.Write("\r\n");
                }
                startTagClosed = true;
            }
        }

        ///
        /// output any text without any conmversion
        ///
        /// <param name="rawString">text of XML fragment</param>
        public override void WriteRawString(string rawString)
        {
            confirmStartTagClose();
            base.WriteRawString(rawString);
        }
        ///
        /// NhNotEmpty class constructor
        ///
        /// <param name="writer">writer for output</param>
        /// <param name="tagName">tag name, if you use namespace prifx, use PREFIX:NAME style.</param>
        /// <param name="parent">parent element object</param>
        public NhNotEmpty(TextWriter writer, string tagName, NhBase parent)
            : base(writer, parent)
        {
            if (NhSetting.StrictNestChecking && parent != null) parent.Lock();
            this.tagName = tagName;
            writer.Write('<');
            writer.Write(tagName);
        }
        ///
        /// Release allocated resources
        ///
        public void Dispose()
        {
            confirmStartTagClose();
            writer.Write("</");
            writer.Write(tagName);
            writer.Write('>');
            if (!(parent is NhTextAvailable))
            {
                writer.Write("\r\n");
            }
            if (NhSetting.StrictNestChecking && parent != null) parent.Unlock();
        }
    }
    ///
    /// element class for content has text. use by Derive
    ///
    public class NhTextAvailable : NhNotEmpty
    {
        ///
        /// NhTextAvailable class constructor
        ///
        /// <param name="writer">writer for output</param>
        /// <param name="tagName">tag name, if you use namespace prifx, use PREFIX:NAME style.</param>
        /// <param name="parent">parent element object</param>
        public NhTextAvailable(TextWriter writer, string tagName, NhBase parent)
            : base(writer, tagName, parent)
        {
        }
        ///
        /// output text
        ///
        /// <param name="text">text for output</param>
        public void WriteText(string text)
        {
            if (NhSetting.StrictNestChecking) checkLock();
            confirmStartTagClose();
            writer.Write(NhUtil.QuoteText(text));
        }
    }
    ///
    /// element class for content is inlinet. use by Derive
    ///
    public class NhInline : NhTextAvailable
    {
        ///
        /// NhInline class constructor
        ///
        /// <param name="writer">writer for output</param>
        /// <param name="tagName">tag name, if you use namespace prifx, use PREFIX:NAME style.</param>
        /// <param name="parent">parent element object</param>
        public NhInline(TextWriter writer, string tagName, NhBase parent)
            : base(writer, tagName, parent)
        {
        }
        ///
        /// strong elemnt object creation
        ///
        /// <returns>created object</returns>
        public NhStrong CreateStrong()
        {
            if (NhSetting.StrictNestChecking) checkLock();
            confirmStartTagClose();
            return new NhStrong(writer, this);
        }
        ///
        /// em elemnt object creation
        ///
        /// <returns>created object</returns>
        public NhEm CreateEm()
        {
            if (NhSetting.StrictNestChecking) checkLock();
            confirmStartTagClose();
            return new NhEm(writer, this);
        }
        ///
        /// span elemnt object creation
        ///
        /// <returns>created object</returns>
        public NhSpan CreateSpan()
        {
            if (NhSetting.StrictNestChecking) checkLock();
            confirmStartTagClose();
            return new NhSpan(writer, this);
        }
        ///
        /// q elemnt object creation
        ///
        /// <returns>created object</returns>
        public NhQ CreateQ()
        {
            if (NhSetting.StrictNestChecking) checkLock();
            confirmStartTagClose();
            return new NhQ(writer, this);
        }
        ///
        /// a elemnt object creation
        ///
        /// <returns>created object</returns>
        public NhA CreateA()
        {
            if (NhSetting.StrictNestChecking) checkLock();
            confirmStartTagClose();
            return new NhA(writer, this);
        }
        ///
        /// img elemnt object creation
        ///
        /// <returns>created object</returns>
        public NhImg CreateImg()
        {
            if (NhSetting.StrictNestChecking) checkLock();
            confirmStartTagClose();
            return new NhImg(writer, this);
        }
        ///
        /// br elemnt object creation
        ///
        /// <returns>created object</returns>
        public NhBr CreateBr()
        {
            if (NhSetting.StrictNestChecking) checkLock();
            confirmStartTagClose();
            return new NhBr(writer, this);
        }
        ///
        /// input elemnt object creation
        ///
        /// <returns>created object</returns>
        public NhInput CreateInput()
        {
            if (NhSetting.StrictNestChecking) checkLock();
            confirmStartTagClose();
            return new NhInput(writer, this);
        }
        ///
        /// label elemnt object creation
        ///
        /// <returns>created object</returns>
        public NhLabel CreateLabel()
        {
            if (NhSetting.StrictNestChecking) checkLock();
            confirmStartTagClose();
            return new NhLabel(writer, this);
        }
        ///
        /// select elemnt object creation
        ///
        /// <returns>created object</returns>
        public NhSelect CreateSelect()
        {
            if (NhSetting.StrictNestChecking) checkLock();
            confirmStartTagClose();
            return new NhSelect(writer, this);
        }
        ///
        /// textarea elemnt object creation
        ///
        /// <param name="cols">cols attribute value</param>
        /// <param name="rows">rows attribute value</param>
        /// <returns>created object</returns>
        public NhTextArea CreateTextArea(int cols, int rows)
        {
            if (NhSetting.StrictNestChecking) checkLock();
            confirmStartTagClose();
            return new NhTextArea(writer, this, cols, rows);
        }
        ///
        /// output a element which has href attribute and text content only
        ///
        /// <param name="href">href attribute value</param>
        /// <param name="text">text for content</param>
        public void WriteAText(string href, string text)
        {
            if (NhSetting.StrictNestChecking) checkLock();
            confirmStartTagClose();
            writer.Write("");
            writer.Write(NhUtil.QuoteText(text));
            writer.Write("");
        }
        ///
        /// output img element which has src, alt, width, heigh attribute
        ///
        /// <param name="src">src attribute value</param>
        /// <param name="alt">alt attribute value</param>
        /// <param name="width">width attribute value</param>
        /// <param name="height">height attribute value</param>
        public void WriteImg(string src, string alt, int width, int height)
        {
            if (NhSetting.StrictNestChecking) checkLock();
            confirmStartTagClose();
            writer.Write("");
        }
        ///
        /// output img element which has src, alt attribute
        ///
        /// <param name="src">src attribute value</param>
        /// <param name="alt">alt attribute value</param>
        public void WriteImg(string src, string alt)
        {
            if (NhSetting.StrictNestChecking) checkLock();
            confirmStartTagClose();
            writer.Write("");
        }
        ///
        /// output br element without attribute
        ///
        public void WriteBr()
        {
            if (NhSetting.StrictNestChecking) checkLock();
            confirmStartTagClose();
            writer.Write("
");
        }
    }
    ///
    /// img elemnt output class
    ///
    public class NhImg : NhEmpty
    {
        ///
        /// NhImg class constructor
        ///
        /// <param name="writer">writer for output</param>
        /// <param name="parent">parent element object</param>
        public NhImg(TextWriter writer, NhBase parent)
            : base(writer, "img", parent)
        {
        }
    }
    ///
    /// br elemnt output class
    ///
    public class NhBr : NhEmpty
    {
        ///
        /// NhBr class constructor
        ///
        /// <param name="writer">writer for output</param>
        /// <param name="parent">parent element object</param>
        public NhBr(TextWriter writer, NhBase parent)
            : base(writer, "br", parent)
        {
        }
    }
    ///
    /// span elemnt output class
    ///
    public class NhSpan : NhInline
    {
        ///
        /// NhSpan class constructor
        ///
        /// <param name="writer">writer for output</param>
        /// <param name="parent">parent element object</param>
        public NhSpan(TextWriter writer, NhBase parent)
            : base(writer, "span", parent)
        {
        }
    }
    ///
    /// q elemnt output class
    ///
    public class NhQ : NhInline
    {
        ///
        /// NhQ class constructor
        ///
        /// <param name="writer">writer for output</param>
        /// <param name="parent">parent element object</param>
        public NhQ(TextWriter writer, NhBase parent)
            : base(writer, "q", parent)
        {
        }
    }
    ///
    /// strong elemnt output class
    ///
    public class NhStrong : NhInline
    {
        ///
        /// NhStrong class constructor
        ///
        /// <param name="writer">writer for output</param>
        /// <param name="parent">parent element object</param>
        public NhStrong(TextWriter writer, NhBase parent)
            : base(writer, "strong", parent)
        {
        }
    }
    ///
    /// em elemnt output class
    ///
    public class NhEm : NhInline
    {
        ///
        /// NhEm class constructor
        ///
        /// <param name="writer">writer for output</param>
        /// <param name="parent">parent element object</param>
        public NhEm(TextWriter writer, NhBase parent)
            : base(writer, "em", parent)
        {
        }
    }
    ///
    /// a elemnt output class
    ///
    public class NhA : NhInline
    {
        ///
        /// NhA class constructor
        ///
        /// <param name="writer">writer for output</param>
        /// <param name="parent">parent element object</param>
        public NhA(TextWriter writer, NhBase parent)
            : base(writer, "a", parent)
        {
        }
    }
    ///
    /// p elemnt output class
    ///
    public class NhP : NhInline
    {
        ///
        /// NhP class constructor
        ///
        /// <param name="writer">writer for output</param>
        /// <param name="parent">parent element object</param>
        public NhP(TextWriter writer, NhBase parent)
            : base(writer, "p", parent)
        {
        }
    }
    ///
    /// caption elemnt output class
    ///
    public class NhCaption : NhInline
    {
        ///
        /// NhCaption class constructor
        ///
        /// <param name="writer">writer for output</param>
        /// <param name="parent">parent element object</param>
        public NhCaption(TextWriter writer, NhBase parent)
            : base(writer, "caption", parent)
        {
        }
    }
    ///
    /// inline content li elemnt output class
    ///
    [System.Obsolete("NhLi was replaces NhLiInline")]
    public class NhLi : NhInline
    {
        ///
        /// NhLi class constructor
        ///
        /// <param name="writer">writer for output</param>
        /// <param name="parent">parent element object</param>
        public NhLi(TextWriter writer, NhBase parent)
            : base(writer, "li", parent)
        {
        }
    }
    ///
    /// inline content li elemnt output class
    ///
    public class NhLiInline : NhInline
    {
        ///
        /// NhLiInline class constructor
        ///
        /// <param name="writer">writer for output</param>
        /// <param name="parent">parent element object</param>
        public NhLiInline(TextWriter writer, NhBase parent)
            : base(writer, "li", parent)
        {
        }
    }
    ///
    /// block content li elemnt output class
    ///
    public class NhLiBlock : NhBlock
    {
        ///
        /// NhLiBlock class constructor
        ///
        /// <param name="writer">writer for output</param>
        /// <param name="parent">parent element object</param>
        public NhLiBlock(TextWriter writer, NhBase parent)
            : base(writer, "li", parent)
        {
        }
    }
    ///
    /// inline content td elemnt output class
    ///
    public class NhTdInline : NhInline
    {
        ///
        /// NhTdInline class constructor
        ///
        /// <param name="writer">writer for output</param>
        /// <param name="parent">parent element object</param>
        public NhTdInline(TextWriter writer, NhBase parent)
            : base(writer, "td", parent)
        {
        }
    }
    ///
    /// block content td elemnt output class
    ///
    public class NhTdBlock : NhBlock
    {
        ///
        /// NhTdBlock class constructor
        ///
        /// <param name="writer">writer for output</param>
        /// <param name="parent">parent element object</param>
        public NhTdBlock(TextWriter writer, NhBase parent)
            : base(writer, "td", parent)
        {
        }
    }
    ///
    /// inline content th elemnt output class
    ///
    public class NhThInline : NhInline
    {
        ///
        /// NhThInline class constructor
        ///
        /// <param name="writer">writer for output</param>
        /// <param name="parent">parent element object</param>
        public NhThInline(TextWriter writer, NhBase parent)
            : base(writer, "th", parent)
        {
        }
    }
    ///
    /// block content th elemnt output class
    ///
    public class NhThBlock : NhBlock
    {
        ///
        /// NhThBlock class constructor
        ///
        /// <param name="writer">writer for output</param>
        /// <param name="parent">parent element object</param>
        public NhThBlock(TextWriter writer, NhBase parent)
            : base(writer, "th", parent)
        {
        }
    }
    ///
    /// tr elemnt output class
    ///
    public class NhTr : NhNotEmpty
    {
        ///
        /// NhTr class constructor
        ///
        /// <param name="writer">writer for output</param>
        /// <param name="parent">parent element object</param>
        public NhTr(TextWriter writer, NhBase parent)
            : base(writer, "tr", parent)
        {
        }
        ///
        /// inline content td elemnt object creation
        ///
        /// <returns>created object</returns>
        public NhTdInline CreateTdInline()
        {
            if (NhSetting.StrictNestChecking) checkLock();
            confirmStartTagClose();
            return new NhTdInline(writer, this);
        }
        ///
        /// block content td elemnt object creation
        ///
        /// <returns>created object</returns>
        public NhTdBlock CreateTdBlock()
        {
            if (NhSetting.StrictNestChecking) checkLock();
            confirmStartTagClose();
            return new NhTdBlock(writer, this);
        }
        ///
        /// inline content th elemnt object creation
        ///
        /// <returns>created object</returns>
        public NhThInline CreateThInline()
        {
            if (NhSetting.StrictNestChecking) checkLock();
            confirmStartTagClose();
            return new NhThInline(writer, this);
        }
        ///
        /// block content th elemnt object creation
        ///
        /// <returns>created object</returns>
        public NhThBlock CreateThBlock()
        {
            if (NhSetting.StrictNestChecking) checkLock();
            confirmStartTagClose();
            return new NhThBlock(writer, this);
        }
    }
    ///
    /// ul elemnt output class
    ///
    public class NhUl : NhNotEmpty
    {
        ///
        /// NhUl class constructor
        ///
        /// <param name="writer">writer for output</param>
        /// <param name="parent">parent element object</param>
        public NhUl(TextWriter writer, NhBase parent)
            : base(writer, "ul", parent)
        {
        }
        ///
        /// li elemnt object creation
        ///
        /// <returns>created object</returns>
        [System.Obsolete()]
        public NhLi CreateLi()
        {
            if (NhSetting.StrictNestChecking) checkLock();
            confirmStartTagClose();
            return new NhLi(writer, this);
        }

        ///
        /// inline content li elemnt object creation
        ///
        /// <returns>created object</returns>
        public NhLiInline CreateLiInline()
        {
            if (NhSetting.StrictNestChecking) checkLock();
            confirmStartTagClose();
            return new NhLiInline(writer, this);
        }

        ///
        /// block content li elemnt object creation
        ///
        /// <returns>created object</returns>
        public NhLiBlock CreateLiBlock()
        {
            if (NhSetting.StrictNestChecking) checkLock();
            confirmStartTagClose();
            return new NhLiBlock(writer, this);
        }

        ///
        /// output li element which has only text content without any attribute
        ///
        /// <param name="text">text for content</param>
        public void WriteLiText(string text)
        {
            if (NhSetting.StrictNestChecking) checkLock();
            confirmStartTagClose();
            writer.Write("
");
            writer.Write(NhUtil.QuoteText(text));
            writer.Write("
\r\n");
        }
    }
    ///
    /// ol elemnt output class
    ///
    public class NhOl : NhNotEmpty
    {
        ///
        /// NhOl class constructor
        ///
        /// <param name="writer">writer for output</param>
        /// <param name="parent">parent element object</param>
        public NhOl(TextWriter writer, NhBase parent)
            : base(writer, "ol", parent)
        {
        }
        ///
        /// inline content li elemnt object creation
        ///
        /// <returns>created object</returns>
        [System.Obsolete()]
        public NhLi CreateLi()
        {
            if (NhSetting.StrictNestChecking) checkLock();
            confirmStartTagClose();
            return new NhLi(writer, this);
        }

        ///
        /// inline content li elemnt object creation
        ///
        /// <returns>created object</returns>
        public NhLiInline CreateLiInline()
        {
            if (NhSetting.StrictNestChecking) checkLock();
            confirmStartTagClose();
            return new NhLiInline(writer, this);
        }

        ///
        /// block content li elemnt object creation
        ///
        /// <returns>created object</returns>
        public NhLiBlock CreateLiBlock()
        {
            if (NhSetting.StrictNestChecking) checkLock();
            confirmStartTagClose();
            return new NhLiBlock(writer, this);
        }

        ///
        /// output li element which has only text content without any attribute
        ///
        /// <param name="text">text for content</param>
        public void WriteLiText(string text)
        {
            if (NhSetting.StrictNestChecking) checkLock();
            confirmStartTagClose();
            writer.Write("
");
            writer.Write(NhUtil.QuoteText(text));
            writer.Write("
\r\n");
        }
    }
    ///
    /// table elemnt output class
    ///
    public class NhTable : NhNotEmpty
    {
        ///
        /// NhTable class constructor
        ///
        /// <param name="writer">writer for output</param>
        /// <param name="parent">parent element object</param>
        public NhTable(TextWriter writer, NhBase parent)
            : base(writer, "table", parent)
        {
        }
        ///
        /// tr elemnt object creation
        ///
        /// <returns>created object</returns>
        public NhTr CreateTr()
        {
            if (NhSetting.StrictNestChecking) checkLock();
            confirmStartTagClose();
            return new NhTr(writer, this);
        }
        ///
        /// caption elemnt object creation
        ///
        /// <returns>created object</returns>
        public NhCaption CreateCaption()
        {
            if (NhSetting.StrictNestChecking) checkLock();
            confirmStartTagClose();
            return new NhCaption(writer, this);
        }
    }
    ///
    /// div elemnt output class
    ///
    public class NhDiv : NhBlock
    {
        ///
        /// NhDiv class constructor
        ///
        /// <param name="writer">writer for output</param>
        /// <param name="parent">parent element object</param>
        public NhDiv(TextWriter writer, NhBase parent)
            : base(writer, "div", parent)
        {
        }
    }
    ///
    /// blockquote elemnt output class
    ///
    public class NhBlockQuote : NhBlock
    {
        ///
        /// NhBlockQuote class constructor
        ///
        /// <param name="writer">writer for output</param>
        /// <param name="parent">parent element object</param>
        public NhBlockQuote(TextWriter writer, NhBase parent)
            : base(writer, "blockquote", parent)
        {
        }
    }
    ///
    /// h1`h6 elemnt output class
    ///
    public class NhHx : NhInline
    {
        ///
        /// NhHx class constructor
        ///
        /// <param name="level">1 to 6 number in 2nd character if tag name</param>
        /// <param name="writer">writer for output</param>
        /// <param name="parent">parent element object</param>
        public NhHx(int level, TextWriter writer, NhBase parent)
            : base(writer, "h" + level.ToString(), parent)
        {
            System.Diagnostics.Debug.Assert(level >= 1 && level <= 6);
        }
    }
    ///
    /// div elemnt output class
    ///
    public class NhForm : NhBlock
    {
        ///
        /// NhForm class constructor
        ///
        /// <param name="writer">writer for output</param>
        /// <param name="parent">parent element object</param>
        /// <param name="action">action attribute value</param>
        public NhForm(TextWriter writer, NhBase parent, string action)
            : base(writer, "form", parent)
        {
            this.WriteAttribute("action", action);
        }
        ///
        /// outout method attribute with post value
        ///
        public void WritePostMethod()
        {
            this.WriteAttribute("method", "post");
        }
        ///
        /// outout method attribute with get value
        ///
        public void WriteGetMethod()
        {
            this.WriteAttribute("method", "get");
        }
    }
    ///
    /// input elemnt output class
    ///
    public class NhInput : NhEmpty
    {
        ///
        /// NhInput class constructor
        ///
        /// <param name="writer">writer for output</param>
        /// <param name="parent">parent element object</param>
        public NhInput(TextWriter writer, NhBase parent)
            : base(writer, "input", parent)
        {
        }
    }
    ///
    /// label elemnt output class
    ///
    public class NhLabel : NhInline
    {
        ///
        /// NhLabel class constructor
        ///
        /// <param name="writer">writer for output</param>
        /// <param name="parent">parent element object</param>
        public NhLabel(TextWriter writer, NhBase parent)
            : base(writer, "label", parent)
        {
        }
    }
    ///
    /// select elemnt output class
    ///
    public class NhSelect : NhInline
    {
        ///
        /// option elemnt object creation
        ///
        /// <returns>created object</returns>
        public NhOption CreateOption()
        {
            if (NhSetting.StrictNestChecking) checkLock();
            confirmStartTagClose();
            return new NhOption(writer, this);
        }
        ///
        /// NhSelect class constructor
        ///
        /// <param name="writer">writer for output</param>
        /// <param name="parent">parent element object</param>
        public NhSelect(TextWriter writer, NhBase parent)
            : base(writer, "select", parent)
        {
        }
    }
    ///
    /// option elemnt output class
    ///
    public class NhOption : NhTextAvailable
    {
        ///
        /// NhSelect class constructor
        ///
        /// <param name="writer">writer for output</param>
        /// <param name="parent">parent element object</param>
        public NhOption(TextWriter writer, NhBase parent)
            : base(writer, "option", parent)
        {
        }
    }
    ///
    /// textarea elemnt output class
    ///
    public class NhTextArea : NhTextAvailable
    {
        ///
        /// NhTextArea class constructor
        ///
        /// <param name="writer">writer for output</param>
        /// <param name="parent">parent element object</param>
        /// <param name="cols">cols attribute value</param>
        /// <param name="rows">rows attribute value</param>
        public NhTextArea(TextWriter writer, NhBase parent, int cols, int rows)
            : base(writer, "textarea", parent)
        {
            this.WriteAttribute("cols", cols.ToString());
            this.WriteAttribute("rows", rows.ToString());
        }
    }

    ///
    /// generic class for block content element. Use by derive
    ///
    public class NhBlock : NhNotEmpty
    {
        ///
        /// NhBlock class constructor
        ///
        /// <param name="writer">writer for output</param>
        /// <param name="tagName">tag name, if you use namespace prifx, use PREFIX:NAME style.</param>
        /// <param name="parent">parent element object</param>
        public NhBlock(TextWriter writer, string tagName, NhBase parent)
            : base(writer, tagName, parent)
        {
        }
        ///
        /// p elemnt object creation
        ///
        /// <returns>created object</returns>
        public NhP CreateP()
        {
            if (NhSetting.StrictNestChecking) checkLock();
            confirmStartTagClose();
            return new NhP(writer, this);
        }
        ///
        /// ul elemnt object creation
        ///
        /// <returns>created object</returns>
        public NhUl CreateUl()
        {
            if (NhSetting.StrictNestChecking) checkLock();
            confirmStartTagClose();
            return new NhUl(writer, this);
        }
        ///
        /// ol elemnt object creation
        ///
        /// <returns>created object</returns>
        public NhOl CreateOl()
        {
            if (NhSetting.StrictNestChecking) checkLock();
            confirmStartTagClose();
            return new NhOl(writer, this);
        }
        ///
        /// table elemnt object creation
        ///
        /// <returns>created object</returns>
        public NhTable CreateTable()
        {
            if (NhSetting.StrictNestChecking) checkLock();
            confirmStartTagClose();
            return new NhTable(writer, this);
        }
        ///
        /// div elemnt object creation
        ///
        /// <returns>created object</returns>
        public NhDiv CreateDiv()
        {
            if (NhSetting.StrictNestChecking) checkLock();
            confirmStartTagClose();
            return new NhDiv(writer, this);
        }
        ///
        /// blockquote elemnt object creation
        ///
        /// <returns>created object</returns>
        public NhBlockQuote CreateBlockQuote()
        {
            if (NhSetting.StrictNestChecking) checkLock();
            confirmStartTagClose();
            return new NhBlockQuote(writer, this);
        }
        ///
        /// h1`h6 elemnt object creation
        ///
        /// <param name="level">1 to 6 integer value of 2nd character of tag name.</param>
        /// <returns>created object</returns>
        public NhHx CreateHx(int level)
        {
            if (NhSetting.StrictNestChecking) checkLock();
            confirmStartTagClose();
            return new NhHx(level, writer, this);
        }
        ///
        /// Form elemnt object creation
        ///
        /// <param name="action">action attribute value</param>
        /// <returns>created object</returns>
        public NhForm CreateForm(string action)
        {
            if (NhSetting.StrictNestChecking) checkLock();
            confirmStartTagClose();
            return new NhForm(writer, this, action);
        }
        ///
        /// output p element which has text content without any attribute
        ///
        /// <param name="text">text for content</param>
        public void WritePText(string text)
        {
            if (NhSetting.StrictNestChecking) checkLock();
            confirmStartTagClose();
            writer.Write("
");
            writer.Write(NhUtil.QuoteText(text));
            writer.Write("
\r\n");
        }
        ///
        /// output h1 to h6 element which has text content without any attribute
        ///
        /// <param name="level">1 to 6 integer value of 2nd character of tag name.</param>
        /// <param name="text">text for content</param>
        public void WriteHxText(int level, string text)
        {
            if (NhSetting.StrictNestChecking) checkLock();
            confirmStartTagClose();
            writer.Write("<h");
            writer.Write(level);
            writer.Write(">");
            writer.Write(NhUtil.QuoteText(text));
            writer.Write("</h");
            writer.Write(level);
            writer.Write(">\r\n");
        }
    }
    ///
    /// body elemnt output class
    ///
    public class NhBody : NhBlock
    {
        ///
        /// NhBody class constructor
        ///
        /// <param name="writer">writer for output</param>
        /// <param name="parent">parent element object</param>
        public NhBody(TextWriter writer, NhBase parent)
            : base(writer, "body", parent)
        {
        }
    }
    ///
    /// head elemnt output class
    ///
    public class NhHead : NhNotEmpty
    {
        ///
        /// NhHead class constructor
        ///
        /// <param name="writer">writer for output</param>
        /// <param name="parent">parent element object</param>
        public NhHead(TextWriter writer, NhBase parent)
            : base(writer, "head", parent)
        {
        }
        ///
        /// output title element which has text content without any attribte
        ///
        /// <param name="title">text for content</param>
        public void WriteTitle(string title)
        {
            if (NhSetting.StrictNestChecking) checkLock();
            confirmStartTagClose();
            writer.Write("<title>");
            writer.Write(NhUtil.QuoteText(title));
            writer.Write("</title>\r\n");
        }
        ///
        /// output meta element with Content-Type information
        ///
        /// <remarks>output follow format
        /// <meta http-equiv="Content-Type" content="text/html;charset="YOUR VALUE" />
        /// </remarks>
        /// <param name="encodingName">charset name</param>
        public void WriteEncodingName(string encodingName)
        {
            if (NhSetting.StrictNestChecking) checkLock();
            confirmStartTagClose();
            writer.Write("<meta http-equiv=\"Content-Type\" content=\"text/html;charset=");
            writer.Write(encodingName);
            writer.Write("\" />\r\n");
        }
        ///
        /// output reference information for style-sheet
        ///
        /// <remarks>output follow format
        /// <link href="HREF VALUE" type="TYPE VALUE" rel="stylesheet" />
        /// </remarks>
        /// <param name="href">URI of style-sheet. if null, no style-sheet information generate</param>
        /// <param name="type">media-type of style-sheet (example:text/css)</param>
        /// <param name="requireSlash">require / before ></param>
        public void WriteStyleSheetRefer(string href, string type, bool requireSlash)
        {
            if (NhSetting.StrictNestChecking) checkLock();
            confirmStartTagClose();
            writer.Write("<link href=\"");
            writer.Write(NhUtil.QuoteText(href));
            writer.Write("\" type=\"");
            writer.Write(NhUtil.QuoteText(type));
            writer.Write("\" rel=\"stylesheet\"");
            if (requireSlash) writer.Write(" /");
            writer.Write(">\r\n");
        }
        ///
        /// output reference information for style-sheet
        ///
        /// <param name="href">URI of style-sheet. if null, no style-sheet information generate</param>
        /// <param name="type">media-type of style-sheet (example:text/css)</param>
        [Obsolete]
        public void WriteStyleSheetRefer(string href, string type)
        {
            WriteStyleSheetRefer(href, type, true);
        }
    }
    ///
    /// html elemnt output class
    ///
    public class NhHtml : NhNotEmpty
    {
        ///
        /// NhHtml class constructor
        ///
        /// <remarks>if xml style, xmlns attribute is specified. the value is http://www.w3.org/1999/xhtml</remarks>
        /// <param name="writer">writer for output</param>
        /// <param name="parent">parent element object</param>
        /// <param name="requireNamespace">require xmlns attribute for http://www.w3.org/1999/xhtml</param>
        public NhHtml(TextWriter writer, NhBase parent, bool requireNamespace)
            : base(writer, "html", parent)
        {
            if (requireNamespace) WriteAttribute("xmlns", "http://www.w3.org/1999/xhtml");
        }
        ///
        /// head elemnt object creation
        ///
        /// <returns>created object</returns>
        public NhHead CreateHead()
        {
            if (NhSetting.StrictNestChecking) checkLock();
            confirmStartTagClose();
            return new NhHead(writer, this);
        }
        ///
        /// body elemnt object creation
        ///
        /// <returns>created object</returns>
        public NhBody CreateBody()
        {
            if (NhSetting.StrictNestChecking) checkLock();
            confirmStartTagClose();
            return new NhBody(writer, this);
        }
    }
    ///
    /// entire document
    ///
    public class NhDocument : NhBase
    {
        ///
        /// NhDocument class constructor
        /// automatically create XML declalation and DOCTYPE declalation
        ///
        /// <remarks>in case of type of documents, follow text will output.
        /// In case of NhDocumentType.Xhtml11
        /// <?xml version=\"1.0\"?>
        /// <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
        /// "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
        ///
        /// In case of NhDocumentType.Xhtml10Strict
        /// <?xml version=\"1.0\"?>
        /// <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        /// "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
        ///
        /// In case of NhDocumentType.Xhtml10Transitional
        /// <?xml version=\"1.0\"?>
        /// <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        /// "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
        ///
        /// In case of NhDocumentType.Html5
        /// <!DOCTYPE html>
        /// </remarks>
        /// <param name="writer">writer for output</param>
        /// <param name="documentType">type of document</param>
        public NhDocument(TextWriter writer, NhDocumentType documentType)
            : base(writer, null)
        {
            if (documentType != NhDocumentType.Html5) writer.WriteLine("<?xml version=\"1.0\"?>");
            switch (documentType)
            {
                case NhDocumentType.Xhtml11:
                    writer.WriteLine("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\"");
                    writer.WriteLine("\"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">");
                    break;
                case NhDocumentType.Xhtml10Strict:
                    writer.WriteLine("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"");
                    writer.WriteLine("\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">");
                    break;
                case NhDocumentType.Xhtml10Transitional:
                    writer.WriteLine("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"");
                    writer.WriteLine("\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">");
                    break;
                case NhDocumentType.Html5:
                    writer.WriteLine("<!DOCTYPE html>");
                    break;
            }
        }
        ///
        /// NhDocument class constructor
        /// automatically create XML declalation and DOCTYPE declalation for XHTML 1.1
        ///
        /// <remarks>output follow lines
        /// <?xml version=\"1.0\"?>
        /// <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
        /// "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
        /// </remarks>
        /// <param name="writer">writer for output</param>
        public NhDocument(TextWriter writer)
            : base(writer, null)
        {
            writer.WriteLine("<?xml version=\"1.0\"?>");
            writer.WriteLine("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\"");
            writer.WriteLine("\"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">");
        }
        ///
        /// html elemnt object creation
        ///
        /// <returns>created object</returns>
        public NhHtml CreateHtml(bool requireNamespace)
        {
            return new NhHtml(writer, this, requireNamespace);
        }
        ///
        /// html elemnt object creation
        ///
        /// <returns>created object</returns>
        [Obsolete]
        public NhHtml CreateHtml()
        {
            return new NhHtml(writer, this, true);
        }
    }
    ///
    /// Quick Generate Document, which output common header
    ///
    public class NhQuickDocument : IDisposable
    {
        private NhHtml html;
        private NhBody body;
        ///
        /// NhQuickDocument class constructor
        /// Header informations for parameters
        ///
        /// <param name="writer">writer for output</param>
        /// <param name="title">title of document (title element)</param>
        /// <param name="styleSheetHref">URI of style-sheet. if null, there is no style-sheet</param>
        /// <param name="styleSheetType">Media Type of style-sheet (esample:text/css)</param>
        [System.Obsolete()]
        public NhQuickDocument(TextWriter writer, string title,
            string styleSheetHref, string styleSheetType)
        {
            NhDocument nestedDocument = new NhDocument(writer);
            html = nestedDocument.CreateHtml(true);
            using (NhHead head = html.CreateHead())
            {
                head.WriteTitle(title);
                if (styleSheetHref != null)
                {
                    head.WriteStyleSheetRefer(styleSheetHref, styleSheetType);
                }
            }
            body = html.CreateBody();
        }
        ///
        /// NhQuickDocument class constructor
        /// Header informations for parameters
        ///
        /// <param name="writer">writer for output</param>
        /// <param name="title">title of document (title element)</param>
        /// <param name="styleSheetHref">URI of style-sheet. if null, there is no style-sheet</param>
        /// <param name="styleSheetType">Media Type of style-sheet (esample:text/css)</param>
        /// <param name="languageCode">Language code for document default. (example:us-EN)</param>
        /// <param name="documentType">type of document</param>
        /// <remarks>if type is NhDocumentType.Xhtml10Strict or NhDocumentType.Xhtml10Transitional,
        /// language code will inlcude in lang attribute, as well as xml:lang attribute
        /// </remarks>
        public NhQuickDocument(TextWriter writer, string title,
            string styleSheetHref, string styleSheetType, string languageCode, NhDocumentType documentType)
        {
            NhDocument nestedDocument = new NhDocument(writer, documentType);
            html = nestedDocument.CreateHtml(documentType != NhDocumentType.Html5);
            writeLang(languageCode, documentType);
            using (NhHead head = html.CreateHead())
            {
                head.WriteTitle(title);
                if (styleSheetHref != null)
                {
                    head.WriteStyleSheetRefer(styleSheetHref, styleSheetType, documentType != NhDocumentType.Html5);
                }
            }
            body = html.CreateBody();
        }

        private void writeLang(string languageCode, NhDocumentType documentType)
        {
            if (documentType != NhDocumentType.Xhtml11) html.WriteAttribute("lang", languageCode);
            if (documentType != NhDocumentType.Html5) html.WriteAttribute("xml:lang", languageCode);
        }
        ///
        /// NhQuickDocument class constructor
        /// Header informations for parameters
        ///
        /// <param name="writer">writer for output</param>
        /// <param name="title">title of document (title element)</param>
        /// <param name="styleSheetHref">URI of style-sheet. if null, there is no style-sheet</param>
        /// <param name="styleSheetType">Media Type of style-sheet (esample:text/css)</param>
        /// <param name="languageCode">Language code for document default. (example:us-EN)</param>
        /// <param name="documentType">type of document</param>
        /// <param name="encodingName">IANA charset name for header</param>
        /// <remarks>if type is NhDocumentType.Xhtml10Strict or NhDocumentType.Xhtml10Transitional,
        /// language code will inlcude in lang attribute, as well as xml:lang attribute
        /// </remarks>
        public NhQuickDocument(TextWriter writer, string title,
            string styleSheetHref, string styleSheetType, string languageCode, NhDocumentType documentType,
            string encodingName)
        {
            NhDocument nestedDocument = new NhDocument(writer, documentType);
            html = nestedDocument.CreateHtml(documentType != NhDocumentType.Html5);
            writeLang(languageCode, documentType);
            using (NhHead head = html.CreateHead())
            {
                head.WriteRawString("<meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\"");
                if (documentType == NhDocumentType.Xhtml10Strict || documentType == NhDocumentType.Xhtml10Transitional)
                {
                    head.WriteRawString(" /");
                }
                head.WriteRawString(">\r\n");
                head.WriteTitle(title);
                if (styleSheetHref != null)
                {
                    head.WriteStyleSheetRefer(styleSheetHref, styleSheetType, documentType != NhDocumentType.Html5);
                }
            }
            body = html.CreateBody();
        }
        ///
        /// Reference for instance of NhBody class in this document.
        /// Use this attribute to outout document body.
        ///
        public NhBody B
        {
            get { return body; }
        }
        ///
        /// Release allocated resources
        ///
        public void Dispose()
        {
            body.Dispose();
            html.Dispose();
        }
    }
}


text:
var getData = {

	init: function (conf) {
		// Check FirePHP Console for output
		this.fetchData();
		this.setTemplate();
	},

	fetchData: function () {
		// body...
		return $.ajax({
			url: '_php/jq_post.php',
			type: 'POST',
			dataType: 'json',
			data: {param1: 'value1', param2: 'value2'},
		}).promise();

	},

	setTemplate: function () {
		// body...
		this.fetchData().then(function (data) {
			console.log(data);
		});
	}
}


text:
using System;

namespace Abp.MultiTenancy
{
    /// <summary>
    /// Used to declare multi tenancy side of an object.
    /// </summary>
    public class MultiTenancySideAttribute : Attribute
    {
        /// <summary>
        /// Multitenancy side.
        /// </summary>
        public MultiTenancySides Side { get; set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="MultiTenancySideAttribute"/> class.
        /// </summary>
        /// <param name="side">Multitenancy side.</param>
        public MultiTenancySideAttribute(MultiTenancySides side)
        {
            Side = side;
        }
    }
}


text:
let message = "foobarbaz";

console.log(message.startsWith("foo"));  // true
console.log(message.startsWith("bar"));  // false

console.log(message.endsWith("baz"));    // true
console.log(message.endsWith("bar"));    // false

console.log(message.includes("bar"));    // true
console.log(message.includes("qux"));    // false


text:
using OLEDB.Test.ModuleCore;
using System.IO;
using XmlCoreTest.Common;

namespace System.Xml.Tests
{
    [TestModule(Name = "XmlCharCheckingReader Test", Desc = "XmlCharCheckingReader Test")]
    public partial class CharCheckingReaderTest : CGenericTestModule
    {
        public override int Init(object objParam)
        {
            int ret = base.Init(objParam);
            string strFile = string.Empty;

            TestFiles.CreateTestFile(ref strFile, EREADER_TYPE.GENERIC);
            TestFiles.CreateTestFile(ref strFile, EREADER_TYPE.XSLT_COPY);
            TestFiles.CreateTestFile(ref strFile, EREADER_TYPE.XMLSCHEMA);
            TestFiles.CreateTestFile(ref strFile, EREADER_TYPE.INVALID_DTD);
            TestFiles.CreateTestFile(ref strFile, EREADER_TYPE.INVALID_NAMESPACE);
            TestFiles.CreateTestFile(ref strFile, EREADER_TYPE.INVALID_SCHEMA);
            TestFiles.CreateTestFile(ref strFile, EREADER_TYPE.INVWELLFORMED_DTD);
            TestFiles.CreateTestFile(ref strFile, EREADER_TYPE.NONWELLFORMED_DTD);
            TestFiles.CreateTestFile(ref strFile, EREADER_TYPE.VALID_DTD);
            TestFiles.CreateTestFile(ref strFile, EREADER_TYPE.WELLFORMED_DTD);
            TestFiles.CreateTestFile(ref strFile, EREADER_TYPE.WHITESPACE_TEST);

            ReaderFactory = new XmlCharCheckingReaderFactory();
            return ret;
        }

        public override int Terminate(object objParam)
        {
            return base.Terminate(objParam);
        }
    }

    ////////////////////////////////////////////////////////////////
    // CharCheckingReader factory
    //
    ////////////////////////////////////////////////////////////////
    internal class XmlCharCheckingReaderFactory : ReaderFactory
    {
        public override XmlReader Create(MyDict<string, object> options)
        {
            string tcDesc = (string)options[ReaderFactory.HT_CURDESC];
            string tcVar = (string)options[ReaderFactory.HT_CURVAR];

            CError.Compare(tcDesc == "charcheckingreader", "Invalid testcase");

            XmlReaderSettings rs = (XmlReaderSettings)options[ReaderFactory.HT_READERSETTINGS];
            Stream stream = (Stream)options[ReaderFactory.HT_STREAM];
            string filename = (string)options[ReaderFactory.HT_FILENAME];
            object readerType = options[ReaderFactory.HT_READERTYPE];
            object vt = options[ReaderFactory.HT_VALIDATIONTYPE];
            string fragment = (string)options[ReaderFactory.HT_FRAGMENT];
            StringReader sr = (StringReader)options[ReaderFactory.HT_STRINGREADER];

            if (rs == null)
                rs = new XmlReaderSettings();

            rs.DtdProcessing = DtdProcessing.Ignore;
            rs.CheckCharacters = false;

            XmlReaderSettings wrs = new XmlReaderSettings();
            wrs.DtdProcessing = DtdProcessing.Ignore;
            wrs.CheckCharacters = true;
            wrs.ConformanceLevel = ConformanceLevel.Auto;

            if (sr != null)
            {
                CError.WriteLine("CharCheckingReader String");
                XmlReader r = ReaderHelper.Create(sr, rs, string.Empty);
                XmlReader wr = ReaderHelper.Create(r, wrs);
                return wr;
            }

            if (stream != null)
            {
                CError.WriteLine("CharCheckingReader Stream");
                XmlReader r = ReaderHelper.Create(stream, rs, filename);
                XmlReader wr = ReaderHelper.Create(r, wrs);
                return wr;
            }

            if (fragment != null)
            {
                CError.WriteLine("CharCheckingReader Fragment");
                rs.ConformanceLevel = ConformanceLevel.Fragment;
                StringReader tr = new StringReader(fragment);
                XmlReader r = ReaderHelper.Create(tr, rs, (string)null);
                XmlReader wr = ReaderHelper.Create(r, wrs);
                return wr;
            }

            if (filename != null)
            {
                CError.WriteLine("CharCheckingReader Filename");
                Stream fs = FilePathUtil.getStream(filename);
                XmlReader r = ReaderHelper.Create(fs, rs, filename);
                XmlReader wr = ReaderHelper.Create(r, wrs);
                return wr;
            }
            return null;
        }
    }

    [TestCase(Name = "ErrorCondition", Desc = "CharCheckingReader")]
    public class TCErrorConditionReader : TCErrorCondition
    {
    }

    [TestCase(Name = "Depth", Desc = "CharCheckingReader")]
    public class TCDepthReader : TCDepth
    {
    }

    [TestCase(Name = "Namespace", Desc = "CharCheckingReader")]
    public class TCNamespaceReader : TCNamespace
    {
    }

    [TestCase(Name = "LookupNamespace", Desc = "CharCheckingReader")]
    public class TCLookupNamespaceReader : TCLookupNamespace
    {
    }

    [TestCase(Name = "IsEmptyElement", Desc = "CharCheckingReader")]
    public class TCIsEmptyElementReader : TCIsEmptyElement
    {
    }

    [TestCase(Name = "XmlSpace", Desc = "CharCheckingReader")]
    public class TCXmlSpaceReader : TCXmlSpace
    {
    }

    [TestCase(Name = "XmlLang", Desc = "CharCheckingReader")]
    public class TCXmlLangReader : TCXmlLang
    {
    }

    [TestCase(Name = "Skip", Desc = "CharCheckingReader")]
    public class TCSkipReader : TCSkip
    {
    }

    [TestCase(Name = "InvalidXML", Desc = "CharCheckingReader")]
    public class TCInvalidXMLReader : TCInvalidXML
    {
    }

    [TestCase(Name = "ReadOuterXml", Desc = "CharCheckingReader")]
    public class TCReadOuterXmlReader : TCReadOuterXml
    {
    }

    [TestCase(Name = "AttributeAccess", Desc = "CharCheckingReader")]
    public class TCAttributeAccessReader : TCAttributeAccess
    {
    }

    [TestCase(Name = "This(Name) and This(Name, Namespace)", Desc = "CharCheckingReader")]
    public class TCThisNameReader : TCThisName
    {
    }

    [TestCase(Name = "MoveToAttribute(Name) and MoveToAttribute(Name, Namespace)", Desc = "CharCheckingReader")]
    public class TCMoveToAttributeReader : TCMoveToAttribute
    {
    }

    [TestCase(Name = "GetAttribute (Ordinal)", Desc = "CharCheckingReader")]
    public class TCGetAttributeOrdinalReader : TCGetAttributeOrdinal
    {
    }

    [TestCase(Name = "GetAttribute(Name) and GetAttribute(Name, Namespace)", Desc = "CharCheckingReader")]
    public class TCGetAttributeNameReader : TCGetAttributeName
    {
    }

    [TestCase(Name = "This [Ordinal]", Desc = "CharCheckingReader")]
    public class TCThisOrdinalReader : TCThisOrdinal
    {
    }

    [TestCase(Name = "MoveToAttribute(Ordinal)", Desc = "CharCheckingReader")]
    public class TCMoveToAttributeOrdinalReader : TCMoveToAttributeOrdinal
    {
    }

    [TestCase(Name = "MoveToFirstAttribute()", Desc = "CharCheckingReader")]
    public class TCMoveToFirstAttributeReader : TCMoveToFirstAttribute
    {
    }

    [TestCase(Name = "MoveToNextAttribute()", Desc = "CharCheckingReader")]
    public class TCMoveToNextAttributeReader : TCMoveToNextAttribute
    {
    }

    [TestCase(Name = "Attribute Test when NodeType != Attributes", Desc = "CharCheckingReader")]
    public class TCAttributeTestReader : TCAttributeTest
    {
    }

    [TestCase(Name = "Attributes test on XmlDeclaration DCR52258", Desc = "CharCheckingReader")]
    public class TCAttributeXmlDeclarationReader : TCAttributeXmlDeclaration
    {
    }

    [TestCase(Name = "xmlns as local name DCR50345", Desc = "CharCheckingReader")]
    public class TCXmlnsReader : TCXmlns
    {
    }

    [TestCase(Name = "bounded namespace to xmlns prefix DCR50881", Desc = "CharCheckingReader")]
    public class TCXmlnsPrefixReader : TCXmlnsPrefix
    {
    }

    [TestCase(Name = "ReadInnerXml", Desc = "CharCheckingReader")]
    public class TCReadInnerXmlReader : TCReadInnerXml
    {
    }

    [TestCase(Name = "MoveToContent", Desc = "CharCheckingReader")]
    public class TCMoveToContentReader : TCMoveToContent
    {
    }

    [TestCase(Name = "IsStartElement", Desc = "CharCheckingReader")]
    public class TCIsStartElementReader : TCIsStartElement
    {
    }

    [TestCase(Name = "ReadStartElement", Desc = "CharCheckingReader")]
    public class TCReadStartElementReader : TCReadStartElement
    {
    }

    [TestCase(Name = "ReadEndElement", Desc = "CharCheckingReader")]
    public class TCReadEndElementReader : TCReadEndElement
    {
    }

    [TestCase(Name = "ResolveEntity and ReadAttributeValue", Desc = "CharCheckingReader")]
    public class TCResolveEntityReader : TCResolveEntity
    {
    }

    [TestCase(Name = "HasValue", Desc = "CharCheckingReader")]
    public class TCHasValueReader : TCHasValue
    {
    }

    [TestCase(Name = "ReadAttributeValue", Desc = "CharCheckingReader")]
    public class TCReadAttributeValueReader : TCReadAttributeValue
    {
    }

    [TestCase(Name = "Read", Desc = "CharCheckingReader")]
    public class TCReadReader : TCRead2
    {
    }

    [TestCase(Name = "MoveToElement", Desc = "CharCheckingReader")]
    public class TCMoveToElementReader : TCMoveToElement
    {
    }

    [TestCase(Name = "Dispose", Desc = "CharCheckingReader")]
    public class TCDisposeReader : TCDispose
    {
    }

    [TestCase(Name = "Buffer Boundaries", Desc = "CharCheckingReader")]
    public class TCBufferBoundariesReader : TCBufferBoundaries
    {
    }

    //[TestCase(Name = "BeforeRead", Desc = "BeforeRead")]
    //[TestCase(Name = "AfterReadIsFalse", Desc = "AfterReadIsFalse")]
    //[TestCase(Name = "AfterCloseInTheMiddle", Desc = "AfterCloseInTheMiddle")]
    //[TestCase(Name = "AfterClose", Desc = "AfterClose")]
    public class TCXmlNodeIntegrityTestFile : TCXMLIntegrityBase
    {
    }

    [TestCase(Name = "Read Subtree", Desc = "CharCheckingReader")]
    public class TCReadSubtreeReader : TCReadSubtree
    {
    }

    [TestCase(Name = "ReadToDescendant", Desc = "CharCheckingReader")]
    public class TCReadToDescendantReader : TCReadToDescendant
    {
    }

    [TestCase(Name = "ReadToNextSibling", Desc = "CharCheckingReader")]
    public class TCReadToNextSiblingReader : TCReadToNextSibling
    {
    }

    [TestCase(Name = "ReadValue", Desc = "CharCheckingReader")]
    public class TCReadValueReader : TCReadValue
    {
    }

    [TestCase(Name = "ReadContentAsBase64", Desc = "CharCheckingReader")]
    public class TCReadContentAsBase64Reader : TCReadContentAsBase64
    {
    }

    [TestCase(Name = "ReadElementContentAsBase64", Desc = "CharCheckingReader")]
    public class TCReadElementContentAsBase64Reader : TCReadElementContentAsBase64
    {
    }

    [TestCase(Name = "ReadContentAsBinHex", Desc = "CharCheckingReader")]
    public class TCReadContentAsBinHexReader : TCReadContentAsBinHex
    {
    }

    [TestCase(Name = "ReadElementContentAsBinHex", Desc = "CharCheckingReader")]
    public class TCReadElementContentAsBinHexReader : TCReadElementContentAsBinHex
    {
    }

    [TestCase(Name = "ReadToFollowing", Desc = "CharCheckingReader")]
    public class TCReadToFollowingReader : TCReadToFollowing
    {
    }
}


text:
/*
 Navicat Premium Data Transfer

 Source Server         : mysql
 Source Server Type    : MySQL
 Source Server Version : 50720
 Source Host           : localhost:3306
 Source Schema         : operonDB

 Target Server Type    : MySQL
 Target Server Version : 50720
 File Encoding         : 65001

 Date: 30/10/2017 00:44:47
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for operon_path
-- ----------------------------
DROP TABLE IF EXISTS `operon_path`;
CREATE TABLE `operon_path`  (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `srr_num` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `kegg_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

SET FOREIGN_KEY_CHECKS = 1;


text: Notebooks for learning/testing/developing Landlab


text:
import Ember from 'ember';
import layout from '../templates/components/ui-list-item';

const item = Ember.Component.extend({
  layout,
  tagName: '',
  init() {
    this._super(...arguments);
    if(this.attrs.register) {
      this.attrs.register(this);
    }
  },

  text: undefined,
  heading: undefined,
  pill: undefined,
  label: undefined,
  selectable: undefined,
  mood: undefined,
  _mood: Ember.computed('mood', function() {
    const mood = this.get('mood');
    return mood ? ` list-group-item-${mood}` : '';
  }),

  actions: {
    onClick() {
      if(this.attrs.onClick) {
        this.attrs.onClick(this);
      }
    }
  }
});

item.reopenClass({
  positionalParams: ['text']
});
item[Ember.NAME_KEY] = 'ui-list-item';
export default item;


text:
case ${OSTYPE} in *darwin*)
    # if this fails please run `brew install coreutils` - homebrew also has this package
    alias readlink=greadlink
    ;;
esac
basedir="$(dirname $(readlink -f ${0}))/../.."
windir="${basedir}/build/releases/Popcorn-Time/win"
outdir="${basedir}/build/updater/win"

rm -rf "${outdir}"

mkdir -p "${outdir}"

echo "Copying Sourcefiles"
cp -r "${basedir}/src" "${outdir}"

echo "Copying modules"
cp -r "${basedir}/node_modules" "${outdir}"
rm -rf "${basedir}/node_modules/grunt"

if [ "${POP_NEW_NW}" = "TRUE" ]; then
   echo "Copying compiled files"
   mkdir -p "${outdir}/node-webkit/"
   cp -r "${windir}/Popcorn-Time/*" "${outdir}/node-webkit/"
fi

cp "${basedir}/package.json" "${outdir}"
cp "${basedir}/.git.json" "${outdir}"

cd ${outdir}
vers=$(sed -n "s|\s*\"version\"\:\ \"\(.*\)\"\,|\1|p" "${basedir}/package.json")

echo "Zipping Files"
tar --exclude-vcs -caf "../Popcorn-Time-${vers}-Update-Win.tar.xz" .


text:
#if !defined(AFX_GROUPSSEARCH_H__A4098255_6314_11D4_8E1D_000102390321__INCLUDED_)
#define AFX_GROUPSSEARCH_H__A4098255_6314_11D4_8E1D_000102390321__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// GroupsSearch.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// CGroupsSearch dialog

class CGroupsSearch : public CDialog
{
// Construction
public:
	CGroupsSearch(CWnd* pParent = NULL);   // standard constructor

// Dialog Data
	//{{AFX_DATA(CGroupsSearch)
	enum { IDD = IDD_GRPPROTOTYPE };
	CString	m_Text;
	//}}AFX_DATA

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CGroupsSearch)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:

	// Generated message map functions
	//{{AFX_MSG(CGroupsSearch)
		// NOTE: the ClassWizard will add member functions here
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_GROUPSSEARCH_H__A4098255_6314_11D4_8E1D_000102390321__INCLUDED_)


text:
{{<layout}}

{{$content}}

  Back to the GOV.UK prototype kit examples

  <form action="/" method="post" class="form">

      Your GP's details

      Where an application is successful your GP will be contacted and, where there is good reason, a medical report may be required.

      Full name
      <input type="text" class="form-control" id="full-name">

      Telephone number
      <input type="text" class="form-control" id="full-name">

      Email
      <input type="text" class="form-control" id="full-name">

      Continue

  </form>

{{/content}}

{{/layout}}


text:
package hudson.util;

import java.io.OutputStream;
import java.io.IOException;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;

/**
 * {@link ByteArrayOutputStream} re-implementation.
 *
 * <p> This version allows one to read while writing is in progress.
 *
 * @author Kohsuke Kawaguchi
 * @deprecated since 2008-05-28. Moved to stapler
 */
public class ByteBuffer extends OutputStream {

    private byte[] buf = new byte[8192];
    /**
     * Size of the data.
     */
    private int size = 0;

    public synchronized void write(byte b[], int off, int len) throws IOException {
        ensureCapacity(len);
        System.arraycopy(b, off, buf, size, len);
        size += len;
    }

    public synchronized void write(int b) throws IOException {
        ensureCapacity(1);
        buf[size++] = (byte) b;
    }

    public synchronized long length() {
        return size;
    }

    private void ensureCapacity(int len) {
        if (buf.length - size > len) {
            return;
        }

        byte[] n = new byte[Math.max(buf.length * 2, size + len)];
        System.arraycopy(buf, 0, n, 0, size);
        this.buf = n;
    }

    public synchronized String toString() {
        return new String(buf, 0, size);
    }

    /**
     * Writes the contents of this buffer to another OutputStream.
     */
    public synchronized void writeTo(OutputStream os) throws IOException {
        os.write(buf, 0, size);
    }

    /**
     * Creates an {@link InputStream} that reads from the underlying buffer.
     */
    public InputStream newInputStream() {
        return new InputStream() {
            private int pos = 0;

            public int read() throws IOException {
                synchronized (ByteBuffer.this) {
                    if (pos >= size) {
                        return -1;
                    }
                    return buf[pos++];
                }
            }

            public int read(byte b[], int off, int len) throws IOException {
                synchronized (ByteBuffer.this) {
                    if (size == pos) {
                        return -1;
                    }

                    int sz = Math.min(len, size - pos);
                    System.arraycopy(buf, pos, b, off, sz);
                    pos += sz;
                    return sz;
                }
            }

            public int available() throws IOException {
                synchronized (ByteBuffer.this) {
                    return size - pos;
                }
            }

            public long skip(long n) throws IOException {
                synchronized (ByteBuffer.this) {
                    int diff = (int) Math.min(n, size - pos);
                    pos += diff;
                    return diff;
                }
            }
        };
    }
}


text:
package org.dcm4chex.xds.mbean.store;

import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.security.DigestOutputStream;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

import javax.mail.MessagingException;
import javax.mail.internet.MimeMultipart;
import javax.xml.soap.AttachmentPart;
import javax.xml.soap.SOAPException;
import javax.xml.transform.stream.StreamSource;

import org.apache.log4j.Logger;
import org.dcm4chex.xds.XDSDocumentMetadata;
import org.jboss.system.server.ServerConfigLocator;

/**
 * @author franz.willer@gwi-ag.com
 * @version $Revision: 5474 $ $Date: 2007-11-21 16:41:28 +0800 (周三, 21 11月 2007) $
 * @since Mar 08, 2006
 */
public class StorageImpl implements Storage {

	private static final String DEFAULT_ROOT = "xds_repository";
	private static final int[] DEFAULT_DIRECTORY_TREE = new int[]{307, 317, 331};
	private static final int BUFFER_SIZE = 65535;

	private File rootDir;
	private int[] directoryTree;

	private static Logger log = Logger.getLogger(StorageImpl.class.getName());

	private static StorageImpl singleton;

	private StorageImpl(){
	}

	public static StorageImpl getInstance() {
		if ( singleton == null ) singleton = new StorageImpl();
		return singleton;
	}
	/**
	 * @return Returns the baseDir.
	 */
	public File getRootDir() {
		if ( rootDir == null ) {
    		File serverHomeDir = ServerConfigLocator.locate().getServerHomeDir();
			rootDir = new File(serverHomeDir, DEFAULT_ROOT);
		}
		return rootDir;
	}
	/**
	 * @param baseDir The baseDir to set.
	 */
	public void setRootDir(File newRoot) {
		this.rootDir = newRoot;
	}
	/**
	 * @return Returns the directoryTree.
	 */
	public int[] getDirectoryTree() {
		if ( directoryTree == null ) {
			directoryTree = DEFAULT_DIRECTORY_TREE;
		}
		return directoryTree;
	}
	/**
	 * @param directoryTree The directoryTree to set.
	 */
	public void setDirectoryTree(int[] directoryTree) {
		this.directoryTree = directoryTree;
	}
	public StoredDocument store(String uid, AttachmentPart part, XDSDocumentMetadata metadata) throws IOException {
		File docFile = getDocFile( uid );
		if ( docFile == null ) return null;
		byte[] hash = null;
		try {
			hash = saveAttachment( part, docFile );
		} catch ( Throwable t ) {
			throw (IOException) new IOException("Store document (uid:"+uid+") failed! Reason:"+t.getMessage()).initCause(t);
		}
		return new StoredDocumentAsFile(docFile, hash);
	}

	public File get(String uid) {
		return null;
	}

	private File getDocFile( String uid ) throws IOException {
		File file = getRootDir();
		if ( directoryTree != null ) {
			file = new File( file, getSubDirName( uid ) );
		}
		if ( !file.exists()) {
			if ( !file.mkdirs() ) {
				log.error("Cant create Directory:"+file+ "(uid:"+uid+")!");
				throw new IOException("Cant create directory "+file+" (uid:"+uid+")!");
			}
		}
		return new File( file, uid );
	}

	private String getSubDirName(String uid) {
		if ( getDirectoryTree() == null ) return uid;
		int hash = uid.hashCode();
		StringBuffer sb = new StringBuffer();
		int modulo;
		for ( int i = 0 ; i < directoryTree.length ; i++ ) {
			if ( directoryTree[i] == 0 ) {
				sb.append(Integer.toHexString(hash)).append(File.separatorChar);
			} else {
				modulo = hash % directoryTree[i];
				if ( modulo < 0 ) {
					modulo *= -1;
				}
				sb.append(modulo).append(File.separatorChar);
			}
		}
		return sb.toString();
	}

	private byte[] saveAttachment(AttachmentPart part, File docFile) throws SOAPException, IOException, MessagingException, NoSuchAlgorithmException {
		log.info("Save Attachment "+part.getContentId()+" (size="+part.getSize()+") to file "+docFile);
		Object content = part.getContent();
		BufferedOutputStream bos = null;
		MessageDigest md = null;
		try {
            md = MessageDigest.getInstance("SHA1");
            DigestOutputStream dos = new DigestOutputStream(new FileOutputStream(docFile), md);
            bos = new BufferedOutputStream(dos);
			if ( content instanceof String ) {
				dos.write(content.toString().getBytes());
			} else {
				if ( content instanceof StreamSource ) {
					content = ((StreamSource) content).getInputStream();
				}
				if ( content instanceof InputStream ) {
					InputStream is = (InputStream) content;
					byte[] buffer = new byte[BUFFER_SIZE];
					for ( int len; (len = is.read(buffer)) > 0; ) {
						dos.write(buffer, 0, len);
					}
				} else if ( content instanceof MimeMultipart ) {
					MimeMultipart mmp = (MimeMultipart) content;
					mmp.writeTo( dos );
				} else {
					throw new IllegalArgumentException("Unknown content:"+content.getClass().getName()+" contentType:"+part.getContentType());
				}
			}
		} finally {
			if ( bos != null ) bos.close();
		}
		return md == null ? null : md.digest();
	}

}


text:
Class UnaryOperatorNode
    Inherits ExpressionNode

    Private mExpr As ExpressionNode
    Private mOperator As String

    Sub New(ByVal operator As String, ByVal expr As ExpressionNode)
        mOperator = operator
        mExpr = expr
    End Sub

    ReadOnly Property Expression() As ExpressionNode
        Get
            Return mExpr
        End Get
    End Property

    ReadOnly Property Operator() As String
        Get
            Return mOperator
        End Get
    End Property

    Overrides Function Evaluate(ByVal env As Environment) As Object
        Dim expr As Object = mExpr.Evaluate(env)

        Select Case mOperator
            Case "not"
                Return Not expr
            Case Else
                Throw New Exception("Operador desconocido")
        End Select
    End Function
End Class


text:
typedef struct t_planet {
	Vector3 position;
	Vector3 speed;
	pt_float mass;
} Planet;

#endif // __PLANET_H__


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
	<uses-sdk android:minSdkVersion="15" />
	<application android:label="FormsCrossPlatform.Android"></application>
</manifest>


text:
// package com.goodformentertainment.canary.playerstate;
//
// import java.io.File;
// import java.io.IOException;
// import java.util.Collection;
// import java.util.Collections;
// import java.util.HashMap;
// import java.util.HashSet;
// import java.util.Map;
// import java.util.concurrent.TimeUnit;
//
// import org.apache.logging.log4j.Level;
// import org.apache.logging.log4j.LogManager;
// import org.apache.logging.log4j.core.LoggerContext;
// import org.apache.logging.log4j.core.config.Configuration;
// import org.apache.logging.log4j.core.config.LoggerConfig;
//
// import com.goodformentertainment.canary.playerstate.api.IPlayerStateManager;
// import com.goodformentertainment.canary.playerstate.api.IWorldStateManager;
// import com.goodformentertainment.canary.playerstate.api.SaveState;
// import com.goodformentertainment.canary.playerstate.api.impl.PlayerStateManager;
// import com.goodformentertainment.canary.playerstate.api.impl.WorldStateManager;
// import com.goodformentertainment.canary.playerstate.hook.WorldDeathHook;
// import com.goodformentertainment.canary.playerstate.hook.WorldEnterHook;
// import com.goodformentertainment.canary.playerstate.hook.WorldExitHook;
// import com.goodformentertainment.canary.util.JarUtil;
//
// import net.canarymod.Canary;
// import net.canarymod.api.entity.living.humanoid.Player;
// import net.canarymod.api.world.World;
// import net.canarymod.api.world.blocks.BlockType;
// import net.canarymod.api.world.position.Location;
// import net.canarymod.api.world.position.Vector3D;
// import net.canarymod.chat.ChatFormat;
// import net.canarymod.commandsys.CommandDependencyException;
// import net.canarymod.database.exceptions.DatabaseReadException;
// import net.canarymod.database.exceptions.DatabaseWriteException;
// import net.canarymod.hook.HookHandler;
// import net.canarymod.hook.player.ConnectionHook;
// import net.canarymod.hook.player.DisconnectionHook;
// import net.canarymod.hook.player.PlayerDeathHook;
// import net.canarymod.hook.player.PlayerRespawnedHook;
// import net.canarymod.hook.player.TeleportHook;
// import net.canarymod.logger.Logman;
// import net.canarymod.plugin.Plugin;
// import net.canarymod.plugin.PluginListener;
// import net.canarymod.tasks.ServerTask;
// import net.visualillusionsent.utils.TaskManager;
//
// public class PlayerStatePlugin extends Plugin implements PluginListener {
// private static final int MULTIPLAYER_SPAWN_RADIUS = 16;
// private static final long TELEPORT_DELAY_SECONDS = 3;
// private static final int TELEPORT_DISTANCE_FUDGE = 1;
//
// public static Logman LOG;
//
// private static final IWorldStateManager worldStateManager = new WorldStateManager();
// private static final IPlayerStateManager manager = new PlayerStateManager();
//
// /**
// * Get the WorldStateManager from the PlayerStatePlugin.
// *
// * @return The WorldStateManager.
// */
// public static IWorldStateManager getWorldManager() {
// return worldStateManager;
// }
//
// /**
// * Get the PlayerStateManager from the PlayerStatePlugin.
// *
// * @return The PlayerStateManager.
// */
// public static IPlayerStateManager getPlayerManager() {
// return manager;
// }
//
// private PlayerStateConfiguration config;
// private PlayerStateCommand command;
//
// private Collection<String> connectingPlayers;
// private Map<String, WorldExitHook> exitingPlayers;
// private Map<String, Location> deadPlayers;
// private Map<String, Location> finalLocations;
//
// public PlayerStatePlugin() {
// PlayerStatePlugin.LOG = getLogman();
// }
//
// @Override
// public boolean enable() {
// boolean success = true;
//
// try {
// JarUtil.exportResource(this, "PlayerState.cfg", new File("config/PlayerState"));
// } catch (final IOException e) {
// LOG.warn("Failed to create the default configuration file.", e);
// }
//
// config = new PlayerStateConfiguration(this);
// setLoggingLevel(config.getLoggingLevel());
//
// LOG.info("Enabling " + getName() + " Version " + getVersion());
// LOG.info("Authored by " + getAuthor());
//
// connectingPlayers = Collections.synchronizedCollection(new HashSet<String>());
// exitingPlayers = Collections.synchronizedMap(new HashMap<String, WorldExitHook>());
// deadPlayers = Collections.synchronizedMap(new HashMap<String, Location>());
// finalLocations = Collections.synchronizedMap(new HashMap<String, Location>());
//
// command = new PlayerStateCommand(manager);
//
// manager.startSaveThread();
//
// Canary.hooks().registerListener(this, this);
//
// try {
// Canary.commands().registerCommands(command, this, false);
// } catch (final CommandDependencyException e) {
// LOG.error("Error registering commands: ", e);
// success = false;
// }
//
// return success;
// }
//
// @Override
// public void disable() {
// LOG.info("Disabling " + getName());
//
// Canary.commands().unregisterCommands(this);
// Canary.hooks().unregisterPluginListeners(this);
// manager.stopSaveThread();
//
// config = null;
// command = null;
//
// connectingPlayers = null;
// exitingPlayers = null;
// deadPlayers = null;
// finalLocations = null;
// }
//
// @HookHandler
// public void onConnection(final ConnectionHook hook)
// throws DatabaseReadException, DatabaseWriteException {
// final Player player = hook.getPlayer();
// final World world = player.getWorld();
// final Location toLoc = player.getLocation();
//
// new WorldEnterHook(player, world, null, toLoc).call();
//
// if (hook.isFirstConnection()) {
// if (config.exactSpawn()) {
// player.teleportTo(Canary.getServer().getDefaultWorld().getSpawnLocation());
// }
// }
//
// connectingPlayers.add(player.getUUIDString());
// }
//
// @HookHandler
// public void onDisconnection(final DisconnectionHook hook) throws DatabaseWriteException {
// final Player player = hook.getPlayer();
// final World world = player.getWorld();
// final Location fromLoc = player.getLocation();
//
// // final String state = getState(player.getWorld());
// // manager.savePlayerState(player, state, getSaves(state));
//
// new WorldExitHook(player, world, fromLoc, null).call();
// }
//
// @HookHandler
// public void onCommand(final PlayerCommandHook hook) throws InterruptedException,
// ExecutionException {
// final String[] command = hook.getCommand();
// if (command[0].equalsIgnoreCase("/spawn")) {
// hook.setCanceled();
//
// // Do not allow spawn command to nether dimension
// final Player player = hook.getPlayer();
// if (command[command.length - 1].matches(".*(?i)(NETHER)$")) {
// player.message(ChatFormat.RED + "Spawning to the nether is verboten.");
// } else {
// World world = player.getWorld();
// if (command.length > 1) {
// world = Canary.getServer().getWorld(command[1]);
// }
// if (world == null) {
// player.message(ChatFormat.RED + "Invalid world specified.");
// } else {
// final Location spawn = world.getSpawnLocation();
// delayedTeleport(player, spawn, ChatFormat.YELLOW + "Teleported to spawn");
// }
// }
// } else if (command[0].equalsIgnoreCase("/home")) {
// hook.setCanceled();
//
// final Player player = hook.getPlayer();
// Player targetPlayer = player;
// if (command.length > 1) {
// targetPlayer = Canary.getServer().getPlayer(command[1]);
// }
// // TODO handle offline players
// final Location loc = targetPlayer.getHome();
// delayedTeleport(player, loc, ChatFormat.RED + "Going home");
//// } else if (command[0].equalsIgnoreCase("/tp")) {
//// // foo(player, loc, "Teleported " + targetPlayer.getName() + " to " + loc);
// }
// }
//
// @HookHandler
// public void onDeath(final PlayerDeathHook hook) {
// final Player player = hook.getPlayer();
// deadPlayers.put(player.getUUIDString(), player.getLocation());
//
// LOG.debug("Player " + player.getName() + " died at: " + player.getLocation());
// }
//
// @HookHandler
// public void onRespawned(final PlayerRespawnedHook hook) {
// final Player player = hook.getPlayer();
// final String uuid = player.getUUIDString();
//
// LOG.info("Player " + player.getName() + " respawned at: " + hook.getLocation());
//
// if (exitingPlayers.containsKey(uuid)) {
// final WorldEnterHook worldEnter = new WorldEnterHook(exitingPlayers.remove(uuid));
// if (worldEnter.getWorld() == player.getWorld()) {
// worldEnter.call();
// } else {
// LOG.error("Player " + player.getName() + " is not in the expected world "
// + worldEnter.getWorld().getName());
// }
// }
//
// final Location finalLoc = finalLocations.remove(uuid);
// if (finalLoc != null) {
// Canary.getServer().addSynchronousTask(new ServerTask(this, 10) {
// @Override
// public void run() {
// player.teleportTo(finalLoc);
// }
// });
// }
// }
//
// @HookHandler
// public void onTeleport(final TeleportHook hook) {
// final Player player = hook.getPlayer();
// final String uuid = player.getUUIDString();
// final Location curLoc = hook.getCurrentLocation();
// final Location destination = hook.getDestination();
//
// LOG.debug(
// "Player " + player.getName() + " teleported from " + curLoc + " to " + destination);
//
// switch (hook.getTeleportReason()) {
// case BED:
// case MOUNT_CHANGE:
// case MOVEMENT:
// // LOG.info(" CURLOC: " + curLoc);
// // LOG.info(" DESTINATION: " + destination);
// // LOG.info(" SPAWN: " + player.getSpawnPosition());
// break;
// case COMMAND:
// case PLUGIN:
// case WARP:
// if (!curLoc.getWorld().equals(destination.getWorld())) {
// final WorldExitHook worldExit = new WorldExitHook(player, curLoc.getWorld(),
// curLoc, destination);
// worldExit.call();
// exitingPlayers.put(uuid, worldExit);
// }
// break;
// case RESPAWN:
// // if (curLoc.equals(destination)) {
// // LOG.info(" CURLOC == DEST");
// // }
// if (connectingPlayers.remove(uuid)) {
// LOG.debug(" CONNECTING");
// } else if (exitingPlayers.containsKey(uuid)) {
// LOG.debug(" EXITING");
// } else if (deadPlayers.containsKey(uuid)) {
// LOG.debug(" ISDEAD");
//
// final Location deadLoc = deadPlayers.remove(uuid);
//
// final WorldDeathHook worldDeath = new WorldDeathHook(player, deadLoc,
// destination);
// worldDeath.call();
// if (!destination.equals(worldDeath.getSpawnLocation())) {
// LOG.debug(" OVERRIDESPAWN");
// finalLocations.put(uuid, worldDeath.getSpawnLocation());
// }
//
// if (isBedRespawn(destination)) {
// LOG.debug(" GOTOBED");
//
// final Location bedLoc = player.getSpawnPosition();
// if (destination.getWorld().getBlockAt(bedLoc).getType() == BlockType.Bed) {
// LOG.debug(" PRESENT");
//
// if (!deadLoc.getWorld().equals(destination.getWorld())) {
// final WorldExitHook worldExit = new WorldExitHook(player,
// deadLoc.getWorld(), deadLoc, destination);
// worldExit.call();
// exitingPlayers.put(uuid, worldExit);
// }
// } else {
// LOG.debug(" MISSING");
//
// if (!deadLoc.getWorld().equals(destination.getWorld())) {
// final WorldExitHook worldExit = new WorldExitHook(player,
// deadLoc.getWorld(), deadLoc,
// destination.getWorld().getSpawnLocation());
// worldExit.call();
// exitingPlayers.put(uuid, worldExit);
// }
//
// hook.setCanceled();
// player.teleportTo(destination.getWorld().getSpawnLocation());
// }
//
// // LOG.info(" CURLOC: " + curLoc);
// // LOG.info(" DESTINATION: " + destination);
// // LOG.info(" SPAWN: " + player.getSpawnPosition());
// } else {
// LOG.debug(" GOTOSPAWN");
//
// if (!deadLoc.getWorld().equals(destination.getWorld())) {
// final WorldExitHook worldExit = new WorldExitHook(player,
// deadLoc.getWorld(), deadLoc,
// destination.getWorld().getSpawnLocation());
// worldExit.call();
// exitingPlayers.put(uuid, worldExit);
// }
//
// if (config.exactSpawn()) {
// hook.setCanceled();
// player.teleportTo(destination.getWorld().getSpawnLocation());
// }
// }
// }
// break;
// case PORTAL:
// case UNDEFINED:
// // LOG.info(" CURLOC: " + curLoc);
// // LOG.info(" DESTINATION: " + destination);
// // LOG.info(" SPAWN: " + player.getSpawnPosition());
// break;
// }
// }
//
// @HookHandler
// public void onWorldEnter(final WorldEnterHook hook)
// throws DatabaseReadException, DatabaseWriteException {
// final Player player = hook.getPlayer();
// final World toWorld = hook.getToLocation().getWorld();
// final String toState = getState(toWorld);
// String fromState = null;
// if (hook.getFromLocation() != null) {
// fromState = getState(hook.getFromLocation().getWorld());
// }
//
// player.message(ChatFormat.GRAY + "Entered world " + hook.getWorld().getName());
//
// if (fromState != null) {
// // Not player login, load the player state
// if (!toState.equals(fromState)) {
// if (manager.loadPlayerState(player, toState, getSaves(toState))) {
// player.message(ChatFormat.GOLD + "Loaded state " + toState);
// } else {
// player.setSpawnPosition(toWorld.getSpawnLocation());
// manager.savePlayerState(player, toState, getSaves(toState));
// // manager.setPlayerSpawnLocation(player, toState, toWorld.getSpawnLocation());
// player.message(ChatFormat.GOLD + "Entering state " + toState);
// }
// }
// }
// }
//
// @HookHandler
// public void onWorldExit(final WorldExitHook hook) throws DatabaseWriteException {
// final Player player = hook.getPlayer();
// final String fromState = getState(hook.getFromLocation().getWorld());
// String toState = null;
// if (hook.getToLocation() != null) {
// toState = getState(hook.getToLocation().getWorld());
// }
//
// player.message(ChatFormat.GRAY + "Exited world " + hook.getWorld().getName());
//
// if (!fromState.equals(toState)) {
// manager.savePlayerState(player, fromState, getSaves(fromState));
// player.message(ChatFormat.GOLD + "Saved state " + fromState);
// }
// }
//
// private void delayedTeleport(final Player player, final Location destination,
// final String successMessage) {
// final Location curLoc = player.getLocation();
//
// player.message(ChatFormat.GOLD + "Stand still for " + TELEPORT_DELAY_SECONDS
// + " seconds to teleport...");
// TaskManager.scheduleDelayedTask(new Runnable() {
// @Override
// public void run() {
// if (curLoc.getDistance(player.getLocation()) > TELEPORT_DISTANCE_FUDGE) {
// player.message(ChatFormat.RED + "Teleportation cancelled");
// } else {
// player.teleportTo(destination);
//
// if (successMessage != null) {
// player.message(successMessage);
// }
// }
// }
// }, TELEPORT_DELAY_SECONDS, TimeUnit.SECONDS);
// }
//
// private String getState(final World world) {
// String state = worldStateManager.getManagedWorldState(world);
// if (state == null) {
// state = config.getState(world);
// }
// return state;
// }
//
// private SaveState[] getSaves(final String state) {
// SaveState[] saves = worldStateManager.getManagedStateSaves(state);
// if (saves == null) {
// saves = config.getSaves(state);
// }
// return saves;
// }
//
// private boolean isBedRespawn(final Location loc) {
// boolean isBedRespawn = false;
//
// final Vector3D v = new Vector3D(loc);
// final Vector3D spawnV = new Vector3D(loc.getWorld().getSpawnLocation());
// v.setY(0);
// spawnV.setY(0);
// if (v.getSquareDistance(spawnV) > MULTIPLAYER_SPAWN_RADIUS * MULTIPLAYER_SPAWN_RADIUS) {
// isBedRespawn = true;
// }
//
// return isBedRespawn;
// }
//
// private void setLoggingLevel(final String level) {
// if (level != null) {
// final LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
// final Configuration config = ctx.getConfiguration();
// final LoggerConfig loggerConfig = config.getLoggerConfig(LOG.getName());
// loggerConfig.setLevel(Level.toLevel(level));
// ctx.updateLoggers();
// }
// }
// }


text:
/**
 *
 */
package edu.cmu.hcii.whyline.ui.components;

import java.awt.BasicStroke;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Insets;
import java.awt.RenderingHints;
import java.awt.Stroke;

import javax.swing.border.Border;

import edu.cmu.hcii.whyline.ui.UI;

/**
 * @author Andrew J. Ko
 *
 */
public class WhylineControlBorder implements Border {

	private int padding = UI.getBorderPadding();

	public WhylineControlBorder() {}

	private Insets standardInsets = new Insets(padding, padding, padding, padding);

	public Insets getBorderInsets(Component c) {
		return standardInsets;
	}

	public boolean isBorderOpaque() {
		return true;
	}

	public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {

		if(!c.isVisible()) return;

		Graphics2D g2 = (Graphics2D)g.create();

		g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
		g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
		g2.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);

		Stroke old = g2.getStroke();

		g2.setStroke(new BasicStroke(UI.getBorderPadding()));
		g2.setColor(UI.getPanelLightColor());
		g2.drawRect(0, 0, width, height);

		int corner = UI.getRoundedness() - 1;

		int widthOfControlBackgroundStroke = UI.getBorderPadding() + 1;
		g2.setStroke(new BasicStroke(widthOfControlBackgroundStroke));
		g2.setColor(c.getBackground());
		g2.drawRoundRect(
			widthOfControlBackgroundStroke / 2 - 1,
			widthOfControlBackgroundStroke / 2 - 1,
			width - widthOfControlBackgroundStroke + 1,
			height - widthOfControlBackgroundStroke + 1,
			corner, corner);

		g2.setStroke(old);

		if(c.hasFocus()) {
			g2.setColor(UI.getFocusColor());
			float strokeWidth = 2.0f;
			g2.setStroke(new BasicStroke(strokeWidth));
			g2.drawRect((int)(strokeWidth / 2), (int)(strokeWidth / 2), (int)(width - strokeWidth - 1), (int)(height - strokeWidth - 1));
		}
		else {
			g2.setColor(c.isEnabled() ? UI.getControlBorderColor() : UI.getControlBorderColor().darker());
			g2.drawRoundRect(0, 0, width - 1, height - 1, corner, corner);
		}

	}

}


text:
package net.runelite.client.ui;

import java.awt.Color;
import java.awt.Point;
import javax.swing.JLabel;
import lombok.Getter;

public class JShadowedLabel extends JLabel
{
	public JShadowedLabel()
	{
		super();
		setUI(new JShadowedLabelUI());
	}

	public JShadowedLabel(String str)
	{
		super(str);
		setUI(new JShadowedLabelUI());
	}

	@Getter
	private Color shadow = Color.BLACK;

	public void setShadow(Color shadow)
	{
		this.shadow = shadow;
		repaint();
	}

	@Getter
	private Point shadowSize = new Point(1, 1);

	public void setShadowSize(Point newSize)
	{
		this.shadowSize = newSize;
		revalidate();
		repaint();
	}
}