text:
namespace DuiLib
{
	CTextUI::CTextUI() : m_nLinks(0), m_nHoverLink(-1)
	{
		m_uTextStyle = DT_WORDBREAK ;
		m_rcTextPadding.left = 2;
		m_rcTextPadding.right = 2;
		::ZeroMemory(m_rcLinks, sizeof(m_rcLinks));
	}

	CTextUI::~CTextUI()
	{
	}

	LPCTSTR CTextUI::GetClass() const
	{
		return _T("TextUI");
	}

	LPVOID CTextUI::GetInterface(LPCTSTR pstrName)
	{
		if( _tcscmp(pstrName, DUI_CTR_TEXT) == 0 ) return static_cast<CTextUI*>(this);
		return CLabelUI::GetInterface(pstrName);
	}

	UINT CTextUI::GetControlFlags() const
	{
		if( IsEnabled() && m_nLinks > 0 ) return UIFLAG_SETCURSOR;
		else return 0;
	}

	CDuiString* CTextUI::GetLinkContent(int iIndex)
	{
		if( iIndex >= 0 && iIndex < m_nLinks ) return &m_sLinks[iIndex];
		return NULL;
	}

	void CTextUI::DoEvent(TEventUI& event)
	{
		if( !IsMouseEnabled() && event.Type > UIEVENT__MOUSEBEGIN && event.Type < UIEVENT__MOUSEEND ) {
			if( m_pParent != NULL ) m_pParent->DoEvent(event);
			else CLabelUI::DoEvent(event);
			return;
		}

		if( event.Type == UIEVENT_SETCURSOR ) {
			for( int i = 0; i < m_nLinks; i++ ) {
				if( ::PtInRect(&m_rcLinks[i], event.ptMouse) ) {
					::SetCursor(::LoadCursor(NULL, MAKEINTRESOURCE(IDC_HAND)));
					return;
				}
			}
		}
		if( event.Type == UIEVENT_BUTTONDOWN || event.Type == UIEVENT_DBLCLICK && IsEnabled() ) {
			for( int i = 0; i < m_nLinks; i++ ) {
				if( ::PtInRect(&m_rcLinks[i], event.ptMouse) ) {
					Invalidate();
					return;
				}
			}
		}
		if( event.Type == UIEVENT_BUTTONUP && IsEnabled() ) {
			for( int i = 0; i < m_nLinks; i++ ) {
				if( ::PtInRect(&m_rcLinks[i], event.ptMouse) ) {
					m_pManager->SendNotify(this, DUI_MSGTYPE_LINK, i);
					return;
				}
			}
		}
		if( event.Type == UIEVENT_CONTEXTMENU )
		{
			return;
		}
		// When you move over a link
		if( m_nLinks > 0 && event.Type == UIEVENT_MOUSEMOVE && IsEnabled() ) {
			int nHoverLink = -1;
			for( int i = 0; i < m_nLinks; i++ ) {
				if( ::PtInRect(&m_rcLinks[i], event.ptMouse) ) {
					nHoverLink = i;
					break;
				}
			}

			if(m_nHoverLink != nHoverLink) {
				m_nHoverLink = nHoverLink;
				Invalidate();
				return;
			}
		}
		if( event.Type == UIEVENT_MOUSELEAVE ) {
			if( m_nLinks > 0 && IsEnabled() ) {
				if(m_nHoverLink != -1) {
					m_nHoverLink = -1;
					Invalidate();
					return;
				}
			}
		}

		CLabelUI::DoEvent(event);
	}
	void CTextUI::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue)
	{
	 if( _tcscmp(pstrName, _T("vcenterforce")) == 0 ) {
				bVcenterForce = _tcscmp(pstrValue, _T("true")) == 0;
	   }else CLabelUI::SetAttribute(pstrName, pstrValue);
	}
	SIZE CTextUI::EstimateSize(SIZE szAvailable)
	{
		RECT rcText = { 0, 0, MAX(szAvailable.cx, m_cxyFixed.cx), 9999 };
		rcText.left += m_rcTextPadding.left;
		rcText.right -= m_rcTextPadding.right;
		if( m_bShowHtml ) {
			int nLinks = 0;
			CRenderEngine::DrawHtmlText(m_pManager->GetPaintDC(), m_pManager, rcText, m_sText, m_dwTextColor, NULL, NULL, nLinks, DT_CALCRECT | m_uTextStyle);
		}
		else {
			CRenderEngine::DrawText(m_pManager->GetPaintDC(), m_pManager, rcText, m_sText, m_dwTextColor, m_iFont, DT_CALCRECT | m_uTextStyle);
		}
		SIZE cXY = {rcText.right - rcText.left + m_rcTextPadding.left + m_rcTextPadding.right,
			rcText.bottom - rcText.top + m_rcTextPadding.top + m_rcTextPadding.bottom};

		if( m_cxyFixed.cy != 0 ) cXY.cy = m_cxyFixed.cy;
		return cXY;
	}
	CDuiRect  CTextUI::GetTextRect(SIZE szAvailable)
	{
		RECT rcText = { 0, 0, MAX(szAvailable.cx, m_cxyFixed.cx), 9999 };
		rcText.left += m_rcTextPadding.left;
		rcText.right -= m_rcTextPadding.right;
		if( m_bShowHtml ) {
			int nLinks = 0;
			CRenderEngine::DrawHtmlText(m_pManager->GetPaintDC(), m_pManager, rcText, m_sText, m_dwTextColor, NULL, NULL, nLinks, DT_CALCRECT | m_uTextStyle);
		}
		else {
			CRenderEngine::DrawText(m_pManager->GetPaintDC(), m_pManager, rcText, m_sText, m_dwTextColor, m_iFont, DT_CALCRECT | m_uTextStyle);
		}
		SIZE cXY = {rcText.right - rcText.left + m_rcTextPadding.left + m_rcTextPadding.right,
			rcText.bottom - rcText.top + m_rcTextPadding.top + m_rcTextPadding.bottom};

		return rcText;

	}
	void CTextUI::PaintText(HDC hDC)
	{
		if( m_sText.IsEmpty() ) {
			m_nLinks = 0;
			return;
		}

		if( m_dwTextColor == 0 ) m_dwTextColor = m_pManager->GetDefaultFontColor();
		if( m_dwDisabledTextColor == 0 ) m_dwDisabledTextColor = m_pManager->GetDefaultDisabledColor();

		if( m_sText.IsEmpty() ) return;

		m_nLinks = lengthof(m_rcLinks);
		RECT rc = m_rcItem;
		rc.left += m_rcTextPadding.left;
		rc.right -= m_rcTextPadding.right;
		rc.top += m_rcTextPadding.top;
		rc.bottom -= m_rcTextPadding.bottom;

		int iadd = 0;

		if(bVcenterForce){
			SIZE szAvailable = { rc.right - rc.left, rc.bottom - rc.top };
			CDuiRect rcText = GetTextRect(szAvailable);
			iadd = ((rc.bottom - rc.top) - (rcText.bottom - rcText.top)) / 2;
			if(iadd <0) iadd = 0;
		}

		rc.top += iadd;

		if( IsEnabled() ) {
			if( m_bShowHtml )
				CRenderEngine::DrawHtmlText(hDC, m_pManager, rc, m_sText, m_dwTextColor, \
				m_rcLinks, m_sLinks, m_nLinks, m_uTextStyle);
			else
				CRenderEngine::DrawText(hDC, m_pManager, rc, m_sText, m_dwTextColor, \
				m_iFont, m_uTextStyle);
		}
		else {
			if( m_bShowHtml )
				CRenderEngine::DrawHtmlText(hDC, m_pManager, rc, m_sText, m_dwDisabledTextColor, \
				m_rcLinks, m_sLinks, m_nLinks, m_uTextStyle);
			else
				CRenderEngine::DrawText(hDC, m_pManager, rc, m_sText, m_dwDisabledTextColor, \
				m_iFont, m_uTextStyle);
		}
	}
}


text:
package org.gradle.test.performance.mediummonolithicjavaproject.p445;

import org.gradle.test.performance.mediummonolithicjavaproject.p444.Production8897;
import org.gradle.test.performance.mediummonolithicjavaproject.p444.Production8898;
import org.gradle.test.performance.mediummonolithicjavaproject.p444.Production8899;

public class Production8900 {

    private Production8897 property0;

    public Production8897 getProperty0() {
        return property0;
    }

    public void setProperty0(Production8897 value) {
        property0 = value;
    }

    private Production8898 property1;

    public Production8898 getProperty1() {
        return property1;
    }

    public void setProperty1(Production8898 value) {
        property1 = value;
    }

    private Production8899 property2;

    public Production8899 getProperty2() {
        return property2;
    }

    public void setProperty2(Production8899 value) {
        property2 = value;
    }

    private String property3;

    public String getProperty3() {
        return property3;
    }

    public void setProperty3(String value) {
        property3 = value;
    }

    private String property4;

    public String getProperty4() {
        return property4;
    }

    public void setProperty4(String value) {
        property4 = value;
    }

    private String property5;

    public String getProperty5() {
        return property5;
    }

    public void setProperty5(String value) {
        property5 = value;
    }

    private String property6;

    public String getProperty6() {
        return property6;
    }

    public void setProperty6(String value) {
        property6 = value;
    }

    private String property7;

    public String getProperty7() {
        return property7;
    }

    public void setProperty7(String value) {
        property7 = value;
    }

    private String property8;

    public String getProperty8() {
        return property8;
    }

    public void setProperty8(String value) {
        property8 = value;
    }

    private String property9;

    public String getProperty9() {
        return property9;
    }

    public void setProperty9(String value) {
        property9 = value;
    }

}

redpajama_set_name: RedPajamaGithub


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

public class ArenaEnemy : MonoBehaviour {

	// Use this for initialization
	void Start () {

	}

	// Update is called once per frame
	void Update () {

		if (!this.isActiveAndEnabled) {
			Destroy(this.transform.parent.gameObject);
		}
	}

	public void OnCollisionEnter2D(Collision2D other)
	{
		if (other.gameObject.CompareTag ("Player"))
		{
			Physics2D.IgnoreCollision (GetComponent<Collider2D> (), other.gameObject.GetComponent<Collider2D> (), true);
		}
		if (other.gameObject.CompareTag ("Enemy"))
		{
			Physics2D.IgnoreCollision (GetComponent<Collider2D> (), other.gameObject.GetComponent<Collider2D> (), true);
		}
	}

}


text:
<!DOCTYPE html>

    <meta http-equiv="refresh" content="0;URL=fn.fsub_fast.html">

Redirecting to fn.fsub_fast.html...


text:
class RenameUsersRssTokenToFeedToken < ActiveRecord::Migration[4.2]
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  disable_ddl_transaction!

  def up
    # rubocop:disable Migration/UpdateLargeTable
    rename_column_concurrently :users, :rss_token, :feed_token
  end

  def down
    cleanup_concurrent_column_rename :users, :feed_token, :rss_token
  end
end


text:
import { createManager } from '../../../src'
import { createFakePool } from '../fixtures/connectionManager'

