text:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE ldml SYSTEM "../../common/dtd/ldml.dtd">
<ldml>
	<identity>
		<version number="$Revision: 4178 $"/>
		<generation date="$Date: 2009-06-14 23:46:26 -0400 (Sun, 14 Jun 2009) $"/>
		<language type="om"/>
	</identity>
	<localeDisplayNames>
		<languages>
			<language type="af" draft="unconfirmed">Afrikoota</language>
			<language type="am" draft="unconfirmed">Afaan Sidaamaa</language>
			<language type="ar" draft="unconfirmed">Arabiffaa</language>
			<language type="az" draft="unconfirmed">Afaan Azerbaijani</language>
			<language type="be" draft="unconfirmed">Afaan Belarusia</language>
			<language type="bg" draft="unconfirmed">Afaan Bulgariya</language>
			<language type="bh" draft="unconfirmed">Afaan Bihari</language>
			<language type="bn" draft="unconfirmed">Afaan Baangladeshi</language>
			<language type="bs" draft="unconfirmed">Afaan Bosniyaa</language>
			<language type="ca" draft="unconfirmed">Afaan Katalaa</language>
			<language type="cs" draft="unconfirmed">Afaan Czech</language>
			<language type="cy" draft="unconfirmed">Welishiffaa</language>
			<language type="da" draft="unconfirmed">Afaan Deenmaark</language>
			<language type="de" draft="unconfirmed">Afaan Jarmanii</language>
			<language type="el" draft="unconfirmed">Afaan Giriiki</language>
			<language type="en" draft="unconfirmed">Ingliffa</language>
			<language type="eo" draft="unconfirmed">Afaan Esperantoo</language>
			<language type="es" draft="unconfirmed">Afaan Ispeen</language>
			<language type="et" draft="unconfirmed">Afaan Istooniya</language>
			<language type="eu" draft="unconfirmed">Afaan Baskuu</language>
			<language type="fa" draft="unconfirmed">Afaan Persia</language>
			<language type="fi" draft="unconfirmed">Afaan Fiilaandi</language>
			<language type="fil" draft="unconfirmed">Afaan Filippinii</language>
			<language type="fo" draft="unconfirmed">Afaan Faroese</language>
			<language type="fr" draft="unconfirmed">Afaan Faransaayii</language>
			<language type="fy" draft="unconfirmed">Afaan Firisiyaani</language>
			<language type="ga" draft="unconfirmed">Afaan Ayirishii</language>
			<language type="gd" draft="unconfirmed">Scots Gaelic</language>
			<language type="gl" draft="unconfirmed">Afaan Galishii</language>
			<language type="gn" draft="unconfirmed">Afaan Guarani</language>
			<language type="gu" draft="unconfirmed">Afaan Gujarati</language>
			<language type="he" draft="unconfirmed">Afaan Hebrew</language>
			<language type="hi" draft="unconfirmed">Afaan Hindii</language>
			<language type="hr" draft="unconfirmed">Afaan Croatian</language>
			<language type="hu" draft="unconfirmed">Afaan Hangaari</language>
			<language type="ia" draft="unconfirmed">Interlingua</language>
			<language type="id" draft="unconfirmed">Afaan Indoneziya</language>
			<language type="is" draft="unconfirmed">Ayiislandiffaa</language>
			<language type="it" draft="unconfirmed">Afaan Xaaliyaani</language>
			<language type="ja" draft="unconfirmed">Afaan Japanii</language>
			<language type="jv" draft="unconfirmed">Afaan Java</language>
			<language type="ka" draft="unconfirmed">Afaan Georgian</language>
			<language type="kn" draft="unconfirmed">Afaan Kannada</language>
			<language type="ko" draft="unconfirmed">Afaan Korea</language>
			<language type="la" draft="unconfirmed">Afaan Laatini</language>
			<language type="lt" draft="unconfirmed">Afaan Liituniyaa</language>
			<language type="lv" draft="unconfirmed">Afaan Lativiyaa</language>
			<language type="mk" draft="unconfirmed">Afaan Macedooniyaa</language>
			<language type="ml" draft="unconfirmed">Malayaalamiffaa</language>
			<language type="mr" draft="unconfirmed">Afaan Maratii</language>
			<language type="ms" draft="unconfirmed">Malaayiffaa</language>
			<language type="mt" draft="unconfirmed">Afaan Maltesii</language>
			<language type="ne" draft="unconfirmed">Afaan Nepalii</language>
			<language type="nl" draft="unconfirmed">Afaan Dachii</language>
			<language type="nn" draft="unconfirmed">Afaan Norwegian</language>
			<language type="no" draft="unconfirmed">Afaan Norweyii</language>
			<language type="oc" draft="unconfirmed">Afaan Occit</language>
			<language type="om">Oromoo</language>
			<language type="pa" draft="unconfirmed">Afaan Punjabii</language>
			<language type="pl" draft="unconfirmed">Afaan Polandii</language>
			<language type="pt" draft="unconfirmed">Afaan Porchugaal</language>
			<language type="pt_BR" draft="unconfirmed">Afaan Portugali (Braazil)</language>
			<language type="pt_PT" draft="unconfirmed">Afaan Protuguese</language>
			<language type="ro" draft="unconfirmed">Afaan Romaniyaa</language>
			<language type="ru" draft="unconfirmed">Afaan Rushiyaa</language>
			<language type="si" draft="unconfirmed">Afaan Sinhalese</language>
			<language type="sk" draft="unconfirmed">Afaan Slovak</language>
			<language type="sl" draft="unconfirmed">Afaan Islovaniyaa</language>
			<language type="sq" draft="unconfirmed">Afaan Albaniyaa</language>
			<language type="sr" draft="unconfirmed">Afaan Serbiya</language>
			<language type="su" draft="unconfirmed">Afaan Sudaanii</language>
			<language type="sv" draft="unconfirmed">Afaan Suwidiin</language>
			<language type="sw" draft="unconfirmed">Suwahilii</language>
			<language type="ta" draft="unconfirmed">Afaan Tamilii</language>
			<language type="te" draft="unconfirmed">Afaan Telugu</language>
			<language type="th" draft="unconfirmed">Afaan Tayii</language>
			<language type="ti" draft="unconfirmed">Afaan Tigiree</language>
			<language type="tk" draft="unconfirmed">Lammii Turkii</language>
			<language type="tlh" draft="unconfirmed">Afaan Kilingon</language>
			<language type="tr" draft="unconfirmed">Afaan Turkii</language>
			<language type="uk" draft="unconfirmed">Afaan Ukreenii</language>
			<language type="ur" draft="unconfirmed">Afaan Urdu</language>
			<language type="uz" draft="unconfirmed">Afaan Uzbek</language>
			<language type="vi" draft="unconfirmed">Afaan Veetinam</language>
			<language type="xh" draft="unconfirmed">Afaan Xhosa</language>
			<language type="zh" draft="unconfirmed">Chinese</language>
			<language type="zu" draft="unconfirmed">Afaan Zuulu</language>
		</languages>
		<scripts>
			<script type="Latn" draft="unconfirmed">Latin</script>
		</scripts>
		<territories>
			<territory type="BR" draft="unconfirmed">Brazil</territory>
			<territory type="CN" draft="unconfirmed">China</territory>
			<territory type="DE" draft="unconfirmed">Germany</territory>
			<territory type="ET">Itoophiyaa</territory>
			<territory type="FR" draft="unconfirmed">France</territory>
			<territory type="GB" draft="unconfirmed">United Kingdom</territory>
			<territory type="IN" draft="unconfirmed">India</territory>
			<territory type="IT" draft="unconfirmed">Italy</territory>
			<territory type="JP" draft="unconfirmed">Japan</territory>
			<territory type="KE">Keeniyaa</territory>
			<territory type="RU" draft="unconfirmed">Russia</territory>
			<territory type="US" draft="unconfirmed">United States</territory>
		</territories>
	</localeDisplayNames>
	<characters>
		<exemplarCharacters>[a-z]</exemplarCharacters>
	</characters>
	<dates>
		<calendars>
			<calendar type="gregorian">
				<months>
					<monthContext type="format">
						<monthWidth type="abbreviated">
							<month type="1">Ama</month>
							<month type="2">Gur</month>
							<month type="3">Bit</month>
							<month type="4">Elb</month>
							<month type="5">Cam</month>
							<month type="6">Wax</month>
							<month type="7">Ado</month>
							<month type="8">Hag</month>
							<month type="9">Ful</month>
							<month type="10">Onk</month>
							<month type="11">Sad</month>
							<month type="12">Mud</month>
						</monthWidth>
						<monthWidth type="wide">
							<month type="1">Amajjii</month>
							<month type="2">Guraandhala</month>
							<month type="3">Bitooteessa</month>
							<month type="4">Elba</month>
							<month type="5">Caamsa</month>
							<month type="6">Waxabajjii</month>
							<month type="7">Adooleessa</month>
							<month type="8">Hagayya</month>
							<month type="9">Fuulbana</month>
							<month type="10">Onkololeessa</month>
							<month type="11">Sadaasa</month>
							<month type="12">Muddee</month>
						</monthWidth>
					</monthContext>
					<monthContext type="stand-alone">
						<monthWidth type="narrow">
							<month type="1" draft="unconfirmed">J</month>
							<month type="2" draft="unconfirmed">F</month>
							<month type="3" draft="unconfirmed">M</month>
							<month type="4" draft="unconfirmed">A</month>
							<month type="5" draft="unconfirmed">M</month>
							<month type="6" draft="unconfirmed">J</month>
							<month type="7" draft="unconfirmed">J</month>
							<month type="8" draft="unconfirmed">A</month>
							<month type="9" draft="unconfirmed">S</month>
							<month type="10" draft="unconfirmed">O</month>
							<month type="11" draft="unconfirmed">N</month>
							<month type="12" draft="unconfirmed">D</month>
						</monthWidth>
					</monthContext>
				</months>
				<days>
					<dayContext type="format">
						<dayWidth type="abbreviated">
							<day type="sun">Dil</day>
							<day type="mon">Wix</day>
							<day type="tue">Qib</day>
							<day type="wed">Rob</day>
							<day type="thu">Kam</day>
							<day type="fri">Jim</day>
							<day type="sat">San</day>
						</dayWidth>
						<dayWidth type="wide">
							<day type="sun">Dilbata</day>
							<day type="mon">Wiixata</day>
							<day type="tue">Qibxata</day>
							<day type="wed">Roobii</day>
							<day type="thu">Kamiisa</day>
							<day type="fri">Jimaata</day>
							<day type="sat">Sanbata</day>
						</dayWidth>
					</dayContext>
					<dayContext type="stand-alone">
						<dayWidth type="narrow">
							<day type="sun" draft="unconfirmed">S</day>
							<day type="mon" draft="unconfirmed">M</day>
							<day type="tue" draft="unconfirmed">T</day>
							<day type="wed" draft="unconfirmed">W</day>
							<day type="thu" draft="unconfirmed">T</day>
							<day type="fri" draft="unconfirmed">F</day>
							<day type="sat" draft="unconfirmed">S</day>
						</dayWidth>
					</dayContext>
				</days>
				<quarters>
					<quarterContext type="format">
						<quarterWidth type="abbreviated">
							<quarter type="1" draft="unconfirmed">Q1</quarter>
							<quarter type="2" draft="unconfirmed">Q2</quarter>
							<quarter type="3" draft="unconfirmed">Q3</quarter>
							<quarter type="4" draft="unconfirmed">Q4</quarter>
						</quarterWidth>
						<quarterWidth type="wide">
							<quarter type="1" draft="unconfirmed">Q1</quarter>
							<quarter type="2" draft="unconfirmed">Q2</quarter>
							<quarter type="3" draft="unconfirmed">Q3</quarter>
							<quarter type="4" draft="unconfirmed">Q4</quarter>
						</quarterWidth>
					</quarterContext>
				</quarters>
				<am draft="unconfirmed">WD</am>
				<pm draft="unconfirmed">WB</pm>
				<eras>
					<eraAbbr>
						<era type="0">KD</era>
						<era type="1">KB</era>
					</eraAbbr>
				</eras>
				<dateFormats>
					<dateFormatLength type="full">
						<dateFormat>
							<pattern draft="unconfirmed">EEEE, MMMM d, y</pattern>
						</dateFormat>
					</dateFormatLength>
					<dateFormatLength type="long">
						<dateFormat>
							<pattern draft="unconfirmed">dd MMMM y</pattern>
						</dateFormat>
					</dateFormatLength>
					<dateFormatLength type="medium">
						<dateFormat>
							<pattern draft="unconfirmed">dd-MMM-y</pattern>
						</dateFormat>
					</dateFormatLength>
					<dateFormatLength type="short">
						<dateFormat>
							<pattern draft="unconfirmed">dd/MM/yy</pattern>
						</dateFormat>
					</dateFormatLength>
				</dateFormats>
				<timeFormats>
					<timeFormatLength type="full">
						<timeFormat>
							<pattern draft="unconfirmed">h:mm:ss a zzzz</pattern>
						</timeFormat>
					</timeFormatLength>
					<timeFormatLength type="long">
						<timeFormat>
							<pattern draft="unconfirmed">h:mm:ss a z</pattern>
						</timeFormat>
					</timeFormatLength>
					<timeFormatLength type="medium">
						<timeFormat>
							<pattern draft="unconfirmed">h:mm:ss a</pattern>
						</timeFormat>
					</timeFormatLength>
					<timeFormatLength type="short">
						<timeFormat>
							<pattern draft="unconfirmed">h:mm a</pattern>
						</timeFormat>
					</timeFormatLength>
				</timeFormats>
				<dateTimeFormats>
					<availableFormats>
						<dateFormatItem id="MMdd" draft="unconfirmed">dd/MM</dateFormatItem>
						<dateFormatItem id="MMMMdd" draft="unconfirmed">dd MMMM</dateFormatItem>
						<dateFormatItem id="yyMM" draft="unconfirmed">MM/yy</dateFormatItem>
						<dateFormatItem id="yyQ" draft="unconfirmed">Q yy</dateFormatItem>
						<dateFormatItem id="yyyyMMMM" draft="unconfirmed">MMMM y</dateFormatItem>
					</availableFormats>
				</dateTimeFormats>
			</calendar>
		</calendars>
		<timeZoneNames>
			<hourFormat draft="unconfirmed">+HH:mm;-HH:mm</hourFormat>
			<gmtFormat draft="unconfirmed">GMT{0}</gmtFormat>
			<regionFormat draft="unconfirmed">{0}</regionFormat>
		</timeZoneNames>
	</dates>
	<numbers>
		<currencyFormats>
			<currencyFormatLength>
				<currencyFormat>
					<pattern>¤#,##0.00</pattern>
				</currencyFormat>
			</currencyFormatLength>
		</currencyFormats>
		<currencies>
			<currency type="BRL">
				<displayName draft="unconfirmed">Brazilian Real</displayName>
			</currency>
			<currency type="CNY">
				<displayName draft="unconfirmed">Chinese Yuan Renminbi</displayName>
			</currency>
			<currency type="ETB">
				<displayName draft="unconfirmed">Itoophiyaa Birrii</displayName>
			</currency>
			<currency type="EUR">
				<displayName draft="unconfirmed">Euro</displayName>
			</currency>
			<currency type="GBP">
				<displayName draft="unconfirmed">British Pound Sterling</displayName>
			</currency>
			<currency type="INR">
				<displayName draft="unconfirmed">Indian Rupee</displayName>
			</currency>
			<currency type="JPY">
				<displayName draft="unconfirmed">Japanese Yen</displayName>
			</currency>
			<currency type="RUB">
				<displayName draft="unconfirmed">Russian Ruble</displayName>
			</currency>
			<currency type="USD">
				<displayName draft="unconfirmed">US Dollar</displayName>
			</currency>
		</currencies>
	</numbers>
