text:
<!DOCTYPE html>

	<title>

            ORCHANGO -

    Complete profile - Canadian Company Capabilities - Industries and Business - Industry Canada
  </title>

<meta charset="utf-8" />
<meta name="dcterms.language" title="ISO639-2" content="eng" />
<meta name="dcterms.title" content="" />
<meta name="description" content="" />
<meta name="dcterms.description" content="" />
<meta name="dcterms.type" content="report, data set" />
<meta name="dcterms.subject" content="businesses, industry" />
<meta name="dcterms.subject" content="businesses, industry" />
<meta name="dcterms.issued" title="W3CDTF" content="" />
<meta name="dcterms.modified" title="W3CDTF" content="" />
<meta name="keywords" content="" />

<meta name="dcterms.creator" content="" />
<meta name="author" content="" />
<meta name="dcterms.created" title="W3CDTF" content="" />
<meta name="dcterms.publisher" content="" />
<meta name="dcterms.audience" title="icaudience" content="" />
<meta name="dcterms.spatial" title="ISO3166-1" content="" />
<meta name="dcterms.spatial" title="gcgeonames" content="" />
<meta name="dcterms.format" content="HTML" />
<meta name="dcterms.identifier" title="ICsiteProduct" content="536" />

<meta http-equiv="X-UA-Compatible" content="IE=edge">

<meta content="width=device-width,initial-scale=1" name="viewport">

<meta name = "format-detection" content = "telephone=no">

<meta name="robots" content="noarchive">

<link href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/favicon.ico" rel="icon" type="image/x-icon">
<link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/wet-boew.min.css">

<link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/theme.min.css">

<link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/noscript.min.css" />

<link rel="stylesheet" href="/eic/home.nsf/css/add_WET_4-0_Canada_Apps.css">

  	<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
  	<link href="/app/ccc/srch/css/print.css" media="print" rel="stylesheet" type="text/css" />

<meta property="legalName" content="Department_of_Industry">

Skip to main content

Skip to "About this site"

Language selection

Français

<object type="image/svg+xml" tabindex="-1" data="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/sig-blk-en.svg"></object> Government of Canada

Search and menus

Search and menus

Topics menu

Jobs

Immigration

Travel

Business

Benefits

Health

Taxes

More services

You are here:

Home

Industries and Business

Canadian Company Capabilities

<input id="showMore" type="hidden" value='more'/>
<input id="showLess" type="hidden" value='less'/>

 Company profile - Canadian Company Capabilities

New Search |

<form name="searchForm" method="post" action="/app/ccc/srch/bscSrch.do">

          <input type="hidden" name="lang" value="eng" />
          <input type="hidden" name="profileId" value="" />
          <input type="hidden" name="prtl" value="1" />
          <input type="hidden" name="searchPage" value="%2Fapp%2Fccc%2Fsrch%2FcccBscSrch.do%3Flang%3Deng%26amp%3Bprtl%3D1%26amp%3Btagid%3D"  />

          <input type="hidden" name="V_SEARCH.scopeCategory" value="CCC.Root" />

          <input type="hidden" name="V_SEARCH.depth" value="1" />
          <input type="hidden" name="V_SEARCH.showStricts" value="false" />
          <input id="repeatSearchBtn" class="btn btn-link" type="submit" value="Return to search results" />

  </form>

| Previous Company

| Next Company

      Third-Party Information Liability Disclaimer

Some of the information on this Web page has been provided by external sources. The Government of Canada is not responsible for the accuracy, reliability or currency of the information supplied by external sources. Users wishing to rely upon this information should consult directly with the source of the information. Content provided by external sources is not subject to official languages, privacy and accessibility requirements.

      ORCHANGO, a division of TRANSITUS Inc.

Legal Name:

ORCHANGO, a division of TRANSITUS Inc.

Operating Name:

ORCHANGO

Alternate Name:

Consulting activities previously delivered under the "TRANSITUS Consulting" name.

http://www.orchango.com

info@orchango.com

Mailing Address:

              	<address class="mrgn-bttm-md">

                   63 Beaconsfield Ave

                    TORONTO,

                    Ontario

                  M6J 3J1

                </address>

Location Address:

              	         <address class="mrgn-bttm-md">

                   63 Beaconsfield Ave

                    TORONTO,

                    Ontario

                  M6J 3J1

                         </address>

Tel.:
		      (416) 607-6474

Fax:
		      (416) 539-8198

Logo

Company Profile

            Our specialty is to build the change capabilities of client organizations and help them execute strategic change.

We provide world-class expertise in change management. Our training programs leverage the power of learning while executing.

Our unique toolkit includes:

•	STEP UP!™ – a learning game (simulation) of change management.

•	CHECK UP!™ – a special survey to measure and drive the change capabilities of client organizations; and monitor the levels of support or resistance for specific change initiatives.

Learning. Consulting. Speaking.

Website: www.orchango.com

Blogs: www.orchango.com/category/blogs/

				Full profile

				Full profile

				Contact information

                Edmond
                Mellina

                  Title:

                President

                    Area of Responsibility:

                    Management Executive.

                  Telephone:

                (416) 607-6474

                  Facsimile:

                (416) 539-8198

                    Email:

                  info@orchango.com

  top of page

				Company description

            Country of Ownership:

              Canada

              Year Established:

            2002

            Exporting:

              Yes

                Primary Industry (NAICS):

				611430 - Professional and Management Development Training

            Alternate Industries (NAICS):

            541611 - Administrative Management and General Management Consulting Services

            541612 - Human Resources Consulting Services

            Primary Business Activity:

            Services

				Product / Service / Licensing

                              Service Name:

                            World-class change management consulting

                            SERVICES TO GO THROUGH COMPLEX CHANGE

Our services are designed to help organizations adapt to change.

1. Change execution - to ensure the successful execution of complex change.

2. Strategy retreats - to extract maximum value from strategy retreats and other management meetings.

3. Performance improvement - to reach higher level of productivity.

4. Individual | Team coaching - to guide managers or teams on the job as they execute the business plan.

5. Change capability building - to acquire world-class change capabilities and thread change management into people's DNA.

The impact stories on our web site illustrate how our clients leverage these services to move their organizations forward during times of change.

                              Out-License (Offering):

                            World-class learning programs on the topic of change management

                            SUPPORTING CURRENT CHANGE, PREPARING FUTURE CHANGE

We have a specific program for each "player" during times of change:

1- Program for frontline managers (e.g. supervisors, managers): LEADING CHANGE ON THE FRONTLINE, Build your priority to-do list and use practical, proven tools to bring your team onboard.

2- Program for middle managers (e.g. directors, AVPs): TRANSFORMING YOUR FUNCTIONAL AREA - Create a domino effect towards change and lead the transition effectively.

3- Program for project teams: ROLLING OUT COMPLEX CHANGE INITIATIVES - Tackle the challenge with a world-class toolkit and become a change master.

4- Program for employees or managers appointed as change agents: SUCCEEDING AS A CHANGE AGENT FOR YOUR FUNCTIONAL AREA - Make it happen with battle-tested tools and effective guidance.

5- Program for executive sponsors: BEING AN EFFECTIVE SPONSOR DESPITE A BUSY SCHEDULE - Make your change campaign go viral through targeted actions.

6- Program for change advocates (including sales professionals): INFLUENCING WITHOUT AUTHORITY - Map out the key players and determine the best way to get buy-in for your ideas.

7- Program for employees on the receiving end of change: MAKING SENSE OF ALL THE CHANGE IMPACTING US - Learn with your peers how to better navigate the rough waters of change.

To address special audiences, context or objectives, we use customized versions of the above programs.

              FSC Code:

              R019-Other Professional Services

              U000-Educational and Training Services

  top of page

					Market profile

                        Alliances:

Sales/Marketing

              Geographic markets:

                  Export experience:

France

Saudi Arabia

United Kingdom

United States

  top of page

					Sector information

                Key / Major clients:

              Sun Life Financial; FundSERV; Islamic Development Bank; Technical Standards & Safety Authority; De Beers; Fairmont Hotels; JMP Engineering; Delta Hotels; Fairmont Hotels; Saputo; Envoy Communication Group; Sparks Event Marketing; Canadian Institute; Ryerson University; Training Folks; CIO Summit; Bell; Sligos; Yellow Pages Group; Government of British Columbia; French Trade Commissions; Alimentation Couche-Tard; Hay Group; Sage Information Consultants; Purolator Courrier Limited; Law Society of Upper Canada; Électricité de France; Confédération Générale des Travailleurs; etc.

                Success stories:

              Please visit our website...

http://orchango.com/client/impact-stories/

                Testimonial:

              Please visit our website...

http://orchango.com/

					Third-Party Information Liability Disclaimer

					Some of the information on this Web page has been provided by external sources. The Government of Canada is not responsible for the accuracy, reliability or currency of the information supplied by external sources. Users wishing to rely upon this information should consult directly with the source of the information. Content provided by external sources is not subject to official languages, privacy and accessibility requirements.

				Contacts

				Contact information

                Edmond
                Mellina

                  Title:

                President

                    Area of Responsibility:

                    Management Executive.

                  Telephone:

                (416) 607-6474

                  Facsimile:

                (416) 539-8198

                    Email:

                  info@orchango.com

				Description

				Company description

            Country of Ownership:

              Canada

              Year Established:

            2002

            Exporting:

              Yes

                Primary Industry (NAICS):

				611430 - Professional and Management Development Training

            Alternate Industries (NAICS):

            541611 - Administrative Management and General Management Consulting Services

            541612 - Human Resources Consulting Services

            Primary Business Activity:

            Services

				Products, services and licensing

				Product / Service / Licensing

                              Service Name:

                            World-class change management consulting

                            SERVICES TO GO THROUGH COMPLEX CHANGE

Our services are designed to help organizations adapt to change.

1. Change execution - to ensure the successful execution of complex change.

2. Strategy retreats - to extract maximum value from strategy retreats and other management meetings.

3. Performance improvement - to reach higher level of productivity.

4. Individual | Team coaching - to guide managers or teams on the job as they execute the business plan.

5. Change capability building - to acquire world-class change capabilities and thread change management into people's DNA.

The impact stories on our web site illustrate how our clients leverage these services to move their organizations forward during times of change.

                              Out-License (Offering):

                            World-class learning programs on the topic of change management

                            SUPPORTING CURRENT CHANGE, PREPARING FUTURE CHANGE

We have a specific program for each "player" during times of change:

1- Program for frontline managers (e.g. supervisors, managers): LEADING CHANGE ON THE FRONTLINE, Build your priority to-do list and use practical, proven tools to bring your team onboard.

2- Program for middle managers (e.g. directors, AVPs): TRANSFORMING YOUR FUNCTIONAL AREA - Create a domino effect towards change and lead the transition effectively.

