text:
#pragma once

#include "zAdAChar.h"

#pragma pack (push, 8)

#ifdef ZCUTIL_INTERNAL
#include <tchar.h>
#include <afx.h>
#ifdef ZDUI_PORT
#undef ZDUI_PORT
#endif
#define ZDUI_PORT
#endif

#include "zaduipathenums.h"

enum FS_TYPE {
    NOFS,
    UKFS,
    NTFS,
    FAT,
    VFAT,
    HPFS,
    CDFS,
    HFS,
    UFS
};

extern __declspec(selectany) const ZTCHAR kBackslash =  ZCRX_T( '\\' );
extern __declspec(selectany) const ZTCHAR kColon =      ZCRX_T( ':' );
extern __declspec(selectany) const ZTCHAR kDoubleQuote= ZCRX_T( '"' );
extern __declspec(selectany) const ZTCHAR kEOS =        ZCRX_T( '\0' );
extern __declspec(selectany) const ZTCHAR kPeriod =     ZCRX_T( '.' );
extern __declspec(selectany) const ZTCHAR kSlash =      ZCRX_T( '/' );
extern __declspec(selectany) const ZTCHAR kSpace =      ZCRX_T( ' ' );
extern __declspec(selectany) const ZTCHAR kAsterisk =   ZCRX_T( '*' );
extern __declspec(selectany) const ZTCHAR kQuestionmark = ZCRX_T( '?' );
extern __declspec(selectany) const ZTCHAR kZero =       ZCRX_T( '0' );

class ZDUI_PORT CZdUiVolumeDescriptor {

friend class CZdUiPathname;

public:

    CZdUiVolumeDescriptor();
    CZdUiVolumeDescriptor(const CString&);
    virtual ~CZdUiVolumeDescriptor();

    virtual inline BOOL CheckReadOnly() const {return m_d_readonly==1;};

    virtual BOOL ValidateFilename( const CString*,
                         const BOOL wildcard_ok = false ) const =0;

    virtual BOOL ValidateSegment( const CString*,
                         const BOOL wildcard_ok = false ) const =0;

    virtual BOOL IsCaseSensitive(void) const;

    virtual BOOL PreservesCase(void) const;

    virtual BOOL AllowsCaseSensitiveLookup(void) const;

    virtual void VolCase( CString& ) const;

    virtual BOOL VolMatch( const ZTCHAR * a, const CString* b ) const;
    virtual BOOL VolMatch( const CString* a, const CString* b) const;

    virtual inline const CString* GetLocalName() const { return m_vol_localname;};

    virtual LONG GetVolFreeSpace() const;

    virtual BOOL WillFit(DWORD) const;

    virtual BOOL VolumeValid() const;

#ifdef _DEBUG

    virtual void debug_dump(FILE*) const;
#endif

    inline BOOL IsRemote() const { return m_d_remote == 1; }

    inline BOOL IsRemovable() const { return m_d_removable == 1; }

protected:

    void GetConnectionName( void );
    int Find(const CString& str, UINT ch) const;
    int IsControl(int c) const;

    FS_TYPE m_vol_fs_type;

    typedef unsigned flagbits;

    flagbits m_d_fixed:    1;
    flagbits m_d_removable: 1;
    flagbits m_d_cdrom: 1;
    flagbits m_d_remote: 1;
    flagbits m_d_ramdisk: 1;
    flagbits m_d_readonly: 1;
    flagbits m_d_caseSensitive: 1;

    CString* m_vol_localname;

    int    m_max_component_size;

    int    m_max_path_length;

    ZTCHAR    m_vol_slash;

    BOOL     m_amodeMultiByte;
    DWORD    m_vol_serial;
    DWORD    m_fsflags;
    CString* m_vol_label;
    CString* m_connection_name;
    const ZTCHAR * m_doubleslash;
};

class ZDUI_PORT CZdUiNTFSVolumeDescriptor : public CZdUiVolumeDescriptor {

    public:

        CZdUiNTFSVolumeDescriptor(const CString&);
        ~CZdUiNTFSVolumeDescriptor(){};

        BOOL ValidateFilename( const CString*,
                               const BOOL wildcard_ok = false ) const;
        BOOL ValidateSegment( const CString*,
                              const BOOL wildcard_ok = false ) const;

};

class ZDUI_PORT CZdUiVFATVolumeDescriptor : public CZdUiVolumeDescriptor {

    public:

        CZdUiVFATVolumeDescriptor(const CString&);
        ~CZdUiVFATVolumeDescriptor(){};

        BOOL ValidateFilename( const CString*,
                               const BOOL wildcard_ok = false ) const;
        BOOL ValidateSegment( const CString*,
                              const BOOL wildcard_ok = false ) const;

};

class ZDUI_PORT CZdUiHPFSVolumeDescriptor : public CZdUiVolumeDescriptor {

    public:

        CZdUiHPFSVolumeDescriptor(const CString&);
        ~CZdUiHPFSVolumeDescriptor(){};

        BOOL ValidateFilename( const CString*,
                               const BOOL wildcard_ok = false ) const;
        BOOL ValidateSegment( const CString*,
                              const BOOL wildcard_ok = false ) const;

};

class ZDUI_PORT CZdUiCDFSVolumeDescriptor : public CZdUiVolumeDescriptor {

    public:

        CZdUiCDFSVolumeDescriptor(const CString&);
        ~CZdUiCDFSVolumeDescriptor(){};

        BOOL ValidateFilename( const CString*,
                               const BOOL wildcard_ok = false ) const;
        BOOL ValidateSegment( const CString*,
                              const BOOL wildcard_ok = false ) const;

};

class ZDUI_PORT CZdUiFATVolumeDescriptor : public CZdUiVolumeDescriptor {

    public:

        CZdUiFATVolumeDescriptor(const CString&);
        ~CZdUiFATVolumeDescriptor(){};

        BOOL ValidateFilename( const CString*,
                               const BOOL wildcard_ok = false ) const;
        BOOL ValidateSegment( const CString*,
                              const BOOL wildcard_ok = false ) const;
    protected:

        int m_segc;
};

class ZDUI_PORT CZdUiUFSVolumeDescriptor : public CZdUiVolumeDescriptor {

    public:

        CZdUiUFSVolumeDescriptor(const CString&);
        ~CZdUiUFSVolumeDescriptor(){};

        BOOL ValidateFilename( const CString*,
                               const BOOL wildcard_ok = false ) const;
        BOOL ValidateSegment( const CString*,
                              const BOOL wildcard_ok = false ) const;

};

class ZDUI_PORT CZdUiNOFSVolumeDescriptor : public CZdUiVolumeDescriptor {

    public:

        CZdUiNOFSVolumeDescriptor(const CString&);
        ~CZdUiNOFSVolumeDescriptor(){};

        BOOL ValidateFilename( const CString*,
                               const BOOL wildcard_ok = false ) const;
        BOOL ValidateSegment( const CString*,
                              const BOOL wildcard_ok = false ) const;

};

#pragma pack (pop)


text:
package com.ninjatjj.smsapp.client;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;

import android.app.AlarmManager;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Binder;
import android.os.IBinder;
import android.preference.PreferenceManager;
import android.support.v4.app.NotificationCompat;
import android.util.Log;

import com.ninjatjj.smsapp.R;
import com.ninjatjj.smsapp.SmsApplication;
import com.ninjatjj.smsapp.Utils;
import com.ninjatjj.smsapp.core.MessageListener;
import com.ninjatjj.smsapp.core.Sms;
import com.ninjatjj.smsapp.core.client.Client;
import com.ninjatjj.smsapp.core.client.ClientConnectionListener;
import com.ninjatjj.smsapp.ui.ContactManager;