</ldml>


text:
/* Preview the transect photo just taken */

var mediaName = Ti.App.Properties.getString('media_name');
var folderName = Ti.App.Properties.getString('folder_name');

// var temp=Ti.Filesystem.getFile(Titanium.Filesystem.tempDirectory,'temp.png');
var imageDir = Ti.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory, folderName);
//alert(temp.resolve().toString());
var imageFile = Ti.Filesystem.getFile(imageDir.resolve(), mediaName);

var back=Titanium.UI.createImageView({
   //check if asect ratio
   //image:temp,
   image:imageFile,
   height:Ti.UI.FILL,
   width:Ti.UI.FILL
});
$.modalWin.add(back);

function backBtn(){
	$.modalNav.close();
}

redpajama_set_name: RedPajamaGithub


text:
require 'spec_helper'

describe AccountConnectionsController do
  before(:each) {
    OmniAuth.config.test_mode = true
    OmniAuth.config.mock_auth[:twitter] = nil
    OmniAuth.config.mock_auth[:facebook] = nil
  }

  specify 'Twitter' do
    OmniAuth.config.mock_auth[:twitter] = OmniAuth::AuthHash.new(
      "provider" => "twitter",
      "uid" => "98188244",
      "info" => {
        "nickname" => "stefanwienert",
        "name" => "Stefan Wienert",
        "location" => "Dresden, Germany",
        "image" => "http://pbs.twimg.com/profile_images/438813559045095424/e6QwEVQP_normal.jpeg",
        "description" => "Lead developer at @pludoni working in Dresden, living in Frankfurt. #Ruby, #RubyOnRails, #vim, #China",
        "urls" => {
          "Website" => "http://t.co/F1UG9don0R",
          "Twitter" => "https://twitter.com/stefanwienert"
        }
      },
      "credentials" => {
        "token" => "98188244-0123123123",
        "secret" => "123123123123123123123"
      }
    )
    request.env["omniauth.auth"] = OmniAuth.config.mock_auth[:twitter]

    get :omniauth, params: { provider: :twitter }
    expect(response).to be_redirect
    expect(AccountConnection.count).to eql 1
    AccountConnection.first.tap do |ac|
      expect(ac.uid).to eql '98188244'
      expect(ac.user).to be_present
      expect(ac.user.name).to eql 'stefanwienert'
    end

    expect(controller.current_user).to be_present

    # Re login
    get :omniauth, params: { provider: :twitter }, session: {}
    expect(response).to be_redirect
    expect(AccountConnection.count).to eql 1
    expect(controller.current_user).to be_present
  end

  specify 'Facebook with special chars' do
    OmniAuth.config.mock_auth[:facebook] = OmniAuth::AuthHash.new(
      "provider" => "facebook",
      "uid" => "100001844680649",
      "info" => {
        "nickname" => "Hzg Castaño",
        "email" => "stwienert@gmail.com",
        "name" => "Stefan Wienert",
        "first_name" => "Stefan",
        "last_name" => "Wienert",
        "image" => "http://graph.facebook.com/100001844680649/picture?type=square",
        "urls" => { "Facebook" => "https://www.facebook.com/stwienert" },
        "location" => "Dresden, Germany",
        "verified" => true
      },
      "credentials" => {
        "token" => "asdasd",
        "expires_at" => 1_429_197_793,
        "expires" => true
      }
    )
    request.env["omniauth.auth"] = OmniAuth.config.mock_auth[:facebook]
    get :omniauth, params: { provider: :facebook }, session: {}
    expect(response).to be_redirect
    expect(AccountConnection.count).to eql 1
    expect(AccountConnection.first.user).to be_present

    get :omniauth, params: { provider: :facebook }, session: {}

    expect(response).to be_redirect
    expect(AccountConnection.count).to eql 1
  end
end


text:
package jj2000.j2k.io;

import java.io.*;

/**
 * This class defines a Buffered Random Access File.  It implements the
 * <tt>BinaryDataInput</tt> and <tt>BinaryDataOutput</tt> interfaces so that
 * binary data input/output can be performed. This class is abstract since no
 * assumption is done about the byte ordering type (little Endian, big
 * Endian). So subclasses will have to implement methods like
 * <tt>readShort()</tt>, <tt>writeShort()</tt>, <tt>readFloat()</tt>, ...
 *
 *
<tt>BufferedRandomAccessFile</tt> (BRAF for short) is a
 * <tt>RandomAccessFile</tt> containing an extra buffer. When the BRAF is
 * accessed, it checks if the requested part of the file is in the buffer or
 * not. If that is the case, the read/write is done on the buffer. If not, the
 * file is uppdated to reflect the current status of the buffer and the file
 * is then accessed for a new buffer containing the requested byte/bit.
 *
 * @see RandomAccessIO
 * @see BinaryDataOutput
 * @see BinaryDataInput
 * @see BEBufferedRandomAccessFile
 * */