describe('Unit', () => {
  describe('Repository', () => {
    describe('selectorsCreator', () => {
      const faker = createFakePool()
      const manager = createManager(faker.pool)
      const user = {
        id: 1,
        createdAt: 'dsa',
        modifiedAt: 'sfsdfg',
      }
      beforeEach(async () => {
        faker.inject()

        await manager.ready()
      })

      it('should start a query builder without alias', async () => {
        const repo = manager.getRepository('users')
        const query = repo.startQuery()
        expect(query.toString()).toEqual('SELECT * FROM users')
        faker.setAnswer('SELECT * FROM users', [user])
        const result = await query.execute()
        expect(result).toMatchObject([user])
      })

      it('should start a query builder with alias', async () => {
        const repo = manager.getRepository('users')
        const query = repo.startQuery('user')
        expect(query.toString()).toEqual('SELECT user.* FROM users `user`')

        faker.setAnswer('SELECT user.* FROM users `user`', [user])
        const result = await query.execute()
        expect(result).toMatchObject([user])
      })

      it('should find data by id and return model', async () => {
        const repo = manager.getRepository('users')
        faker.setAnswer(
          'SELECT * FROM users WHERE (id = ?) LIMIT ?',
          [1, 1],
          [user],
        )
        const result = await repo.find(1)
        if (!result) {
          throw new Error('user should be found')
        }
        expect(result).toEqual(user)
        expect(result.isDirty()).toBeFalsy()
      })

      it('should return null when data by id is not found', async () => {
        const repo = manager.getRepository('users')
        faker.setAnswer(
          'SELECT * FROM users WHERE (id = ?) LIMIT ?',
          [1, 1],
          [],
        )
        const result = await repo.find(1)
        expect(result).toBeNull()
      })

      it('should find data by criteria and return model', async () => {
        const repo = manager.getRepository('users')
        faker.setAnswer(
          'SELECT * FROM users WHERE (id IN (?, ?, ?)) LIMIT ?',
          [1, 2, 3, 1],
          [user],
        )
        const result = await repo.findOneBy({
          id: {
            $in: [1, 2, 3],
          },
        })
        if (!result) {
          throw new Error('user should be found')
        }
        expect(result).toEqual(user)
        expect(result.isDirty()).toBeFalsy()
      })

      it('should return null when data by criteria is not found', async () => {
        const repo = manager.getRepository('users')
        faker.setAnswer(
          'SELECT * FROM users WHERE (id IN (?, ?, ?)) LIMIT ?',
          [1, 2, 3, 1],
          [],
        )
        const result = await repo.findOneBy({
          id: {
            $in: [1, 2, 3],
          },
        })
        expect(result).toBeNull()
      })

      it('should return array of data by criteria and return models', async () => {
        const repo = manager.getRepository('users')
        faker.setAnswer(
          'SELECT * FROM users WHERE (id IN (?, ?, ?))',
          [1, 2, 3],
          [user, user],
        )
        const result = await repo.findBy({
          id: {
            $in: [1, 2, 3],
          },
        })
        if (!result) {
          throw new Error('user should be found')
        }
        expect(result).toHaveLength(2)
        expect(result).toMatchObject([user, user])
        expect(result[0].isDirty()).toBeFalsy()
        expect(result[1].isDirty()).toBeFalsy()
      })

      it('should return array of data with order applied and return model', async () => {
        const repo = manager.getRepository('users')
        faker.setAnswer(
          'SELECT * FROM users WHERE (id IN (?, ?, ?)) ORDER BY id ASC, createdAt DESC',
          [1, 2, 3],
          [user, user],
        )
        const result = await repo.findBy(
          {
            id: {
              $in: [1, 2, 3],
            },
          },
          {
            id: true,
            createdAt: false,
          },
        )
        if (!result) {
          throw new Error('user should be found')
        }
        expect(result).toHaveLength(2)
        expect(result).toMatchObject([user, user])
      })

      it('should return array of data with order applied and limit', async () => {
        const repo = manager.getRepository('users')
        faker.setAnswer(
          'SELECT * FROM users WHERE (id IN (?, ?, ?)) ORDER BY id ASC, createdAt DESC LIMIT ?',
          [1, 2, 3, 10],
          [user, user],
        )
        const result = await repo.findBy(
          {
            id: {
              $in: [1, 2, 3],
            },
          },
          {
            id: true,
            createdAt: false,
          },
          10,
        )
        if (!result) {
          throw new Error('user should be found')
        }
        expect(result).toHaveLength(2)
        expect(result).toMatchObject([user, user])
      })

      it('should return array of data with order applied, limit and offset', async () => {
        const repo = manager.getRepository('users')
        faker.setAnswer(
          'SELECT * FROM users WHERE (id IN (?, ?, ?)) ORDER BY id ASC, createdAt DESC LIMIT ? OFFSET ?',
          [1, 2, 3, 10, 5],
          [user, user],
        )
        const result = await repo.findBy(
          {
            id: {
              $in: [1, 2, 3],
            },
          },
          {
            id: true,
            createdAt: false,
          },
          10,
          5,
        )
        if (!result) {
          throw new Error('user should be found')
        }
        expect(result).toHaveLength(2)
        expect(result).toMatchObject([user, user])
      })

      it('should return empty array when data by criteria is not found', async () => {
        const repo = manager.getRepository('users')
        faker.setAnswer(
          'SELECT * FROM users WHERE (id IN (?, ?, ?))',
          [1, 2, 3],
          [],
        )
        const result = await repo.findBy({
          id: {
            $in: [1, 2, 3],
          },
        })
        expect(result).toHaveLength(0)
      })

      afterEach(async () => {
        faker.resetAnswers()
        await manager.clear()
      })
    })
  })
})


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

import org.apache.commons.logging.LogFactory;
import org.apache.commons.logging.Log;

import javax.imageio.ImageIO;
import javax.imageio.ImageReader;
import javax.imageio.stream.FileImageInputStream;
import javax.imageio.stream.ImageInputStream;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Iterator;

/**
 *
 */
public class FastImageDimensions {
    private static Log log = LogFactory.getLog(FastImageDimensions.class);
    // https://stackoverflow.com/questions/672916/how-to-get-image-height-and-width-using-java
    public static Dimension getImageDimensions(final String path) {
        Dimension result = null;
        String suffix = getFileSuffix(path);
        Iterator<ImageReader> iter = ImageIO.getImageReadersBySuffix(suffix);
        if (iter.hasNext()) {
            ImageReader reader = iter.next();
            try {
                ImageInputStream stream = new FileImageInputStream(new File(path));
                reader.setInput(stream);
                int width = reader.getWidth(reader.getMinIndex());
                int height = reader.getHeight(reader.getMinIndex());
                return new Dimension(width, height);
            } catch (IOException e) {
                log.debug("Exception parsing " + path + ", using fallback");
            } finally {
                reader.dispose();
            }
        }
        try {
            BufferedImage bimg = ImageIO.read(new File(path));
            return new Dimension(bimg.getWidth(), bimg.getHeight());
        } catch (Exception e) {
            throw new RuntimeException("Exception fallback parsing image dimensions from " + path, e);
        }
    }
    private static String getFileSuffix(final String path) {
        String result = null;
        if (path != null) {
            result = "";
            if (path.lastIndexOf('.') != -1) {
                result = path.substring(path.lastIndexOf('.'));
                if (result.startsWith(".")) {
                    result = result.substring(1);
                }
            }
        }
        return result;
    }

    public static Dimension getSlowImageDimensions(String path) {
        try {
            BufferedImage bimg = ImageIO.read(new File(path));
            return new Dimension(bimg.getWidth(), bimg.getHeight());
        } catch (Exception e) {
            throw new RuntimeException("Exception fallback parsing image dimensions from " + path, e);
        }
    }
    //   https://stackoverflow.com/questions/35925981/is-there-any-way-in-java-to-take-image-width-and-height-without-transfer-or-down
    public static Dimension getThirdImageDimensions(String path) throws IOException {
        URL url = new File(path).toURL();
        try (InputStream stream = url.openStream()) {
            // The "useCache" setting will decide whether "input" below
            // will be disk or memory cached
            try (ImageInputStream input = ImageIO.createImageInputStream(stream)) {
                ImageReader reader = ImageIO.getImageReaders(input).next(); // TODO: Handle no reader
                try {
                    reader.setInput(input);

                    // Get dimensions of first image in the stream, without decoding pixel values
                    int width = reader.getWidth(0);
                    int height = reader.getHeight(0);
                    return new Dimension(width, height);
                } finally {
                    reader.dispose();
                }
            }
        }
    }
}


text:
using namespace std;

namespace rocksdb {

class AutoRollLoggerTest {
 public:
  static void InitTestDb() {
    string deleteCmd = "rm -rf " + kTestDir;
    ASSERT_TRUE(system(deleteCmd.c_str()) == 0);
    Env::Default()->CreateDir(kTestDir);
  }

  void RollLogFileBySizeTest(AutoRollLogger* logger,
                             size_t log_max_size,
                             const string& log_message);
  uint64_t RollLogFileByTimeTest(AutoRollLogger* logger,
                                 size_t time,
                                 const string& log_message);

