text:
/**
 * @file    parse_config.h
 * @brief   XXX Add brief description!
 * @author  Loudet Julien <loudet.julien@gmail.com>
 * @version 1.1
 * @date    2015-09
 *
 * @details (last edited by Loudet Julien on 2015/09)
 *
 *          Parses a configuration file. The configuration file, for now, has
 *          to follow a certain structure that is why it is STRONGLY advised to
 *          first generate a default configuration file. Then one can copy
 *          and/or modify it according to ones needs so that the structure
 *          stays intact.
 *
 *          The structure is as following:
 *
 *          <MY_INFO>
 *              <tcell_ip>127.0.0.1</tcell_ip>
 *              <tcell_port>5678</tcell_port>
 *              <id>julien</id>
 *              <priv_key_path>$HOME/.config/sipd/keys/priv_key</priv_key_path>
 *              <pub_key_path>$HOME/.config/sipd/keys/pub_key</pub_key_path>
 *          </MY_INFO>
 *
 *          NOTES: (*) The order of the parameters does not matter.
 *                 (*) The spelling and case of the parameters MUST be the
 *                     SAME as above. See the header file "configuration.h".
 *                 (*) There MUST be NO SPACES in the values you provide.
 *                 (*) Other parameters will not be processed. Thus you can add
 *                     whatever information you want (for instance other path
 *                     for other RSA keys), only the parameter above will be
 *                     taken into account.
 */
#ifndef __PARSE_CONFIG_H__
#define __PARSE_CONFIG_H__

#include "../beans/my_info.h"

MyInfo_t* parse_configuration_file(const char *config_file_path);

#endif


text:
TEST(S2MemoryTracker, PeriodicCallback) {
  S2MemoryTracker tracker;
  int callback_count = 0;
  S2MemoryTracker::Client client(&tracker);

  // Test that a callback interval of 0 bytes invokes the callback every time.
  tracker.set_periodic_callback(0, [&]() { ++callback_count; });
  client.Tally(0);
  EXPECT_EQ(callback_count, 1);
  client.Tally(-10);
  EXPECT_EQ(callback_count, 2);

  // Test that the callback interval is based on total allocated bytes rather
  // than current usage.
  tracker.set_periodic_callback(100, [&]() { ++callback_count; });
  client.Tally(99);
  EXPECT_EQ(callback_count, 2);
  client.Tally(1);
  EXPECT_EQ(callback_count, 3);
  client.Tally(-50);
  client.Tally(50);
  client.Tally(-50);
  client.Tally(49);
  EXPECT_EQ(callback_count, 3);
  client.Tally(1);
  EXPECT_EQ(callback_count, 4);
}

redpajama_set_name: RedPajamaGithub


text:
namespace base {
class SingleThreadTaskRunner;
}  // namespace base

namespace webrtc {
class FrameTransformerInterface;
class TransformedFrameCallback;
class TransformableVideoFrameInterface;
}  // namespace webrtc

namespace blink {

class PLATFORM_EXPORT RTCEncodedVideoStreamTransformer {
 public:
  using TransformerCallback = WTF::CrossThreadRepeatingFunction<void(
      std::unique_ptr<webrtc::TransformableVideoFrameInterface>)>;

  // A RefCounted wrapper around the Transformer class which holds a
  // cross-thread safe weak pointer to a Transformer object. This allows us to
  // post tasks to the Transformer from classes the transformer owns without
  // creating a circular reference.
  class PLATFORM_EXPORT Broker : public WTF::ThreadSafeRefCounted<Broker> {
   public:
    void RegisterTransformedFrameCallback(
        rtc::scoped_refptr<webrtc::TransformedFrameCallback>
            send_frame_to_sink_callback);

    void RegisterTransformedFrameSinkCallback(
        rtc::scoped_refptr<webrtc::TransformedFrameCallback>,
        uint32_t ssrc);

    void UnregisterTransformedFrameCallback();

    void UnregisterTransformedFrameSinkCallback(uint32_t ssrc);

    void TransformFrameOnSourceTaskRunner(
        std::unique_ptr<webrtc::TransformableVideoFrameInterface> frame);

    void SetTransformerCallback(TransformerCallback callback);

    void ResetTransformerCallback();

    void SetSourceTaskRunner(
        scoped_refptr<base::SingleThreadTaskRunner> task_runner);

    void SendFrameToSink(
        std::unique_ptr<webrtc::TransformableVideoFrameInterface> frame);

   private:
    explicit Broker(RTCEncodedVideoStreamTransformer* transformer_);
    void ClearTransformer();
    friend class RTCEncodedVideoStreamTransformer;

    base::Lock transformer_lock_;
    RTCEncodedVideoStreamTransformer* transformer_
        GUARDED_BY(transformer_lock_);
  };

  explicit RTCEncodedVideoStreamTransformer(
      scoped_refptr<base::SingleThreadTaskRunner> realm_task_runner);
  ~RTCEncodedVideoStreamTransformer();

  // Called by WebRTC to let us know about a callback object to send
  // transformed frames to the WebRTC decoder. Runs on the thread which
  // created this object. The callback can run on any thread.
  void RegisterTransformedFrameCallback(
      rtc::scoped_refptr<webrtc::TransformedFrameCallback>);
  void RegisterTransformedFrameSinkCallback(
      rtc::scoped_refptr<webrtc::TransformedFrameCallback>,
      uint32_t ssrc);

  // Called by WebRTC to let us know that any reference to the callback object
  // reported by RegisterTransformedFrameCallback() should be released since
  // the callback is no longer useful and is intended for destruction.
  // Runs on the thread which created this object.
  // TODO(crbug.com/1065838): Remove the non-ssrc version once WebRTC uses the
  // ssrc version in all cases.
  void UnregisterTransformedFrameCallback();
  void UnregisterTransformedFrameSinkCallback(uint32_t ssrc);

  // Called by WebRTC to notify of new untransformed frames from the WebRTC
  // stack. Runs on the most recently set source task_runner - ie changes when
  // the stream is transferred.
  void TransformFrame(
      std::unique_ptr<webrtc::TransformableVideoFrameInterface>);

  // Send a transformed frame to the WebRTC sink. Threadsafe.
  void SendFrameToSink(
      std::unique_ptr<webrtc::TransformableVideoFrameInterface> frame);

  // Set a callback to be invoked on every untransformed frame. Is threadsafe.
  void SetTransformerCallback(TransformerCallback);

  // Removes the callback. Is threadsafe.
  void ResetTransformerCallback();

  // Returns true if a callback has been set with SetTransformerCallback(),
  // false otherwise. Is threadsafe.
  bool HasTransformerCallback();

  // Returns true if a webrtc::TransformedFrameCallback is registered.
  // Threadsafe.
  bool HasTransformedFrameCallback() const;

  // Returns true if a webrtc::TransformedFrameCallback is registered for
  // the given ssrc.
  bool HasTransformedFrameSinkCallback(uint32_t ssrc) const;

  rtc::scoped_refptr<webrtc::FrameTransformerInterface> Delegate();

  // Set the TaskRunner used for the Source side - to deliver frames up to the
  // UnderlyingSource. Is threadsafe.
  void SetSourceTaskRunner(
      scoped_refptr<base::SingleThreadTaskRunner> realm_task_runner);

  scoped_refptr<Broker> GetBroker();

 private:
  const scoped_refptr<Broker> broker_;
  const rtc::scoped_refptr<webrtc::FrameTransformerInterface> delegate_;
  mutable base::Lock sink_lock_;
  Vector<
      std::pair<uint32_t, rtc::scoped_refptr<webrtc::TransformedFrameCallback>>>
      send_frame_to_sink_callbacks_ GUARDED_BY(sink_lock_);
  base::Lock source_lock_;
  TransformerCallback transformer_callback_ GUARDED_BY(source_lock_);
};

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_PLATFORM_PEERCONNECTION_RTC_ENCODED_VIDEO_STREAM_TRANSFORMER_H_


text:
if [ "$(uname)" != "Darwin" ]; then
  echo "🐧 This is just meant for MacOS!"
  exit 0
fi

echo "🍎 Setting some preferered MacOS defaults."

# Show all filename extensions in Finder
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
# Expand save panel by default
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
# Expand print panel by default
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
# Dark/Light mode automatic switching
defaults write NSGlobslDomain AppleInterfaceStyleSwitchesAutomatically -bool true
# Turn off Terminal prompt markers
defaults write com.apple.Terminal AutoMarkPromptLines -int 0
# Weeks start on Monday
defaults write -globalDomain AppleFirstWeekday -dict gregorian 2
# AM/PM → 🌅/🌃
defaults write -globalDomain AppleICUDateTimeSymbols '{ 5 = ("\Ud83c\Udf05", "\Ud83c\Udf03"); }'

#######
# Dock

# Hide it by default
defaults write com.apple.dock autohide -bool true
# Dock on bottom
defaults write com.apple.dock orientation -string "bottom"
# Don't show recent apps
defaults write com.apple.dock "show-recents" -bool false
# Kill it to apply settings
killall Dock

#########
# Safari

# Don't autofill/remember passwords
defaults write com.apple.Safari AutoFillPasswords -bool false
# Use DuckDuckGo as default search
defaults write com.apple.Safari SearchProviderIdentifier -string "com.duckduckgo"
# Show favicons on tabs
defaults write com.apple.Safari ShowIconsInTab -bool true
# Enable developer tools
defaults write com.apple.Safari "WebKitPreferences.developerExtrasEnabled" -bool true


text:
Scaling Goggles is a minecraft mod that <does something>.

This is based on the recommended repository name when creating a new repository
on github.

## Development

Set up your workspace.

```
gradle setupDecompWorkspace --refresh-dependencies
```

Run the client

```
gradle runClient
```

Build the jar in `build/libs`
```
gradle build
```

### Troubleshooting

#### Fonts not rendered correctly on OSX

If the minecraft fonts are missing or displaying as blocky textures, edit the
`minecraft/config/splash.properties` file and set `enabled=false`.


text:
@interface UIDevice (TXHardware)
+ (NSString *)tx_platform;
+ (NSString *)tx_platformString;

+ (NSString *)tx_macAddress;

//Return the current device CPU frequency
+ (NSUInteger)tx_cpuFrequency;
// Return the current device BUS frequency
+ (NSUInteger)tx_busFrequency;
//current device RAM size
+ (NSUInteger)tx_ramSize;
//Return the current device CPU number
+ (NSUInteger)tx_cpuNumber;
//Return the current device total memory

/// 获取iOS系统的版本号
+ (NSString *)tx_systemVersion;
/// 判断当前系统是否有摄像头
+ (BOOL)tx_hasCamera;
/// 获取手机内存总量, 返回的是字节数
+ (NSUInteger)tx_totalMemoryBytes;
/// 获取手机可用内存, 返回的是字节数
+ (NSUInteger)tx_freeMemoryBytes;

/// 获取手机硬盘空闲空间, 返回的是字节数
+ (long long)tx_freeDiskSpaceBytes;
/// 获取手机硬盘总空间, 返回的是字节数
+ (long long)tx_totalDiskSpaceBytes;
@end


text:
package org.callimachusproject.setup;

import java.io.IOException;
import java.util.Iterator;
import java.util.ServiceLoader;

import org.callimachusproject.repository.CalliRepository;
import org.openrdf.OpenRDFException;

public class UpdateService extends UpdateProvider {
	private final ServiceLoader<UpdateProvider> updateProviders;