public abstract class BufferedRandomAccessFile
    implements RandomAccessIO, EndianType {

    /**
     * The name of the current file
     * */
    private String fileName;

    /**
     * Whether the opened file is read only or not (defined by the constructor
     * arguments)
     * */
    private boolean isReadOnly = true;

    /**
     * The RandomAccessFile associated with the buffer
     * */
    private RandomAccessFile theFile;

    /**
     * Buffer of bytes containing the part of the file that is currently being
     * accessed
     * */
    protected byte[] byteBuffer;

    /**
     * Boolean keeping track of whether the byte buffer has been changed since
     * it was read.
     * */
    protected boolean byteBufferChanged;

    /**
     * The current offset of the buffer (which will differ from the offset of
     * the file)
     * */
    protected int offset;

    /**
     * The current position in the byte-buffer
     * */
    protected int pos;

    /**
     * The maximum number of bytes that can be read from the buffer
     * */
    protected int maxByte;

    /**
     * Whether the end of the file is in the current buffer or not
     * */
    protected boolean isEOFInBuffer;

    /* The endianess of the class */
    protected int byteOrdering;

    /**
     * Constructor. Always needs a size for the buffer.
     *
     * @param file The file associated with the buffer
     *
     * @param mode "r" for read, "rw" or "rw+" for read and write mode ("rw+"
     *             opens the file for update whereas "rw" removes it
     *             before. So the 2 modes are different only if the file
     *             already exists).
     *
     * @param bufferSize The number of bytes to buffer
     *
     * @exception java.io.IOException If an I/O error ocurred.
     * */
    protected BufferedRandomAccessFile(File file,
				       String mode,
				       int bufferSize) throws IOException{

	fileName = file.getName();
	if(mode.equals("rw") || mode.equals("rw+")){ // mode read / write
	    isReadOnly = false;
	    if(mode.equals("rw")){ // mode read / (over)write
		if(file.exists()) // Output file already exists
		    file.delete();
	    }
	    mode = "rw";
	}
	theFile=new RandomAccessFile(file,mode);
	byteBuffer=new byte[bufferSize];
	readNewBuffer(0);
    }

    /**
     * Constructor. Uses the default value for the byte-buffer
     * size (512 bytes).
     *
     * @param file The file associated with the buffer
     *
     * @param mode "r" for read, "rw" or "rw+" for read and write mode
     *             ("rw+" opens the file for update whereas "rw" removes
     *             it before. So the 2 modes are different only if the
     *             file already exists).
     *
     * @exception java.io.IOException If an I/O error ocurred.
     * */
    protected BufferedRandomAccessFile(File file,
				       String mode ) throws IOException{

	this(file, mode, 512);
    }

    /**
     * Constructor. Always needs a size for the buffer.
     *
     * @param name The name of the file associated with the buffer
     *
     * @param mode "r" for read, "rw" or "rw+" for read and write mode
     *             ("rw+" opens the file for update whereas "rw" removes
     *             it before. So the 2 modes are different only if the
     *             file already exists).
     *
     * @param bufferSize The number of bytes to buffer
     *
     * @exception java.io.IOException If an I/O error ocurred.
     * */
    protected BufferedRandomAccessFile(String name,
				       String mode,
				       int bufferSize) throws IOException{
	this(new File(name), mode, bufferSize);
    }

    /**
     * Constructor. Uses the default value for the byte-buffer
     * size (512 bytes).
     *
     * @param name The name of the file associated with the buffer
     *
     * @param mode "r" for read, "rw" or "rw+" for read and write mode
     *             ("rw+" opens the file for update whereas "rw" removes
     *             it before. So the 2 modes are different only if the
     *             file already exists).
     *
     * @exception java.io.IOException If an I/O error ocurred.
     * */
    protected BufferedRandomAccessFile(String name,
				       String mode ) throws IOException{

	this(name, mode, 512);
    }

    /**
     * Reads a new buffer from the file. If there has been any
     * changes made since the buffer was read, the buffer is
     * first written to the file.
     *
     * @param off The offset where to move to.
     *
     * @exception java.io.IOException If an I/O error ocurred.
     * */
    protected final void readNewBuffer(int off) throws IOException{

	/* If the buffer have changed. We need to write it to
	 * the file before reading a new buffer.
	 */
	if(byteBufferChanged){
	    flush();
	}
        // Don't allow to seek beyond end of file if reading only
        if (isReadOnly && off >= theFile.length()) {
            throw new EOFException();
        }
        // Set new offset
	offset = off;

        theFile.seek(offset);

	maxByte = theFile.read(byteBuffer,0,byteBuffer.length);
	pos=0;

	if(maxByte<byteBuffer.length){ // Not enough data in input file.
	    isEOFInBuffer = true;
	    if(maxByte==-1){
		maxByte++;
	    }
	}else{
	    isEOFInBuffer = false;
	}
    }

    /**
     * Closes the buffered random access file
     *
     * @exception java.io.IOException If an I/O error ocurred.
     * */
    public void close() throws IOException{
	/* If the buffer has been changed, it need to be saved before
	 * closing
	 */
	flush();
	byteBuffer = null; // Release the byte-buffer reference
	theFile.close();
    }

    /**
     * Returns the current offset in the file
     * */
    public int getPos(){
	return (offset+pos);
    }

    /**
     * Returns the current length of the stream, in bytes, taking into
     * account any buffering.
     *
     * @return The length of the stream, in bytes.
     *
     * @exception java.io.IOException If an I/O error ocurred.
     * */
    public int length() throws IOException{
	int len;

	len = (int)theFile.length();

	// If the position in the buffer is not past the end of the file,
	// the length of theFile is the length of the stream
	if( (offset+maxByte)<=len ){
	    return(len);
	}
	else{ // If not, the file is extended due to the buffering
	    return (offset+maxByte);
	}
    }

    /**
     * Moves the current position to the given offset at which the
     * next read or write occurs. The offset is measured from the
     * beginning of the stream.
     *
     * @param off The offset where to move to.
     *
     * @exception EOFException If in read-only and seeking beyond EOF.
     *
     * @exception java.io.IOException If an I/O error ocurred.
     * */
    public void seek(int off) throws IOException{
	/* If the new offset is within the buffer, only the pos value needs
	 * to be modified. Else, the buffer must be moved. */
	if( (off>=offset)&&(off<(offset+byteBuffer.length)) ){
            if (isReadOnly && isEOFInBuffer && off > offset+maxByte) {
                // We are seeking beyond EOF in read-only mode!
                throw new EOFException();
            }
	    pos = off-offset;
	}
	else{
	    readNewBuffer(off);
	}
    }

    /**
     * Reads an unsigned byte of data from the stream. Prior to reading, the
     * stream is realigned at the byte level.
     *
     * @return The byte read.
     *
     * @exception java.io.IOException If an I/O error ocurred.
     *
     * @exception java.io.EOFException If the end of file was reached
     * */
    public final int read() throws IOException, EOFException{
	if(pos<maxByte){ // The byte can be read from the buffer
	    // In Java, the bytes are always signed.
            return (byteBuffer[pos++]&0xFF);
	}
	else if(isEOFInBuffer){ // EOF is reached
            pos = maxByte+1; // Set position to EOF
	    throw new EOFException();
	}
	else { // End of the buffer is reached
	    readNewBuffer(offset+pos);
	    return read();
	}
    }

    /**
     * Reads up to len bytes of data from this file into an array of
     * bytes. This method reads repeatedly from the stream until all the bytes
     * are read. This method blocks until all the bytes are read, the end of
     * the stream is detected, or an exception is thrown.
     *
     * @param b The buffer into which the data is to be read. It must be long
     * enough.
     *
     * @param off The index in 'b' where to place the first byte read.
     *
     * @param len The number of bytes to read.
     *
     * @exception EOFException If the end-of file was reached before
     * getting all the necessary data.
     *
     * @exception IOException If an I/O error ocurred.
     * */
    public final void readFully(byte b[], int off, int len)
        throws IOException {
        int clen; // current length to read
        while (len > 0) {
            // There still is some data to read
            if (pos<maxByte) { // We can read some data from buffer
                clen = maxByte-pos;
                if (clen > len) clen = len;
                System.arraycopy(byteBuffer,pos,b,off,clen);
                pos += clen;
                off += clen;
                len -= clen;
            }
            else if (isEOFInBuffer) {
                pos = maxByte+1; // Set position to EOF
                throw new EOFException();
            }
            else { // Buffer empty => get more data
                readNewBuffer(offset+pos);
            }
        }
    }

    /**
     * Writes a byte to the stream. Prior to writing, the stream is
     * realigned at the byte level.
     *
     * @param b The byte to write. The lower 8 bits of <tt>b</tt> are
     * written.
     *
     * @exception java.io.IOException If an I/O error ocurred.
     * */
    public final void write(int b) throws IOException{
	// As long as pos is less than the length of the buffer we can write
	// to the buffer. If the position is after the buffer a new buffer is
	// needed
	if(pos<byteBuffer.length){
	    if(isReadOnly)
		throw new IOException("File is read only");
	    byteBuffer[pos]=(byte)b;
	    if(pos>=maxByte){
		maxByte=pos+1;
	    }
	    pos++;
	    byteBufferChanged =true;
	}
	else{
	    readNewBuffer(offset+pos);
	    write(b);
	}
    }

    /**
     * Writes a byte to the stream. Prior to writing, the stream is
     * realigned at the byte level.
     *
     * @param b The byte to write.
     *
     * @exception java.io.IOException If an I/O error ocurred.
     * */
    public final void write(byte b) throws IOException{
	// As long as pos is less than the length of the buffer we can write
	// to the buffer. If the position is after the buffer a new buffer is
	// needed
	if(pos<byteBuffer.length){
	    if(isReadOnly)
		throw new IOException("File is read only");
	    byteBuffer[pos]=b;
	    if(pos>=maxByte){
		maxByte=pos+1;
	    }
	    pos++;
	    byteBufferChanged =true;
	}
	else{
	    readNewBuffer(offset+pos);
	    write(b);
	}
    }

    /**
     * Writes aan array of bytes to the stream. Prior to writing, the stream is
     * realigned at the byte level.
     *
     * @param b The array of bytes to write.
     *
     * @param offset The first byte in b to write
     *
     * @param length The number of bytes from b to write
     *
     * @exception java.io.IOException If an I/O error ocurred.
     * */
    public final void write(byte[] b, int offset, int length)
        throws IOException{
        int i,stop;
        stop = offset+length;
        if(stop > b.length)
            throw new ArrayIndexOutOfBoundsException(b.length);
        for(i=offset ; i<stop ; i++){
            write(b[i]);
        }
    }

    /**
     * Writes the byte value of <tt>v</tt> (i.e., 8 least
     * significant bits) to the output. Prior to writing, the output
     * should be realigned at the byte level.
     *
     *
Signed or unsigned data can be written. To write a signed
     * value just pass the <tt>byte</tt> value as an argument. To
     * write unsigned data pass the <tt>int</tt> value as an argument
     * (it will be automatically casted, and only the 8 least
     * significant bits will be written).
     *
     * @param v The value to write to the output
     *
     * @exception java.io.IOException If an I/O error ocurred.
     * */
    public final void writeByte(int v) throws IOException{
	write(v);
    }

    /**
     * Any data that has been buffered must be written (including
     * buffering at the bit level), and the stream should be realigned
     * at the byte level.
     *
     * @exception java.io.IOException If an I/O error ocurred.
     * */
    public final void flush() throws IOException{
        if(byteBufferChanged){
	    theFile.seek(offset);
	    theFile.write(byteBuffer,0,maxByte);
	    byteBufferChanged = false;
        }
    }

    /**
     * Reads a signed byte (i.e., 8 bit) from the input. Prior to
     * reading, the input should be realigned at the byte level.
     *
     * @return The next byte-aligned signed byte (8 bit) from the
     * input.
     *
     * @exception java.io.EOFException If the end-of file was reached before
     * getting all the necessary data.
     *
     * @exception java.io.IOException If an I/O error ocurred.
     * */
    public final byte readByte() throws EOFException, IOException {
	if(pos<maxByte){ // The byte can be read from the buffer
	    // In Java, the bytes are always signed.
            return byteBuffer[pos++];
	}
	else if(isEOFInBuffer){ // EOF is reached
            pos = maxByte+1; // Set position to EOF
	    throw new EOFException();
	}
	else { // End of the buffer is reached
	    readNewBuffer(offset+pos);
	    return readByte();
	}
    }

    /**
     * Reads an unsigned byte (i.e., 8 bit) from the input. It is
     * returned as an <tt>int</tt> since Java does not have an
     * unsigned byte type. Prior to reading, the input should be
     * realigned at the byte level.
     *
     * @return The next byte-aligned unsigned byte (8 bit) from the
     * input, as an <tt>int</tt>.
     *
     * @exception java.io.EOFException If the end-of file was reached before
     * getting all the necessary data.
     *
     * @exception java.io.IOException If an I/O error ocurred.
     * */
    public final int readUnsignedByte() throws EOFException, IOException{
        return read();
    }

    /**
     * Returns the endianess (i.e., byte ordering) of the implementing
     * class. Note that an implementing class may implement only one
     * type of endianness or both, which would be decided at creation
     * time.
     *
     * @return Either <tt>EndianType.BIG_ENDIAN</tt> or
     * <tt>EndianType.LITTLE_ENDIAN</tt>
     *
     * @see EndianType
     * */
    public int getByteOrdering(){
	return byteOrdering;
    }

    /**
     * Skips <tt>n</tt> bytes from the input. Prior to skipping, the
     * input should be realigned at the byte level.
     *
     * @param n The number of bytes to skip
     *
     * @exception java.io.EOFException If the end-of file was reached before
     * all the bytes could be skipped.
     *
     * @exception java.io.IOException If an I/O error ocurred.
     * */
    public int skipBytes(int n)throws EOFException, IOException{
	if(n<0)
	    throw new IllegalArgumentException("Can not skip negative number "+
					       "of bytes");
	if(n <= (maxByte-pos)){
	    pos += n;
	    return n;
	}
	else{
	    seek(offset+pos+n);
	    return n;
	}
    }

    /**
     * Returns a string of information about the file
     * */
    public String toString(){
	return "BufferedRandomAccessFile: "+fileName+" ("+
	    ((isReadOnly)?"read only":"read/write")+
	    ")";
    }
}


text:
#ifndef SOFTRP_POSITION_VERTEX_SHADER_H_
#define SOFTRP_POSITION_VERTEX_SHADER_H_
#include "SoftRPDefs.h"
#include "VertexShader.h"
namespace SoftRP {