  static const string kSampleMessage;
  static const string kTestDir;
  static const string kLogFile;
  static Env* env;
};

const string AutoRollLoggerTest::kSampleMessage(
    "this is the message to be written to the log file!!");
const string AutoRollLoggerTest::kTestDir(test::TmpDir() + "/db_log_test");
const string AutoRollLoggerTest::kLogFile(test::TmpDir() + "/db_log_test/LOG");
Env* AutoRollLoggerTest::env = Env::Default();

// In this test we only want to Log some simple log message with
// no format. LogMessage() provides such a simple interface and
// avoids the [format-security] warning which occurs when you
// call Log(logger, log_message) directly.
namespace {
void LogMessage(Logger* logger, const char* message) {
  Log(logger, "%s", message);
}

void LogMessage(const InfoLogLevel log_level, Logger* logger,
                const char* message) {
  Log(log_level, logger, "%s", message);
}
}  // namespace

namespace {
void GetFileCreateTime(const std::string& fname, uint64_t* file_ctime) {
  struct stat s;
  if (stat(fname.c_str(), &s) != 0) {
    *file_ctime = (uint64_t)0;
  }
  *file_ctime = static_cast<uint64_t>(s.st_ctime);
}
}  // namespace

void AutoRollLoggerTest::RollLogFileBySizeTest(AutoRollLogger* logger,
                                               size_t log_max_size,
                                               const string& log_message) {
  logger->SetInfoLogLevel(InfoLogLevel::INFO_LEVEL);
  // measure the size of each message, which is supposed
  // to be equal or greater than log_message.size()
  LogMessage(logger, log_message.c_str());
  size_t message_size = logger->GetLogFileSize();
  size_t current_log_size = message_size;

  // Test the cases when the log file will not be rolled.
  while (current_log_size + message_size < log_max_size) {
    LogMessage(logger, log_message.c_str());
    current_log_size += message_size;
    ASSERT_EQ(current_log_size, logger->GetLogFileSize());
  }

  // Now the log file will be rolled
  LogMessage(logger, log_message.c_str());
  // Since rotation is checked before actual logging, we need to
  // trigger the rotation by logging another message.
  LogMessage(logger, log_message.c_str());

  ASSERT_TRUE(message_size == logger->GetLogFileSize());
}

uint64_t AutoRollLoggerTest::RollLogFileByTimeTest(
    AutoRollLogger* logger, size_t time, const string& log_message) {
  uint64_t expected_create_time;
  uint64_t actual_create_time;
  uint64_t total_log_size;
  ASSERT_OK(env->GetFileSize(kLogFile, &total_log_size));
  GetFileCreateTime(kLogFile, &expected_create_time);
  logger->SetCallNowMicrosEveryNRecords(0);

  // -- Write to the log for several times, which is supposed
  // to be finished before time.
  for (int i = 0; i < 10; ++i) {
     LogMessage(logger, log_message.c_str());
     ASSERT_OK(logger->GetStatus());
     // Make sure we always write to the same log file (by
     // checking the create time);
     GetFileCreateTime(kLogFile, &actual_create_time);

     // Also make sure the log size is increasing.
     ASSERT_EQ(expected_create_time, actual_create_time);
     ASSERT_GT(logger->GetLogFileSize(), total_log_size);
     total_log_size = logger->GetLogFileSize();
  }

  // -- Make the log file expire
  sleep(time);
  LogMessage(logger, log_message.c_str());

  // At this time, the new log file should be created.
  GetFileCreateTime(kLogFile, &actual_create_time);
  ASSERT_GT(actual_create_time, expected_create_time);
  ASSERT_LT(logger->GetLogFileSize(), total_log_size);
  expected_create_time = actual_create_time;

  return expected_create_time;
}

TEST(AutoRollLoggerTest, RollLogFileBySize) {
    InitTestDb();
    size_t log_max_size = 1024 * 5;

    AutoRollLogger logger(Env::Default(), kTestDir, "", log_max_size, 0);

    RollLogFileBySizeTest(&logger, log_max_size,
                          kSampleMessage + ":RollLogFileBySize");
}

TEST(AutoRollLoggerTest, RollLogFileByTime) {
    size_t time = 1;
    size_t log_size = 1024 * 5;

    InitTestDb();
    // -- Test the existence of file during the server restart.
    ASSERT_TRUE(!env->FileExists(kLogFile));
    AutoRollLogger logger(Env::Default(), kTestDir, "", log_size, 1);
    ASSERT_TRUE(env->FileExists(kLogFile));

    RollLogFileByTimeTest(&logger, time, kSampleMessage + ":RollLogFileByTime");
}

TEST(AutoRollLoggerTest,
     OpenLogFilesMultipleTimesWithOptionLog_max_size) {
  // If only 'log_max_size' options is specified, then every time
  // when rocksdb is restarted, a new empty log file will be created.
  InitTestDb();
  // WORKAROUND:
  // avoid complier's complaint of "comparison between signed
  // and unsigned integer expressions" because literal 0 is
  // treated as "singed".
  size_t kZero = 0;
  size_t log_size = 1024;

  AutoRollLogger* logger = new AutoRollLogger(
    Env::Default(), kTestDir, "", log_size, 0);

  LogMessage(logger, kSampleMessage.c_str());
  ASSERT_GT(logger->GetLogFileSize(), kZero);
  delete logger;

  // reopens the log file and an empty log file will be created.
  logger = new AutoRollLogger(
    Env::Default(), kTestDir, "", log_size, 0);
  ASSERT_EQ(logger->GetLogFileSize(), kZero);
  delete logger;
}

TEST(AutoRollLoggerTest, CompositeRollByTimeAndSizeLogger) {
  size_t time = 1, log_max_size = 1024 * 5;

  InitTestDb();

  AutoRollLogger logger(Env::Default(), kTestDir, "", log_max_size, time);

  // Test the ability to roll by size
  RollLogFileBySizeTest(
      &logger, log_max_size,
      kSampleMessage + ":CompositeRollByTimeAndSizeLogger");

  // Test the ability to roll by Time
  RollLogFileByTimeTest( &logger, time,
      kSampleMessage + ":CompositeRollByTimeAndSizeLogger");
}

TEST(AutoRollLoggerTest, CreateLoggerFromOptions) {
  DBOptions options;
  shared_ptr<Logger> logger;

  // Normal logger
  ASSERT_OK(CreateLoggerFromOptions(kTestDir, "", env, options, &logger));
  ASSERT_TRUE(dynamic_cast<PosixLogger*>(logger.get()));

  // Only roll by size
  InitTestDb();
  options.max_log_file_size = 1024;
  ASSERT_OK(CreateLoggerFromOptions(kTestDir, "", env, options, &logger));
  AutoRollLogger* auto_roll_logger =
    dynamic_cast<AutoRollLogger*>(logger.get());
  ASSERT_TRUE(auto_roll_logger);
  RollLogFileBySizeTest(
      auto_roll_logger, options.max_log_file_size,
      kSampleMessage + ":CreateLoggerFromOptions - size");

  // Only roll by Time
  InitTestDb();
  options.max_log_file_size = 0;
  options.log_file_time_to_roll = 1;
  ASSERT_OK(CreateLoggerFromOptions(kTestDir, "", env, options, &logger));
  auto_roll_logger =
    dynamic_cast<AutoRollLogger*>(logger.get());
  RollLogFileByTimeTest(
      auto_roll_logger, options.log_file_time_to_roll,
      kSampleMessage + ":CreateLoggerFromOptions - time");

  // roll by both Time and size
  InitTestDb();
  options.max_log_file_size = 1024 * 5;
  options.log_file_time_to_roll = 1;
  ASSERT_OK(CreateLoggerFromOptions(kTestDir, "", env, options, &logger));
  auto_roll_logger =
    dynamic_cast<AutoRollLogger*>(logger.get());
  RollLogFileBySizeTest(
      auto_roll_logger, options.max_log_file_size,
      kSampleMessage + ":CreateLoggerFromOptions - both");
  RollLogFileByTimeTest(
      auto_roll_logger, options.log_file_time_to_roll,
      kSampleMessage + ":CreateLoggerFromOptions - both");
}

TEST(AutoRollLoggerTest, InfoLogLevel) {
  InitTestDb();

  size_t log_size = 8192;
  size_t log_lines = 0;
  // an extra-scope to force the AutoRollLogger to flush the log file when it
  // becomes out of scope.
  {
    AutoRollLogger logger(Env::Default(), kTestDir, "", log_size, 0);
    for (int log_level = InfoLogLevel::FATAL_LEVEL;
         log_level >= InfoLogLevel::DEBUG_LEVEL; log_level--) {
      logger.SetInfoLogLevel((InfoLogLevel)log_level);
      for (int log_type = InfoLogLevel::DEBUG_LEVEL;
           log_type <= InfoLogLevel::FATAL_LEVEL; log_type++) {
        // log messages with log level smaller than log_level will not be
        // logged.
        LogMessage((InfoLogLevel)log_type, &logger, kSampleMessage.c_str());
      }
      log_lines += InfoLogLevel::FATAL_LEVEL - log_level + 1;
    }
    for (int log_level = InfoLogLevel::FATAL_LEVEL;
         log_level >= InfoLogLevel::DEBUG_LEVEL; log_level--) {
      logger.SetInfoLogLevel((InfoLogLevel)log_level);

      // again, messages with level smaller than log_level will not be logged.
      Debug(&logger, "%s", kSampleMessage.c_str());
      Info(&logger, "%s", kSampleMessage.c_str());
      Warn(&logger, "%s", kSampleMessage.c_str());
      Error(&logger, "%s", kSampleMessage.c_str());
      Fatal(&logger, "%s", kSampleMessage.c_str());
      log_lines += InfoLogLevel::FATAL_LEVEL - log_level + 1;
    }
  }
  std::ifstream inFile(AutoRollLoggerTest::kLogFile.c_str());
  size_t lines = std::count(std::istreambuf_iterator<char>(inFile),
                         std::istreambuf_iterator<char>(), '\n');
  ASSERT_EQ(log_lines, lines);
  inFile.close();
}

}  // namespace rocksdb

int main(int argc, char** argv) {
  return rocksdb::test::RunAllTests();
}


text:
(function() {
    "use strict";

    angular
        .module('app.myReservations')
        .controller('MyReservationsController', MyReservationsController);

    /* @ngInject */
    function MyReservationsController (reservationService) {
        var ctrl = this;
        ctrl.loading = false;

        activate();

        function activate() {
            ctrl.loading = true;
            return getMyReservations().then(function() {
                console.log('my reservations loaded');
                ctrl.loading = false;
            });
        }

        function getMyReservations() {
            return reservationService.getReservationsByOwner()
                .then(function(reservations) {
                    ctrl.emptyReservations = _.isEmpty(reservations);
                    ctrl.myReservations = reservations;
                    return ctrl.myReservations;
                });
        }

    }

})();


text:
from __future__ import unicode_literals

from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [
        ('telesurvideos', '0009_auto_20170112_0837'),
    ]

    operations = [
        migrations.AddField(
            model_name='programalistpluginmodel',
            name='mostrar_descripciones',
            field=models.BooleanField(default=True, verbose_name='mostrar descripciones'),
        ),
        migrations.AddField(
            model_name='programalistpluginmodel',
            name='mostrar_titulos',
            field=models.BooleanField(default=True, verbose_name='mostrar t\xedtulos'),
        ),
        migrations.AlterField(
            model_name='programalistpluginmodel',
            name='mostrar_horarios',
            field=models.BooleanField(default=False, verbose_name='mostrar horarios'),
        ),
        migrations.AlterField(
            model_name='videolistpluginmodel',
            name='mostrar_banner',
            field=models.BooleanField(default=False, help_text='Mostrar encabezado con banner de programa correspondiente al primer video', verbose_name='mostrar banner'),
        ),
    ]


text:
+++
title = "Oaxacan Green"
description = "Wüchsig und ertragreich"
weight = 1
tags = [ "Zahnmais" ]
image = "oaxacan-green-1.jpg"

[intro]
  text = '''
**Oaxacan Green** ist eine wüchsige und robuste Sorte, die im Frühling bisher weder Kältestress- noch Mangelsymptome zeigte.

In einer Erhebung im Jahr 2013 (Meyer, 2013) waren die Pflanzen durchschnittlich 250 cm hoch und produzierten knapp 2 Kolben pro Pflanze. Der Stängeldurchmesser betrug durchschnittlich 1.83 cm.

Die Sorte wuchs und blühte einheitlich und benötigte 1550 Gradtage von der Saat bis zur Reife. Davon entfielen 950 Gradtage bis zur Blüte. Damit ist sie vergleichbar mit einer mittelfrühen Silomaissorte der offiziellen Sortenliste.

Typisch für die Sorte ist die Bestockung der Pflanzen. Hat sie Raum, so entwickeln sich bis zu drei Triebe pro Pflanze, die auch einen Kolbenertrag abliefern können.

Die grün gefärbten Kolben können kurz und breit oder lang und etwas schmaler sein und besitzen meist 12 oder 14 Körnerreihen. Die Körner zeigen meist die typische Eindellung des Zahnmais.
'''
  [[intro.gallery]]
    url = "oaxacan-green-1.jpg"
    url_small = "oaxacan-green-1-small.jpg"
    url_large = "oaxacan-green-1-large.jpg"
    caption = "Oaxacan Green"

  [[intro.gallery]]
    url = "oaxacan-green-2.jpg"
    url_small = "oaxacan-green-2-small.jpg"
    url_large = "oaxacan-green-2-large.jpg"
    caption = "Oaxacan Green 2"

  [[intro.gallery]]
    url = "oaxacan-green-3.jpg"
    url_small = "oaxacan-green-3-small.jpg"
    url_large = "oaxacan-green-3-large.jpg"
    caption = "Oaxacan Green 3"

  [[intro.gallery]]
    url = "oaxacan-green-4.jpg"
    url_small = "oaxacan-green-4-small.jpg"
    url_large = "oaxacan-green-4-large.jpg"
    caption = "Oaxacan Green 4"

