text:
const vrpn_uint32 vrpn_FUNCTION_CHANNELS_MAX = vrpn_CHANNEL_MAX;

extern const char* vrpn_FUNCTION_MESSAGE_TYPE_CHANNEL;
extern const char* vrpn_FUNCTION_MESSAGE_TYPE_CHANNEL_REQUEST;
extern const char* vrpn_FUNCTION_MESSAGE_TYPE_ALL_CHANNEL_REQUEST;
extern const char* vrpn_FUNCTION_MESSAGE_TYPE_SAMPLE_RATE;
extern const char* vrpn_FUNCTION_MESSAGE_TYPE_START;
extern const char* vrpn_FUNCTION_MESSAGE_TYPE_STOP;
extern const char* vrpn_FUNCTION_MESSAGE_TYPE_CHANNEL_REPLY;
extern const char* vrpn_FUNCTION_MESSAGE_TYPE_START_REPLY;
extern const char* vrpn_FUNCTION_MESSAGE_TYPE_STOP_REPLY;
extern const char* vrpn_FUNCTION_MESSAGE_TYPE_SAMPLE_RATE_REPLY;
extern const char* vrpn_FUNCTION_MESSAGE_TYPE_INTERPRETER_REQUEST;
extern const char* vrpn_FUNCTION_MESSAGE_TYPE_INTERPRETER_REPLY;
extern const char* vrpn_FUNCTION_MESSAGE_TYPE_ERROR;

class VRPN_API vrpn_FunctionGenerator_channel;

// a base class for all functions that vrpn_FunctionGenerator
// can generate
class VRPN_API vrpn_FunctionGenerator_function
{
public:
	virtual ~vrpn_FunctionGenerator_function() = 0;

	// concrete classes should implement this to generate the appropriate
	// values for the function the class represents.  nValue samples should be
	// generated beginning at time startTime, and these samples should be placed
	// in the provided buffer.  several data members of 'channel' can modify the
	// times for which values are generated.
	// returns the time of the last sample generated.
	virtual vrpn_float32 generateValues( vrpn_float32* buf, vrpn_uint32 nValues,
										 vrpn_float32 startTime, vrpn_float32 sampleRate,
										 vrpn_FunctionGenerator_channel* channel ) const = 0;

	// concrete classes should implement this to encode their
	// function information into the specified buffer 'buf'.  The
	// remaining length in the buffer is stored in 'len'.  At return,
	// 'len' should be set to the number of characters remaining in the
	// buffer and the number of characters written should be returned,
	// save in case of failure, when negative should be returned.
	virtual vrpn_int32 encode_to( char** buf, vrpn_int32& len ) const = 0;

	// concrete classes should implement this to decode their
	// function information from the specified buffer.  The remaining
	// length in the buffer is stored in 'len'.  At return, 'len' should
	// be set to the number of characters remaining in the the buffer
	// and the number of characters read should be returned, save in case
	// of failure, when negative should be returned
	virtual vrpn_int32 decode_from( const char** buf, vrpn_int32& len ) = 0;

	virtual vrpn_FunctionGenerator_function* clone( ) const = 0;

	// used when encoding/decoding to specify function type
	enum FunctionCode
	{
		FUNCTION_NULL = 0,
		FUNCTION_SCRIPT = 1
	};

	// concrete classes should implement this to return the
	// appropriate FunctionCode, from above
	virtual FunctionCode getFunctionCode( ) const = 0;

};

// the NULL function:  generate all zeros
class VRPN_API vrpn_FunctionGenerator_function_NULL
: public virtual vrpn_FunctionGenerator_function
{
public:
	vrpn_FunctionGenerator_function_NULL( ) { }
	virtual ~vrpn_FunctionGenerator_function_NULL( ) { }

	vrpn_float32 generateValues( vrpn_float32* buf, vrpn_uint32 nValues,
								vrpn_float32 startTime, vrpn_float32 sampleRate,
								vrpn_FunctionGenerator_channel* channel ) const;

	vrpn_int32 encode_to( char** buf, vrpn_int32& len ) const;
	vrpn_int32 decode_from( const char** buf, vrpn_int32& len );
	vrpn_FunctionGenerator_function* clone( ) const;
protected:
	FunctionCode getFunctionCode( ) const {  return FUNCTION_NULL;  }

};

class VRPN_API vrpn_FunctionGenerator_function_script
: public virtual vrpn_FunctionGenerator_function
{
public:
	vrpn_FunctionGenerator_function_script( );
	vrpn_FunctionGenerator_function_script( const char* script );
	vrpn_FunctionGenerator_function_script( const vrpn_FunctionGenerator_function_script& );
	virtual ~vrpn_FunctionGenerator_function_script();

	virtual vrpn_float32 generateValues( vrpn_float32* buf, vrpn_uint32 nValues,
								vrpn_float32 startTime, vrpn_float32 sampleRate,
								vrpn_FunctionGenerator_channel* channel ) const;

	vrpn_int32 encode_to( char** buf, vrpn_int32& len ) const;
	vrpn_int32 decode_from( const char** buf, vrpn_int32& len );
	vrpn_FunctionGenerator_function* clone( ) const;

	// returns a copy of the script.  caller is responsible for
	// calling 'delete []' to free the returned string.
	char* getScript( ) const;

	const char* getConstScript( ) const
	{ return script; }

	vrpn_bool setScript( char* script );

protected:
	FunctionCode getFunctionCode( ) const {  return FUNCTION_SCRIPT;  }
	char* script;

};

class VRPN_API vrpn_FunctionGenerator_channel
{
	// note:  the channel will delete its function when the function is
	// no longer needed (e.g., when the channel is destroyed or the function changed)
public:
	vrpn_FunctionGenerator_channel( );
	vrpn_FunctionGenerator_channel( vrpn_FunctionGenerator_function* function );
	virtual ~vrpn_FunctionGenerator_channel( );

	const vrpn_FunctionGenerator_function* getFunction( ) const { return function; }
	void setFunction( vrpn_FunctionGenerator_function* function );

	// these return zero on success and negative on some failure.
	vrpn_int32 encode_to( char** buf, vrpn_int32& len ) const;
	vrpn_int32 decode_from( const char** buf, vrpn_int32& len );

protected:
	vrpn_FunctionGenerator_function* function;

};

class VRPN_API vrpn_FunctionGenerator : public vrpn_BaseClass
{
public:
	vrpn_FunctionGenerator( const char* name, vrpn_Connection* c = NULL );
	virtual ~vrpn_FunctionGenerator( );

	// returns the requested channel, or null if channelNum is
	// greater than the maximum number of channels.
	const vrpn_FunctionGenerator_channel* const getChannel( vrpn_uint32 channelNum );

	vrpn_uint32 getNumChannels( ) const { return numChannels; }

	vrpn_float32 getSampleRate( )
	{  return sampleRate;  }

	enum FGError
	{
		NO_FG_ERROR = 0,
		INTERPRETER_ERROR = 1, // the interpreter (for script) had some problem
		TAKING_TOO_LONG = 2, // samples were not generated quickly enough
		INVALID_RESULT_QUANTITY = 3, // an incorrect number of values was generated
		INVALID_RESULT_RANGE = 4 // generated values were out of range
	};

protected:
	vrpn_float32 sampleRate;  // samples per second
	vrpn_uint32 numChannels;
	vrpn_FunctionGenerator_channel* channels[vrpn_FUNCTION_CHANNELS_MAX];

	vrpn_int32 channelMessageID;             // id for channel message (remote -> server)
	vrpn_int32 requestChannelMessageID;	     // id for messages requesting channel info be sent (remote -> server)
	vrpn_int32 requestAllChannelsMessageID;  // id for messages requesting channel info of all channels be sent (remote -> server)
	vrpn_int32 sampleRateMessageID;		     // id for message to request a sampling rate (remote -> server)
	vrpn_int32 startFunctionMessageID;       // id for message to start generating the function (remote -> server)
	vrpn_int32 stopFunctionMessageID;        // id for message to stop generating the function (remote -> server)
	vrpn_int32 requestInterpreterMessageID;  // id for message to request interpreter description (remote -> server)

	vrpn_int32 channelReplyMessageID;        // id for reply for channel message (server -> remote)
	vrpn_int32 startFunctionReplyMessageID;  // id for reply to start-function message (server -> remote)
	vrpn_int32 stopFunctionReplyMessageID;   // id for reply to stop-function message (server -> remote)
	vrpn_int32 sampleRateReplyMessageID;     // id for reply to request-sample-rate message (server -> remote)
	vrpn_int32 interpreterReplyMessageID;    // id for reply to request-interpreter message (server -> remote)
	vrpn_int32 errorMessageID;				 // id for error reports

	vrpn_int32	gotConnectionMessageID;  // for new-connection message

	virtual int register_types( );

	char msgbuf[vrpn_CONNECTION_TCP_BUFLEN];
	struct timeval timestamp;
}; // end class vrpn_FunctionGenerator

class VRPN_API vrpn_FunctionGenerator_Server : public vrpn_FunctionGenerator
{
public:
	vrpn_FunctionGenerator_Server( const char* name, vrpn_uint32 numChannels = vrpn_FUNCTION_CHANNELS_MAX, vrpn_Connection* c = NULL );
	virtual ~vrpn_FunctionGenerator_Server( );

	virtual void mainloop( );

	// sub-classes should implement these functions.  they will be called when messages
	// are received for the particular request.  at the end of these functions, servers
	// should call the appropriate send*Reply function, even (especially!) if the requested
	// change was rejected.
	virtual void setChannel( vrpn_uint32 channelNum, vrpn_FunctionGenerator_channel* channel ) = 0;
	virtual void start( ) = 0;
	virtual void stop( ) = 0;
	virtual void setSampleRate( vrpn_float32 rate ) = 0;

	vrpn_uint32 setNumChannels( vrpn_uint32 numChannels );

	// sub-classes should implement this function to provide a description of the type
	// of interpreter used to interpret vrpn_FunctionGenerator_function_script
	virtual const char* getInterpreterDescription( ) = 0;

	// sub-classes should not override these methods; these take care of
	// receiving requests
	static int VRPN_CALLBACK handle_channel_message( void* userdata, vrpn_HANDLERPARAM p );
	static int VRPN_CALLBACK handle_channelRequest_message( void* userdata, vrpn_HANDLERPARAM p );
	static int VRPN_CALLBACK handle_allChannelRequest_message( void* userdata, vrpn_HANDLERPARAM p );
	static int VRPN_CALLBACK handle_start_message( void* userdata, vrpn_HANDLERPARAM p );
	static int VRPN_CALLBACK handle_stop_message( void* userdata, vrpn_HANDLERPARAM p );
	static int VRPN_CALLBACK handle_sample_rate_message( void* userdata, vrpn_HANDLERPARAM p );
	static int VRPN_CALLBACK handle_interpreter_request_message( void* userdata, vrpn_HANDLERPARAM p );

protected:

	// sub-classes should call these functions to inform the remote side of
	// changes (or of non-changes, when a requested change cannot be accepted).
	// returns 0 on success and negative on failure.
	int sendChannelReply( vrpn_uint32 channelNum );
	int sendSampleRateReply( );
	int sendStartReply( vrpn_bool started );
	int sendStopReply( vrpn_bool stopped );
	int sendInterpreterDescription( );

	// sub-classes should use this function to report an error in function generation
	int sendError( FGError error, vrpn_int32 channel );

	vrpn_int32 decode_channel( const char* buf, const vrpn_int32 len, vrpn_uint32& channelNum,
								vrpn_FunctionGenerator_channel& channel );
	vrpn_int32 decode_channel_request( const char* buf, const vrpn_int32 len, vrpn_uint32& channelNum );
	vrpn_int32 decode_sampleRate_request( const char* buf, const vrpn_int32 len, vrpn_float32& sampleRate );