	public UpdateService(ClassLoader cl) {
		this.updateProviders = ServiceLoader.load(UpdateProvider.class, cl);
	}

	@Override
	public String getDefaultWebappLocation(final String origin) throws IOException {
		Iterator<UpdateProvider> iter = updateProviders.iterator();
		while (iter.hasNext()) {
			String webapp = iter.next().getDefaultWebappLocation(origin);
			if (webapp != null)
				return webapp;
		}
		throw new AssertionError("Cannot determine default Callimachus webapp folder");
	}

	@Override
	public Updater prepareCallimachusWebapp(final String origin) throws IOException {
		return new Updater() {
			public boolean update(String webapp, CalliRepository repository)
					throws IOException, OpenRDFException {
				boolean modified = false;
				Iterator<UpdateProvider> iter = updateProviders.iterator();
				while (iter.hasNext()) {
					Updater updater = iter.next().prepareCallimachusWebapp(
							origin);
					if (updater != null) {
						modified |= updater.update(webapp, repository);
					}
				}
				return modified;
			}
		};
	}

	@Override
	public Updater updateFrom(final String origin, final String version)
			throws IOException {
		return new Updater() {
			public boolean update(String webapp, CalliRepository repository)
					throws IOException, OpenRDFException {
				boolean modified = false;
				Iterator<UpdateProvider> iter = updateProviders.iterator();
				while (iter.hasNext()) {
					Updater updater = iter.next().updateFrom(origin, version);
					if (updater != null) {
						modified |= updater.update(webapp, repository);
					}
				}
				return modified;
			}
		};
	}

	@Override
	public Updater updateCallimachusWebapp(final String origin) throws IOException {
		return new Updater() {
			public boolean update(String webapp, CalliRepository repository)
					throws IOException, OpenRDFException {
				boolean modified = false;
				Iterator<UpdateProvider> iter = updateProviders.iterator();
				while (iter.hasNext()) {
					Updater updater = iter.next().updateCallimachusWebapp(
							origin);
					if (updater != null) {
						modified |= updater.update(webapp, repository);
					}
				}
				return modified;
			}
		};
	}

	@Override
	public Updater updateOrigin(final String virtual) throws IOException {
		return new Updater() {
			public boolean update(String webapp, CalliRepository repository)
					throws IOException, OpenRDFException {
				boolean modified = false;
				Iterator<UpdateProvider> iter = updateProviders.iterator();
				while (iter.hasNext()) {
					Updater updater = iter.next().updateOrigin(virtual);
					if (updater != null) {
						modified |= updater.update(webapp, repository);
					}
				}
				return modified;
			}
		};
	}

	@Override
	public Updater finalizeCallimachusWebapp(final String origin) throws IOException {
		return new Updater() {
			public boolean update(String webapp, CalliRepository repository)
					throws IOException, OpenRDFException {
				boolean modified = false;
				Iterator<UpdateProvider> iter = updateProviders.iterator();
				while (iter.hasNext()) {
					Updater updater = iter.next().finalizeCallimachusWebapp(
							origin);
					if (updater != null) {
						modified |= updater.update(webapp, repository);
					}
				}
				return modified;
			}
		};
	}

}


text:
package path_matcher

import (
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/ginkgo/extensions/table"
	. "github.com/onsi/gomega"
)

var _ = Describe("include path matcher", func() {
	type entry struct {
		includeGlobs                []string
		testPath                    string
		isPathMatched               bool
		shouldGoThrough             bool
		isDirOrSubmodulePathMatched bool
	}

	itBodyFunc := func(e entry) {
		matcher := newIncludePathMatcher(e.includeGlobs)

		Ω(matcher.IsPathMatched(e.testPath)).Should(BeEquivalentTo(e.isPathMatched))
		Ω(matcher.ShouldGoThrough(e.testPath)).Should(BeEquivalentTo(e.shouldGoThrough))
		Ω(matcher.IsDirOrSubmodulePathMatched(e.testPath)).Should(BeEquivalentTo(e.isDirOrSubmodulePathMatched))
	}

	DescribeTable("empty include globs list", itBodyFunc,
		Entry("empty test path", entry{
			includeGlobs:                nil,
			testPath:                    "",
			isPathMatched:               true,
			shouldGoThrough:             false,
			isDirOrSubmodulePathMatched: true,
		}),
	)

	DescribeTable("non-empty include globs list", itBodyFunc,
		Entry("empty test path (1)", entry{
			includeGlobs:                []string{""},
			testPath:                    "",
			isPathMatched:               true,
			shouldGoThrough:             false,
			isDirOrSubmodulePathMatched: true,
		}),
		Entry("empty test path (2)", entry{
			includeGlobs:                []string{"dir"},
			testPath:                    "",
			isPathMatched:               false,
			shouldGoThrough:             true,
			isDirOrSubmodulePathMatched: true,
		}),
		Entry("matched test path (1)", entry{
			includeGlobs:                []string{"dir"},
			testPath:                    "dir",
			isPathMatched:               true,
			shouldGoThrough:             false,
			isDirOrSubmodulePathMatched: true,
		}),
		Entry("matched test path (2)", entry{
			includeGlobs:                []string{"dir"},
			testPath:                    "dir/any",
			isPathMatched:               true,
			shouldGoThrough:             false,
			isDirOrSubmodulePathMatched: true,
		}),
		Entry("not matched test path (1)", entry{
			includeGlobs:                []string{"dir1"},
			testPath:                    "dir2",
			isPathMatched:               false,
			shouldGoThrough:             false,
			isDirOrSubmodulePathMatched: false,
		}),
		Entry("not matched test path (2)", entry{
			includeGlobs:                []string{"dir/file"},
			testPath:                    "dir",
			isPathMatched:               false,
			shouldGoThrough:             true,
			isDirOrSubmodulePathMatched: true,
		}),
		Entry("glob completion (1)", entry{
			includeGlobs:                []string{"a"},
			testPath:                    "a/b/c/d",
			isPathMatched:               true,
			shouldGoThrough:             false,
			isDirOrSubmodulePathMatched: true,
		}),
		Entry("glob completion (2)", entry{
			includeGlobs:                []string{"a/*/*/**/*"},
			testPath:                    "a/d/c/d",
			isPathMatched:               true,
			shouldGoThrough:             false,
			isDirOrSubmodulePathMatched: true,
		}),
	)
})


text:
package com.marshalchen.common.demoofui.switchbuttondemo;

import android.app.Activity;
import android.app.IntentService;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.support.v4.content.LocalBroadcastManager;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.ProgressBar;
import android.widget.TextView;

import com.marshalchen.common.demoofui.R;
import com.marshalchen.common.uimodule.switchbutton.SwitchButton;

public class UseActivity extends Activity implements OnClickListener {

    private SwitchButton mListenerSb, mLongSb, mToggleSb, mCheckedSb;
    private ProgressBar mPb;
    private Button mStartBt, mToggleAniBt, mToggleNotAniBt, mCheckedAniBt, mCheckNotAniBt;
    private TextView mListenerFinish;
    private LongServiceReceiver longServiceReceiver;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.switch_button_activity_use);
        //getActionBar().setDisplayHomeAsUpEnabled(true);

        findView();

        // work with listener
        mListenerSb.setOnCheckedChangeListener(new OnCheckedChangeListener() {

            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                mListenerFinish.setVisibility(isChecked ? View.VISIBLE : View.INVISIBLE);
            }
        });

        // work with stuff takes long
        longServiceReceiver = new LongServiceReceiver();
        IntentFilter recevierFilter = new IntentFilter();
        recevierFilter.addAction("LongServiceReceiver_ReturnIntent");
        recevierFilter.addAction("PROGRESS_UPDATE");
        LocalBroadcastManager.getInstance(this).registerReceiver(longServiceReceiver, recevierFilter);
        mStartBt.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                Intent longService = new Intent(UseActivity.this, LongService.class);
                longServiceReceiver.onPreExecute();
                UseActivity.this.startService(longService);
            }
        });

        // toggle
        mToggleAniBt.setOnClickListener(this);
        mToggleNotAniBt.setOnClickListener(this);

        // checked
        mCheckedAniBt.setOnClickListener(this);
        mCheckNotAniBt.setOnClickListener(this);
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        if (longServiceReceiver != null)
            LocalBroadcastManager.getInstance(this).unregisterReceiver(longServiceReceiver);
    }

    private void findView() {
        mListenerSb = (SwitchButton) findViewById(R.id.sb_use_listener);
        mLongSb = (SwitchButton) findViewById(R.id.sb_use_long);
        mToggleSb = (SwitchButton) findViewById(R.id.sb_use_toggle);
        mCheckedSb = (SwitchButton) findViewById(R.id.sb_use_checked);

        mPb = (ProgressBar) findViewById(R.id.pb);
        mPb.setProgress(0);
        mPb.setMax(100);

        mStartBt = (Button) findViewById(R.id.long_start);
        mToggleAniBt = (Button) findViewById(R.id.toggle_ani);
        mToggleNotAniBt = (Button) findViewById(R.id.toggle_not_ani);
        mCheckedAniBt = (Button) findViewById(R.id.checked_ani);
        mCheckNotAniBt = (Button) findViewById(R.id.checked_not_ani);

        mListenerFinish = (TextView) findViewById(R.id.listener_finish);
        mListenerFinish.setVisibility(mListenerSb.isChecked() ? View.VISIBLE : View.INVISIBLE);
    }

    class LongServiceReceiver extends BroadcastReceiver {

        public void onPreExecute() {
            mLongSb.setChecked(false);
            mStartBt.setEnabled(false);
        }

        public void onProgressUpdate(Integer... values) {
            if (values == null || values.length == 0) {
                return;
            }
            int p = values[0];
            mPb.setProgress(p);
        }

        @Override
        public void onReceive(Context receiverContext, Intent receiverIntent) {
            if (receiverIntent.getAction().equals("PROGRESS_UPDATE")) {
                onProgressUpdate(receiverIntent.getIntExtra("progress", 0));
                return;
            }
            mLongSb.slideToChecked(true);
            mStartBt.setEnabled(true);
        }

    }

    public static class LongService extends IntentService {
        private int progress = 0;

        public LongService() {
            super("LongService");
        }

        public void onHandleIntent(Intent intent) {
            while (progress < 100) {
                progress++;
                try {
                    Thread.sleep(20);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                Intent updateIntent = new Intent("PROGRESS_UPDATE");
                updateIntent.putExtra("progress", progress);
                LocalBroadcastManager.getInstance(this).sendBroadcast(updateIntent);
            }
            Intent resultIntent = new Intent("LongServiceReceiver_ReturnIntent");
            LocalBroadcastManager.getInstance(this).sendBroadcast(resultIntent);
        }
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        if (item.getItemId() == android.R.id.home) {
            finish();
            return true;
        }
        return super.onOptionsItemSelected(item);
    }

    @Override
    public void onClick(View v) {
        int id = v.getId();
        switch (id) {
            case R.id.toggle_ani:
                mToggleSb.toggle();
                break;
            case R.id.toggle_not_ani:
                mToggleSb.toggle(false);
                break;
            case R.id.checked_ani:
                mCheckedSb.slideToChecked(!mCheckedSb.isChecked());
                break;
            case R.id.checked_not_ani:
                mCheckedSb.setChecked(!mCheckedSb.isChecked());
                break;

            default:
                break;
        }
    }
}