[herkunft]
  text = '''
Das bei *Landmais.ch* angebaute Saatgut wurde im Jahr 2011 über [freie-saaten.org](http://www.freie-saaten.org/) erworben. In den bisherigen Anbaujahren wurden jeweils die schönsten Kolben ausselektiert und neu als Saatgut verwendet. Aufgrund des Namens wird der Ursprung in der mexikanischen Region Oaxacan gesehen. Die Sorte ist weltweit bekannt und das Saatgut ist in kleinen Mengen gut erhältlich.
'''
  [herkunft.image]
    url = "koerner-makro.jpg"
    url_large = "koerner-makro-large.jpg"
    caption = "Körner Makro"

[anbau]
  text = '''
Oaxacan Green wird von *Landmais.ch* bereits seit 2011 angebaut. Die Sorte wächst problemlos. Wichtig ist eine rechteckige oder runde Anordnung, damit die Befruchtung gewährleistet ist.

In der Landwirtschaft wird mit einem Reihenabstand von 75cm und einem Pflanzabstand von ca. 12-14cm gesät. Alternativ kann der Reihenabstand auch 50cm und der Pflanzenabstand 18-20cm betragen.

Ebenfalls gut möglich ist der Anbau zusammen mit Stangenbohnen und/oder Kürbis. Dieser Mischanbau wird Milpa genannt. Hier müssen die Pflanzabstände grösser gewählt und die Bohnen erst ein paar Wochen nach dem Mais gepflanzt werden, damit die Maispflanzen nicht überwuchert werden.
'''
  [anbau.image]
    url = "anbau-parzellenbeispiel.png"
    url_large = "anbau-parzellenbeispiel.png"
    caption = "Anbau"

[geschichte]
  content = '''
Die Sorte Oaxacan Green stammt angeblich aus der Provinz Oaxacan im südlichen Mexico (siehe [Seed Savers](http://www.seedsavers.org/onlinestore/corn/Corn-Oaxacan-Green-Dent.html)). Sie soll seit hunderten von Jahre von den dort sesshaften Zapoteken angebaut worden sein, um damit Tortillas und Tamales aus dem grünen Mehl herzustellen. Genaue Informationen konnten jedoch bisher nicht gefunden werden.
'''

[verwendung]
  text = '''
Die Kolben müssen nach der Ernte noch getrocknet werden, bis sie maximal 14% Wasser enthalten (86% TS). Die grünen Körner können grob gemahlen zu Bramatagriess verarbeitet werden. Mit einem Sieb kann der Mehlanteil noch etwas reduziert werden. Ein grünes Polentagriess ist nicht nur gesund, sondern sieht auch gut aus. Propieren Sie's aus!

Die Zapoteken verwendeten das grüne Mehl für die Herstellung von Tamales (Tortillas mit einer Füllung, die mit Pflanzenblättern umwickelt gekocht werden.
'''
  [verwendung.image]
    url = "koerner-querschnitt.jpg"
    url_large = "koerner-querschnitt-large.jpg"
    caption = "Oaxacan Green Körnerquerschnitt"

[[quellen]]
  text = '''
**Meyer** P, 2013, Landmais-Erhaltenszüchtung – Beobachtung und Auswahl von geeigneten Landmaissorten für einen Ertragsvergleich mit Hybridmais. HAFL, Zollikofen, 40 S.
'''

+++


text:
'use strict';

module.exports = {
  db: 'mongodb://localhost/mean-dev',
  debug: true,
//  aggregate: 'whatever that is not false, because boolean false value turns aggregation off', //false
  aggregate: true,
  mongoose: {
    debug: false
  },
  app: {
    name: 'MEAN - FullStack JS - Development'
  },
  facebook: {
    clientID: 'DEFAULT_APP_ID',
    clientSecret: 'APP_SECRET',
    callbackURL: 'http://localhost:3000/auth/facebook/callback'
  },
  twitter: {
    clientID: 'DEFAULT_CONSUMER_KEY',
    clientSecret: 'CONSUMER_SECRET',
    callbackURL: 'http://localhost:3000/auth/twitter/callback'
  },
  github: {
    clientID: 'DEFAULT_APP_ID',
    clientSecret: 'APP_SECRET',
    callbackURL: 'http://localhost:3000/auth/github/callback'
  },
  google: {
    clientID: 'DEFAULT_APP_ID',
    clientSecret: 'APP_SECRET',
    callbackURL: 'http://localhost:3000/auth/google/callback'
  },
  linkedin: {
    clientID: 'DEFAULT_API_KEY',
    clientSecret: 'SECRET_KEY',
    callbackURL: 'http://localhost:3000/auth/linkedin/callback'
  },
  emailFrom: 'meandrywall@gmail.com', // sender address like ABC <abc@example.com>
  mailer: {
    service: 'Gmail', // Gmail, SMTP
    auth: {
      user: 'meandrywall',
      pass: 'rap12par'
    }
  }
};


text:
package biz;

import java.math.BigDecimal;

import android.os.Bundle;
import android.util.Log;

public class CmdSubtract extends iCmd {
	private static final String TAG = "test";
	private BigDecimal a;
	private BigDecimal b;

	public CmdSubtract(BigDecimal a, BigDecimal b) {
		this.a = a;
		this.b = b;
	}

	@Override
	public Bundle exe() throws Exception {
		Log.i(TAG, this + ", exe, tid=" + Thread.currentThread().getId());
		Thread.sleep(10000);// demo for long operation
		Bundle bundle = new Bundle();
		bundle.putString("result", a.subtract(b).toString());
		// throw new Exception("");// for test
		return bundle;
	}

}


text:
namespace Microsoft.AspNetCore.Localization;

/// <summary>
/// Represents the feature that provides the current request's culture information.
/// </summary>
public interface IRequestCultureFeature
{
    /// <summary>
    /// The <see cref="Localization.RequestCulture"/> of the request.
    /// </summary>
    RequestCulture RequestCulture { get; }

    /// <summary>
    /// The <see cref="IRequestCultureProvider"/> that determined the request's culture information.
    /// If the value is <c>null</c> then no provider was used and the request's culture was set to the value of
    /// <see cref="Builder.RequestLocalizationOptions.DefaultRequestCulture"/>.
    /// </summary>
    IRequestCultureProvider? Provider { get; }
}


text:
using System;
using System.Windows;
using System.Windows.Controls;
using Autodesk.Revit.DB;
using Autodesk.Revit.DB.ExtensibleStorage;
using Autodesk.Revit.UI;

namespace ExtensibleStorageManager
{
   /// <summary>
   /// The main user dialog class for issuing sample commands to the a SchemaWrapper
   /// </summary>
   public partial class UICommand : Window
   {
      #region Constructor
      /// <summary>
      /// Create a new dialog object and store a reference to the active document and applicationID of this addin.
      /// </summary>
      public UICommand(Autodesk.Revit.DB.Document doc, string applicationId)
      {

         InitializeComponent();
         this.Closing += new System.ComponentModel.CancelEventHandler(UICommand_Closing);
         m_Document = doc;

         //Create a new empty schemaWrapper.
         m_SchemaWrapper = SchemaWrapperTools.SchemaWrapper.NewSchema(Guid.Empty, Autodesk.Revit.DB.ExtensibleStorage.AccessLevel.Public, Autodesk.Revit.DB.ExtensibleStorage.AccessLevel.Public, "adsk", applicationId, "schemaName", "Schema documentation");
         this.m_label_applicationAppId.Content = applicationId;
         UpdateUI();
      }
      #endregion

      #region Helper methods
      /// <summary>
      /// Return a convenient recommended path to save schema files in.
      /// </summary>
      private string GetStartingXmlPath()
      {
         string currentAssemby = System.Reflection.Assembly.GetAssembly(this.GetType()).Location;
         return System.IO.Path.Combine(System.IO.Path.GetDirectoryName(currentAssemby), "schemas");

      }

      /// <summary>
      /// Synchronize all UI controls in the dialog with the data in m_SchemaWrapper.
      /// </summary>
      private void UpdateUI()
      {

         this.m_textBox_SchemaApplicationId.Text = m_SchemaWrapper.Data.ApplicationId;
         this.m_textBox_SchemaVendorId.Text = m_SchemaWrapper.Data.VendorId;
         this.m_textBox_SchemaPath.Content = m_SchemaWrapper.GetXmlPath();
         this.m_textBox_SchemaName.Text = m_SchemaWrapper.Data.Name;
         this.m_textBox_SchemaDocumentation.Text = m_SchemaWrapper.Data.Documentation;
         this.m_textBox_SchemaId.Text = m_SchemaWrapper.Data.SchemaId;
         if (this.m_textBox_SchemaId.Text == Guid.Empty.ToString())
            this.m_textBox_SchemaId.Text = Application.LastGuid;

         switch (m_SchemaWrapper.Data.ReadAccess)
         {
            case AccessLevel.Application:
               {
                  m_rb_ReadAccess_Application.IsChecked = true;
                  break;
               }
            case AccessLevel.Public:
               {
                  m_rb_ReadAccess_Public.IsChecked = true;
                  break;
               }
            case AccessLevel.Vendor:
               {
                  m_rb_ReadAccess_Vendor.IsChecked = true;
                  break;
               }
         }

         switch (m_SchemaWrapper.Data.WriteAccess)
         {
            case AccessLevel.Application:
               {
                  m_rb_WriteAccess_Application.IsChecked = true;
                  break;
               }
            case AccessLevel.Public:
               {
                  m_rb_WriteAccess_Public.IsChecked = true;
                  break;
               }
            case AccessLevel.Vendor:
               {
                  m_rb_WriteAccess_Vendor.IsChecked = true;
                  break;
               }
         }
      }

      /// <summary>
      /// Retrieve AccessLevel enums for read and write permissions from the UI
      /// </summary>
      private void GetUIAccessLevels(out AccessLevel read, out AccessLevel write)
      {
         read = AccessLevel.Public;
         write = AccessLevel.Public;

         if (m_rb_ReadAccess_Application.IsChecked == true)
            read = AccessLevel.Application;
         else if (m_rb_ReadAccess_Public.IsChecked  == true)
            read = AccessLevel.Public;
         else
            read = AccessLevel.Vendor;

         if (m_rb_WriteAccess_Application.IsChecked == true)
            write = AccessLevel.Application;
         else if (m_rb_WriteAccess_Public.IsChecked == true)
            write = AccessLevel.Public;
         else
            write = AccessLevel.Vendor;

      }

      /// <summary>
      /// Ensure that the values in the two text fields in the dialogs meant for Guids evaluate
      /// to valid Guids.
      /// </summary>
      private bool ValidateGuids()
      {
         bool retval = true;
         try
         {
            Guid schemaId = new Guid(this.m_textBox_SchemaId.Text);
            Guid applicationId = new Guid(this.m_textBox_SchemaApplicationId.Text);
         }
         catch (Exception)
         {
            retval = false;
         }

         return retval;
      }
      #endregion

      #region UI Handlers

      //Store the Guid of the last-used schema in the Application object for convenient access
      //later if the user re-creates and displays this dialog again.
      void UICommand_Closing(object sender, System.ComponentModel.CancelEventArgs e)
      {
         Application.LastGuid = m_textBox_SchemaId.Text;
      }

      //Put a new, arbitrary Guid in the schema text box.
      private void m_button_NewSchemaId_Click(object sender, RoutedEventArgs e)
      {
         m_textBox_SchemaId.Text = StorageCommand.NewGuid().ToString();
      }