	/*
	Specialization of VertexShader which transforms vertices to Clip space.
	*/
	class PositionVertexShader : public VertexShader{
	public:
		PositionVertexShader() = default;
		virtual ~PositionVertexShader() = default;

#ifdef SOFTRP_MULTI_THREAD
		virtual	ThreadPool::Fence operator()(const ShaderContext& sc,
										const Vertex* input, Vertex* output, size_t vertexCount, size_t instance,
										 ThreadPool& threadPool) const override;
#else
		virtual void operator()(const ShaderContext& sc,
							const Vertex* input, Vertex* output, size_t vertexCount, size_t instance) const override;
#endif
	protected:
		PositionVertexShader(const PositionVertexShader&) = delete;
		PositionVertexShader(PositionVertexShader&&) = delete;
		PositionVertexShader& operator=(const PositionVertexShader&) = delete;
		PositionVertexShader& operator=(PositionVertexShader&&) = delete;
	};
}
#include "PositionVertexShaderImpl.inl"
#endif


text:
title: MiCasaVerde Vera3 available in December
author: iHomeAutomate
excerpt: 'Vera3 available in December, featuring better WiFi, more memory and more LAN ports. VeraLite hopefully coming soon?'
layout: article
permalink: /2011/11/24/micasaverde-vera3-available/
disqus_identifier: "525 http://www.ihomeautomate.eu/?p=525"
categories:
  - vera
tags:
  - vera
  - vera3
  - veralite
  - z-wave
comments: false
ads: true
image:
  teaser: /2011/11/vera_3_head_400x250.jpg
---
It looks like the [Vera3][1] (quitely) sneaked in the available stock on [MiCasaVerde][2]. The specifications are the same as previously mentioned on the [wiki][3]:

  * CPU 500M Hz MIPS SoC
  * Flash NAND 32 MB
  * SDRAM 32 MB DDR2
  * Memory DDR2 128 MB
  * 2xUSB Port
  * 1xWAN Port (10/100 Mbit/sec)
  * 4xLAN Port 4 (10/100 Mbit/sect)
  * Z-Wave Built-in with internal antenna
  * Dimensions (HxWxD) 177mm x 130mm x 34mm

Now we're still waiting for the at CEDIA showed VeraLite, having a built-in battery compartment for making inclusion of Z-Wave devices into the network easier, and its lack of Wi-Fi. Hopefully in time to make it under the christmas tree.

**2011-11-25, update:**
It looks like Vera3 will be available [somewhere in December][4], "EU Vera3 Dealer pre-orders will ship December 12th and customer pre-orders December 15th."

About Mi Casa Verde
Founded in 2008, Mi Casa Verde's mission is to provide home and small business control
and entertainment solutions that are easier to setup and use than any other product on the
market, and that are extremely energy-efficient, eco-friendly and affordable.

Mi Casa Verde's Z-Wave home and small business controller and bridge, called Vera,
is a simple and flexible solution. It is designed to help save energy, increase home and
small business security and enhance the home theater experience. Vera can be managed
from anywhere in the world using an iPhone, iPad, Android phone, PC and other mobile devices.

Mi Casa Verde's Z-Wave home controller is built on the MiOS platform.

 [1]: http://micasaverde.com/vera-3.php "Vera3"
 [2]: http://shop.micasaverde.com/index.php/featured-products/vera-3.html "MiCasaVerde shop"
 [3]: http://wiki.micasaverde.com/index.php/Vera3
 [4]: http://shop.micasaverde.com/index.php/featured-products/vera-3.html


text:
package io.vertx.ext.apex;

import io.vertx.codegen.annotations.Fluent;
import io.vertx.codegen.annotations.VertxGen;
import io.vertx.core.Handler;
import io.vertx.core.Vertx;
import io.vertx.core.http.HttpMethod;
import io.vertx.core.http.HttpServerRequest;
import io.vertx.ext.apex.impl.RouterImpl;

import java.util.List;

/**
 * A router receives request from an {@link io.vertx.core.http.HttpServer} and routes it to the first matching
 * {@link io.vertx.ext.apex.Route} that it contains. A router can contain many routes.
 *

 * Routers are also used for routing failures.
 *
 * @author Tim Fox
 */
@VertxGen
public interface Router {

  /**
   * Create a router
   *
   * @param vertx  the Vert.x instance
   * @return the router
   */
  static Router router(Vertx vertx) {
    return new RouterImpl(vertx);
  }

  /**
   * This method is used to provide a request to the router. Usually you take request from the
   * {@link io.vertx.core.http.HttpServer#requestHandler(io.vertx.core.Handler)} and pass it to this method. The
   * router then routes it to matching routes.
   *
   * @param request  the request
   */
  void accept(HttpServerRequest request);

  /**
   * Add a route with no matching criteria, i.e. it matches all requests or failures.
   *
   * @return  the route
   */
  Route route();

  /**
   * Add a route that matches the specified HTTP method and path
   *
   * @param method  the HTTP method to match
   * @param path  URI paths that begin with this path will match
   *
   * @return the route
   */
  Route route(HttpMethod method, String path);

  /**
   * Add a route that matches the specified path
   *
   * @param path  URI paths that begin with this path will match
   *
   * @return the route
   */
  Route route(String path);

  /**
   * Add a route that matches the specified HTTP method and path regex
   *
   * @param method  the HTTP method to match
   * @param regex  URI paths that begin with a match for this regex will match
   *
   * @return the route
   */
  Route routeWithRegex(HttpMethod method, String regex);

  /**
   * Add a route that matches the specified path regex
   *
   * @param regex  URI paths that begin with a match for this regex will match
   *
   * @return the route
   */
  Route routeWithRegex(String regex);

  /**
   * Add a route that matches any HTTP GET request
   *
   * @return the route
   */
  Route get();

  /**
   * Add a route that matches a HTTP GET request and the specified path
   *
   * @param path  URI paths that begin with this path will match
   *
   * @return the route
   */
  Route get(String path);

  /**
   * Add a route that matches a HTTP GET request and the specified path regex
   *
   * @param regex  URI paths that begin with a match for this regex will match
   *
   * @return the route
   */
  Route getWithRegex(String regex);

  /**
   * Add a route that matches any HTTP HEAD request
   *
   * @return the route
   */
  Route head();

  /**
   * Add a route that matches a HTTP HEAD request and the specified path
   *
   * @param path  URI paths that begin with this path will match
   *
   * @return the route
   */
  Route head(String path);

  /**
   * Add a route that matches a HTTP HEAD request and the specified path regex
   *
   * @param regex  URI paths that begin with a match for this regex will match
   *
   * @return the route
   */
  Route headWithRegex(String regex);

  /**
   * Add a route that matches any HTTP OPTIONS request
   *
   * @return the route
   */
  Route options();

  /**
   * Add a route that matches a HTTP OPTIONS request and the specified path
   *
   * @param path  URI paths that begin with this path will match
   *
   * @return the route
   */
  Route options(String path);

  /**
   * Add a route that matches a HTTP OPTIONS request and the specified path regex
   *
   * @param regex  URI paths that begin with a match for this regex will match
   *
   * @return the route
   */
  Route optionsWithRegex(String regex);

  /**
   * Add a route that matches any HTTP PUT request
   *
   * @return the route
   */
  Route put();

  /**
   * Add a route that matches a HTTP PUT request and the specified path
   *
   * @param path  URI paths that begin with this path will match
   *
   * @return the route
   */
  Route put(String path);

  /**
   * Add a route that matches a HTTP PUT request and the specified path regex
   *
   * @param regex  URI paths that begin with a match for this regex will match
   *
   * @return the route
   */
  Route putWithRegex(String regex);

  /**
   * Add a route that matches any HTTP POST request
   *
   * @return the route
   */
  Route post();

  /**
   * Add a route that matches a HTTP POST request and the specified path
   *
   * @param path  URI paths that begin with this path will match
   *
   * @return the route
   */
  Route post(String path);

  /**
   * Add a route that matches a HTTP POST request and the specified path regex
   *
   * @param regex  URI paths that begin with a match for this regex will match
   *
   * @return the route
   */
  Route postWithRegex(String regex);

  /**
   * Add a route that matches any HTTP DELETE request
   *
   * @return the route
   */
  Route delete();

  /**
   * Add a route that matches a HTTP DELETE request and the specified path
   *
   * @param path  URI paths that begin with this path will match
   *
   * @return the route
   */
  Route delete(String path);

  /**
   * Add a route that matches a HTTP DELETE request and the specified path regex
   *
   * @param regex  URI paths that begin with a match for this regex will match
   *
   * @return the route
   */
  Route deleteWithRegex(String regex);

  /**
   * @return a list of all the routes on this router
   */
  List<Route> getRoutes();

  /**
   * Remove all the routes from this router
   *
   * @return a reference to this, so the API can be used fluently
   */
  @Fluent
  Router clear();

  /**
   * Mount a sub router on this router
   *
   * @param mountPoint  the mount point (path prefix) to mount it on
   * @param subRouter  the router to mount as a sub router
   * @return a reference to this, so the API can be used fluently
   */
  @Fluent
  Router mountSubRouter(String mountPoint, Router subRouter);

  /**
   * Specify a handler for any unhandled exceptions on this router. The handler will be called for exceptions thrown
   * from handlers. This does not affect the normal failure routing logic.
   *
   * @param exceptionHandler  the exception handler
   * @return a reference to this, so the API can be used fluently
   */
  @Fluent
  Router exceptionHandler(Handler<Throwable> exceptionHandler);

  /**
   * Used to route a context to the router. Used for sub-routers. You wouldn't normally call this method directly.
   *
   * @param context  the routing context
   */
  void handleContext(RoutingContext context);

  /**
   * Used to route a failure to the router. Used for sub-routers. You wouldn't normally call this method directly.
   *
   * @param context  the routing context
   */
  void handleFailure(RoutingContext context);

}


text:
<?php

namespace Everon\Test;

use Everon\Interfaces;
use Everon\Email;

class AddressTest extends \Everon\TestCase
{
    public function testConstructor()
    {
        $Recipient = new Email\Address('test@grofas.com', 'Test');
        $this->assertInstanceOf('Everon\Email\Interfaces\Address', $Recipient);
    }

    public function testToArray()
    {
        $Address = new Email\Address('test@grofas.com', 'Test');

        $data = $Address->toArray();

        $this->assertInternalType('array', $data);
        $this->assertNotEmpty($data);
    }
}


text:
#ifndef LIBCORK_CORE_ATTRIBUTES_H
#define LIBCORK_CORE_ATTRIBUTES_H

#include "libcork/config.h"

/*
 * Declare a "const" function.
 *
 * A const function is one whose return value depends only on its
 * parameters.  This is slightly more strict than a "pure" function; a
 * const function is not allowed to read from global variables, whereas
 * a pure function is.
 *
 *   int square(int x) CORK_ATTR_CONST;
 */

#if CORK_CONFIG_HAVE_GCC_ATTRIBUTES
#define CORK_ATTR_CONST  __attribute__((const))
#else
#define CORK_ATTR_CONST
#endif

/*
 * Declare a "pure" function.
 *
 * A pure function is one whose return value depends only on its
 * parameters, and global variables.
 *
 *   int square(int x) CORK_ATTR_PURE;
 */

#if CORK_CONFIG_HAVE_GCC_ATTRIBUTES
#define CORK_ATTR_PURE  __attribute__((pure))
#else
#define CORK_ATTR_PURE
#endif

/*
 * Declare that a function returns a newly allocated pointer.
 *
 * The compiler can use this information to generate more accurate
 * aliasing information, since it can infer that the result of the
 * function cannot alias any other existing pointer.
 */

#if CORK_CONFIG_HAVE_GCC_ATTRIBUTES
#define CORK_ATTR_MALLOC  __attribute__((malloc))
#else
#define CORK_ATTR_MALLOC
#endif