text:
<readable><title>2043427251_83b746da8e</title><content>
a man jumping in a mud puddle in the middle of the street
A man jumps up and down in a puddle in a parking lot .
A smiling person wearing a jacket and boots jumps in a big puddle .
Man jumping for joy in a rain storm at the beach .
Person in blue coat jumping in standing water on pavement with body of water in the background .
</content></readable>


text:
package io.rsocket.aeron.internal;

import io.aeron.Aeron;
import io.aeron.Image;
import io.aeron.Publication;
import io.aeron.Subscription;
import java.util.function.Function;

/** */
public interface AeronWrapper {
  Aeron getAeron();

  void availableImageHandler(Function<Image, Boolean> handler);

  void unavailableImageHandlers(Function<Image, Boolean> handler);

  default Subscription addSubscription(String channel, int streamdId) {
    return getAeron().addSubscription(channel, streamdId);
  }

  default Publication addPublication(String channel, int streamdId) {
    return getAeron().addPublication(channel, streamdId);
  }

  default void close() {
    getAeron().close();
  }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <ListView
        android:id="@+id/tree_listview"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:divider="#00000000" />

</LinearLayout>


text:
namespace FishEditor
{
	class SearchFilter
	{
	public:
		enum class SearchArea
		{
			AllAssets,
			SelectedFolders,
			AssetStore
		};

		enum class State
		{
			EmptySearchFilter,
			FolderBrowsing,
			SearchingInAllAssets,
			SearchingInFolders,
			SearchingInAssetStore
		};

	public:

		void ClearSearch()
		{
			this->m_NameFilter = "";
			this->m_ClassNames.clear();
			this->m_AssetLabels.clear();
			this->m_AssetBundleNames.clear();
			this->m_ReferencingInstanceIDs.clear();
			this->m_ScenePaths.clear();
			this->m_VersionControlStates.clear();
			this->m_ShowAllHits = false;
		}

		State GetState()
		{
			bool flag = !m_NameFilter.empty() || !IsNullOrEmpty(this->m_AssetLabels) || !IsNullOrEmpty(this->m_ClassNames) || !IsNullOrEmpty(this->m_AssetBundleNames) || !IsNullOrEmpty(this->m_ReferencingInstanceIDs) || !IsNullOrEmpty(this->m_VersionControlStates);
			bool flag2 = !IsNullOrEmpty(this->m_Folders);
			State result;
			if (flag)
			{
				if (this->m_SearchArea == SearchArea::AssetStore)
				{
					result = State::SearchingInAssetStore;
				}
				else if (flag2 && this->m_SearchArea == SearchArea::SelectedFolders)
				{
					result = State::SearchingInFolders;
				}
				else
				{
					result = State::SearchingInAllAssets;
				}
			}
			else if (flag2)
			{
				result = State::FolderBrowsing;
			}
			else
			{
				result = State::EmptySearchFilter;
			}
			return result;
		}

		bool IsSearching()
		{
			State state = this->GetState();
			return state == State::SearchingInAllAssets || state == State::SearchingInFolders || state == State::SearchingInAssetStore;
		}

		bool SetNewFilter(SearchFilter const & newFilter)
		{
			bool result = false;
			if (newFilter.m_NameFilter != this->m_NameFilter)
			{
				this->m_NameFilter = newFilter.m_NameFilter;
				result = true;
			}
			if (newFilter.m_ClassNames != this->m_ClassNames)
			{
				this->m_ClassNames = newFilter.m_ClassNames;
				result = true;
			}
			if (newFilter.m_Folders != this->m_Folders)
			{
				this->m_Folders = newFilter.m_Folders;
				result = true;
			}
			if (newFilter.m_VersionControlStates != this->m_VersionControlStates)
			{
				this->m_VersionControlStates = newFilter.m_VersionControlStates;
				result = true;
			}
			if (newFilter.m_AssetLabels != this->m_AssetLabels)
			{
				this->m_AssetLabels = newFilter.m_AssetLabels;
				result = true;
			}
			if (newFilter.m_AssetBundleNames != this->m_AssetBundleNames)
			{
				this->m_AssetBundleNames = newFilter.m_AssetBundleNames;
				result = true;
			}
			if (newFilter.m_ReferencingInstanceIDs != this->m_ReferencingInstanceIDs)
			{
				this->m_ReferencingInstanceIDs = newFilter.m_ReferencingInstanceIDs;
				result = true;
			}
			if (newFilter.m_ScenePaths != this->m_ScenePaths)
			{
				this->m_ScenePaths = newFilter.m_ScenePaths;
				result = true;
			}
			if (newFilter.m_SearchArea != this->m_SearchArea)
			{
				this->m_SearchArea = newFilter.m_SearchArea;
				result = true;
			}
			this->m_ShowAllHits = newFilter.m_ShowAllHits;
			return result;
		}

#if 0
		std::string ToString()
		{
			std::string text = "SearchFilter: ";
			//text += std::string.Format("[Area: {0}, State: {1}]", this->m_SearchArea, this->GetState());
			text += FishEngine::Format("[Area: {1}, State: {2}]", this->m_SearchArea)
			if (!string.IsNullOrEmpty(this->m_NameFilter))
			{
				text = text + "[Name: " + this->m_NameFilter + "]";
			}
			if (this->m_AssetLabels != null && this->m_AssetLabels.Length > 0)
			{
				text = text + "[Labels: " + this->m_AssetLabels[0] + "]";
			}
			if (this->m_VersionControlStates != null && this->m_VersionControlStates.Length > 0)
			{
				text = text + "[VersionStates: " + this->m_VersionControlStates[0] + "]";
			}
			if (this->m_AssetBundleNames != null && this->m_AssetBundleNames.Length > 0)
			{
				text = text + "[AssetBundleNames: " + this->m_AssetBundleNames[0] + "]";
			}
			string text2;
			if (this->m_ClassNames != null && this->m_ClassNames.Length > 0)
			{
				text2 = text;
				text = string.Concat(new object[]
				{
					text2,
					"[Types: ",
					this->m_ClassNames[0],
					" (",
					this->m_ClassNames.Length,
					")]"
				});
			}
			if (this->m_ReferencingInstanceIDs != null && this->m_ReferencingInstanceIDs.Length > 0)
			{
				text2 = text;
				text = string.Concat(new object[]
				{
					text2,
					"[RefIDs: ",
					this->m_ReferencingInstanceIDs[0],
					"]"
				});
			}
			if (this->m_Folders != null && this->m_Folders.Length > 0)
			{
				text = text + "[Folders: " + this->m_Folders[0] + "]";
			}
			text2 = text;
			return string.Concat(new object[]
			{
				text2,
				"[ShowAllHits: ",
				this->showAllHits,
				"]"
			});
		}
#endif

		static std::vector<std::string> Split(std::string const & text)
		{
			std::vector<std::string> result;
			if (text.empty())
			{
				result = {};
			}
			else
			{
				List<string> list = new List<string>();
				IEnumerator enumerator = Regex.Matches(text, "\".+?\"|\\S+").GetEnumerator();
				try
				{
					while (enumerator.MoveNext())
					{
						Match match = (Match)enumerator.Current;
						list.Add(match.Value.Replace("\"", ""));
					}
				}
				finally
				{
					IDisposable disposable;
					if ((disposable = (enumerator as IDisposable)) != null)
					{
						disposable.Dispose();
					}
				}
				result = list.ToArray();
			}
			return result;
		}

	private:

		template<class T>
		inline bool IsNullOrEmpty(std::vector<T> list)
		{
			return list.empty();
		}

		std::string FilterToSearchFieldString()
		{
			std::string text = "";
			if (!this->m_NameFilter.empty())
			{
				text += this->m_NameFilter;
			}
			this->AddToString<std::string>("t:", this->m_ClassNames, text);
			this->AddToString<std::string>("l:", this->m_AssetLabels, text);
			this->AddToString<std::string>("v:", this->m_VersionControlStates, text);
			this->AddToString<std::string>("b:", this->m_AssetBundleNames, text);
			return text;
		}

		template <class T>
		void AddToString(std::string prefix, std::vector<T> const & list, std::string & result)
		{
			if (!list.empty())
			{
//				if (result == null)
//				{
//					result = "";
//				}
				for (auto const & t : list)
				{
					if (!result.empty())
					{
						result += " ";
					}
					result = result + prefix + t;
				}
			}
		}

		void SearchFieldStringToFilter(std::string const & searchString)
		{
			this->ClearSearch();
			if (searchString.empty())
			{
				SearchUtility::ParseSearchString(searchString, *this);
			}
		}

		static SearchFilter CreateSearchFilterFromString(std::string const & searchText)
		{
			SearchFilter searchFilter;
			SearchUtility::ParseSearchString(searchText, searchFilter);
			return searchFilter;
		}

	public:
		std::string m_NameFilter = "";
		std::vector<std::string> m_ClassNames;
		std::vector<std::string> m_AssetLabels;
		std::vector<std::string> m_AssetBundleNames;
		std::vector<std::string> m_VersionControlStates;
		std::vector<int> m_ReferencingInstanceIDs;
		std::vector<std::string> m_ScenePaths;
		bool m_ShowAllHits = false;

		SearchArea m_SearchArea = SearchArea::AllAssets;

		std::vector<std::string> m_Folders;
	};
}


text:
<?php

namespace App\WebBundle\Entity;

use Doctrine\ORM\EntityRepository;

/**
 * GrupoPreguntaRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class GrupoPreguntaRepository extends EntityRepository
{
}


text:
class ChangeColumnNameMathModelRun < ActiveRecord::Migration
  def change
    rename_column :math_model_runs, :project_settings_id, :project_setting_id
  end
end


text:
<!DOCTYPE html>

    <title>Welcome Page</title>

Placeholder


text:
{% if paginator.total_pages > 1 %}

		{% if paginator.previous_page %}

			Back

		{% endif %}
		{% if paginator.next_page %}

				Next

		{% endif %}

{% endif %}


text:
import Posts from '../components/Posts/Posts'

function PostsPage() {
  return <Posts />
}

export default PostsPage


text:
Chrome Extension that fix Google Hangouts direction to RTL.

[![Chrome Web Store](https://img.shields.io/chrome-web-store/v/oohpklfcenaffjconedjebkaclkachmi.svg)](https://chrome.google.com/webstore/detail/oohpklfcenaffjconedjebkaclkachmi)
[![Mozilla Add-on](https://img.shields.io/amo/v/hangouts-rtl-fixer.svg)](https://addons.mozilla.org/en-US/firefox/addon/hangouts-rtl-fixer/)


text:
<!DOCTYPE html>

<title>小牛在线</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta content="yes" name="apple-mobile-web-app-capable" />
<meta content="black" name="apple-mobile-web-app-status-bar-style" />
<meta content="telephone=no" name="format-detection" />
<link rel="stylesheet" type="text/css" href="css_old/old/wx_common.css">
<link rel="stylesheet" type="text/css" href="lib/dialog/css/dialog.css">
<link rel="stylesheet" type="text/css" href="css_old/old/wx_account.css">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta content="yes" name="apple-mobile-web-app-capable" />
<meta content="black" name="apple-mobile-web-app-status-bar-style" />
<meta content="telephone=no" name="format-detection" />
<link rel="stylesheet" type="text/css" href="css_old/old/wx_common.css">
<link rel="stylesheet" type="text/css" href="css_old/old/wx_index.css">

按钮更新当前页面


text:
package com.mcxiaoke.next.task;

import android.os.Looper;
import android.os.SystemClock;
import android.util.Log;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Callable;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.ThreadPoolExecutor;

/**
 * 一个用于执行异步任务的类,单例,支持检查Caller,支持按照Caller和Tag取消对应的任务
 * 支持创建并发执行和顺序执行两种模式的任务队列
 * User: mcxiaoke
 * Date: 2013-7-1 2013-7-25 2014-03-04 2014-03-25
 * Date: 2014-05-14 2014-05-29 2015-06-15 2015-12-25
 */
final class TaskQueueImpl extends TaskQueue {