public class SmsApplicationClient extends Service implements
		ClientConnectionListener, MessageListener, SmsApplication {
	private MyClient myClient;
	volatile private String uuid;
	private SharedPreferences defaultSharedPreferences;

	private Map<String, Set<Sms>> currentNotification = new HashMap<String, Set<Sms>>();

	private final BroadcastReceiver receiver = new BroadcastReceiver() {

		@Override
		public void onReceive(Context context, final Intent intent) {
			final String action = intent.getAction();
			if (action.equals("android.net.conn.CONNECTIVITY_CHANGE")) {
				ConnectivityManager conMan = (ConnectivityManager) context
						.getSystemService(Context.CONNECTIVITY_SERVICE);
				NetworkInfo netInfo = conMan.getActiveNetworkInfo();
				if (netInfo != null
						&& netInfo.getType() == ConnectivityManager.TYPE_WIFI) {
					if (myClient.shouldConnectWifi()) {
						myClient.reconnect();
					}
				}
			}
		}
	};

	public class LocalBinder extends Binder {
		public SmsApplicationClient getService() {
			return SmsApplicationClient.this;
		}
	}

	// This is the object that receives interactions from clients. See
	// RemoteService for a more complete example.
	private final IBinder mBinder = new LocalBinder();
	private boolean phoneConnected;

	@Override
	public IBinder onBind(Intent intent) {
		return mBinder;
	}

	@Override
	public int onStartCommand(Intent intent, int flags, int startId) {
		Log.i("LocalService", "Received start id " + startId + ": " + intent);
		// We want this service to continue running until it is explicitly
		// stopped, so return sticky.
		return START_STICKY;
	}

	@Override
	public void onCreate() {

		Utils.logcat("smsappclient");

		Log.d("smsapp", "service created");

		super.onCreate();

		IntentFilter filter4 = new IntentFilter();
		filter4.addAction("android.net.conn.CONNECTIVITY_CHANGE");
		registerReceiver(receiver, filter4);

		if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean(
				"persistentNotification", true)) {
			startForeground();
		}

		defaultSharedPreferences = PreferenceManager
				.getDefaultSharedPreferences(this);

		uuid = PreferenceManager.getDefaultSharedPreferences(
				SmsApplicationClient.this).getString("uuid", null);
		myClient = new MyClient(this,
				(AlarmManager) (this.getSystemService(Context.ALARM_SERVICE)),
				PreferenceManager.getDefaultSharedPreferences(
						SmsApplicationClient.this).getString("remoteAddress",
						null), PreferenceManager.getDefaultSharedPreferences(
						SmsApplicationClient.this).getString("wifiAddress",
						null), "8765", uuid);
		myClient.addMessageListener(SmsApplicationClient.this);
		myClient.addClientConnectionListener(SmsApplicationClient.this);

		connectionStateChange(false);
	}

	@Override
	public void onDestroy() {

		super.onDestroy();
		unregisterReceiver(receiver);

		myClient.removeMessageListener(SmsApplicationClient.this);
		myClient.removeClientConnectionListener(SmsApplicationClient.this);

		disconnect();

		NotificationManager notificationManger = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
		if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean(
				"persistentNotification", true)) {
			stopForeground();
		}
		notificationManger.cancel(02);
		notificationManger.cancel(03);
		notificationManger.cancel(04);

		myClient.exit();
		System.exit(0);
	}

	public Client getClient() {
		return myClient;
	}

	@Override
	public void connectionStateChange(boolean connected) {
		processNotification();
	}

	@Override
	public void messageReceived(Sms sms) {
		if (!sms.isRead() && sms.getPrefix().length() == 0) {
			Set<Sms> set2 = currentNotification.get(sms.getAddress());
			if (set2 == null) {
				set2 = new TreeSet<Sms>();
				currentNotification.put(sms.getAddress(), set2);
			}
			set2.add(sms);
			processNotification();
		}
	}

	@Override
	public void clearMessageReceived() {
		boolean cleared = currentNotification.size() > 0;
		currentNotification.clear();
		if (cleared) {
			processNotification();
		}
	}

	@Override
	public void messageRemoved(Sms sms) {
	}

	@Override
	public void cannotConnect(String reason) {
	}

	@Override
	public void longTimeToConnect() {
		// TODO Auto-generated method stub

	}

	public void disconnect() {
		myClient.setSocketConnectionDetails(null, "8765", myClient.uuid);
		myClient.disconnect();
	}

	@Override
	public void deleteThread(String address) throws IOException {
		myClient.deleteThread(address);
	}

	@Override
	public Set<Sms> getMessages() {
		return myClient.getMessages();
	}

	@Override
	public boolean hasUnread(String address) {
		return currentNotification.get(address) != null
				&& currentNotification.get(address).size() != 0;
	}

	@Override
	public void sendMessage(String address, String message) throws IOException,
			InterruptedException {
		myClient.sendMessage(address, message);
	}

	public void signalStrengthChanged(boolean connected) {
		Log.d("smsapp", "Signal strength changed: " + connected);
		phoneConnected = connected;
		processNotification();

	}

	private void processNotification() {
		NotificationManager notificationManger = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
		notificationManger.cancel(02);
		notificationManger.cancel(03);
		notificationManger.cancel(04);

		if (!myClient.connected()) {
			Intent intent = new Intent(SmsApplicationClient.this,
					SplashScreen.class);
			intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP
					| Intent.FLAG_ACTIVITY_NEW_TASK);
			PendingIntent pendingIntent = PendingIntent.getActivity(
					SmsApplicationClient.this, 01, intent, 0);
			NotificationCompat.Builder builder = new NotificationCompat.Builder(
					getApplicationContext());
			builder.setContentTitle(getResources().getString(R.string.app_name));
			builder.setContentIntent(pendingIntent);
			builder.setSmallIcon(R.drawable.icon_disconnected);// android.R.color.transparent);
			builder.setPriority(0);
			builder.setOngoing(true);
			Notification notification = builder.build();
			notificationManger.notify(03, notification);
		} else if (currentNotification.size() > 0
				&& PreferenceManager.getDefaultSharedPreferences(
						SmsApplicationClient.this).getBoolean(
						"newMessageNotification", true)) {
			String address = currentNotification.keySet()
					.toArray(new String[0])[0];
			Intent intent = new Intent(SmsApplicationClient.this,
					ClearNotificationConversationActivity.class);
			intent.putExtra("address", address);

			PendingIntent pendingIntent = PendingIntent.getActivity(
					SmsApplicationClient.this, 01, intent,
					PendingIntent.FLAG_UPDATE_CURRENT);
			NotificationCompat.Builder builder = new NotificationCompat.Builder(
					getApplicationContext());
			builder.setContentTitle(ContactManager.getDisplayName(
					getContentResolver(), address));
			builder.setContentIntent(pendingIntent);
			builder.setSmallIcon(R.drawable.icon_msg);
			builder.setPriority(0);
			Notification notification = builder.build();
			notification.defaults |= Notification.DEFAULT_ALL;
			notification.flags |= Notification.FLAG_AUTO_CANCEL;
			notificationManger.notify(02, notification);
		} else if (!phoneConnected) {
			Intent intent = new Intent(SmsApplicationClient.this,
					SplashScreen.class);
			intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP
					| Intent.FLAG_ACTIVITY_NEW_TASK);
			PendingIntent pendingIntent = PendingIntent.getActivity(
					SmsApplicationClient.this, 01, intent, 0);
			NotificationCompat.Builder builder = new NotificationCompat.Builder(
					getApplicationContext());
			builder.setContentTitle(getResources().getString(R.string.app_name));
			builder.setContentIntent(pendingIntent);
			builder.setSmallIcon(R.drawable.icon_phone_disconnected);
			builder.setPriority(0);
			builder.setOngoing(true);
			Notification notification = builder.build();
			notificationManger.notify(04, notification);
		}
	}

	public void startForeground() {
		Intent intent = new Intent(this, ConversationsActivity.class);
		PendingIntent pendingIntent = PendingIntent.getActivity(this, 01,
				intent, 0);
		NotificationCompat.Builder builder = new NotificationCompat.Builder(
				getApplicationContext());
		builder.setPriority(Notification.PRIORITY_MIN);
		builder.setContentTitle(getResources().getString(R.string.app_name));
		builder.setContentIntent(pendingIntent);
		builder.setSmallIcon(R.drawable.icon);// android.R.color.transparent);
		Notification notification = builder.build();
		startForeground(01, notification);
	}

	public void stopForeground() {
		stopForeground(true);
	}
}

redpajama_set_name: RedPajamaGithub


text:
static NSString * const kTableViewCellIdentifier = @"com.twotoasters.sampleCell";

@interface TWTMainViewController ()

@end