3- Program for project teams: ROLLING OUT COMPLEX CHANGE INITIATIVES - Tackle the challenge with a world-class toolkit and become a change master.

4- Program for employees or managers appointed as change agents: SUCCEEDING AS A CHANGE AGENT FOR YOUR FUNCTIONAL AREA - Make it happen with battle-tested tools and effective guidance.

5- Program for executive sponsors: BEING AN EFFECTIVE SPONSOR DESPITE A BUSY SCHEDULE - Make your change campaign go viral through targeted actions.

6- Program for change advocates (including sales professionals): INFLUENCING WITHOUT AUTHORITY - Map out the key players and determine the best way to get buy-in for your ideas.

7- Program for employees on the receiving end of change: MAKING SENSE OF ALL THE CHANGE IMPACTING US - Learn with your peers how to better navigate the rough waters of change.

To address special audiences, context or objectives, we use customized versions of the above programs.

              FSC Code:

              R019-Other Professional Services

              U000-Educational and Training Services

					Market

					Market profile

                        Alliances:

Sales/Marketing

              Geographic markets:

                  Export experience:

France

Saudi Arabia

United Kingdom

United States

					Sector

					Sector information

                Key / Major clients:

              Sun Life Financial; FundSERV; Islamic Development Bank; Technical Standards & Safety Authority; De Beers; Fairmont Hotels; JMP Engineering; Delta Hotels; Fairmont Hotels; Saputo; Envoy Communication Group; Sparks Event Marketing; Canadian Institute; Ryerson University; Training Folks; CIO Summit; Bell; Sligos; Yellow Pages Group; Government of British Columbia; French Trade Commissions; Alimentation Couche-Tard; Hay Group; Sage Information Consultants; Purolator Courrier Limited; Law Society of Upper Canada; Électricité de France; Confédération Générale des Travailleurs; etc.

                Success stories:

              Please visit our website...

http://orchango.com/client/impact-stories/

                Testimonial:

              Please visit our website...

http://orchango.com/

    Last Update Date 2015-01-15

Date Modified:

      <time>2017-03-02</time>

About government

Contact us

Departments and agencies

Public service and military

News

Treaties, laws and regulations

Government-wide reporting

Prime Minister

How government works

Open government

About this site

Social media

Mobile applications

About Canada.ca

Terms and conditions

Privacy

Top of Page

<object type="image/svg+xml" tabindex="-1" role="img" data="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/wmms-blk.svg" aria-label="Symbol of the Government of Canada"></object>


text:
using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Xunit;
using Scripting.SSharp.Runtime;
using Scripting.SSharp.Runtime.Promotion;
using Scripting.SSharp;

namespace UnitTests
{
  /// <summary>
  /// Summary description for FunctionScopes
  /// </summary>
  public class FunctionScopes : IDisposable
  {
    public FunctionScopes()
    {
      RuntimeHost.Initialize();
      EventBroker.ClearAllSubscriptions();
    }

    public void Dispose()
    {
      RuntimeHost.CleanUp();
      EventBroker.ClearAllSubscriptions();
    }