    public static final String TAG = "TaskQueue";
    private final Object mCaller = new Object();
    private final Object mLock = new Object();
    private int mMaxThreads;
    private ExecutorService mExecutor;
    private Map<String, List<String>> mGroups;
    private Map<String, ITaskRunnable> mTasks;

    public TaskQueueImpl(int maxThreads) {
        Log.v(TAG, "TaskQueue() maxThreads:" + maxThreads);
        if (maxThreads < 0) {
            throw new IllegalArgumentException("Invalid Argument, maxThreads:" + maxThreads);
        }
        mMaxThreads = maxThreads;
        checkThread();
        init();
        checkExecutor();
    }

    private void init() {
        mGroups = new ConcurrentHashMap<String, List<String>>();
        mTasks = new ConcurrentHashMap<String, ITaskRunnable>();
    }

    /********************************************************************
     * PUBLIC METHODS
     *******************************************************************/

    @Override
    public <Result> String add(final Callable<Result> callable,
                               final TaskCallback<Result> callback,
                               final Object caller) {
        return execute(callable, callback, caller);
    }

    /**
     * @param callable Callable
     * @param callback callback
     * @param <Result> Result
     * @return Tag
     */
    @Override
    public <Result> String add(final Callable<Result> callable,
                               final TaskCallback<Result> callback) {
        return add(callable, callback, mCaller);
    }

    @Override
    public <Result> String add(final Callable<Result> callable, final Object caller) {
        return add(callable, null, caller);
    }

    @Override
    public String add(final Runnable runnable) {
        final Callable<Boolean> callable = new Callable<Boolean>() {
            @Override
            public Boolean call() throws Exception {
                runnable.run();
                return true;
            }
        };
        return add(callable, null, mCaller);
    }

    @Override
    public <Result> String add(final Callable<Result> callable) {
        return add(callable, null, mCaller);
    }

    /**
     * 取消NAME对应的任务
     *
     * @param name 任务NAME
     * @return 任务是否存在
     */
    @Override
    public boolean cancel(String name) {
        return cancelByName(name);
    }

    /**
     * 取消由该调用方发起的所有任务
     * 建议在Fragment或Activity的onDestroy中调用
     *
     * @param caller 任务调用方
     * @return 返回取消的数目
     */
    @Override
    public int cancelAll(Object caller) {
        return cancelByCaller(caller);
    }

    /**
     * 设置自定义的ExecutorService
     *
     * @param executor ExecutorService
     */
    @Override
    public void setExecutor(final ExecutorService executor) {
        if (executor == null) {
            throw new NullPointerException("executor must not be null.");
        }
        mExecutor = executor;
    }

    /**
     * 便利任务列表,取消所有任务
     */
    @Override
    public void cancelAll() {
        if (Config.DEBUG) {
            Log.v(TAG, "cancelAll()");
        }
        cancelAllInQueue();
    }

    /**
     * 获取当前实例的详细信息
     *
     * @return dump output
     */
    @Override
    public String dump() {
        final StringBuilder builder = new StringBuilder();
        if (mExecutor instanceof ThreadPoolExecutor) {
            // thread pool info
            final ThreadPoolExecutor executor = (ThreadPoolExecutor) mExecutor;
            final int corePoolSize = executor.getCorePoolSize();
            final int poolSize = executor.getPoolSize();
            final int activeCount = executor.getActiveCount();
            final long taskCount = executor.getTaskCount();
            final long completedCount = executor.getCompletedTaskCount();
            final boolean isShutdown = executor.isShutdown();
            final boolean isTerminated = executor.isTerminated();
            builder.append(TAG).append("[ ");
            builder.append("ThreadPool:{")
                    .append(" coreSize:").append(corePoolSize).append(";")
                    .append(" poolSize:").append(poolSize).append(";")
                    .append(" isShutdown:").append(isShutdown).append(";")
                    .append(" isTerminated:").append(isTerminated).append(";")
                    .append(" activeCount:").append(activeCount).append(";")
                    .append(" taskCount:").append(taskCount).append(";")
                    .append(" completedCount:").append(completedCount).append(";")
                    .append("}\n");
        } else {
            // thread pool info
            final ExecutorService executor = mExecutor;
            final boolean isShutdown = executor.isShutdown();
            final boolean isTerminated = executor.isTerminated();
            builder.append(TAG).append("[ ");
            builder.append("ThreadPool:{")
                    .append(" isShutdown:").append(isShutdown).append(";")
                    .append(" isTerminated:").append(isTerminated).append(";")
                    .append("}\n");
        }
        // group map
        final Map<String, List<String>> callerMap = mGroups;
        builder.append("Groups:{");
        for (Map.Entry<String, List<String>> entry : callerMap.entrySet()) {
            builder.append(" group:").append(entry.getKey())
                    .append(", tags:").append(ThreadUtils.toString(entry.getValue())).append(";");
        }
        builder.append("}\n");
        builder.append("]");

        // task map
        Map<String, ITaskRunnable> taskMap = mTasks;
        builder.append("Tasks:{");
        for (Map.Entry<String, ITaskRunnable> entry : taskMap.entrySet()) {
            builder.append(" tag:").append(entry.getKey())
                    .append(", runnable:").append(entry.getValue()).append(";");
        }
        builder.append("}\n");

        final String info = builder.toString();
        Log.v(TAG, info);
        return info;
    }

    /********************************************************************
     *
     * PRIVATE METHODS
     *
     *******************************************************************/

    /**
     * 执行异步任务
     *
     * @param task 任务对象
     * @return 返回内部生成的此次任务的TAG
     */
    @Override
    String execute(final Task task) {
        if (Config.DEBUG) {
            Log.v(TAG, "execute() task=" + task);
        }
        checkExecutor();
        assert task != null;
        final ITaskRunnable runnable = TaskFactory.createRunnable(task);
        final String group = task.getGroup();
        final String name = task.getName();
        addToRunnableMap(name, runnable);
        addToGroupMap(name, group);

        runnable.setFuture(mExecutor.submit(runnable));
        return name;
    }

    /**
     * 执行异步任务,回调时会检查Caller是否存在,如果不存在就不执行回调函数
     *
     * @param callable Callable对象,任务的实际操作
     * @param callback 回调接口
     * @param caller   调用方,一般为Fragment或Activity
     * @param <Result> 类型参数,异步任务执行结果
     * @return 返回内部生成的此次任务的TAG
     */
    @Override
    <Result> String execute(final Callable<Result> callable,
                            final TaskCallback<Result> callback,
                            final Object caller) {
        checkArguments(callable, caller);
        return execute(TaskBuilder.create(callable).with(caller).
                callback(callback).on(this).done());
    }

    @Override
    boolean cancel(final TaskFuture task) {
        return cancelByName(task.getName());
    }

    private void addToRunnableMap(final String tag, final ITaskRunnable runnable) {
        synchronized (mLock) {
            mTasks.put(tag, runnable);
        }
    }

    private void addToGroupMap(final String name, final String group) {
        List<String> tags = mGroups.get(group);
        if (tags == null) {
            synchronized (mLock) {
                tags = new ArrayList<String>();
                mGroups.put(group, tags);
            }
        }
        synchronized (mLock) {
            tags.add(name);
        }
    }

    /**
     * 取消所有的Runnable对应的任务
     */
    private void cancelAllInQueue() {
        if (Config.DEBUG) {
            Log.v(TAG, "cancelAllInQueue()");
        }
        long start = SystemClock.elapsedRealtime();
        final Collection<ITaskRunnable> tasks = mTasks.values();
        for (ITaskRunnable task : tasks) {
            if (task != null) {
                task.cancel();
            }
        }
        synchronized (mLock) {
            mTasks.clear();
            mGroups.clear();
        }
        if (Config.DEBUG) {
            final long time = SystemClock.elapsedRealtime() - start;
            Log.v(TAG, "cancelAllInQueue() using " + time + "ms");
        }
    }

    int cancelByCaller(final Object caller) {
        if (Config.DEBUG) {
            Log.v(TAG, "cancelByCaller() caller=" + caller);
        }
        return cancelByGroup(TaskTag.getGroup(caller));
    }

    int cancelByGroup(final String group) {
        if (Config.DEBUG) {
            Log.v(TAG, "cancelByGroup() group=" + group);
        }
        long start = SystemClock.elapsedRealtime();
        int count = 0;
        final List<String> names;
        synchronized (mLock) {
            names = mGroups.remove(group);
        }
        if (names == null || names.isEmpty()) {
            return count;
        }
        for (String name : names) {
            cancelByName(name);
            ++count;
        }
        if (Config.DEBUG) {
            final long time = SystemClock.elapsedRealtime() - start;
            Log.v(TAG, "cancelByGroup() count=" + count + " using " + time + "ms");
        }
        return count;
    }

    boolean cancelByName(final String name) {
        if (Config.DEBUG) {
            Log.v(TAG, "cancelByName() name=" + name);
        }
        boolean result = false;
        final ITaskRunnable runnable;
        synchronized (mLock) {
            runnable = mTasks.remove(name);
        }
        if (runnable != null) {
            result = runnable.cancel();
        }
        return result;
    }

    @Override
    void remove(final TaskFuture task) {
        if (Config.DEBUG) {
            Log.v(TAG, "remove() " + task.getName());
        }
        synchronized (mLock) {
            mTasks.remove(task.getName());
        }
        List<String> tags = mGroups.get(task.getGroup());
        if (tags != null) {
            synchronized (mLock) {
                tags.remove(task.getName());
            }
        }
    }

    /**
     * 检查并初始化ExecutorService
     */
    private void checkExecutor() {
        if (mExecutor == null || mExecutor.isShutdown()) {
            ExecutorService poolExecutor;
            final String name = "task-queue-" + mMaxThreads;
            switch (mMaxThreads) {
                case 0:
                    // cached thread pool
                    poolExecutor = ThreadUtils.newCachedThreadPool(name);
                    break;
                case 1:
                    // single thread mode
                    poolExecutor = ThreadUtils.newSingleThreadExecutor(name);
                    break;
                default:
                    // fixed thread pool
                    poolExecutor = ThreadUtils.newFixedThreadPool(name, mMaxThreads);
                    break;

            }
            mExecutor = poolExecutor;
        }
    }

    /**
     * 关闭Executor
     */
    private void destroyExecutor() {
        if (mExecutor != null) {
            mExecutor.shutdown();
            mExecutor = null;
        }
    }

    /********************************************************************
     * STATIC METHODS
     *******************************************************************/

    private static void checkThread() {
        if (Looper.myLooper() != Looper.getMainLooper()) {
            throw new IllegalStateException("TaskQueue instance must be created on main thread");
        }
    }

    /**
     * 检查参数非空
     *
     * @param args 参数列表
     */
    private static void checkArguments(final Object... args) {
        for (Object o : args) {
            if (o == null) {
                throw new NullPointerException("argument can not be null " + Arrays.toString(args));
            }
        }
    }