@implementation TWTMainViewController

- (void)viewDidAppear:(BOOL)animated {
    [super viewDidAppear:animated];
    NSLog(@"main viewDidAppear");
}
- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    NSLog(@"main viewWillAppear");
}

- (void)viewDidDisappear:(BOOL)animated {
    [super viewDidDisappear:animated];
    NSLog(@"main viewDidDisappear");
}
- (void)viewWillDisappear:(BOOL)animated {
    [super viewDidDisappear:animated];
    NSLog(@"main viewWillDisappear");
}

- (void)viewDidLoad
{
    [super viewDidLoad];

    self.title = @"My View";
    self.view.backgroundColor = [UIColor grayColor];

    UIBarButtonItem *openItem = [[UIBarButtonItem alloc] initWithTitle:@"Open" style:UIBarButtonItemStylePlain target:self action:@selector(openButtonPressed)];
    self.navigationItem.leftBarButtonItem = openItem;

    [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:kTableViewCellIdentifier];
}

- (void)openButtonPressed
{
    [self.sideMenuViewController openMenuAnimated:YES completion:nil];
}

#pragma mark - UITableViewDelegate & UITableViewDataSource

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 20;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return [tableView dequeueReusableCellWithIdentifier:kTableViewCellIdentifier forIndexPath:indexPath];
}

- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
    cell.textLabel.text = [NSString stringWithFormat:@"Row %i", indexPath.row + 1];
}

@end


text:
'use strict';

const rewire = require('rewire');
const DigsSerialDevice = rewire('../../lib/serial-device');
const digsMock = require('digs-common/test/mocks/digs');

describe(`DigsSerialDevice`, () => {
  let sandbox;
  let digs;
  let spawnm;

  beforeEach(() => {
    sandbox = sinon.sandbox.create('DigsSerialDevice');
    spawnm = sandbox.stub();
    spawnm.kill = sandbox.stub();
    digs = digsMock(sandbox);
    DigsSerialDevice.__set__('spawnm', spawnm);
  });

  afterEach(() => {
    sandbox.restore();
  });

  it(`should be a function`, () => {
    expect(DigsSerialDevice).to.be.a('function');
  });

  describe(`method`, () => {
    describe(`kill()`, () => {
      let dsd;

      beforeEach(() => {
        dsd = DigsSerialDevice({}, digs);
      });

      describe(`if a client has been created`, () => {
        beforeEach(() => {
          dsd.client = {};
        });

        it(`should kill the client and remove it`, () => {
          dsd.kill();
          expect(dsd.client).to.be.undefined;
          expect(spawnm.kill).to.have.been.calledOnce;
        });
      });

      describe(`if a client has not been created`, () => {
        it(`should not attempt to kill it`, () => {
          dsd.kill();
          expect(spawnm.kill).not.to.have.been.called;
        });
      });
    });
  });

  describe(`event callback`, () => {
    describe(`onstart()`, () => {

    });

    describe(`onstop()`, () => {

    });
  });
});


text:
using GameTimer;
using InputHelper;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using System;
using System.Threading.Tasks;

namespace MenuBuddy
{
	/// <summary>
	/// This is a button that can be clicked on
	/// </summary>
	public abstract class BaseButton : Widget, IButton, IDisposable
	{
		#region Fields

		/// <summary>
		/// whether or not to draw this item when inactive
		/// </summary>
		private bool _drawWhenInactive;

		private Vector2 _size;

		public event EventHandler<ClickEventArgs> OnClick;

		private CountdownTimer _clickTimer;

		public float ClickTimeDelta { get; set; } = 0.2f;

		private ILayout _layout;

		#endregion //Fields

		#region Properties

		public bool Clickable { get; set; }

		public Vector2 Size
		{
			protected get
			{
				return _size;
			}
			set
			{
				if (_size != value)
				{
					_size = value;
					CalculateRect();
				}
			}
		}

		public override float Scale
		{
			get
			{
				return base.Scale;
			}
			set
			{
				base.Scale = value;
				Layout.Scale = value;
			}
		}

		/// <summary>
		/// The layout to add to this button
		/// </summary>
		public ILayout Layout
		{
			get
			{
				return _layout;
			}
			protected set
			{
				_layout = value;
				if (null != _layout)
				{
					_layout.TransitionObject = TransitionObject;
				}
			}
		}

		public override bool IsHighlighted
		{
			get
			{
				return base.IsHighlighted;
			}
			set
			{
				base.IsHighlighted = value;
				Layout.IsHighlighted = value;
			}
		}

		public override bool DrawWhenInactive
		{
			get
			{
				return _drawWhenInactive;
			}
			set
			{
				_drawWhenInactive = value;
			}
		}

		public override Point Position
		{
			get { return base.Position; }
			set
			{
				if (base.Position != value)
				{
					base.Position = value;
					CalculateRect();
				}
			}
		}

		/// <summary>
		/// A description of the function of the menu entry.
		/// </summary>
		public string Description { get; set; }

		public bool IsQuiet { get; set; }

		protected SoundEffect HighlightedSoundEffect { get; set; }

		protected SoundEffect ClickedSoundEffect { get; set; }

		public bool IsClicked
		{
			get
			{
				return _clickTimer.HasTimeRemaining;
			}
			set
			{
				Layout.IsClicked = value;
			}
		}

		public override ITransitionObject TransitionObject
		{
			get
			{
				return base.TransitionObject;
			}

			set
			{
				base.TransitionObject = value;

				if (null != Layout)
				{
					Layout.TransitionObject = value;
				}
			}
		}

		public string HighlightedSound { get; set; }

		public string ClickedSound { get; set; }

		/// <summary>
		/// Event raised when the menu entry is selected.
		/// </summary>
		public event EventHandler OnLeft;

		/// <summary>
		/// Event raised when the menu entry is selected.
		/// </summary>
		public event EventHandler OnRight;

		#endregion //Properties

		#region Initialization

		/// <summary>
		/// Constructs a new button with the specified text.
		/// </summary>
		protected BaseButton()
		{
			Clickable = true;
			IsQuiet = false;
			_clickTimer = new CountdownTimer();

			//by default, just play a sound when this item is selected
			OnClick += PlaySelectedSound;

			OnClick += ((obj, e) =>
			{
				_clickTimer.Start(ClickTimeDelta);
			});

			OnHighlight += PlayHighlightSound;
			OnHighlight += ((obj, e) =>
			{
				IsHighlighted = true;
			});

			HighlightedSound = StyleSheet.HighlightedSoundResource;
			ClickedSound = StyleSheet.ClickedSoundResource;
		}

		/// <summary>
		/// Constructs a new button with the specified text.
		/// </summary>
		protected BaseButton(BaseButton inst) : base(inst)
		{
			Clickable = true;
			_drawWhenInactive = inst._drawWhenInactive;
			_size = inst._size;
			Description = inst.Description;
			OnClick = inst.OnClick;
			IsQuiet = inst.IsQuiet;
			HighlightedSoundEffect = inst.HighlightedSoundEffect;
			ClickedSoundEffect = inst.ClickedSoundEffect;
			_clickTimer = inst._clickTimer;
			OnLeft = inst.OnLeft;
			OnRight = inst.OnRight;

			HighlightedSound = inst.HighlightedSound;
			ClickedSound = inst.ClickedSound;
		}

		public override async Task LoadContent(IScreen screen)
		{
			if (null != screen.ScreenManager)
			{
				if (!string.IsNullOrEmpty(HighlightedSound))
				{
					HighlightedSoundEffect = screen.Content.Load<SoundEffect>(HighlightedSound);
				}

				if (!string.IsNullOrEmpty(ClickedSound))
				{
					ClickedSoundEffect = screen.Content.Load<SoundEffect>(ClickedSound);
				}
			}

			await Layout.LoadContent(screen);
			await base.LoadContent(screen);
		}

		public override void UnloadContent()
		{
			base.UnloadContent();

			Layout?.UnloadContent();
			Layout = null;

			OnClick = null;
			OnLeft = null;
			OnRight = null;
		}

		#endregion //Initialization

		#region Methods

		public void AddItem(IScreenItem item)
		{
			Layout.AddItem(item);
			CalculateRect();

			var widget = item as ITransitionable;
			if (null != widget)
			{
				widget.TransitionObject = TransitionObject;
			}

		}