	vrpn_int32 encode_channel_reply( char** buf, vrpn_int32& len, const vrpn_uint32 channelNum );
	vrpn_int32 encode_start_reply( char** buf, vrpn_int32& len, const vrpn_bool isStarted );
	vrpn_int32 encode_stop_reply( char** buf, vrpn_int32& len, const vrpn_bool isStopped );
	vrpn_int32 encode_sampleRate_reply( char** buf, vrpn_int32& len, const vrpn_float32 sampleRate );
	vrpn_int32 encode_interpreterDescription_reply( char** buf, vrpn_int32& len, const char* desc );
	vrpn_int32 encode_error_report( char** buf, vrpn_int32& len, const FGError err, const vrpn_int32 channel );

}; // end class vrpn_FunctionGenerator_Server

//----------------------------------------------------------
// ************** Users deal with the following *************

// User routine to handle function-generator channel replies.  This
// is called when the function-generator server replies with new
// setting for some channel.
typedef	struct _vrpn_FUNCTION_CHANNEL_REPLY_CB
{
	struct timeval	msg_time;	// Time of the report
	vrpn_uint32	channelNum;		// Which channel is being reported
	vrpn_FunctionGenerator_channel*	channel;
} vrpn_FUNCTION_CHANNEL_REPLY_CB;
typedef void (VRPN_CALLBACK *vrpn_FUNCTION_CHANGE_REPLY_HANDLER)( void *userdata,
					  const vrpn_FUNCTION_CHANNEL_REPLY_CB info );

// User routine to handle function-generator start replies.  This
// is called when the function-generator server reports that it
// has started generating functions.
typedef	struct _vrpn_FUNCTION_START_REPLY_CB
{
	struct timeval	msg_time;	// Time of the report
	vrpn_bool isStarted;		// did the function generation start?
} vrpn_FUNCTION_START_REPLY_CB;
typedef void (VRPN_CALLBACK *vrpn_FUNCTION_START_REPLY_HANDLER)( void *userdata,
					     const vrpn_FUNCTION_START_REPLY_CB info );

// User routine to handle function-generator stop replies.  This
// is called when the function-generator server reports that it
// has stopped generating functions.
typedef	struct _vrpn_FUNCTION_STOP_REPLY_CB
{
	struct timeval	msg_time;	// Time of the report
	vrpn_bool isStopped;		// did the function generation stop?
} vrpn_FUNCTION_STOP_REPLY_CB;
typedef void (VRPN_CALLBACK *vrpn_FUNCTION_STOP_REPLY_HANDLER)( void *userdata,
					     const vrpn_FUNCTION_STOP_REPLY_CB info );

// User routine to handle function-generator sample-rate replies.
// This is called when the function-generator server reports that
// the function-generation sample rate has changed.
typedef	struct _vrpn_FUNCTION_SAMPLE_RATE_REPLY_CB
{
	struct timeval	msg_time;	// Time of the report
	vrpn_float32 sampleRate;
} vrpn_FUNCTION_SAMPLE_RATE_REPLY_CB;
typedef void (VRPN_CALLBACK *vrpn_FUNCTION_SAMPLE_RATE_REPLY_HANDLER)( void *userdata,
					     const vrpn_FUNCTION_SAMPLE_RATE_REPLY_CB info );

// User routine to handle function-generator interpreter-description replies.
// This is called when the function-generator server reports the description
// of its interpreter.
typedef	struct _vrpn_FUNCTION_INTERPRETER_REPLY_CB
{
	struct timeval	msg_time;	// Time of the report
	char* description;
} vrpn_FUNCTION_INTERPRETER_REPLY_CB;
typedef void (VRPN_CALLBACK *vrpn_FUNCTION_INTERPRETER_REPLY_HANDLER)( void *userdata,
					     const vrpn_FUNCTION_INTERPRETER_REPLY_CB info );

// User routine to handle function-generator error notifications.
// This is called when the function-generator server reports some
// error in the generation of a function.
typedef	struct _vrpn_FUNCTION_ERROR_CB
{
	struct timeval	msg_time;	// Time of the report
	vrpn_FunctionGenerator::FGError err;
	vrpn_int32 channel;
} vrpn_FUNCTION_ERROR_CB;
typedef void (VRPN_CALLBACK *vrpn_FUNCTION_ERROR_HANDLER)( void *userdata,
					     const vrpn_FUNCTION_ERROR_CB info );

class VRPN_API vrpn_FunctionGenerator_Remote : public vrpn_FunctionGenerator
{
public:
	vrpn_FunctionGenerator_Remote( const char* name, vrpn_Connection* c = NULL );
	virtual ~vrpn_FunctionGenerator_Remote( ) { }

	int setChannel( const vrpn_uint32 channelNum, const vrpn_FunctionGenerator_channel* channel );
	int requestChannel( const vrpn_uint32 channelNum );
	int requestAllChannels( );
	int requestStart( );
	int requestStop( );
	int requestSampleRate( const vrpn_float32 rate );
	int requestInterpreterDescription( );

	virtual void mainloop( );

	// (un)Register a callback handler to handle a channel reply
	virtual int register_channel_reply_handler( void *userdata,
		vrpn_FUNCTION_CHANGE_REPLY_HANDLER handler );
	virtual int unregister_channel_reply_handler( void *userdata,
		vrpn_FUNCTION_CHANGE_REPLY_HANDLER handler );

	// (un)Register a callback handler to handle a start reply
	virtual int register_start_reply_handler( void *userdata,
		vrpn_FUNCTION_START_REPLY_HANDLER handler );
	virtual int unregister_start_reply_handler( void *userdata,
		vrpn_FUNCTION_START_REPLY_HANDLER handler );

	// (un)Register a callback handler to handle a stop reply
	virtual int register_stop_reply_handler( void *userdata,
		vrpn_FUNCTION_STOP_REPLY_HANDLER handler );
	virtual int unregister_stop_reply_handler( void *userdata,
		vrpn_FUNCTION_STOP_REPLY_HANDLER handler );

	// (un)Register a callback handler to handle a sample-rate reply
	virtual int register_sample_rate_reply_handler( void *userdata,
		vrpn_FUNCTION_SAMPLE_RATE_REPLY_HANDLER handler );
	virtual int unregister_sample_rate_reply_handler( void *userdata,
		vrpn_FUNCTION_SAMPLE_RATE_REPLY_HANDLER handler );

	// (un)Register a callback handler to handle an interpreter message
	virtual int register_interpreter_reply_handler( void *userdata,
		vrpn_FUNCTION_INTERPRETER_REPLY_HANDLER handler );
	virtual int unregister_interpreter_reply_handler( void *userdata,
		vrpn_FUNCTION_INTERPRETER_REPLY_HANDLER handler );

	virtual int register_error_handler( void* userdata,
		vrpn_FUNCTION_ERROR_HANDLER handler );
	virtual int unregister_error_handler( void* userdata,
		vrpn_FUNCTION_ERROR_HANDLER handler );

	static int VRPN_CALLBACK handle_channelReply_message( void* userdata, vrpn_HANDLERPARAM p );
	static int VRPN_CALLBACK handle_startReply_message( void* userdata, vrpn_HANDLERPARAM p );
	static int VRPN_CALLBACK handle_stopReply_message( void* userdata, vrpn_HANDLERPARAM p );
	static int VRPN_CALLBACK handle_sampleRateReply_message( void* userdata, vrpn_HANDLERPARAM p );
	static int VRPN_CALLBACK handle_interpreterReply_message( void* userdata, vrpn_HANDLERPARAM p );
	static int VRPN_CALLBACK handle_error_message( void* userdata, vrpn_HANDLERPARAM p );

protected:
	vrpn_Callback_List<vrpn_FUNCTION_CHANNEL_REPLY_CB> channel_reply_list;
	vrpn_Callback_List<vrpn_FUNCTION_START_REPLY_CB> start_reply_list;
	vrpn_Callback_List<vrpn_FUNCTION_STOP_REPLY_CB> stop_reply_list;
	vrpn_Callback_List<vrpn_FUNCTION_SAMPLE_RATE_REPLY_CB> sample_rate_reply_list;
	vrpn_Callback_List<vrpn_FUNCTION_INTERPRETER_REPLY_CB> interpreter_reply_list;
	vrpn_Callback_List<vrpn_FUNCTION_ERROR_CB> error_list;

	vrpn_int32 decode_channel_reply( const char* buf, const vrpn_int32 len, vrpn_uint32& channelNum );
	vrpn_int32 decode_start_reply( const char* buf, const vrpn_int32 len, vrpn_bool& isStarted );
	vrpn_int32 decode_stop_reply( const char* buf, const vrpn_int32 len, vrpn_bool& isStopped );
	vrpn_int32 decode_sampleRate_reply( const char* buf, const vrpn_int32 len );
	vrpn_int32 decode_interpreterDescription_reply( const char* buf, const vrpn_int32 len, char** desc );
	vrpn_int32 decode_error_reply( const char* buf, const vrpn_int32 len, FGError& error, vrpn_int32& channel );

	vrpn_int32 encode_channel( char** buf, vrpn_int32& len, const vrpn_uint32 channelNum,
							   const vrpn_FunctionGenerator_channel* channel );
	vrpn_int32 encode_channel_request( char** buf, vrpn_int32& len, const vrpn_uint32 channelNum );
	vrpn_int32 encode_sampleRate_request( char** buf, vrpn_int32& len, const vrpn_float32 sampleRate );

}; // end class vrpn_FunctionGenerator_Remote

#endif // VRPN_FUNCTIONGENERATOR_H