    private static void logExecutor(final String name, final ThreadPoolExecutor executor) {
        final int corePoolSize = executor.getCorePoolSize();
        final int poolSize = executor.getPoolSize();
        final int activeCount = executor.getActiveCount();
        final long taskCount = executor.getTaskCount();
        final long completedCount = executor.getCompletedTaskCount();
        final boolean isShutdown = executor.isShutdown();
        final boolean isTerminated = executor.isTerminated();
        Log.v(TAG, name + " CorePoolSize:" + corePoolSize + " PoolSize:" + poolSize);
        Log.v(TAG, name + " isShutdown:" + isShutdown + " isTerminated:" + isTerminated);
        Log.v(TAG, name + " activeCount:" + activeCount + " taskCount:" + taskCount
                + " completedCount:" + completedCount);
    }

}


text:
Gulp & amd-optimize

 * Uses [Gulp](https://github.com/gulpjs/gulp/blob/master/docs/getting-started.md)
 * Uses [amd-optimize](https://github.com/scalableminds/amd-optimize)
 * Uses [Almond](https://github.com/jrburke/almond)


text:
package util.security

import models.UserImpl
import scala.collection.immutable.MapProxy

// This exists because a Guava cache loader is invariant in type K, this is an easy work around
case class FileUserMap(override val self: Map[String,UserImpl]) extends MapProxy[String,UserImpl]


text:
<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "building_before".
 *
 * @property string $id
 * @property string $inventory_id
 * @property string $house_no
 * @property integer $ward_no
 * @property string $owner_name
 * @property string $contact_no
 * @property string $present_use
 * @property string $construction_date_age
 * @property string $renovation_history
 * @property string $architectural_style
 * @property string $important_features
 * @property string $present_physical_conditions
 * @property string $historical_socio_cultural_significance
 * @property string $description
 * @property string $items_to_be_preserved_before
 * @property string $surveyor_opinion_before
 * @property string $recorded_by
 * @property string $old_date
 * @property string $photo_before_1
 * @property string $photo_before_2
 * @property string $photo_before_3
 * @property string $timestamp_created_at
 * @property string $timestamp_updated_at
 * @property string $user_id
 * @property boolean $verified
 *
 * @property User $user
 */
class BuildingBefore extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'building_before';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['inventory_id', 'house_no', 'present_use', 'renovation_history', 'important_features', 'present_physical_conditions', 'historical_socio_cultural_significance', 'description', 'items_to_be_preserved_before', 'surveyor_opinion_before', 'recorded_by', 'old_date', 'photo_before_1', 'photo_before_2', 'photo_before_3'], 'string'],
            [['ward_no', 'user_id'], 'integer'],
            [['timestamp_created_at', 'timestamp_updated_at'], 'safe'],
            [['verified'], 'boolean'],
            [['owner_name', 'contact_no', 'construction_date_age', 'architectural_style'], 'string', 'max' => 255]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => Yii::t('app', 'ID'),
            'inventory_id' => Yii::t('app', 'Inventory ID'),
            'house_no' => Yii::t('app', 'House No'),
            'ward_no' => Yii::t('app', 'Ward No'),
            'owner_name' => Yii::t('app', 'Owner Name'),
            'contact_no' => Yii::t('app', 'Contact No'),
            'present_use' => Yii::t('app', 'Present Use'),
            'construction_date_age' => Yii::t('app', 'Construction Date Age'),
            'renovation_history' => Yii::t('app', 'Renovation History'),
            'architectural_style' => Yii::t('app', 'Architectural Style'),
            'important_features' => Yii::t('app', 'Important Features'),
            'present_physical_conditions' => Yii::t('app', 'Present Physical Conditions'),
            'historical_socio_cultural_significance' => Yii::t('app', 'Historical Socio Cultural Significance'),
            'description' => Yii::t('app', 'Description'),
            'items_to_be_preserved_before' => Yii::t('app', 'Items To Be Preserved Before'),
            'surveyor_opinion_before' => Yii::t('app', 'Surveyor Opinion Before'),
            'recorded_by' => Yii::t('app', 'Recorded By'),
            'old_date' => Yii::t('app', 'Old Date'),
            'photo_before_1' => Yii::t('app', 'Photo Before 1'),
            'photo_before_2' => Yii::t('app', 'Photo Before 2'),
            'photo_before_3' => Yii::t('app', 'Photo Before 3'),
            'timestamp_created_at' => Yii::t('app', 'Timestamp Created At'),
            'timestamp_updated_at' => Yii::t('app', 'Timestamp Updated At'),
            'user_id' => Yii::t('app', 'User ID'),
            'verified' => Yii::t('app', 'Verified'),
        ];
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getUser()
    {
        return $this->hasOne(User::className(), ['id' => 'user_id']);
    }
}


text:
@class QPSQuestion;
@class UserInfoView;

@interface QuestionHeader : UIView

@property (nonatomic,strong) UserInfoView *userInfoView;
@property (nonatomic,strong) UILabel *textLabel;
@property (nonatomic,strong) UIImageView *imageView;
@property (nonatomic,strong) UILabel *cityLabel;
@property (nonatomic,strong) UIButton *locationButton;
@property (nonatomic,strong) UILabel *timeLabel;

- (void)setHeaderWithQuestion:(QPSQuestion *)question;
- (CGFloat)heightWithQuestion:(QPSQuestion *)question;

@end


text:
@implementation SpectacleScreenDetector

- (NSScreen *)screenWithAction:(SpectacleWindowAction)action
                       andRect:(CGRect)rect
                       screens:(NSArray *)screens
                    mainScreen:(NSScreen *)mainScreen
{
  NSArray *screensInConsistentOrder = [self screensInConsistentOrder:screens];
  NSScreen *result = [self screenContainingRect:rect screens:screensInConsistentOrder mainScreen:mainScreen];

  if (MovingToNextOrPreviousDisplay(action)) {
    result = [self nextOrPreviousScreenToFrameOfScreen:NSRectToCGRect([result frame])
                                   inDirectionOfAction:action
                                               screens:screensInConsistentOrder];
  }

  return result;
}

#pragma mark -

- (NSScreen *)screenContainingRect:(CGRect)rect screens:(NSArray *)screens mainScreen:(NSScreen *)mainScreen
{
  CGFloat largestPercentageOfRectWithinFrameOfScreen = 0.0f;
  NSScreen *result = mainScreen;

  for (NSScreen *currentScreen in screens) {
    CGRect currentFrameOfScreen = NSRectToCGRect(currentScreen.frame);
    CGRect flippedRect = rect;
    CGFloat percentageOfRectWithinCurrentFrameOfScreen = 0.0f;

    flippedRect.origin.y = FlipVerticalOriginOfRectInRect(flippedRect, currentFrameOfScreen);

    if (CGRectContainsRect(currentFrameOfScreen, flippedRect)) {
      result = currentScreen;

      break;
    }

    percentageOfRectWithinCurrentFrameOfScreen = [self percentageOfRect:flippedRect
                                                    withinFrameOfScreen:currentFrameOfScreen];

    if (percentageOfRectWithinCurrentFrameOfScreen > largestPercentageOfRectWithinFrameOfScreen) {
      largestPercentageOfRectWithinFrameOfScreen = percentageOfRectWithinCurrentFrameOfScreen;

      result = currentScreen;
    }
  }

  return result;
}

#pragma mark -

- (CGFloat)percentageOfRect:(CGRect)rect withinFrameOfScreen:(CGRect)frameOfScreen
{
  CGRect intersectionOfRectAndFrameOfScreen = CGRectIntersection(rect, frameOfScreen);
  CGFloat result = 0.0f;

  if (!CGRectIsNull(intersectionOfRectAndFrameOfScreen)) {
    result = AreaOfRect(intersectionOfRectAndFrameOfScreen) / AreaOfRect(rect);
  }

  return result;
}

#pragma mark -

- (NSScreen *)nextOrPreviousScreenToFrameOfScreen:(CGRect)frameOfScreen
                              inDirectionOfAction:(SpectacleWindowAction)action
                                          screens:(NSArray *)screens
{
  NSScreen *result = nil;

  if (screens.count <= 1) {
    return result;
  }

  for (NSInteger i = 0; i < screens.count; i++) {
    NSScreen *currentScreen = screens[i];
    CGRect currentFrameOfScreen = NSRectToCGRect(currentScreen.frame);
    NSInteger nextOrPreviousIndex = i;

    if (!CGRectEqualToRect(currentFrameOfScreen, frameOfScreen)) {
      continue;
    }

    if (action == SpectacleWindowActionNextDisplay) {
      nextOrPreviousIndex++;
    } else if (action == SpectacleWindowActionPreviousDisplay) {
      nextOrPreviousIndex--;
    }

    if (nextOrPreviousIndex < 0) {
      nextOrPreviousIndex = screens.count - 1;
    } else if (nextOrPreviousIndex >= screens.count) {
      nextOrPreviousIndex = 0;
    }

    result = screens[nextOrPreviousIndex];

    break;
  }

  return result;
}

# pragma mark -

- (NSArray *)screensInConsistentOrder:(NSArray *)screens
{
  NSArray *result = [[screens sortedArrayWithOptions:NSSortStable usingComparator:^(NSScreen *screenOne, NSScreen *screenTwo) {
    if (CGPointEqualToPoint(screenOne.frame.origin, CGPointMake(0, 0))) {
      return NSOrderedAscending;
    } else if (CGPointEqualToPoint(screenTwo.frame.origin, CGPointMake(0, 0))) {
      return NSOrderedDescending;
    }

    return (NSComparisonResult)(screenTwo.frame.origin.y - screenOne.frame.origin.y);
  }] sortedArrayWithOptions:NSSortStable usingComparator:^(NSScreen *screenOne, NSScreen *screenTwo) {
    if (CGPointEqualToPoint(screenOne.frame.origin, CGPointMake(0, 0))) {
      return NSOrderedAscending;
    } else if (CGPointEqualToPoint(screenTwo.frame.origin, CGPointMake(0, 0))) {
      return NSOrderedDescending;
    }

    return (NSComparisonResult)(screenTwo.frame.origin.x - screenOne.frame.origin.x);
  }];

  return result;
}

@end


text:
package com.thanple.thinking.root;

/**
 * Created by Thanple on 2016/12/15.
 * 工程的常量配置文件
 */
public class Constant {

    public static class Path{

        //工程根目录
        //F:\IdeaProjects\ThinkingInWorld
        public static final String ROOT_PATH = System.getProperty("user.dir");

        //运行class目录
        // /F:/IdeaProjects/ThinkingInWorld/target/classes/
        public static final String RUN_CLASS_PATH = Thread.currentThread().getContextClassLoader().getResource("").getPath();

        //tools目录
        public static final String TOOLS_PATH = ROOT_PATH + "/tools";
        public static final String TOOL_PROTOC = TOOLS_PATH + "/protoc.exe";

        //src目录下
        public static final String SRC_ROOT_PATH = ROOT_PATH + "/src/main/java";

        //resource目录下
        public static final String RESOURCE_ROOT_PATH = ROOT_PATH + "/src/main/resources";
    }

}


text:
<!DOCTYPE html>

    	<title></title>

 Wireframing Blog:

Ok, so first up would be  rtve.es  , and I'm choosing to wireframe my favorite show,  Comando Actualidad.

 This page's wireframe helps by ordering and categorizing video links into a digital library that features the latest episodes. It provides captions to inform the user of each video's content, along with links to older episodes and social media following the show. Since the background of the webpage is currently black with orange specks, there's a lot of contrast between the white layout. It also can give a feel of information overload.

Followed by  Google Drive:

Google Drive's wireframing provides for a hassle-free creation and search of documents. I can easily navigate through my files because folders are listed in sequential order. But it's also possible to rearrange and catalog them as it suits best. Due to the minimalistic design (which I find so great), I personally don't have any visual challenges with it. Actually, I like the predictability and stability this wireframe creates (once you know where eveything is it doesn't change).