		public bool RemoveItem(IScreenItem item)
		{
			var result = Layout.RemoveItem(item);
			CalculateRect();
			return result;
		}

		public override void Update(IScreen screen, GameClock gameTime)
		{
			base.Update(screen, gameTime);
			_clickTimer.Update(gameTime);
			Layout.Update(screen, gameTime);
			Layout.IsClicked = IsClicked;
		}

		public override void DrawBackground(IScreen screen, GameClock gameTime)
		{
			base.DrawBackground(screen, gameTime);

			Layout.DrawBackground(screen, gameTime);
		}

		public override void Draw(IScreen screen, GameClock gameTime)
		{
			Layout.Draw(screen, gameTime);
		}

		protected override void CalculateRect()
		{
			_rect = Layout.Rect;
		}

		/// <summary>
		/// Method for raising the Selected event.
		/// </summary>
		public void PlaySelectedSound(object obj, ClickEventArgs e)
		{
			//play the sound effect
			if (!IsQuiet && (null != ClickedSoundEffect))
			{
				ClickedSoundEffect.Play();
			}
		}

		public void PlayHighlightSound(object obj, HighlightEventArgs e)
		{
			if (!IsQuiet && (null != HighlightedSoundEffect))
			{
				//play menu noise
				HighlightedSoundEffect.Play();
			}
		}

		public virtual bool CheckClick(ClickEventArgs click)
		{
			//check if the widget was clicked
			if (Rect.Contains(click.Position) && Clickable)
			{
				Clicked(this, click);
				return true;
			}

			return false;
		}

		public virtual void Clicked(object obj, ClickEventArgs e)
		{
			if (OnClick != null)
			{
				OnClick(obj, e);
			}
		}

		/// <summary>
		/// Method for raising the Selected event.
		/// </summary>
		public virtual void OnLeftEntry()
		{
			if (OnLeft != null)
			{
				//play menu noise
				PlayHighlightSound(this, new HighlightEventArgs(null));

				OnLeft(this, new EventArgs());
			}
		}

		/// <summary>
		/// Method for raising the Selected event.
		/// </summary>
		public virtual void OnRightEntry()
		{
			if (OnRight != null)
			{
				//play menu noise
				PlayHighlightSound(this, new HighlightEventArgs(null));

				OnRight(this, new EventArgs());
			}
		}

		#endregion //Methods
	}
}


text:
package org.rythmengine.internal.generator;

import org.junit.Test;
import org.rythmengine.RythmEngine;
import org.rythmengine.TestBase;
import org.rythmengine.conf.RythmConfiguration;
import org.rythmengine.internal.compiler.CompiledTemplate;

import java.io.InputStream;

import static org.junit.Assert.assertEquals;

public class GeneratorJava7Test extends TestBase {
    @Test
    public void generatorTest1() {
        RythmConfiguration config = createRythmConfiguration();
        RythmEngine engine = new RythmEngine(config);

        InputStream is = loadTemplate("generator/generator1.html");
        String expected = loadFileRaw("generator/generator1.java.generated");
        CompiledTemplate result = engine.compile("generator/generator1.html", is);
        String actual = result.source();

        assertEquals(expected, actual);
    }

    @Test
    public void generatorTest2() {
        RythmConfiguration config = createRythmConfiguration();
        RythmEngine engine = new RythmEngine(config);

        InputStream is = loadTemplate("generator/generator2.html");
        String expected = loadFileRaw("generator/generator2.java.generated");
        CompiledTemplate result = engine.compile("generator/generator2.html", is);
        String actual = result.source();

        assertEquals(expected, actual);
    }

    @Test
    public void generatorTest3() {
        RythmConfiguration config = createRythmConfiguration();
        RythmEngine engine = new RythmEngine(config);

        InputStream is = loadTemplate("generator/generator3.html");
        String expected = loadFileRaw("generator/generator3.java.generated");
        CompiledTemplate result = engine.compile("generator/generator3.html", is);
        String actual = result.source();

        assertEquals(expected, actual);
    }

    @Test
    public void generatorTest4() {
        RythmConfiguration config = createRythmConfiguration();
        RythmEngine engine = new RythmEngine(config);

        InputStream is = loadTemplate("generator/generator4.html");
        String expected = loadFileRaw("generator/generator4.java.generated");
        CompiledTemplate result = engine.compile("generator/generator4.html", is);
        String actual = result.source();

        assertEquals(expected, actual);
    }

    @Test
    public void generatorTest5() {
        RythmConfiguration config = createRythmConfiguration();
        RythmEngine engine = new RythmEngine(config);

        InputStream is = loadTemplate("generator/generator5.html");
        String expected = loadFileRaw("generator/generator5.java.generated");
        CompiledTemplate result = engine.compile("generator/generator5.html", is);
        String actual = result.source();

        assertEquals(expected, actual);
    }

    @Test
    public void generatorTest6() {
        RythmConfiguration config = createRythmConfiguration();
        RythmEngine engine = new RythmEngine(config);

        InputStream is = loadTemplate("generator/generator6.html");
        String expected = loadFileRaw("generator/generator6.java.generated");
        CompiledTemplate result = engine.compile("generator/generator6.html", is);
        String actual = result.source();

        assertEquals(expected, actual);
    }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>Class DefaultJsonSerializerConfigurator
   </title>
    <meta name="viewport" content="width=device-width">
    <meta name="title" content="Class DefaultJsonSerializerConfigurator
   ">
    <meta name="generator" content="docfx 2.43.2.0">

    <link rel="shortcut icon" href="../favicon.ico">
    <link rel="stylesheet" href="../styles/docfx.vendor.css">
    <link rel="stylesheet" href="../styles/docfx.css">
    <link rel="stylesheet" href="../styles/main.css">
    <meta property="docfx:navrel" content="../toc.html">
    <meta property="docfx:tocrel" content="toc.html">

              <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
                Toggle navigation

              </button>

              <form class="navbar-form navbar-right" role="search" id="search">

                  <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">

              </form>

          Show / Hide Table of Contents

Class DefaultJsonSerializerConfigurator

A default JSON serializer configurator.

Inheritance

System.Object

Loggable

DefaultJsonSerializerConfigurator

Implements

ILoggable

IJsonSerializerConfigurator

Inherited Members

      Loggable.Logger

      Loggable.GetLogger()

      System.Object.Equals(System.Object)

      System.Object.Equals(System.Object, System.Object)

      System.Object.GetHashCode()

      System.Object.GetType()

      System.Object.MemberwiseClone()

      System.Object.ReferenceEquals(System.Object, System.Object)

      System.Object.ToString()

Namespace: Kephas.Serialization.ServiceStack.Text

Assembly: Kephas.Serialization.ServiceStack.Text.dll

Syntax

[OverridePriority(Priority.Low)]
public class DefaultJsonSerializerConfigurator : Loggable, ILoggable, IJsonSerializerConfigurator

Constructors

    |
    <a href="https://github.com/kephas-software/kephas/new/master/apiSpec/new?filename=Kephas_Serialization_ServiceStack_Text_DefaultJsonSerializerConfigurator__ctor_Kephas_Reflection_ITypeResolver_System_Collections_Generic_ICollection_Kephas_Composition_IExportFactory_Kephas_Serialization_ServiceStack_Text_ITypeJsonSerializer_Kephas_Serialization_ServiceStack_Text_Composition_TypeJsonSerializerMetadata___.md&value=---%0Auid%3A%20Kephas.Serialization.ServiceStack.Text.DefaultJsonSerializerConfigurator.%23ctor(Kephas.Reflection.ITypeResolver%2CSystem.Collections.Generic.ICollection%7BKephas.Composition.IExportFactory%7BKephas.Serialization.ServiceStack.Text.ITypeJsonSerializer%2CKephas.Serialization.ServiceStack.Text.Composition.TypeJsonSerializerMetadata%7D%7D)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc

    View Source