      /// <summary>
      /// Handler for the "Create a simple schema" button.
      /// </summary>
      private void m_button_CreateSetSaveSimple_Click(object sender, RoutedEventArgs e)
      {
         CreateSetSave(SampleSchemaComplexity.SimpleExample);
      }

      /// <summary>
      /// Handler for the "Create a complex schema" button.
      /// </summary>
      private void m_button_CreateSetSaveComplex_Click(object sender, RoutedEventArgs e)
      {
         CreateSetSave(SampleSchemaComplexity.ComplexExample);
      }

      /// <summary>
      /// Creates a sample schema, populates it with sample data, and saves it to an XML file
      /// </summary>
      /// <param name="schemaComplexity">The example schema to create</param>
      private void CreateSetSave(SampleSchemaComplexity schemaComplexity)
      {

         //Get read-write access levels and schema and application Ids from the active dialog
         AccessLevel read;
         AccessLevel write;
         GetUIAccessLevels(out read, out write);
         if (!ValidateGuids())
         {
            TaskDialog.Show("ExtensibleStorage Manager", "Invalid Schema or ApplicationId Guid.");
            return;
         }

         //Get a pathname for an XML file from the user.
         Microsoft.Win32.SaveFileDialog sfd = new Microsoft.Win32.SaveFileDialog();
         sfd.DefaultExt = ".xml";
         sfd.Filter = "SchemaWrapper Xml files (*.xml)|*.xml";
         sfd.InitialDirectory = GetStartingXmlPath();

         sfd.FileName = this.m_textBox_SchemaName.Text + "_" + this.m_textBox_SchemaVendorId.Text + "___" + this.m_textBox_SchemaId.Text.Substring(31) + ".xml";

         Nullable<bool> result = sfd.ShowDialog();

         if ((result.HasValue) && (result == true))
         {
            try
            {
               //Create a new sample SchemaWrapper, schema, and Entity and store it in the current document's ProjectInformation element.
               m_SchemaWrapper = StorageCommand.CreateSetAndExport(m_Document.ProjectInformation, sfd.FileName, new Guid(this.m_textBox_SchemaId.Text), read, write, this.m_textBox_SchemaVendorId.Text, this.m_textBox_SchemaApplicationId.Text, this.m_textBox_SchemaName.Text, this.m_textBox_SchemaDocumentation.Text, schemaComplexity);
            }
            catch (Exception ex)
            {
               TaskDialog.Show("ExtensibleStorage Manager", "Could not Create Schema.  " + ex.ToString());
               return;
            }

            UpdateUI();

            //Display the schema fields and sample data we just created in a dialog.
            ExtensibleStorageManager.UIData dataDialog = new ExtensibleStorageManager.UIData();
            string schemaData = this.m_SchemaWrapper.ToString();
            string entityData = this.m_SchemaWrapper.GetSchemaEntityData(m_Document.ProjectInformation.GetEntity(m_SchemaWrapper.GetSchema()));
            string allData = "Schema: " + Environment.NewLine + schemaData + Environment.NewLine + Environment.NewLine + "Entity" + Environment.NewLine + entityData;
            dataDialog.SetData(allData);
            dataDialog.ShowDialog();
         }
      }

      /// <summary>
      /// Handler for the "Create Wrapper from Schema" button
      /// </summary>
      private void m_button_CreateWrapperFromSchema_Click(object sender, RoutedEventArgs e)
      {
         try
         {
            //Given a Guid that corresponds to a schema that already exists in a document, create a SchemaWrapper
            //from it and display its top-level data in the dialog.
            StorageCommand.CreateWrapperFromSchema(new Guid(m_textBox_SchemaId.Text), out m_SchemaWrapper);
            UpdateUI();
         }

         catch (Exception ex)
         {
            TaskDialog.Show("ExtensibleStorage Manager", "Could not Create SchemaWrapper from Schema.  " + ex.ToString());
            return;
         }
         //Display all of the schema's field data in a separate dialog.
         ExtensibleStorageManager.UIData dataDialog = new ExtensibleStorageManager.UIData();
         dataDialog.SetData(m_SchemaWrapper.ToString());
         dataDialog.ShowDialog();
      }

      /// <summary>
      /// Handler for the "Look up and extract" button
      /// </summary>
      private void m_button_LookupExtract_Click(object sender, RoutedEventArgs e)
      {
         try
         {
            //Given a Guid that corresponds to a schema that already exists in a document, create a SchemaWrapper
            //from it and display its top-level data in the dialog.
            StorageCommand.LookupAndExtractData(m_Document.ProjectInformation, new Guid(m_textBox_SchemaId.Text), out m_SchemaWrapper);
         }
         catch (Exception ex)
         {
            TaskDialog.Show("ExtensibleStorage Manager", "Could not extract data from Schema.  " + ex.ToString());
            return;
         }
         UpdateUI();
         ExtensibleStorageManager.UIData dataDialog = new ExtensibleStorageManager.UIData();

         //Get and display the schema field data and the actual entity data in a separate dialog.
         string schemaData = this.m_SchemaWrapper.ToString();
         string entityData = this.m_SchemaWrapper.GetSchemaEntityData(m_Document.ProjectInformation.GetEntity(m_SchemaWrapper.GetSchema()));
         string allData = "Schema: " + Environment.NewLine + schemaData + Environment.NewLine + Environment.NewLine + "Entity" + Environment.NewLine + entityData;

         dataDialog.SetData(allData);
         dataDialog.ShowDialog();
      }

      /// <summary>
      /// Handler for the "Create Schema from XML" button
      /// </summary>
      private void m_button_CreateSchemaFromXml_Click(object sender, RoutedEventArgs e)
      {

         //Prompt the user for an xml file containing a serialized schema.
         Microsoft.Win32.OpenFileDialog ofd = new Microsoft.Win32.OpenFileDialog();
         ofd.InitialDirectory = GetStartingXmlPath();
         ofd.DefaultExt = ".xml";
         ofd.Filter = "SchemaWrapper Xml files (*.xml)|*.xml";
         Nullable<bool> result = ofd.ShowDialog();

         if (( result.HasValue) && (result == true))
         {
            try
            {
               //Given an xml file containing schema data, create a new SchemaWrapper object
               StorageCommand.ImportSchemaFromXml(ofd.FileName, out m_SchemaWrapper);
            }

            catch (Exception ex)
            {
               TaskDialog.Show("ExtensibleStorage Manager", "Could not import Schema from Xml.  " + ex.ToString());
               return;
            }
            //Display the top level schema data in the dialog.
            UpdateUI();

            //Display the field data of the schema in a separate dialog.
            ExtensibleStorageManager.UIData dataDialog = new ExtensibleStorageManager.UIData();
            dataDialog.SetData(m_SchemaWrapper.ToString());
            dataDialog.ShowDialog();
         }
      }

      /// <summary>
      /// Handler for the "Edit Exisiting Data" button
      /// </summary>
      private void m_button_EditExistingSimple_Click(object sender, RoutedEventArgs e)
      {
         try
         {
            ///Given a guid corresponding to a Schema with Entity data in the current document's ProjectInformation element,
            ///change the entity data to new data, (assuming that the schemas and schema guids are identical).
            StorageCommand.EditExistingData(m_Document.ProjectInformation, new Guid(m_textBox_SchemaId.Text), out m_SchemaWrapper);
         }
         catch (Exception ex)
         {
            TaskDialog.Show("ExtensibleStorage Manager", "Could not extract data from Schema.  " + ex.ToString());
            return;
         }

         UpdateUI();

         ///Display the schema fields and new data in a separate dialog.
         ExtensibleStorageManager.UIData dataDialog = new ExtensibleStorageManager.UIData();
         string schemaData = this.m_SchemaWrapper.ToString();
         string entityData = this.m_SchemaWrapper.GetSchemaEntityData(m_Document.ProjectInformation.GetEntity(m_SchemaWrapper.GetSchema()));
         string allData = "Schema: " + Environment.NewLine + schemaData + Environment.NewLine + Environment.NewLine + "Entity" + Environment.NewLine + entityData;

         dataDialog.SetData(allData);
         dataDialog.ShowDialog();
      }
      #endregion

      #region Properties
      /// <summary>
      /// The active document in Revit that the dialog queries for Schema and Entity data.
      /// </summary>
      public Autodesk.Revit.DB.Document Document
      {
         get { return m_Document; }
         set { m_Document = value; }
      }
      #endregion

      #region Data
      /// <summary>
      /// The object that provides high level serialization access to an Autodesk.Revit.DB.ExtensibleStorage.Schema
      /// </summary>
      private SchemaWrapperTools.SchemaWrapper m_SchemaWrapper;
      private Autodesk.Revit.DB.Document m_Document;
      #endregion

   }
}


text:
package org.panda.lists

import org.scalatest._
import org.scalacheck.Gen
import org.scalatest.prop.PropertyChecks
import org.panda.tags._

class ListsTests extends FreeSpec with Matchers with PropertyChecks {
    "Lists.tail should" - {
        "match the behaviour of the scala.collections.List.tail" taggedAs(Slow) in {
            forAll (Gen.nonEmptyListOf(Gen.posNum[Int])) { list =>
                Lists.tail(list) shouldEqual list.tail
            }
        }

        "return Nil when passed an empty list" in {
            Lists.tail(Nil) shouldBe Nil
        }
    }

    "Lists.drop should" - {
        "match the behaviour of the scala.collections.List.drop" taggedAs(Slow) in {
            forAll (Gen.nonEmptyListOf(Gen.posNum[Int]), Gen.posNum[Int]) { (list, n) =>
                Lists.drop(n, list) shouldEqual list.drop(n)
            }
        }

        "return Nil when passed an empty list" in {
            forAll { n: Int =>
                Lists.drop(n, Nil) shouldBe Nil
            }
        }
    }

    "Lists.init should" - {
        "match the behaviour of the scala.collections.List.dropRight" in {
            forAll { list: List[Int] =>
                whenever(list.size > 2) {
                    Lists.init(list) shouldEqual list.dropRight(1)
                }
            }
        }

        val nilCases = {
            for {
                x       <- Gen.posNum[Int]
                list    <- Gen.oneOf(Nil, List(x))
            } yield list
        }

        "return Nil when passed empty lists and lists with only a single element" in {
            forAll (nilCases) { list: List[Int] => Lists.init(list) shouldBe Nil }
        }
    }
}


text:
<?php
/**
 * Created by PhpStorm.
 * User: arnaud
 * Date: 04/11/15
 * Time: 20:53
 */

namespace Ndrx\Profiler\Components;

use Ndrx\Profiler\Events\DispatcherAwareInterface;
use Ndrx\Profiler\Events\DispatcherAwareTrait;
use Ndrx\Profiler\Events\Timeline\End;
use Ndrx\Profiler\Events\Timeline\Start;
use Symfony\Component\EventDispatcher\EventDispatcher;

class Timeline implements DispatcherAwareInterface
{
    use DispatcherAwareTrait;

    /**
     * @param EventDispatcher $eventDispatcher
     */
    public function __construct(EventDispatcher $eventDispatcher)
    {
        $this->dispatcher = $eventDispatcher;
    }

    /**
     * Start item for the timeline
     *
     * @param $key
     * @param $label
     * @param null $data
     * @param null $timetamp
     */
    public function start($key, $label, $data = null, $timetamp = null)
    {
        $event = new Start($key, $label, $data, $timetamp);
        $this->dispatcher->dispatch(Start::EVENT_NAME, $event);
    }