And lastly,  Livemocha.com

Livemocha.com's homepage neatly divides information that a user would like to know, such as "What is this page all about?" I'm pretty satified with the wireframing distribution of the content. It's appealing enough that you will read throughout the whole page in order to get a gist of it.


text:
using System.Collections.Generic;

using Moq;

using NUnit.Framework;

using Ploeh.AutoFixture;

using RememBeer.Business.Logic.Admin.UserDetails;
using RememBeer.Business.Logic.Admin.UserDetails.Contracts;
using RememBeer.Business.Logic.Common.EventArgs.Contracts;
using RememBeer.Business.Services.Contracts;
using RememBeer.Models;
using RememBeer.Models.Contracts;
using RememBeer.Tests.Utils;
using RememBeer.Tests.Utils.MockedClasses;

namespace RememBeer.Tests.Business.Logic.Admin.UserDetails.Presenter
{
    [TestFixture]
   public class OnViewInitialized_Should : TestClassBase
    {
        [TestCase(null)]
        [TestCase("719f443f-6c3a-44a6-bd15-ff03bfbe54d5")]
        public void Call_UserServiceGetByIdMethodOnceWithCorrectParams(string expectedId)
        {
            var userService = new Mock<IUserService>();
            var view = new Mock<IUserDetailsView>();

            var args = new Mock<IIdentifiableEventArgs<string>>();
            args.Setup(a => a.Id)
                .Returns(expectedId);

            var presenter = new UserDetailsPresenter(userService.Object, view.Object);

            view.Raise(v => v.Initialized += null, view.Object, args.Object);

            userService.Verify(s => s.GetById(expectedId), Times.Once);
        }

        [Test]
        public void Set_ViewModelProperties_WhenUserIsFound()
        {
            var expectedId = this.Fixture.Create<string>();
            var expectedReviews = new List<BeerReview>();
            var expectedUser = new Mock<IApplicationUser>();
            expectedUser.Setup(u => u.BeerReviews)
                .Returns(expectedReviews);

            var userService = new Mock<IUserService>();
            userService.Setup(s => s.GetById(It.IsAny<string>()))
                       .Returns(expectedUser.Object);

            var viewModel = new MockedUserDetailsViewModel();
            var view = new Mock<IUserDetailsView>();
            view.Setup(v => v.Model)
                .Returns(viewModel);

            var args = new Mock<IIdentifiableEventArgs<string>>();
            args.Setup(a => a.Id)
                .Returns(expectedId);

            var presenter = new UserDetailsPresenter(userService.Object, view.Object);

            view.Raise(v => v.Initialized += null, view.Object, args.Object);

            Assert.AreSame(expectedUser.Object, viewModel.User);
            Assert.AreSame(expectedReviews, viewModel.Reviews);
        }

        [Test]
        public void Set_ViewModelProperties_WhenUserIsNotFound()
        {
            var expectedId = this.Fixture.Create<string>();
            var userService = new Mock<IUserService>();

            var view = new Mock<IUserDetailsView>();

            var args = new Mock<IIdentifiableEventArgs<string>>();
            args.Setup(a => a.Id)
                .Returns(expectedId);

            var presenter = new UserDetailsPresenter(userService.Object, view.Object);

            view.Raise(v => v.Initialized += null, view.Object, args.Object);

            view.VerifySet(v => v.ErrorMessageText = It.IsAny<string>(), Times.Once);
            view.VerifySet(v => v.ErrorMessageVisible = true, Times.Once);
        }
    }
}


text:
package crate.elasticsearch.action.searchinto;

import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.support.broadcast.BroadcastOperationRequest;
import org.elasticsearch.common.Nullable;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.bytes.BytesArray;
import org.elasticsearch.common.bytes.BytesReference;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.xcontent.XContentHelper;

import java.io.IOException;
import java.util.Arrays;