  <h4 id="Kephas_Serialization_ServiceStack_Text_DefaultJsonSerializerConfigurator__ctor_Kephas_Reflection_ITypeResolver_System_Collections_Generic_ICollection_Kephas_Composition_IExportFactory_Kephas_Serialization_ServiceStack_Text_ITypeJsonSerializer_Kephas_Serialization_ServiceStack_Text_Composition_TypeJsonSerializerMetadata___" data-uid="Kephas.Serialization.ServiceStack.Text.DefaultJsonSerializerConfigurator.#ctor(Kephas.Reflection.ITypeResolver,System.Collections.Generic.ICollection{Kephas.Composition.IExportFactory{Kephas.Serialization.ServiceStack.Text.ITypeJsonSerializer,Kephas.Serialization.ServiceStack.Text.Composition.TypeJsonSerializerMetadata}})">DefaultJsonSerializerConfigurator(ITypeResolver, ICollection<IExportFactory<ITypeJsonSerializer, TypeJsonSerializerMetadata>>)

Initializes a new instance of the DefaultJsonSerializerConfigurator class.

Declaration

public DefaultJsonSerializerConfigurator(ITypeResolver typeResolver, ICollection<IExportFactory<ITypeJsonSerializer, TypeJsonSerializerMetadata>> typeSerializerFactories = null)

Parameters

        Type
        Name
        Description

        ITypeResolver
        typeResolver

The type resolver.

        System.Collections.Generic.ICollection<IExportFactory<ITypeJsonSerializer, TypeJsonSerializerMetadata>>
        typeSerializerFactories

Optional. The type serializer factories.

Properties

    |
    Improve this Doc

    View Source

TypeAttr

Gets or sets the type attribute.

Declaration

public string TypeAttr { get; protected set; }

Property Value

        Type
        Description

        System.String

The type attribute.

    |
    Improve this Doc

    View Source

TypeResolver

Gets the type resolver.

Declaration

public ITypeResolver TypeResolver { get; }

Property Value

        Type
        Description

        ITypeResolver

The type resolver.

Methods

    |
    <a href="https://github.com/kephas-software/kephas/new/master/apiSpec/new?filename=Kephas_Serialization_ServiceStack_Text_DefaultJsonSerializerConfigurator_ConfigureJsonSerialization_System_Boolean_.md&value=---%0Auid%3A%20Kephas.Serialization.ServiceStack.Text.DefaultJsonSerializerConfigurator.ConfigureJsonSerialization(System.Boolean)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc

    View Source

ConfigureJsonSerialization(Boolean)

Configures the JSON serialization.

Declaration

public virtual bool ConfigureJsonSerialization(bool overwrite = false)

Parameters

        Type
        Name
        Description

        System.Boolean
        overwrite

True to overwrite the configuration, false to preserve it (optional).

Returns

        Type
        Description

        System.Boolean

True if the configuration was changed, false otherwise.

Implements

      ILoggable

      IJsonSerializerConfigurator

Extension Methods

      DynamicObjectExtensions.SetPropertyValue(Object, String, Object)

      DynamicObjectExtensions.TrySetPropertyValue(Object, String, Object)

      DynamicObjectExtensions.GetPropertyValue(Object, String)

      DynamicObjectExtensions.TryGetPropertyValue(Object, String, out Object)

      DynamicObjectExtensions.GetRuntimeTypeInfo(Object)

      DynamicObjectExtensions.ToDynamic(Object)

      DynamicObjectExtensions.ToExpando(Object)

      BehaviorValue.ToBehaviorValue<TValue>(TValue)

      CollectionExtensions.AddRange<T, TItem>(T, IEnumerable<TItem>)

      LoggingExtensions.GetLogger(Object, IContext)

      TypeExtensions.GetAbstractType(Object)

      TypeExtensions.GetAbstractTypeInfo(Object)

      ReflectionHelper.GetTypeInfo(Object)

      EntityEntryExtensions.TryGetAttachedEntityEntry(Object)

                    Improve this Doc

                    View Source

              Back to top

            Generated by DocFX


text:
require 'generators/chaplin/helpers'

module Chaplin
  module Generators
    class InstallGenerator < Rails::Generators::Base
      include Chaplin::Generators::Helpers

      source_root File.expand_path("../templates", __FILE__)

      desc "Generates a Chaplin.js skeleton directory structure and manifest"

      # TODO currently only coffee works
      #class_option :javascript,
                    #type: :boolean,
                    #aliases: "-j",
                    #default: false,
                    #desc: "Generate JavaScript"

      def copy_app_boilerplate
        # it should remove empty directories during 'destroy' command
        %w(controllers lib models views).each do |dir_name|
          empty_directory File.join(javascript_path, dir_name)
        end

        # copy all /javascripts directory
        directory 'javascripts', javascript_path

        # create empty 'assets/templates' directory
        empty_directory template_path
      end

      def generate_app_files
        template "application.js.coffee", "#{javascript_path}/application.js.coffee"
        template "app_template.js.coffee", "#{javascript_path}/#{app_filename}.js.coffee"
      end

      def apply_requirejs
        # copy config file
        copy_file 'requirejs.yml', 'config/requirejs.yml'

        # check if we can find layout file
        # TODO doesn't work during 'destroy' command
        if layout_path
          # inject requirejs tag
          unless gsub_file(layout_path, /javascript_include_tag/, 'requirejs_include_tag')
            display "Can't find a javascript_include_tag in '#{layout_path}'!"
            display "You must add 'requirejs_include_tag' instead of 'javascript_include_tag'"
            display "in your layout(s)."
          end
        else
          display "Can't find a layout to inject requirejs tag!"
          display "You must add 'requirejs_include_tag' instead of 'javascript_include_tag'"
          display "in your layout(s)."
        end
      end

      def post_install_messages
        if File.exists?("#{javascript_path}/application.js")
          display "You have 'application.js' file in your 'assets/' folder."
          display "You should migrate all dependencies to the 'requirejs.yml' config file"
          display "and remove 'application.js file."
        end
      end

    end
  end
end


text:
package net.kebernet.configuration.client.service;

import net.kebernet.configuration.client.model.Device;

import java.util.List;

/**
 * Created by rcooper on 7/3/17.
 */
public interface DiscoveryService {

    /**
     * Adds a callback that will be notified whenever new devices are discovered.
     * This will always occur asyncronously.
     * @param callback Callback to receive notifications.
     */
    void listenForDevices(DeviceListCallback callback);

    /**
     * Lists the currently discovered devices.
     * This will always happen asyncronously.
     * @param callback Callback for current known devices
     */
    void listKnownDevices(DeviceListCallback callback);

    /**
     * Sets an error callback. This will provide messages that can be presented to the user
     * when an error occurs inside the DiscoveryService service.
     * @param callback ErrorCallback
     */
    void setErrorCallback(ErrorCallback callback);

    /**
     * Refreshes/rediscovers devices. This will need to be called at startup.
     */
    void refresh();

    /**
     * A callback for device lists.
     */
    interface DeviceListCallback {
        /**
         * If this callback is being used as a listener
         * the return value will indicate if the listener should continue listening.
         * @param devices A list of recently discovered devices.
         * @return "true" if the listener should continue to listen for more discoveries, or
         *  "false" if it is completed.
         */
        boolean onDevices(List<Device> devices);
    }

    /**
     * A callback that can be used to present the user with error messages about the
     * internal state of the DiscoveryService services
     */
    interface ErrorCallback{
        /**
         * @param message Message to present to user
         */
        void onError(String message);
    }
}


text:
..
  SPDX-License-Identifier: CC-BY-4.0
  Copyright Contributors to the OpenColorIO Project.
  Do not edit! This file was automatically generated by share/docs/frozendoc.py.

.. py:class:: PlanarImageDesc
   :module: PyOpenColorIO

   All the constructors expect pointers to the specified image planes (i.e. rrrr gggg bbbb) starting at the first color channel of the first pixel to process (which need not be the first pixel of the image). Pass NULL for aData if no alpha exists (r/g/bData must not be NULL).

   .. note::
      The methods assume the :ref:`CPUProcessor` bit-depth type for the R/G/B/A data pointers.

   .. py:method:: PlanarImageDesc.__init__(*args, **kwargs)
      :module: PyOpenColorIO

      Overloaded function.

      1. __init__(self: PyOpenColorIO.PlanarImageDesc, rData: buffer, gData: buffer, bData: buffer, width: int, height: int) -> None