/*
 * Declare that a function shouldn't be inlined.
 */

#if CORK_CONFIG_HAVE_GCC_ATTRIBUTES
#define CORK_ATTR_NOINLINE  __attribute__((noinline))
#else
#define CORK_ATTR_NOINLINE
#endif

/*
 * Declare an entity that isn't used.
 *
 * This lets you keep -Wall activated in several cases where you're
 * obligated to define something that you don't intend to use.
 */

#if CORK_CONFIG_HAVE_GCC_ATTRIBUTES
#define CORK_ATTR_UNUSED  __attribute__((unused))
#else
#define CORK_ATTR_UNUSED
#endif

/*
 * Declare a function that takes in printf-like parameters.
 *
 * When the compiler supports this attribute, it will check the format
 * string, and the following arguments, to make sure that they match.
 * format_index and args_index are 1-based.
 */

#if CORK_CONFIG_HAVE_GCC_ATTRIBUTES
#define CORK_ATTR_PRINTF(format_index, args_index) \
    __attribute__((format(printf, format_index, args_index)))
#else
#define CORK_ATTR_PRINTF(format_index, args_index)
#endif

/*
 * Declare a var-arg function whose last parameter must be a NULL
 * sentinel value.
 *
 * When the compiler supports this attribute, it will check the actual
 * parameters whenever this function is called, and ensure that the last
 * parameter is a @c NULL.
 */

#if CORK_CONFIG_HAVE_GCC_ATTRIBUTES
#define CORK_ATTR_SENTINEL  __attribute__((sentinel))
#else
#define CORK_ATTR_SENTINEL
#endif

/*
 * Declare that a boolean expression is likely to be true or false.
 */

#if CORK_CONFIG_HAVE_GCC_ATTRIBUTES
#define CORK_LIKELY(expr)  __builtin_expect((expr), 1)
#define CORK_UNLIKELY(expr)  __builtin_expect((expr), 0)
#else
#define CORK_LIKELY(expr)  (expr)
#define CORK_UNLIKELY(expr)  (expr)
#endif

/*
 * Declare that a function is part of the current library's public API, or that
 * it's internal to the current library.
 */

#if CORK_CONFIG_HAVE_GCC_ATTRIBUTES
#define CORK_EXPORT  __attribute__((visibility("default")))
#define CORK_IMPORT  __attribute__((visibility("default")))
#define CORK_LOCAL   __attribute__((visibility("hidden")))
#else
#define CORK_EXPORT
#define CORK_IMPORT
#define CORK_LOCAL
#endif

/*
 * Declare a static function that should automatically be called at program
 * startup.
 */

/* TODO: When we implement a full Windows port, [1] describes how best to
 * implement an initialization function under Visual Studio.
 *
 * [1] http://stackoverflow.com/questions/1113409/attribute-constructor-equivalent-in-vc
 */

#if CORK_CONFIG_HAVE_GCC_ATTRIBUTES
#define CORK_INITIALIZER(name) \
__attribute__((constructor)) \
static void \
name(void)
#else
#error "Don't know how to implement initialization functions of this platform"
#endif

#endif /* LIBCORK_CORE_ATTRIBUTES_H */


text:
using System;
using System.Globalization;

namespace QuantConnect
{
    ///
    /// Provides extension methods for properly parsing and serializing values while properly using
    /// an IFormatProvider/CultureInfo when applicable
    ///
    public static class StringExtensions
    {
        private static readonly CultureInfo CultureInfo = CultureInfo.InvariantCulture;
        private static readonly IFormatProvider FormatProvider = CultureInfo;
        private static readonly StringComparison StringComparison = StringComparison.InvariantCulture;

        ///
        /// Converts the provided <paramref name="value"/> as <typeparamref name="T"/>
        /// using <see cref="CultureInfo"/>
        ///
        public static T ConvertInvariant<T>(this object value)
        {
            return (T) value.ConvertInvariant(typeof(T));
        }

        ///
        /// Converts the provided <paramref name="value"/> as <paramref name="conversionType"/>
        /// using <see cref="CultureInfo"/>
        ///
        /// <remarks>
        /// This implementation uses the Convert.ToXXX methods. This causes null values to be converted to the default value
        /// for the provided <paramref name="conversionType"/>. This is in contrast to directly calling <see cref="IConvertible.ToType"/>
        /// which results in an <see cref="InvalidCastException"/> or a <see cref="FormatException"/>. Since existing code is
        /// dependent on this null -> default value conversion behavior, it has been preserved in this method.
        /// </remarks>
        public static object ConvertInvariant(this object value, Type conversionType)
        {
            switch (Type.GetTypeCode(conversionType))
            {
                // these cases are purposefully ordered to ensure the compiler can generate a jump table vs a binary tree
                case TypeCode.Empty:
                    throw new ArgumentException("StringExtensions.ConvertInvariant does not support converting to TypeCode.Empty");

                case TypeCode.Object:
                    var convertible = value as IConvertible;
                    if (convertible != null)
                    {
                        return convertible.ToType(conversionType, FormatProvider);
                    }

                    return Convert.ChangeType(value, conversionType, FormatProvider);

                case TypeCode.DBNull:
                    throw new ArgumentException("StringExtensions.ConvertInvariant does not support converting to TypeCode.DBNull");

                case TypeCode.Boolean:
                    return Convert.ToBoolean(value, FormatProvider);

                case TypeCode.Char:
                    return Convert.ToChar(value, FormatProvider);

                case TypeCode.SByte:
                    return Convert.ToSByte(value, FormatProvider);

                case TypeCode.Byte:
                    return Convert.ToByte(value, FormatProvider);

                case TypeCode.Int16:
                    return Convert.ToInt16(value, FormatProvider);

                case TypeCode.UInt16:
                    return Convert.ToUInt16(value, FormatProvider);

                case TypeCode.Int32:
                    return Convert.ToInt32(value, FormatProvider);

                case TypeCode.UInt32:
                    return Convert.ToUInt32(value, FormatProvider);

                case TypeCode.Int64:
                    return Convert.ToInt64(value, FormatProvider);

                case TypeCode.UInt64:
                    return Convert.ToUInt64(value, FormatProvider);

                case TypeCode.Single:
                    return Convert.ToSingle(value, FormatProvider);

                case TypeCode.Double:
                    return Convert.ToDouble(value, FormatProvider);

                case TypeCode.Decimal:
                    return Convert.ToDecimal(value, FormatProvider);

                case TypeCode.DateTime:
                    return Convert.ToDateTime(value, FormatProvider);

                case TypeCode.String:
                    return Convert.ToString(value, FormatProvider);

                default:
                    return Convert.ChangeType(value, conversionType, FormatProvider);
            }
        }

        ///
        /// Non-extension method alias for <see cref="FormattableString.Invariant"/>
        /// This supports the using static QuantConnect.StringExtensions syntax
        /// and is aimed at ensuring all formatting is piped through this class instead of
        /// alternatively piping through directly to <see cref="FormattableString.Invariant"/>
        ///
        public static string Invariant(FormattableString formattable)
        {
            return FormattableString.Invariant(formattable);
        }

        ///
        /// Converts the provided value to a string using <see cref="CultureInfo"/>
        ///
        public static string ToStringInvariant(this IConvertible convertible)
        {
            if (convertible == null)
            {
                return string.Empty;
            }

            return convertible.ToString(FormatProvider);
        }

        ///
        /// Formats the provided value using the specified <paramref name="format"/> and
        /// <see cref="CultureInfo"/>
        ///
        public static string ToStringInvariant(this IFormattable formattable, string format)
        {
            if (formattable == null)
            {
                return string.Empty;
            }

            // if we have a colon, this implies there's a width parameter in the format it seems this isn't handled
            // as one would expect. For example, specifying something like $"{value,10:0.00}" would force the string
            // to be at least 10 characters wide with extra padding in the front, but passing the string '10:0.00' or
            // ',10:0.00' doesn't work. If we are able to detect a colon in the format and the values preceding the colon,
            // are numeric, then we know it starts with a width parameter and we can pipe it into a custom-formed
            // string.format call to get the correct output
            if (format != null)
            {
                var indexOfColon = format.IndexOfInvariant(":");
                if (indexOfColon != -1)
                {
                    int padding;
                    var beforeColon = format.Substring(0, indexOfColon);
                    if (int.TryParse(beforeColon, out padding))
                    {
                        return string.Format(FormatProvider, $"{{0,{format}}}", formattable);
                    }
                }
            }

            return formattable.ToString(format, FormatProvider);
        }

        ///
        /// Provides a convenience methods for converting a <see cref="DateTime"/> to an invariant ISO-8601 string
        ///
        public static string ToIso8601Invariant(this DateTime dateTime)
        {
            return dateTime.ToStringInvariant("O");
        }

        ///
        /// Checks if the string starts with the provided <paramref name="beginning"/> using <see cref="CultureInfo"/>
        /// while optionally ignoring case.
        ///
        public static bool StartsWithInvariant(this string value, string beginning, bool ignoreCase = false)
        {
            return value.StartsWith(beginning, ignoreCase, CultureInfo);
        }

        ///
        /// Checks if the string ends with the provided <paramref name="ending"/> using <see cref="CultureInfo"/>
        /// while optionally ignoring case.
        ///
        public static bool EndsWithInvariant(this string value, string ending, bool ignoreCase = false)
        {
            return value.EndsWith(ending, ignoreCase, CultureInfo);
        }

        ///
        /// Gets the index of the specified <paramref name="character"/> using <see cref="StringComparison"/>
        ///
        public static int IndexOfInvariant(this string value, char character)
        {
            return value.IndexOf(character);
        }

        ///
        /// Gets the index of the specified <paramref name="substring"/> using <see cref="StringComparison"/>
        /// or <see cref="System.StringComparison.InvariantCultureIgnoreCase"/> when <paramref name="ignoreCase"/> is true
        ///
        public static int IndexOfInvariant(this string value, string substring, bool ignoreCase = false)
        {
            return value.IndexOf(substring, ignoreCase
                ? StringComparison.InvariantCultureIgnoreCase
                : StringComparison
            );
        }

        ///
        /// Gets the index of the specified <paramref name="substring"/> using <see cref="StringComparison"/>
        /// or <see cref="System.StringComparison.InvariantCultureIgnoreCase"/> when <paramref name="ignoreCase"/> is true
        ///
        public static int LastIndexOfInvariant(this string value, string substring, bool ignoreCase = false)
        {
            return value.LastIndexOf(substring, ignoreCase
                ? StringComparison.InvariantCultureIgnoreCase
                : StringComparison
            );
        }

        ///
        /// Provides a shorthand for avoiding the more verbose ternary equivalent.
        /// Consider the following:
        ///
        /// string.IsNullOrEmpty(str) ? (decimal?)null : Convert.ToDecimal(str, CultureInfo.InvariantCulture)
        ///
        /// Can be expressed as:
        ///
        /// str.IfNotNullOrEmpty<decimal?>(s => Convert.ToDecimal(str, CultureInfo.InvariantCulture))
        ///
        /// When combined with additional methods from this class, reducing further to a declarative:
        ///
        /// str.IfNotNullOrEmpty<decimal?>(s => s.ParseDecimalInvariant())
        /// str.IfNotNullOrEmpty<decimal?>(s => s.ConvertInvariant<decimal>())
        ///
        ///
        /// <paramref name="value">The string value to check for null or empty</paramref>
        /// <paramref name="defaultValue">The default value to use if null or empty</paramref>
        /// <paramref name="func">Function run on non-null string w/ length > 0</paramref>
        public static T IfNotNullOrEmpty<T>(this string value, T defaultValue, Func<string, T> func)
        {
            if (string.IsNullOrEmpty(value))
            {
                return defaultValue;
            }

            return func(value);
        }