public class SearchIntoRequest extends
        BroadcastOperationRequest<SearchIntoRequest> {

    @Nullable
    protected String routing;

    @Nullable
    private String preference;

    private BytesReference source;
    private boolean querySourceUnsafe;

    private String[] types = Strings.EMPTY_ARRAY;

    SearchIntoRequest() {
    }

    /**
     * Constructs a new inout request against the provided indices. No
     * indices provided means it will
     * run against all indices.
     */
    public SearchIntoRequest(String... indices) {
        super(indices);
    }

    @Override
    public ActionRequestValidationException validate() {
        ActionRequestValidationException validationException = super
                .validate();
        return validationException;
    }

    @Override
    protected void beforeStart() {
        if (querySourceUnsafe) {
            source = source.copyBytesArray();
            querySourceUnsafe = false;
        }
    }

    /**
     * The query source to execute.
     */
    public BytesReference source() {
        return source;
    }

    public SearchIntoRequest source(String source) {
        return this.source(new BytesArray(source), false);
    }

    public SearchIntoRequest source(BytesReference source, boolean unsafe) {
        this.source = source;
        this.querySourceUnsafe = unsafe;
        return this;
    }

    /**
     * The types of documents the query will run against. Defaults to all
     * types.
     */
    String[] types() {
        return this.types;
    }

    /**
     * The types of documents the query will run against. Defaults to all
     * types.
     */
    public SearchIntoRequest types(String... types) {
        this.types = types;
        return this;
    }

    /**
     * A comma separated list of routing values to control the shards the
     * search will be executed on.
     */
    public String routing() {
        return this.routing;
    }

    /**
     * A comma separated list of routing values to control the shards the
     * search will be executed on.
     */
    public SearchIntoRequest routing(String routing) {
        this.routing = routing;
        return this;
    }

    /**
     * The routing values to control the shards that the search will be
     * executed on.
     */
    public SearchIntoRequest routing(String... routings) {
        this.routing = Strings.arrayToCommaDelimitedString(routings);
        return this;
    }

    public SearchIntoRequest preference(String preference) {
        this.preference = preference;
        return this;
    }

    public String preference() {
        return this.preference;
    }

    @Override
    public void readFrom(StreamInput in) throws IOException {
        super.readFrom(in);
        routing = in.readOptionalString();
        preference = in.readOptionalString();
        querySourceUnsafe = false;
        source = in.readBytesReference();
        types = in.readStringArray();
    }

    @Override
    public void writeTo(StreamOutput out) throws IOException {
        super.writeTo(out);
        out.writeOptionalString(routing);
        out.writeOptionalString(preference);
        out.writeBytesReference(source);
        out.writeStringArray(types);
    }

    @Override
    public String toString() {
        String sSource = "_na_";
        try {
            sSource = XContentHelper.convertToJson(source, false);
        } catch (Exception e) {
            // ignore
        }
        return "[" + Arrays.toString(indices) + "]" + Arrays.toString(
                types) + ", querySource[" + sSource + "]";
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<LanguageData>
  <Mending.label>修補</Mending.label>
  <Mending.description>修補損壞的物品。</Mending.description>
</LanguageData>


text:
<?php

namespace Hgabka\KunstmaanExtensionBundle\Entity\PageParts;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Hgabka\KunstmaanExtensionBundle\Entity\SliderImage;
use Hgabka\KunstmaanExtensionBundle\Form\PageParts\SliderPagePartAdminType;
use Kunstmaan\PagePartBundle\Entity\AbstractPagePart;
use Symfony\Component\Form\AbstractType;

/**
 * ImagePagePart.
 *
 * @ORM\Entity
 * @ORM\Table(name="hg_kuma_extension_slider_page_parts")
 */
class SliderPagePart extends AbstractPagePart
{
    /**
     * @var ArrayCollection|SliderImage[]
     *
     * @ORM\OneToMany(targetEntity="\Hgabka\KunstmaanExtensionBundle\Entity\SliderImage", mappedBy="sliderPagePart", cascade={"persist"})
     * @ORM\OrderBy({"displayOrder" = "ASC"})
     */
    protected $images;

    public function __construct()
    {
        $this->images = new ArrayCollection();
    }

    /**
     * @return ArrayCollection|SliderImage[]
     */
    public function getImages()
    {
        return $this->images;
    }

    /**
     * @param ArrayCollection|SliderImage[] $images
     *
     * @return $this
     */
    public function setImages($images)
    {
        $this->images = $images;

        return $this;
    }

    public function addImage(SliderImage $image)
    {
        $image->setSliderPagePart($this);
        $this->images->add($image);

        return $this;
    }

    public function removeImage(SliderImage $image)
    {
        $this->images->removeElement($image);

        return $this;
    }

    /**
     * Returns the view used in the frontend.
     *
     * @return string
     */
    public function getDefaultView()
    {
        return 'HgabkaKunstmaanExtensionBundle:PageParts:SliderPagePart/view.html.twig';
    }

    /**
     * Returns the view used in the backend.
     *
     * @return string
     */
    public function getAdminView()
    {
        return 'HgabkaKunstmaanExtensionBundle:PageParts:SliderPagePart/view-admin.html.twig';
    }

    /**
     * @return AbstractType
     */
    public function getDefaultAdminType()
    {
        return SliderPagePartAdminType::class;
    }
}


text:
package org.apache.flink.table.planner.functions.casting;

import org.apache.flink.annotation.Internal;
import org.apache.flink.table.types.logical.LogicalType;
import org.apache.flink.table.types.logical.LogicalTypeFamily;
import org.apache.flink.table.types.logical.LogicalTypeRoot;

import java.util.Collections;
import java.util.HashSet;
import java.util.Optional;
import java.util.Set;
import java.util.function.BiPredicate;

/**
 * In order to apply a {@link CastRule}, the runtime checks if a particular rule matches the tuple
 * of input and target type using this class. In particular, a rule is applied if:
 *
 *

 *
{@link #getTargetTypeRoots()} includes the {@link LogicalTypeRoot} of target type and
 *       either
 *

 *
{@link #getInputTypeRoots()} includes the {@link LogicalTypeRoot} of input type or
 *
{@link #getInputTypeFamilies()} includes one of the {@link LogicalTypeFamily} of
 *             input type
 *

 *
Or {@link #getTargetTypeFamilies()} includes one of the {@link LogicalTypeFamily} of target
 *       type and either
 *

 *
{@link #getInputTypeRoots()} includes the {@link LogicalTypeRoot} of input type or
 *
{@link #getInputTypeFamilies()} includes one of the {@link LogicalTypeFamily} of
 *             input type
 *

 *
Or, if {@link #getCustomPredicate()} is not null, the input {@link LogicalType} and target
 *       {@link LogicalType} matches the predicate.
 *

 *
 *
The {@code customPredicate} should be used in cases where {@link LogicalTypeRoot} and {@link
 * LogicalTypeFamily} are not enough to identify whether a rule is applicable or not, for example
 * when the matching depends on a field of the provided input {@link LogicalType} instance.
 */
@Internal
public class CastRulePredicate {

    private final Set<LogicalType> targetTypes;

    private final Set<LogicalTypeRoot> inputTypeRoots;
    private final Set<LogicalTypeRoot> targetTypeRoots;

    private final Set<LogicalTypeFamily> inputTypeFamilies;
    private final Set<LogicalTypeFamily> targetTypeFamilies;

    private final BiPredicate<LogicalType, LogicalType> customPredicate;

    private CastRulePredicate(
            Set<LogicalType> targetTypes,
            Set<LogicalTypeRoot> inputTypeRoots,
            Set<LogicalTypeRoot> targetTypeRoots,
            Set<LogicalTypeFamily> inputTypeFamilies,
            Set<LogicalTypeFamily> targetTypeFamilies,
            BiPredicate<LogicalType, LogicalType> customPredicate) {
        this.targetTypes = targetTypes;
        this.inputTypeRoots = inputTypeRoots;
        this.targetTypeRoots = targetTypeRoots;
        this.inputTypeFamilies = inputTypeFamilies;
        this.targetTypeFamilies = targetTypeFamilies;
        this.customPredicate = customPredicate;
    }

    public Set<LogicalType> getTargetTypes() {
        return targetTypes;
    }

    public Set<LogicalTypeRoot> getInputTypeRoots() {
        return inputTypeRoots;
    }

    public Set<LogicalTypeRoot> getTargetTypeRoots() {
        return targetTypeRoots;
    }

    public Set<LogicalTypeFamily> getInputTypeFamilies() {
        return inputTypeFamilies;
    }

    public Set<LogicalTypeFamily> getTargetTypeFamilies() {
        return targetTypeFamilies;
    }

    public Optional<BiPredicate<LogicalType, LogicalType>> getCustomPredicate() {
        return Optional.ofNullable(customPredicate);
    }

    public static Builder builder() {
        return new Builder();
    }

    /** Builder for the {@link CastRulePredicate}. */
    public static class Builder {
        private final Set<LogicalTypeRoot> inputTypeRoots = new HashSet<>();
        private final Set<LogicalTypeRoot> targetTypeRoots = new HashSet<>();
        private final Set<LogicalType> targetTypes = new HashSet<>();

        private final Set<LogicalTypeFamily> inputTypeFamilies = new HashSet<>();
        private final Set<LogicalTypeFamily> targetTypeFamilies = new HashSet<>();

        private BiPredicate<LogicalType, LogicalType> customPredicate;

        public Builder input(LogicalTypeRoot inputTypeRoot) {
            inputTypeRoots.add(inputTypeRoot);
            return this;
        }

        public Builder target(LogicalTypeRoot outputTypeRoot) {
            targetTypeRoots.add(outputTypeRoot);
            return this;
        }

        public Builder target(LogicalType outputType) {
            targetTypes.add(outputType);
            return this;
        }

        public Builder input(LogicalTypeFamily inputTypeFamily) {
            inputTypeFamilies.add(inputTypeFamily);
            return this;
        }

        public Builder target(LogicalTypeFamily outputTypeFamily) {
            targetTypeFamilies.add(outputTypeFamily);
            return this;
        }

        public Builder predicate(BiPredicate<LogicalType, LogicalType> customPredicate) {
            this.customPredicate = customPredicate;
            return this;
        }

        public CastRulePredicate build() {
            return new CastRulePredicate(
                    Collections.unmodifiableSet(targetTypes),
                    Collections.unmodifiableSet(inputTypeRoots),
                    Collections.unmodifiableSet(targetTypeRoots),
                    Collections.unmodifiableSet(inputTypeFamilies),
                    Collections.unmodifiableSet(targetTypeFamilies),
                    customPredicate);
        }
    }
}


text:
require 'logger'
require 'csv'

module PurolandGreeting
  class Database
    def self.connect
      ActiveRecord::Base.establish_connection ENV['DATABASE_URL']
      logger = Logger.new(STDERR)
      logger.level = Logger::WARN
      ActiveRecord::Base.logger = logger
      ActiveRecord::Base.default_timezone = :local
    end

    def self.register(items: [], nextday_items: [], new_items: [], new_nextday_items: [])
      normalizer = Normalizer.new

      keys = [ :character, :place, :start_at, :end_at, :deleted ].freeze
      nextday_keys = [ :character, :date, :deleted ].freeze

      deleted_items = nil
      added_items = nil

      items = [
        items.select {|item| !normalizer.ignored_in_old_site?(item[:character]) },
        new_items.select {|item| normalizer.include_in_new_site?(item[:character]) },
      ].flatten(1)

      items.each do |item|
        item[:end_at] ||= item[:start_at] + (normalizer.default_minutes_by_place(item[:place]) || 30) * 60
      end

      nextday_items = [
        nextday_items.select {|item| !normalizer.ignored_in_old_site?(item[:character]) },
        new_nextday_items.select {|item| normalizer.include_in_new_site?(item[:character]) },
      ].flatten(1)

      ActiveRecord::Base.transaction do
        dates = items.map {|item| item[:start_at].to_date }.uniq
        before = Appearance.joins(greeting: :schedule).where('schedules.date IN ( ? )', dates).map {|a|
            Hash[keys.zip([ a.raw_character_name, a.greeting.raw_place_name, a.greeting.start_at, a.greeting.end_at, a.greeting.deleted ])]
        }.to_set
        after = items.map {|item|
          { deleted: false }.merge item
        }.to_set

        deleted_items = (before - after).select {|item| !item[:deleted] }
        deleted_items.each do |item|
          character_name, costume_name = normalizer.character(item[:character])
          character = Character.where(name: character_name).first
          costume = Costume.where(name: costume_name).first if costume_name
          place = Place.where(name: normalizer.place(item[:place])).first
          schedule = Schedule.where(date: item[:start_at].to_date).first
          greeting = Greeting.where(
            start_at: item[:start_at],
            end_at: item[:end_at],
            place_id: place.id,
            schedule_id: schedule.id,
            deleted: false).first or next

          appearance = Appearance.where(
            character_id: character.id,
            costume_id: costume && costume.id,
            greeting_id: greeting.id).first or next

          deleted_greeting = Greeting.where(
            start_at: item[:start_at],
            end_at: item[:end_at],
            place_id: place.id,
            schedule_id: schedule.id,
            deleted: true).first_or_initialize
          deleted_greeting.raw_place_name = item[:place]
          deleted_greeting.save!

          appearance.update_attribute :greeting_id, deleted_greeting.id
          greeting.destroy if greeting.characters.empty?
        end

        added_items = []
        (after - before).each do |item|
          character_name, costume_name = normalizer.character(item[:character])
          character = Character.where(name: character_name).first_or_create
          costume = Costume.where(name: costume_name).first_or_create if costume_name
          place = Place.where(name: normalizer.place(item[:place])).first_or_create
          schedule = Schedule.where(date: item[:start_at].to_date).first_or_create
          greeting = Greeting.where(
            start_at: item[:start_at],
            end_at: item[:end_at],
            place_id: place.id,
            schedule_id: schedule.id,
            deleted: item[:deleted]).first_or_initialize
          greeting.raw_place_name = item[:place]
          greeting.save!

          appearance = Appearance.where(
            character_id: character.id,
            costume_id: costume && costume.id,
            greeting_id: greeting.id
          ).first_or_initialize {
            added_items << item
          }
          appearance.raw_character_name = item[:character]
          appearance.save!
        end

        unless nextday_items.empty?
          dates = nextday_items.map {|item| item[:date] }.uniq
          before_nextday = TemporaryAppearance.joins(:temporary_schedule).where('temporary_schedules.date IN ( ? )', dates).map {|a|
            Hash[nextday_keys.zip([ a.raw_character_name, a.temporary_schedule.date, a.deleted ])]
          }.to_set
          after_nextday = nextday_items.map {|item|
            { deleted: false }.merge item
          }.to_set

          (before_nextday - after_nextday).select {|item| !item[:deleted] }.each do |item|
            character_name, _ = normalizer.character(item[:character])
            character = Character.where(name: character_name).first_or_create
            schedule = TemporarySchedule.where(date: item[:date]).first_or_create
            TemporaryAppearance.where(character_id: character.id, temporary_schedule_id: schedule.id).update_all deleted: true
          end

          (after_nextday - before_nextday).each do |item|
            character_name, _ = normalizer.character(item[:character])
            character = Character.where(name: character_name).first_or_create
            schedule = TemporarySchedule.where(date: item[:date]).first_or_create
            appearance = TemporaryAppearance.where(character_id: character.id, temporary_schedule_id: schedule.id, deleted: item[:deleted]).first_or_initialize
            appearance.raw_character_name = item[:character]
            appearance.save!
          end

          nextday_items.map {|item| item[:date] }.uniq.each do |date|
            TemporarySchedule.where(date: date).first_or_create
          end
        end

      end

      [ added_items, deleted_items, ]
    end

    def self.import(src)
      register(items: LTSV.load(src).map {|item|
        {
          character: item[:character],
          place: item[:place],
          start_at: Time.parse(item[:start_at]),
          end_at: Time.parse(item[:end_at]),
          deleted: (item[:deleted] == 'true') || false,
        }
      })
    end

    def self.import_ohtake_csv(src)
      src = src.each_line.to_a[1..-1].join
      csv = CSV.new(src, headers: true, header_converters: :symbol)
      register(items: csv.map {|item|
        {
          character: item[:name],
          place: item[:location],
          start_at: Time.parse(item[:start]),
          end_at: Time.parse(item[:end]),
          deleted: false,
        }
      })
    end

    def self.dump
      Appearance.includes(:character, greeting: :place).order('greeting_id ASC, character_id ASC').map {|a|
        {
          character: a.raw_character_name,
          place: a.greeting.raw_place_name,
          start_at: a.greeting.start_at,
          end_at: a.greeting.end_at,
          deleted: a.greeting.deleted,
          normalized_character: a.character.name,
          normalized_place: a.greeting.place.name,
        }
      }
    end

    def self.export
      dump.map {|item| LTSV.dump(item) }.join("\n")
    end

    def self.dump_by_date(date)
      Appearance.find_by_sql([
        %{
          SELECT
            appearances.raw_character_name AS raw_character_name,
            greetings.raw_place_name AS raw_place_name,
            greetings.start_at AS start_at,
            greetings.end_at AS end_at
          FROM appearances
          JOIN greetings ON greetings.id = appearances.greeting_id
          JOIN schedules ON schedules.id = greetings.schedule_id
          WHERE
            schedules.date = :date
            AND greetings.deleted = FALSE
          ORDER BY end_at, start_at, raw_place_name, raw_character_name
        },
        {
          date: date,
        }
      ]).map {|a|
        {
          character: a.raw_character_name,
          place: a.raw_place_name,
          start_at: a.start_at,
          end_at: a.end_at,
        }
      }
    end

    def self.export_by_date(date)
      dump_by_date(date).map {|item| LTSV.dump(item) }.join("\n")
    end

    def self.normalize
      ActiveRecord::Base.transaction do
        normalizer = Normalizer.new
        normalizer.character_table.each do |before, after|
          before_character = Character.find_by_name(before) or next
          after_character = Character.where(name: after).first_or_create
          Appearance.where('character_id = ?', before_character.id).update_all character_id: after_character.id
          TemporaryAppearance.where('character_id = ?', before_character.id).update_all character_id: after_character.id
          before_character.destroy
        end
        normalizer.place_table.each do |before, after|
          before_place = Place.find_by_name(before) or next
          after_place = Place.where(name: after).first_or_create
          Greeting.where('place_id = ?', before_place.id).update_all place_id: after_place.id
          before_place.destroy
        end
      end
    end
  end
end


text:
<?php

namespace Colibri\Validator\Messages;

use Colibri\Validator\MessageInterface;

/**
 * Class NoticeMessage
 * @package Colibri\Validator\Messages
 */
class NoticeMessage extends AbstractMessage
{

    /**
     * NoticeMessage constructor.
     *
     * @param string $message
     */
    public function __construct($message)
    {
        parent::__construct($message, MessageInterface::NOTICE_CODE);
    }

    /**
     * @return string
     */
    public function toString(): string
    {
        return sprintf('Notice: %s', $this->toString());
    }

}


text:
cask "betterandbetter" do
  version "2.5.1"
  sha256 "fa6606e91a99dbd726cfb51e07e21e8c12af6b01a691443e9ef1b3ad1fafea9c"

  url "https://cdn.better365.cn/BetterAndBetter/BetterAndBetter#{version}Beta.dmg"
  name "Better And Better"
  desc "Keyboard, mouse and touchpad motion gestures"
  homepage "https://www.better365.cn/bab2.html"

  livecheck do
    url "https://www.better365.cn/BetterAndBetterUpdate.xml"
    strategy :sparkle, &:short_version
  end

  pkg "BetterAndBetter#{version}Beta.pkg"

  uninstall pkgutil:   [
    "cn.better365.BetterAndBetter",
    "cn.better365.BetterAndBetterHelper",
  ],
            launchctl: "cn.better365.BetterAndBetterHelper",
            quit:      "cn.better365.BetterAndBetter"

  zap trash: [
    "~/Library/Application Support/BetterAndBetter",
    "~/Library/Application Support/cn.better365.BetterAndBetter",
    "~/Library/Caches/cn.better365.BetterAndBetter",
  ]
end


text:
********************************************************************************
	Project owner:		RageQuit community
	Project name: 		GTW-RPG
	Developers:   		Mr_Moose

	Source code:		https://github.com/404rq/GTW-RPG/
	Bugtracker: 		https://discuss.404rq.com/t/issues
	Suggestions:		https://discuss.404rq.com/t/development

	Version:    		Open source
	License:    		BSD 2-Clause
	Status:     		Stable release
********************************************************************************
]]--