      2. __init__(self: PyOpenColorIO.PlanarImageDesc, rData: buffer, gData: buffer, bData: buffer, aData: buffer, width: int, height: int) -> None

      Note that although :ref:`PlanarImageDesc` is powerful enough to also describe all :ref:`PackedImageDesc` scenarios, it is recommended to use a :ref:`PackedImageDesc` where possible since that allows for additional optimizations.

      3. __init__(self: PyOpenColorIO.PlanarImageDesc, rData: buffer, gData: buffer, bData: buffer, width: int, height: int, bitDepth: PyOpenColorIO.BitDepth, xStrideBytes: int, yStrideBytes: int) -> None

      4. __init__(self: PyOpenColorIO.PlanarImageDesc, rData: buffer, gData: buffer, bData: buffer, aData: buffer, width: int, height: int, bitDepth: PyOpenColorIO.BitDepth, xStrideBytes: int, yStrideBytes: int) -> None

   .. py:method:: PlanarImageDesc.getAData(self: PyOpenColorIO.PlanarImageDesc) -> numpy.ndarray
      :module: PyOpenColorIO

      Get a pointer to the alpha channel of the first pixel or null as alpha channel is optional.

   .. py:method:: PlanarImageDesc.getBData(self: PyOpenColorIO.PlanarImageDesc) -> numpy.ndarray
      :module: PyOpenColorIO

      Get a pointer to the blue channel of the first pixel.

   .. py:method:: PlanarImageDesc.getBitDepth(self: PyOpenColorIO.ImageDesc) -> PyOpenColorIO.BitDepth
      :module: PyOpenColorIO

      Get the bit-depth.

   .. py:method:: PlanarImageDesc.getGData(self: PyOpenColorIO.PlanarImageDesc) -> numpy.ndarray
      :module: PyOpenColorIO

      Get a pointer to the green channel of the first pixel.

   .. py:method:: PlanarImageDesc.getHeight(self: PyOpenColorIO.ImageDesc) -> int
      :module: PyOpenColorIO

      Get the height to process (where y position starts at 0 and ends at height-1).

   .. py:method:: PlanarImageDesc.getRData(self: PyOpenColorIO.PlanarImageDesc) -> numpy.ndarray
      :module: PyOpenColorIO

      Get a pointer to the red channel of the first pixel.

   .. py:method:: PlanarImageDesc.getWidth(self: PyOpenColorIO.ImageDesc) -> int
      :module: PyOpenColorIO

      Get the width to process (where x position starts at 0 and ends at width-1).

   .. py:method:: PlanarImageDesc.getXStrideBytes(self: PyOpenColorIO.ImageDesc) -> int
      :module: PyOpenColorIO

      Get the step in bytes to find the same color channel of the next pixel.

   .. py:method:: PlanarImageDesc.getYStrideBytes(self: PyOpenColorIO.ImageDesc) -> int
      :module: PyOpenColorIO

      Get the step in bytes to find the same color channel of the pixel at the same position in the next line.

   .. py:method:: PlanarImageDesc.isFloat(self: PyOpenColorIO.ImageDesc) -> bool
      :module: PyOpenColorIO

      Is the image buffer 32-bit float?

   .. py:method:: PlanarImageDesc.isRGBAPacked(self: PyOpenColorIO.ImageDesc) -> bool
      :module: PyOpenColorIO

      Is the image buffer in packed mode with the 4 color channels? ("Packed" here means that XStrideBytes is 4x the bytes per channel, so it is more specific than simply any :ref:`PackedImageDesc`.)


text:
function s = styles( this )

s={};
for i=1:this.actxWord.ActiveDocument.Styles.Count
    s{end+1} = this.actxWord.ActiveDocument.Styles.Item(i).NameLocal;
end


text:
/*
 * EVE Swagger Interface
 * An OpenAPI for EVE Online
 *
 * The version of the OpenAPI document: 1.12
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

package net.troja.eve.esi.model;

import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.io.Serializable;

/**
 * jump_clone object
 */
@ApiModel(description = "jump_clone object")
public class Clone implements Serializable {
    private static final long serialVersionUID = 1L;

    public static final String SERIALIZED_NAME_IMPLANTS = "implants";
    @SerializedName(SERIALIZED_NAME_IMPLANTS)
    private List<Integer> implants = new ArrayList<>();

    public static final String SERIALIZED_NAME_JUMP_CLONE_ID = "jump_clone_id";
    @SerializedName(SERIALIZED_NAME_JUMP_CLONE_ID)
    private Integer jumpCloneId;

    public static final String SERIALIZED_NAME_LOCATION_ID = "location_id";
    @SerializedName(SERIALIZED_NAME_LOCATION_ID)
    private Long locationId;

    /**
     * location_type string
     */
    @JsonAdapter(LocationTypeEnum.Adapter.class)
    public enum LocationTypeEnum {
        STATION("station"),

        STRUCTURE("structure");

        private String value;

        LocationTypeEnum(String value) {
            this.value = value;
        }

        public String getValue() {
            return value;
        }

        @Override
        public String toString() {
            return String.valueOf(value);
        }

        public static LocationTypeEnum fromValue(String value) {
            for (LocationTypeEnum b : LocationTypeEnum.values()) {
                if (b.value.equals(value)) {
                    return b;
                }
            }
            return null;
        }

        public static class Adapter extends TypeAdapter<LocationTypeEnum> {
            @Override
            public void write(final JsonWriter jsonWriter, final LocationTypeEnum enumeration) throws IOException {
                jsonWriter.value(enumeration.getValue());
            }

            @Override
            public LocationTypeEnum read(final JsonReader jsonReader) throws IOException {
                String value = jsonReader.nextString();
                return LocationTypeEnum.fromValue(value);
            }
        }
    }

    public static final String SERIALIZED_NAME_LOCATION_TYPE = "location_type";
    @SerializedName(SERIALIZED_NAME_LOCATION_TYPE)
    private String locationType;
    private LocationTypeEnum locationTypeEnum;

    public static final String SERIALIZED_NAME_NAME = "name";
    @SerializedName(SERIALIZED_NAME_NAME)
    private String name;

    public Clone implants(List<Integer> implants) {

        this.implants = implants;
        return this;
    }

    public Clone addImplantsItem(Integer implantsItem) {
        this.implants.add(implantsItem);
        return this;
    }

    /**
     * implants array
     *
     * @return implants
     **/
    @ApiModelProperty(required = true, value = "implants array")
    public List<Integer> getImplants() {
        return implants;
    }

    public void setImplants(List<Integer> implants) {
        this.implants = implants;
    }

    public Clone jumpCloneId(Integer jumpCloneId) {

        this.jumpCloneId = jumpCloneId;
        return this;
    }

    /**
     * jump_clone_id integer
     *
     * @return jumpCloneId
     **/
    @ApiModelProperty(required = true, value = "jump_clone_id integer")
    public Integer getJumpCloneId() {
        return jumpCloneId;
    }

    public void setJumpCloneId(Integer jumpCloneId) {
        this.jumpCloneId = jumpCloneId;
    }

    public Clone locationId(Long locationId) {

        this.locationId = locationId;
        return this;
    }

    /**
     * location_id integer
     *
     * @return locationId
     **/
    @ApiModelProperty(required = true, value = "location_id integer")
    public Long getLocationId() {
        return locationId;
    }

    public void setLocationId(Long locationId) {
        this.locationId = locationId;
    }

    public Clone locationType(LocationTypeEnum locationTypeEnum) {

        this.locationTypeEnum = locationTypeEnum;
        return this;
    }

    public Clone locationTypeString(String locationType) {

        this.locationType = locationType;
        return this;
    }

    /**
     * location_type string
     *
     * @return locationType
     **/
    @ApiModelProperty(required = true, value = "location_type string")
    public LocationTypeEnum getLocationType() {
        if (locationTypeEnum == null) {
            locationTypeEnum = LocationTypeEnum.fromValue(locationType);
        }
        return locationTypeEnum;
    }

    public String getLocationTypeString() {
        return locationType;
    }

    public void setLocationType(LocationTypeEnum locationTypeEnum) {
        this.locationTypeEnum = locationTypeEnum;
    }

    public void setLocationTypeString(String locationType) {
        this.locationType = locationType;
    }