text:
export class IterableValueConverter {
  toView(value) {
    let index = 0;
    let propKeys = Reflect.ownKeys(value);
    return {
        [Symbol.iterator]() {
            return this;
        },
        next() {
            if (index < propKeys.length) {
                let key = propKeys[index];
                index++;
                return { value: [key, value[key]] };
            } else {
                return { done: true };
            }
        }
    };
  }
}

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.almasb.fxglgames</groupId>
    <artifactId>Mario</artifactId>
    <version>2.0</version>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <source.version>17</source.version>

        <!-- plugins -->
        <maven.compiler.version>3.8.1</maven.compiler.version>
        <maven.shade.version>3.0.0</maven.shade.version>

        <fxgl.version>17</fxgl.version>
        <jfx.maven.plugin.version>0.0.8</jfx.maven.plugin.version>
        <gluonfx.plugin.version>1.0.11</gluonfx.plugin.version>
        <attach.version>4.0.13</attach.version>
        <mainClassName>com.almasb.fxglgames.platformer.PlatformerApp</mainClassName>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.github.almasb</groupId>
            <artifactId>fxgl</artifactId>
            <version>${fxgl.version}</version>
        </dependency>

        <dependency>
            <groupId>com.gluonhq.attach</groupId>
            <artifactId>audio</artifactId>
            <version>${attach.version}</version>
        </dependency>
        <dependency>
            <groupId>com.gluonhq.attach</groupId>
            <artifactId>lifecycle</artifactId>
            <version>${attach.version}</version>
        </dependency>
        <dependency>
            <groupId>com.gluonhq.attach</groupId>
            <artifactId>storage</artifactId>
            <version>${attach.version}</version>
        </dependency>
        <dependency>
            <groupId>com.gluonhq.attach</groupId>
            <artifactId>util</artifactId>
            <version>${attach.version}</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven.compiler.version}</version>
                <configuration>
                    <release>${source.version}</release>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.openjfx</groupId>
                <artifactId>javafx-maven-plugin</artifactId>
                <version>${jfx.maven.plugin.version}</version>
                <configuration>
                    <stripDebug>true</stripDebug>
                    <compress>2</compress>
                    <noHeaderFiles>true</noHeaderFiles>
                    <noManPages>true</noManPages>
                    <launcher>Start-game</launcher>
                    <jlinkImageName>game</jlinkImageName>
                    <jlinkZipName>${project.name}-game</jlinkZipName>
                    <mainClass>${mainClassName}</mainClass>
                </configuration>
            </plugin>

            <plugin>
                <groupId>com.gluonhq</groupId>
                <artifactId>gluonfx-maven-plugin</artifactId>
                <version>${gluonfx.plugin.version}</version>
                <configuration>
                    <nativeImageArgs>--allow-incomplete-classpath</nativeImageArgs>
                    <attachList>
                        <list>audio</list>
                        <list>lifecycle</list>
                        <list>storage</list>
                        <list>util</list>
                    </attachList>
                    <resourcesList>
                        <list>.*\\.lang$</list>
                        <list>.*\\.tmx$</list>
                        <list>.*\\.wav$</list>
                        <list>.*\\.mp3$</list>
                    </resourcesList>
                    <verbose>true</verbose>
                    <reflectionList>
                        <list>com.almasb.fxgl.app.GameApplication</list>
                        <list>com.almasb.fxgl.app.FXGLApplication</list>
                        <list>com.almasb.fxgl.app.ReadOnlyGameSettings</list>
                        <list>com.almasb.fxgl.app.GameSettings</list>

                        <!-- Engine services -->
                        <list>com.almasb.fxgl.app.services.FXGLDialogService</list>
                        <list>com.almasb.fxgl.app.services.IOTaskExecutorService</list>
                        <list>com.almasb.fxgl.app.services.SystemBundleService</list>
                        <list>com.almasb.fxgl.app.services.UpdaterService</list>
                        <list>com.almasb.fxgl.app.services.FXGLAssetLoaderService</list>
                        <list>com.almasb.fxgl.core.asset.AssetLoaderService</list>
                        <list>com.almasb.fxgl.cutscene.CutsceneService</list>
                        <list>com.almasb.fxgl.dev.DevService</list>
                        <list>com.almasb.fxgl.dev.profiling.ProfilerService</list>
                        <list>com.almasb.fxgl.event.EventBusService</list>
                        <list>com.almasb.fxgl.io.FileSystemService</list>
                        <list>com.almasb.fxgl.localization.LocalizationService</list>
                        <list>com.almasb.fxgl.minigames.MiniGameService</list>
                        <list>com.almasb.fxgl.net.NetService</list>
                        <list>com.almasb.fxgl.profile.SaveLoadService</list>
                        <list>com.almasb.fxgl.ui.FXGLDialogFactoryServiceProvider</list>
                        <list>com.almasb.fxgl.ui.FXGLUIFactoryServiceProvider</list>
                        <list>com.almasb.fxgl.app.FXGLApplication$GameApplicationService</list>
                        <list>com.almasb.fxgl.audio.AudioPlayer</list>
                        <list>com.almasb.fxgl.notification.impl.NotificationServiceProvider</list>
                        <list>com.almasb.fxgl.notification.view.XboxNotificationView</list>
                        <list>com.almasb.fxgl.achievement.AchievementService</list>
                        <list>com.almasb.fxgl.core.math.Vec2</list>
                        <list>com.almasb.fxgl.particle.Particle</list>
                        <!-- Components -->

                        <list>com.almasb.fxgl.entity.components.BoundingBoxComponent</list>
                        <list>com.almasb.fxgl.entity.components.CollidableComponent</list>
                        <list>com.almasb.fxgl.entity.components.IDComponent</list>
                        <list>com.almasb.fxgl.entity.components.IrremovableComponent</list>
                        <list>com.almasb.fxgl.entity.components.TimeComponent</list>
                        <list>com.almasb.fxgl.entity.components.TransformComponent</list>
                        <list>com.almasb.fxgl.entity.components.TypeComponent</list>
                        <list>com.almasb.fxgl.entity.components.ViewComponent</list>
                        <list>com.almasb.fxgl.particle.ParticleComponent</list>
                        <list>com.almasb.fxgl.physics.PhysicsComponent</list>
                        <list>com.almasb.fxgl.dsl.components.EffectComponent</list>
                        <list>com.almasb.fxgl.dsl.components.LiftComponent</list>
                        <list>com.almasb.fxgl.dsl.components.OffscreenCleanComponent</list>
                        <list>com.almasb.fxgl.dsl.components.OffscreenPauseComponent</list>
                        <list>com.almasb.fxgl.dsl.components.ProjectileComponent</list>

                        <!--     Custom components                  -->
                        <list>com.almasb.fxglgames.platformer.PlayerComponent</list>
                        <list>com.almasb.fxglgames.platformer.PlatformerFactory</list>

                    </reflectionList>
                    <target>android</target>
                    <mainClass>${mainClassName}</mainClass>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>


text:
package ai.elimu.util;

import java.util.List;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.assertThat;

import org.junit.Test;

public class LetterExtractionHelperTest {

    @Test
    public void testGetLetters() {
        String paragraph = "\"Mom,\" called Lebo. \"Come and look. These clothes are all too small for me!\"";
        List<String> letters = LetterExtractionHelper.getLetters(paragraph);
        assertThat(letters.get(0), is("M"));
        assertThat(letters.get(1), is("o"));
        assertThat(letters.get(2), is("m"));
        assertThat(letters.get(3), is("c"));
        assertThat(letters.get(4), is("a"));
        assertThat(letters.get(5), is("l"));
        assertThat(letters.get(6), is("l"));
        assertThat(letters.get(7), is("e"));
        assertThat(letters.get(8), is("d"));
        assertThat(letters.get(9), is("L"));
        assertThat(letters.get(10), is("e"));
        assertThat(letters.get(11), is("b"));
        assertThat(letters.get(12), is("o"));
    }
}


text:
package com.baidu.oped.apm.profiler.receiver;

import java.util.List;

/**
 * @Author Taejin Koo
 */
public interface ProfilerCommandServiceGroup {

    List<ProfilerCommandService> getCommandServiceList();

}


text:
angular.module('plan').controller('ProjectsController', [
    '$scope', '$filter', 'AngularDataStore', 'projects', 'NgTableParams', 'gitlab',
    function ($scope, $filter, AngularDataStore, projects, NgTableParams, gitlab) {
        $scope.gitlab = gitlab;
        $scope.projects = projects;

        $scope.removeProject = function (project) {
            if (confirm('Are you sure you want to delete this project ?')) {
                AngularDataStore.remove(project);
            }
        };

        $scope.tableParams = new NgTableParams(
            {
                page: 1,
                count: 100,
                sorting: {
                    name: 'asc'
                }
            },
            {
                dataset: $scope.projects
            }
        );

        $scope.$on('$destroy', $scope.$watch('projects', function () { $scope.tableParams.reload(); }, true));
    }
]);


text:
package gov.nih.nci.cabig.caaers.web.study;

import com.semanticbits.rules.utils.RuleUtil;
import gov.nih.nci.cabig.caaers.dao.StudyDao;
import gov.nih.nci.cabig.caaers.domain.CoordinatingCenter;
import gov.nih.nci.cabig.caaers.domain.FundingSponsor;
import gov.nih.nci.cabig.caaers.domain.OrganizationAssignedIdentifier;
import gov.nih.nci.cabig.caaers.domain.Study;
import gov.nih.nci.cabig.caaers.service.migrator.StudyConverter;
import gov.nih.nci.cabig.caaers.web.rule.notification.ReportDefinitionCommand;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.validation.BindException;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractCommandController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.Marshaller;
import java.io.*;

/**
 * @author Ion C. Olaru
 *
 * */
public class ExportStudyController extends AbstractCommandController {

    protected final Log log = LogFactory.getLog(getClass());

	protected StudyDao studyDao;
	protected StudyConverter converter;

	public ExportStudyController(){
		setCommandClass(ReportDefinitionCommand.class);
	}

	@Override
	protected ModelAndView handle(HttpServletRequest request, HttpServletResponse response, Object o, BindException e) throws Exception {

        Integer studyID = Integer.valueOf(request.getParameter("id"));
        Study study = studyDao.getById(studyID);
        studyDao.initialize(study);

        // START study export pre-population
        study.setCoordinatingCenter(new CoordinatingCenter());
        study.getCoordinatingCenter().setStudyCoordinatingCenter(study.getStudyCoordinatingCenter());

        study.setFundingSponsor(new FundingSponsor());
        study.getFundingSponsor().setStudyFundingSponsor(study.getStudyFundingSponsors().get(0));

        for (OrganizationAssignedIdentifier id : study.getOrganizationAssignedIdentifiers()) {
            if (id.getOrganization().equals(study.getFundingSponsor().getStudyFundingSponsor().getOrganization())) {
                study.getFundingSponsor().setOrganizationAssignedIdentifier(id);
                study.getFundingSponsor().getOrganizationAssignedIdentifier().setPrimaryIndicator(true);
                break;
            }
        }
        for (OrganizationAssignedIdentifier id : study.getOrganizationAssignedIdentifiers()) {
            if (id.getOrganization().equals(study.getCoordinatingCenter().getStudyCoordinatingCenter().getOrganization())) {
                study.getCoordinatingCenter().setOrganizationAssignedIdentifier(id);
                study.getCoordinatingCenter().getOrganizationAssignedIdentifier().setPrimaryIndicator(false);
                break;
            }
        }
        // END study export pre-population

        gov.nih.nci.cabig.caaers.integration.schema.study.Studies studies = converter.convertStudyDomainToStudyDto(study);

        //Marshall the Data Transfer Object according to Study.xsd schema,
        //and download it to the client machine.
		try {
			String tempDir = System.getProperty("java.io.tmpdir");
			String fileName = "ExportedStudy_" + study.getPrimaryIdentifierValue();
			fileName = RuleUtil.getStringWithoutSpaces(fileName);

			StringWriter sw = new StringWriter();
			JAXBContext jaxbContext = JAXBContext.newInstance("gov.nih.nci.cabig.caaers.integration.schema.study");

	    	Marshaller marshaller = jaxbContext.createMarshaller();
	    	marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true) ;
	    	marshaller.marshal(studies, sw);
	        BufferedWriter out = new BufferedWriter(new FileWriter(tempDir + fileName + ".xml"));
	        out.write(sw.toString());
            out.flush();
	        out.close();

	        response.setContentType("application/xml");
	        response.setHeader("Content-Disposition", "attachment; filename=" + fileName + ".xml");
	        response.setHeader("Content-length", String.valueOf(sw.toString().length()));
	        response.setHeader("Pragma", "private");
	        response.setHeader("Cache-control", "private, must-revalidate");

	        OutputStream outputStream = response.getOutputStream();
	        File file = new File(tempDir + fileName + ".xml");
	        FileInputStream fileIn = new FileInputStream(file);
	        byte[] buffer = new byte[2048];
            int bytesRead = fileIn.read(buffer);
            while (bytesRead >= 0) {
                if (bytesRead > 0) outputStream.write(buffer, 0, bytesRead);
                bytesRead = fileIn.read(buffer);
            }
            outputStream.flush();
            outputStream.close();
            fileIn.close();

		} catch (Exception ex) {
            log.error(ex);
            ex.printStackTrace();
		}
		return null;
	}

    public StudyDao getStudyDao() {
        return studyDao;
    }

    public void setStudyDao(StudyDao studyDao) {
        this.studyDao = studyDao;
    }

    public StudyConverter getConverter() {
        return converter;
    }

    public void setConverter(StudyConverter converter) {
        this.converter = converter;
    }
}


text:
package griffon.plugins.hibernate3;

import griffon.util.CallableWithArgs;
import groovy.lang.Closure;

/**
 * @author Andres Almiray
 */
public interface Hibernate3ContributionHandler {
    void setHibernate3Provider(Hibernate3Provider provider);

    Hibernate3Provider getHibernate3Provider();

    <R> R withHibernate3(Closure<R> closure);

    <R> R withHibernate3(String sessionFactoryName, Closure<R> closure);

