text:
using Melanchall.DryWetMidi.Multimedia;
using Melanchall.DryWetMidi.Tests.Common;
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Linq;

namespace Melanchall.DryWetMidi.Tests.Multimedia
{
    [TestFixture]
    public sealed partial class PlaybackCurrentTimeWatcherTests
    {
        #region Test methods

        [Test]
        public void WatchOnlyRunningPlaybacks_SinglePlayback_NotRunning()
        {
            var eventFired = false;

            using (var watcher = GetWatcherForOnlyRunningPlaybacks())
            using (var playback = GetLongPlayback())
            {
                watcher.CurrentTimeChanged += (_, __) => eventFired = true;
                watcher.AddPlayback(playback);

                watcher.Start();
                WaitOperations.Wait(TimeSpan.FromSeconds(1));
                watcher.Stop();
            }

            Assert.IsFalse(eventFired, "Event is fired.");
        }

        [Test]
        public void WatchOnlyRunningPlaybacks_SinglePlayback_ChangedFromRunningToNotRunning()
        {
            var objects = new List<object>();
            var objectsCount = 0;

            using (var watcher = GetWatcherForOnlyRunningPlaybacks())
            using (var playback = GetLongPlayback())
            {
                watcher.CurrentTimeChanged += (_, __) => objects.Add(new object());
                watcher.AddPlayback(playback);

                playback.Start();
                watcher.Start();

                WaitOperations.Wait(TimeSpan.FromSeconds(1));
                playback.Stop();
                objectsCount = objects.Count;

                WaitOperations.Wait(TimeSpan.FromSeconds(1));
                watcher.Stop();
            }

            Assert.Greater(objectsCount, 0, "Event was not fired at all.");
            Assert.AreEqual(objectsCount, objects.Count, "Event is fired after playback stopped.");
        }

        [Test]
        public void WatchOnlyRunningPlaybacks_MultiplePlaybacks_NotRunning()
        {
            var eventFired = false;

            using (var watcher = GetWatcherForOnlyRunningPlaybacks())
            using (var playback1 = GetLongPlayback())
            using (var playback2 = GetLongPlayback())
            {
                watcher.CurrentTimeChanged += (_, __) => eventFired = true;
                watcher.AddPlayback(playback1);
                watcher.AddPlayback(playback2);

                watcher.Start();
                WaitOperations.Wait(TimeSpan.FromSeconds(1));
                watcher.Stop();
            }

            Assert.IsFalse(eventFired, "Event is fired.");
        }

        [Test]
        public void WatchOnlyRunningPlaybacks_MultiplePlaybacks_OneRunning()
        {
            var firstPlayback = true;

            using (var watcher = GetWatcherForOnlyRunningPlaybacks())
            using (var playback1 = GetLongPlayback())
            using (var playback2 = GetLongPlayback())
            {
                watcher.CurrentTimeChanged += (_, e) => firstPlayback &= e.Times.All(t => t.Playback != playback2);
                watcher.AddPlayback(playback1);
                watcher.AddPlayback(playback2);

                playback1.Start();
                watcher.Start();
                WaitOperations.Wait(TimeSpan.FromSeconds(1));
                watcher.Stop();
            }

            Assert.IsTrue(firstPlayback, "Second playback time reported.");
        }

        #endregion

        #region Private methods

        private static PlaybackCurrentTimeWatcher GetWatcherForOnlyRunningPlaybacks() =>
            new PlaybackCurrentTimeWatcher(new PlaybackCurrentTimeWatcherSettings
            {
                WatchOnlyRunningPlaybacks = true
            });

        #endregion
    }
}


text:
using System;
using NUnit.Framework;
using Streamus.Dao;
using Streamus.Domain;