    [Fact]
    public void SimpleFunctionScope()
    {
      ScriptContext context = new ScriptContext();
      IScriptScope scope = context.Scope;
      Script.RunCode(@"
        a = 4; b = 2; c = 3;
        function test1(a,b)
          global(c)
        {
          c = a+b;
          a = 15;
        }

        test1(2,3);", context);

      Assert.Equal(scope, context.Scope);
      Assert.Equal(5, context.GetItem("c", true));
      Assert.Equal(4, context.GetItem("a", true));
      Assert.Equal(2, context.GetItem("b", true));
    }

    [Fact]
    public void SimpleFunctionScopeWithContract()
    {
      ScriptContext context = new ScriptContext();
      IScriptScope scope = context.Scope;
      Script.RunCode(@"
        a = 4; b = 2; c = 3;
        function test1(a,b)
          global(c)
          [
           pre(a>0);
           post();
           invariant();
          ]
        {
          c = a+b;
          a = 15;
        }

        test1(2,3);", context);

      Assert.Equal(scope, context.Scope);
      Assert.Equal(5, context.GetItem("c", true));
      Assert.Equal(4, context.GetItem("a", true));
      Assert.Equal(2, context.GetItem("b", true));
    }

    [Fact]
    public void RedefineGlobalVariableInFunctionNotAllowed()
    {
      Assert.Throws<ScriptExecutionException>(() =>
        Script.RunCode(@"
         var x = 5;
         function f() global(x)
         {
             var x;
         }
         f();
         return x;
      "));
    }

    [Fact]
    public void ReassignGlobalVariableInFunctionNotAllowed()
    {
      Assert.Throws<ScriptExecutionException>(() => {
          ScriptContext context = new ScriptContext();
          var result = Script.RunCode(@"
                 var x = 5;
                 function f() global (x)
                 {
                     var x = 10;
                 }
                 f();
                 return x;
              ", context);

          Assert.Equal(5, context.GetItem("x", true));
      });
    }

    [Fact]
    public void RedefineVariableInFunction() {
        ScriptContext context = new ScriptContext();
        var result = Script.RunCode(@"
         var x = 5;
         function f()
         {
             var x;
             x = 10;
         }
         f();
         return x;
      ", context);

      Assert.Equal(5, context.GetItem("x", true));
    }
  }
}

redpajama_set_name: RedPajamaGithub


text:
package com.nio.filecopy.database.mysql;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Date;
import java.util.List;

import com.nio.filecopy.bean.filter.DataUnit;
import com.nio.filecopy.bean.filter.DateFilter;
import com.nio.filecopy.bean.filter.DateOptions;
import com.nio.filecopy.bean.filter.DateType;
import com.nio.filecopy.bean.filter.ExtensionFilter;
import com.nio.filecopy.bean.filter.Filter;
import com.nio.filecopy.bean.filter.GroupFilter;
import com.nio.filecopy.bean.filter.Mode;
import com.nio.filecopy.bean.filter.Options;
import com.nio.filecopy.bean.filter.OwnerFilter;
import com.nio.filecopy.bean.filter.SizeFilter;
import com.nio.filecopy.bean.filter.DataUnit.Unit;
import com.nio.filecopy.database.TableConstants;

public class FilterDatabase {
	private static FilterDatabase fd;

	public static FilterDatabase getInstance() {
		if (fd == null) {
			fd = new FilterDatabase();
		}
		return fd;
	}

	private FilterDatabase() {};

	/**
	 * Insert filter to database
	 * @param jobId
	 * @param fileId
	 * @param hash
	 * @return the id of the filter, if failed, return null
	 */
	public Integer insertFilter(Filter filter) {

		Integer filterId = null;

		Connection con = null;
		PreparedStatement preStatement = null;
		ResultSet rs = null;
		try {
			con = DBLoader.getInstance().getConnection();
			con.setAutoCommit(false);

			StringBuilder sql = new StringBuilder(128);
			sql.append("INSERT INTO ").append(TableConstants.FILTER_TABLE).append(" (name, description) VALUES (?, ?);");
			preStatement = con.prepareStatement(sql.toString(), PreparedStatement.RETURN_GENERATED_KEYS);

			preStatement.setString(1, filter.getName());
			preStatement.setString(2, filter.getDesc());

			preStatement.executeUpdate();
			rs = preStatement.getGeneratedKeys();
			if(rs.next()) {
				filterId = rs.getInt(1);
			}

			if(filterId != null) {
				// The filter id is not null

				// Date filter
				if(filter.getDateFilters() != null && filter.getDateFilters().size() > 0) {
					// Has date filter

					List<DateFilter> filterList = filter.getDateFilters();
					for(DateFilter dateFilter : filterList) {
						sql = new StringBuilder(128);
						if(dateFilter.getOption() == DateOptions.RANGE) {
							// Range
							sql.append("INSERT ").append(TableConstants.DATE_FILTER_TABLE)
								.append("(filter_id, date_type, date_option, start_date, end_date, mode)")
								.append(" VALUES (?, ?, ?, ?, ?, ?);");
							preStatement = con.prepareStatement(sql.toString());
							preStatement.setInt(1, filterId);
							preStatement.setInt(2, dateFilter.getDateType().getId());
							preStatement.setInt(3, dateFilter.getOption().getId());
							java.sql.Date startDate = new java.sql.Date(dateFilter.getStartDate().getTime());
							preStatement.setDate(4, startDate);
							java.sql.Date endDate = new java.sql.Date(dateFilter.getEndDate().getTime());
							preStatement.setDate(5, endDate);
							preStatement.setInt(6, dateFilter.getMode().getId());
						} else {
							// Not range
							sql.append("INSERT ").append(TableConstants.DATE_FILTER_TABLE)
								.append("(filter_id, date_type, date_option, start_date, mode)")
								.append(" VALUES (?, ?, ?, ?, ?);");
							preStatement = con.prepareStatement(sql.toString());
							preStatement.setInt(1, filterId);
							preStatement.setInt(2, dateFilter.getDateType().getId());
							preStatement.setInt(3, dateFilter.getOption().getId());
							java.sql.Date startDate = new java.sql.Date(dateFilter.getStartDate().getTime());
							preStatement.setDate(4, startDate);
							preStatement.setInt(5, dateFilter.getMode().getId());
						}

						preStatement.executeUpdate();
					}

				}
				// End date filter

				// Extension filter
				if(filter.getExtensionFilters() != null && filter.getExtensionFilters().size() > 0) {
					List<ExtensionFilter> filterList = filter.getExtensionFilters();

					for(ExtensionFilter extensionFilter : filterList) {
						sql = new StringBuilder(128);
						sql.append("INSERT ").append(TableConstants.EXTENSION_FILTER_TABLE)
							.append("(filter_id, extension, mode)").append(" VALUES (?, ?, ?);");
						preStatement = con.prepareStatement(sql.toString());

						preStatement.setInt(1, filterId);
						preStatement.setString(2, extensionFilter.getExtension());
						preStatement.setInt(3, extensionFilter.getMode().getId());

						preStatement.executeUpdate();
					}
				}
				// End extension filter

				// Size filter
				if(filter.getSizeFilter() != null) {
					SizeFilter sizeFilter = filter.getSizeFilter();

					sql = new StringBuilder(128);
					sql.append("INSERT ").append(TableConstants.SIZE_FILTER_TABLE)
						.append("(filter_id, min_size, min_unit, max_size, max_unit, mode)").append(" VALUES (?, ?, ?, ?, ?, ?);");
					preStatement = con.prepareStatement(sql.toString());

					preStatement.setInt(1, filterId);
					preStatement.setInt(2, sizeFilter.getMinSize());
					preStatement.setInt(3, sizeFilter.getMinUnit().getNum());
					preStatement.setInt(4, sizeFilter.getMaxSize());
					preStatement.setInt(5, sizeFilter.getMaxUnit().getNum());
					preStatement.setInt(6, sizeFilter.getMode().getId());

					preStatement.executeUpdate();
				}
				// End size filter

				// Owner filter
				if(filter.getOwnerFilters() != null && filter.getOwnerFilters().size() >0) {
					List<OwnerFilter> filterList = filter.getOwnerFilters();

					for(OwnerFilter ownerFilter : filterList) {
						sql = new StringBuilder(128);
						sql.append("INSERT ").append(TableConstants.OWNER_FILTER_TABLE)
							.append("(filter_id, owner, options, mode)").append(" VALUES (?, ?, ?, ?);");
						preStatement = con.prepareStatement(sql.toString());

						preStatement.setInt(1, filterId);
						preStatement.setString(2, ownerFilter.getOwner());
						preStatement.setInt(3, ownerFilter.getOptions().getId());
						preStatement.setInt(4, ownerFilter.getMode().getId());

						preStatement.executeUpdate();
					}
				}
				// End owner filter

				// Group filter
				if(filter.getGroupFilters() != null && filter.getGroupFilters().size() > 0) {
					List<GroupFilter> filterList = filter.getGroupFilters();
					for(GroupFilter groupFilter : filterList) {
						sql = new StringBuilder(128);
						sql.append("INSERT ").append(TableConstants.GROUP_FILTER_TABLE)
						.append("(filter_id, groups, options, mode)").append(" VALUES (?, ?, ?, ?);");
						preStatement = con.prepareStatement(sql.toString());

						preStatement.setInt(1, filterId);
						preStatement.setString(2, groupFilter.getGroup());
						preStatement.setInt(3, groupFilter.getOptions().getId());
						preStatement.setInt(4, groupFilter.getMode().getId());

						preStatement.executeUpdate();
					}

				}
			}

			con.commit();
			con.setAutoCommit(true);
			preStatement.close();
			con.close();
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();

			try {
				con.rollback();
			} catch (SQLException exception) {
				// TODO Auto-generated catch block
				exception.printStackTrace();
			}

			closeConnection(con);
		}

		return filterId;
	}

	/**
	 * Get filter from database
	 * @param filterId
	 * @return return null if filter not found
	 */
	public Filter getFilter(int filterId) {
		Filter filter = null;

		Connection con = null;
		PreparedStatement preStatement = null;
		ResultSet rs = null;

		try {
			con = DBLoader.getInstance().getConnection();

			StringBuilder sql = new StringBuilder(128);
			sql.append("SELECT id, name, description, in_use FROM ").append(TableConstants.FILTER_TABLE).append(" WHERE id = ?");
			preStatement = con.prepareStatement(sql.toString());
			preStatement.setInt(1, filterId);

			rs = preStatement.executeQuery();

			if(rs.next()) {
				filter = new Filter();
				filter.setId(rs.getInt("id"));
				filter.setName(rs.getString("name"));
				filter.setDesc(rs.getString("description"));
				filter.setInUse(rs.getInt("in_use") == 1 ? true : false);

				// Get Date filters
				sql = new StringBuilder(128);
				sql.append("SELECT id, filter_id, date_type, date_option, start_date, end_date, mode FROM ").append(TableConstants.DATE_FILTER_TABLE).append(" WHERE filter_id = ?");
				preStatement = con.prepareStatement(sql.toString());
				preStatement.setInt(1, filterId);

				rs = preStatement.executeQuery();

				while(rs.next()) {
					int id = rs.getInt("id");
					DateType dateType = DateType.getDateTypeById(rs.getInt("date_type"));
					DateOptions option = DateOptions.getDateOptionById(rs.getInt("date_option"));
					Date startDate = new Date(rs.getDate("start_date").getTime());
					Date endDate = null;
					if(rs.getDate("end_date") != null) {
						endDate = new Date(rs.getDate("end_date").getTime());
					}
					Mode mode = Mode.getModeById(rs.getInt("mode"));
					filter.addDateFilter(id, dateType, option, startDate, endDate, mode);
				}

				// Get extension filters
				sql = new StringBuilder(128);
				sql.append("SELECT id, filter_id, extension, mode FROM ").append(TableConstants.EXTENSION_FILTER_TABLE).append(" WHERE filter_id = ?");
				preStatement = con.prepareStatement(sql.toString());
				preStatement.setInt(1, filterId);

				rs = preStatement.executeQuery();
				while(rs.next()) {
					int id = rs.getInt("id");
					String extension = rs.getString("extension");
					Mode mode = Mode.getModeById(rs.getInt("mode"));
					filter.addExtensionFilter(id, extension, mode);
				}

				// Get Size filter
				sql = new StringBuilder(128);
				sql.append("SELECT id, filter_id, min_size, min_unit, max_size, max_unit, mode FROM ").append(TableConstants.SIZE_FILTER_TABLE).append(" WHERE filter_id = ?");
				preStatement = con.prepareStatement(sql.toString());
				preStatement.setInt(1, filterId);

				rs = preStatement.executeQuery();
				if(rs.next()) {
					int id = rs.getInt("id");
					int minSize = rs.getInt("min_size");
					Unit minUnit = DataUnit.getUnitById(rs.getInt("min_unit"));
					int maxSize = rs.getInt("max_size");
					Unit maxUnit = DataUnit.getUnitById(rs.getInt("max_unit"));
					Mode mode = Mode.getModeById(rs.getInt("mode"));
					filter.setSizeFilter(id, minSize, minUnit, maxSize, maxUnit, mode);
				}

				// Get owner filters
				sql = new StringBuilder(128);
				sql.append("SELECT id, filter_id, owner, options, mode FROM ").append(TableConstants.OWNER_FILTER_TABLE).append(" WHERE filter_id = ?");
				preStatement = con.prepareStatement(sql.toString());
				preStatement.setInt(1, filterId);

				rs = preStatement.executeQuery();
				while(rs.next()) {
					int id = rs.getInt("id");
					String owner = rs.getString("owner");
					Options options = Options.getOptionById(rs.getInt("options"));
					Mode mode = Mode.getModeById(rs.getInt("mode"));
					filter.addOwnerFilter(id, owner, options, mode);
				}

				// Get group filters
				sql = new StringBuilder(128);
				sql.append("SELECT id, filter_id, groups, options, mode FROM ").append(TableConstants.GROUP_FILTER_TABLE).append(" WHERE filter_id = ?");
				preStatement = con.prepareStatement(sql.toString());
				preStatement.setInt(1, filterId);

				rs = preStatement.executeQuery();
				while(rs.next()) {
					int id = rs.getInt("id");
					String group = rs.getString("groups");
					Options options = Options.getOptionById(rs.getInt("options"));
					Mode mode = Mode.getModeById(rs.getInt("mode"));
					filter.addGroupFilter(id, group, options, mode);
				}
			}

			preStatement.close();
			con.close();

		} catch (SQLException e) {
			// TODO Auto-generated catch block
			filter = null;
			e.printStackTrace();
			closeConnection(con);
		}

		return filter;
	}

	/**
	 * Delete the filter by filter id. If filter is be used by any jobs, filter could not be deleted
	 * @param filterId
	 * @return
	 */
	public boolean delFilter(int filterId) {

		boolean success = false;

		Connection con = null;
		PreparedStatement preStatement = null;
		ResultSet rs = null;
		try {
			con = DBLoader.getInstance().getConnection();

			// Check filter if in use or not
			StringBuilder sql = new StringBuilder(128);
			sql.append("SELECT in_use FROM ").append(TableConstants.FILTER_TABLE).append(" WHERE id = ?");
			preStatement = con.prepareStatement(sql.toString());
			preStatement.setInt(1, filterId);
			rs = preStatement.executeQuery();
			if(rs.next()) {
				int isUse = rs.getInt("in_use");

				if(isUse > 0) {
					// Filter is used by jobs, can not be deleted
					success = false;
				} else {

					// Filter does not used by jobs, so it can be deleted
					con.setAutoCommit(false);

					// Delete in "filter"
					sql = new StringBuilder(128);
					sql.append("DELETE FROM ").append(TableConstants.FILTER_TABLE).append(" WHERE id = ?");
					preStatement = con.prepareStatement(sql.toString());
					preStatement.setInt(1, filterId);
					preStatement.executeUpdate();

					// Delete in "date_filter"
					sql = new StringBuilder(128);
					sql.append("DELETE FROM ").append(TableConstants.DATE_FILTER_TABLE).append(" WHERE filter_id = ?");
					preStatement = con.prepareStatement(sql.toString());
					preStatement.setInt(1, filterId);
					preStatement.executeUpdate();

					// Delete in "extension_filter"
					sql = new StringBuilder(128);
					sql.append("DELETE FROM ").append(TableConstants.EXTENSION_FILTER_TABLE).append(" WHERE filter_id = ?");
					preStatement = con.prepareStatement(sql.toString());
					preStatement.setInt(1, filterId);
					preStatement.executeUpdate();

					// Delete in "size_filter"
					sql = new StringBuilder(128);
					sql.append("DELETE FROM ").append(TableConstants.SIZE_FILTER_TABLE).append(" WHERE filter_id = ?");
					preStatement = con.prepareStatement(sql.toString());
					preStatement.setInt(1, filterId);
					preStatement.executeUpdate();

					// Delete in "owner_filter"
					sql = new StringBuilder(128);
					sql.append("DELETE FROM ").append(TableConstants.OWNER_FILTER_TABLE).append(" WHERE filter_id = ?");
					preStatement = con.prepareStatement(sql.toString());
					preStatement.setInt(1, filterId);
					preStatement.executeUpdate();

					// Delete in "group_filter"
					sql = new StringBuilder(128);
					sql.append("DELETE FROM ").append(TableConstants.GROUP_FILTER_TABLE).append(" WHERE filter_id = ?");
					preStatement = con.prepareStatement(sql.toString());
					preStatement.setInt(1, filterId);
					preStatement.executeUpdate();

					con.commit();
					con.setAutoCommit(true);
					success = true;
				}

			}

			preStatement.close();
			con.close();

		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();

			try {
				con.rollback();
			} catch (SQLException exception) {
				// TODO Auto-generated catch block
				exception.printStackTrace();
			}

			closeConnection(con);
		}

		return success;
	}

	private void closeConnection(Connection con) {
		if(con != null) {
			try {
				con.close();
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
	}
}


text:
<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
    android:oneshot="false">

    <item android:drawable="@drawable/lfr0" android:duration="500" />
    <item android:drawable="@drawable/lfr1" android:duration="500" />

</animation-list>


text:
package com.adamstyrc.cookiecutter;

import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;

/**
 * Created by adamstyrc on 04/04/16.
 */
public class CookieCutterParams {

    private int circleRadius = 400;
    private Circle circle;
    private float maxZoom = 4;
    private int minImageSize = 200;

    private int width;
    private int height;

    private HoleParams holeParams;

    Circle getCircle() {
        return circle;
    }

    public void setCircleRadius(int circleRadius) {
        this.circleRadius = circleRadius;
    }

    public int getCircleRadius() {
        return circleRadius;
    }

    public float getMaxZoom() {
        return maxZoom;
    }

    public void setMaxZoom(float maxZoom) {
        this.maxZoom = maxZoom;
    }

    public int getMinImageSize() {
        return minImageSize;
    }

    public void setMinImageSize(int minImageSize) {
        this.minImageSize = minImageSize;
    }

    void updateWithView(int width, int height) {
        this.width = width;
        this.height = height;

        circle = new Circle(width / 2, height / 2, circleRadius);

        holeParams = new HoleParams();
    }

    public HoleParams getHoleParams() {
        return holeParams;
    }

    public class HoleParams {
        Path path;
        Paint paint;

        public HoleParams() {
            setPath();

            paint = new Paint();
            paint.setColor(Color.parseColor("#AA000000"));
        }

        private void setPath() {
            path = new Path();
            path.setFillType(Path.FillType.EVEN_ODD);
            path.addRect(0, 0, width, height, Path.Direction.CW);
            path.addCircle(circle.getCx(), circle.getCy(), circle.getRadius(), Path.Direction.CW);
        }
    }
}


text:
<!DOCTYPE html>

        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">
        <title>todo</title>
        <link rel='stylesheet' href='http://fonts.googleapis.com/css?family=Crimson+Text' type='text/css'>
        <link rel="stylesheet" href="node_modules/bootstrap/dist/css/bootstrap.min.css">
        <link rel="stylesheet" href="node_modules/animate.css/animate.min.css">
        <link rel="stylesheet" href="styles/index.css">

                    things & stuff

            Why, hello there! Welcome to my list of things.
            Click or tap the button to a thing to the list.
            Click or tap a thing's label to rename it.
            Type some text in the input to filter things by name.

            <button class="btn btn-sm btn-info add-task-button" ng-click="main.addTask()">
                New thing
            </button>
            |

                <input class="form-control"
                       placeholder="Filter things"
                       ng-keyup="filter.applyFilter(main.tasks)"
                       ng-model="filter.searchPhrase">

                        {{task.name}}
                        <input class="form-control task-name-input"
                               id="task_rename_{{task.id}}"
                               type="text"
                               ng-blur="main.stopEditingAllTasks()"
                               ng-keydown="main.checkKey($event)"
                               ng-model="task.name"
                               ng-show="task.editing">

                                <button type="button" class="btn btn-sm">{{task.timeString}}</button>
                                <button ng-click="timer.resumeTask(task)"
                                        ng-hide="task.playing || task.done"
                                        type="button"
                                        class="btn btn-sm">

                                </button>
                                <button ng-click="timer.pauseTask(task)"
                                        ng-show="task.playing && !task.done"
                                        type="button"
                                        class="btn btn-sm btn-info">

                                </button>

                        <button type="button" class="btn btn-sm" data-toggle="dropdown" aria-expanded="true">

                        </button>

Label

Compensation

                                <input ng-model="task.money"
                                       class="form-control menu-input"
                                       min="0"
                                       step="0.01"
                                       type="number">

                                <input ng-model="task.beer" id="beer_toggle_{{task.id}}" type="checkbox">
                                Drink a beer after completing this.

                                <button ng-click="taskSettings.completeTask(task)" ng-hide="task.done" class="btn btn-sm complete-task">

                                </button>
                                <button ng-click="taskSettings.openTask(task)" ng-show="task.done" class="btn btn-sm btn-success">

                                </button>
                                <button ng-click="taskSettings.destroyTask(task)" class="btn btn-sm btn-danger">

                                </button>

                         0">


text:
package com.almasb.mbx;

import com.jme3.math.ColorRGBA;
import com.jme3.math.FastMath;
import com.jme3.math.Vector3f;
import com.jme3.renderer.RenderManager;
import com.jme3.renderer.ViewPort;
import com.jme3.scene.Node;
import com.jme3.scene.control.AbstractControl;
import com.jme3.ui.Picture;

public class ParticleControl extends AbstractControl {
    private int screenWidth, screenHeight;

    private Vector3f velocity;
    private float lifespan;
    private long spawnTime;
    private ColorRGBA color;

    public ParticleControl(Vector3f velocity, float lifespan, ColorRGBA color,
            int width, int height) {
        this.velocity = velocity;
        this.lifespan = lifespan;
        this.color = color;
        this.screenWidth = width;
        this.screenHeight = height;
        spawnTime = System.currentTimeMillis();
    }

    @Override
    protected void controlUpdate(float tpf) {
        // movement
        spatial.move(velocity.mult(tpf * 3f));
        velocity.multLocal(1 - 3f * tpf);
        if (Math.abs(velocity.x) + Math.abs(velocity.y) < 0.001f) {
            velocity = Vector3f.ZERO;
        }

        // particle off screen?
        Vector3f loc = spatial.getLocalTranslation();
        if (loc.x < 0) {
            velocity.x = Math.abs(velocity.x);
        }
        else if (loc.x > screenWidth) {
            velocity.x = -Math.abs(velocity.x);
        }
        if (loc.z < 0) {
            velocity.y = Math.abs(velocity.y);
        }
        else if (loc.y > screenHeight) {
            velocity.y = -Math.abs(velocity.y);
        }

        // rotation
        if (velocity != Vector3f.ZERO) {
            spatial.rotateUpTo(velocity.normalize());
            spatial.rotate(0, 0, FastMath.PI / 2f);
        }

        // scaling and alpha
        float speed = velocity.length();
        long difTime = System.currentTimeMillis() - spawnTime;
        float percentLife = 1 - difTime / lifespan;
        float alpha = lesserValue(1.5f, lesserValue(percentLife * 2, speed));
        alpha *= alpha;
        setAlpha(alpha);

        spatial.setLocalScale(0.3f + lesserValue(
                lesserValue(1.5f, 0.02f * speed + 0.1f), alpha));
        spatial.scale(0.65f);

        // is particle expired?
        if (difTime > lifespan) {
            spatial.removeFromParent();
        }
    }

    @Override
    protected void controlRender(RenderManager rm, ViewPort vp) {}

    private float lesserValue(float a, float b) {
        return a < b ? a : b;
    }

    private void setAlpha(float alpha) {
        color.set(color.r, color.g, color.b, alpha);
        Node spatialNode = (Node) spatial;
        Picture pic = (Picture) spatialNode.getChild(spatialNode.getName());
        pic.getMaterial().setColor("Color", color);
    }

    public void applyGravity(Vector3f gravity, float distance) {
        Vector3f additionalVelocity = gravity
                .mult(1000f / (distance * distance + 10000f));
        velocity.addLocal(additionalVelocity);

        if (distance < 400) {
            additionalVelocity = new Vector3f(gravity.y, -gravity.x, 0)
                    .mult(3f / (distance + 100));
            velocity.addLocal(additionalVelocity);
        }
    }
}


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 com.google.devtools.j2objc.translate;

import com.google.common.collect.Lists;
import com.google.devtools.j2objc.Options;
import com.google.devtools.j2objc.ast.Block;
import com.google.devtools.j2objc.ast.ExpressionStatement;
import com.google.devtools.j2objc.ast.FieldAccess;
import com.google.devtools.j2objc.ast.FunctionInvocation;
import com.google.devtools.j2objc.ast.MethodDeclaration;
import com.google.devtools.j2objc.ast.MethodInvocation;
import com.google.devtools.j2objc.ast.PrefixExpression;
import com.google.devtools.j2objc.ast.SimpleName;
import com.google.devtools.j2objc.ast.SingleVariableDeclaration;
import com.google.devtools.j2objc.ast.Statement;
import com.google.devtools.j2objc.ast.SuperMethodInvocation;
import com.google.devtools.j2objc.ast.TreeUtil;
import com.google.devtools.j2objc.ast.TreeVisitor;
import com.google.devtools.j2objc.ast.TypeDeclaration;
import com.google.devtools.j2objc.ast.VariableDeclarationFragment;
import com.google.devtools.j2objc.types.FunctionBinding;
import com.google.devtools.j2objc.types.GeneratedVariableBinding;
import com.google.devtools.j2objc.types.IOSMethodBinding;
import com.google.devtools.j2objc.util.BindingUtil;

import org.eclipse.jdt.core.dom.ITypeBinding;
import org.eclipse.jdt.core.dom.IVariableBinding;
import org.eclipse.jdt.core.dom.Modifier;

import java.util.List;

/**
 * Writes the __javaClone method in order to support correct Java clone()
 * behavior.
 *
 * @author Keith Stanger
 */
public class JavaCloneWriter extends TreeVisitor {

  private static final String JAVA_CLONE_METHOD = "__javaClone:";

  @Override
  public void endVisit(TypeDeclaration node) {
    ITypeBinding type = node.getTypeBinding();
    IVariableBinding originalVar = new GeneratedVariableBinding(
        "original", 0, type, false, true, null, null);
    List<Statement> adjustments = getFieldAdjustments(node, originalVar);
    if (adjustments.isEmpty()) {
      return;
    }

    ITypeBinding voidType = typeEnv.resolveJavaType("void");
    int modifiers = Modifier.PUBLIC | BindingUtil.ACC_SYNTHETIC;
    IOSMethodBinding methodBinding = IOSMethodBinding.newMethod(
        JAVA_CLONE_METHOD, modifiers, voidType, type);
    methodBinding.addParameter(type);

    MethodDeclaration declaration = new MethodDeclaration(methodBinding);
    node.getBodyDeclarations().add(declaration);
    declaration.getParameters().add(new SingleVariableDeclaration(originalVar));

    Block body = new Block();
    declaration.setBody(body);
    List<Statement> statements = body.getStatements();

    ITypeBinding nsObjectType = typeEnv.resolveIOSType("NSObject");
    IOSMethodBinding cloneMethod = IOSMethodBinding.newMethod(
        JAVA_CLONE_METHOD, Modifier.PUBLIC, voidType, nsObjectType);
    SuperMethodInvocation superCall = new SuperMethodInvocation(cloneMethod);
    superCall.getArguments().add(new SimpleName(originalVar));
    statements.add(new ExpressionStatement(superCall));

    statements.addAll(adjustments);
  }

  private List<Statement> getFieldAdjustments(TypeDeclaration node, IVariableBinding originalVar) {
    List<Statement> adjustments = Lists.newArrayList();
    for (VariableDeclarationFragment decl : TreeUtil.getAllFields(node)) {
      IVariableBinding var = decl.getVariableBinding();
      if (BindingUtil.isStatic(var) || var.getType().isPrimitive()) {
        continue;
      }
      boolean isWeak = BindingUtil.isWeakReference(var);
      boolean isVolatile = BindingUtil.isVolatile(var);
      if (isVolatile) {
        adjustments.add(createVolatileCloneStatement(var, originalVar, isWeak));
      } else if (isWeak) {
        adjustments.add(createReleaseStatement(var));
      }
    }
    return adjustments;
  }

  private Statement createReleaseStatement(IVariableBinding var) {
    if (Options.useARC()) {
      ITypeBinding voidType = typeEnv.resolveJavaType("void");
      FunctionBinding binding = new FunctionBinding("JreRelease", voidType, null);
      binding.addParameter(typeEnv.resolveIOSType("id"));
      FunctionInvocation invocation = new FunctionInvocation(binding, voidType);
      invocation.getArguments().add(new SimpleName(var));
      return new ExpressionStatement(invocation);
    } else {
      return new ExpressionStatement(
          new MethodInvocation(typeEnv.getReleaseMethod(), new SimpleName(var)));
    }
  }

  private Statement createVolatileCloneStatement(
      IVariableBinding var, IVariableBinding originalVar, boolean isWeak) {
    ITypeBinding voidType = typeEnv.resolveJavaType("void");
    ITypeBinding pointerType = typeEnv.getPointerType(var.getType());
    String funcName = "JreCloneVolatile" + (isWeak ? "" : "Strong");
    FunctionBinding binding = new FunctionBinding(funcName, voidType, null);
    binding.addParameters(pointerType, pointerType);
    FunctionInvocation invocation = new FunctionInvocation(binding, voidType);
    invocation.getArguments().add(new PrefixExpression(
        pointerType, PrefixExpression.Operator.ADDRESS_OF, new SimpleName(var)));
    invocation.getArguments().add(new PrefixExpression(
        pointerType, PrefixExpression.Operator.ADDRESS_OF,
        new FieldAccess(var, new SimpleName(originalVar))));
    return new ExpressionStatement(invocation);
  }
}


text:
using System;

namespace TekConf.Web.ViewModels
{
	public class ConferenceDetailDto
	{
		public string Slug { get; set; }

		public string Name { get; set; }
		public string ImageUrl { get; set; }
		public DateTime? Start { get; set; }
		public DateTime? End { get; set; }
		public string Description { get; set; }
		public bool IsOnline { get; set; }
		public string HomepageUrl { get; set; }
		public string TwitterName { get; set; }
		public string TwitterHashTag { get; set; }
		public string FacebookUrl { get; set; }
		public string LanyrdUrl { get; set; }
		public string MeetupUrl { get; set; }
		public string GooglePlusUrl { get; set; }
		public string VimeoUrl { get; set; }
		public string YoutubeUrl { get; set; }
		public string GithubUrl { get; set; }
		public string LinkedInUrl { get; set; }
		public DateTime? LastUpdatedDate { get; set; }
		public virtual LocationDto Location { get; set; }

		public string DateRange
		{
			get
			{

				string range;
				if (!Start.HasValue || !End.HasValue)
				{
					range = "No Date Set";
				}
				else if (Start.Value.Month == End.Value.Month && Start.Value.Year == End.Value.Year)
				{
					// They begin and end in the same month
					if (Start.Value.Date == End.Value.Date)
					{
						range = Start.Value.ToString("MMMM") + " " + Start.Value.Day + ", " + Start.Value.Year;
					}
					else
						range = Start.Value.ToString("MMMM") + " " + Start.Value.Day + " - " + End.Value.Day + ", " + Start.Value.Year;
				}
				else
				{
					// They begin and end in different months
					if (Start.Value.Year == End.Value.Year)
					{
						range = Start.Value.ToString("MMMM") + " " + Start.Value.Day + " - " + End.Value.ToString("MMMM") + " " + End.Value.Day + ", " + Start.Value.Year;
					}
					else
					{
						range = Start.Value.ToString("MMMM") + " " + Start.Value.Day + ", " + Start.Value.Year + " - " + End.Value.ToString("MMMM") + " " + End.Value.Day + ", " + End.Value.Year;
					}
				}

				return range;
			}
		}

		public string FormattedAddress
		{
			get
			{
				string formattedAddress;
				if (IsOnline == true)
				{
					formattedAddress = "online";
				}
				else if (Location == null)
				{
					formattedAddress = "No location set";
				}
				else if (!string.IsNullOrWhiteSpace(Location.City) && !string.IsNullOrWhiteSpace(Location.State))
				{
					formattedAddress = Location.City + ", " + Location.State;
				}
				else if (!string.IsNullOrWhiteSpace(Location.City) && !string.IsNullOrWhiteSpace(Location.Country))
				{
					formattedAddress = Location.City + ", " + Location.Country;
				}
				else if (!string.IsNullOrWhiteSpace(Location.City))
				{
					formattedAddress = Location.City;
				}
				else
				{
					formattedAddress = "No location set";
				}

				return formattedAddress;
			}
		}
	}
}


text:
SLF4J
===================

This module allows directing Feign's logging to [SLF4J](http://www.slf4j.org/), allowing you to easily use a logging backend of your choice (Logback, Log4J, etc.)

To use SLF4J with Feign, add both the SLF4J module and an SLF4J binding of your choice to your classpath.  Then, configure Feign to use the Slf4jLogger:

```java
GitHub github = Feign.builder()
                     .logger(new Slf4jLogger())
                     .target(GitHub.class, "https://api.github.com");
```


text:
//
//  vector3.h
//  ASongOfAily
//
//  Created by dust on 5/13/16.
//  Copyright © 2016 Aily. All rights reserved.
//

#ifndef vector3_h
#define vector3_h

#include "supports/utils.h"

NAMESPACE_MINT3D_BEGIN

class Vector3 {
public:
    float x;
    float y;
    float z;

    static Vector3 zero();

    Vector3();
    Vector3(float x, float y, float z);

    void normalize();

    Vector3 operator + (const Vector3 & other) const;
    Vector3 operator - (const Vector3 & other) const;
    Vector3 operator / (float val) const;

    Vector3 cross(const Vector3 & other) const;

    float length() const;
    float lengthSq() const;

    float dot(const Vector3 &v) const;

    void dump();
};

NAMESPACE_MINT3D_END
#endif /* vector3_h */


text:
package com.chillenious.common.util;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.Reader;
import java.net.URL;
import java.net.URLConnection;
import java.util.Properties;

/**
 * Utilities methods for working with input and output streams.
 *
 * @author Jonathan Locke
 * @author Igor Vaynberg
 */
public final class Streams {
    /**
     * Writes the input stream to the output stream. Input is done without a Reader object, meaning
     * that the input is copied in its raw form.
     *
     * @param in  The input stream
     * @param out The output stream
     * @return Number of bytes copied from one stream to the other
     * @throws java.io.IOException
     */
    public static int copy(final InputStream in, final OutputStream out) throws IOException {
        return copy(in, out, 4096);
    }

    /**
     * Writes the input stream to the output stream. Input is done without a Reader object, meaning
     * that the input is copied in its raw form.
     *
     * @param in      The input stream
     * @param out     The output stream
     * @param bufSize The buffer size. A good value is 4096.
     * @return Number of bytes copied from one stream to the other
     * @throws java.io.IOException
     */
    public static int copy(final InputStream in, final OutputStream out, final int bufSize)
            throws IOException {
        if (bufSize <= 0) {
            throw new IllegalArgumentException("The parameter 'bufSize' must not be <= 0");
        }

        final byte[] buffer = new byte[bufSize];
        int bytesCopied = 0;
        while (true) {
            int byteCount = in.read(buffer, 0, buffer.length);
            if (byteCount <= 0) {
                break;
            }
            out.write(buffer, 0, byteCount);
            bytesCopied += byteCount;
        }
        return bytesCopied;
    }

    /**
     * Loads properties from an XML input stream into the provided properties object.
     *
     * @param properties  The object to load the properties into
     * @param inputStream
     * @throws java.io.IOException When the input stream could not be read from
     */
    public static void loadFromXml(final Properties properties, final InputStream inputStream)
            throws IOException {
        if (properties == null) {
            throw new IllegalArgumentException("properties must not be null");
        }
        if (inputStream == null) {
            throw new IllegalArgumentException("inputStream must not be null");
        }

        properties.loadFromXML(inputStream);
    }

    /**
     * Sets the connection to a URL as non-caching and returns the input stream.
     *
     * @param url the url to read from
     * @return the input stream for this url
     * @throws java.io.IOException when a connection cannot be opened
     */
    public static InputStream readNonCaching(final URL url) throws IOException {
        Args.notNull(url, "url");

        URLConnection urlConnection = url.openConnection();
        urlConnection.setUseCaches(false);
        InputStream inputStream = urlConnection.getInputStream();
        return inputStream;
    }

    /**
     * Reads a stream as a string.
     *
     * @param in The input stream
     * @return The string
     * @throws java.io.IOException
     */
    public static String readString(final InputStream in) throws IOException {
        return readString(new BufferedReader(new InputStreamReader(in)));
    }

    /**
     * Reads a string using a character encoding.
     *
     * @param in       The input
     * @param encoding The character encoding of the input data
     * @return The string
     * @throws java.io.IOException
     */
    public static String readString(final InputStream in, final CharSequence encoding)
            throws IOException {
        return readString(new BufferedReader(new InputStreamReader(in, encoding.toString())));
    }

    /**
     * Reads all input from a reader into a string.
     *
     * @param in The input
     * @return The string
     * @throws java.io.IOException
     */
    public static String readString(final Reader in) throws IOException {
        final StringBuilder buffer = new StringBuilder(2048);
        int value;

        while ((value = in.read()) != -1) {
            buffer.append((char) value);
        }

        return buffer.toString();
    }

    /**
     * Private to prevent instantiation.
     */
    private Streams() {
    }
}


text:
<?php

namespace Micro\Session\Validator;

interface ValidatorInterface
{
    /**
     * Setup() - this method will store the environment variables
     * necessary to be able to validate against in future requests.
     *
     * @return void
     */
    public function setup();

    /**
     * Validate() - this method will be called at the beginning of
     * every session to determine if the current environment matches
     * that which was store in the setup() procedure.
     *
     * @return boolean
     */
    public function validate();
}


text:
package org.yapp.db.converter;

import android.database.Cursor;

import org.yapp.db.sqlite.ColumnDbType;

public class LongColumnConverter implements ColumnConverter<Long> {
    @Override
    public Long getFieldValue(final Cursor cursor, int index) {
        return cursor.isNull(index) ? null : cursor.getLong(index);
    }

    @Override
    public Object fieldValue2DbValue(Long fieldValue) {
        return fieldValue;
    }

    @Override
    public ColumnDbType getColumnDbType() {
        return ColumnDbType.INTEGER;
    }
}


text:
<!DOCTYPE html>

	<meta charset="utf-8">
	<title>Eye Of Things</title>

	<link rel="stylesheet" href="css/style.css">

Eye Of Things - Berkeley

		<form><select id="4th-selector" class='selectors' size="4"></select></form>
		<form><select id="3rd-selector" class='selectors' size="4"></select></form>
		<form><select id="2nd-selector" class='selectors' size="4"></select></form>
		<form><select id="1st-selector" class='selectors' size="4"></select></form>
		<button id='apply-btn' type="button">Apply</button>


text:
package database

import (
	"errors"
	"strings"
)

const (
	// NotificationServiceEmail type for email notifications.
	NotificationServiceEmail = "email"

	// NotificationServiceSlack type for slack notifications.
	NotificationServiceSlack = "slack"

	// NotificationServiceCampfire type for campfire notifications.
	NotificationServiceCampfire = "campfire"

	// NotificationServiceHipchat type for hipchat notifications.
	NotificationServiceHipchat = "hipchat"
)

// Notification stores the configuration needed for a notification plugin to
// work. All optiones required by the services are stored as map - it is the
// job of the notification plugin to access them correctly and handle missing
// ones.
type Notification struct {
	ID        int64
	Service   string
	Arguments string

	Repository   Repository
	RepositoryID int64 `sql:"index"`
}

// CreateNotification create a new notification for a repository.
func CreateNotification(service, arguments string, repo *Repository) (*Notification, error) {
	not := Notification{
		Service:    service,
		Arguments:  arguments,
		Repository: *repo,
	}

	db.Save(&not)

	return &not, nil
}

// GetNotification returns a notification.
func GetNotification(id int64) (*Notification, error) {
	not := &Notification{}
	db.Where("id = ?", id).First(&not)
	return not, nil
}

// GetNotificationForRepoAndType returns a specific notification for a repository.
func GetNotificationForRepoAndType(repo *Repository, service string) (*Notification, error) {
	not := &Notification{}
	db.Where("repository_id = ? AND service = ?", repo.ID, service).First(&not)
	return not, nil
}

// Update this notification.
func (n *Notification) Update(service, arguments string) error {
	n.Service = service
	n.Arguments = arguments
	db.Save(n)
	return nil
}

// Delete this notification.
func (n *Notification) Delete() {
	db.Delete(n)
}

// GetConfigValue returns a configuration value for a given key that is stored in Arguments.
func (n *Notification) GetConfigValue(key string) (string, error) {
	if n.Arguments == "" {
		return "", errors.New("No Arguments defined.")
	}

	for _, pair := range strings.Split(n.Arguments, ":::::") {
		split := strings.Split(pair, ":::")

		if split[0] == key {
			return split[1], nil
		}
	}

	return "", errors.New("Not found.")
}


text:
import * as React from 'react';
import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core/styles';
import CardMedia from '@material-ui/core/CardMedia';
import Grid from '@material-ui/core/Grid';
import Paper from '@material-ui/core/Paper';
import Typography from '@material-ui/core/Typography';
import IconButton from '@material-ui/core/IconButton';
import GitHubIcon from '@material-ui/icons/GitHub';
import TwitterIcon from '@material-ui/icons/Twitter';

const activeCore = [
  {
    name: 'Olivier Tassinari',
    github: 'oliviertassinari',
    twitter: 'olivtassinari',
    flag: 'v1.x co-creator',
    location: 'Paris, France',
  },
  {
    name: 'Matt Brookes',
    github: 'mbrookes',
    twitter: 'randomtechdude',
    flag: 'Pioneer',
    location: 'London, UK',
  },
  {
    name: 'Sebastian Silbermann',
    github: 'eps1lon',
    twitter: 'sebsilbermann',
    flag: 'Core components team',
    location: 'Dresden, Germany',
  },
  {
    name: 'Damien Tassone',
    github: 'dtassone',
    twitter: 'madKakoO',
    flag: 'Advanced components team',
    location: 'Barcelona, Spain',
  },
  {
    name: 'Marija Najdova',
    github: 'mnajdova',
    twitter: 'marijanajdova',
    flag: 'Core components team',
    location: 'Skopje, North Macedonia',
  },
  {
    name: 'Danail Hadjiatanasov',
    github: 'DanailH',
    twitter: 'danail_h',
    flag: 'Advanced components team',
    location: 'Amsterdam, Netherlands',
  },
  {
    name: 'Josh Wooding',
    github: 'joshwooding',
    twitter: 'JoshWooding_',
    flag: 'Community member, J.P. Morgan',
    location: 'London, UK',
  },
  {
    name: 'Matheus Wichman',
    github: 'm4theushw',
    flag: 'Advanced components team',
    location: 'Esteio, Brazil',
  },
];

const community = [
  {
    name: 'Dmitriy Kovalenko',
    github: 'dmtrKovalenko',
    twitter: 'dmtrKovalenko',
    flag: 'Date pickers',
    location: 'Kharkiv, Ukraine',
  },
  {
    name: 'Danica Shen',
    github: 'DDDDDanica',
    flag: '🇨🇳 Chinese docs',
    location: 'Ireland',
  },
  {
    name: 'Yan Lee',
    github: 'AGDholo',
    flag: '🇨🇳 Chinese docs',
    location: 'China',
  },
  {
    name: 'Jairon Alves Lima',
    github: 'jaironalves',
    flag: '🇧🇷 Brazilian docs',
    location: 'São Paulo, Brazil',
  },
  {
    name: 'Oleg Slobodskoi',
    github: 'kof',
    twitter: 'oleg008',
    flag: 'JSS',
    location: 'Berlin, Germany',
  },
];

const emeriti = [
  {
    name: 'Hai Nguyen',
    github: 'hai-cea',
    twitter: 'haicea',
    flag: 'v0.x creator',
    location: 'Dallas, Texas, US',
  },
  {
    name: 'Nathan Marks',
    github: 'nathanmarks',
    flag: 'v1.x co-creator',
    location: 'Toronto, ON',
  },
  {
    name: 'Kevin Ross',
    github: 'rosskevin',
    twitter: 'rosskevin',
    flag: 'Core focus',
    location: 'Franklin, Tennessee, US',
  },
  {
    name: 'Sebastian Sebald',
    github: 'sebald',
    twitter: 'sebastiansebald',
    flag: 'Core focus',
    location: 'Freiburg, Germany',
  },
  {
    name: 'Ken Gregory',
    github: 'kgregory',
    flag: 'Core focus',
    location: 'New Jersey, US',
  },
  {
    name: 'Tom Crockett',
    github: 'pelotom',
    twitter: 'pelotom',
    flag: 'Core focus',
    location: 'Los Angeles, California, US',
  },
  {
    name: 'Maik Marschner',
    github: 'leMaik',
    twitter: 'leMaikOfficial',
    flag: 'Core focus',
    location: 'Hannover, Germany',
  },
];

const styles = (theme) => ({
  details: {
    margin: theme.spacing(1, 1, 1, 0),
  },
  cover: {
    width: theme.spacing(10),
    height: theme.spacing(10),
    margin: theme.spacing(2),
    borderRadius: '50%',
    flexShrink: 0,
    backgroundColor: theme.palette.background.default,
  },
  icon: {
    fontSize: 18,
    padding: theme.spacing(1),
  },
  container: {
    margin: theme.spacing(2, 0, 4),
  },
});

function Group(props) {
  const { title, description, classes, members } = props;
  return (

      <Typography gutterBottom component="h2" variant="h5">
        {title}
      </Typography>
      <Typography>{description}</Typography>
      <Grid container spacing={2} className={classes.container}>
        {members.map((member) => (
          <Grid key={member.name} item xs={12} md={6}>
            <Paper variant="outlined">
              <Grid container wrap="nowrap">
                <Grid item>
                  <CardMedia
                    className={classes.cover}
                    image={`https://github.com/${member.github}.png`}
                    title="Avatar"
                  />
                </Grid>
                <Grid item>

                    <Typography component="h3" variant="h6">
                      {member.name}
                    </Typography>
                    <Typography variant="body2" color="text.secondary">
                      {member.flag}
                    </Typography>
                    <Typography variant="body2" color="text.secondary">
                      {member.location}
                    </Typography>
                    <Grid container>
                      {member.github && (
                        <IconButton
                          aria-label="github"
                          component="a"
                          href={`https://github.com/${member.github}`}
                          className={classes.icon}
                        >
                          <GitHubIcon fontSize="inherit" />
                        </IconButton>
                      )}
                      {member.twitter && (
                        <IconButton
                          aria-label="twitter"
                          component="a"
                          href={`https://twitter.com/${member.twitter}`}
                          className={classes.icon}
                        >
                          <TwitterIcon fontSize="inherit" />
                        </IconButton>
                      )}
                    </Grid>

                </Grid>
              </Grid>
            </Paper>
          </Grid>
        ))}
      </Grid>

  );
}

Group.propTypes = {
  classes: PropTypes.object.isRequired,
  description: PropTypes.string.isRequired,
  members: PropTypes.array.isRequired,
  title: PropTypes.string.isRequired,
};

function Team(props) {
  return (

      <Group
        title="Core team"
        description={`The development of the project and its ecosystem is
guided by an international team,
some of whom have chosen to be featured below.`}
        members={activeCore}
        {...props}
      />
      <Group
        title="Community contributors"
        description={`Some members of the community have so enriched it,
      that they deserve special mention.`}
        members={community}
        {...props}
      />
      <Group
        title="Community emeriti"
        description={`We honor some no-longer-active core team members who have made
valuable contributions in the past.
They advise us from time-to-time.`}
        members={emeriti}
        {...props}
      />

  );
}

export default withStyles(styles)(Team);


text:
local t = Def.ActorFrame{}
t[#t+1] = LoadActor("bg")
t[#t+1] = LoadActor("ScreenFilter")
--t[#t+1] = LoadActor("cbHighlight")
--t[#t+1] = LoadActor("SpeedChange")
--t[#t+1] = LoadActor("pause")
return t --hurr almost everything here is useless


text:
/*! \file IR.hh
	Intermediate Representation Constructs
*/
#pragma once

#include <string>
#include <map>
#include <vector>
namespace Torii {
	namespace Core {
		namespace IR {
			/* Symbol */
			/*! \enum Torii::Core::IR::SymbolState
				State of the symbol for the table
			*/
			enum class SymbolState {
				Undefined,		/*!< The symbol is undefined, meaning that there is not a previous occurrence of the symbol */
				Defined,		/*!< The symbol has been defined, or it has a value */
				Unknown			/*!< The symbol is in a state of WTF */
			};
			/*! \enum Torii::Core::IR::SymbolType
				The type of symbol
			*/
			enum class SymbolType {
				Lable			/*!< The symbol is a label, meaning the value is the offset to this position */
			};
			/*! \class Torii::Core::IR::Symbol
				\brief Structure for symbols
			*/
			struct Symbol {
				SymbolState State;
				SymbolType Type;
				std::string SymbolName;
				std::string Value;
			};
			/*! A quick helper for the table */
			typedef std::map<std::string, Torii::Core::IR::Symbol> SymbolTable;
			/* Assembler Directive */

			/* Instructions */
			/*! \enum Torii::Core::IR::OperandType
				What type the operand is it
			*/
			enum class OperandType {
				Register,		/*!< The given operand is a register */
				Expression,		/*!< The given operand is an expression */
				Symbol			/*!< The given operand is a symbol */
			};
			/*! \class Torii::Core::IR::Operand
				\brief Operands for instructions

				Holds the type and value of the given operand

			*/
			struct Operand {
				OperandType type;
				// union Operand {

				// };
			};
			/*! \class Torii::Core::IR:Instruction2
				\brief Dual operand instruction

				This instruction line holds two operands
			*/
			struct Instruction2 {
				std::string Instruction;
				Operand op1;
				Operand op2;
			};
			/*! \class Torii::Core::IR::Instruction1
				\brief Single operand instruction

				This instruction holds only a single operand
			*/
			struct  Instruction1 {
				std::string Instruction;
				Operand op;
			};
			/*! \class Torii::Core::IR::Instruction
				\brief No operand instruction

				This instruction is just an instruction and has no operands
			*/
			struct Instruction {
				std::string Instruction;
			};

			class IRNode {};
		}
	}
}


text:
python gen_abc.py > abc

debugfs -w Jayson-Grace_Dominic-Salas_437disk -f 3cCommands

rm abc

#sudo mkdir /media/mount

#sudo mount -t ext2 Jayson-Grace_Dominic-Salas_437disk /media/mount

#cp ./abc /media/mount


text:
"""
Created on Mon March 24, 2011

@author:Isabel Restrepo

Script used to inspect the voxels contained in .ply objects
"""
import os;
import dbrec3d_batch
import time
import optparse
import sys
import glob

class dbvalue:
  def __init__(self, index, type):
    self.id = index    # unsigned integer
    self.type = type   # string

#*******************The Main Algorithm ************************#
if __name__=="__main__":
  dbrec3d_batch.register_processes();
  dbrec3d_batch.register_datatypes();

  scene_in = "/Users/isa/Experiments/helicopter_providence/boxm_scenes/site1/mean_color_scene.xml";
  obj_name = "planes";

  ply_path_in ="/Users/isa/Experiments/helicopter_providence/ground_truth_original/site1/planes"
  ply_path_out="/Users/isa/Experiments/helicopter_providence/ground_truth_processed/site1/planes"
  scale = 1e3;
  start_time = time.time();

  if not os.path.isdir(ply_path_out +"/"):
    os.makedirs(ply_path_out + "/");

  if not os.path.isdir(ply_path_out +"/drishti/"):
    os.mkdir(ply_path_out + "/drishti/");

#  ply_files = glob.glob1(ply_path_in, "*.ply");
#
#  print ply_files
#
#  for file in ply_files:
#
#    dbrec3d_batch.init_process("bofScalePLYProcess");
#    dbrec3d_batch.set_input_string(0,ply_path_in + '/' + file);
#    dbrec3d_batch.set_input_string(1,ply_path_out + '/' + file);
#    dbrec3d_batch.set_input_double(2,scale);
#    dbrec3d_batch.run_process();

  #*********** Save a scene labeling objects for debigging purposes **************#

  print("Creating a Scene");
  dbrec3d_batch.init_process("boxmCreateSceneProcess");
  dbrec3d_batch.set_input_string(0, scene_in);
  dbrec3d_batch.run_process();
  (id, type) = dbrec3d_batch.commit_output(0);
  scene= dbvalue(id, type);

  dbrec3d_batch.init_process("bofExamineGroundTruthProcess");
  dbrec3d_batch.set_input_from_db(0,scene);
  dbrec3d_batch.set_input_string(1,ply_path_out);
  dbrec3d_batch.set_input_string(2,obj_name);
  dbrec3d_batch.set_input_string(3,ply_path_out);
  dbrec3d_batch.run_process();
  (id, type) = dbrec3d_batch.commit_output(0);
  scene_out= dbvalue(id, type);

  print("Save Scene");
  dbrec3d_batch.init_process("boxmSaveSceneRawProcess");
  dbrec3d_batch.set_input_from_db(0,scene_out);
  dbrec3d_batch.set_input_string(1, ply_path_out + "/drishti/labeled_scene_level_0");
  dbrec3d_batch.set_input_unsigned(2,0);
  dbrec3d_batch.set_input_unsigned(3,1);
  dbrec3d_batch.run_process();

  print ("Total running time: ");
  print(time.time() - start_time);


text:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context=".WeatherTest" >

    <TextView
        android:id="@+id/text"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/hello_world" />

    <Button
        android:id="@+id/send_request"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:text="Send Request"
        />

</RelativeLayout>


text:
This is the repository for my personal website, found at [katy-ereira.co.uk](http://katy-ereira.co.uk)

## Prerequisites

* **PHP 5.4** or above
* **[Composer](https://getcomposer.org/)** for dependency management

## Installation

Clone the repository to your desired location:

`git clone https://github.com/maccath/katyereira.git`

Run the following command to install dependencies:

`composer install --no-dev`

Point your virtual host at the `public/` directory.

## Credits

Based on Baun CMS. Baun was created by [Gilbert Pellegrom](http://gilbert.pellegrom.me) from
[Dev7studios](http://dev7studios.com). Released under the MIT license.


text:
package com.kingofgranges.max.animeultimetv.libs;

import android.content.Context;
import android.util.Log;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.text.SimpleDateFormat;
import java.util.Date;

public class History {

    private final Context context;
    public final String fileSaveTarget = "history";

    public History(Context context){
        this.context = context;
    }

    public void addHistory(String histAnime, String histEpisode, String urlTarget){
        try {
            JSONArray currData = getHistoryAsJson();
            JSONObject newHist = new JSONObject();
            newHist.put("anime", histAnime);
            newHist.put("episode", histEpisode);
            newHist.put("url", urlTarget);
            newHist.put("date", (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", context.getResources().getConfiguration().locale)).format(new Date()));
            currData.put(newHist);
            writeToFile(currData.toString(), fileSaveTarget);
        } catch (JSONException e) {
            e.printStackTrace();
        }
    }

    public String[][] getHistory(){
        JSONArray data = getHistoryAsJson();
        String[][] arrayOfArrays = new String[data != null ? data.length() : 0][];
        for (int i = 0; i < (data != null ? data.length() : 0); i++) {
            JSONObject innerJsonObject;
            try {
                innerJsonObject = (JSONObject) data.get(i);
                String[] stringArray = new String[4];
                for (int j = 0; j < innerJsonObject.length(); j++) {
                    stringArray[0] = (String) innerJsonObject.get("anime");
                    stringArray[1] = (String) innerJsonObject.get("episode");
                    stringArray[2] = (String) innerJsonObject.get("url");
                    stringArray[3] = (String) innerJsonObject.get("date");
                }
                arrayOfArrays[i] = stringArray;
            } catch (JSONException e) {
                e.printStackTrace();
            }
        }
        String[][] invertedList = new String[arrayOfArrays.length][];
        for(int i = 0; i < arrayOfArrays.length; i ++) {
            invertedList[i] = arrayOfArrays[arrayOfArrays.length - 1 - i];
        }
        return invertedList;
    }

    private JSONArray getHistoryAsJson(){
        try {
            return new JSONArray(readFromFile(fileSaveTarget));
        } catch (JSONException e) {
            e.printStackTrace();
        }
        return null;
    }

    private void writeToFile(String data, String file) {
        try {
            OutputStreamWriter outputStreamWriter = new OutputStreamWriter(context.openFileOutput(file, Context.MODE_PRIVATE));
            outputStreamWriter.write(data);
            outputStreamWriter.close();
        }
        catch (IOException e) {
            Log.e("Exception", "File write failed: " + e.toString());
        }
    }

    private String readFromFile(String file) {
        String ret = "";
        try {
            InputStream inputStream = context.openFileInput(file);
            if ( inputStream != null ) {
                InputStreamReader inputStreamReader = new InputStreamReader(inputStream);
                BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
                String receiveString = "";
                StringBuilder stringBuilder = new StringBuilder();

                while ( (receiveString = bufferedReader.readLine()) != null ) {
                    stringBuilder.append(receiveString);
                }

                inputStream.close();
                ret = stringBuilder.toString();
            }
        }
        catch (FileNotFoundException e) {
            writeToFile("[]", fileSaveTarget);
            ret = "[]";
        } catch (IOException e) {
            Log.e("login activity", "Can not read file: " + e.toString());
        }

        return ret;
    }

    public void deleteHistory() {
        writeToFile("[]", fileSaveTarget);
    }
}


text:
<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "penerimaan_barang".
 *
 * @property string $no_penerimaan
 * @property string $tanggal_penerimaan
 * @property string $supplier
 * @property string $no_po
 * @property string $pengirim
 * @property string $keterangan
 */
class PenerimaanBarang extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'penerimaan_barang';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['no_penerimaan'], 'unique'],
            [['no_penerimaan', 'tanggal_penerimaan'], 'required'],
            [['tanggal_penerimaan'], 'safe'],
            [['tanggal_penerimaan'], 'default','value'=>date('Y-m-d H:i')],
            [['no_penerimaan', 'supplier', 'no_po', 'pengirim', 'keterangan'], 'string', 'max' => 255],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'no_penerimaan' => 'No Penerimaan',
            'tanggal_penerimaan' => 'Tanggal Penerimaan',
            'supplier' => 'Supplier',
            'no_po' => 'No Po',
            'pengirim' => 'Pengirim',
            'keterangan' => 'Keterangan',
            'tgl1' => 'Periode Penerimaan',
        ];
    }

    public function getDetails()
    {
        return $this->hasMany(PenerimaanBarangDetail::className(), ['no_penerimaan' => 'no_penerimaan']);
    }
}


text:
package me.justinkrejcha.ccgame;

public class Building {
	private String name;
	private int basePrice;
	private int amount;
	private double bonus;

	public Building(String name, int basePrice, double bonus) {
		this(name, basePrice, 0, bonus);
	}

	public Building(String name, int basePrice, int amount, double bonus) {
		this.name = name;
		this.basePrice = basePrice;
		this.amount = amount;
		this.bonus = bonus;
	}

	/**
	* Gets the name of this building.
	* @return Building's name.
	*/
	public String getName() {
		return name;
	}

	/**
	* Returns the base price. Use getPrice() if you want to get the cost for
	* this item.
	* @return Base price for this item.
	*/
	public int getBasePrice() {
		return basePrice;
	}

	/**
	* Gets the amount of this type of building owned.
	* @return Amount of buildings owned for this.
	*/
	public int getAmount() {
		return amount;
	}

	/**
	* Sets the amount of this type of building owned.
	* @param amount Value to set
	*/
	public void setAmount(int amount) {
		this.amount = amount;
	}

	/**
	* Gets the bonus. Use getTotalBonus() to get the total bonus for
	* this building based on amount.
	*/
	public double getBonus() {
		return bonus;
	}

	public double getTotalBonus() {
		return bonus * amount;
	}

	/**
	* Returns the price to buy another building.

	* Formula: Base Cost * (1.15 ^ Amount owned)
	* @return The new price to buy another building.
	*/
	public long getPrice() {
		return (long) Math.ceil(basePrice * Math.pow(1.15, amount));
	}

	/**
	* Increments the amount of this building. This does not check for enough
	* coffees to upgrade.
	*/
	public void increment() {
		amount++;
	}
}


text:
package boofcv.benchmark.feature.corner;

import boofcv.abst.feature.detect.interest.ConfigFast;
import boofcv.abst.feature.detect.interest.ConfigGeneralDetector;
import boofcv.abst.filter.derivative.ImageGradient;
import boofcv.abst.filter.derivative.ImageHessian;
import boofcv.alg.feature.detect.interest.GeneralFeatureDetector;
import boofcv.core.image.GeneralizedImageOps;
import boofcv.evaluation.FileImageSequence;
import boofcv.factory.feature.detect.interest.FactoryDetectPoint;
import boofcv.factory.filter.derivative.FactoryDerivative;
import boofcv.misc.PerformerBase;
import boofcv.misc.ProfileOperation;
import boofcv.struct.image.ImageFloat32;
import boofcv.struct.image.ImageSInt16;
import boofcv.struct.image.ImageSingleBand;
import boofcv.struct.image.ImageUInt8;

/**
 * Benchmark which scores the whole corner detection processing stack.
 *
 * @author Peter Abeles
 */
@SuppressWarnings({"unchecked"})
public class BenchmarkCornerRuntime {
	static int imgWidth = 640;
	static int imgHeight = 480;
	static int windowRadius = 2;
	static long TEST_TIME = 1000;

	static ImageFloat32 image_F32;

	static ImageUInt8 image_I8;

	static Class imageType;
	static Class derivType;

	static int maxFeatures = imgWidth * imgHeight / (windowRadius * windowRadius);

	// should it include the gradient calculation in the benchmark?
	static boolean includeGradient = true;

	public static class Detector<T extends ImageSingleBand, D extends ImageSingleBand> extends PerformerBase {
		GeneralFeatureDetector<T, D> alg;
		ImageGradient<T, D> gradient;
		ImageHessian<D> hessian;

		D derivX, derivY;
		D derivXX, derivYY, derivXY;

		T input;

		public Detector(GeneralFeatureDetector<T, D> alg, T input, Class<T> imageType, Class<D> derivType) {
			this.alg = alg;
			this.input = input;
			gradient = FactoryDerivative.sobel(imageType, derivType);
			hessian = FactoryDerivative.hessianSobel(derivType);

			derivX = GeneralizedImageOps.createSingleBand(derivType, imgWidth, imgHeight);
			derivY = GeneralizedImageOps.createSingleBand(derivType, imgWidth, imgHeight);
			derivXX = GeneralizedImageOps.createSingleBand(derivType, imgWidth, imgHeight);
			derivYY = GeneralizedImageOps.createSingleBand(derivType, imgWidth, imgHeight);
			derivXY = GeneralizedImageOps.createSingleBand(derivType, imgWidth, imgHeight);
		}

		@Override
		public void process() {

			if (includeGradient) {
				if (alg.getRequiresGradient() || alg.getRequiresHessian()) {
					gradient.process(input, derivX, derivY);
				}

				if (alg.getRequiresHessian()) {
					hessian.process(derivX, derivY, derivXX, derivYY, derivXY);
				}
			}

			alg.process(input, derivX, derivY, derivXX, derivYY, derivXY);
		}
	}

	public static void benchmark(GeneralFeatureDetector alg, String name) {
		ImageSingleBand input = imageType == ImageFloat32.class ? image_F32 : image_I8;
		double opsPerSec = ProfileOperation.profileOpsPerSec(new Detector(alg, input, imageType, derivType), TEST_TIME, false);

		System.out.printf("%30s ops/sec = %6.2f\n", name, opsPerSec);
	}

	public static GeneralFeatureDetector<?, ?> createMedian() {
		return FactoryDetectPoint.createMedian(new ConfigGeneralDetector(maxFeatures,windowRadius, 1), imageType);
	}

	public static GeneralFeatureDetector<?, ?> createFast12() {
		return FactoryDetectPoint.createFast(
				new ConfigFast(30,9),new ConfigGeneralDetector(maxFeatures,windowRadius,30), imageType);
	}

	public static GeneralFeatureDetector<?, ?> createHarris() {
		return FactoryDetectPoint.createHarris(new ConfigGeneralDetector(maxFeatures,windowRadius,1), false, derivType);
	}

	public static GeneralFeatureDetector<?, ?> createKitRos() {
		return FactoryDetectPoint.createKitRos(new ConfigGeneralDetector(maxFeatures,windowRadius, 1), derivType);
	}

	public static GeneralFeatureDetector<?, ?> createShiTomasi() {
		return FactoryDetectPoint.createShiTomasi(new ConfigGeneralDetector(maxFeatures,windowRadius,1), false,  derivType);
	}

	public static void main(String args[]) {
		String pre = "../data/evaluation/";

		FileImageSequence<ImageUInt8> sequence_U8 = new FileImageSequence<ImageUInt8>(ImageUInt8.class, "indoors01.jpg", "outdoors01.jpg", "particles01.jpg");
		FileImageSequence<ImageFloat32> sequence_F32 = new FileImageSequence<ImageFloat32>(ImageFloat32.class, "indoors01.jpg", "outdoors01.jpg", "particles01.jpg");

		sequence_U8.setPrefix(pre);
		sequence_F32.setPrefix(pre);

		while (sequence_U8.next() && sequence_F32.next()) {
			image_I8 = sequence_U8.getImage();
			image_F32 = sequence_F32.getImage();

			imgWidth = image_I8.getWidth();
			imgHeight = image_I8.getHeight();

			System.out.println("=========  Profile Image Size " + imgWidth + " x " + imgHeight + " ==========");
			System.out.println("           " + sequence_U8.getName());
			System.out.println();

			imageType = ImageFloat32.class;
			derivType = ImageFloat32.class;

			benchmark(createShiTomasi(), "KLT F32");
			benchmark(createFast12(), "Fast F32");
			benchmark(createHarris(), "Harris F32");
			benchmark(createKitRos(), "Kit Ros F32");
			benchmark(createMedian(), "Median F32");

			imageType = ImageUInt8.class;
			derivType = ImageSInt16.class;

			benchmark(createShiTomasi(), "KLT U8");
			benchmark(createFast12(), "Fast U8");
			benchmark(createHarris(), "Harris U8");
			benchmark(createKitRos(), "Kit Ros U8");
			benchmark(createMedian(), "Median U8");

			System.out.println();
		}
	}
}


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.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.localservices.v1.model;

/**
 * Container for message lead specific information.
 *
 *
 This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Local Services API. For a detailed explanation see:
 * https://developers.google.com/api-client-library/java/google-http-java-client/json
 *

 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class GoogleAdsHomeservicesLocalservicesV1MessageLead extends com.google.api.client.json.GenericJson {

  /**
   * Consumer phone number associated with the message lead.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String consumerPhoneNumber;

  /**
   * Name of the customer who created the lead.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String customerName;

  /**
   * The job type of the specified lead.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String jobType;

  /**
   * The postal code of the customer who created the lead.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String postalCode;

  /**
   * Consumer phone number associated with the message lead.
   * @return value or {@code null} for none
   */
  public java.lang.String getConsumerPhoneNumber() {
    return consumerPhoneNumber;
  }

  /**
   * Consumer phone number associated with the message lead.
   * @param consumerPhoneNumber consumerPhoneNumber or {@code null} for none
   */
  public GoogleAdsHomeservicesLocalservicesV1MessageLead setConsumerPhoneNumber(java.lang.String consumerPhoneNumber) {
    this.consumerPhoneNumber = consumerPhoneNumber;
    return this;
  }

  /**
   * Name of the customer who created the lead.
   * @return value or {@code null} for none
   */
  public java.lang.String getCustomerName() {
    return customerName;
  }

  /**
   * Name of the customer who created the lead.
   * @param customerName customerName or {@code null} for none
   */
  public GoogleAdsHomeservicesLocalservicesV1MessageLead setCustomerName(java.lang.String customerName) {
    this.customerName = customerName;
    return this;
  }

  /**
   * The job type of the specified lead.
   * @return value or {@code null} for none
   */
  public java.lang.String getJobType() {
    return jobType;
  }

  /**
   * The job type of the specified lead.
   * @param jobType jobType or {@code null} for none
   */
  public GoogleAdsHomeservicesLocalservicesV1MessageLead setJobType(java.lang.String jobType) {
    this.jobType = jobType;
    return this;
  }

  /**
   * The postal code of the customer who created the lead.
   * @return value or {@code null} for none
   */
  public java.lang.String getPostalCode() {
    return postalCode;
  }

  /**
   * The postal code of the customer who created the lead.
   * @param postalCode postalCode or {@code null} for none
   */
  public GoogleAdsHomeservicesLocalservicesV1MessageLead setPostalCode(java.lang.String postalCode) {
    this.postalCode = postalCode;
    return this;
  }

  @Override
  public GoogleAdsHomeservicesLocalservicesV1MessageLead set(String fieldName, Object value) {
    return (GoogleAdsHomeservicesLocalservicesV1MessageLead) super.set(fieldName, value);
  }

  @Override
  public GoogleAdsHomeservicesLocalservicesV1MessageLead clone() {
    return (GoogleAdsHomeservicesLocalservicesV1MessageLead) super.clone();
  }

}