        ///
        /// Provides a shorthand for avoiding the more verbose ternary equivalent.
        /// Consider the following:
        ///
        /// string.IsNullOrEmpty(str) ? (decimal?)null : Convert.ToDecimal(str, CultureInfo.InvariantCulture)
        ///
        /// Can be expressed as:
        ///
        /// str.IfNotNullOrEmpty<decimal?>(s => Convert.ToDecimal(str, CultureInfo.InvariantCulture))
        ///
        /// When combined with additional methods from this class, reducing further to a declarative:
        ///
        /// str.IfNotNullOrEmpty<decimal?>(s => s.ParseDecimalInvariant())
        /// str.IfNotNullOrEmpty<decimal?>(s => s.ConvertInvariant<decimal>())
        ///
        ///
        /// <paramref name="value">The string value to check for null or empty</paramref>
        /// <paramref name="func">Function run on non-null string w/ length > 0</paramref>
        public static T IfNotNullOrEmpty<T>(this string value, Func<string, T> func)
        {
            return value.IfNotNullOrEmpty(default(T), func);
        }

        ///
        /// Retrieves a substring from this instance. The substring starts at a specified
        /// character position and has a specified length.
        ///
        /// <paramref name="startIndex">The zero-based starting character position of a substring in this instance</paramref>
        /// <paramref name="length">The number of characters in the substring</paramref>
        public static string SafeSubstring(this string value, int startIndex, int length)
        {
            if (string.IsNullOrEmpty(value))
            {
                return value;
            }

            if (startIndex > value.Length - 1)
            {
                return string.Empty;
            }

            if (startIndex < - 1)
            {
                startIndex = 0;
            }

            return value.Substring(startIndex, Math.Min(length, value.Length - startIndex));
        }
    }
}


text:
cask 'mysqlworkbench' do
  version '6.3.7'
  sha256 '06e7c87483b8851fa3c9baa6f784d76a8f099878abebdb56e8c22637b784ca12'

  url "https://dev.mysql.com/get/Downloads/MySQLGUITools/mysql-workbench-community-#{version}-osx-x86_64.dmg"
  name 'MySQL Workbench'
  homepage 'https://www.mysql.com/products/workbench'
  gpg "#{url}.asc",
      key_id: '8c718d3b5072e1f5'

  app 'MySQLWorkbench.app'

  zap delete: [
                '~/Library/Application Support/MySQL/Workbench',
                '~/Library/Preferences/com.oracle.mysql.workbench.plist',
                '~/Library/Preferences/com.oracle.MySQLWorkbench.plist',
                '~/Library/Saved Application State/com.oracle.mysql.workbench.savedState',
                '~/Library/Saved Application State/com.oracle.MySQLWorkbench.savedState',
                '~/Library/Caches/com.oracle.mysql.workbench',
              ]
end


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace SRNicoNico.Views.Contents.Config {
    /// <summary>
    /// ConfigVideo.xaml の相互作用ロジック
    /// </summary>
    public partial class ConfigVideo : UserControl {
        public ConfigVideo() {
            InitializeComponent();
        }
    }
}


text:
package com.netflix.exhibitor.core.entities;

import javax.xml.bind.annotation.XmlRootElement;

@SuppressWarnings("UnusedDeclaration")
@XmlRootElement
public class Index
{
    private String  name;
    private String  from;
    private String  to;
    private int     entryCount;

    public Index()
    {
        this("", "", "", 0);
    }

    public Index(String name, String from, String to, int entryCount)
    {
        this.name = name;
        this.from = from;
        this.to = to;
        this.entryCount = entryCount;
    }

    public String getName()
    {
        return name;
    }

    public void setName(String name)
    {
        this.name = name;
    }

    public String getFrom()
    {
        return from;
    }

    public void setFrom(String from)
    {
        this.from = from;
    }

    public String getTo()
    {
        return to;
    }

    public void setTo(String to)
    {
        this.to = to;
    }

    public int getEntryCount()
    {
        return entryCount;
    }

    public void setEntryCount(int entryCount)
    {
        this.entryCount = entryCount;
    }
}


text:
package com.nixus.raop.player;

import java.util.Collection;
import java.util.Collections;
import java.util.Map;

import com.nixus.raop.core.Service;
import com.nixus.raop.core.ServiceContext;
import com.nixus.raop.core.ServiceFactory;

public class PlayerFactory implements ServiceFactory {

    private ServiceContext context;
    private Class<? extends Player> productclass;

    @SuppressWarnings("unchecked")
    public void startService(ServiceContext context) {
        this.context = context;
        try {
            this.productclass = (Class<? extends Player>)Class.forName(context.getProperty("product"));
        } catch (Exception e) {
            throw new IllegalStateException("Invalid \"product\" property \""+context.getProperty("product")+"\"", e);
        }
    }

    public void stopService(ServiceContext context) {
    }

    public ServiceContext getContext() {
        return context;
    }

    public Collection<Class<?>> getServiceClasses() {
        return Collections.<Class<?>>singleton(Player.class);
    }

    public Service createService(Class<? extends Service> type, Map<String,String> properties) {
        Player service = null;
        if (type==Player.class) {
            try {
                service = productclass.newInstance();
            } catch (Exception e) {
                throw new IllegalStateException(e);
            }
        }
        return service;
    }

    public Map<String,Object> reportState() {
        return null;
    }

}


text:
<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

namespace Usuarios\UsuariosBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use FOS\MessageBundle\Entity\Message as BaseMessage;

/**
 * @ORM\Entity
 */
class Message extends BaseMessage
{
    /**
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $id;

    /**
     * @ORM\ManyToOne(
     *   targetEntity="Usuarios\UsuariosBundle\Entity\Thread",
     *   inversedBy="messages"
     * )
     * @var \FOS\MessageBundle\Model\ThreadInterface
     */
    protected $thread;

    /**
     * @ORM\ManyToOne(targetEntity="Usuarios\UsuariosBundle\Entity\User")
     * @var \FOS\MessageBundle\Model\ParticipantInterface
     */
    protected $sender;

    /**
     * @ORM\OneToMany(
     *   targetEntity="Usuarios\UsuariosBundle\Entity\MessageMetadata",
     *   mappedBy="message",
     *   cascade={"all"}
     * )
     * @var MessageMetadata
     */
    protected $metadata;
}


text:
require 'schatter/resource'

class Schatter::Person < Schatter::Resource
  def email
    resource['email']
  end
end


text:
<?php

namespace app\system\controllers;

use Yii;
use yii\web\Controller;

class AuthController extends Controller
{
    public function actionIndex()
    {
        return $this->render('index');
    }
    public function actionInit()
    {
        $auth = Yii::$app->authManager;

        $admin = $auth->createRole('admin');
        $auth->add($admin);

        $operator = $auth->createRole('operator');
        $auth->add($operator);

        // Assign roles to users. 1 and 2 are IDs returned by IdentityInterface::getId()
        // usually implemented in your User model.
        $auth->assign($admin, 1);
        $auth->assign($operator, 1);
    }
}


text:
using System.ComponentModel.DataAnnotations;
using Utilities.Validation.ExtensionMethods;
using Utilities.Validation.Rules;
using Xunit;

namespace UnitTests.Validation.Rules
{
    public class NotBetween
    {
        [Fact]
        public void Test()
        {
            NotBetweenClass Temp = new NotBetweenClass();
            Temp.ItemA = 0;
            Assert.DoesNotThrow(() => Temp.Validate());
            Temp.ItemA = 1;
            Assert.Throws<ValidationException>(() => Temp.Validate());
        }
    }

    public class NotBetweenClass
    {
        [NotInRange(1,10)]
        public int ItemA { get; set; }
    }
}


text:
using BitcoinUtilities;
using BitcoinUtilities.P2P;
using BitcoinUtilities.P2P.Primitives;

namespace Test.BitcoinUtilities.Scripts
{
    public class TransactionInputExample
    {
        public TransactionInputExample(string name, int blockHeight, string transaction, int inputIndex, ulong inputValue, string inputScript)
        {
            Name = name;
            BlockHeight = blockHeight;
            Transaction = BitcoinStreamReader.FromBytes(HexUtils.GetBytesUnsafe(transaction), Tx.Read);
            InputIndex = inputIndex;
            InputValue = inputValue;
            InputScript = HexUtils.GetBytesUnsafe(inputScript);
        }

        public string Name { get; }

        public int BlockHeight { get; }
        public Tx Transaction { get; }

        public int InputIndex { get; }
        public ulong InputValue { get; }
        public byte[] InputScript { get; }

        public override string ToString()
        {
            return $"\"{Name}\" {{{BlockHeight} - {HexUtils.GetReversedString(Transaction.Hash)} - {InputIndex}}}";
        }
    }
}


text:
package io.dockstore.webservice.core;

import com.google.common.base.Objects;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.sql.Timestamp;
import java.util.Comparator;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;

/**
 * This describes a input or output file format that is associated with an entry in the dockstore
 *
 * @author gluu
 * @since 1.5.0
 */
@ApiModel(value = "FileFormat", description = "This describes an input or output file format that is associated with an entry in the dockstore")
@Entity
@Table(name = "fileformat")
@NamedQueries({
    @NamedQuery(name = "io.dockstore.webservice.core.FileFormat.findByFileFormatValue", query = "SELECT l FROM FileFormat l WHERE l.value = :fileformatValue")
})

public class FileFormat implements Comparable<FileFormat> {

    private static final Comparator<String> NULL_SAFE_STRING_COMPARATOR = Comparator
            .nullsFirst(String::compareToIgnoreCase);

    private static final Comparator<FileFormat> FILE_FORMAT_COMPARATOR = Comparator
            .comparing(FileFormat::getValue, NULL_SAFE_STRING_COMPARATOR)
            .thenComparing(FileFormat::getValue, NULL_SAFE_STRING_COMPARATOR);

    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "fileformat_id_seq")
    @SequenceGenerator(name = "fileformat_id_seq", sequenceName = "fileformat_id_seq", allocationSize = 1)
    @ApiModelProperty(value = "Implementation specific ID for file format in this web service", position = 0)
    @Column(columnDefinition = "bigint default nextval('fileformat_id_seq')")
    private long id;

    @Column(unique = true, columnDefinition = "text")
    @ApiModelProperty(value = "String representation of the file format", required = true, position = 1)
    private String value;

    // database timestamps
    @Column(updatable = false)
    @CreationTimestamp
    private Timestamp dbCreateDate;

    @Column()
    @UpdateTimestamp
    private Timestamp dbUpdateDate;

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(value);
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null || getClass() != obj.getClass()) {
            return false;
        }
        final FileFormat other = (FileFormat)obj;
        return Objects.equal(value, other.value);
    }

    @Override
    public int compareTo(FileFormat that) {
        return FILE_FORMAT_COMPARATOR.compare(this, that);
    }
}