    <R> R withHibernate3(CallableWithArgs<R> callable);

    <R> R withHibernate3(String sessionFactoryName, CallableWithArgs<R> callable);
}


text:
- [Gulp](http://gulpjs.com/) - Task Runner.
- [Bower](http://bower.io/) - Package Manager.
- [Browsersync](http://www.browsersync.io/) - Watch project changes and updates browsers.

#### HTML
- [Assemble](https://github.com/assemble/assemble/)

#### CSS
- [SASS](http://sass-lang.com/)
- [Autoprefixer](https://github.com/postcss/autoprefixer)
- [CSScomb](http://csscomb.com/)
- [CSSnano](http://cssnano.co/)
- [stylelint](http://stylelint.io/)

#### Javascript
- [BabelJS](https://babeljs.io/) - Javascript compiler.
- [rollup.js](http://rollupjs.org/) - Javascript module bundler
- [ESLint](http://eslint.org/)

#### Test
- [Karma](https://karma-runner.github.io/)
- [Mocha](http://mochajs.org/)
- [Chai](http://chaijs.com/)
- [Sinon](http://sinonjs.org/)

#### Visual regression testing
- [PhantomCSS](https://github.com/Huddle/PhantomCSS)

#### Coverage
- [Istanbul](https://github.com/gotwarlost/istanbul)

#### HTML
- [htmlhint](http://htmlhint.com)
- [w3cjs](https://github.com/thomasdavis/w3cjs)
- [a11y](https://addyosmani.com/a11y/)

#### Assets
- [assets-manager](https://github.com/amazingSurge/assets-manager)

#### Release
- [release-it](https://github.com/webpro/release-it)

## Instalation

You will need to install [NodeJS](http://nodejs.org/).

```sh
# Clone the repository.
$ git clone git@github.com:amazingSurge/frontend-starter-kit.git project
$ cd project

# Install Gulp, Bower and babel-cli, if you haven't already.
$ npm install -g gulp-cli babel-cli bower assemble

# Installs all the dependencies.
$ npm install

# gulp-scss-lint plugin requires Ruby and scss-lint
$ gem install scss_lint

# Installs all packages.
$ bower install

# Start a mini server to view the project and watch their changes on http://localhost:3000/
$ gulp
```

## Available Tasks
- `gulp` or `gulp watch` Start watch for changes and server with Browsersync.
- `gulp build` Run all development tasks
- `gulp serve` Start server with Browsersync.
- `gulp clean` Clean output directories.
- `gulp lint` Lint everything.
- `gulp pagespeed` Run PageSpeed Insights.

#### Html
- `gulp html` Complie handlebar templates into html files.
- `gulp htmlhint` Lint html files using htmlhint.
- `gulp w3cjs` Lint html files using w3c.
- `gulp a11y` Lint html files using a11y.
- `gulp clean:html` Clean out distribution html files.

#### Javascript
- `gulp bundler` Bundle javasript modules.
- `gulp scripts` Concatenate and minify JavaScript.
- `gulp eslint` Lint ES6 files using eslint.
- `gulp clean:scripts` Clean out distribution javascript files.

#### CSS
- `gulp styles` Compile and automatically prefix stylesheets.
- `gulp stylelint` Lint css files using stylelint.
- `gulp clean:styles` Clean out distribution stylesheets files.

#### Assets
- `gulp images` Optimize all images.
- `gulp svg` Create svg sprites.
- `gulp fonts` Create fontface files.
- `gulp favicons` Create favicon images.
- `gulp icons` Create icons.
- `gulp assets` Copy assets to distribution directory.
- `gulp assets:clean` Clean out assets from distribution directory.

#### Tests
- `gulp tdd` Test for Test Driven Development purposes.
- `gulp test` Test for Continuous Integration purposes.

#### Visual regression testing
- `gulp visual` Run tests for visual regression.
- `gulp clean:visual` Clean out visual regression testing screenshots and results files.

#### Coverage
- `gulp coverage` Generate coverage report.

#### Release
- `gulp release` Bump version and release to npm and github.

##### Standalone file tasks
- `gulp html --page=index.hbs`
- `gulp scripts --file=index.js`
- `gulp styles --file=styles.scss`
- `gulp svgs --folder=example`
- `gulp assets --package=jquery`
- `gulp assets:clean --package=jquery`

## Directories
- `src/html` - Source files for html.
- `src/js` - Source files for javascript.
- `src/scss` - Source files for css.
- `src/svgs` - Svg files for sprites.
- `src/images` - Source files for images.
- `src/icons` - Source files for icons.
- `src/fonts` - ttf fonts that will generated into fontface files.

Other directories:

- `build` - Intermediate files produced by the development server.
- `dist` - The output of `gulp dist`, which contains your distribution-ready app.

Main application files:
- `src/js/index.js` - The application's entry point
- `src/scss/style.scss` - Global styles for your application

Main build files:

- `gulpfile.babel.js` - Build scripts written with [gulp](http://gulpjs.com/)


text:
rock.namespace('pong.court');

/**
 * Class representing a ball
 *
 * @param world
 *
 * @constructor
 * @extends pong.court.PongObject
 *
 * @author Luis Alberto Jiménez
 */
pong.court.Ball = function (world) {
    rock.super_(this, [pong.constants.BALL_TYPE, world]);
    this.velocity = null;
    this.angle = null;
};

rock.extends_(pong.court.Ball, pong.court.PongObject);

pong.court.Ball.prototype.move = function (timeVariation) {
    this.moveStraight(timeVariation);
    var bounceOnWall = this.bounceOnWalls();
    var bounceOnRacket = this.bounceOnRackets();

    return bounceOnWall || bounceOnRacket;
};

pong.court.Ball.prototype.moveStraight = function(timeVariation) {
    var velocity = this.velocity;
    var distance = timeVariation * velocity;

    var rad = rock.util.GeometryUtils.degToRad(this.angle);
    var varX = Math.cos(rad) * distance;
    var varZ = Math.sin(rad) * distance;

    var position = this.getPosition();
    position.setX(position.getX() + varX);
    position.setZ(position.getZ() + varZ);
};

pong.court.Ball.prototype.bounceOnWalls = function () {
    var leftWall = this.world.getLeftWall();
    var rightWall = this.world.getRightWall();
    var bounce = false;

    if (this.isMovingLeft()) {
        bounce = leftWall.bounceBallOnRightIfNecessary(this);
    }

    if (this.isMovingRight()) {
        bounce = bounce || rightWall.bounceBallOnLeftIfNecessary(this);
    }

    return bounce;
};

pong.court.Ball.prototype.bounceOnRackets = function () {
    var playerRacket = this.world.getPlayerRacket();
    var opponentRacket = this.world.getOpponentRacket();
    var bounce = false;

    if (this.isMovingTop()) {
        bounce = playerRacket.bounceBallOnBottomIfNecessary(this);
    }

    if (this.isMovingBottom()) {
        bounce = bounce || opponentRacket.bounceBallOnTopIfNecessary(this);
    }

    return bounce;
};

pong.court.Ball.prototype.getOpponentGoalAreaHitPosition = function () {
    var court = this.world;
    var cathetus1 = court.getCourtDepth();
    var cathetus2 = court.getCourtWidth();
    var hypotenuse =  Math.sqrt(Math.pow(cathetus1, 2) + Math.pow(cathetus2, 2));

    var maxDistance = hypotenuse * 1.10; // we add an extra to more secure
    var timeNeeded = maxDistance / this.getVelocity();

    this.moveStraight(timeNeeded);
    var bounceOnWall = this.bounceOnWalls();
    while (bounceOnWall) {
        this.moveStraight(timeNeeded);
        bounceOnWall = this.bounceOnWalls();
    }

    var opponentGoalArea = court.getOpponentGoalArea();
    return this.getBallHitPointWidthAxis(this, this.dynamicBBOX.getZMin(), opponentGoalArea.getDynamicBBOX().getZMax());
};

pong.court.Ball.prototype.isMovingLeft = function () {
    var angle = this.angle;
    return 90 < angle && angle < 270;
};

pong.court.Ball.prototype.isMovingRight = function () {
    var angle = this.angle;
    return (0 < angle && angle < 90) ||
        (270 < angle && angle < 360);
};

pong.court.Ball.prototype.isMovingTop = function () {
    var angle = this.angle;
    return 0 < angle && angle < 180;
};

pong.court.Ball.prototype.isMovingBottom = function () {
    var angle = this.angle;
    return 180 < angle && angle < 360;
};

pong.court.Ball.prototype.initFromBallInfo = function (ball) {
    this.setVelocity(ball.getVelocity());
    this.setAngle(ball.getAngle());
    var position = this.getPosition();
    var ballPosition = ball.getPosition();
    position.setX(ballPosition.getX());
    position.setZ(ballPosition.getZ());
};

/**
 * Get the velocity
 */
pong.court.Ball.prototype.getVelocity = function() {
    return this.velocity;
};

/**
 * Set the velocity
 *
 * @param velocity the value
 */
pong.court.Ball.prototype.setVelocity = function(velocity) {
    this.velocity = velocity;
};

/**
 * Get the angle
 */
pong.court.Ball.prototype.getAngle = function() {
    return this.angle;
};

/**
 * Set the angle
 *
 * @param angle the value
 */
pong.court.Ball.prototype.setAngle = function(angle) {
    this.angle = rock.util.GeometryUtils.normalizeAngle(angle);
};


text:
maintainer "Micah Wylde"
maintainer_email "mwylde@wesleyan.edu"
license "MIT"
description "Installs xorg."
version "0.0.2"

recipe "roomtrol-randoms", "Makes small necessary changes to Ubuntu"


text:
void check_int(const vv::value::integer orig)
{
  const auto ptr = vv::gc::alloc<vv::value::integer>( orig );
  BOOST_CHECK_EQUAL(ptr.tag(), vv::tag::integer);
  BOOST_CHECK_MESSAGE(ptr.type() == vv::builtin::type::integer,
                      "incorrect type for " << orig);

  const auto val = vv::value::get<vv::value::integer>(ptr);
  BOOST_CHECK_EQUAL(orig, val);
}

void check_bool(const vv::value::boolean orig)
{
  const auto ptr = vv::gc::alloc<vv::value::boolean>( orig );
  BOOST_CHECK_EQUAL(ptr.tag(), vv::tag::boolean);
  BOOST_CHECK_MESSAGE(ptr.type() == vv::builtin::type::boolean,
                      "incorrect type for " << orig);

  const auto val = vv::value::get<vv::value::boolean>(ptr);
  BOOST_CHECK_EQUAL(orig, val);
}

void check_float(const double orig)
{
  const auto ptr = vv::gc::alloc<vv::value::floating_point>( orig );
  BOOST_CHECK_EQUAL(ptr.tag(), vv::tag::floating_point);
  BOOST_CHECK_MESSAGE(ptr.type() == vv::builtin::type::floating_point,
                      "incorrect type for " << orig);

  const auto val = vv::value::get<vv::value::floating_point>(ptr);
  BOOST_CHECK_EQUAL(orig, val);
}

BOOST_AUTO_TEST_CASE(check_nil)
{
  const auto ptr = vv::gc::alloc<vv::value::nil>( );
  BOOST_CHECK_EQUAL(ptr.tag(), vv::tag::nil);
  BOOST_CHECK_MESSAGE(ptr.type() == vv::builtin::type::nil,
                      "incorrect type for nil");
}

void check_string(const std::string& orig)
{
  const auto ptr = vv::gc::alloc<vv::value::string>( orig );
  BOOST_CHECK_EQUAL(ptr.tag(), vv::tag::string);
  BOOST_CHECK_MESSAGE(ptr.type() == vv::builtin::type::string,
                      "incorrect type for \"" << vv::escape_chars(orig) << '"');

  const auto val = vv::value::get<vv::value::string>(ptr);
  BOOST_CHECK_EQUAL(orig, val);
}

BOOST_AUTO_TEST_CASE(check_default_string)
{
  const auto ptr = vv::gc::alloc<vv::value::string>( );
  BOOST_CHECK_EQUAL(vv::value::get<vv::value::string>(ptr), "");
}

void check_symbol(const vv::symbol orig)
{
  const auto ptr = orig.ptr();//vv::gc::alloc<vv::value::symbol>( orig );
  BOOST_CHECK_EQUAL(ptr.tag(), vv::tag::symbol);
  BOOST_CHECK_MESSAGE(ptr.type() == vv::builtin::type::symbol,
                      "incorrect type for " << orig);

  const auto val = vv::value::get<vv::symbol>(ptr);
  BOOST_CHECK_EQUAL(orig, val);
}

boost::unit_test::test_suite* init_unit_test_suite(int argc, char** argv)
{
  vv::builtin::init();

  std::array<int64_t, 1002> ints;
  ints[0] = std::numeric_limits<int32_t>::min();
  ints[1] = std::numeric_limits<int32_t>::max();
  std::iota(begin(ints) + 2, end(ints), -500);

  boost::unit_test::framework::master_test_suite().add(
    BOOST_PARAM_TEST_CASE(&check_int, begin(ints), end(ints)));

  const auto bools = { true, false };
  boost::unit_test::framework::master_test_suite().add(
    BOOST_PARAM_TEST_CASE(&check_bool, begin(bools), end(bools)));

  std::array<double, 1002> doubles;
  doubles[0] = std::numeric_limits<double>::min();
  doubles[1] = std::numeric_limits<double>::max();
  std::iota(begin(doubles) + 2, end(doubles), -500.0);
  boost::unit_test::framework::master_test_suite().add(
    BOOST_PARAM_TEST_CASE(&check_float, begin(doubles), end(doubles)));

  const auto strings = { "", "foo", "foo\"bar", "foo\\bar" };
  boost::unit_test::framework::master_test_suite().add(
    BOOST_PARAM_TEST_CASE(&check_string, begin(strings), end(strings)));

  const auto symbols = { vv::symbol{""}, vv::symbol{"foo"} };
  boost::unit_test::framework::master_test_suite().add(
    BOOST_PARAM_TEST_CASE(&check_symbol, begin(symbols), end(symbols)));

  return nullptr;
}


text:
jest.unmock('../menu');
jest.unmock('../utils');

import Menu from '../menu';
import Utils from '../utils'

describe('menu', () => {
  it('tests menu', () => {
    let mock = {
      callback: function() {},
      event: {
        preventDefault:function(){}
      }
    };

    let menu = new Menu(mock.callback);
    menu.render();
    Utils.CONSTANTS.PHOTO_SET.forEach(function () {
      menu.handleMenuAction(mock.event);
    });
  });
});


text:
$(function(){
    // allowed only digits
    $(".onlyDigits").keypress(function (e) {
        //if the letter is not digit then don't type anything
        if (e.which != 8 && e.which != 0 && (e.which < 48 || e.which > 57)) {
            return false;
        }
    });

    /**
     * below function are used for validate bitcoin value with 4 decimal poin
     * bitcoin minimum transfer amount is 0.0001
     */
    $(document).off('keypress','.onlyDigitWithDecimal').on('keypress','.onlyDigitWithDecimal',function(event) {
        var $this = $(this);
        if ((event.which != 46 || $this.val().indexOf('.') != -1) &&
           ((event.which < 48 || event.which > 57) &&
           (event.which != 0 && event.which != 4))) {
            event.preventDefault();
        }

        var text = $(this).val();
        if ((event.which == 46) && (text.indexOf('.') == -1)) {
         setTimeout(function() {
          if ($this.val().substring($this.val().indexOf('.')).length > 4) {
           $this.val($this.val().substring(0, $this.val().indexOf('.') + 4));

          }
         }, 1);
        }

        if ((text.indexOf('.') != -1) &&
         (text.substring(text.indexOf('.')).length > 4) &&
         (event.which != 0 && event.which != 4) &&
         ($(this)[0].selectionStart >= text.length - 4)) {
          event.preventDefault();
        }
    });

    //show loaded on ajax calls.
    $loading = $('#loadingDiv').hide();
    if(login){
        check_assigned_task();
        $(document).off('click','.offer').on('click','.offer',function(){
            var tid=$(this).attr('data-task_id');
            if($(this).hasClass('btn-success'))
                accept_reject_offer(tid,'/tasks/accept_offer');
            else if($(this).hasClass('re_assigned'))
                accept_reject_offer(tid,'/tasks/accept_offer');
            else if($(this).hasClass('btn-danger'))
                accept_reject_offer(tid,'/tasks/reject_offer');
        })
    }

    $(document).off("click",".more_unit_site_activity_btn").on('click','.more_unit_site_activity_btn',function(e){
        e.preventDefault();
        $(".site_activity_loading").show();
        var page = $(this).data('url').split('page=')[1];
        var unit_id = $(this).data('unit_id');
        $(this).parents(".loading_content_hide").css('opacity','0.5');
        getUnitActivity(page,unit_id);
        return false;
    });

    $(document).off("click",".more_site_activity_btn").on('click','.more_site_activity_btn',function(e){
        e.preventDefault();
        $(".site_activity_loading").show();
        var from_page = $(this).data('from_page');
        var page = $(this).data('url').split('page=')[1];
        $(this).parents(".loading_content_hide").css('opacity','0.5');
        if($.trim(from_page) != "" && (from_page == "global" || from_page == "user")) {
            if(from_page == "global")
                from_page = "global_activity";

            getGlobalSiteActivity(page, from_page);
        }
        else
            getSiteActivity(page);
        return false;
    });

    //load more units
    $(document).off("click",".more-units").on('click','.more-units',function(e){
        e.preventDefault();
        $(".unit_loading").show();
        var page = $(this).data('url').split('page=')[1];
        $(this).parents(".loading_content_hide").css('opacity','0.5');
        getUnits(page);
        return false;
    });

    //load more units
    $(document).off("click",".more-issues").on('click','.more-issues',function(e){
        e.preventDefault();
        $(".unit_loading").show();
        var page = $(this).data('url').split('page=')[1];
        $(this).parents(".loading_content_hide").css('opacity','0.5');
        getIssues(page);
        return false;
    });

    //load more units
    $(document).off("click",".more-objectives").on('click','.more-objectives',function(e){
        e.preventDefault();
        $(".objective_loading").show();
        var page = $(this).data('url').split('page=')[1];
        var from_page = $(this).data('from_page');
        var unit_id = $(this).data('unit_id');
        if($.trim(unit_id) == "")
            unit_id = 'none';
        if($.trim(from_page) == "" || from_page != "unit_view")
            from_page = "main_page";
        $(this).parents(".loading_content_hide").css('opacity','0.5');
        getObjectives(page,unit_id,from_page);
        return false;
    });

    //load more units
    $(document).off("click",".more-tasks").on('click','.more-tasks',function(e){
        e.preventDefault();
        $(".task_loading").show();
        var page = $(this).data('url').split('page=')[1];
        var from_page = $(this).data('from_page');
        var unit_id = $(this).data('unit_id');
        var objective_id =$(this).data('objective_id');
        if($.trim(unit_id) == "")
            unit_id = 'none';
        if($.trim(objective_id) == "")
            objective_id = 'none';
        if($.trim(from_page) == "" || from_page != "unit_view")
            from_page = "main_page";
        $(this).parents(".loading_content_hide").css('opacity','0.5');
        getTasks(page,unit_id,objective_id,from_page);
        return false;
    });

    $(document).off("click",".more-skills").on('click','.more-skills',function(e){
        e.preventDefault();
        $(".skill_loading").show();
        var page = $(this).data('url').split('page=')[1];
        $(this).parents(".loading_content_hide").css('opacity','0.5');
        $.ajax({
            type:'get',
            url:siteURL+'/skills/get_skill_paginate',
            data:{page:page},
            success:function(resp){
                $(".skill-table tbody tr:last-child").remove();
                $(".skill-table tbody").append(resp.html);
                $(".skill_loading").hide();
                $(".loading_content_hide").css('opacity','1');
            }
        });
        return false;
    });
    $(document).off("click",".more-area-of-interest").on('click','.more-area-of-interest',function(e){
        e.preventDefault();
        $(".area_of_interest_loading").show();
        var page = $(this).data('url').split('page=')[1];
        $(this).parents(".loading_content_hide").css('opacity','0.5');
        $.ajax({
            type:'get',
            url:siteURL+'/area_of_interest/get_area_of_interest_paginate',
            data:{page:page},
            success:function(resp){
                $(".area_of_interest-table tbody tr:last-child").remove();
                $(".area_of_interest-table tbody").append(resp.html);
                $(".area_of_interest_loading").hide();
                $(".loading_content_hide").css('opacity','1');
            }
        });
        return false;
    });
    $(document).off("click",".more-category").on('click','.more-category',function(e){
        e.preventDefault();
        $(".category_loading").show();
        var page = $(this).data('url').split('page=')[1];
        $(this).parents(".loading_content_hide").css('opacity','0.5');
        $.ajax({
            type:'get',
            url:siteURL+'/category/get_category_paginate',
            data:{page:page},
            success:function(resp){
                $(".category-table tbody tr:last-child").remove();
                $(".category-table tbody").append(resp.html);
                $(".category_loading").hide();
                $(".loading_content_hide").css('opacity','1');
            }
        });
        return false;
    });

    //Global Search Form
    $('#form-global-search').submit(function() {
        $(this).find("[name='search_term']").val($.trim($(this).find("[name='search_term']").val()));
    });

    //add item to watchlist
    var flag = false;
    $(".add_to_my_watchlist").on('click',function(){
        var type=$(this).data('type');
        var id = $(this).data('id');
        var url_redirect = $(this).data('redirect');

        toastr.options = {
            "closeButton": true,
            "debug": false,
            "positionClass": "toast-top-right",
            "onclick": null,
            "showDuration": "1000",
            "hideDuration": "1000",
            "timeOut": "5000",
            "extendedTimeOut": "1000",
            "showEasing": "swing",
            "hideEasing": "linear",
            "showMethod": "fadeIn",
            "hideMethod": "fadeOut"
        };

        if(!flag && !$('#toast-container').length) {
            flag = true;
            if ($.trim(type) != "" && $.trim(id) != '') {
                $.ajax({
                    type: 'get',
                    url: siteURL + '/add_to_watchlist',
                    data: {type: type, id: id, sessionUrl: url_redirect},
                    dataType: 'json',
                    success: function (resp) {
                        flag = false;
                        if (!resp.success) {
                            if(resp.msg == 'Please login to continue.'){
                                window.location.href = siteURL + '/login';
                            }else{
                                toastr['error'](resp.msg, '');
                            }
                        } else {
                            toastr['success'](resp.msg, '');
                        }
                    },
                    error: function (error) {
                    }
                })
            }
        }
    });

    var widget;
    var onloadCallbackRecaptcha = function() {
        var myinto = setInterval(function(){
            var elementExists = document.getElementById("gcaptcha");
            if ( $('#gcaptcha').length ) {
                widget = grecaptcha.render(document.getElementById('gcaptcha'), {
                    'sitekey' : '6LfDyawUAAAAAIeiKY1kIW8hs0e52tAcmV3Gk0id',
                    'callback' : correctCaptcha
                });
                $("button[data-bb-handler='success']").attr("disabled", true);
                var captchaResponse = grecaptcha.getResponse();
                clearInterval(myinto);
            }
        }, 1000);
    };

    var correctCaptcha = function(response) {
        $("button[data-bb-handler='success']").attr("disabled", false);
    };

    $(".report").click(function(){
        var captchaResponse = "";
        var visited_url = window.location.href;
        $(".div-table-second-cell").css('z-index','100');
        $(".list-item-main").css('z-index','100');

        var html = '<form class="form-horizontal" role="form" method="post" action="javascript:grecaptcha.reset(widget);">'+
            '
'+
            'Visited URL'+
            '
'+
            '<input type="text" class="form-control" disabled  id="url" name="url" value="'+visited_url+'">'+
            '
'+
            '
'+
            '
'+
            'Message'+
            '
'+
            '<textarea class="form-control" id="message" rows="4" name="message" placeholder="Write your message here.">'+
            '</textarea>'+
            '
'+
            '
';

        if($.trim(login) == ""){
            html+= '
'+
                '
'+
                '

'+
                '
'+
                '
'+
                '</form>';
            onloadCallbackRecaptcha();
            var captcha_intval = setInterval(function(){
                captchaResponse = grecaptcha.getResponse();
            }, 1000);
        }else{
             captchaResponse = "";
        }

        var bootbox_dialog=bootbox.dialog({
            title: 'Report a Concern

Your message will be sent to the Javul.org administrator.',
            message:html,
            buttons: {
                success: {
                    label: "Submit",
                    className: 'btn-success',
                    callback: function () {
                        clearInterval(captcha_intval);
                        $(".errors").html('');
                        var captcha_value = captchaResponse;
                        var visit_url = $('#url').val();
                        var message = $('#message').val();
                        $.ajax({
                            type: 'post',
                            url: siteURL + '/reportconc',
                            dataType: 'json',
                            data: {
                                _token: report_concern_token,
                                visit_url: visit_url,
                                message: message,
                                captcha_value: captcha_value
                            },
                            success: function (response) {
                                if (!response.success) {
                                    console.log(response);
                                    $.each(response.errors, function (index, value) {
                                        $("[id='" + index + "_error']").html(value);
                                    });

                                    if(response.errors.message = 'The message field is required.' && response.auth_check.message == 0){
                                        grecaptcha.reset();
                                    }

                                } else {
                                    showToastMessage('THANK_YOU_YOUR_MESSAGE_WAS_SENT_TO_JAVUL');
                                    captcha_code = response.captcha_value;
                                    bootbox.hideAll();
                                }
                            },
                            error: function ($err) {
                                console.log($err);
                            }
                        });
                        return false;
                    }
                }
                },
                cancel:{
                    label:'Cancel',
                    className:'btn-danger'
                }
        });

        bootbox_dialog.on("hidden.bs.modal", function (e) {
            $.ajax({
                type:'get',
                url:siteURL+'/close_report',
                dataType:'json',
                success:function(response){
                    captcha_code=response.captcha_value;
                }
            });
        });

        bootbox_dialog.modal('show');
    });
});

function check_assigned_task(){
    $.ajax({
        type:'get',
        url:siteURL+'/tasks/check_assigned_task',
        dataType:'json',
        success:function(resp){
            if(resp.success){
                if($(".confirmation_box_"+resp.task_id).length == 0){
                    $(".content > .container").prepend('

'+resp.html+'

');
                }
                /*bootbox.dialog({
                    message: resp.html,
                    title: resp.title,
                    buttons: {
                        success: {
                            label: resp.ok,
                            className: "btn-success",
                            callback: function() {
                                accept_reject_offer(resp.task_id,'/tasks/accept_offer');
                            }
                        },
                        danger: {
                            label: resp.cancel,
                            className: "btn-danger",
                            callback: function() {
                                accept_reject_offer(resp.task_id,'/tasks/reject_offer');
                            }
                        }
                    }
                });*/
            }else
            {
                setTimeout(function(){
                    check_assigned_task();
                },15000)
            }
        }
    })
}

function accept_reject_offer(task_id,url){
    $.ajax({
        type:'get',
        url:siteURL+url,
        data:{task_id:task_id},
        dataType:'json',
        success:function(resp){
            $(".close").trigger('click');
            setTimeout(function(){
                check_assigned_task();
            },15000)
        }
    });
}

function getUnitActivity(page,unit_id){

    $.ajax({
        type:'get',
        url:siteURL+'/get_unit_site_activity_paginate',
        data:{page:page,unit_id:unit_id},
        success:function(resp){
            $(".site_activity_list .panel-body").find(".more-btn").remove();
            $(".site_activity_list .panel-body").append(resp.html);
            $(".site_activity_loading").hide();
            $(".loading_content_hide").css('opacity','1');
        }
    });
}

function getSiteActivity(page){
    $.ajax({
        type:'get',
        url:siteURL+'/get_site_activity_paginate',
        data:{page:page},
        success:function(resp){
            $(".site_activity_list .panel-body").find(".more-btn").remove();
            $(".site_activity_list .panel-body").find('.last-site-activity').remove();

            $(".site_activity_list .panel-body").append(resp.html);
            $(".site_activity_loading").hide();
            $(".loading_content_hide").css('opacity','1');

            $(".site_activity_list .panel-body").find('span.tooltipster').each(function(){
                if(!$(this).hasClass('tooltipstered')){
                    $(this).tooltipster({
                        position: 'right'
                    });
                }
            });

        }
    });
}

function getGlobalSiteActivity(page,from_page){
    $.ajax({
        type:'get',
        url:siteURL+'/get_site_activity_paginate',
        data:{page:page,from_page:from_page},
        success:function(resp){
            $(".site_activity_list .panel-body").find(".more-btn").remove();
            $(".site_activity_list .panel-body").find('.last-site-activity').remove();
            $(".site_activity_list .panel-body").append(resp.html);
            $(".site_activity_loading").hide();
            $(".loading_content_hide").css('opacity','1');

            $(".site_activity_list .panel-body").find('span.tooltipster').each(function(){
                if(!$(this).hasClass('tooltipstered')){
                    $(this).tooltipster({
                        position: 'right'
                    });
                }
            });
        }
    });
}

function getUnits(page){
    $.ajax({
        type:'get',
        url:siteURL+'/units/get_units_paginate',
        data:{page:page},
        success:function(resp){
            $(".unit-table tbody tr:last-child").remove();
            $(".unit-table tbody").append(resp.html);
            $(".unit_loading").hide();
            $(".loading_content_hide").css('opacity','1');
        }
    });
}

function getIssues(page){
    $.ajax({
        type:'get',
        url:siteURL+'/issues/get_issues_paginate',
        data:{page:page},
        success:function(resp){
            $(".unit-table tbody tr:last-child").remove();
            $(".unit-table tbody").append(resp.html);
            $(".unit_loading").hide();
            $(".loading_content_hide").css('opacity','1');
        }
    });
}

function getObjectives(page,unit_id,from_page){
    $.ajax({
        type:'get',
        url:siteURL+'/objectives/get_objectives_paginate',
        data:{page:page,from_page:from_page,unit_id:unit_id},
        success:function(resp){
            $(".objective-table tbody tr:last-child").remove();
            $(".objective-table tbody").append(resp.html);
            $(".objective_loading").hide();
            $(".loading_content_hide").css('opacity','1');
        }
    });
}

function getTasks(page,unit_id,objective_id,from_page){
    $.ajax({
        type:'get',
        url:siteURL+'/tasks/get_tasks_paginate',
        data:{page:page,from_page:from_page,unit_id:unit_id,objective_id:objective_id},
        success:function(resp){
            $(".tasks-table tbody tr:last-child").remove();
            $(".tasks-table tbody").append(resp.html);
            $(".task_loading").hide();
            $(".loading_content_hide").css('opacity','1');
        }
    });
}


text:
CREATE TABLE IF NOT EXISTS `Leaderboard` (
  `idLeaderboard` INT NOT NULL,
  `username` VARCHAR(45) NULL,
  `score` VARCHAR(45) NULL
) ENGINE = InnoDB;


text:
package org.zeroturnaround;

import org.apache.log4j.Logger;
import org.zeroturnaround.util.ExecUtil;

public class Settings {
  private static final Logger log = Logger.getLogger(Settings.class.getName());

  private static String openSSLExec;
  private static String openSSLVer;

  public static String getOpenSSLExec() {
    if (openSSLExec == null) {
      initSSL();
    }
    return openSSLExec;
  }

  public static String getOpenSSLVer() {
    if (openSSLVer == null) {
      initSSL();
    }
    return openSSLVer;
  }

  private static void initSSL() {
    String line = "which openssl";
    openSSLExec = ExecUtil.exec(line);
    if (openSSLExec == null) {
      throw new RuntimeException("Unable to find OpenSSL");
    }

    openSSLVer = ExecUtil.exec("openssl version").replace("OpenSSL ", "");
  }
}


text:
//
//  PhotoBoardViewController.m
//  HomeWork08
//
//  Created by morplcp on 15/10/9.
//  Copyright (c) 2015年 MyOClesson.com. All rights reserved.
//

#import "PhotoBoardViewController.h"
#import "PhotoBoardScrollView.h"
@interface PhotoBoardViewController ()<UIScrollViewDelegate>

@property(nonatomic, retain) PhotoBoardScrollView *photoBoardView;
@property(nonatomic, retain) UIPageControl *pageControl;

@end

@implementation PhotoBoardViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    MMMaterialDesignSpinner *sp = [[MMMaterialDesignSpinner alloc] initWithFrame:CGRectMake((kWindowWidth - 80) / 2.0, kWindowHeight / 2.0 - 40, 80, 80)];
    sp.lineWidth = 2.0;
    sp.tintColor = [UIColor cyanColor];
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [sp startAnimating];
        [self.view addSubview:sp];
        [self loadPhotoBoard];
        [self loadPageControl];
    });
}

// 加载相册
- (void)loadPhotoBoard{
    self.view.backgroundColor = [UIColor grayColor];
    self.photoBoardView = [[PhotoBoardScrollView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dismisVC:)];
    [self.view addGestureRecognizer:tap];
    _photoBoardView.delegate = self;
    [_photoBoardView setImgArray:[self loadImageArray]];
    [self setOffset:_photoBoardView];
    [self.view addSubview:_photoBoardView];
    [self.photoBoardView.imgArray[self.currentPhoto] sd_setImageWithURL:self.imgArray[self.currentPhoto]];
}

- (void)dismisVC:(UIGestureRecognizer *)tap{
    [self dismissViewControllerAnimated:YES completion:nil];
}

// 加载图片数组
- (NSArray *)loadImageArray{
    NSMutableArray *photoArray = [NSMutableArray array];
    for (int i = 0; i < self.imgArray.count; i++) {
        UIImageView *imgView = [[UIImageView alloc] init];
        imgView.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);
         imgView.contentMode = UIViewContentModeScaleAspectFit;
        [photoArray addObject:imgView];
    }
    return photoArray;
}
// 设置偏移量
- (void)setOffset:(UIScrollView *)sender{
    sender.contentOffset = CGPointMake(self.view.frame.size.width * self.currentPhoto, 0);
}
// 加载PageControl
- (void)loadPageControl{
    self.pageControl = [[UIPageControl alloc] initWithFrame:CGRectMake((self.view.frame.size.width - 200) / 2.0, (self.view.frame.size.height - 100), 200, 30)];
    _pageControl.numberOfPages = self.imgArray.count;
    _pageControl.currentPage = _currentPhoto;
    _pageControl.pageIndicatorTintColor = [UIColor whiteColor];
    _pageControl.currentPageIndicatorTintColor = [UIColor blackColor];
    [self.view addSubview:_pageControl];
}

// 减速结束后将拖拽前缩放过的图片还原
- (void)scrollViewDidEndDecelerating:(PhotoBoardScrollView *)scrollView{
    _pageControl.currentPage = _photoBoardView.contentOffset.x / self.view.frame.size.width;
    [self.photoBoardView.imgArray[_pageControl.currentPage] sd_setImageWithURL:self.imgArray[_pageControl.currentPage]];
    // 将所有图片缩放比例置为1
    for (PhotoScrollView *psc in _photoBoardView.photoScrollArray) {
        [psc setZoomScale:1];
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end


text:
require "timeout"
require ::File.expand_path('file_asset', File.dirname(__FILE__))
require ::File.expand_path('pretty_formatter', File.dirname(__FILE__))
require ::File.expand_path('report_table', File.dirname(__FILE__))
# require ::File.expand_path('configuration', File.dirname(__FILE__))

module Cornucopia
  module Util
    class ReportBuilder
      @@current_report  = nil
      @@on_close_blocks = []

      MAX_OLD_FOLDERS = 5

      class TestDataHolder
      end

      class << self
        def current_report(folder_name = nil, parent_folder = nil)
          if (@@current_report &&
              ((parent_folder && @@current_report.instance_variable_get(:@parent_folder_name) != parent_folder) ||
                  (folder_name && @@current_report.instance_variable_get(:@base_folder_name) != folder_name)))
            @@current_report.close
            @@current_report = nil
          end

          folder_name   ||= Cornucopia::Util::Configuration.base_folder
          parent_folder ||= Cornucopia::Util::Configuration.base_folder

          @@current_report ||= Cornucopia::Util::ReportBuilder.new(folder_name, parent_folder)
        end

        def new_report(folder_name = nil, parent_folder = nil)
          if (@@current_report)
            @@current_report.close
            @@current_report = nil
          end

          @@current_report = Cornucopia::Util::ReportBuilder.new(folder_name, parent_folder)
        end

        def escape_string(value)
          value = value.to_s
          value = value + "" if value.frozen?
          "".html_safe + value.force_encoding("UTF-8")
        end

        def format_code_refs(value)
          safe_text = Cornucopia::Util::ReportBuilder.escape_string(value)

          safe_text = safe_text.gsub(/(#{Cornucopia::Util::ReportBuilder.root_folder}|\.\/|(?=(?:^features|^spec)\/))([^\:\r\n &]*(?: *\: *[0-9]+)?)/,
                                     "\\1 \\2 ").html_safe

          safe_text
        end

        def pretty_array(array, format_sub_items = true)
          if (array.is_a?(Array))
            array.map do |value|
              # This is not expected to be called on an array of arrays,
              # block this and just convert sub-arrays to strings.
              format_value = value
              format_value = value.to_s if value.is_a?(Array)

              if format_sub_items
                Cornucopia::Util::ReportBuilder.pretty_format(format_value, in_pretty_print: true).rstrip
              else
                # "".html_safe + format_value
                format_value
              end
            end.join("\n").html_safe
          else
            Cornucopia::Util::ReportBuilder.pretty_format(array)
          end
        end

        # I've seen some objects with pretty_inspect get stuck in an infinite loop (or close to it),
        # so they take literally hours to print.  This function uses Timeout to prevent this.
        # either the class prints quickly, or we kill it and try something else.
        #
        # If the something else doesn't work, we just give up...
        def pretty_object(value, options = {})
          timed_out    = false
          return_value = nil

          begin
            begin
              timeout_length = Cornucopia::Util::Configuration.print_timeout_min
              if Object.const_defined?("Capybara")
                default_time = ::Capybara.respond_to?(:default_max_wait_time) ? ::Capybara.default_max_wait_time : ::Capybara.default_wait_time
                timeout_length = [timeout_length, default_time].max
              end
              if Object.const_defined?("Rails")
                timeout_length = [timeout_length, 30].max if Rails.env.development?
              end

              Timeout::timeout(timeout_length) do
                if value.is_a?(String)
                  return_value = value
                elsif value.is_a?(Array)
                  return_value = Cornucopia::Util::ReportBuilder.pretty_array(value, !options[:in_pretty_print])
                elsif value.respond_to?(:pretty_inspect)
                  return_value = value.pretty_inspect
                else
                  return_value = value.to_s
                end
              end
            rescue Timeout::Error
              timed_out = true
            end
          rescue Exception
          end

          # If it timed out or threw an exception, try .to_s
          # That may also timeout or throw an exception, and if it does, give up.
          if timed_out || !return_value
            begin
              Timeout::timeout(timeout_length) do
                return_value = value.to_s
              end
            rescue Timeout::Error
              return_value = "Timed out rendering"
            rescue => error
              return_value = "Rendering error => #{error.to_s}\n#{error.backtrace.join("\n")}"
            end
          end

          return_value
        end

        def pretty_format(value, options = {})
          pretty_text = value

          pretty_text = Cornucopia::Util::ReportBuilder.pretty_object(pretty_text, options)
          pretty_text = Cornucopia::Util::ReportBuilder.escape_string(pretty_text)
          pretty_text = Cornucopia::Util::PrettyFormatter.format_string(pretty_text)
          pretty_text = Cornucopia::Util::ReportBuilder.format_code_refs(pretty_text)

          pretty_text
        end

        def build_index_section_item(path_name)
          item_path = "".html_safe

          item_path << "
\n".html_safe
          item_path << "    ".html_safe
          item_path << File.dirname(path_name)
          item_path << "\n".html_safe
          item_path << "
\n".html_safe

          item_path
        end

        def build_index_section(section_name, section_items)
          section = "".html_safe

          section << "
".html_safe
          section << "
".html_safe
          section << section_name
          section << "
\n".html_safe
          section << "
\n".html_safe

          section << Cornucopia::Util::ReportBuilder.build_index_section_item(section_items.shift)
          section_items.reverse.each do |section_item|
            section << Cornucopia::Util::ReportBuilder.build_index_section_item(section_item)
          end

          section << "
\n".html_safe
          section << "
\n".html_safe

          section
        end

        def folder_name_to_section_name(folder_name)
          case File.basename(folder_name)
            when Cornucopia::Util::Configuration.base_folder
              "Feature Tests"
            when "diagnostics_rspec_report"
              "RSPEC Tests"
            else
              File.basename(folder_name)
          end
        end

        def root_folder
          if Object.const_defined?("Rails")
            Rails.root
          else
            FileUtils.pwd
          end
        end

        def page_dump(page_html)
          "<textarea class=\"cornucopia-page-dump\">#{Cornucopia::Util::ReportBuilder.escape_string(page_html)}</textarea>\n".html_safe
        end

        def on_close(&block)
          @@on_close_blocks << block
        end
      end

      def initialize(folder_name = nil, parent_folder = nil)
        @parent_folder_name      = parent_folder || Cornucopia::Util::Configuration.base_folder
        @base_folder_name        = folder_name || Cornucopia::Util::Configuration.base_folder
        @report_title            = folder_name || Cornucopia::Util::Configuration.base_folder
        @test_name               = "unknown_test"
        @section_number          = 0
        @test_number             = 0
        @report_body             = "".html_safe
        @report_folder_name      = nil
        @index_folder_name       = nil
        @report_test_folder_name = nil
        @test_list_item          = nil
      end

      # This does nothing in a normal report because reports are built as you go.
      # If nothing has been reported though, this will create a report indicating that
      # nothing happened.
      def close
        exceptions = []

        if @@on_close_blocks
          @@on_close_blocks.each do |on_close_block|
            begin
              on_close_block.yield
            rescue
              exceptions << $!
            end
          end
        end

        if File.exist?(report_base_page_name)
          if Cornucopia::Util::Configuration.backup_logs_on_failure
            backup_log_files
          end

          if Cornucopia::Util::Configuration.open_report_after_generation(@base_folder_name)
            # `open #{report_base_page_name}` rescue nil
            system("open #{report_base_page_name}") rescue nil
          end
        else
          open_report_contents_file do |write_file|
            write_file.write %Q[
No Errors to report
]
            write_file.write "\n"
          end
        end

        if self == @@current_report
          @@current_report = nil
        end

        exceptions.each do |exception|
          raise exception
        end
      end

      def report_folder_name
        unless @report_folder_name
          @report_folder_name = File.join(index_folder_name, "#{@base_folder_name}/")

          backup_report_folder
          delete_old_folders
        end

        @report_folder_name
      end

      def report_test_folder_name
        unless @report_test_folder_name
          @test_number             += 1
          @report_test_folder_name = File.join(report_folder_name, "test_#{@test_number}")
        end

        @report_test_folder_name
      end

      def index_folder_name
        unless @index_folder_name
          @index_folder_name = File.join(Cornucopia::Util::ReportBuilder.root_folder, "#{@parent_folder_name}/")

          FileUtils.mkdir_p @index_folder_name
        end

        @index_folder_name
      end

      def backup_report_folder
        if Dir.exist?(@report_folder_name)
          if File.exist?(File.join(@report_folder_name, "index.html"))
            update_time = File.ctime(File.join(@report_folder_name, "index.html"))
          else
            update_time = File.ctime(@report_folder_name)
          end

          # ensure the name is unique...
          new_sub_dir = File.join(index_folder_name, "#{@base_folder_name}_#{update_time.strftime("%Y_%m_%d_%H_%M_%S")}").to_s
          index       = 0
          while Dir.exist?(new_sub_dir)
            if new_sub_dir[-1 * "_alt_#{index}".length..-1] == "_alt_#{index}"
              new_sub_dir = new_sub_dir[0..-1 * "_alt_#{index}".length - 1]
            end

            index       += 1
            new_sub_dir += "_alt_#{index}"
          end

          FileUtils.mv @report_folder_name,
                       new_sub_dir
        end
      end

      def delete_old_folders
        old_directories = Dir[File.join(index_folder_name, "#{@base_folder_name}_*")].
            map { |dir| File.directory?(dir) ? dir : nil }.compact.sort

        if Array.wrap(old_directories).length > MAX_OLD_FOLDERS
          old_directories.each_with_index do |dir, index|
            break if index >= old_directories.length - MAX_OLD_FOLDERS

            FileUtils.rm_rf dir
          end
        end
      end

      def rebuild_index_page
        index_folder = index_folder_name

        FileUtils.mkdir_p index_folder_name
        FileUtils.rm_rf index_contents_page_name

        FileAsset.asset("index_base.html").create_file(File.join(index_folder, "index.html"))
        FileAsset.asset("index_contents.html").add_file(File.join(index_folder, "report_contents.html"))
        FileAsset.asset("cornucopia.css").add_file(File.join(index_folder, "cornucopia.css"))

        index_file = "".html_safe
        if File.exist?(File.join(Cornucopia::Util::ReportBuilder.root_folder, "coverage/index.html"))
          index_file << Cornucopia::Util::ReportBuilder.build_index_section("Coverage", ["../coverage/index.html"])
        end

        last_folder = nil
        group_items = []
        Dir[File.join(@index_folder_name, "*")].sort.each do |directory_item|
          if File.directory?(directory_item) && File.exist?(File.join(directory_item, "index.html"))
            directory_item = directory_item[@index_folder_name.to_s.length..-1]

            if last_folder
              if directory_item =~ /^#{last_folder}_/
                group_items << File.join(directory_item, "index.html")
              else
                unless group_items.empty?
                  index_file << Cornucopia::Util::ReportBuilder.build_index_section(
                      Cornucopia::Util::ReportBuilder.folder_name_to_section_name(last_folder), group_items)
                end

                last_folder = directory_item
                group_items = [File.join(last_folder, "index.html")]
              end
            else
              last_folder = directory_item
              group_items = [File.join(last_folder, "index.html")]
            end
          end
        end

        unless group_items.empty?
          index_file << Cornucopia::Util::ReportBuilder.build_index_section(
              Cornucopia::Util::ReportBuilder.folder_name_to_section_name(last_folder), group_items)
        end

        File.open(index_contents_page_name, "a:UTF-8") do |write_file|
          write_file << index_file
        end
      end

      def rebuild_report_holder_page
        initialize_report_files

        report_folder = report_folder_name

        FileUtils.mkdir_p report_folder_name
        FileUtils.rm_rf report_base_page_name

        report_holder_body = FileAsset.asset("report_holder.html").body
        FileAsset.asset("report.js").add_file(File.join(report_folder, "report.js"))
        FileAsset.asset("cornucopia.css").add_file(File.join(report_folder, "cornucopia.css"))

        File.open(File.join(report_folder, "index.html"), "w+") do |write_file|
          write_file << report_holder_body % { report_list: @report_body, report_title: @report_title }
        end
      end

      def report_base_page_name
        File.join(report_folder_name, "index.html")
      end

      def report_contents_page_name
        File.join(report_folder_name, "report_contents.html")
      end

      def report_test_base_page_name
        File.join(report_test_folder_name, "index.html")
      end

      def report_test_contents_page_name
        File.join(report_test_folder_name, "report_contents.html")
      end

      def index_base_page_name
        File.join(index_folder_name, "index.html")
      end

      def index_contents_page_name
        File.join(index_folder_name, "report_contents.html")
      end

      def initialize_report_files
        support_folder_name = report_folder_name

        FileUtils.mkdir_p @report_folder_name

        unless File.exist?(report_base_page_name)
          # use a different base index file.
          FileAsset.asset("report_holder.html").add_file(File.join(support_folder_name, "index.html"))
          rebuild_index_page
        end

        FileAsset.asset("report.js").add_file(File.join(support_folder_name, "report.js"))
        FileAsset.asset("cornucopia.css").add_file(File.join(support_folder_name, "cornucopia.css"))
      end

      def initialize_basic_report_files
        support_folder_name = report_folder_name

        FileUtils.mkdir_p @report_folder_name

        unless File.exist?(report_base_page_name)
          # use a different base index file.
          FileAsset.asset("report_base.html").add_file(File.join(support_folder_name, "index.html"))
          rebuild_index_page
        end

        FileAsset.asset("report_contents.html").add_file(File.join(support_folder_name, "report_contents.html"))
        FileAsset.asset("collapse.gif").add_file(File.join(support_folder_name, "collapse.gif"))
        FileAsset.asset("expand.gif").add_file(File.join(support_folder_name, "expand.gif"))
        FileAsset.asset("more_info.js").add_file(File.join(support_folder_name, "more_info.js"))
        FileAsset.asset("cornucopia.css").add_file(File.join(support_folder_name, "cornucopia.css"))
      end

      def body_list_item(name, path)
        body_list_item = "
\n".html_safe
        body_list_item += "".html_safe
        body_list_item += name
        body_list_item += "\n".html_safe
        body_list_item += "
\n".html_safe

        body_list_item
      end

      def test_list_item
        if @test_list_item
          nil
        else
          folder_name = File.basename(report_test_folder_name)

          @test_list_item = body_list_item(@test_name, File.join(folder_name, "index.html"))

          @test_list_item
        end
      end

      def initialize_report_test_files
        @report_body += test_list_item.to_s

        support_folder_name = report_test_folder_name

        FileUtils.mkdir_p @report_test_folder_name

        unless File.exist?(report_test_base_page_name)
          FileAsset.asset("report_base.html").add_file(File.join(support_folder_name, "index.html"))
          rebuild_report_holder_page
        end

        FileAsset.asset("report_contents.html").add_file(File.join(support_folder_name, "report_contents.html"))
        FileAsset.asset("collapse.gif").add_file(File.join(support_folder_name, "collapse.gif"))
        FileAsset.asset("expand.gif").add_file(File.join(support_folder_name, "expand.gif"))
        FileAsset.asset("more_info.js").add_file(File.join(support_folder_name, "more_info.js"))
        FileAsset.asset("cornucopia.css").add_file(File.join(support_folder_name, "cornucopia.css"))
      end

      def open_report_contents_file(&block)
        initialize_basic_report_files

        File.open(report_contents_page_name, "a:UTF-8", &block)
      end

      def open_report_test_contents_file(&block)
        initialize_report_test_files

        File.open(report_test_contents_page_name, "a:UTF-8", &block)
      end

      def test_succeeded
        if @report_test_folder_name
          FileUtils.rm_rf report_test_folder_name
          @report_body.gsub!(@test_list_item, "")

          if @report_body.blank?
            FileUtils.rm_rf report_base_page_name
            FileUtils.rm_rf File.join(report_folder_name, "report.js")
            FileUtils.rm_rf File.join(report_folder_name, "cornucopia.css")
            @report_body = "".html_safe
          else
            rebuild_report_holder_page
          end

          @test_number -= 1
        end
      end

      def start_test(stack_object, test_name)
        test_data =
            {
                orig_test_name:      @test_name,
                orig_test_folder:    @report_test_folder_name,
                orig_test_list_item: @test_list_item,
                orig_section_number: @section_number
            }

        stack_object.instance_variable_set(:@report_builder_test_start_data, test_data)

        @test_name               = test_name
        @report_test_folder_name = nil
        @test_list_item          = nil
        @section_number          = 0
      end

      def end_test(stack_object)
        test_data = stack_object.instance_variable_get(:@report_builder_test_start_data)

        @section_number          = test_data[:orig_section_number]
        @test_name               = test_data[:orig_test_name]
        @report_test_folder_name = test_data[:orig_test_folder]
        @test_list_item          = test_data[:orig_test_list_item]
      end

      def within_test(test_name, &block)
        test_data_holder = TestDataHolder.new

        begin
          start_test(test_data_holder, test_name)

          block.yield
        ensure
          end_test(test_data_holder)
        end
      end

      def within_section(section_text, &block)
        begin
          open_report_test_contents_file do |write_file|
            write_file.write "
\n"
            write_file.write "
#{Cornucopia::Util::ReportBuilder.escape_string(section_text)}
\n".
                                 dup.force_encoding("UTF-8")
          end
          block.yield self
        ensure
          open_report_test_contents_file do |write_file|
            write_file.write "
\n"
            write_file.write "
\n"
          end
        end
      end

      def within_hidden_table(options={}, &block)
        table_pre = "
\n".dup
        table_pre << "
\n"
        table_pre << "
\n"
        table_pre << "
\n"
        table_pre << "        More Details...\n"
        table_pre << "
\n"
        table_pre << "
\n"
        table_pre << "
\n"
        table_pre << "
\n"
        table_pre = table_pre.html_safe

        table_post = "
\n".dup
        table_post << "
\n"
        table_post = table_post.html_safe

        within_table(table_prefix:         table_pre,
                     table_postfix:        table_post,
                     report_table:         nil,
                     nested_table:         options.delete(:nested_table),
                     nested_table_label:   options.delete(:nested_table_label),
                     not_a_table:          table_pre,
                     suppress_blank_table: table_pre) do |outer_report_table|
          block.yield outer_report_table
        end
      end

      def within_table(options = {}, &block)
        report_table         = nil
        options_report_table = options[:report_table]

        begin
          Cornucopia::Util::ReportTable.new(options) do |table|
            report_table = table
            block.yield(report_table)
          end
        ensure
          if report_table && !options_report_table
            open_report_test_contents_file do |write_file|
              write_file.write report_table.full_table.force_encoding("UTF-8")
            end
          end
        end
      end

      def image_link(image_file_name)
        dest_file_name = unique_file_name(File.basename(image_file_name))

        FileUtils.mv image_file_name, File.join(report_test_folder_name, dest_file_name)

        "".html_safe
      end

      def page_text(page_html)
        padded_frame("<textarea class=\"cornucopia-page-dump\">#{Cornucopia::Util::ReportBuilder.escape_string(page_html)}</textarea>\n".html_safe)
      end

      def page_frame(page_html)
        dump_file_name = unique_file_name("page_dump.html")

        File.open(File.join(report_test_folder_name, dump_file_name), "w:UTF-8") do |dump_file|
          page_text = page_html.to_s
          page_text = page_text + "" if page_text.frozen?
          dump_file.write page_text.force_encoding("UTF-8")
        end

        padded_frame("\n".html_safe)
      end

      def padded_frame(padded_text)
        padded_val = "
".html_safe
        padded_val << padded_text
        padded_val << "
".html_safe
      end

      def unique_file_name(file_base_name, base_folder = nil)
        file_parts = file_base_name.split(".")
        base_name  = file_parts[0..-2].join(".")
        extension  = file_parts[-1]

        base_folder ||= report_test_folder_name

        unique_num = 1
        num_string = ""
        while File.exist?(File.join(base_folder, "#{base_name}#{num_string}.#{extension}"))
          num_string = "_#{unique_num}"
          unique_num += 1
        end

        "#{base_name}#{num_string}.#{extension}"
      end

      def unique_folder_name(folder_base_name, base_folder = nil)
        unique_num = 1
        num_string = ""

        base_folder ||= report_test_folder_name

        while File.exist?(File.join(base_folder, "#{folder_base_name}#{num_string}"))
          num_string = "_#{unique_num}"
          unique_num += 1
        end

        "#{folder_base_name}#{num_string}"
      end

      def backup_log_files
        log_folder = unique_folder_name "log_files", report_folder_name

        Cornucopia::Util::LogCapture.backup_log_files File.join(report_folder_name, log_folder)

        log_files = Dir[File.join(report_folder_name, log_folder, "**", "*")]
        log_files.each do |log_file|
          @report_body += body_list_item(File.basename(log_file), log_file[report_folder_name.length..-1])
        end

        rebuild_report_holder_page
      end
    end
  end
end


text:
<?php
namespace PHPUnitHelper\Util;

class FileUtilTest extends \PHPUnit_Framework_TestCase
{

    public function testJoin()
    {
        $expected = "/foo/bar/baz";
        $actual = FileUtil::join("/foo/", "bar", "baz");
        $this->assertEquals($expected, $actual);
    }

    public function testEnsureDirectoryExists()
    {
        $testDirParent = FileUtil::join(
            '/tmp',
            StringUtil::randomMD5String()
        );

        $testDir = FileUtil::join(
            $testDirParent,
            StringUtil::randomMD5String()
        );

        FileUtil::ensureDirectoryExists($testDir);

        $this->assertTrue(file_exists($testDir));

        rmdir($testDir);
        rmdir($testDirParent);
    }
}


text:
using System.Collections.Generic;

namespace NuDoq
{
    /// <summary>
    /// Represents the <c>code</c> documentation tag.
    /// </summary>
    /// <remarks>
    /// See http://msdn.microsoft.com/en-US/library/f8hahtxf(v=vs.80).aspx.
    /// </remarks>
    public class Code : Element
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="Code"/> class
        /// with the given content.
        /// </summary>
        public Code(string content, IDictionary<string, string> attributes)
            : base(attributes)
            => Content = content;

        /// <summary>
        /// Accepts the specified visitor.
        /// </summary>
        public override TVisitor Accept<TVisitor>(TVisitor visitor)
        {
            visitor.VisitCode(this);
            return visitor;
        }

        /// <summary>
        /// Gets the code content.
        /// </summary>
        public string Content { get; }

        /// <summary>
        /// Returns a <see cref="string" /> that represents this instance.
        /// </summary>
        public override string ToString() => "<code>" + base.ToString();
    }
}


text:
package org.jboss.weld.environment.se.test.groovy.interceptors;

import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import jakarta.interceptor.InterceptorBinding;

@Inherited
@InterceptorBinding
@Retention(RUNTIME)
@Target({ METHOD, TYPE })
public @interface Log {
}


text:
<?php

namespace PHPExiftool\Driver\Tag\DICOM;

use JMS\Serializer\Annotation\ExclusionPolicy;
use PHPExiftool\Driver\AbstractTag;

/**
 * @ExclusionPolicy("all")
 */
class GantryID extends AbstractTag
{

    protected $Id = '0018,1008';

    protected $Name = 'GantryID';

    protected $FullName = 'DICOM::Main';

    protected $GroupName = 'DICOM';

    protected $g0 = 'DICOM';

    protected $g1 = 'DICOM';

    protected $g2 = 'Image';

    protected $Type = '?';

    protected $Writable = false;

    protected $Description = 'Gantry ID';
}