    /**
     * End item for the timeline
     *
     * @param $key
     * @param null $timetamp
     */
    public function stop($key, $timetamp = null)
    {
        $event = new End($key, $timetamp);
        $this->dispatcher->dispatch(End::EVENT_NAME, $event);
    }

    /**
     * @param $label
     * @param \Closure $closure
     * @return mixed
     */
    public function monitor($label, \Closure $closure)
    {
        $key = uniqid();
        $this->start($key, $label);
        $result = $closure();
        $this->start($key, $label);

        return $result;
    }
}


text:
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE NoRebindableSyntax #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE StandaloneDeriving #-}

module Duckling.Types where

import Control.DeepSeq
import Data.Aeson
import qualified Data.ByteString.Lazy as LB
import Data.GADT.Compare
import Data.Hashable
import Data.Maybe
import Data.String
import Data.Text (Text)
import qualified Data.Text.Encoding as Text
import Data.Typeable ((:~:)(Refl), Typeable)
import GHC.Generics
import Prelude
import qualified Text.Regex.Base as R
import qualified Text.Regex.PCRE as PCRE

import Duckling.Dimensions.Types
import Duckling.Resolve

-- -----------------------------------------------------------------
-- Token

data Token = forall a . (Resolve a, Eq a, Hashable a, Show a, NFData a) =>
  Token (Dimension a) a

deriving instance Show Token
instance Eq Token where
  Token d1 v1 == Token d2 v2 = case geq d1 d2 of
    Just Refl -> v1 == v2
    Nothing   -> False

instance Hashable Token where
  hashWithSalt s (Token dim v) = hashWithSalt s (dim, v)

instance NFData Token where
  rnf (Token _ v) = rnf v