text:
/*
 * Code Generator - Data Access Layer for SharePoint
 * Version 0.1.0
 * Author: John Kerski (Definitive Logic)
 * @requires jQuery v1.5 or greater and SPServices
 * Licensed under the MIT LIcense
 * http://www.opensource.org/licenses/mit-license.php
*/
/*
*  @description - Data Access Layer for SharePoint
*  @name DAL
*  @author John Kerski (Definitive Logic)
*/

		/* @namespace DAL*/
		window.DAL = {};

		/** @function getLists
		 * Get List of lists from url provided
		 */
		DAL.getLists = function(url)
		{
			var _jquery = $;

			return _jquery.Deferred(function(dfd){
				_jquery().SPServices({
				    webURL: url,
				    operation: "GetListCollection",
				    async: true,
				    completefunc: function (xData, Status) {
				      if(Status == "success")
				      {
				      		//Done function will return this
							var lists = [];

							lists.push({title:"[Please Select List]"});

							$(xData.responseXML).find("Lists > List").each(function(){
								var $node = _jquery(this);

								var tempTitle = $node.attr("Title");

								var temp = {
									title : tempTitle
								};

								lists.push(temp);
							});

							dfd.resolve(lists);
			      	  }
	   		      	  else
			      	 {
						dfd.reject(Status);
			      	 }
			      }
			  });//End SPService Function
			}).promise();//End Deferred function

		};//end DAL.getLists

		/** @function getContentTypesFromList
		 * Get Content Types From Lis
		 */
		DAL.getContentTypesFromList = function(url, list)
		{
			var _jquery = $;

			return _jquery.Deferred(function(dfd){
				_jquery().SPServices({
 					webURL: url,
		  		    operation: "GetListContentTypes",
			        listName: list,
				    completefunc: function (xData, Status) {
				      if(Status == "success")
				      {
				      		//Done function will return this
							var contentTypes = [];

							contentTypes.push({name:"[Please Select Content Type]", id:"0"});

							_jquery(xData.responseXML).find("ContentType").each(function(){
								var $node = _jquery(this);

								var tempName = $node.attr("Name");
								var tempID = $node.attr("ID");

								var temp = {
									name : tempName,
									id : tempID
								};

								if(tempName != "Folder") //Don't add folders
								{
									contentTypes.push(temp);
								}
							});

							dfd.resolve(contentTypes);
			      	  }
	   		      	  else
			      	 {
						dfd.reject(Status);
			      	 }
			      }
			  });//End SPService Function
			}).promise();//End Deferred function

		};//end DAL.getContentTypesFromList

		/** @function getAllSubWebCollection
		 * Return Get Sub Sites	and includes current site
		 */
		DAL.getWebCollection = function()
		{
			var _jquery = $;

			return _jquery.Deferred(function(dfd){
				_jquery().SPServices({
				    operation: "GetWebCollection",
				    async: false,
				    completefunc: function (xData, Status) {
				      if(Status == "success")
				      {
				      		//Done function will return this
							var webs = [];

							//Load current site
							webs.push({title: "Current Site", url : _jquery().SPServices.SPGetCurrentSite()});

							_jquery(xData.responseXML).find("Webs > Web").each(function(){
								var $node = _jquery(this);

								var tempTitle = $node.attr("Title");
								var tempURL = $node.attr("Url");

								var temp = {
									title : tempTitle,
									url : tempURL
								};

								webs.push(temp);
							});

							dfd.resolve(webs);
			      	  }
	   		      	  else
			      	 {
						dfd.reject(Status);
			      	 }
			      }
			  });//End SPService Function
			}).promise();//End Deferred function
		};//end DAL.getWebCollection

		/** @function getContentType
		 * Get Content Type Information based on parameters provided
		 */
		DAL.getContentType = function(url, list, contentTypeID)
		{

			var _jquery = $;

			return _jquery.Deferred(function(dfd){
				_jquery().SPServices({
					webURL: url,
				    operation: "GetListContentType",
				    listName: list,
				    contentTypeId: contentTypeID,
				    async: true,
				    completefunc: function (xData, Status) {
				      if(Status == "success")
				      {
				      		//Done function will return this
							var fields = [];

							_jquery(xData.responseXML).find("Fields > Field").each(function(){
								var $node = _jquery(this);

								//Build Properties
								var tempProperties = {};

								//Pull also possible relevant values for use later
								var tempStaticName = $node.attr("StaticName");
								var tempType = $node.attr("Type");
								var tempDisplayName = $node.attr("DisplayName");
								var tempRequired = $node.attr("Required");

								//Add properties now based on type
								if(tempType == "Note")
								{
									var tempRichText = $node.attr("RichText");
									var tempRichTextMode = $node.attr("RichTextMode"); //FullHtml or Compatible
									var tempAppendOnly = $node.attr("AppendOnly");

									tempProperties.richText = tempRichText;
									tempProperties.richTextMode = tempRichTextMode;
									tempProperties.appendOnly = tempAppendOnly;
								}
								else if(tempType == "Choice" || tempType == "MultiChoice")
								{
									var tempChoices = [];

									//Get Choices
									$node.find("CHOICES > CHOICE").each(function(){
										var $choice = _jquery(this);
										//Add choice
										tempChoices.push( {"choice":$choice.text()} );
									});

									var tempFillInChoice = $node.attr("FillInChoice");

									tempProperties.choices = tempChoices;
									tempProperties.fillInChoice = tempFillInChoice;

								}
								else if(tempType == "Number")
								{
									var tempMin = $node.attr("Min");
									var tempMax = $node.attr("Max");
									var tempPercentage = $node.attr("Percentage");
									var tempDecimals = $node.attr("Decimals");

									tempProperties.min = tempMin;
									tempProperties.max = tempMax;
									tempProperties.percentage = tempPercentage;
									tempProperties.decimals = tempDecimals;

								}
								else if(tempType == "Currency")
								{
									var tempLCID = $node.attr("LCID");
									tempProperties.lCID = tempLCID;
								}
								else if(tempType == "DateTime")
								{
									var tempFormat = $node.attr("Format"); //DateOnly or DateTime

									tempProperties.format = tempFormat;
								}
								else if(tempType == "Lookup" || tempType == "LookupMulti")
								{
									var tempList = $node.attr("List");
									var tempShowField = $node.attr("ShowField");

									tempProperties.list = tempList;
									tempProperties.showField = tempShowField;
								}
								else if(tempType == "Boolean")
								{
									//Do nothing right now
								}
								else if(tempType == "User" || tempType == "UserMulti")
								{
									var tempUserSelectionMode = $node.attr("UserSelectionMode");

									tempProperties.userSelectionMode = tempUserSelectionMode;
								}

								var temp = {
									staticName : tempStaticName,
									type : tempType,
									displayName : tempDisplayName,
									required : tempRequired,
									properties : tempProperties
								};

								fields.push(temp);
							});

							dfd.resolve(fields);
			      	  }
	   		      	  else
			      	 {
						dfd.reject(Status);
			      	 }
			      }
			  });//End SPService Function
			}).promise();//End Deferred function
			};// end DAL.getContentType

			/** @function hasSPError
			 * Checks for error code
			 */
			DAL.hasSPError = function(xData){

				var results = JSON.stringify(xData);

				//Check if error code is not 0
				var index = results.indexOf('<ErrorCode>0x00000000</ErrorCode>');

				if(index == -1)
				{
					return true;
				}
				else
				{
					return false;
				}

			};//end DAL.hasSPError


text:
require 'spec_helper'
require 'reek/smells/long_parameter_list'
require 'reek/smells/smell_detector_shared'

include Reek
include Reek::Smells

describe LongParameterList do

  context 'for methods with few parameters' do
    it 'should report nothing for no parameters' do
      expect('def simple; f(3);true; end').not_to smell_of(LongParameterList)
    end
    it 'should report nothing for 1 parameter' do
      expect('def simple(yep) f(3);true end').not_to smell_of(LongParameterList)
    end
    it 'should report nothing for 2 parameters' do
      expect('def simple(yep,zero) f(3);true end').not_to smell_of(LongParameterList)
    end
    it 'should not count an optional block' do
      expect('def simple(alpha, yep, zero, &opt) f(3);true end').not_to smell_of(LongParameterList)
    end
    it 'should not report inner block with too many parameters' do
      src = 'def simple(yep,zero); m[3]; rand(34); f.each { |arga, argb, argc, argd| true}; end'
      expect(src).not_to smell_of(LongParameterList)
    end

    describe 'and default values' do
      it 'should report nothing for 1 parameter' do
        expect('def simple(zero=nil) f(3);false end').not_to smell_of(LongParameterList)
      end
      it 'should report nothing for 2 parameters with 1 default' do
        expect('def simple(yep, zero=nil) f(3);false end').not_to smell_of(LongParameterList)
      end
      it 'should report nothing for 2 defaulted parameters' do
        expect('def simple(yep=4, zero=nil) f(3);false end').not_to smell_of(LongParameterList)
      end
    end
  end

  describe 'for methods with too many parameters' do
    it 'should report 4 parameters' do
      src = 'def simple(arga, argb, argc, argd) f(3);true end'
      expect(src).to smell_of(LongParameterList, LongParameterList::PARAMETER_COUNT_KEY => 4)
    end
    it 'should report 8 parameters' do
      src = 'def simple(arga, argb, argc, argd,arge, argf, argg, argh) f(3);true end'
      expect(src).to smell_of(LongParameterList, LongParameterList::PARAMETER_COUNT_KEY => 8)
    end

    describe 'and default values' do
      it 'should report 3 with 1 defaulted' do
        src = 'def simple(polly, queue, yep, zero=nil) f(3);false end'
        expect(src).to smell_of(LongParameterList, LongParameterList::PARAMETER_COUNT_KEY => 4)
      end
      it 'should report with 3 defaulted' do
        src = 'def simple(aarg, polly=2, yep=:truth, zero=nil) f(3);false end'
        expect(src).to smell_of(LongParameterList, LongParameterList::PARAMETER_COUNT_KEY => 4)
      end
    end
  end
end

describe LongParameterList do
  before(:each) do
    @source_name = 'smokin'
    @detector = LongParameterList.new(@source_name)
  end

  it_should_behave_like 'SmellDetector'

  context 'when a smell is reported' do
    before :each do
      src = <<EOS
def badguy(arga, argb, argc, argd)
  f(3)
  true
end
EOS
      ctx = CodeContext.new(nil, src.to_reek_source.syntax_tree)
      @smells = @detector.examine_context(ctx)
      @warning = @smells[0]
    end

    it_should_behave_like 'common fields set correctly'

    it 'reports the number of parameters' do
      expect(@warning.parameters[LongParameterList::PARAMETER_COUNT_KEY]).to eq(4)
    end
    it 'reports the line number of the method' do
      expect(@warning.lines).to eq([1])
    end
  end
end


text:
"""
This is your project's main settings file that can be committed to your
repo. If you need to override a setting locally, use local.py
"""

import django
import os, sys
import logging
#import django.conf.global_settings as DEFAULT_SETTINGS
#import memcache_toolbar.panels.memcache

# Your project root
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__) + "../../../")

PYTHON_VERSION = '%s.%s' % sys.version_info[:2]
DJANGO_VERSION = django.get_version()
#path = lambda *a: os.path.join(ROOT, *a)

SUPPORTED_NONLOCALES = ['media', 'admin', 'static']

# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'ru-ru'

#LOCALE_PATHS = (os.path.join(PROJECT_ROOT, 'locale'),)
SITE_ID = 1

# Defines the views served for root URLs.
ROOT_URLCONF = 'DjangoApp.urls'

IMAGESTORE_SHOW_USER = False
IMAGESTORE_LOAD_CSS = False

INSTALLED_APPS = [
    'mptt',
    #'compressor',
    'fiber',
    #'grappelli.dashboard',
    #'grappelli',
    #'grappellifit',
    'filebrowser',

    # Django contrib apps
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.admin',
    #'modeltranslation_wrapper',
    'modeltranslation',
    'django.contrib.admindocs',
    'django.contrib.markup',
    'django.contrib.humanize',
    'django.contrib.syndication',
    'django.contrib.staticfiles',
    'djangorestframework',
    'dajaxice',
    'dajax',
    # Third-party apps, patches, fixes
    ##'commonware.response.cookies',
    'djcelery',
    'gunicorn',
    #'rosetta-grappelli',
    'rosetta',
    #'django_nose',
    #'session_csrf',
    #'debug_toolbar',
    #'debug_toolbar_user_panel',
    #'memcache_toolbar',
    'easy_thumbnails',
    'widget_tweaks',
    'imagestore',
    'sorl.thumbnail',
    'taggit',
    'intellipages',
    #'registration',
    'guardian',
    # Database migrations
    'south',
    'knowledge',
    # Application base, containing global templates.
    'DjangoApp.base',
    'userena',
    'userena.contrib.umessages',
    'profiles',

    # Local apps, referenced via DjangoApp.appname
    'flatpages_plus',
    'compressor',
]