function applyStaffAdvantage(plr)
	-- Staff advantage
    local accName = getAccountName(getPlayerAccount(plr))
    if isObjectInACLGroup("user."..accName, aclGetGroup("Admin")) then
     	setElementData(plr, "staff", 10)
     	bindKey(plr, "J", "down", "jetpack")
     	if subOccupation and subOccupation == "Admin" then
     		setElementData(plr, "admin", true)
     	end
    elseif isObjectInACLGroup("user."..accName, aclGetGroup("Developer")) then
     	setElementData(plr, "staff", 9)
     	bindKey(plr, "J", "down", "jetpack")
     	if subOccupation and subOccupation == "Developer" then
     		setElementData(plr, "admin", true)
     	end
    elseif isObjectInACLGroup("user."..accName, aclGetGroup("Moderator")) then
    	setElementData(plr, "staff", 8)
     	bindKey(plr, "J", "down", "jetpack")
     	if subOccupation and subOccupation == "Moderator" then
     		setElementData(plr, "admin", true)
     	end
    elseif isObjectInACLGroup("user."..accName, aclGetGroup("Supporter")) then
    	setElementData(plr, "staff", 7)
     	bindKey(plr, "J", "down", "jetpack")
     	if subOccupation and subOccupation == "Supporter" then
     		setElementData(plr, "admin", true)
     	end
    end
end

function jetpack(thePlayer)
    if doesPedHaveJetPack(thePlayer) then
        removePedJetPack(thePlayer)
        return
    end

    -- Otherwise, give him one if he has access
    local accName = getAccountName(getPlayerAccount(thePlayer))
    if (isObjectInACLGroup("user."..accName, aclGetGroup("Admin")) or
		isObjectInACLGroup("user."..accName, aclGetGroup("Developer")) or
		isObjectInACLGroup("user."..accName, aclGetGroup("Moderator")) or
		isObjectInACLGroup("user."..accName, aclGetGroup("Supporter"))) and
		getPlayerWantedLevel(thePlayer) == 0 then
        if not doesPedHaveJetPack(thePlayer) then
            givePedJetPack(thePlayer)
			bindKey(thePlayer, "J", "down", "jetpack")
        end
    elseif getPlayerWantedLevel(thePlayer) > 0 then
    	exports.GTWtopbar:dm("You can't use jetpack while being wanted", thePlayer, 255, 0, 0)
    end
end
addCommandHandler("jetpack", jetpack)

function goStaff(source, command)
    local accName = getAccountName(getPlayerAccount(source))
    if (isObjectInACLGroup("user."..accName, aclGetGroup("Admin")) or
		isObjectInACLGroup("user."..accName, aclGetGroup("Developer")) or
		isObjectInACLGroup("user."..accName, aclGetGroup("Moderator")) or
		isObjectInACLGroup("user."..accName, aclGetGroup("Supporter"))) and
		getPlayerWantedLevel(source) == 0 then
	    setElementData(source, "admin",true)
        exports.GTWtopbar:dm("Staff mode is now enabled", source, 0, 255, 0)
        setPlayerNametagColor(source, getTeamColor(getTeamFromName("Staff")))
        --setPlayerNametagShowing(source, false)
        if command == "gostaff" then
        	setElementModel(source, 217)
        elseif command == "gostafff" then
        	setElementModel(source, 211)
        end
     	setPlayerTeam(source, getTeamFromName("Staff"))
     	if isObjectInACLGroup("user."..accName, aclGetGroup("Admin")) then
	     	setElementData(source, "Occupation", "Admin")
     		setElementData(source, "staff", 10)
     	elseif isObjectInACLGroup("user."..accName, aclGetGroup("Developer")) then
     		setElementData(source, "Occupation", "Developer")
     		setElementData(source, "staff", 9)
     	elseif isObjectInACLGroup("user."..accName, aclGetGroup("Moderator")) then
     		setElementData(source, "Occupation", "Moderator")
     		setElementData(source, "staff", 8)
     	elseif isObjectInACLGroup("user."..accName, aclGetGroup("Supporter")) then
     		setElementData(source, "Occupation", "Supporter")
     		setElementData(source, "staff", 7)
     	end
     	bindKey(source, "J", "down", "jetpack")
     	setPlayerWantedLevel(source, 0)
     	setElementData(source, "Wanted", 0.0)
     	setElementAlpha(source, 255)
     	--setPlayerNametagShowing(source, false)
    elseif getPlayerWantedLevel(source) > 0 then
    	exports.GTWtopbar:dm("You can't use staff mode while being wanted", source, 255, 0, 0)
    end
end
addCommandHandler("gostaff", goStaff)
addCommandHandler("gostafff", goStaff)

function endStaff(source)
    local accName = getAccountName(getPlayerAccount(source))
    if isObjectInACLGroup("user."..accName, aclGetGroup("Admin")) or
		isObjectInACLGroup("user."..accName, aclGetGroup("Developer")) or
		isObjectInACLGroup("user."..accName, aclGetGroup("Moderator")) or
		isObjectInACLGroup("user."..accName, aclGetGroup("Supporter")) then
	    setElementData(source, "admin",false)
        setPlayerNametagColor(source, getTeamColor(getTeamFromName("Unemployed")))
        --setPlayerNametagShowing(source, false)
        local skinID = exports.GTWclothes:getBoughtSkin(source)
        setElementModel(source, skinID)
     	setPlayerTeam(source, getTeamFromName("Unemployed"))
     	setElementData(source, "Occupation", "")
    end
end
addCommandHandler("endwork", endStaff)
addEvent("GTWdata_onEndWork", true)
addEventHandler("GTWdata_onEndWork", root, endStaff)


text:
"""Custom classification model that is already retained by data."""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import tensorflow.compat.v2 as tf
from tensorflow_examples.lite.model_maker.core import compat

def generate_elements(ds):
  """Generates elements from `tf.data.dataset`."""
  if compat.get_tf_behavior() == 2:
    for element in ds.as_numpy_iterator():
      yield element
  else:
    iterator = tf.compat.v1.data.make_one_shot_iterator(ds)
    next_element = iterator.get_next()
    with tf.compat.v1.Session() as sess:
      try:
        while True:
          yield sess.run(next_element)
      except tf.errors.OutOfRangeError:
        return


text:
'use strict';

const assert = require('assert');
const ActiveCollab = require('../index');
const fs = require('fs');
const chai = require('chai');
const expect = chai.expect;
const chaiAsPromised = require("chai-as-promised");
chai.use(chaiAsPromised);

if (!process.env.email || !process.env.password) {
    throw 'Expected an email and password in process.env';
}

const client = new ActiveCollab.Client('ActiveCollab.js', 'Gerard');

describe('Client', function () {
    describe('#login()', function () {
        it('should login', () => client.login(process.env.email, process.env.password));
    });
});

describe('Account', function () {
    let account;

    before(() => {
        if (client.accounts.empty()) {
            throw 'No accounts are loaded.'
        }

        account = client.accounts.first();
    });

    describe('#issueToken()', function () {
        it('should fetch the token', () => account.issueToken());
    });

    describe('#projects()', function () {
        it('should get the projects', () => account.projects());
    });

    describe('#projects.create()', function () {
        it('should fail because the name is missing', () => expect(account.projects.create({})).to.be.rejected);
        it('should add a new Test project', () => expect(account.projects.create({name: 'Test'})).to.be.fulfilled);
    });
});
describe('Project', function () {
    let account;

    before(() => {
        if (client.accounts.empty()) {
            throw 'No accounts are loaded.'
        }

        account = client.accounts.first();
    });

    describe('#remove()', function () {
        it('should remove the Test project(s)', () => {
            return expect(
                account.projects()
                    .then((projects) => projects
                    .filter((project) => project.name === 'Test')
                    .promise((project) => project.remove())
                )
            ).to.be.fulfilled
        });
    });
});


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<feed><tipo>Rua</tipo><logradouro>Geruzinho</logradouro><bairro>Centro</bairro><cidade>Aracaju</cidade><uf>SE</uf><cep>49010420</cep></feed>


text:
namespace System.ServiceModel.Configuration
{
    using System;
    using System.Configuration;

    [AttributeUsage(AttributeTargets.Property)]
    sealed class WebEncodingValidatorAttribute : ConfigurationValidatorAttribute
    {
        public WebEncodingValidatorAttribute()
        {
        }

        public override ConfigurationValidatorBase ValidatorInstance
        {
            get { return new WebEncodingValidator(); }
        }
    }
}


text:
namespace System.Collections.Generic
{
    /// <summary>
    /// An object that provides optional configuration information for <see cref="T:IEnumerable{T}.ToDelimetedFile{T}"/>.
    /// </summary>
    public sealed class DelimetedOptions
    {
        /// <summary>
        /// 	<para>Initializes an instance of the <see cref="DelimetedOptions"/> class.</para>
        /// </summary>
        public DelimetedOptions() : this(',', false) { }

        /// <summary>
        /// 	<para>Initializes an instance of the <see cref="DelimetedOptions"/> class.</para>
        /// </summary>
        /// <param name="delimeter">The character that will be used to delimit data in the file.</param>
        /// <param name="includeHeader">Specifies if a column header will be included in the file.</param>
        public DelimetedOptions(char delimeter, bool includeHeader)
        {
            this.Delimeter = delimeter;
            this.IncludeHeader = includeHeader;
        }

        /// <summary>
        /// Gets the character that will be used to delimit data in the file.
        /// </summary>
        public char Delimeter { get; private set; }

        /// <summary>
        /// Gets a value that specifies if a column header will be included in the file.
        /// </summary>
        public bool IncludeHeader { get; private set; }
    }
}