    public Clone name(String name) {

        this.name = name;
        return this;
    }

    /**
     * name string
     *
     * @return name
     **/
    @javax.annotation.Nullable
    @ApiModelProperty(value = "name string")
    public String getName() {
        return name;
    }

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

    @Override
    public boolean equals(java.lang.Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        Clone clone = (Clone) o;
        return Objects.equals(this.implants, clone.implants) && Objects.equals(this.jumpCloneId, clone.jumpCloneId)
                && Objects.equals(this.locationId, clone.locationId)
                && Objects.equals(this.locationType, clone.locationType) && Objects.equals(this.name, clone.name);
    }

    @Override
    public int hashCode() {
        return Objects.hash(implants, jumpCloneId, locationId, locationType, name);
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("class Clone {\n");
        sb.append("    implants: ").append(toIndentedString(implants)).append("\n");
        sb.append("    jumpCloneId: ").append(toIndentedString(jumpCloneId)).append("\n");
        sb.append("    locationId: ").append(toIndentedString(locationId)).append("\n");
        sb.append("    locationType: ").append(toIndentedString(locationType)).append("\n");
        sb.append("    name: ").append(toIndentedString(name)).append("\n");
        sb.append("}");
        return sb.toString();
    }

    /**
     * Convert the given object to string with each line indented by 4 spaces
     * (except the first line).
     */
    private String toIndentedString(java.lang.Object o) {
        if (o == null) {
            return "null";
        }
        return o.toString().replace("\n", "\n    ");
    }

}


text:
Practical Work Proposal

					<a href="<?php echo base_url(); ?>">Home

					Practical Work

					<a href="<?php echo site_url('practice/proposal'); ?>">Proposal

					 Add Proposal

								Form Add Proposal

							<form action="<?php echo site_url('practice/proposal/savedata'); ?>" class="form-horizontal" method="post" enctype="multipart/form-data">
							<input type="hidden" name="<?php echo $this->security->get_csrf_token_name(); ?>" value="<?php echo $this->security->get_csrf_hash(); ?>">

School Detail

										School Name

										<select class="select2_category form-control" data-placeholder="Choose School Name" name="lstSchool" id="lstSchool" onchange="mySchool()" required autofocus>
											<option value="">- Choose School Name -</option>
											<?php
											foreach($schoollist as $s) {
											?>
											<option value="<?php echo $s->school_id; ?>" <?php echo set_select('lstSchool', $s->school_id); ?> data-address="<? echo $s->school_address; ?>"><?php echo $s->school_name; ?></option>
											<?php
											}
											?>
										</select>
										<?php echo form_error('lstSchool', '',''); ?>

										School Address

											<input type="text" class="form-control" placeholder="Address" name="address" id="address" value="<?php echo set_value('address'); ?>" autocomplete="off" readonly>

Proposal Detail

										Title

											<input type="text" class="form-control" placeholder="Enter Title" name="title" value="<?php echo set_value('title'); ?>" autocomplete="off" required autofocus />
											<?php echo form_error('title', '',''); ?>

										Date

											<input class="form-control form-control-inline input-medium date-picker" size="16" type="text" name="date_mail" value="<?php echo set_value('date_mail'); ?>" placeholder="DD-MM-YYYY" autocomplete="off" required />
											<?php echo form_error('date_mail', '',''); ?>

										Month

											<input type="text" class="form-control" placeholder="January 2016, February 2017, etc" name="month" value="<?php echo set_value('month'); ?>" autocomplete="off" required />
											<?php echo form_error('month', '',''); ?>

										Description

											<textarea class="form-control ckeditor" name="desc" rows="6"><?php echo set_value('desc'); ?></textarea>

										<?php echo form_error('desc', '',''); ?>

Scan File

										File

							                    <img src="<?php echo base_url(); ?>img/no_image.gif" alt="" />

								                 Browse
								                 Ganti
								                <input type="file" class="default" name="userfile" />

											<button type="submit" class="btn btn-primary"> Save</button>
											<a href="<?php echo site_url('practice/proposal'); ?>" class="btn btn-default"> Cancel

							</form>


text:
package s_mach.validate.play_json

import play.api.data.validation.ValidationError
import play.api.libs.json._
import s_mach.validate.{Rule, Validator}

object PlayJsonUtils {
  def listRuleToJsError(rules: List[Rule]) : Option[JsError] = {
    def pathToJsPath(path: String) : PathNode = {
      path match {
        case s if (s.size == 1 && s.head.isDigit) =>
          IdxPathNode(s.toInt)
        case _ => KeyPathNode(path)
      }
    }

    if(rules.isEmpty) {
      None
    } else {
      val errors =
        rules.groupBy(_.path).map { case (path,rules) =>
          val jsPath = JsPath(path.map(pathToJsPath))
          val errors = rules.map(r => ValidationError(r.desc))
          (jsPath,errors)
        }.toSeq
      Some(JsError(errors))
    }
  }

  def wrapReadsWithValidator[A](
    f: JsValue => JsResult[A],
    v:Validator[A]
  ) : JsValue => JsResult[A] = { json =>
    f(json).flatMap { a =>
      v(a).toOptJsError match {
        case None => JsSuccess(a)
        case Some(error) => error
      }
    }
  }

}


text:
<?php

namespace Illuminate\View\Compilers\Concerns;

trait CompilesRawPhp
{
    /**
     * Compile the raw PHP statements into valid PHP.
     *
     * @param  string  $expression
     * @return string
     */
    protected function compilePhp($expression)
    {
        return $expression ? "<?php {$expression}; ?>" : '<?php ';
    }

    /**
     * Compile end-php statement into valid PHP.
     *
     * @param  string  $expression
     * @return string
     */
    protected function compileEndphp($expression)
    {
        return ' ?>';
    }