# Place bcrypt first in the list, so it will be the default password hashing
# mechanism
PASSWORD_HASHERS = (
    'django.contrib.auth.hashers.BCryptPasswordHasher',
    'django.contrib.auth.hashers.PBKDF2PasswordHasher',
    'django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher',
    'django.contrib.auth.hashers.SHA1PasswordHasher',
    'django.contrib.auth.hashers.MD5PasswordHasher',
    'django.contrib.auth.hashers.CryptPasswordHasher',
    )

# Sessions
#
# By default, be at least somewhat secure with our session cookies.
SESSION_COOKIE_HTTPONLY = True

# Set this to true if you are using https
SESSION_COOKIE_SECURE = False

CSRF_COOKIE_IN_EVERY_RESPONSE = True
## Tests
TEST_RUNNER = 'test_utils.runner.RadicalTestSuiteRunner'

# Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/home/media/media.example.com/media/"
MEDIA_ROOT = FILEBROWSER_MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'public/media')

# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
# Examples: "http://media.example.com/media/", "http://example.com/media/"
MEDIA_URL = FILEBROWSER_MEDIA_URL = '/media/'

# Absolute path to the directory static files should be collected to.
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/home/media/media.example.com/static/"
STATIC_ROOT = os.path.join(PROJECT_ROOT, 'public/static')

# URL prefix for static files.
# Example: "http://media.example.com/static/"
STATIC_URL = '/static/'

# Additional locations of static files
STATICFILES_DIRS = (
    # Put strings here, like "/home/html/static" or "C:/www/django/static".
    # Always use forward slashes, even on Windows.
    # Don't forget to use absolute paths, not relative paths.
    'static',
    )

# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True

# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale
USE_L10N = True

# If you set this to False, Django will not use timezone-aware datetimes.
USE_TZ = True

# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
    'dajaxice.finders.DajaxiceFinder',
    'compressor.finders.CompressorFinder',
    )

MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.locale.LocaleMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    #'session_csrf.CsrfMiddleware',  # Must be after auth middleware.
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'flatpages_plus.middleware.FlatpageFallbackMiddleware',
    #'commonware.middleware.FrameOptionsHeader',
    #'debug_toolbar.middleware.DebugToolbarMiddleware',
    'userena.middleware.UserenaLocaleMiddleware',
    #'userena.middleware.CsrfFixMiddleware',
    )

TEMPLATE_CONTEXT_PROCESSORS = (
    'django.contrib.auth.context_processors.auth',
    'django.core.context_processors.debug',
    'django.core.context_processors.media',
    'django.core.context_processors.request',
    'django.core.context_processors.i18n',
    'django.core.context_processors.static',
    'django.core.context_processors.tz',
    #'session_csrf.context_processor',
    'django.contrib.messages.context_processors.messages',
    'django.core.context_processors.csrf',
    #'jingo_minify.helpers.build_ids',
    "imagestore.context_processors.imagestore_processor",
    )

TEMPLATE_DIRS = (
    # Put strings here, like "/home/html/django_templates" or
    # "C:/www/django/templates".
    # Always use forward slashes, even on Windows.
    # Don't forget to use absolute paths, not relative paths.
    os.path.join(PROJECT_ROOT, 'templates'),
    )

# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
    #'jingo.Loader',
    'django.template.loaders.filesystem.Loader',
    'django.template.loaders.app_directories.Loader',
    'django.template.loaders.eggs.Loader',
    )

FIXTURE_DIRS = (
    os.path.join(PROJECT_ROOT, 'fixtures'),
    )

gettext = lambda s: s

LANGUAGES = (
    ('en', gettext('English')),
    #('fr', gettext('French')),
    #('es', gettext('Spanish')),
    #('pt', gettext('Portuguese')),
    #('de', gettext('German')),
    ('ru', gettext('Russian')),
    ('ua', gettext('Ukraine')),
    )
MODELTRANSLATION_DEFAULT_LANGUAGE = 'ru'
MODELTRANSLATION_TRANSLATION_REGISTRY = 'DjangoApp.translation'
#MODELTRANSLATION_TRANSLATION_FILES = ('DjangoApp',)
# Specify a model to use for user profiles, if desired.
#AUTH_PROFILE_MODULE = 'DjangoApp.accounts.UserProfile'

FILE_UPLOAD_PERMISSIONS = 0664

SOUTH_TESTS_MIGRATE = False

FIBER_TEMPLATE_CHOICES = (
    ('', 'Default template'),
    ('tpl-home.html', 'Home template'),
    ('tpl-sidebar.html', 'With sidebar template'),
    )

try:
    import seoutils
except ImportError:
    pass
else:
    INSTALLED_APPS = INSTALLED_APPS + ['seoutils']
# Django extensions
try:
    import django_extensions
except ImportError:
    pass
else:
    INSTALLED_APPS = INSTALLED_APPS + ['django_extensions']

if 'fiber' in INSTALLED_APPS:
    MIDDLEWARE_CLASSES = MIDDLEWARE_CLASSES + (
        'fiber.middleware.ObfuscateEmailAddressMiddleware',
        'fiber.middleware.AdminPageMiddleware',
        )
    TEMPLATE_CONTEXT_PROCESSORS = TEMPLATE_CONTEXT_PROCESSORS + (
        'fiber.context_processors.page_info',
        )

# The WSGI Application to use for runserver
WSGI_APPLICATION = 'DjangoApp.wsgi.application'

GRAPPELLI_INDEX_DASHBOARD = 'DjangoApp.dashboard.CustomIndexDashboard'
DIRECTORY = 'uploads/'

# https://github.com/mozilla/django-session-csrf
ANON_ALWAYS = True # always provide CSRF protection for anonymous users (неработает registration Login)

# Add the Guardian and userena authentication backends
AUTHENTICATION_BACKENDS = (
    'userena.backends.UserenaAuthenticationBackend',
    'guardian.backends.ObjectPermissionBackend',
    'django.contrib.auth.backends.ModelBackend',
    )

# Settings used by Userena
LOGIN_REDIRECT_URL = '/accounts/%(username)s/'
LOGIN_URL = '/accounts/signin/'
LOGOUT_URL = '/accounts/signout/'
AUTH_PROFILE_MODULE = 'profiles.Profile'
USERENA_DISABLE_PROFILE_LIST = True
USERENA_MUGSHOT_SIZE = 140

ACCOUNT_ACTIVATION_DAYS = 2 # кол-во дней для хранения кода активации
DAJAXICE_MEDIA_PREFIX = "dajaxice"
DAJAXICE_DEBUG = True
DAJAXICE_JS_DOCSTRINGS = True
#DAJAX_FUNCTIONS=(
# "userena.ajax.send_form",
# "userena.assign_test",
#)

## Help Desk
KNOWLEDGE_ALLOW_ANONYMOUS = True
KNOWLEDGE_FREE_RESPONSE = False
KNOWLEDGE_SLUG_URLS = False
KNOWLEDGE_ALERTS = True

## Compress
COMPRESS_ENABLED = True
COMPRESS_OFFLINE = True
COMPRESS_PRECOMPILERS = (
    ('text/less', 'lessc DjangoApp/base/static/less/aplication.less DjangoApp/base/static/css/aplication.css'),
    )

## Rosetta
#ROSETTA_ENABLE_TRANSLATION_SUGGESTIONS = True
ROSETTA_STORAGE_CLASS = 'rosetta.storage.SessionRosettaStorage'

## Log settings

LOG_LEVEL = logging.INFO
LOG_COLORSQL_ENABLE = True
LOG_COLORSQL_VERBOSE = True
#HAS_SYSLOG = True
#SYSLOG_TAG = "http_app_DjangoApp"  # Make this unique to your project.
# Remove this configuration variable to use your custom logging configuration
#LOGGING_CONFIG = None
# A sample logging configuration. The only tangible logging
# performed by this configuration is to send an email to
# the site admins on every HTTP 500 error when DEBUG=False.
# See http://docs.djangoproject.com/en/dev/topics/logging for
# more details on how to customize your logging configuration.
LOGGING = {
    'version': 1,
    'disable_existing_loggers': True,
    'root': {
        'level': 'DEBUG',
        'handlers': ['default'],
    },
    'formatters': {
        'verbose': {
            'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
        },
        'simple': {
            'format': '%(asctime)s %(levelname)s || %(message)s'
        },
    },
    'handlers': {
        # Include the default Django email handler for errors
        # This is what you'd get without configuring logging at all.
        'mail_admins': {
            'class': 'django.utils.log.AdminEmailHandler',
            'level': 'ERROR',
            # But the emails are plain text by default - HTML is nicer
            'include_html': True,
        },
        'default': {
            'class': 'logging.handlers.WatchedFileHandler',
            'filename': 'log/django-app.log',
            'formatter': 'verbose',
        },
        'default-db': {
            'level': 'DEBUG',
            'class': 'logging.handlers.RotatingFileHandler',
            'filename': 'log/django-app-db.log',
            'maxBytes': 1024 * 1024 * 5, # 5 MB
            'backupCount': 20,
            'formatter': 'verbose',
        },
        'console': {
            'level': 'DEBUG',
            'class': 'logging.StreamHandler',
            'formatter': 'verbose'
        },
    },
    'loggers': {
        # Again, default Django configuration to email unhandled exceptions
        'django': {
            'handlers': ['default'],
            'propagate': False,
            'level': 'DEBUG',
        },
        'dajaxice': {
            'handlers': ['console'],
            'level': 'DEBUG',
            'propagate': True,
        },
        'django.request': {
            'handlers': ['mail_admins'],
            'level': 'ERROR',
            'propagate': True,
        },
        'django.db.backends': {
            'handlers': ['default-db'],
            'level': 'DEBUG',
            'propagate': False,
        },
        'userena': {
            'handlers': ['console', 'default'],
            'level': 'DEBUG',
        },
        'fiber': {
            'handlers': ['console', 'default'],
            'level': 'DEBUG',
        },
        'DjangoApp': {
            'handlers': ['console'],
            'propagate': False,
            'level': 'DEBUG',
        },
    },
}
# Needed for Django guardian
ANONYMOUS_USER_ID = -1

try:
    import django_jenkins

    installed_apps = list(INSTALLED_APPS)
    installed_apps.append('django_jenkins')
    INSTALLED_APPS = tuple(installed_apps)
except ImportError:
    pass

JENKINS_TASKS = (
    'django_jenkins.tasks.with_coverage',
    'django_jenkins.tasks.django_tests',
    )


text:
/* Rezgo responsive calendar */
.responsive-calendar {
	font-family:'Lato', sans-serif;
	padding:20px;
	background:#eee;
}
.responsive-calendar .controls a {
  font-size:20px;
}
.responsive-calendar .day-headers {
	height:20px;
	margin-top:20px;
}
.responsive-calendar .day {
  line-height:1.5 em;
}
.responsive-calendar .day.active a {
  border-radius:10%;
}
.responsive-calendar .day.select a {
	background-color:#398439 !important;
}
.responsive-calendar .day.select a:hover {
	background-color:#449d44 !important;
}
.responsive-calendar .day.not-current a {
	cursor: default;
}
.responsive-calendar .day.available a {
  background-color: #090;
}
.responsive-calendar .day.passed a,
.responsive-calendar .day.cutoff a,
.responsive-calendar .day.unavailable a {
	cursor: default;
}
.responsive-calendar .day.full a {
  background-color: #FF9900;
	border-radius: 10%;
	color: #FFFFFF;
	cursor: default;
}
.responsive-calendar .day.full a:hover {
}
.rezgo-calendar .responsive-calendar .day a {
	margin:2px;
}