isDimension :: Dimension a -> Token -> Bool
isDimension dim (Token dim' _) = isJust $ geq dim dim'

data Node = Node
  { nodeRange :: Range
  , token     :: Token
  , children  :: [Node]
  , rule      :: Maybe Text
  } deriving (Eq, Generic, Hashable, Show, NFData)

data ResolvedToken = Resolved
  { range :: Range
  , node :: Node
  , jsonValue :: Value
  } deriving (Eq, Show)

instance Ord ResolvedToken where
  compare (Resolved range1 _ json1) (Resolved range2 _ json2) =
    case compare range1 range2 of
      EQ -> compare (toJText json1) (toJText json2)
      z  -> z

data Candidate = Candidate ResolvedToken Double Bool
  deriving (Eq, Show)

instance Ord Candidate where
  compare (Candidate (Resolved{range = Range s1 e1, node = Node{token = Token d1 _}}) score1 t1)
          (Candidate (Resolved{range = Range s2 e2, node = Node{token = tok2}}) score2 t2)
    | isDimension d1 tok2 = case starts of
        EQ -> case ends of
          EQ -> compare score1 score2
          z -> z
        LT -> case ends of
          LT -> EQ
          _ -> GT
        GT -> case ends of
          GT -> EQ
          _ -> LT
    | t1 == t2 = compRange
    | t1 && compRange == GT = GT
    | t2 && compRange == LT = LT
    | otherwise = EQ
      where
        starts = compare s1 s2
        ends = compare e1 e2
        -- a > b if a recovers b
        compRange = case starts of
          EQ -> ends
          LT -> case ends of
            LT -> EQ
            _  -> GT
          GT -> case ends of
            GT -> EQ
            _  -> LT

data Range = Range Int Int
  deriving (Eq, Ord, Generic, Hashable, Show, NFData)

type Production = [Token] -> Maybe Token
type Predicate = Token -> Bool
data PatternItem = Regex PCRE.Regex | Predicate Predicate

type Pattern = [PatternItem]

data Rule = Rule
  { name :: Text
  , pattern :: Pattern
  , prod :: Production
  }

instance Show Rule where
  show (Rule name _ _) = show name

data Entity = Entity
  { dim   :: Text
  , body  :: Text
  , value :: Text
  , start :: Int
  , end   :: Int
  } deriving (Eq, Generic, Show, NFData)

instance ToJSON Entity where
  toEncoding = genericToEncoding defaultOptions

toJText :: ToJSON x => x -> Text
toJText j = Text.decodeUtf8 $ LB.toStrict $ encode j

-- -----------------------------------------------------------------
-- Predicates helpers

regex :: String -> PatternItem
regex = Regex . R.makeRegexOpts compOpts execOpts
  where
    compOpts = PCRE.defaultCompOpt + PCRE.compCaseless
    execOpts = PCRE.defaultExecOpt

dimension :: Typeable a => Dimension a -> PatternItem
dimension value = Predicate $ isDimension value


text:
local drpath = require("directories")
      drpath.addPath("myprograms",
                  "ZeroBraineProjects",
                  "CorporateProjects",
                  -- When not located in general directory search in projects
                  "ZeroBraineProjects/dvdlualib",
                  "ZeroBraineProjects/ExtractWireWiki")
      drpath.addBase("D:/LuaIDE").setBase(1)

local wikilib = require("dvdlualib/wikilib")

local bPreview = true
local sTubePat = "https://www%.youtube%.com/watch%?v="

local f = assert(io.open("ExtractWireWiki/in/you-links.txt"))
if(f) then
  local sRow, iRow = f:read("*line"), 0
  while(sRow) do iRow = iRow + 1
    if(sRow:find("google") and wikilib.isEncodedURL(sRow)) then
      sRow = wikilib.getDecodeURL(sRow)
      local s, e = sRow:find(sTubePat)
      sRow = sRow:sub(1,1)..sRow:sub(s, e + 11)
    end
    -----------------------------------------
    sRow = sRow:gsub(sTubePat, "/")
    tab = wikilib.common.stringExplode(sRow, "/")
    if(tab[2]) then
      if(bPreview) then
        print("aaa", tab[1], tab[2].."  ")
        for iD = 1, 3 do print(wikilib.insYoutubeVideo(tab[2], iD)) end
      else local sOut = wikilib.insYoutubeVideo(tab[2], tab[1])
        print(((iRow % 3) == 0) and sOut.."  " or sOut)
      end
    else
      print(sRow)
    end
    -----------------------------------------
    sRow = f:read("*line")
  end
end

--[[

[![](http://img.youtube.com/vi/1rsDHU79J50/3.jpg)](http://www.youtube.com/watch?v=1rsDHU79J50 "." ---

]]


text:
using System.Data.Entity;

namespace Simple.OData.ProductService.Models
{
    public class ProductServiceContext : DbContext
    {
        // You can add custom code to this file. Changes will not be overwritten.
        //
        // If you want Entity Framework to drop and regenerate your database
        // automatically whenever you change your model schema, please use data migrations.
        // For more information refer to the documentation:
        // http://msdn.microsoft.com/en-us/data/jj591621.aspx

        public ProductServiceContext()
            : base("name=DefaultConnection")
        {
        }

        public System.Data.Entity.DbSet<Product> Products { get; set; }
        public System.Data.Entity.DbSet<WorkTaskModel> WorkTaskModels { get; set; }
        public System.Data.Entity.DbSet<WorkTaskAttachmentModel> WorkTaskAttachmentModels { get; set; }
        public System.Data.Entity.DbSet<WorkActivityReportModel> WorkActivityReportModels { get; set; }

    }
}


text:
namespace Umbraco.Cms.Infrastructure.Persistence
{
    public interface IDatabaseCreator
    {
        string ProviderName { get; }

        void Create(string connectionString);
    }
}


text:
'use strict';

/**
* Exponential distribution cumulative distribution function (CDF).
*
* @module @stdlib/stats/base/dists/exponential/cdf
*
* @example
* var cdf = require( '@stdlib/stats/base/dists/exponential/cdf' );
*
* var y = cdf( 2.0, 0.1 );
* // returns ~0.181
*
* var myCDF = cdf.factory( 0.5 );
* y = myCDF( 3.0 );
* // returns ~0.777
*/

// MODULES //

var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
var main = require( './main.js' );
var factory = require( './factory.js' );

// MAIN //

setReadOnly( main, 'factory', factory );

// EXPORTS //

module.exports = main;


text:
{namespace bp = BK2K\BootstrapPackage\ViewHelpers}
<bp:dataRelation uid="{data.uid}" table="tx_bootstrappackage_carousel_item">
	<f:if condition="{items}">
		<bp:flexForm/>

				<f:for each="{items}" as="item" iteration="iteration">
					<bp:var name="itemStyleImage">
						<bp:fal data="{item}" as="images" field="background_image"
								table="tx_bootstrappackage_carousel_item">
							<f:if condition="{images}">
								<bp:var name="backgroundImagePath"
										value="{f:uri.image(src:'{images.0.uid}',treatIdAsReference: 1)}"/>
								background-image: url('{backgroundImagePath}');
								filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='.{backgroundImagePath}',
								sizingMethod='scale');
								-ms-filter:
								"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='{backgroundImagePath}',
								sizingMethod='scale')";
							</f:if>
						</bp:fal>
					</bp:var>
					<bp:var name="itemStyleColor">
						<f:if condition="{item.background_color}">background-color: {item.background_color};</f:if>
					</bp:var>

						<f:switch expression="{item.item_type}">
							<f:case value="header">
								<f:link.page pageUid="{item.link}">
									<f:render partial="Carousel/Item/Header" arguments="{_all}"/>
								</f:link.page>
							</f:case>
							<f:case value="textandimage">
								<f:link.page pageUid="{item.link}">
									<f:render partial="Carousel/Item/TextAndImage" arguments="{_all}"/>
								</f:link.page>
							</f:case>
							<f:case value="html">{item.bodytext->f:format.raw()}</f:case>
						</f:switch>

				</f:for>

			<f:if condition="{items -> f:count()} > 1">

					<f:for each="{items}" as="item" iteration="iteration">

					</f:for>

				<f:link.page class="left carousel-control" additionalAttributes="{data-slide: 'prev', role: 'button'}"
							 section="carousel-{data.uid}">

					{f:translate(key: 'previous', extensionName: 'bootstrap_package')}
				</f:link.page>
				<f:link.page class="right carousel-control" additionalAttributes="{data-slide: 'next', role: 'button'}"
							 section="carousel-{data.uid}">

					{f:translate(key: 'next', extensionName: 'bootstrap_package')}
				</f:link.page>
			</f:if>

	</f:if>
</bp:dataRelation>


text:
'use strict';

// FUNCTIONS //

var Assessment = require( './../index.js' );

// CREATE SEQUENCE //

/**
* FUNCTION: createSequence( qa )
*	Create a sequence of nodes for the supplied qality object.
*
* @param {Object} qa - qality object
* @returns {Void}
*/
function createSequence( qa ) {
	/* jshint validthis:true */
	var self = this,
		temp = qa.sequence,
		no;
	// self.evaluation = qa.evaluation;
	self.evaluation.sorted		= qa.evaluation.sorted;
	self.evaluation.ranges		= qa.evaluation.ranges;
	self.evaluation.seperator = qa.evaluation.seperator;
	self.repaint_evaluation_form();

	for ( var i = 0; i < temp.nodes.length; i++ ) {
		switch( temp.nodes[i].type ) {
		case "multiple_choice":
			no = self.sequence.nodes.length;
			self.sequence.nodes.push( new Assessment.MultipleChoice(self.sequence.nodes.length) );
			self.sequence.nodes[no].right_value     = temp.nodes[i].right_value;
			self.sequence.nodes[no].question        = temp.nodes[i].question;
			self.sequence.nodes[no].transition_in   = temp.nodes[i].transition_in;
			self.sequence.nodes[no].transition_out  = temp.nodes[i].transition_out;
			self.sequence.nodes[no].duration        = temp.nodes[i].duration;
			self.sequence.nodes[no].answers         = temp.nodes[i].answers;
		break;
		case "input":
			no = self.sequence.nodes.length;
			self.sequence.nodes.push( new Assessment.Input(self.sequence.nodes.length) );
			self.sequence.nodes[no].right_answer    = temp.nodes[i].right_answer;
			self.sequence.nodes[no].question        = temp.nodes[i].question;
			self.sequence.nodes[no].transition_in   = temp.nodes[i].transition_in;
			self.sequence.nodes[no].transition_out  = temp.nodes[i].transition_out;
			self.sequence.nodes[no].duration        = temp.nodes[i].duration;
			self.sequence.nodes[no].points           = temp.nodes[i].points;
		break;
		}
	}
} // end FUNCTION createSequence()

// EXPORTS //

module.exports = createSequence;


text:
title: "Doing it live"
layout: page
path: "/goals"
mast: "castlemast.jpg"
---

Nailed it! right...?


text:
include(_cmake/AddLibrary/Dependencies.cmake)

# external libraries we're going to use.
include(_cmake/dependencies/Boost.cmake)
include(_cmake/dependencies/BuildTraits.cmake)
include(_cmake/dependencies/dl.cmake)

# external libraries used for testing.
include(_cmake/dependencies/UnitTest++.cmake)


text:
package imallett.FlashBang.Threading;

import android.graphics.Canvas;
import android.view.SurfaceView;

import imallett.FlashBang.Config;
import imallett.FlashBang.Activities.ActivityMain;
import imallett.FlashBang.R;
import imallett.FlashBang.Views.ViewGraphAudio;
import imallett.FlashBang.Views.ViewGraphLight;
import imallett.FlashBang.Measurement.MeasurerAudio;

public class ThreadUpdate extends ThreadBase {
	private final ActivityMain _activity;

	private final MeasurerAudio _audio;

	private final ViewGraphAudio _graph_audio;
	private final ViewGraphLight _graph_light;

	public ThreadUpdate(ActivityMain activity, MeasurerAudio audio, ViewGraphAudio graph_audio, ViewGraphLight graph_light) {
		_activity = activity;
		_audio = audio;
		_graph_audio = graph_audio;
		_graph_light = graph_light;
	}

	private void _redrawSurfaceView(SurfaceView surface) {
		//Note: evidently checking _graphs.getHolder().getSurface().isValid() is insufficient.
		Canvas canvas = surface.getHolder().lockCanvas(null);
		if (canvas != null) {
			surface.draw(canvas);
			surface.getHolder().unlockCanvasAndPost(canvas);
			surface.postInvalidate();
		}
	}
	@Override public void run() {
		while (!stop_requested) {
			//Update data
			_audio.update();
			//	lux updates via a callback automatically

			//Redraw
			_redrawSurfaceView(_graph_audio);
			_redrawSurfaceView(_graph_light);

			//Update GUI
			_activity.runOnUiThread(new Runnable() { @Override public void run() {
				//Input values
				//	Relative humidity (%)
				double RH = _activity.humidity.valid ? _activity.humidity.RH : 45.0;
				//	Pressure (Pa)
				double P = _activity.pressure.valid ? _activity.pressure.hPa*100.0 : 101325.0;
				//	Temperature (°C)
				double T = _activity.temperature.valid ? _activity.temperature.degC : 20.0;
				//	Delay (sec)
				long ns = _activity.thread_correlate.delay;
				double delay = ns / 1000000000.0;

				//Calculate refractive index
				//	http://physics.stackexchange.com/a/14948/10909
				//	TODO: make dependent on humidity.  See https://www.mathworks.com/matlabcentral/fileexchange/31240-air-refractive-index/content/air_index.m
				double P0 = 101325.0; //in Pa
				double T0 = 300.0 - 273.15; //in deg C
				double n = 1.0 + 0.000293 * P/P0 * T0/T;

				//Calculate speed of light in air
				//	n=c/v -> v=c/n
				double c = 299792458.0;
				double v = c / n;

				//Calculate speed of sound in air
				//	http://www.sengpielaudio.com/calculator-airpressure.htm
				double T_kelvin = T + 273.15;
				//	Molecular concentration of water vapor calculated from Rh using Giacomos method by Davis (1991) as implemented in DTU report 11b-1997
				double ENH = 1.00062 + (Math.PI*1.0e-8)*P + 5.6e-7*T*T;

				//	Mole fraction of carbon dioxide
				double Xc = 3.14e-4; //Version had this commented out and replaced by "4.0".  Don't know why.
				//	Mole fraction of water vapor
				//		The commented values correspond to values used in Cramer (Appendix)
				//            1.2811805e-5                   - 1.9509874e-2
				double PSV1 = 1.2378847e-5*T_kelvin*T_kelvin - 1.9121316e-2*T_kelvin;
				//            34.04926034 - 6.3536311e3
				double PSV2 = 33.93711047 - 6.3431645e3/T_kelvin;
				double PSV = Math.exp(PSV1 + PSV2);
				double H = RH*ENH*PSV/P; //Molarity of water vapor
				double Xw = 0.01 * H;
				//	Calculate speed using the method of Cramer from JASA vol 93 p. 2510
				double C1 = 331.5024 + 0.603055*T - 5.28e-4*T*T + (51.471935 + 0.1495874*T - 7.82e-4*T*T)*Xw;
				double C2 = (-1.82e-7 + 3.73e-8*T - 2.93e-10*T*T)*P + (-85.20931 - 0.228525*T + 5.91e-5*T*T)*Xc;
				double C3 = 2.835149*Xw*Xw - 2.15e-13*P*P + 29.179762*Xc*Xc + 4.86e-4*Xw*P*Xc;
				double C = C1 + C2 - C3;

				//Calculate distance
				//	d=r_1*t_1=r_2*t_2 -> d=r_1*r_2*((t_2-t_1)/(r_1-r_2))
				double dist = v*C*( delay / (v-C) );

				//Update text
				//	Simple inputs
				_activity.text_value_pres. setText(_activity.getString(R.string.caption_input_press)+" "+Config.localizePressure(P));
				_activity.text_value_temp. setText(_activity.getString(R.string.caption_input_temp)+" "+Config.localizeTemperature(T));
				_activity.text_value_RH.   setText(_activity.getString(R.string.caption_input_RH)+" "+RH+"%");
				if (_activity.audio.valid&&_activity.light.valid) {
					if (ns!=-1) {
						_activity.text_value_delay.setText(_activity.getString(R.string.caption_input_okdelay)+" "+String.format("%.2f",delay)+" sec");
					} else {
						_activity.text_value_delay.setText(_activity.getString(R.string.caption_input_abdelay));
					}
				} else {
					_activity.text_value_delay.setText(_activity.getString(R.string.caption_input_nodelay));
				}
				//	Derived quantities
				_activity.text_value_airn.setText(_activity.getString(R.string.caption_derived_n)+" "+String.format("%.9f",n));
				_activity.text_value_sol. setText(_activity.getString(R.string.caption_derived_sol)+" "+Config.localizeSpeed(v));
				_activity.text_value_sos. setText(_activity.getString(R.string.caption_derived_sos)+" "+Config.localizeSpeed(C));
				//	Value
				if (_activity.audio.valid&&_activity.light.valid) {
					if (ns!=-1) {
						_activity.text_value_dist.setText(_activity.getString(R.string.caption_dist_okval)+" "+Config.localizeLength(dist));
					} else {
						_activity.text_value_dist.setText(_activity.getString(R.string.caption_dist_abval));
					}
				} else {
					_activity.text_value_dist.setText(_activity.getString(R.string.caption_dist_noval));
				}
			}});
		}
	}
}


text:
This test makes sure that HTMLObjectElement.vspace and HTMLObjectElement.hspace are exposed as numbers instead of strings, per the DOM Level 2 HTML spec: http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-9893177

<object id="object" data="" vspace="10" hspace="20"></object>

FAILURE


text:
CREATE TABLE [SalesLT].[Address] (
    [AddressID]     INT              IDENTITY (1, 1) NOT NULL,
    [AddressLine1]  NVARCHAR (60)    NOT NULL,
    [AddressLine2]  NVARCHAR (60)    NULL,
    [City]          NVARCHAR (30)    NOT NULL,
    [StateProvince] [dbo].[Name]     NOT NULL,
    [CountryRegion] [dbo].[Name]     NOT NULL,
    [PostalCode]    NVARCHAR (15)    NOT NULL,
    [rowguid]       UNIQUEIDENTIFIER CONSTRAINT [DF_Address_rowguid] DEFAULT (newid()) NOT NULL,
    [ModifiedDate]  DATETIME         CONSTRAINT [DF_Address_ModifiedDate] DEFAULT (getdate()) NOT NULL,
    CONSTRAINT [PK_Address_AddressID] PRIMARY KEY CLUSTERED ([AddressID] ASC),
    CONSTRAINT [AK_Address_rowguid] UNIQUE NONCLUSTERED ([rowguid] ASC)
);

GO
CREATE NONCLUSTERED INDEX [IX_Address_StateProvince]
    ON [SalesLT].[Address]([StateProvince] ASC);

GO
CREATE NONCLUSTERED INDEX [IX_Address_AddressLine1_AddressLine2_City_StateProvince_PostalCode_CountryRegion]
    ON [SalesLT].[Address]([AddressLine1] ASC, [AddressLine2] ASC, [City] ASC, [StateProvince] ASC, [PostalCode] ASC, [CountryRegion] ASC);


text:
var Twitter = require('../lib/Twitter');

var twitterStreamClient = new Twitter.StreamClient(
    'CONSUMER_KEY',
    'CONSUMER_SECRET',
    'TOKEN',
    'TOKEN_SECRET'
);

twitterStreamClient.on('close', function() {
    console.log('Connection closed.');
});
twitterStreamClient.on('end', function() {
    console.log('End of Line.');
});
twitterStreamClient.on('error', function(error) {
    console.log('Error: ' + (error.code ? error.code + ' ' + error.message : error.message));
});
twitterStreamClient.on('retweet', function(retweet) {
    console.log(retweet);
});

twitterStreamClient.start(['baseball', 'basketball', 'football', 'hockey']);


text:
'******************************************************************************************************
'  AlternateCommandChannel.vb - Gbtc
'
'  Copyright © 2016, Grid Protection Alliance.  All Rights Reserved.
'
'  Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See
'  the NOTICE file distributed with this work for additional information regarding copyright ownership.
'  The GPA licenses this file to you under the MIT License (MIT), the "License"; you may
'  not use this file except in compliance with the License. You may obtain a copy of the License at:
'
'      http://opensource.org/licenses/MIT
'
'  Unless agreed to in writing, the subject software distributed under the License is distributed on an
'  "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Refer to the
'  License for the specific language governing permissions and limitations.
'
'  Code Modification History:
'  ----------------------------------------------------------------------------------------------------
'  06/15/2009 - James R. Carroll
'       Generated original version of source code.
'
'******************************************************************************************************

Imports System.IO
Imports System.Windows.Forms.DialogResult
Imports GSF
Imports GSF.Communication
Imports GSF.Common
Imports Infragistics.Win.UltraWinMaskedEdit

Public Class AlternateCommandChannel

    Public NetworkInterface As Integer

    Public Sub New()

        ' This call is required by the Windows Form Designer.
        InitializeComponent()

        ' Initialize serial port selection lists
        For Each port As String In Ports.SerialPort.GetPortNames()
            ComboBoxSerialPorts.Items.Add(port)
        Next

        For Each parity As String In GetNames(GetType(Ports.Parity))
            ComboBoxSerialParities.Items.Add(parity)
        Next

        For Each stopbit As String In GetNames(GetType(Ports.StopBits))
            ComboBoxSerialStopBits.Items.Add(stopbit)
        Next

        ' Default to TCP tab
        TabControlCommunications.Tabs(TransportProtocol.Tcp).Selected = True

    End Sub

    Private Sub CheckBoxUndefined_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs) Handles CheckBoxUndefined.CheckedChanged

        ' Enable or disable command channel settings tab
        TabControlCommunications.Enabled = Not CheckBoxUndefined.Checked

        ' Automatically show change in link label text/format on parent for to cue user of defined state indicator
        If Visible Then PMUConnectionTester.UpdateAlternateCommandChannelLabel()

    End Sub

    Private Sub ButtonBrowse_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ButtonBrowse.Click

        With PMUConnectionTester.OpenFileDialog
            .Title = "Open Capture File"
            .Filter = "Captured Files (*.PmuCapture)|*.PmuCapture|All Files|*.*"
            .FileName = ""
            If .ShowDialog(Me) = OK Then
                TextBoxFileCaptureName.Text = .FileName()
            End If
        End With

    End Sub

    Private Sub TextBox_GotFocus(ByVal sender As Object, ByVal e As EventArgs) Handles _
        TextBoxFileCaptureName.GotFocus, TextBoxSerialDataBits.GotFocus, TextBoxTcpHostIP.GotFocus, TextBoxTcpPort.GotFocus

        ' Select all text box contents upon focus or selection
        Dim maskedEdit As UltraMaskedEdit = TryCast(sender, UltraMaskedEdit)

        If maskedEdit IsNot Nothing Then
            If maskedEdit.EditAs = EditAsType.UseSpecifiedMask Then
                maskedEdit.SelectAll()
            Else
                maskedEdit.SelectionStart = 0
                maskedEdit.SelectionLength = maskedEdit.Text.Length
            End If
        Else
            Dim windowsTextBox As TextBox = TryCast(sender, TextBox)

            If windowsTextBox IsNot Nothing Then
                windowsTextBox.SelectAll()
            End If
        End If

    End Sub

    Private Sub TextBox_MouseClick(ByVal sender As Object, ByVal e As MouseEventArgs) Handles _
        TextBoxFileCaptureName.MouseClick, TextBoxSerialDataBits.MouseClick, TextBoxTcpPort.MouseClick

        ' TextBoxTcpHostIP.MouseClick,

        TextBox_GotFocus(sender, e)

    End Sub

    Private Sub LabelTcpNetworkInterface_Click(sender As Object, e As EventArgs) Handles LabelTcpNetworkInterface.Click

        NetworkInterfaceSelector.ComboBoxNetworkInterfaces.SelectedIndex = NetworkInterface

        If NetworkInterfaceSelector.ShowDialog(Me) = OK Then
            NetworkInterface = NetworkInterfaceSelector.ComboBoxNetworkInterfaces.SelectedIndex
        End If

        NetworkInterfaceSelector.ComboBoxNetworkInterfaces.SelectedIndex = -1

    End Sub

    Public ReadOnly Property IsDefined() As Boolean
        Get
            Return Not CheckBoxUndefined.Checked
        End Get
    End Property

    Public Property ConnectionString() As String
        Get
            If CheckBoxUndefined.Checked Then
                Return ""
            Else
                Select Case TabControlCommunications.SelectedTab.Index
                    Case TransportProtocol.Tcp
                        Return _
                            "; commandchannel={protocol=Tcp" & _
                            "; server=" & TextBoxTcpHostIP.Text & _
                            "; port=" & TextBoxTcpPort.Text & _
                            "; interface=" & PMUConnectionTester.GetNetworkInterfaceValue(NetworkInterface) & "}"
                    Case TransportProtocol.Serial - 1 ' UDP removed from tab set...
                        Return _
                            "; commandchannel={protocol=Serial" & _
                            "; port=" & ComboBoxSerialPorts.Text & _
                            "; baudrate=" & ComboBoxSerialBaudRates.Text & _
                            "; parity=" & ComboBoxSerialParities.Text & _
                            "; stopbits=" & ComboBoxSerialStopBits.Text & _
                            "; databits=" & TextBoxSerialDataBits.Text & _
                            "; dtrenable=" & CheckBoxSerialDTR.Checked.ToString() & _
                            "; rtsenable=" & CheckBoxSerialRTS.Checked.ToString() & "}"
                    Case TransportProtocol.File - 1 ' UDP removed from tab set...
                        Return _
                            "; commandchannel={protocol=File" & _
                            "; file=" & TextBoxFileCaptureName.Text & "}"
                    Case Else
                        Return ""
                End Select
            End If
        End Get
        Set(ByVal value As String)
            Dim connectionData As Dictionary(Of String, String) = value.ParseKeyValuePairs()

            If connectionData.ContainsKey("commandchannel") Then
                Dim protocol As TransportProtocol
                Dim interfaceIP As String

                CheckBoxUndefined.Checked = False
                connectionData = connectionData("commandchannel").ParseKeyValuePairs()
                protocol = DirectCast([Enum].Parse(GetType(TransportProtocol), connectionData("protocol"), True), TransportProtocol)

                ' Load remaining connection settings
                TabControlCommunications.Tabs(IIf(protocol > TransportProtocol.Tcp, protocol - 1, protocol)).Selected = True

                Select Case protocol
                    Case TransportProtocol.Tcp
                        TextBoxTcpPort.Text = connectionData("port")
                        PMUConnectionTester.AssignHostIP(TextBoxTcpHostIP, connectionData("server"))

                        If connectionData.TryGetValue("interface", interfaceIP) Then
                            NetworkInterface = PMUConnectionTester.GetNetworkInterfaceIndex(interfaceIP)
                        Else
                            NetworkInterface = 0
                        End If
                    Case TransportProtocol.Serial
                        ComboBoxSerialPorts.Text = connectionData("port")
                        ComboBoxSerialBaudRates.Text = connectionData("baudrate")
                        ComboBoxSerialParities.Text = connectionData("parity")
                        ComboBoxSerialStopBits.Text = connectionData("stopbits")
                        TextBoxSerialDataBits.Text = connectionData("databits")
                        CheckBoxSerialDTR.Checked = connectionData("dtrenable").ParseBoolean()
                        CheckBoxSerialRTS.Checked = connectionData("rtsenable").ParseBoolean()
                    Case TransportProtocol.File
                        TextBoxFileCaptureName.Text = connectionData("file")
                End Select
            Else
                CheckBoxUndefined.Checked = True
            End If
        End Set
    End Property