    /**
     * Compile the unset statements into valid PHP.
     *
     * @param  string  $expression
     * @return string
     */
    protected function compileUnset($expression)
    {
        return "<?php unset{$expression}; ?>";
    }
}


text:
#include <xslt_stylesheet.h>

#include <libxslt/xsltInternals.h>
#include <libxslt/xsltutils.h>
#include <libxslt/transform.h>
#include <libexslt/exslt.h>

VALUE xslt;

int vasprintf (char **strp, const char *fmt, va_list ap);
void vasprintf_free (void *p);

static void mark(nokogiriXsltStylesheetTuple *wrapper)
{
  rb_gc_mark(wrapper->func_instances);
}

static void dealloc(nokogiriXsltStylesheetTuple *wrapper)
{
    xsltStylesheetPtr doc = wrapper->ss;

    NOKOGIRI_DEBUG_START(doc);
    xsltFreeStylesheet(doc); /* commented out for now. */
    NOKOGIRI_DEBUG_END(doc);

    free(wrapper);
}

static void xslt_generic_error_handler(void * ctx, const char *msg, ...)
{
  char * message;

  va_list args;
  va_start(args, msg);
  vasprintf(&message, msg, args);
  va_end(args);

  rb_str_cat2((VALUE)ctx, message);

  vasprintf_free(message);
}

VALUE Nokogiri_wrap_xslt_stylesheet(xsltStylesheetPtr ss)
{
  VALUE self;
  nokogiriXsltStylesheetTuple *wrapper;

  self = Data_Make_Struct(cNokogiriXsltStylesheet, nokogiriXsltStylesheetTuple,
                          mark, dealloc, wrapper);

  ss->_private = (void *)self;
  wrapper->ss = ss;
  wrapper->func_instances = rb_ary_new();

  return self;
}

/*
 * call-seq:
 *   parse_stylesheet_doc(document)
 *
 * Parse a stylesheet from +document+.
 */
static VALUE parse_stylesheet_doc(VALUE klass, VALUE xmldocobj)
{
    xmlDocPtr xml, xml_cpy;
    VALUE errstr, exception;
    xsltStylesheetPtr ss ;
    Data_Get_Struct(xmldocobj, xmlDoc, xml);
    exsltRegisterAll();

    errstr = rb_str_new(0, 0);
    xsltSetGenericErrorFunc((void *)errstr, xslt_generic_error_handler);

    xml_cpy = xmlCopyDoc(xml, 1); /* 1 => recursive */
    ss = xsltParseStylesheetDoc(xml_cpy);

    xsltSetGenericErrorFunc(NULL, NULL);

    if (!ss) {
	xmlFreeDoc(xml_cpy);
	exception = rb_exc_new3(rb_eRuntimeError, errstr);
	rb_exc_raise(exception);
    }

    return Nokogiri_wrap_xslt_stylesheet(ss);
}

/*
 * call-seq:
 *   serialize(document)
 *
 * Serialize +document+ to an xml string.
 */
static VALUE serialize(VALUE self, VALUE xmlobj)
{
    xmlDocPtr xml ;
    nokogiriXsltStylesheetTuple *wrapper;
    xmlChar* doc_ptr ;
    int doc_len ;
    VALUE rval ;

    Data_Get_Struct(xmlobj, xmlDoc, xml);
    Data_Get_Struct(self, nokogiriXsltStylesheetTuple, wrapper);
    xsltSaveResultToString(&doc_ptr, &doc_len, xml, wrapper->ss);
    rval = NOKOGIRI_STR_NEW(doc_ptr, doc_len);
    xmlFree(doc_ptr);
    return rval ;
}

static void swallow_superfluous_xml_errors(void * userdata, xmlErrorPtr error, ...)
{
}

/*
 *  call-seq:
 *    transform(document, params = [])
 *
 *  Apply an XSLT stylesheet to an XML::Document.
 *  +params+ is an array of strings used as XSLT parameters.
 *  returns Nokogiri::XML::Document
 *
 *  Example:
 *
 *    doc   = Nokogiri::XML(File.read(ARGV[0]))
 *    xslt  = Nokogiri::XSLT(File.read(ARGV[1]))
 *    puts xslt.transform(doc, ['key', 'value'])
 *
 */
static VALUE transform(int argc, VALUE* argv, VALUE self)
{
    VALUE xmldoc, paramobj, errstr, exception ;
    xmlDocPtr xml ;
    xmlDocPtr result ;
    nokogiriXsltStylesheetTuple *wrapper;
    const char** params ;
    long param_len, j ;
    int parse_error_occurred ;

    rb_scan_args(argc, argv, "11", &xmldoc, &paramobj);
    if (NIL_P(paramobj)) { paramobj = rb_ary_new2(0L) ; }
    if (!rb_obj_is_kind_of(xmldoc, cNokogiriXmlDocument))
      rb_raise(rb_eArgError, "argument must be a Nokogiri::XML::Document");

    /* handle hashes as arguments. */
    if(T_HASH == TYPE(paramobj)) {
      paramobj = rb_funcall(paramobj, rb_intern("to_a"), 0);
      paramobj = rb_funcall(paramobj, rb_intern("flatten"), 0);
    }

    Check_Type(paramobj, T_ARRAY);

    Data_Get_Struct(xmldoc, xmlDoc, xml);
    Data_Get_Struct(self, nokogiriXsltStylesheetTuple, wrapper);

    param_len = RARRAY_LEN(paramobj);
    params = calloc((size_t)param_len+1, sizeof(char*));
    for (j = 0 ; j < param_len ; j++) {
      VALUE entry = rb_ary_entry(paramobj, j);
      const char * ptr = StringValueCStr(entry);
      params[j] = ptr;
    }
    params[param_len] = 0 ;

    errstr = rb_str_new(0, 0);
    xsltSetGenericErrorFunc((void *)errstr, xslt_generic_error_handler);
    xmlSetGenericErrorFunc(NULL, (xmlGenericErrorFunc)&swallow_superfluous_xml_errors);

    result = xsltApplyStylesheet(wrapper->ss, xml, params);
    free(params);

    xsltSetGenericErrorFunc(NULL, NULL);
    xmlSetGenericErrorFunc(NULL, NULL);

    parse_error_occurred = (Qfalse == rb_funcall(errstr, rb_intern("empty?"), 0));

    if (parse_error_occurred) {
      exception = rb_exc_new3(rb_eRuntimeError, errstr);
      rb_exc_raise(exception);
    }

    return Nokogiri_wrap_xml_document((VALUE)0, result) ;
}

static void method_caller(xmlXPathParserContextPtr ctxt, int nargs)
{
    VALUE handler;
    const char *function_name;
    xsltTransformContextPtr transform;
    const xmlChar *functionURI;

    transform = xsltXPathGetTransformContext(ctxt);
    functionURI = ctxt->context->functionURI;
    handler = (VALUE)xsltGetExtData(transform, functionURI);
    function_name = (const char*)(ctxt->context->function);

    Nokogiri_marshal_xpath_funcall_and_return_values(ctxt, nargs, handler, (const char*)function_name);
}

static void * initFunc(xsltTransformContextPtr ctxt, const xmlChar *uri)
{
    VALUE modules = rb_iv_get(xslt, "@modules");
    VALUE obj = rb_hash_aref(modules, rb_str_new2((const char *)uri));
    VALUE args = { Qfalse };
    VALUE methods = rb_funcall(obj, rb_intern("instance_methods"), 1, args);
    VALUE inst;
    nokogiriXsltStylesheetTuple *wrapper;
    int i;

    for(i = 0; i < RARRAY_LEN(methods); i++) {
	VALUE method_name = rb_obj_as_string(rb_ary_entry(methods, i));
	xsltRegisterExtFunction(ctxt,
          (unsigned char *)StringValueCStr(method_name), uri, method_caller);
    }

    Data_Get_Struct((VALUE)ctxt->style->_private, nokogiriXsltStylesheetTuple,
                    wrapper);
    inst = rb_class_new_instance(0, NULL, obj);
    rb_ary_push(wrapper->func_instances, inst);

    return (void *)inst;
}

static void shutdownFunc(xsltTransformContextPtr ctxt,
	const xmlChar *uri, void *data)
{
    nokogiriXsltStylesheetTuple *wrapper;

    Data_Get_Struct((VALUE)ctxt->style->_private, nokogiriXsltStylesheetTuple,
                    wrapper);

    rb_ary_clear(wrapper->func_instances);
}

/*
 *  call-seq:
 *    register(uri, custom_handler_class)
 *
 *  Register a class that implements custom XSLT transformation functions.
 */
static VALUE registr(VALUE self, VALUE uri, VALUE obj)
{
    VALUE modules = rb_iv_get(self, "@modules");
    if(NIL_P(modules)) rb_raise(rb_eRuntimeError, "wtf! @modules isn't set");

    rb_hash_aset(modules, uri, obj);
    xsltRegisterExtModule((unsigned char *)StringValueCStr(uri), initFunc, shutdownFunc);
    return self;
}

VALUE cNokogiriXsltStylesheet ;
void init_xslt_stylesheet()
{
  VALUE nokogiri;
  VALUE klass;

  nokogiri = rb_define_module("Nokogiri");
  xslt = rb_define_module_under(nokogiri, "XSLT");
  klass = rb_define_class_under(xslt, "Stylesheet", rb_cObject);

  rb_iv_set(xslt, "@modules", rb_hash_new());

  cNokogiriXsltStylesheet = klass;

  rb_define_singleton_method(klass, "parse_stylesheet_doc", parse_stylesheet_doc, 1);
  rb_define_singleton_method(xslt, "register", registr, 2);
  rb_define_method(klass, "serialize", serialize, 1);
  rb_define_method(klass, "transform", transform, -1);
}


text:
package org.java_websocket.server;

import java.nio.channels.SelectionKey;
import java.nio.channels.SocketChannel;
import java.util.List;

import org.java_websocket.WebSocketAdapter;
import org.java_websocket.WebSocketImpl;
import org.java_websocket.drafts.Draft;
import org.java_websocket.WebSocketServerFactory;

public class DefaultWebSocketServerFactory implements WebSocketServerFactory {
	@Override
	public WebSocketImpl createWebSocket( WebSocketAdapter a, Draft d) {
		return new WebSocketImpl( a, d );
	}
	@Override
	public WebSocketImpl createWebSocket( WebSocketAdapter a, List<Draft> d) {
		return new WebSocketImpl( a, d );
	}
	@Override
	public SocketChannel wrapChannel( SocketChannel channel, SelectionKey key ) {
		return channel;
	}
	@Override
	public void close() {
	}
}