namespace Streamus.Tests.PersistanceMappingTests
{
    [TestFixture]
    public class PlaylistItemMappingTest
    {
        [Test]
        public void ShouldMap()
        {
            var sessionFactory = new NHibernateConfiguration().Configure().BuildSessionFactory();

            using (var session = sessionFactory.OpenSession())
            {
                using (var transaction = session.BeginTransaction())
                {
                    var createdUser = new User {GooglePlusId = "some id?", Name = "user name"};
                    session.Save(createdUser);

                    var playlist2 = new Playlist("users second playlist")
                        {
                            User = createdUser,
                            Sequence = 200,
                        };

                    var video = new Video
                        {
                            Id = "some id",
                            Author = "video author",
                            Duration = 90,
                            HighDefinition = true,
                            Title = "my video",
                        };
                    session.Save(video);
                    var playlistItem = new PlaylistItem
                        {
                            Cid = "cid",
                            Playlist = playlist2,
                            Video = video,
                            Sequence = 300,
                            Title = "My playlist item",
                        };

                    playlist2.AddItem(playlistItem);

                    session.Save(playlist2);

                    session.Flush();
                    session.Clear();

                    var savedPlaylistItem = session.Get<PlaylistItem>(playlistItem.Id);

                    Assert.That(savedPlaylistItem.Title, Is.EqualTo("My playlist item"));
                    Assert.That(savedPlaylistItem.Id, Is.Not.EqualTo(Guid.Empty));
                    Assert.That(savedPlaylistItem.Sequence, Is.EqualTo(300));

                    Assert.That(savedPlaylistItem.Video, Is.EqualTo(playlistItem.Video));

                    transaction.Rollback();
                }
            }
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
Installing Lean and mathlib on Windows
===

**This page has moved to the
[leanprover-community website](https://leanprover-community.github.io/install/windows.html).**


text:
{% extends 'syspanel/base.html' %}
{% load i18n %}
{% block title %}Users{% endblock %}

{% block page_header %}
  {% url horizon:syspanel:users:index as refresh_link %}
  {# to make searchable false, just remove it from the include statement #}
  {% include "horizon/common/_page_header.html" with title=_("Users") refresh_link=refresh_link searchable="true" %}
{% endblock page_header %}

{% block syspanel_main %}
    {{ table.render }}
{% endblock %}


text:
require('../setup');
var postal = require('postal');
var eventChannel = postal.channel('events');
var port = 8988;
var config = {
	port: port,
	socketio: true,
	websocket: true,
	defaultUser: true,
	handleRouteErrors: true
};
var harnessFn = require('../../src/harness');

describe('Socket Management', function () {
	var harness;

	before(function () {
		harness = harnessFn(config);
		harness.addUser('usertwo', 'two', 'two', []);
		harness.start();
	});

	describe('with multiple socket clients', function () {
		var io, ws, ioC, wsC;
		var clients = [];
		var connectionSubscription;
		var closedSubscription;
		before(function (done) {
			function check() {
				if (ioC && wsC) {
					done();
				}
			}

			connectionSubscription = eventChannel.subscribe('socket.client.connected', function (client) {
				clients.push(client);
			});

			closedSubscription = eventChannel.subscribe('socket.client.closed', function (data) {
				_.remove(clients, { socket: data.socket });
			});

			io = harness.getIOClient('http://localhost:8988', { query: 'token=one', reconnection: false });
			io.once('connect', function () {
				ioC = true;
				check();
			});

			ws = harness.getWSClient('http://localhost:8988/websocket', { Authorization: 'Bearer two' });
			ws.once('connect', function (c) {
				wsC = c;
				check();
			});
		});

		it('should uniquely id clients', function () {
			var client1Id = clients[0].socket.connectionId;
			var client2Id = clients[1].socket.connectionId;

			expect(client1Id).to.exist;
			expect(client2Id).to.exist;
			client1Id.should.not.equal(client2Id);
		});

		describe('when notifying clients', function () {
			var ioMessages = [];
			var wsMessages = [];
			var onWSMessage;

			before(function (done) {
				function check() {
					if (ioMessages.length && wsMessages.length) {
						done();
					}
				}

				onWSMessage = function (msg) {
					var json = JSON.parse(msg.utf8Data);
					if (json.topic === 'broadcast') {
						wsMessages.push(json.data);
						check();
					}
				};

				wsC.on('message', onWSMessage);

				io.once('broadcast', function (msg) {
					ioMessages.push(msg);
					check();
				});

				harness.socket.notify('broadcast', { message: 'behold, an broadcast!' });
			});

			it('should send messages to all connected clients', function () {
				ioMessages.should.eql([{ message: 'behold, an broadcast!' }]);
				wsMessages.should.eql([{ message: 'behold, an broadcast!' }]);
			});
		});

		describe('when sending to a specific client', function () {
			var ioMessages = [];
			var wsMessages = [];
			var onWSMessage;

			before(function (done) {
				function check() {
					if (ioMessages.length && wsMessages.length) {
						done();
					}
				}

				onWSMessage = function (msg) {
					var json = JSON.parse(msg.utf8Data);
					if (json.topic === 'specific') {
						wsMessages.push(json.data);
						check();
					}
				};

				wsC.on('message', onWSMessage);

				io.once('specific', function (msg) {
					ioMessages.push(msg);
					check();
				});

				harness.socket.send('userone', 'specific', { message: 'sent to userone' });
				harness.socket.send('usertwo', 'specific', { message: 'sent to usertwo' });
			});

			it('should send messages to all connected clients', function () {
				ioMessages.should.eql([{ message: 'sent to userone' }]);
				wsMessages.should.eql([
					{ message: 'sent to usertwo' }
				]);
			});
		});

		describe('when closing a specific client', function () {
			var firstSocket, secondSocket;

			before(function () {
				firstSocket = clients[0].socket;
				secondSocket = clients[1].socket;

				secondSocket.close();
			});

			it('should remove just the given client', function () {
				clients.should.eql([{ socket: firstSocket }]);
			});

			it('should remove the closed client from its lookup', function () {
				Object.keys(harness.socket.clients.lookup).should.eql([firstSocket.user.name]);
			});
		});

		after(function () {
			connectionSubscription.unsubscribe();
			closedSubscription.unsubscribe();
		});
	});

	after(function () {
		harness.stop();
	});
});


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>ObjectMetadata (AWS SDK for Java - 1.10.27)</title>
<meta name="date" content="2015-10-15">
<link rel="stylesheet" type="text/css" href="../../../../../JavaDoc.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Index

Help

        <link id="syntaxhighlight_css_core" rel="stylesheet" type="text/css" href = "http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/resources/syntaxhighlight/styles/shCoreDefault.css"/>
        <link id="syntaxhighlight_css_theme" rel="stylesheet" type="text/css" href = "http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/resources/syntaxhighlight/styles/shThemeDefault.css"/>

              Search

            <form id="nav-search-form" target="_parent" method="get" action="http://docs.aws.amazon.com/search/doc-search.html#facet_doc_guide=API+Reference&facet_doc_product=AWS+SDK+for+Java">

                    <input id="nav-searchfield" name="searchQuery">

                <input alt="" id="nav-search-button-inner" type="image">

              <input name="searchPath" type="hidden" value="documentation-guide" />
              <input name="this_doc_product" type="hidden" value="AWS SDK for Java" />
              <input name="this_doc_guide" type="hidden" value="API Reference" />
              <input name="doc_locale" type="hidden" value="en_us" />
            </form>

Did this page help you?

                  Yes
            No
            Tell us about it...

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

com.amazonaws.services.s3.model

Class ObjectMetadata

java.lang.Object

com.amazonaws.services.s3.model.ObjectMetadata

All Implemented Interfaces:

com.amazonaws.services.s3.internal.ObjectExpirationResult, com.amazonaws.services.s3.internal.ObjectRestoreResult, com.amazonaws.services.s3.internal.ServerSideEncryptionResult, java.lang.Cloneable

public class ObjectMetadata
extends java.lang.Object
implements com.amazonaws.services.s3.internal.ServerSideEncryptionResult, com.amazonaws.services.s3.internal.ObjectExpirationResult, com.amazonaws.services.s3.internal.ObjectRestoreResult, java.lang.Cloneable

Represents the object metadata that is stored with Amazon S3. This includes custom
 user-supplied metadata, as well as the standard HTTP headers that Amazon S3
 sends and receives (Content-Length, ETag, Content-MD5, etc.).

Field Summary

Fields

Modifier and Type
Field and Description

static java.lang.String
AES_256_SERVER_SIDE_ENCRYPTION

Constructor Summary

Constructors

Constructor and Description

ObjectMetadata()

Method Summary

Methods

Modifier and Type
Method and Description

void
addUserMetadata(java.lang.String key,
               java.lang.String value)

 Adds the key value pair of custom user-metadata for the associated
 object.

ObjectMetadata
clone()

Returns a clone of this ObjectMetadata.

java.lang.String
getCacheControl()

 Gets the optional Cache-Control HTTP header which allows the user to
 specify caching behavior along the HTTP request/reply chain.

java.lang.String
getContentDisposition()

 Gets the optional Content-Disposition HTTP header, which specifies
 presentation information for the object such as the recommended filename
 for the object to be saved as.

java.lang.String
getContentEncoding()

 Gets the optional Content-Encoding HTTP header specifying what
 content encodings have been applied to the object and what decoding
 mechanisms must be applied in order to obtain the media-type referenced
 by the Content-Type field.

long
getContentLength()

 Gets the Content-Length HTTP header indicating the size of the
 associated object in bytes.

java.lang.String
getContentMD5()

 Gets the base64 encoded 128-bit MD5 digest of the associated object
 (content - not including headers) according to RFC 1864.

java.lang.String
getContentType()

 Gets the Content-Type HTTP header, which indicates the type of content
 stored in the associated object.

java.lang.String
getETag()

Gets the hex encoded 128-bit MD5 digest of the associated object
 according to RFC 1864.

java.util.Date
getExpirationTime()

Returns the time this object will expire and be completely removed from
 S3.

java.lang.String
getExpirationTimeRuleId()

Returns the BucketLifecycleConfiguration rule ID for this
 object's expiration, or null if it doesn't expire.

java.util.Date
getHttpExpiresDate()

Returns the date when the object is no longer cacheable.

long
getInstanceLength()

Returns the physical length of the entire object stored in S3.

java.util.Date
getLastModified()

Gets the value of the Last-Modified header, indicating the date
 and time at which Amazon S3 last recorded a modification to the
 associated object.

java.lang.Boolean
getOngoingRestore()

Returns the boolean value which indicates whether there is ongoing restore request.

java.util.Map<java.lang.String,java.lang.Object>
getRawMetadata()

For internal use only.

java.lang.Object
getRawMetadataValue(java.lang.String key)

For internal use only.

java.util.Date
getRestoreExpirationTime()

Returns the time at which an object that has been temporarily restored
 from Amazon Glacier will expire, and will need to be restored again in
 order to be accessed.

java.lang.String
getServerSideEncryption()

Deprecated.

Replaced by getSSEAlgorithm()

java.lang.String
getSSEAlgorithm()

Returns the server-side encryption algorithm when encrypting the object
 using AWS-managed keys .

java.lang.String
getSSEAwsKmsKeyId()

Returns the AWS Key Management System key id used for Server Side
 Encryption of the Amazon S3 object.

java.lang.String
getSSECustomerAlgorithm()

Returns the server-side encryption algorithm if the object is encrypted
 using customer-provided keys.

java.lang.String
getSSECustomerKeyMd5()

Returns the base64-encoded MD5 digest of the encryption key for
 server-side encryption, if the object is encrypted using
 customer-provided keys.

java.lang.String
getStorageClass()

java.util.Map<java.lang.String,java.lang.String>
getUserMetadata()

 Gets the custom user-metadata for the associated object.

java.lang.String
getUserMetaDataOf(java.lang.String key)

Returns the value of the specified user meta datum.

java.lang.String
getVersionId()

Gets the version ID of the associated Amazon S3 object if available.

void
setCacheControl(java.lang.String cacheControl)

 Sets the optional Cache-Control HTTP header which allows the user to
 specify caching behavior along the HTTP request/reply chain.

void
setContentDisposition(java.lang.String disposition)

 Sets the optional Content-Disposition HTTP header, which specifies
 presentational information such as the recommended filename for the
 object to be saved as.

void
setContentEncoding(java.lang.String encoding)

 Sets the optional Content-Encoding HTTP header specifying what
 content encodings have been applied to the object and what decoding
 mechanisms must be applied in order to obtain the media-type referenced
 by the Content-Type field.

void
setContentLength(long contentLength)

 Sets the Content-Length HTTP header indicating the size of the
 associated object in bytes.

void
setContentMD5(java.lang.String md5Base64)

 Sets the base64 encoded 128-bit MD5 digest of the associated object
 (content - not including headers) according to RFC 1864.

void
setContentType(java.lang.String contentType)

 Sets the Content-Type HTTP header indicating the type of content
 stored in the associated object.

void
setExpirationTime(java.util.Date expirationTime)

For internal use only.

void
setExpirationTimeRuleId(java.lang.String expirationTimeRuleId)

Sets the BucketLifecycleConfiguration rule ID for this object's
 expiration

void
setHeader(java.lang.String key,
         java.lang.Object value)

For internal use only.

void
setHttpExpiresDate(java.util.Date httpExpiresDate)

Set the date when the object is no longer cacheable.

void
setLastModified(java.util.Date lastModified)

For internal use only.

void
setOngoingRestore(boolean ongoingRestore)

For internal use only.

void
setRestoreExpirationTime(java.util.Date restoreExpirationTime)

For internal use only.

void
setServerSideEncryption(java.lang.String algorithm)

Deprecated.

Replaced by setSSEAlgorithm(String)

void
setSSEAlgorithm(java.lang.String algorithm)

Sets the server-side encryption algorithm when encrypting the object
 using AWS-managed keys.

void
setSSECustomerAlgorithm(java.lang.String algorithm)

For internal use only.

void
setSSECustomerKeyMd5(java.lang.String md5Digest)

For internal use only.

void
setUserMetadata(java.util.Map<java.lang.String,java.lang.String> userMetadata)

 Sets the custom user-metadata for the associated object.

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

AES_256_SERVER_SIDE_ENCRYPTION

public static final java.lang.String AES_256_SERVER_SIDE_ENCRYPTION

Constructor Detail

ObjectMetadata

public ObjectMetadata()

Method Detail

getUserMetadata

public java.util.Map<java.lang.String,java.lang.String> getUserMetadata()

 Gets the custom user-metadata for the associated object.

 Amazon S3 can store additional metadata on objects by internally
 representing it as HTTP headers prefixed with "x-amz-meta-". Use
 user-metadata to store arbitrary metadata alongside their data in Amazon
 S3. When setting user metadata, callers should not include the
 internal "x-amz-meta-" prefix; this library will handle that for them.
 Likewise, when callers retrieve custom user-metadata, they will not see
 the "x-amz-meta-" header prefix.

 User-metadata keys are case insensitive and will be returned as
 lowercase strings, even if they were originally specified with uppercase
 strings.

 Note that user-metadata for an object is limited by the HTTP request
 header limit. All HTTP headers included in a request (including user
 metadata headers and other standard HTTP headers) must be less than 8KB.

Returns:

The custom user metadata for the associated object.

See Also:

setUserMetadata(Map),
addUserMetadata(String, String)

setUserMetadata

public void setUserMetadata(java.util.Map<java.lang.String,java.lang.String> userMetadata)

 Sets the custom user-metadata for the associated object.

 Amazon S3 can store additional metadata on objects by internally
 representing it as HTTP headers prefixed with "x-amz-meta-". Use
 user-metadata to store arbitrary metadata alongside their data in Amazon
 S3. When setting user metadata, callers should not include the
 internal "x-amz-meta-" prefix; this library will handle that for them.
 Likewise, when callers retrieve custom user-metadata, they will not see
 the "x-amz-meta-" header prefix.

 User-metadata keys are case insensitive and will be returned as
 lowercase strings, even if they were originally specified with uppercase
 strings.

 Note that user-metadata for an object is limited by the HTTP request
 header limit. All HTTP headers included in a request (including user
 metadata headers and other standard HTTP headers) must be less than 8KB.

Parameters:

userMetadata - The custom user-metadata for the associated object. Note that
            the key should not include the internal S3 HTTP header prefix.

See Also:

getUserMetadata(),
addUserMetadata(String, String)

setHeader

public void setHeader(java.lang.String key,
             java.lang.Object value)

For internal use only. Sets a specific metadata header value. Not
 intended to be called by external code.

Parameters:

key - The name of the header being set.

value - The value for the header.

addUserMetadata

public void addUserMetadata(java.lang.String key,
                   java.lang.String value)

 Adds the key value pair of custom user-metadata for the associated
 object. If the entry in the custom user-metadata map already contains the
 specified key, it will be replaced with these new contents.

 Amazon S3 can store additional metadata on objects by internally
 representing it as HTTP headers prefixed with "x-amz-meta-".
 Use user-metadata to store arbitrary metadata alongside their data in
 Amazon S3. When setting user metadata, callers should not include
 the internal "x-amz-meta-" prefix; this library will handle that for
 them. Likewise, when callers retrieve custom user-metadata, they will not
 see the "x-amz-meta-" header prefix.

 Note that user-metadata for an object is limited by the HTTP request
 header limit. All HTTP headers included in a request (including user
 metadata headers and other standard HTTP headers) must be less than 8KB.

Parameters:

key - The key for the custom user metadata entry. Note that the key
            should not include
            the internal S3 HTTP header prefix.

value - The value for the custom user-metadata entry.

See Also:

setUserMetadata(Map),
getUserMetadata()

getRawMetadata

public java.util.Map<java.lang.String,java.lang.Object> getRawMetadata()

For internal use only. Gets a map of the raw metadata/headers
 for the associated object.

Returns:

A map of the raw metadata/headers for the associated object.

getRawMetadataValue

public java.lang.Object getRawMetadataValue(java.lang.String key)

For internal use only. Returns the raw value of the metadata/headers
 for the specified key.

getLastModified

public java.util.Date getLastModified()

Gets the value of the Last-Modified header, indicating the date
 and time at which Amazon S3 last recorded a modification to the
 associated object.

Returns:

The date and time at which Amazon S3 last recorded a modification
         to the associated object. Returns null if
         the Last-Modified header hasn't been set.

setLastModified

public void setLastModified(java.util.Date lastModified)

For internal use only. Sets the Last-Modified header value
 indicating the date and time at which Amazon S3 last recorded a
 modification to the associated object.

Parameters:

lastModified - The date and time at which Amazon S3 last recorded a
            modification to the associated object.

getContentLength

public long getContentLength()

 Gets the Content-Length HTTP header indicating the size of the
 associated object in bytes.

 This field is required when uploading objects to S3, but the AWS S3 Java
 client will automatically set it when working directly with files. When
 uploading directly from a stream, set this field if
 possible. Otherwise the client must buffer the entire stream in
 order to calculate the content length before sending the data to
 Amazon S3.

 For more information on the Content-Length HTTP header, see
 http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.13

Returns:

The Content-Length HTTP header indicating the size of the
         associated object in bytes. Returns null
         if it hasn't been set yet.

See Also:

setContentLength(long)

getInstanceLength

public long getInstanceLength()

Returns the physical length of the entire object stored in S3.
 This is useful during, for example, a range get operation.

setContentLength

public void setContentLength(long contentLength)

 Sets the Content-Length HTTP header indicating the size of the
 associated object in bytes.

 This field is required when uploading objects to S3, but the AWS S3 Java
 client will automatically set it when working directly with files. When
 uploading directly from a stream, set this field if
 possible. Otherwise the client must buffer the entire stream in
 order to calculate the content length before sending the data to
 Amazon S3.

 For more information on the Content-Length HTTP header, see
 http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.13

Parameters:

contentLength - The Content-Length HTTP header indicating the size of the
            associated object in bytes.

See Also:

getContentLength()

getContentType

public java.lang.String getContentType()

 Gets the Content-Type HTTP header, which indicates the type of content
 stored in the associated object. The value of this header is a standard
 MIME type.

 When uploading files, the AWS S3 Java client will attempt to determine
 the correct content type if one hasn't been set yet. Users are
 responsible for ensuring a suitable content type is set when uploading
 streams. If no content type is provided and cannot be determined by
 the filename, the default content type, "application/octet-stream", will
 be used.

 For more information on the Content-Type header, see
 http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17

Returns:

The HTTP Content-Type header, indicating the type of content
         stored in the associated S3 object. Returns null
         if it hasn't been
         set.

See Also:

setContentType(String)

setContentType

public void setContentType(java.lang.String contentType)

 Sets the Content-Type HTTP header indicating the type of content
 stored in the associated object. The value of this header is a standard
 MIME type.

 When uploading files, the AWS S3 Java client will attempt to determine
 the correct content type if one hasn't been set yet. Users are
 responsible for ensuring a suitable content type is set when uploading
 streams. If no content type is provided and cannot be determined by
 the filename, the default content type "application/octet-stream" will
 be used.

 For more information on the Content-Type header, see
 http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17

Parameters:

contentType - The HTTP Content-Type header indicating the type of content
            stored in the associated S3 object.

See Also:

getContentType()

getContentEncoding

public java.lang.String getContentEncoding()

 Gets the optional Content-Encoding HTTP header specifying what
 content encodings have been applied to the object and what decoding
 mechanisms must be applied in order to obtain the media-type referenced
 by the Content-Type field.

 For more information on how the Content-Encoding HTTP header works, see

 http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11

Returns:

The HTTP Content-Encoding header.
 Returns null if it hasn't been set.

See Also:

setContentType(String)

setContentEncoding

public void setContentEncoding(java.lang.String encoding)

 Sets the optional Content-Encoding HTTP header specifying what
 content encodings have been applied to the object and what decoding
 mechanisms must be applied in order to obtain the media-type referenced
 by the Content-Type field.

 For more information on how the Content-Encoding HTTP header works, see

 http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11

Parameters:

encoding - The HTTP Content-Encoding header, as defined in RFC 2616.

See Also:

http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11,
getContentType()

getCacheControl

public java.lang.String getCacheControl()

 Gets the optional Cache-Control HTTP header which allows the user to
 specify caching behavior along the HTTP request/reply chain.

 For more information on how the Cache-Control HTTP header affects HTTP
 requests and responses, see
 http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9

Returns:

The HTTP Cache-Control header as defined in RFC 2616.
         Returns null  if
         it hasn't been set.

See Also:

setCacheControl(String)

setCacheControl

public void setCacheControl(java.lang.String cacheControl)

 Sets the optional Cache-Control HTTP header which allows the user to
 specify caching behavior along the HTTP request/reply chain.

 For more information on how the Cache-Control HTTP header affects HTTP
 requests and responses see
 http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9

Parameters:

cacheControl - The HTTP Cache-Control header as defined in RFC 2616.

See Also:

getCacheControl()

setContentMD5

public void setContentMD5(java.lang.String md5Base64)

 Sets the base64 encoded 128-bit MD5 digest of the associated object
 (content - not including headers) according to RFC 1864. This data is
 used as a message integrity check to verify that the data received by
 Amazon S3 is the same data that the caller sent. If set to null,then the
 MD5 digest is removed from the metadata.

 This field represents the base64 encoded 128-bit MD5 digest digest of an
 object's content as calculated on the caller's side. The ETag metadata
 field represents the hex encoded 128-bit MD5 digest as computed by Amazon
 S3.

 The AWS S3 Java client will attempt to calculate this field automatically
 when uploading files to Amazon S3.

Parameters:

md5Base64 - The base64 encoded MD5 hash of the content for the object
            associated with this metadata.

See Also:

getContentMD5()

getContentMD5

public java.lang.String getContentMD5()

 Gets the base64 encoded 128-bit MD5 digest of the associated object
 (content - not including headers) according to RFC 1864. This data is
 used as a message integrity check to verify that the data received by
 Amazon S3 is the same data that the caller sent.

 This field represents the base64 encoded 128-bit MD5 digest digest of an
 object's content as calculated on the caller's side. The ETag metadata
 field represents the hex encoded 128-bit MD5 digest as computed by Amazon
 S3.

 The AWS S3 Java client will attempt to calculate this field automatically
 when uploading files to Amazon S3.

Returns:

The base64 encoded MD5 hash of the content for the associated
         object.  Returns null if the MD5 hash of the content
         hasn't been set.

See Also:

setContentMD5(String)

setContentDisposition

public void setContentDisposition(java.lang.String disposition)

 Sets the optional Content-Disposition HTTP header, which specifies
 presentational information such as the recommended filename for the
 object to be saved as.

 For more information on how the Content-Disposition header affects HTTP
 client behavior, see
 http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.5.1

Parameters:

disposition - The value for the Content-Disposition header.

See Also:

getContentDisposition()

getContentDisposition

public java.lang.String getContentDisposition()

 Gets the optional Content-Disposition HTTP header, which specifies
 presentation information for the object such as the recommended filename
 for the object to be saved as.

 For more information on how the Content-Disposition header affects HTTP
 client behavior, see
 http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.5.1

Returns:

The value of the Content-Disposition header.
         Returns null if the Content-Disposition header
         hasn't been set.

See Also:

http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.5.1,
setCacheControl(String)

getETag

public java.lang.String getETag()

Gets the hex encoded 128-bit MD5 digest of the associated object
 according to RFC 1864. This data is used as an integrity check to verify
 that the data received by the caller is the same data that was sent by
 Amazon S3.

 This field represents the hex encoded 128-bit MD5 digest of an object's
 content as calculated by Amazon S3. The ContentMD5 field represents the
 base64 encoded 128-bit MD5 digest as calculated on the caller's side.

Returns:

The hex encoded MD5 hash of the content for the associated object
         as calculated by Amazon S3.
         Returns null if it hasn't been set yet.

getVersionId

public java.lang.String getVersionId()

Gets the version ID of the associated Amazon S3 object if available.
 Version IDs are only assigned to objects when an object is uploaded to an
 Amazon S3 bucket that has object versioning enabled.

Returns:

The version ID of the associated Amazon S3 object if available.

getSSEAlgorithm

public java.lang.String getSSEAlgorithm()

Returns the server-side encryption algorithm when encrypting the object
 using AWS-managed keys .

Specified by:

getSSEAlgorithm in interface com.amazonaws.services.s3.internal.ServerSideEncryptionResult

getServerSideEncryption

@Deprecated
public java.lang.String getServerSideEncryption()

Deprecated. Replaced by getSSEAlgorithm()

setSSEAlgorithm

public void setSSEAlgorithm(java.lang.String algorithm)

Sets the server-side encryption algorithm when encrypting the object
 using AWS-managed keys.

Specified by:

setSSEAlgorithm in interface com.amazonaws.services.s3.internal.ServerSideEncryptionResult

Parameters:

algorithm - The server-side encryption algorithm when encrypting the
            object using AWS-managed keys .

setServerSideEncryption

@Deprecated
public void setServerSideEncryption(java.lang.String algorithm)

Deprecated. Replaced by setSSEAlgorithm(String)

getSSECustomerAlgorithm

public java.lang.String getSSECustomerAlgorithm()

Returns the server-side encryption algorithm if the object is encrypted
 using customer-provided keys. Otherwise returns null.

Specified by:

getSSECustomerAlgorithm in interface com.amazonaws.services.s3.internal.ServerSideEncryptionResult

setSSECustomerAlgorithm

public void setSSECustomerAlgorithm(java.lang.String algorithm)

For internal use only. This method is only used to set the value in the
 object after receiving the value in a response from S3. When sending
 requests, use SSECustomerKey members in request objects.

Specified by:

setSSECustomerAlgorithm in interface com.amazonaws.services.s3.internal.ServerSideEncryptionResult

Parameters:

algorithm - The server-side encryption algorithm used when encrypting the
            object with customer-provided keys.

getSSECustomerKeyMd5

public java.lang.String getSSECustomerKeyMd5()

Returns the base64-encoded MD5 digest of the encryption key for
 server-side encryption, if the object is encrypted using
 customer-provided keys. Otherwise returns null.

Specified by:

getSSECustomerKeyMd5 in interface com.amazonaws.services.s3.internal.ServerSideEncryptionResult

setSSECustomerKeyMd5

public void setSSECustomerKeyMd5(java.lang.String md5Digest)

For internal use only. This method is only used to set the value in the
 object after receiving the value in a response from S3. When sending
 requests, use SSECustomerKey members in request objects.

Specified by:

setSSECustomerKeyMd5 in interface com.amazonaws.services.s3.internal.ServerSideEncryptionResult

Parameters:

md5Digest - The base64-encoded MD5 digest of the encryption key for
            server-side encryption.

getExpirationTime

public java.util.Date getExpirationTime()

Returns the time this object will expire and be completely removed from
 S3. Returns null if this object will never expire.

Specified by:

getExpirationTime in interface com.amazonaws.services.s3.internal.ObjectExpirationResult

setExpirationTime

public void setExpirationTime(java.util.Date expirationTime)

For internal use only. This will *not* set the object's expiration time,
 and is only used to set the value in the object after receiving the value
 in a response from S3.

Specified by:

setExpirationTime in interface com.amazonaws.services.s3.internal.ObjectExpirationResult

Parameters:

expirationTime - The expiration time for the object.

getExpirationTimeRuleId

public java.lang.String getExpirationTimeRuleId()

Returns the BucketLifecycleConfiguration rule ID for this
 object's expiration, or null if it doesn't expire.

Specified by:

getExpirationTimeRuleId in interface com.amazonaws.services.s3.internal.ObjectExpirationResult

See Also:

BucketLifecycleConfiguration.Rule.getId()

setExpirationTimeRuleId

public void setExpirationTimeRuleId(java.lang.String expirationTimeRuleId)

Sets the BucketLifecycleConfiguration rule ID for this object's
 expiration

Specified by:

setExpirationTimeRuleId in interface com.amazonaws.services.s3.internal.ObjectExpirationResult

Parameters:

expirationTimeRuleId - The rule ID for this object's expiration

getRestoreExpirationTime

public java.util.Date getRestoreExpirationTime()

Returns the time at which an object that has been temporarily restored
 from Amazon Glacier will expire, and will need to be restored again in
 order to be accessed. Returns null if this is not a temporary copy of an
 object restored from Glacier.

Specified by:

getRestoreExpirationTime in interface com.amazonaws.services.s3.internal.ObjectRestoreResult

setRestoreExpirationTime

public void setRestoreExpirationTime(java.util.Date restoreExpirationTime)

For internal use only. This will *not* set the object's restore
 expiration time, and is only used to set the value in the object after
 receiving the value in a response from S3.

Specified by:

setRestoreExpirationTime in interface com.amazonaws.services.s3.internal.ObjectRestoreResult

Parameters:

restoreExpirationTime - The new restore expiration time for the object.

setOngoingRestore

public void setOngoingRestore(boolean ongoingRestore)

For internal use only. Sets the boolean value which indicates whether
 there is ongoing restore request. Not intended to be called by external
 code.

Specified by:

setOngoingRestore in interface com.amazonaws.services.s3.internal.ObjectRestoreResult

getOngoingRestore

public java.lang.Boolean getOngoingRestore()

Returns the boolean value which indicates whether there is ongoing restore request.

Specified by:

getOngoingRestore in interface com.amazonaws.services.s3.internal.ObjectRestoreResult

setHttpExpiresDate

public void setHttpExpiresDate(java.util.Date httpExpiresDate)

Set the date when the object is no longer cacheable.

getHttpExpiresDate

public java.util.Date getHttpExpiresDate()

Returns the date when the object is no longer cacheable.

getStorageClass

public java.lang.String getStorageClass()

Returns:

The storage class of the object. Returns null if the object is in STANDARD storage.
         See StorageClass for possible values

getUserMetaDataOf

public java.lang.String getUserMetaDataOf(java.lang.String key)

Returns the value of the specified user meta datum.

clone

public ObjectMetadata clone()

Returns a clone of this ObjectMetadata. Note the clone of
 the internal metadata is limited to a shallow copy due to the
 unlimited type of value in the map. Other fields can be regarded as deep
 clone.

Overrides:

clone in class java.lang.Object

getSSEAwsKmsKeyId

public java.lang.String getSSEAwsKmsKeyId()

Returns the AWS Key Management System key id used for Server Side
 Encryption of the Amazon S3 object.

Overview

Package

Class

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

            Copyright © 2013 Amazon Web Services, Inc. All Rights Reserved.


text:
import { Template } from './Template.js';
import { removeSymbol, repeaterSymbol } from './utilities.js';

export class DirectiveNode {
  constructor(node, value, context, compiler, index) {
    this.node = node;
    this.values = value;
    this.context = context;
    this.compiler = compiler;
    this.index = index;
    this.templateMap = null;
    this.compiler.partIndicies.set(index, this);
    this.node[repeaterSymbol] = [];
    this.repeater = this.node[repeaterSymbol];
    this.group = Symbol('Group');
  }

  init() {
    this.templates = this.values.map((value, index) => {
      const [strings, values] = value;
      const { $$key } = values;
      if (this.templateMap === null) {
        if (typeof $$key !== 'string' && typeof $$key !== 'number') {
          this.templateMap = new WeakMap();
        } else {
          this.templateMap = new Map();
        }
      }
      let template;
      if (this.templateMap.has($$key)) {
        template = this.templateMap.get($$key);
        template.update(values);
      } else {
        template = new Template(strings, values, this.node, this.context, this.group, index);
        this.templateMap.set($$key, template);
      }
      this.node[this.group].set(index, template);
      this.repeater.push(...template.nodes);
      return template;
    });
  }

  update(values) {
    const newValues = values[this.index];
    const oldValues = this.values;
    this.values = newValues;
    const activeKeys = new Set(this.values.map(([, value]) => value.$$key));
    const previousKeys = new Set(oldValues.map(([, value]) => value.$$key));
    const newKeys = new Set();

    activeKeys.forEach(key => {
      previousKeys.has(key) ? null : newKeys.add(key);
    });

    previousKeys.forEach(key => {
      const template = this.templateMap.get(key);
      if (template && !activeKeys.has(key)) {
        template[removeSymbol]();
        this.templateMap.delete(key);
      }
    });
    this.init();
  }
}


text:
#include "dcmtk/config/osconfig.h"
#include "dcmtk/dcmdata/dcdeftag.h"
#include "dcmtk/dcmiod/iodutil.h"
#include "dcmtk/dcmfg/fgplanposvol.h"
#include "dcmtk/dcmfg/fgtypes.h"

// Constructor
FGPlanePositionVolume::FGPlanePositionVolume() :
  FGBase(DcmFGTypes::EFG_PLANEPOSITIONVOLUME),
  m_ImagePositionVolume(DCM_ImagePositionVolume)
{
}

FGPlanePositionVolume::~FGPlanePositionVolume()
{
  // nothing to do
}

FGBase* FGPlanePositionVolume::clone() const
{
  FGPlanePositionVolume* copy = new FGPlanePositionVolume();
  if (copy)
  {
    copy->m_ImagePositionVolume = this->m_ImagePositionVolume;
  }
  return copy;
}

void FGPlanePositionVolume::clearData()
{
  m_ImagePositionVolume.clear();
}

OFCondition FGPlanePositionVolume::check() const
{
  // TODO
  return EC_Normal;
}

// --- get() functionality ---

OFCondition FGPlanePositionVolume::getImagePositionVolume(Float64& value,
                                                          const long unsigned int pos)
{
  return m_ImagePositionVolume.getFloat64(value, pos);
}

OFCondition FGPlanePositionVolume::getImagePositionVolume(Float64& valueX,
                                                          Float64& valueY,
                                                          Float64& valueZ)
{
  OFCondition result = m_ImagePositionVolume.getFloat64(valueX, 0);
  if (result.good()) result = m_ImagePositionVolume.getFloat64(valueY, 1);
  if (result.good()) result = m_ImagePositionVolume.getFloat64(valueZ, 2);
  return result;
}

OFCondition FGPlanePositionVolume::setImagePositionVolume(const Float64& valueX,
                                                          const Float64& valueY,
                                                          const Float64& valueZ,
                                                          const OFBool checkValue)
{
  (void)checkValue;
  OFCondition result = m_ImagePositionVolume.putFloat64(valueX, 0);
  if (result.good()) result = m_ImagePositionVolume.putFloat64(valueY, 1);
  if (result.good()) result = m_ImagePositionVolume.putFloat64(valueZ, 2);
  return result;
}

OFCondition FGPlanePositionVolume::setImagePositionVolume(const Float64& value,
                                                          const long unsigned int pos,
                                                          const OFBool checkValue)
{
  // no checks
  (void)checkValue;
  if (pos > 2)
    return EC_ValueMultiplicityViolated;

  return m_ImagePositionVolume.putFloat64(value, pos);
}

/// Read Plane Position (Volume) Sequence from given item
OFCondition FGPlanePositionVolume::read(DcmItem& item)
{
  clearData();

  DcmItem* seqItem = NULL;
  OFCondition result = getItemFromFGSequence(item, DCM_PlanePositionVolumeSequence, 0, seqItem);
  if (result.bad())
    return result;

  DcmIODUtil::getAndCheckElementFromDataset(*seqItem, m_ImagePositionVolume, "3", "1", "PlanePositionVolume");

  return EC_Normal;

}

/// Writes single Plane Position (Volume) Sequence into given item
OFCondition FGPlanePositionVolume::write(DcmItem& item)
{
  DcmItem *seqItem = NULL;
  OFCondition result = createNewFGSequence(item, DCM_PlanePositionVolumeSequence, 0, seqItem);
  if (result.bad())
    return result;

  // --- write frame content macro attributes ---
  DcmIODUtil::copyElementToDataset(result, *seqItem, m_ImagePositionVolume, "3", "1", "PlanePositionVolume");
  return result;
}

int FGPlanePositionVolume::compare(const FGBase& rhs) const
{
  int result = FGBase::compare(rhs);
  if (result != 0)
    return result;

  const FGPlanePositionVolume* myRhs = OFstatic_cast(const FGPlanePositionVolume*, &rhs);

  // Compare all elements
  result = m_ImagePositionVolume.compare(myRhs->m_ImagePositionVolume);
  return result;
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Box2D: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>

Main Page

Classes

Files

Class List

Class Hierarchy

Class Members

b2ContactSolver Member List
This is the complete list of members for b2ContactSolver, including all inherited members.

b2ContactSolver(b2Contact **contacts, int32 contactCount, b2StackAllocator *allocator, float32 impulseRatio)	b2ContactSolver

m_allocator	b2ContactSolver

m_constraintCount	b2ContactSolver

m_constraints	b2ContactSolver

SolvePositionConstraints(float32 baumgarte)	b2ContactSolver

SolveVelocityConstraints()	b2ContactSolver

StoreImpulses()	b2ContactSolver

WarmStart()	b2ContactSolver

~b2ContactSolver()	b2ContactSolver

<address style="text-align: right;">Generated on Sat Apr 3 18:18:09 2010 for Box2D by

 1.6.3 </address>


text: A web server built using [Shelf](https://pub.dartlang.org/packages/shelf).


text:
package org.apache.commons.collections4.queue;

import java.util.Queue;

import org.apache.commons.collections4.collection.AbstractCollectionDecorator;

/**
 * Decorates another {@link Queue} to provide additional behavior.
 *

 * Methods are forwarded directly to the decorated queue.
 *

 *

 * This implementation does not forward the hashCode and equals methods through
 * to the backing object, but relies on Object's implementation. This is
 * necessary as some Queue implementations, e.g. LinkedList, have custom a
 * equals implementation for which symmetry can not be preserved.
 * See class javadoc of AbstractCollectionDecorator for more information.
 *

 *
 * @param <E> the type of the elements in the queue
 * @since 4.0
 */
public abstract class AbstractQueueDecorator<E> extends AbstractCollectionDecorator<E>
        implements Queue<E> {

    /** Serialization version */
    private static final long serialVersionUID = -2629815475789577029L;

    /**
     * Constructor only used in deserialization, do not use otherwise.
     */
    protected AbstractQueueDecorator() {
    }

    /**
     * Constructor that wraps (not copies).
     *
     * @param queue  the queue to decorate, must not be null
     * @throws NullPointerException if queue is null
     */
    protected AbstractQueueDecorator(final Queue<E> queue) {
        super(queue);
    }

    /**
     * Gets the queue being decorated.
     *
     * @return the decorated queue
     */
    @Override
    protected Queue<E> decorated() {
        return (Queue<E>) super.decorated();
    }

    @Override
    public boolean offer(final E obj) {
        return decorated().offer(obj);
    }

    @Override
    public E poll() {
        return decorated().poll();
    }

    @Override
    public E peek() {
        return decorated().peek();
    }

    @Override
    public E element() {
        return decorated().element();
    }

    @Override
    public E remove() {
        return decorated().remove();
    }

}


text:
using Crosschat.Client.Model.Entities;

namespace Crosschat.Client.Model
{
    public class CountriesRepository
    {
        public Country[] GetAll()
        {
            return new[]
                {
                    //see http://countrycode.org/
                    new Country(1, "United States"),
                    new Country(93, "Afghanistan"),
                    new Country(355, "Albania"),
                    new Country(213, "Algeria"),
                    new Country(1684, "American Samoa"),
                    new Country(376, "Andorra"),
                    new Country(244, "Angola"),
                    new Country(1264, "Anguilla"),
                    new Country(672, "Antarctica"),
                    new Country(1268, "Antigua and Barbuda"),
                    new Country(54, "Argentina"),
                    new Country(374, "Armenia"),
                    new Country(297, "Aruba"),
                    new Country(61, "Australia"),
                    new Country(43, "Austria"),
                    new Country(994, "Azerbaijan"),
                    new Country(1242, "Bahamas"),
                    new Country(973, "Bahrain"),
                    new Country(880, "Bangladesh"),
                    new Country(1246, "Barbados"),
                    new Country(375, "Belarus"),
                    new Country(32, "Belgium"),
                    new Country(501, "Belize"),
                    new Country(229, "Benin"),
                    new Country(1441, "Bermuda"),
                    new Country(975, "Bhutan"),
                    new Country(591, "Bolivia"),
                    new Country(387, "Bosnia and Herzegovina"),
                    new Country(267, "Botswana"),
                    new Country(55, "Brazil"),
                    new Country(1284, "British Virgin Islands"),
                    new Country(673, "Brunei"),
                    new Country(359, "Bulgaria"),
                    new Country(226, "Burkina Faso"),
                    new Country(95, "Burma (Myanmar)"),
                    new Country(257, "Burundi"),
                    new Country(855, "Cambodia"),
                    new Country(237, "Cameroon"),
                    new Country(1, "Canada"),
                    new Country(238, "Cape Verde"),
                    new Country(1345, "Cayman Islands"),
                    new Country(236, "Central African Republic"),
                    new Country(235, "Chad"),
                    new Country(56, "Chile"),
                    new Country(86, "China"),
                    new Country(61, "Christmas Island"),
                    new Country(61, "Cocos (Keeling) Islands"),
                    new Country(57, "Colombia"),
                    new Country(269, "Comoros"),
                    new Country(682, "Cook Islands"),
                    new Country(506, "Costa Rica"),
                    new Country(385, "Croatia"),
                    new Country(53, "Cuba"),
                    new Country(357, "Cyprus"),
                    new Country(420, "Czech Republic"),
                    new Country(243, "Democratic Republic of the Congo"),
                    new Country(45, "Denmark"),
                    new Country(253, "Djibouti"),
                    new Country(1767, "Dominica"),
                    new Country(1809, "Dominican Republic"),
                    new Country(593, "Ecuador"),
                    new Country(20, "Egypt"),
                    new Country(503, "El Salvador"),
                    new Country(240, "Equatorial Guinea"),
                    new Country(291, "Eritrea"),
                    new Country(372, "Estonia"),
                    new Country(251, "Ethiopia"),
                    new Country(500, "Falkland Islands"),
                    new Country(298, "Faroe Islands"),
                    new Country(679, "Fiji"),
                    new Country(358, "Finland"),
                    new Country(33, "France"),
                    new Country(689, "French Polynesia"),
                    new Country(241, "Gabon"),
                    new Country(220, "Gambia"),
                    new Country(970, "Gaza Strip"),
                    new Country(995, "Georgia"),
                    new Country(49, "Germany"),
                    new Country(233, "Ghana"),
                    new Country(350, "Gibraltar"),
                    new Country(30, "Greece"),
                    new Country(299, "Greenland"),
                    new Country(1473, "Grenada"),
                    new Country(1671, "Guam"),
                    new Country(502, "Guatemala"),
                    new Country(224, "Guinea"),
                    new Country(245, "Guinea-Bissau"),
                    new Country(592, "Guyana"),
                    new Country(509, "Haiti"),
                    new Country(39, "Holy See (Vatican City)"),
                    new Country(504, "Honduras"),
                    new Country(852, "Hong Kong"),
                    new Country(36, "Hungary"),
                    new Country(354, "Iceland"),
                    new Country(91, "India"),
                    new Country(62, "Indonesia"),
                    new Country(98, "Iran"),
                    new Country(964, "Iraq"),
                    new Country(353, "Ireland"),
                    new Country(44, "Isle of Man"),
                    new Country(972, "Israel"),
                    new Country(39, "Italy"),
                    new Country(225, "Ivory Coast"),
                    new Country(1876, "Jamaica"),
                    new Country(81, "Japan"),
                    new Country(962, "Jordan"),
                    new Country(7, "Kazakhstan"),
                    new Country(254, "Kenya"),
                    new Country(686, "Kiribati"),
                    new Country(381, "Kosovo"),
                    new Country(965, "Kuwait"),
                    new Country(996, "Kyrgyzstan"),
                    new Country(856, "Laos"),
                    new Country(371, "Latvia"),
                    new Country(961, "Lebanon"),
                    new Country(266, "Lesotho"),
                    new Country(231, "Liberia"),
                    new Country(218, "Libya"),
                    new Country(423, "Liechtenstein"),
                    new Country(370, "Lithuania"),
                    new Country(352, "Luxembourg"),
                    new Country(853, "Macau"),
                    new Country(389, "Macedonia"),
                    new Country(261, "Madagascar"),
                    new Country(265, "Malawi"),
                    new Country(60, "Malaysia"),
                    new Country(960, "Maldives"),
                    new Country(223, "Mali"),
                    new Country(356, "Malta"),
                    new Country(692, "Marshall Islands"),
                    new Country(222, "Mauritania"),
                    new Country(230, "Mauritius"),
                    new Country(262, "Mayotte"),
                    new Country(52, "Mexico"),
                    new Country(691, "Micronesia"),
                    new Country(373, "Moldova"),
                    new Country(377, "Monaco"),
                    new Country(976, "Mongolia"),
                    new Country(382, "Montenegro"),
                    new Country(1664, "Montserrat"),
                    new Country(212, "Morocco"),
                    new Country(258, "Mozambique"),
                    new Country(264, "Namibia"),
                    new Country(674, "Nauru"),
                    new Country(977, "Nepal"),
                    new Country(31, "Netherlands"),
                    new Country(599, "Netherlands Antilles"),
                    new Country(687, "New Caledonia"),
                    new Country(64, "New Zealand"),
                    new Country(505, "Nicaragua"),
                    new Country(227, "Niger"),
                    new Country(234, "Nigeria"),
                    new Country(683, "Niue"),
                    new Country(672, "Norfolk Island"),
                    new Country(850, "North Korea"),
                    new Country(1670, "Northern Mariana Islands"),
                    new Country(47, "Norway"),
                    new Country(968, "Oman"),
                    new Country(92, "Pakistan"),
                    new Country(680, "Palau"),
                    new Country(507, "Panama"),
                    new Country(675, "Papua New Guinea"),
                    new Country(595, "Paraguay"),
                    new Country(51, "Peru"),
                    new Country(63, "Philippines"),
                    new Country(870, "Pitcairn Islands"),
                    new Country(48, "Poland"),
                    new Country(351, "Portugal"),
                    new Country(1, "Puerto Rico"),
                    new Country(974, "Qatar"),
                    new Country(242, "Republic of the Congo"),
                    new Country(40, "Romania"),
                    new Country(7, "Russia"),
                    new Country(250, "Rwanda"),
                    new Country(590, "Saint Barthelemy"),
                    new Country(290, "Saint Helena"),
                    new Country(1869, "Saint Kitts and Nevis"),
                    new Country(1758, "Saint Lucia"),
                    new Country(1599, "Saint Martin"),
                    new Country(508, "Saint Pierre and Miquelon"),
                    new Country(1784, "Saint Vincent and the Grenadines"),
                    new Country(685, "Samoa"),
                    new Country(378, "San Marino"),
                    new Country(239, "Sao Tome and Principe"),
                    new Country(966, "Saudi Arabia"),
                    new Country(221, "Senegal"),
                    new Country(381, "Serbia"),
                    new Country(248, "Seychelles"),
                    new Country(232, "Sierra Leone"),
                    new Country(65, "Singapore"),
                    new Country(421, "Slovakia"),
                    new Country(386, "Slovenia"),
                    new Country(677, "Solomon Islands"),
                    new Country(252, "Somalia"),
                    new Country(27, "South Africa"),
                    new Country(82, "South Korea"),
                    new Country(34, "Spain"),
                    new Country(94, "Sri Lanka"),
                    new Country(249, "Sudan"),
                    new Country(597, "Suriname"),
                    new Country(268, "Swaziland"),
                    new Country(46, "Sweden"),
                    new Country(41, "Switzerland"),
                    new Country(963, "Syria"),
                    new Country(886, "Taiwan"),
                    new Country(992, "Tajikistan"),
                    new Country(255, "Tanzania"),
                    new Country(66, "Thailand"),
                    new Country(670, "Timor-Leste"),
                    new Country(228, "Togo"),
                    new Country(690, "Tokelau"),
                    new Country(676, "Tonga"),
                    new Country(1868, "Trinidad and Tobago"),
                    new Country(216, "Tunisia"),
                    new Country(90, "Turkey"),
                    new Country(993, "Turkmenistan"),
                    new Country(1649, "Turks and Caicos Islands"),
                    new Country(688, "Tuvalu"),
                    new Country(256, "Uganda"),
                    new Country(380, "Ukraine"),
                    new Country(971, "United Arab Emirates"),
                    new Country(44, "United Kingdom"),
                    new Country(1, "United States"),
                    new Country(598, "Uruguay"),
                    new Country(1340, "US Virgin Islands"),
                    new Country(998, "Uzbekistan"),
                    new Country(678, "Vanuatu"),
                    new Country(58, "Venezuela"),
                    new Country(84, "Vietnam"),
                    new Country(681, "Wallis and Futuna"),
                    new Country(970, "West Bank"),
                    new Country(967, "Yemen"),
                    new Country(260, "Zambia"),
                    new Country(263, "Zimbabwe"),
                };
        }
    }
}


text:
function selectYear() {
	var dropdown = document.getElementById('yearDropDown');
    var fileName = "committees_page/officers_" + dropdown.value + ".html";
    $("body").fadeOut(800, function() {
        window.open(fileName, "_self")
    });
};


text:
from django.contrib import admin

from .models import GeneralEvent, ScheduledEvent

admin.site.site_header = "echildcare"

# Register your models here.

admin.site.register(GeneralEvent)
admin.site.register(ScheduledEvent)


text:
<?php

defined('BASEPATH') or exit('No direct script access allowed');

class Authentication_model extends CRM_Model
{
    public function __construct()
    {
        parent::__construct();
        $this->load->model('user_autologin');
        $this->autologin();
    }

    /**
     * @param  string Email address for login
     * @param  string User Password
     * @param  boolean Set cookies for user if remember me is checked
     * @param  boolean Is Staff Or Client
     * @return boolean if not redirect url found, if found redirect to the url
     */
    public function login($email, $password, $remember, $staff)
    {
        if ((!empty($email)) and (!empty($password))) {
            $table = 'tblcontacts';
            $_id   = 'id';
            if ($staff == true) {
                $table = 'tblstaff';
                $_id   = 'staffid';
            }
            $this->db->where('email', $email);
            $user = $this->db->get($table)->row();
            if ($user) {
                // Email is okey lets check the password now
                $this->load->helper('phpass');
                $hasher = new PasswordHash(PHPASS_HASH_STRENGTH, PHPASS_HASH_PORTABLE);
                if (!$hasher->CheckPassword($password, $user->password)) {
                    do_action('failed_login_attempt', [
                        'user'            => $user,
                        'is_staff_member' => $staff,
                    ]);

                    logActivity('Failed Login Attempt [Email: ' . $email . ', Is Staff Member: ' . ($staff == true ? 'Yes' : 'No') . ', IP: ' . $this->input->ip_address() . ']');
                    // Password failed, return
                    return false;
                }
            } else {
                logActivity('Non Existing User Tried to Login [Email: ' . $email . ', Is Staff Member: ' . ($staff == true ? 'Yes' : 'No') . ', IP: ' . $this->input->ip_address() . ']');

                return false;
            }

            if ($user->active == 0) {
                logActivity('Inactive User Tried to Login [Email: ' . $email . ', Is Staff Member: ' . ($staff == true ? 'Yes' : 'No') . ', IP: ' . $this->input->ip_address() . ']');

                return [
                    'memberinactive' => true,
                ];
            }

            $twoFactorAuth = false;
            if ($staff == true) {
                $twoFactorAuth = $user->two_factor_auth_enabled == 0 ? false : true;

                if (!$twoFactorAuth) {
                    do_action('before_staff_login', [
                        'email'  => $email,
                        'userid' => $user->$_id,
                    ]);
                    $user_data = [
                        'staff_user_id'   => $user->$_id,
                        'staff_logged_in' => true,
                    ];
                } else {
                    $user_data = [];
                    if ($remember) {
                        $user_data['tfa_remember'] = true;
                    }
                }
            } else {
                do_action('before_client_login', [
                    'email'           => $email,
                    'userid'          => $user->userid,
                    'contact_user_id' => $user->$_id,
                ]);

                $user_data = [
                    'client_user_id'   => $user->userid,
                    'contact_user_id'  => $user->$_id,
                    'client_logged_in' => true,
                ];
            }

            $this->session->set_userdata($user_data);

            if (!$twoFactorAuth) {
                if ($remember) {
                    $this->create_autologin($user->$_id, $staff);
                }

                $this->update_login_info($user->$_id, $staff);
            } else {
                return ['two_factor_auth' => true, 'user' => $user];
            }

            return true;
        }

        return false;
    }

    /**
     * @param  boolean If Client or Staff
     * @return none
     */
    public function logout($staff = true)
    {
        $this->delete_autologin($staff);
        if (is_client_logged_in()) {
            do_action('before_client_logout', get_client_user_id());
            $this->session->unset_userdata('client_user_id');
            $this->session->unset_userdata('client_logged_in');
        } else {
            do_action('before_staff_logout', get_client_user_id());
            $this->session->unset_userdata('staff_user_id');
            $this->session->unset_userdata('staff_logged_in');
        }
        $this->session->sess_destroy();
    }

    /**
     * @param  integer ID to create autologin
     * @param  boolean Is Client or Staff
     * @return boolean
     */
    private function create_autologin($user_id, $staff)
    {
        $this->load->helper('cookie');
        $key = substr(md5(uniqid(rand() . get_cookie($this->config->item('sess_cookie_name')))), 0, 16);
        $this->user_autologin->delete($user_id, $key, $staff);
        if ($this->user_autologin->set($user_id, md5($key), $staff)) {
            set_cookie([
                'name'  => 'autologin',
                'value' => serialize([
                    'user_id' => $user_id,
                    'key'     => $key,
                ]),
                'expire' => 60 * 60 * 24 * 31 * 2, // 2 months
            ]);

            return true;
        }

        return false;
    }

    /**
     * @param  boolean Is Client or Staff
     * @return none
     */
    private function delete_autologin($staff)
    {
        $this->load->helper('cookie');
        if ($cookie = get_cookie('autologin', true)) {
            $data = unserialize($cookie);
            $this->user_autologin->delete($data['user_id'], md5($data['key']), $staff);
            delete_cookie('autologin', 'aal');
        }
    }

    /**
     * @return boolean
     * Check if autologin found
     */
    public function autologin()
    {
        if (!is_logged_in()) {
            $this->load->helper('cookie');
            if ($cookie = get_cookie('autologin', true)) {
                $data = unserialize($cookie);
                if (isset($data['key']) and isset($data['user_id'])) {
                    if (!is_null($user = $this->user_autologin->get($data['user_id'], md5($data['key'])))) {
                        // Login user
                        if ($user->staff == 1) {
                            $user_data = [
                                'staff_user_id'   => $user->id,
                                'staff_logged_in' => true,
                            ];
                        } else {
                            // Get the customer id
                            $this->db->select('userid');
                            $this->db->where('id', $user->id);
                            $contact = $this->db->get('tblcontacts')->row();

                            $user_data = [
                                'client_user_id'   => $contact->userid,
                                'contact_user_id'  => $user->id,
                                'client_logged_in' => true,
                            ];
                        }
                        $this->session->set_userdata($user_data);
                        // Renew users cookie to prevent it from expiring
                        set_cookie([
                            'name'   => 'autologin',
                            'value'  => $cookie,
                            'expire' => 60 * 60 * 24 * 31 * 2, // 2 months
                        ]);
                        $this->update_login_info($user->id, $user->staff);

                        return true;
                    }
                }
            }
        }

        return false;
    }

    /**
     * @param  integer ID
     * @param  boolean Is Client or Staff
     * @return none
     * Update login info on autologin
     */
    private function update_login_info($user_id, $staff)
    {
        $table = 'tblcontacts';
        $_id   = 'id';
        if ($staff == true) {
            $table = 'tblstaff';
            $_id   = 'staffid';
        }
        $this->db->set('last_ip', $this->input->ip_address());
        $this->db->set('last_login', date('Y-m-d H:i:s'));
        $this->db->where($_id, $user_id);
        $this->db->update($table);
    }

    /**
     * Send set password email
     * @param string $email
     * @param boolean $staff is staff of contact
     */
    public function set_password_email($email, $staff)
    {
        $table = 'tblcontacts';
        $_id   = 'id';
        if ($staff == true) {
            $table = 'tblstaff';
            $_id   = 'staffid';
        }
        $this->db->where('email', $email);
        $user = $this->db->get($table)->row();
        if ($user) {
            if ($user->active == 0) {
                return [
                    'memberinactive' => true,
                ];
            }

            $new_pass_key = app_generate_hash();
            $this->db->where($_id, $user->$_id);
            $this->db->update($table, [
                'new_pass_key'           => $new_pass_key,
                'new_pass_key_requested' => date('Y-m-d H:i:s'),
            ]);
            if ($this->db->affected_rows() > 0) {
                $this->load->model('emails_model');
                $data['new_pass_key'] = $new_pass_key;
                $data['staff']        = $staff;
                $data['userid']       = $user->$_id;
                $data['email']        = $email;

                $merge_fields = [];
                if ($staff == false) {
                    $merge_fields = array_merge($merge_fields, get_client_contact_merge_fields($user->userid, $user->$_id));
                } else {
                    $merge_fields = array_merge($merge_fields, get_staff_merge_fields($user->$_id));
                }
                $merge_fields = array_merge($merge_fields, get_password_merge_field($data, $staff, 'set'));
                $sent         = $this->emails_model->send_email_template('contact-set-password', $user->email, $merge_fields);

                if ($sent) {
                    return true;
                }

                return false;
            }

            return false;
        }

        return false;
    }

    /**
     * @param  string Email from the user
     * @param  Is Client or Staff
     * @return boolean
     * Generate new password key for the user to reset the password.
     */
    public function forgot_password($email, $staff = false)
    {
        $table = 'tblcontacts';
        $_id   = 'id';
        if ($staff == true) {
            $table = 'tblstaff';
            $_id   = 'staffid';
        }
        $this->db->where('email', $email);
        $user = $this->db->get($table)->row();

        if ($user) {
            if ($user->active == 0) {
                return [
                    'memberinactive' => true,
                ];
            }

            $new_pass_key = app_generate_hash();
            $this->db->where($_id, $user->$_id);
            $this->db->update($table, [
                'new_pass_key'           => $new_pass_key,
                'new_pass_key_requested' => date('Y-m-d H:i:s'),
            ]);

            if ($this->db->affected_rows() > 0) {
                $this->load->model('emails_model');
                $data['new_pass_key'] = $new_pass_key;
                $data['staff']        = $staff;
                $data['userid']       = $user->$_id;
                $merge_fields         = [];
                if ($staff == false) {
                    $template     = 'contact-forgot-password';
                    $merge_fields = array_merge($merge_fields, get_client_contact_merge_fields($user->userid, $user->$_id));
                } else {
                    $template     = 'staff-forgot-password';
                    $merge_fields = array_merge($merge_fields, get_staff_merge_fields($user->$_id));
                }
                $merge_fields = array_merge($merge_fields, get_password_merge_field($data, $staff, 'forgot'));
                $sent         = $this->emails_model->send_email_template($template, $user->email, $merge_fields);
                if ($sent) {
                    return true;
                }

                return false;
            }

            return false;
        }

        return false;
    }

    /**
     * Update user password from forgot password feature or set password
     * @param boolean $staff        is staff or contact
     * @param mixed $userid
     * @param string $new_pass_key the password generate key
     * @param string $password     new password
     */
    public function set_password($staff, $userid, $new_pass_key, $password)
    {
        if (!$this->can_set_password($staff, $userid, $new_pass_key)) {
            return [
                'expired' => true,
            ];
        }
        $this->load->helper('phpass');
        $hasher   = new PasswordHash(PHPASS_HASH_STRENGTH, PHPASS_HASH_PORTABLE);
        $password = $hasher->HashPassword($password);
        $table    = 'tblcontacts';
        $_id      = 'id';
        if ($staff == true) {
            $table = 'tblstaff';
            $_id   = 'staffid';
        }
        $this->db->where($_id, $userid);
        $this->db->where('new_pass_key', $new_pass_key);
        $this->db->update($table, [
            'password' => $password,
        ]);
        if ($this->db->affected_rows() > 0) {
            logActivity('User Set Password [User ID: ' . $userid . ', Is Staff Member: ' . ($staff == true ? 'Yes' : 'No') . ', IP: ' . $this->input->ip_address() . ']');
            $this->db->set('new_pass_key', null);
            $this->db->set('new_pass_key_requested', null);
            $this->db->set('last_password_change', date('Y-m-d H:i:s'));
            $this->db->where($_id, $userid);
            $this->db->where('new_pass_key', $new_pass_key);
            $this->db->update($table);

            return true;
        }

        return null;
    }

    /**
     * @param  boolean Is Client or Staff
     * @param  integer ID
     * @param  string
     * @param  string
     * @return boolean
     * User reset password after successful validation of the key
     */
    public function reset_password($staff, $userid, $new_pass_key, $password)
    {
        if (!$this->can_reset_password($staff, $userid, $new_pass_key)) {
            return [
                'expired' => true,
            ];
        }
        $this->load->helper('phpass');
        $hasher   = new PasswordHash(PHPASS_HASH_STRENGTH, PHPASS_HASH_PORTABLE);
        $password = $hasher->HashPassword($password);
        $table    = 'tblcontacts';
        $_id      = 'id';
        if ($staff == true) {
            $table = 'tblstaff';
            $_id   = 'staffid';
        }

        $this->db->where($_id, $userid);
        $this->db->where('new_pass_key', $new_pass_key);
        $this->db->update($table, [
            'password' => $password,
        ]);
        if ($this->db->affected_rows() > 0) {
            logActivity('User Reseted Password [User ID: ' . $userid . ', Is Staff Member: ' . ($staff == true ? 'Yes' : 'No') . ', IP: ' . $this->input->ip_address() . ']');
            $this->db->set('new_pass_key', null);
            $this->db->set('new_pass_key_requested', null);
            $this->db->set('last_password_change', date('Y-m-d H:i:s'));
            $this->db->where($_id, $userid);
            $this->db->where('new_pass_key', $new_pass_key);
            $this->db->update($table);
            $this->load->model('emails_model');
            $this->db->where($_id, $userid);
            $user          = $this->db->get($table)->row();
            $data['email'] = $user->email;

            $merge_fields = [];
            if ($staff == false) {
                $template     = 'contact-password-reseted';
                $merge_fields = array_merge($merge_fields, get_client_contact_merge_fields($user->userid, $user->$_id));
            } else {
                $template     = 'staff-password-reseted';
                $merge_fields = array_merge($merge_fields, get_staff_merge_fields($user->$_id));
            }
            $this->emails_model->send_email_template($template, $user->email, $merge_fields);

            return true;
        }

        return null;
    }

    /**
     * @param  integer Is Client or Staff
     * @param  integer ID
     * @param  string Password reset key
     * @return boolean
     * Check if the key is not expired or not exists in database
     */
    public function can_reset_password($staff, $userid, $new_pass_key)
    {
        $table = 'tblcontacts';
        $_id   = 'id';
        if ($staff == true) {
            $table = 'tblstaff';
            $_id   = 'staffid';
        }

        $this->db->where($_id, $userid);
        $this->db->where('new_pass_key', $new_pass_key);
        $user = $this->db->get($table)->row();
        if ($user) {
            $timestamp_now_minus_1_hour = time() - (60 * 60);
            $new_pass_key_requested     = strtotime($user->new_pass_key_requested);
            if ($timestamp_now_minus_1_hour > $new_pass_key_requested) {
                return false;
            }

            return true;
        }

        return false;
    }

    /**
     * @param  integer Is Client or Staff
     * @param  integer ID
     * @param  string Password reset key
     * @return boolean
     * Check if the key is not expired or not exists in database
     */
    public function can_set_password($staff, $userid, $new_pass_key)
    {
        $table = 'tblcontacts';
        $_id   = 'id';
        if ($staff == true) {
            $table = 'tblstaff';
            $_id   = 'staffid';
        }
        $this->db->where($_id, $userid);
        $this->db->where('new_pass_key', $new_pass_key);
        $user = $this->db->get($table)->row();
        if ($user) {
            $timestamp_now_minus_48_hour = time() - (3600 * 48);
            $new_pass_key_requested      = strtotime($user->new_pass_key_requested);
            if ($timestamp_now_minus_48_hour > $new_pass_key_requested) {
                return false;
            }

            return true;
        }

        return false;
    }

    /**
     * Get user from database by 2 factor authentication code
     * @param  string $code authentication code to search for
     * @return object
     */
    public function get_user_by_two_factor_auth_code($code)
    {
        $this->db->where('two_factor_auth_code', $code);

        return $this->db->get('tblstaff')->row();
    }

    /**
     * Login user via two factor authentication
     * @param  object $user user object
     * @return boolean
     */
    public function two_factor_auth_login($user)
    {
        do_action(
            'before_staff_login',
            [
                'email'  => $user->email,
                'userid' => $user->staffid,
                ]
        );

        $this->session->set_userdata(
            [
                'staff_user_id'   => $user->staffid,
                'staff_logged_in' => true,
            ]
        );

        $remember = null;
        if ($this->session->has_userdata('tfa_remember')) {
            $remember = true;
            $this->session->unset_userdata('tfa_remember');
        }

        if ($remember) {
            $this->create_autologin($user->staffid, true);
        }

        $this->update_login_info($user->staffid, true);

        return true;
    }

    /**
     * Check if 2 factor authentication code is valid for usage
     * @param  string  $code auth code
     * @return boolean
     */
    public function is_two_factor_code_valid($code)
    {
        $this->db->select('two_factor_auth_code_requested');
        $this->db->where('two_factor_auth_code', $code);
        $user = $this->db->get('tblstaff')->row();

        // Code not exists because no user is found
        if (!$user) {
            return false;
        }

        $timestamp_minus_1_hour = time() - (60 * 60);
        $new_code_key_requested = strtotime($user->two_factor_auth_code_requested);
        // The code is older then 1 hour and its not valid
        if ($timestamp_minus_1_hour > $new_code_key_requested) {
            return false;
        }
        // Code is valid
        return true;
    }

    /**
     * Clears 2 factor authentication code in database
     * @param  mixed $id
     * @return boolean
     */
    public function clear_two_factor_auth_code($id)
    {
        $this->db->where('staffid', $id);
        $this->db->update('tblstaff', [
            'two_factor_auth_code' => null,
        ]);

        return true;
    }

    /**
     * Set 2 factor authentication code for staff member
     * @param mixed $id staff id
     */
    public function set_two_factor_auth_code($id)
    {
        $code = generate_two_factor_auth_key();
        $code .= $id;

        $this->db->where('staffid', $id);
        $this->db->update('tblstaff', [
            'two_factor_auth_code'           => $code,
            'two_factor_auth_code_requested' => date('Y-m-d H:i:s'),
        ]);

        return $code;
    }
}


text:
#ifndef NX_USER_RENDER_SURFACE_BUFFER_DESC_H
#define NX_USER_RENDER_SURFACE_BUFFER_DESC_H

/*!
\file
\brief class NxUserRenderSurfaceBufferDesc, structs NxRenderDataFormat and NxRenderSurfaceSemantic
*/

#include "NxApexUsingNamespace.h"
#include "NxUserRenderResourceManager.h"
#include "NxApexRenderDataFormat.h"
#include "NxApexSDK.h"

namespace physx
{
namespace apex
{

PX_PUSH_PACK_DEFAULT

/**
\brief Describes the semantics and layout of a Surface buffer
*/
class NxUserRenderSurfaceBufferDesc
{
public:
	NxUserRenderSurfaceBufferDesc(void)
	{
		setDefaults();
	}

	/**
	\brief Default values
	*/
	void setDefaults()
	{
//		hint   = NxRenderBufferHint::STATIC;
		format = NxRenderDataFormat::UNSPECIFIED;

		width = 0;
		height = 0;
		depth = 1;

		//moduleIdentifier = 0;

		registerInCUDA = false;
		interopContext = 0;
//		stride = 0;
	}

	/**
	\brief Checks if the surface buffer descriptor is valid
	*/
	bool isValid(void) const
	{
		physx::PxU32 numFailed = 0;
		numFailed += (format == NxRenderDataFormat::UNSPECIFIED);
		numFailed += (width == 0) && (height == 0) && (depth == 0);
		numFailed += registerInCUDA && (interopContext == 0);
//		numFailed += registerInCUDA && (stride == 0);

		return (numFailed == 0);
	}

public:
	/**
	\brief The size of U-dimension.
	*/
	physx::PxU32				width;

	/**
	\brief The size of V-dimension.
	*/
	physx::PxU32				height;

	/**
	\brief The size of W-dimension.
	*/
	physx::PxU32				depth;

	/**
	\brief A hint about the update frequency of this buffer
	*/
//	NxRenderBufferHint::Enum	hint;

	/**
	\brief Data format of suface buffer.
	*/
	NxRenderDataFormat::Enum	format;

	/**
	\brief Identifier of module generating this request
	*/
	//NxAuthObjTypeID				moduleIdentifier;

	/**
	\brief Buffer can be shared by multiple render resources
	*/
	//bool							canBeShared;

//	physx::PxU32					stride; //!< The stride between sprites of this buffer. Required when CUDA interop is used!

	bool							registerInCUDA;  //!< Declare if the resource must be registered in CUDA upon creation

	/**
	This context must be used to register and unregister the resource every time the
	device is lost and recreated.
	*/
	physx::PxCudaContextManager*	interopContext;
};

PX_POP_PACK

}
} // end namespace physx::apex

#endif // NX_USER_RENDER_SURFACE_BUFFER_DESC_H


text:
<?php

global $_MODULE;
$_MODULE = array();

$_MODULE['<{blockcontactinfos}prestashop>blockcontactinfos_fc02586aa99596947b184a01f43fb4ae'] = 'Bloc d\'informació de contacte';
$_MODULE['<{blockcontactinfos}prestashop>blockcontactinfos_86458ae1631be34a6fcbf1a4584f5abe'] = 'Afegiu un bloc per afegir informació sobre com contactar amb la botiga';
$_MODULE['<{blockcontactinfos}prestashop>blockcontactinfos_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Configuració modificada.';
$_MODULE['<{blockcontactinfos}prestashop>blockcontactinfos_f4f70727dc34561dfde1a3c529b6205c'] = 'Configuració';
$_MODULE['<{blockcontactinfos}prestashop>blockcontactinfos_c281f92b77ba329f692077d23636f5c9'] = 'Nom de l\'empresa';
$_MODULE['<{blockcontactinfos}prestashop>blockcontactinfos_dd7bf230fde8d4836917806aff6a6b27'] = 'Adreça';
$_MODULE['<{blockcontactinfos}prestashop>blockcontactinfos_1f8261d17452a959e013666c5df45e07'] = 'Telèfon';
$_MODULE['<{blockcontactinfos}prestashop>blockcontactinfos_ce8ae9da5b7cd6c3df2929543a9af92d'] = 'Adreça electrònica';
$_MODULE['<{blockcontactinfos}prestashop>blockcontactinfos_c9cc8cce247e49bae79f15173ce97354'] = 'Desar';
$_MODULE['<{blockcontactinfos}prestashop>blockcontactinfos_02d4482d332e1aef3437cd61c9bcc624'] = 'Contacteu-nos';
$_MODULE['<{blockcontactinfos}prestashop>blockcontactinfos_2e006b735fbd916d8ab26978ae6714d4'] = 'Tel:';
$_MODULE['<{blockcontactinfos}prestashop>blockcontactinfos_6a1e265f92087bb6dd18194833fe946b'] = 'Adreça electrònica:';
$_MODULE['<{blockcontactinfos}prestashop>blockcontactinfos_80a11d2a54a677f6fadd9c041c0d6b98'] = 'Informació sobre la botiga';
$_MODULE['<{blockcontactinfos}prestashop>blockcontactinfos_320abee94a07e976991e4df0d4afb319'] = 'Telefoneu-nos ara:';

return $_MODULE;


text:
namespace te
{
    class Entity;
    class CommandComponent;

    class Command {
    public:
        Command(CommandMask dispatchMask, CommandMask forbidMask, std::function<void(const Entity&, const ECS&, float)> = [](const Entity&, const ECS&, float){});
        virtual ~Command();

    private:
        friend class CommandSystem;

        virtual void execute(const Entity& e, const ECS& ecs, float dt) const;

        std::function<void(const Entity&, const ECS&, float)> mFn;
        CommandMask mDispatchMask;
        CommandMask mForbidMask;
    };

    class CommandSystem : public System
    {
    public:
        CommandSystem(const ECS&);

        void queueCommand(const Command&);
        void queueCommand(Command&&);
        void update(float dt);
    private:
        const ECS mECS;
        std::vector<Command> mCommands;
    };

    enum class InputType
    { PRESS, RELEASE };

    class InputSystem
    {
    public:
        InputSystem(std::shared_ptr<CommandSystem>);
        void setKeyPress(char, Command&&);
        void setKeyRelease(char, Command&&);
        void processInput(char, InputType);
    private:
        std::map<char, std::vector<Command>>& getInputMap(InputType);

        std::shared_ptr<CommandSystem> mpCommandSystem;

        std::map<char, std::vector<Command>> mKeyPressMap;
        std::map<char, std::vector<Command>> mKeyReleaseMap;
    };
}

#endif


text:
Error: 3 out of 4 chameneos report 0 for creaturesMet, so the other chameneos is meeting itself!

The D std.thread implementation is OS-level (pthreads). The source code for it is in dmd/src/phobos/std/thread.d if you want to take a look at it.


text:
using Microsoft.Owin.Security;
using Microsoft.Owin.Security.OAuth;
using System;
using System.Collections.Generic;
using Owin;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNet.Identity.Owin;

namespace Fullstack.Core.Identity {
    public class CustomOAuthProvider : OAuthAuthorizationServerProvider {

        public override Task ValidateClientAuthentication(OAuthValidateClientAuthenticationContext context) {
            context.Validated();
            return Task.FromResult<object>(null);
        }

        public override async Task GrantResourceOwnerCredentials(OAuthGrantResourceOwnerCredentialsContext context) {

            var userManager = context.OwinContext.GetUserManager<UserManager>();

            var user = await userManager.FindAsync(context.UserName, context.Password);

            if (user == null) {
                context.SetError("invalid_grant", "The user name or password is incorrect.");
                return;
            }

            var claims = await userManager.CreateIdentityAsync(user, "JWT");
            var ticket = new AuthenticationTicket(claims, null);

            context.Validated(ticket);

        }
    }
}


text:
package apimodel

import (
	"github.com/alexandre-normand/glukit/app/util"
	"sort"
	"time"
)

type Time struct {
	Timestamp  int64  `json:"timestamp" datastore:"timestamp,noindex"`
	TimeZoneId string `json:"timezone" datastore:"timezone,noindex"`
}

// GetTime gets the time of a Timestamp value
func (element Time) GetTime() (timeValue time.Time) {
	rawValue := time.Unix(element.Timestamp/1000, 0)
	if location, err := util.GetOrLoadLocationForName(element.TimeZoneId); err != nil {
		util.Propagate(err)
		return time.Unix(0, 0)
	} else {
		return rawValue.In(location)
	}

	return time.Unix(0, 0)
}

func (element Time) Format() (formatted string, err error) {
	timeValue := element.GetTime()
	if location, err := util.GetOrLoadLocationForName(element.TimeZoneId); err != nil {
		return "", err
	} else {
		return timeValue.In(location).Format(util.TIMEFORMAT), nil
	}
}

func GetTimeMillis(time time.Time) int64 {
	return time.Unix() * 1000
}

type TimeSlice []Time

func (slice TimeSlice) Len() int {
	return len(slice)
}

func (slice TimeSlice) Less(i, j int) bool {
	return slice[i].Timestamp < slice[j].Timestamp
}

func (slice TimeSlice) Swap(i, j int) {
	slice[i], slice[j] = slice[j], slice[i]
}

func (slice TimeSlice) GetEpochTime(i int) (epochTime int64) {
	return slice[i].Timestamp / 1000
}

type Interface interface {
	sort.Interface
	GetEpochTime(i int) (epochTime int64)
}

// filter filters out any value that is outside of the lower and upper bounds. The two bounds are inclusive and the returned
// indexes are inclusive too.
func GetBoundariesOfElementsInRange(slice Interface, lowerBound, upperBound time.Time) (startIndex, endIndex int) {
	// Nothing to sort, return immediately
	if slice.Len() == 0 {
		return 0, slice.Len() - 1
	}

	arraySize := slice.Len()
	startIndex = 0
	endIndex = arraySize - 1

	// Sort might not be strictly needed depending on the ordering of the datastore loading but since there doesn't
	// seem to be any warranty, sorting seems like a good idea
	sort.Sort(slice)

	for i := arraySize - 1; i > 0; i-- {
		elementTime := time.Unix(slice.GetEpochTime(i), 0)
		if !elementTime.After(upperBound) {
			endIndex = i
			break
		}
	}

	for i := 0; i < arraySize; i++ {
		elementTime := time.Unix(slice.GetEpochTime(i), 0)
		if !elementTime.Before(lowerBound) {
			startIndex = i
			break
		}
	}

	return startIndex, endIndex
}