End Class


text:
layout: "digitalocean"
page_title: "DigitalOcean: digitalocean_ssh_key"
sidebar_current: "docs-do-resource-ssh-key"
description: |-
  Provides a DigitalOcean SSH key resource.
---

# digitalocean\_ssh_key

Provides a DigitalOcean SSH key resource to allow you manage SSH
keys for Droplet access. Keys created with this resource
can be referenced in your droplet configuration via their ID or
fingerprint.

## Example Usage

```
# Create a new SSH key
resource "digitalocean_ssh_key" "default" {
    name = "Terraform Example"
    public_key = "${file("/Users/terraform/.ssh/id_rsa.pub")}"
}
```

## Argument Reference

The following arguments are supported:

* `name` - (Required) The name of the SSH key for identification
* `public_key` - (Required) The public key. If this is a file, it
can be read using the file interpolation function

## Attributes Reference

The following attributes are exported:

* `id` - The unique ID of the key
* `name` - The name of the SSH key
* `public_key` - The text of the public key
* `fingerprint` - The fingerprint of the SSH key


text:
/* PR debug/36690 */
/* Verify that break func is hit.
   This version of the test just checks that it can be compiled, linked
   and executed, further testing is done in corresponding gcc.dg/dwarf2/
   test and hopefully in gdb testsuite.  */
/* { dg-do run } */
/* { dg-options "-O0 -g -dA" } */

int i;

void
func (void)
{
  while (i == 1)
    i = 0;
}

int
main (void)
{
  func ();
  return 0;
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Journal of the Sericultural Association of Japan 27(no. 314): 227 (1918)

#### Original name
Helminthosporium mori Hara

### Remarks
null


text:
{% if form_show_errors %}
    {% include "cp_forms/errors.html" %}
{% endif %}
{% if form_style == "" or form_style %}
    <fieldset class="{{ form_style }}">
    {% if legend %}<legend>{{ legend|safe }}</legend>{% endif %}
{% endif %}
        <ul class="form__ul">
{% for field in form %}
    {% include "cp_forms/field.html" %}
{% endfor %}
        </ul>
{% if form_style == "" or form_style %}
    </fieldset>
{% endif %}


text:
namespace df
{

CircleShape::CircleShape(m2::PointF const & mercatorPt, CircleViewParams const & params)
  : m_pt(mercatorPt)
  , m_params(params)
{
}

void CircleShape::Draw(dp::RefPointer<dp::Batcher> batcher, dp::RefPointer<dp::TextureManager> textures) const
{
  int const TriangleCount = 20;
  double const etalonSector = (2.0 * math::pi) / static_cast<double>(TriangleCount);

  dp::TextureManager::ColorRegion region;
  textures->GetColorRegion(m_params.m_color, region);
  glsl::vec2 colorPoint(glsl::ToVec2(region.GetTexRect().Center()));

  buffer_vector<gpu::SolidTexturingVertex, 22> vertexes;
  vertexes.push_back(gpu::SolidTexturingVertex
  {
    glsl::vec3(glsl::ToVec2(m_pt), m_params.m_depth),
    glsl::vec2(0.0f, 0.0f),
    colorPoint
  });

  m2::PointD startNormal(0.0f, m_params.m_radius);

  for (size_t i = 0; i < TriangleCount + 1; ++i)
  {
    m2::PointD rotatedNormal = m2::Rotate(startNormal, (i) * etalonSector);
    vertexes.push_back(gpu::SolidTexturingVertex
    {
      glsl::vec3(glsl::ToVec2(m_pt), m_params.m_depth),
      glsl::ToVec2(rotatedNormal),
      colorPoint
    });
  }

  dp::GLState state(gpu::TEXTURING_PROGRAM, dp::GLState::OverlayLayer);
  state.SetBlending(dp::Blending(true));
  state.SetColorTexture(region.GetTexture());

  dp::OverlayHandle * overlay = new dp::SquareHandle(m_params.m_id,
                                                     dp::Center, m_pt,
                                                     m2::PointD(m_params.m_radius, m_params.m_radius),
                                                     m_params.m_depth);

  dp::AttributeProvider provider(1, TriangleCount + 2);
  provider.InitStream(0, gpu::SolidTexturingVertex::GetBindingInfo(), dp::MakeStackRefPointer<void>(vertexes.data()));
  batcher->InsertTriangleFan(state, dp::MakeStackRefPointer(&provider), dp::MovePointer(overlay));
}

} // namespace df