text:
goog.provide('fireauth.storage.IndexedDBTest');

goog.require('fireauth.AuthError');
goog.require('fireauth.authenum.Error');
goog.require('fireauth.messagechannel.Receiver');
goog.require('fireauth.messagechannel.Sender');
goog.require('fireauth.storage.IndexedDB');
goog.require('fireauth.storage.Storage');
goog.require('goog.Promise');
goog.require('goog.testing.MockClock');
goog.require('goog.testing.MockControl');
goog.require('goog.testing.PropertyReplacer');
goog.require('goog.testing.jsunit');
goog.require('goog.testing.recordFunction');

goog.setTestOnly('fireauth.storage.IndexedDBTest');

var mockControl;
var ignoreArgument;
var stubs = new goog.testing.PropertyReplacer();
var db = null;
var manager;
var clock;
var indexedDBMock;
var containsObjectStore;
var deleted;

function setUp() {
  mockControl = new goog.testing.MockControl();
  ignoreArgument = goog.testing.mockmatchers.ignoreArgument;
  mockControl.$resetAll();
  deleted = 0;
  // IndexedDB not supported in IE9.
  stubs.replace(
      fireauth.storage.IndexedDB,
      'isAvailable',
      function() {
        return true;
      });
  clock = new goog.testing.MockClock(true);
  // Callback to run to determine whether the database constains an object
  // store.
  containsObjectStore = function() {
    return true;
  };
  indexedDBMock = {
    deleteDatabase: function(dbName) {
      assertEquals('firebaseLocalStorageDb', dbName);
      var request = {};
      // Simulate successful deletion.
      goog.Promise.resolve().then(function() {
        deleted++;
        db = null;
        request.onsuccess();
      });
      return request;
    },
    open: function(dbName, version) {
      assertEquals('firebaseLocalStorageDb', dbName);
      assertEquals(1, version);
      var dbRequest = {};
      goog.Promise.resolve().then(function() {
        db = {
          objectStoreNames: {
            contains: function(name) {
              assertEquals('firebaseLocalStorage', name);
              return containsObjectStore();
            }
          },
          key: null,
          store: {},
          createObjectStore: function(objectStoreName, keyPath) {
            var request = {
              'transaction': {
              }
            };
            assertEquals(
                'firebaseLocalStorage',
                objectStoreName);
            assertObjectEquals(
                {
                  'keyPath': 'fbase_key'
                },
                keyPath);
            db.key = keyPath['keyPath'];
            db.store[objectStoreName] = {};
            goog.Promise.resolve().then(function() {
              var event = {
                'target': {
                  'result': db
                }
              };
              dbRequest.onsuccess(event);
            });
            return request;
          },
          transaction: function(objectStores, type) {
            for (var i = 0; i < objectStores.length; i++) {
              if (!db.store[objectStores[i]]) {
                fail('Object store does not exist!');
              }
            }
            return {
              objectStore: function(objectStoreName) {
                if (!db.store[objectStoreName]) {
                  fail('Object store does not exist!');
                }
                return {
                  add: function(data) {
                    var request = {};
                    if (type != 'readwrite') {
                      fail('Invalid write operation!');
                    }
                    if (db.store[objectStoreName][data[db.key]]) {
                      fail('Unable to add. Key already exists!');
                    }
                    goog.Promise.resolve().then(function() {
                      db.store[objectStoreName][data[db.key]] = data;
                      request.onsuccess();
                    });
                    return request;
                  },
                  put: function(data) {
                    var request = {};
                    if (type != 'readwrite') {
                      fail('Invalid write operation!');
                    }
                    if (!db.store[objectStoreName][data[db.key]]) {
                      fail('Unable to put. Key does not exist!');
                    }
                    for (var subKey in data) {
                      db.store[objectStoreName][data[db.key]][subKey] =
                          data[subKey];
                    }
                    goog.Promise.resolve().then(function() {
                      request.onsuccess();
                    });
                    return request;
                  },
                  delete: function(keyToRemove) {
                    var request = {};
                    if (type != 'readwrite') {
                      fail('Invalid write operation!');
                    }
                    if (db.store[objectStoreName][keyToRemove]) {
                      delete db.store[objectStoreName][keyToRemove];
                    }
                    goog.Promise.resolve().then(function() {
                      request.onsuccess();
                    });
                    return request;
                  },
                  get: function(keyToGet, callback) {
                    var request = {};
                    var data = db.store[objectStoreName][keyToGet] || null;
                    goog.Promise.resolve().then(function() {
                      var event = {
                        'target': {
                          'result': data
                        }
                      };
                      request.onsuccess(event);
                    });
                    return request;
                  },
                  getAll: function() {
                    var request = {};
                    var results = [];
                    for (var key in db.store[objectStoreName]) {
                      results.push(db.store[objectStoreName][key]);
                    }
                    goog.Promise.resolve().then(function() {
                      var event = {
                        'target': {
                          'result': results
                        }
                      };
                      request.onsuccess(event);
                    });
                    return request;
                  }
                };
              }
            };
          }
        };
        var event = {
          'target': {
            'result': db
          }
        };
        dbRequest.onupgradeneeded(event);
      });
      return dbRequest;
    }
  };
}

function tearDown() {
  if (manager) {
    manager.removeAllStorageListeners();
  }
  manager = null;
  db = null;
  indexedDBMock = null;
  stubs.reset();
  goog.dispose(clock);
  try {
    mockControl.$verifyAll();
  } finally {
    mockControl.$tearDown();
  }
}

/**
 * Asserts that two errors are equivalent. Plain assertObjectEquals cannot be
 * used as Internet Explorer adds the stack trace as a property of the object.
 * @param {!fireauth.AuthError} expected
 * @param {!fireauth.AuthError} actual
 */
function assertErrorEquals(expected, actual) {
  assertObjectEquals(expected.toPlainObject(), actual.toPlainObject());
}

/**
 * @return {!fireauth.storage.IndexedDB} The default indexedDB
 *     local storage manager to be used for testing.
 */
function getDefaultFireauthManager() {
  return new fireauth.storage.IndexedDB(
      'firebaseLocalStorageDb',
      'firebaseLocalStorage',
      'fbase_key',
      'value',
      1,
      indexedDBMock);
}

function testIndexedDb_notSupported() {
  // Test when indexedDB is not supported.
  stubs.replace(
      fireauth.storage.IndexedDB,
      'isAvailable',
      function() {
        return false;
      });
  var expectedError = new fireauth.AuthError(
      fireauth.authenum.Error.WEB_STORAGE_UNSUPPORTED);
  try {
    getDefaultFireauthManager();
    fail('Should fail when indexedDB is not supported.');
  } catch (error) {
    assertErrorEquals(expectedError, error);
  }
}

function testIndexedDb_null() {
  manager = getDefaultFireauthManager();
  assertEquals(fireauth.storage.Storage.Type.INDEXEDDB, manager.type);
  return manager.get('key1')
      .then(function(data) {
        assertNull(data);
      });
}

function testIndexedDb_setGetRemove_objectStoreContained() {
  manager = getDefaultFireauthManager();
  manager.addStorageListener(function() {
    fail('Storage should not be triggered for local changes!');
  });
  return goog.Promise.resolve()
      .then(function() {
        return manager.set('key1', 'value1');
      })
      .then(function() {
        // No database deletion should occur.
        assertEquals(0, deleted);
        return manager.get('key1');
      })
      .then(function(data) {
        assertEquals('value1', data);
      })
      .then(function() {
        return manager.remove('key1');
      })
      .then(function() {
        return manager.get('key1');
      })
      .then(function(data) {
        assertNull(data);
      });
}

function testIndexedDb_setGetRemove_objectStoreMissing() {
  // Track number of initialization trials.
  var trials = 2;
  containsObjectStore = function() {
    trials--;
    // Fail first time and then succeed the second time.
    if (trials != 0) {
      return false;
    }
    return true;
  };
  manager = getDefaultFireauthManager();
  manager.addStorageListener(function() {
    fail('Storage should not be triggered for local changes!');
  });
  return goog.Promise.resolve()
      .then(function() {
        return manager.set('key1', 'value1');
      })
      .then(function() {
        // Db should have been deleted and re-initialized.
        assertEquals(0, trials);
        assertEquals(1, deleted);
        return manager.get('key1');
      })
      .then(function(data) {
        assertEquals('value1', data);
      })
      .then(function() {
        return manager.remove('key1');
      })
      .then(function() {
        return manager.get('key1');
      })
      .then(function(data) {
        assertNull(data);
      });
}

function testStartListeners() {
  manager = getDefaultFireauthManager();
  var listener1 = goog.testing.recordFunction();
  var listener2 = goog.testing.recordFunction();

  // Add listeners.
  manager.addStorageListener(listener1);
  manager.addStorageListener(listener2);
  clock.tick(800);
  clock.tick(800);
  clock.tick(800);
  db.store['firebaseLocalStorage'] = {
    'key1': {'fbase_key': 'key1', 'value': 1},
    'key2': {'fbase_key': 'key2', 'value': 2}
  };
  clock.tick(800);
  assertEquals(1, listener1.getCallCount());
  assertEquals(1, listener2.getCallCount());
  assertArrayEquals(
      ['key1', 'key2'], listener1.getLastCall().getArgument(0));
  assertArrayEquals(
      ['key1', 'key2'], listener2.getLastCall().getArgument(0));
}

function testStopListeners() {
  manager = getDefaultFireauthManager();
  var listener1 = goog.testing.recordFunction();
  var listener2 = goog.testing.recordFunction();
  var listener3 = goog.testing.recordFunction();
  // Add listeners.
  manager.addStorageListener(listener1);
  manager.addStorageListener(listener2);
  manager.addStorageListener(listener3);
  clock.tick(800);
  clock.tick(800);
  clock.tick(800);
  // Remove all but listener3.
  manager.removeStorageListener(listener1);
  manager.removeStorageListener(listener2);
  db.store['firebaseLocalStorage'] = {
    'key1': {'fbase_key': 'key1', 'value': 1},
    'key2': {'fbase_key': 'key2', 'value': 2}
  };
  clock.tick(800);
  // Only listener3 should be called.
  assertEquals(0, listener1.getCallCount());
  assertEquals(0, listener2.getCallCount());
  assertEquals(1, listener3.getCallCount());
  assertArrayEquals(
      ['key1', 'key2'], listener3.getLastCall().getArgument(0));
  db.store['firebaseLocalStorage'] = {
    'key1': {'fbase_key': 'key1', 'value': 1},
    'key3': {'fbase_key': 'key3', 'value': 3}
  };
  clock.tick(800);
  // Only listener3 should be called.
  assertEquals(0, listener1.getCallCount());
  assertEquals(0, listener2.getCallCount());
  assertEquals(2, listener3.getCallCount());
  assertArrayEquals(
      ['key2', 'key3'], listener3.getLastCall().getArgument(0));
  // Remove listener3.
  manager.removeStorageListener(listener3);
  // Add listener1 again.
  manager.addStorageListener(listener1);
  db.store['firebaseLocalStorage'] = {
    'key1': {'fbase_key': 'key1', 'value': 0},
    'key3': {'fbase_key': 'key3', 'value': 3},
    'key4': {'fbase_key': 'key4', 'value': 4}
  };
  clock.tick(800);
  // Only listener1 should be called.
  assertEquals(1, listener1.getCallCount());
  assertEquals(0, listener2.getCallCount());
  assertEquals(2, listener3.getCallCount());
  assertArrayEquals(
      ['key1', 'key4'], listener1.getLastCall().getArgument(0));
  // Remove all listeners.
  manager.removeAllStorageListeners();
  db.store['firebaseLocalStorage'] = {
    'key1': {'fbase_key': 'key1', 'value': 0}
  };
  clock.tick(800);
  // No additional listener should be called.
  assertEquals(1, listener1.getCallCount());
  assertEquals(0, listener2.getCallCount());
  assertEquals(2, listener3.getCallCount());
}

function testReceiverSubscribed_noWorkerGlobalScope() {
  var getWorkerGlobalScope = mockControl.createMethodMock(
      fireauth.util, 'getWorkerGlobalScope');
  var getInstance = mockControl.createMethodMock(
      fireauth.messagechannel.Receiver, 'getInstance');
  getWorkerGlobalScope().$returns(null).$atLeastOnce();
  getInstance().$never();
  mockControl.$replayAll();

  manager = getDefaultFireauthManager();
  return manager.get('abc').then(function(value) {
    assertNull(value);
  });
}

function testReceiverSubscribed_externalChange_notYetProcessed() {
  var listener1 = goog.testing.recordFunction();
  var subscribedCallback;
  var pingCallback;
  var workerGlobalScope = {};
  var getWorkerGlobalScope = mockControl.createMethodMock(
      fireauth.util, 'getWorkerGlobalScope');
  var receiver = mockControl.createStrictMock(fireauth.messagechannel.Receiver);
  var getInstance = mockControl.createMethodMock(
      fireauth.messagechannel.Receiver, 'getInstance');
  getWorkerGlobalScope().$returns(workerGlobalScope).$atLeastOnce();
  getInstance(workerGlobalScope).$returns(receiver);
  receiver.subscribe('keyChanged', ignoreArgument)
      .$does(function(eventType, callback) {
        subscribedCallback = callback;
      }).$once();
  receiver.subscribe('ping', ignoreArgument)
      .$does(function(eventType, callback) {
        pingCallback = callback;
      }).$once();
  mockControl.$replayAll();

  manager = getDefaultFireauthManager();
  manager.addStorageListener(listener1);
  return manager.get('abc').then(function(value) {
    // Simulate ping response at this point.
    pingCallback('https://www.example.com', {});
    assertNull(value);
    // Simulate external indexedDB change.
    db.store['firebaseLocalStorage'] = {
      'abc': {'fbase_key': 'abc', 'value': 'def'}
    };
    return subscribedCallback('https://www.example.com', {'key': 'abc'});
  }).then(function(response) {
    // Confirm sync completed. Status true returned to confirm the key was
    // processed.
    assertObjectEquals({'keyProcessed': true}, response);
    // Listener should trigger with expected argument.
    assertEquals(1, listener1.getCallCount());
    assertArrayEquals(['abc'], listener1.getLastCall().getArgument(0));
    return manager.get('abc');
  }).then(function(value) {
    assertEquals('def', value);
  });
}

function testReceiverSubscribed_externalChange_notYetProcessed_pingTimeout() {
  // Confirm ping timeout does not affect the flow. This is mostly used for
  // optimization for slow browsers.
  var listener1 = goog.testing.recordFunction();
  var subscribedCallback;
  var workerGlobalScope = {};
  var getWorkerGlobalScope = mockControl.createMethodMock(
      fireauth.util, 'getWorkerGlobalScope');
  var receiver = mockControl.createStrictMock(fireauth.messagechannel.Receiver);
  var getInstance = mockControl.createMethodMock(
      fireauth.messagechannel.Receiver, 'getInstance');
  getWorkerGlobalScope().$returns(workerGlobalScope).$atLeastOnce();
  getInstance(workerGlobalScope).$returns(receiver);
  receiver.subscribe('keyChanged', ignoreArgument)
      .$does(function(eventType, callback) {
        subscribedCallback = callback;
      }).$once();
  // Simulate no response to ping. This means short timeout will be used by
  // sender.
  receiver.subscribe('ping', ignoreArgument).$once();
  mockControl.$replayAll();

  manager = getDefaultFireauthManager();
  manager.addStorageListener(listener1);
  return manager.get('abc').then(function(value) {
    assertNull(value);
    // Simulate external indexedDB change.
    db.store['firebaseLocalStorage'] = {
      'abc': {'fbase_key': 'abc', 'value': 'def'}
    };
    return subscribedCallback('https://www.example.com', {'key': 'abc'});
  }).then(function(response) {
    // Confirm sync completed. Status true returned to confirm the key was
    // processed.
    assertObjectEquals({'keyProcessed': true}, response);
    // Listener should trigger with expected argument.
    assertEquals(1, listener1.getCallCount());
    assertArrayEquals(['abc'], listener1.getLastCall().getArgument(0));
    return manager.get('abc');
  }).then(function(value) {
    assertEquals('def', value);
  });
}

function testReceiverSubscribed_externalChange_alreadyProcessed() {
  var listener1 = goog.testing.recordFunction();
  var subscribedCallback;
  var pingCallback;
  var workerGlobalScope = {};
  var getWorkerGlobalScope = mockControl.createMethodMock(
      fireauth.util, 'getWorkerGlobalScope');
  var receiver = mockControl.createStrictMock(fireauth.messagechannel.Receiver);
  var getInstance = mockControl.createMethodMock(
      fireauth.messagechannel.Receiver, 'getInstance');
  getWorkerGlobalScope().$returns(workerGlobalScope).$atLeastOnce();
  getInstance(workerGlobalScope).$returns(receiver);
  receiver.subscribe('keyChanged', ignoreArgument)
      .$does(function(eventType, callback) {
        subscribedCallback = callback;
      }).$once();
  receiver.subscribe('ping', ignoreArgument)
      .$does(function(eventType, callback) {
        pingCallback = callback;
      }).$once();
  mockControl.$replayAll();

  manager = getDefaultFireauthManager();
  manager.addStorageListener(listener1);
  return manager.set('abc', 'def').then(function() {
    // Simulate ping response at this point.
    pingCallback('https://www.example.com', {});
    return subscribedCallback('https://www.example.com', {'key': 'abc'});
  }).then(function(response) {
    // Confirm sync completed but key not processed since no change is detected.
    assertObjectEquals({'keyProcessed': false}, response);
    // No listener should trigger.
    assertEquals(0, listener1.getCallCount());
    return manager.get('abc');
  }).then(function(value) {
    assertEquals('def', value);
  });
}

function testSender_writeOperations_serviceWorkerControllerUnavailable() {
  var getActiveServiceWorker = mockControl.createMethodMock(
      fireauth.util, 'getActiveServiceWorker');
  var sender = mockControl.createStrictMock(fireauth.messagechannel.Sender);
  var senderConstructor = mockControl.createConstructorMock(
      fireauth.messagechannel, 'Sender');
  getActiveServiceWorker()
      .$returns(goog.Promise.resolve(null)).$atLeastOnce();
  // No sender initialized.
  senderConstructor(ignoreArgument).$never();
  sender.send(ignoreArgument).$never();
  mockControl.$replayAll();

  // Set and remove should not trigger sender.
  manager = getDefaultFireauthManager();
  return manager.set('abc', 'def').then(function() {
    return manager.get('abc');
  }).then(function(value) {
    assertEquals('def', value);
    return manager.remove('abc');
  }).then(function() {
    return manager.get('abc');
  }).then(function(value) {
    assertNull(value);
  });
}

function testSender_writeOperations_serviceWorkerControllerAvailable() {
  var status = [];
  var serviceWorkerController = {};
  var getServiceWorkerController = mockControl.createMethodMock(
      fireauth.util, 'getServiceWorkerController');
  var getActiveServiceWorker = mockControl.createMethodMock(
      fireauth.util, 'getActiveServiceWorker');
  var sender = mockControl.createStrictMock(fireauth.messagechannel.Sender);
  var senderConstructor = mockControl.createConstructorMock(
      fireauth.messagechannel, 'Sender');
  var resolvePing;
  getActiveServiceWorker()
      .$returns(goog.Promise.resolve(serviceWorkerController)).$atLeastOnce();
  // Successful set event.
  senderConstructor(ignoreArgument).$returns(sender);
  sender.send('ping', null, true).$does(function(eventType, data) {
    return new goog.Promise(function(resolve, reject) {
      resolvePing = resolve;
    });
  }).$once();
  // Short timeout used as ping response not yet received.
  getServiceWorkerController().$returns(serviceWorkerController).$once();
  sender.send('keyChanged', {'key': 'abc'}, false)
      .$does(function(eventType, data) {
        status.push(0);
        return goog.Promise.resolve([
          {
            'fulfilled': true,
            'value': {'keyProcessed': true}
          }
        ]);
      }).$once();
      // Successful remove event.
  // Short timeout used as ping response not yet received.
  getServiceWorkerController().$returns(serviceWorkerController).$once();
  sender.send('keyChanged', {'key': 'abc'}, false)
      .$does(function(eventType, data) {
        // Simulate ping resolved at this point.
        resolvePing([
          {
            'fulfilled': true,
            'value': ['keyChanged']
          }
        ]);
        status.push(1);
        return goog.Promise.resolve([
          {
            'fulfilled': true,
            'value': {'keyProcessed': true}
          }
        ]);
      }).$once();
  // Long timeout used as ping response has been resolved.
  // Failing set event.
  getServiceWorkerController().$returns(serviceWorkerController).$once();
  sender.send('keyChanged', {'key': 'abc'}, true)
      .$does(function(eventType, data) {
        status.push(2);
        return goog.Promise.reject(new Error('unsupported_event'));
      }).$once();
  // Failing remove event.
  getServiceWorkerController().$returns(serviceWorkerController).$once();
  sender.send('keyChanged', {'key': 'abc'}, true)
      .$does(function(eventType, data) {
        status.push(3);
        return goog.Promise.reject(new Error('invalid_response'));
      }).$once();
  // Simulate the active service worker changed for some reason. No send
  // requests sent anymore.
  getServiceWorkerController().$returns({}).$once();
  mockControl.$replayAll();

  manager = getDefaultFireauthManager();
  return manager.set('abc', 'def').then(function() {
    // Set should trigger sender at this point.
    assertArrayEquals([0], status);
    return manager.get('abc');
  }).then(function(value) {
    // Get shouldn't trigger.
    assertArrayEquals([0], status);
    assertEquals('def', value);
    return manager.remove('abc');
  }).then(function() {
    // Remove should trigger sender at this point.
    assertArrayEquals([0, 1], status);
    return manager.get('abc');
  }).then(function(value) {
    // Get shouldn't trigger.
    assertArrayEquals([0, 1], status);
    assertNull(value);
    // This should resolve even if sender error occurs.
    return manager.set('abc', 'ghi');
  }).then(function() {
    // Set should trigger sender at this point.
    assertArrayEquals([0, 1, 2], status);
    return manager.get('abc');
  }).then(function(value) {
    // Get shouldn't trigger.
    assertArrayEquals([0, 1, 2], status);
    assertEquals('ghi', value);
    // This should resolve even if sender error occurs.
    return manager.remove('abc');
  }).then(function() {
    // Remove should trigger sender at this point.
    assertArrayEquals([0, 1, 2, 3], status);
    return manager.get('abc');
  }).then(function(value) {
    // Get shouldn't trigger.
    assertArrayEquals([0, 1, 2, 3], status);
    assertNull(value);
    return manager.set('abc', 'ghi');
  }).then(function() {
    // This shouldn't trigger sender anymore since active service worker
    // changed.
    assertArrayEquals([0, 1, 2, 3], status);
    return manager.get('abc');
  }).then(function(value) {
    assertEquals('ghi', value);
  });
}


text:
mkdir -p /var/log/journal

exec /usr/local/bin/fluentd "$@"

redpajama_set_name: RedPajamaGithub


text: > This is a sample clabot implementation powering the sandbox


text:
\chapter{Schlussfolgerungen/Fazit}
\label{chap:schlussfolgerungen}


text:
title: React Timeline component
components: Timeline, TimelineItem, TimelineSeparator, TimelineDot, TimelineConnector, TimelineContent, TimelineOppositeContent
githubLabel: 'component: Timeline'
packageName: '@material-ui/lab'
---

# Línea de tiempo

La línea de tiempo muestra una lista de eventos en orden cronológico.

**Nota:** Este componente no está documentado en las [ pautas de Material Design](https://material.io/), pero Material-UI lo soporta.

{{"component": "modules/components/ComponentLinkHeader.js"}}

## Línea de tiempo básica

Una línea de tiempo básica que muestra una lista de eventos.

{{"demo": "pages/components/timeline/BasicTimeline.js"}}

## Right-aligned timeline

La línea de tiempo puede posicionarse en el lado derecho de los eventos.

{{"demo": "pages/components/timeline/RightAlignedTimeline.js"}}

## Línea de tiempo alternativa

La línea de tiempo puede mostrar los eventos en los lados alternos.

{{"demo": "pages/components/timeline/AlternateTimeline.js"}}

## Color

El `TimelineDot` puede aparecer en diferentes colores.

{{"demo": "pages/components/timeline/ColorsTimeline.js"}}

## Delineada

{{"demo": "pages/components/timeline/OutlinedTimeline.js"}}

## Contenido opuesto

La línea de tiempo puede mostrar contenido en lados opuestos.

{{"demo": "pages/components/timeline/OppositeContentTimeline.js"}}

## Línea de tiempo personalizada

He aquí un ejemplo de personalización del componente. Puedes aprender más sobre esto en la [sección Personalizando Componentes de la documentación](/customization/how-to-customize/).

{{"demo": "pages/components/timeline/CustomizedTimeline.js"}}


text:
package im.mange.backdoor.server.kryo

import java.io.{ByteArrayOutputStream, IOException, OutputStream}

import com.esotericsoftware.kryo.io.{Input, Output}
import com.esotericsoftware.kryo.{Kryo, Registration, Serializer}
import com.twitter.chill.{KryoInstantiator, KryoPool, SerDeState}

trait Regsiterable[T] {
  def register(kryo: Kryo): Registration
}

case class ClassAndSerializer[T](clazz: Class[T], serializer: Serializer[T]) extends Regsiterable[T] {
  override def register(kryo: Kryo) = kryo.register(clazz, serializer)
}

//SEE: https://github.com/twitter/chill/issues/226
object RegisteringKryoPool {
  def withByteArrayOutputStream(poolSize: Int, ki: KryoInstantiator, regsiterables: Seq[Regsiterable[_ <: Any]]) = {
    new KryoPool(poolSize) {
      protected def newInstance: SerDeState = {
        val kryo = ki.newKryo

        regsiterables.map(r => r.register(kryo))

        new SerDeState(kryo, new Input, new Output(new ByteArrayOutputStream)) {
          override def clear() {
            super.clear()
            val byteStream = output.getOutputStream.asInstanceOf[ByteArrayOutputStream]
            byteStream.reset()
          }

          override def outputToBytes: Array[Byte] = {
            output.flush()
            val byteStream = output.getOutputStream.asInstanceOf[ByteArrayOutputStream]
            byteStream.toByteArray
          }

          @throws(classOf[IOException])
          override def writeOutputTo(os: OutputStream) {
            output.flush()
            val byteStream = output.getOutputStream.asInstanceOf[ByteArrayOutputStream]
            byteStream.writeTo(os)
          }
        }
      }
    }
  }
}


text:
namespace blink {

class PLATFORM_EXPORT ClipRecorderStack {
public:
    ClipRecorderStack(GraphicsContext* context)
        : m_parent(context->clipRecorderStack())
        , m_context(context)
    {
        context->setClipRecorderStack(this);
    }

    ~ClipRecorderStack();

    void addClipRecorder(PassOwnPtr<ClipRecorder> clipRecorder)
    {
        ASSERT(m_context->clipRecorderStack() == this);
        m_clipRecorders.append(clipRecorder);
    }
private:
    ClipRecorderStack* m_parent;
    Vector<OwnPtr<ClipRecorder>> m_clipRecorders;
    GraphicsContext* m_context;
    WTF_MAKE_NONCOPYABLE(ClipRecorderStack);
};

} // namespace blink

#endif // ClipRecorderStack_h


text:
user 'kibana user' do
  username node['kibana']['user']
  comment 'Kibana User'
  home "#{node['kibana']['dir']}/kibana"
  shell '/bin/bash'
  supports manage_home: false
  action :create
  system true
  only_if { node['kibana']['setup_user'] }
end

group 'kibana group' do
  group_name node['kibana']['user']
  action :create
  system true
  only_if { node['kibana']['setup_user'] }
end

ark 'kibana' do
  url node['kibana']['download_url']
  owner node['kibana']['user']
  group node['kibana']['group']
  version node['kibana']['version']
  has_binaries ['bin/kibana']
  checksum node['kibana']['checksum']

  prefix_root node['kibana']['dir']
  prefix_home node['kibana']['dir']
end


text:
title: "Twitter: May 01, 2022 at 11:33AM"
text: "RT @dailystoic: \"Be tolerant with others and strict with yourself.\" Marcus Aurelius"
createdAt: "May 01, 2022 at 11:33AM"
type: "twitter"
url: "https://twitter.com/DHolloran/status/1520803560006590464"
username: "DHolloran"
collectionName: "twitter"
slug: "twitter-may-01-2022-at-1133am"
---

RT @dailystoic: "Be tolerant with others and strict with yourself." Marcus Aurelius

  — Dan Holloran (@DHolloran)
  May 1, 2022


text:
<?xml version="1.0" encoding="utf-8"?>
<!--Generated by crowdin.com-->
<!--
  ~ Copyright (C) 2015 Chandra Poerwanto
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->
<resources>
  <!-- App -->
  <string name="app_name">Frissítések</string>
  <string name="app_title">Frissítések</string>
  <!-- Categories -->
  <string name="ota_category">OTA</string>
  <string name="links_category">Linkek</string>
  <!-- ROM info -->
  <string name="latest_version">Frissítés elérhető! \nLegújabb verzió: %1$s</string>
  <string name="unknown">Ismeretlen</string>
  <string name="system_uptodate">A rendszer naprakész</string>
  <!-- Check update -->
  <string name="check_update_title">Frissítés keresése</string>
  <string name="last_check_summary">Utolsó ellenőrzés: %1$s</string>
  <string name="last_check_never">Soha</string>
  <string name="check_update_failed">Frissítés ellenőrzése sikertelen</string>
  <string name="update_available">Frissítés elérhető!</string>
  <string name="no_update_available">Nincs elérhető frissítés</string>
  <!-- Update interval -->
  <string name="interval_title">Automatikus frissítési időköz</string>
  <string name="interval_entry_disable">Letiltva</string>
  <string name="interval_entry_1h">Óránként</string>
  <string name="interval_entry_12h">12 óránként</string>
  <string name="interval_entry_24h">24 óránként</string>
  <string name="autoupdate_enabled">Automatikus frissítés engedélyezve van</string>
  <string name="autoupdate_disabled">Automatikus frissítés le van tiltva</string>
  <!-- Notification -->
  <string name="notification_title">ResurrectionRemix OS frissítés</string>
  <string name="notification_message">Új verzió érhető el!</string>
  <string name="resurrection_channel">ResurrectionOTA értesítések</string>
  <string name="resurrection_channel_description">Értesítések a ResurrectionRemix OS frissítésekről</string>
  <!-- Dialog -->
  <string name="dialog_message">ROM frissítések keresése, kis türelmet…</string>
  <!-- Toast -->
  <string name="toast_message">Nincs böngésző telepítve</string>
</resources>


text:
namespace AutoMapper
{
    using System;
    using Impl;
    using Mappers;

    public interface IConfigurationProvider : IProfileConfiguration
    {
        /// <summary>
        /// Get all configured type maps created
        /// </summary>
        /// <returns>All configured type maps</returns>
        TypeMap[] GetAllTypeMaps();

        /// <summary>
        /// Find the <see cref="TypeMap"/> for the configured source and destination type
        /// </summary>
        /// <param name="sourceType">Configured source type</param>
        /// <param name="destinationType">Configured destination type</param>
        /// <returns>Type map configuration</returns>
        TypeMap FindTypeMapFor(Type sourceType, Type destinationType);

        /// <summary>
        /// Find the <see cref="TypeMap"/> for the configured type pair
        /// </summary>
        /// <param name="typePair">Type pair</param>
        /// <returns>Type map configuration</returns>
        TypeMap FindTypeMapFor(TypePair typePair);

        /// <summary>
        /// Find the <see cref="TypeMap"/> for the configured source and destination type, checking the source/destination object types too
        /// </summary>
        /// <param name="source">Source object</param>
        /// <param name="destination">Destination object</param>
        /// <param name="sourceType">Configured source type</param>
        /// <param name="destinationType">Configured destination type</param>
        /// <returns>Type map configuration</returns>
        TypeMap ResolveTypeMap(object source, object destination, Type sourceType, Type destinationType);

        /// <summary>
        /// Resolve the <see cref="TypeMap"/> for the configured source and destination type, checking parent types
        /// </summary>
        /// <param name="sourceType">Configured source type</param>
        /// <param name="destinationType">Configured destination type</param>
        /// <returns>Type map configuration</returns>
        TypeMap ResolveTypeMap(Type sourceType, Type destinationType);

        /// <summary>
        /// Resolve the <see cref="TypeMap"/> for the configured type pair, checking parent types
        /// </summary>
        /// <param name="typePair">Type pair</param>
        /// <returns>Type map configuration</returns>
        TypeMap ResolveTypeMap(TypePair typePair);

        /// <summary>
        /// Resolve the <see cref="TypeMap"/> for the resolution result and destination type, checking parent types
        /// </summary>
        /// <param name="resolutionResult">Resolution result from the source object</param>
        /// <param name="destinationType">Configured destination type</param>
        /// <returns>Type map configuration</returns>
        TypeMap ResolveTypeMap(ResolutionResult resolutionResult, Type destinationType);

        /// <summary>
        /// Get named profile configuration
        /// </summary>
        /// <param name="profileName">Profile name</param>
        /// <returns></returns>
        IProfileConfiguration GetProfileConfiguration(string profileName);

        /// <summary>
        /// Dry run all configured type maps and throw <see cref="AutoMapperConfigurationException"/> for each problem
        /// </summary>
        void AssertConfigurationIsValid();

        /// <summary>
        /// Dry run single type map
        /// </summary>
        /// <param name="typeMap">Type map to check</param>
        void AssertConfigurationIsValid(TypeMap typeMap);

        /// <summary>
        /// Dry run all type maps in given profile
        /// </summary>
        /// <param name="profileName">Profile name of type maps to test</param>
        void AssertConfigurationIsValid(string profileName);

        /// <summary>
        /// Dry run all type maps in given profile
        /// </summary>
        /// <typeparam name="TProfile">Profile type</typeparam>
        void AssertConfigurationIsValid<TProfile>() where TProfile : Profile, new();

        /// <summary>
        /// Creates a <see cref="TypeMap"/> based on a source and destination type
        /// </summary>
        /// <param name="sourceType">Source type</param>
        /// <param name="destinationType">Destination type</param>
        /// <returns>Type map configuration</returns>
        TypeMap CreateTypeMap(Type sourceType, Type destinationType);

        /// <summary>
        /// Fired each time a type map is created
        /// </summary>
        event EventHandler<TypeMapCreatedEventArgs> TypeMapCreated;

        /// <summary>
        /// Factory method to create formatters, resolvers and type converters
        /// </summary>
        Func<Type, object> ServiceCtor { get; }

        /// <summary>
        /// Find the closed generic type map for an item that maps to an open generic type map
        /// </summary>
        TypeMap FindClosedGenericTypeMapFor(ResolutionContext context);

        /// <summary>
        /// Determines if a context has an open generic type map defined
        /// </summary>
        bool HasOpenGenericTypeMapDefined(ResolutionContext context);
    }
}


text:
Haml::Template.options[:format] = :html5
Haml::Template.options[:ugly] = RAILS_ENV == 'production'


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Beih. Nova Hedwigia 18: 312 (1965)

#### Original name
Stereopsis nigripes D.A. Reid, 1965

### Remarks
null


text:
package university.wur;

import org.caleydo.core.internal.cmd.AOpenViewHandler;
import org.caleydo.vis.lineup.model.RankTableModel;

import demo.ARcpRankTableDemoView;
import demo.IModelBuilder;
import demo.project.model.RankTableSpec;

/**
 * @author Samuel Gratzl
 *
 */
public class WorldUniversityRanking2012View extends ARcpRankTableDemoView {
	private static final String ID = "lineup.demo.university.wur2012";

	@Override
	public IModelBuilder createModel(RankTableSpec tableSpec) {
		return new WorldUniversityRanking2012(tableSpec);
	}

	@Override
	protected String getCopyright() {
		return "QS World University Rankings® - 2012/2013";
	}

	@Override
	public RankTableSpec createRankTableSpec() {
		RankTableModel t = getTable();
		RankTableSpec tableSpec = t == null ? null : RankTableSpec.save(t, AWorldUniversityRanking.DATA_CREATOR);
		return tableSpec;
	}

	@Override
	public String getViewGUIID() {
		return ID;
	}

	public static class Handler extends AOpenViewHandler {
		public Handler() {
			super(ID);
		}
	}
}


text:
Rails.application.routes.draw do
  devise_for :users

  resources :protected

  mount Devise::Oauth2Providable::Engine => '/oauth2'
end


text:
This is a micropass compiler, translating the code in numerous
simple steps.  The more the merrier as that's easier to debug.
The passes are split up into "ends": the front-, middle and
back-end.  All code has to go through the front-end before the
other ends in order to collect as much data as possible required
to generate code of acceptable efficiency.

Aside from gathering that information the front-end breaks down
the code into assembly-style control flow made of goto statements
only.  It also moves expressions out of argument lists by assigning
them to temporary variables which replace them in the argument lists.
The middle-end connects the dots by building a tree of FUNINFO
objects and performs tailcall and peephole optimizations.
The back-end is left to generate the code.  Stack places are
assigned here if required (e.g. for C, bytecode or PHP closures).


text:
package pl.szymonmatejczyk.subgraphsampling

import com.twitter.cassovary.graph.Graph

/**
 * Created by szymonmatejczyk on 26.03.15.
 */
class MHSampling(graph: Graph) {
//  def neighbors(subraphNodes: collection.Set[Int]): Seq[collection.Set[Int]] = {
//
//  }
}


text: export { default as DefaultPage } from './page';


text:
Engine::Engine() {
  // Create a window
  //int w = sf::VideoMode().getDesktopMode().width;
  //int h = sf::VideoMode().getDesktopMode().height;
  int w = 800;
  int h = 600;
  main_window_.create(sf::VideoMode(w, h), "My Game");
  main_window_.setVerticalSyncEnabled(true);
}

Engine::~Engine() {

}

void Engine::Run() {
  game_loop_.Loop(main_window_);
}


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/html; charset=UTF-8"/>
<title></title>
<#include "/jeecms_sys/head.html"/>

<@s.m "global.position"/>: <@s.m "template.function"/> - <@s.m "global.add"/>

	<form class="ropt">
		<input type="hidden" name="root" value="${root}"/>
		<input class="return-button" type="submit" value="<@s.m "global.backToList"/>" onclick="this.form.action='v_list.do';"/>
	</form>

<form action="v_add.do" style="padding-top:5px;">
<input type="hidden" name="root" value="${root}"/>
<input type="radio" name="style" value="textarea" checked="checked" onclick="this.form.submit();" style="margin-left:40px;"/><@s.m "template.textarea"/>
<input type="radio" name="style" value="editor" onclick="this.form.submit();" style="margin-left:95px;"/><@s.m "template.editor"/>
</form>

<@p.form id="jvForm" action="o_save.do" labelWidth="15">
<@p.text  colspan="1" width="50" label="template.filename" name="filename" size="30" required="true" class="required" maxlength="100" help=".html"/>
<@p.td colspan="1" >
<input id="directiveButton" class="pfzgl" type="button" value="<@s.m 'directive.directives'/>"/>
</@p.td><@p.tr/>
<@p.td colspan="2"><@p.textarea id="source" name="source" style="width:90%;height:350px" wrap="off" maxlength="1232896"/></@p.td><@p.tr/>
<@p.td colspan="2">
	<input type="hidden" name="root" value="${root}"/>
	<@p.submit code="global.submit"/>   <@p.reset code="global.reset"/>
</@p.td>
</@p.form>

<div id="directiveDialog" title="<@s.m 'directive.directives'/>">

<@s.m  "directive.directives.help"/>

	<@s.m "directive.directives"/><select name="tpl" id="selectTpl" onchange="selectTpl()">
	<#list directives as d>
	<option value="${d.id}">${d.name!}</option>
	</#list>
	</select> <input id="tempImport" type="button" value="<@s.m 'directive.directive.temp'/>"/>

	<@s.m "directive.description"/>
<#if directives?size gt 0>${directives[0].description!}</#if>

	<@s.m "directive.code"/><textarea  id="selectCode" cols="40" rows="8"><#if directives?size gt 0>${directives[0].code!}</#if></textarea>
	<#list directives as d>
	<textarea style="display: none;" id="t_${d.id}">${d.code!}</textarea>
	<textarea style="display: none;" id="d_${d.id}">${d.description!}</textarea>
	</#list>

<div id="tempDialog" title="<@s.m 'directive.directives'/>">

<@s.m  "directive.directives.help"/>

	<@p.form id="tempForm" action="../directive/v_getcode.do" labelWidth="12">
	<@p.td required="true" label='directive.module' colspan='2' width="100">
	<@p.select onchange="selectModule()" list={"channel":"directive.channel","content":"directive.content","comment":"directive.comment","topic":"directive.topic","vote":"directive.vote","guestbook":"directive.guestbook","advertise":"directive.advertise","link":"directive.link","tag":"directive.tag"} name="module" id="module" colspan="2" width="100"/>
	</@p.td>
	<@p.tr/>
	<@p.td colspan="2" label='directive.module.rule' colspan='2' width="100" >

	</@p.td><@p.tr/>
	<@p.td colspan="2" width="100" ><@p.submit code="directive.code.insert"/></@p.td>
	</@p.form>


text:
function DirRFModel_example2

% DIRRFMODEL_EXAMPLE2 -
%     Generating a firing rate with hand-picked kernel, then Reconstructing the linear kernel from that firing rate.
%    (Note that there are no spikes generated here, that is DIRRFMODEL_EXAMPLE3)

% STEP 1  - Generate a hand-picked kernel

 % kernel parameters

Stimx = [0:0.1:10]; Stimt = [0:0.1:100];
Dx = [ Stimx ]; Dt = [ 0:0.001:1]; % these are the time and space values for the hand-picked kernel
dt = 0.001; % our time resolution for our kernel, both for computing response and reverse-correlation
SpFreq = 1; TFreq = 4; Left = 1; Right = -1; Stim_Center_Position = 3;

  % make the kernel
D = createdirkernel(Dx,Dt,SpFreq,0,TFreq,Left,[Stim_Center_Position 2],[0.1 0.001 0.2],0.100);
  % D has units of Volts / (unit contrast * unit time * unit space)

% STEP 2 - Generate a noise stimulus

   % alpha is probability of seeing -100% or 100% contrast instead of 0% contrast
alpha = 0.4;
stim_random = stim1d_random(Stimx,Stimt,100*[1 0 -1],[alpha 1-2*alpha alpha]);

% STEP 3 - Specify the time coordinates of the kernel we will (re)construct

kerneltimes = Dt;  % these will be the times for the calculated kernel

disp(['Setup complete, now simulating']);

% STEP 4 - simulate the response of the hand-picked kernel to the random stimulus

[R_random,sim_time] = simulate_1dkernel_response(D, Dx,Dt, stim_random, Stimx, Stimt);
Rspikerate_random = 50*rectify(R_random);  % assume units of Hz, 1Hz/mV

% STEP 5 - compute the reverse correlation kernel

disp(['About to compute rate output correlation with the stimulus, this might take a couple minutes....']);

 % now compute the autocorrelation of the stimulus, which is not white noise because it has width in time larger than 1 sample
N = fix((Stimt(2)-Stimt(1)) / dt ); % what is the size of the stimulus pulse in samples of kernel?
stim_autocorrelation = step_autocorrelation((100*100)*alpha, N, 0:length(kerneltimes));
   % stim_autocorrelation has units of contrast squared

[computed_kernel, computed_kernel_unfiltered, correlation_stimulus_response, correlation_stimulus_stimulus] = ...
		reverse_correlation_mv_stepfunc(R_random,sim_time,kerneltimes,Stimt,stim_random,...
		'dt',dt,'dx',Stimx(2)-Stimx(1), 'xc_stimstim',stim_autocorrelation);
   % correlation_stimulus_response has units of Volts * contrast
   % computed kernel has units of D: Volts / [unit time * unit space / unit contrast]

% STEP 6 -  now plot everything

figure;

colormap(gray(256));

 % plot kernel
subplot(3,2,1);

pcolor(Dx,Dt,D); shading flat; xlabel('Visual space (deg)'); ylabel('Time (s)'); title('Kernel'); box off;
clim = get(gca,'clim');

 % plot stim_random

subplot(3,2,3);
pcolor(Stimx,Stimt,stim_random); shading flat;
set(gca,'clim',[-1 1]);
xlabel('Visual space (deg)'); ylabel('Time (s)'); title('Stimulus: Random'); box off;

subplot(3,2,2);

plot(sim_time,R_random,'b');
hold on;
xlabel('Time (s)'); ylabel('Response (V)'); title('Repsonse to random stimulation');
box off;

subplot(3,2,4);

column_with_most_kernel = findclosest(Stimx,Stim_Center_Position);

plot(kerneltimes,D(:,column_with_most_kernel),'b','linewidth',2);
hold on;
plot(kerneltimes,computed_kernel(:,column_with_most_kernel),'r','linewidth',2);
a = axis;
plot(kerneltimes,computed_kernel_unfiltered(:,column_with_most_kernel),'g');
axis(a);
xlabel('Time (s)'); ylabel('Kernel (V/[contrast*time*space])'); title('Original and computed kernels');
box off;
legend('Original kernel','Computed kernel','Computed kernel (unfiltered)');

subplot(3,2,5);
pcolor(Stimx,kerneltimes,computed_kernel); shading flat;
xlabel('Visual space (deg)'); ylabel('Time (s)'); title('Computed kernel'); box off;
set(gca,'clim',clim),

subplot(3,2,6);
pcolor(Stimx,kerneltimes,correlation_stimulus_response); shading flat;
xlabel('Visual space (deg)'); ylabel('Time (s)'); title('Computed kernel'); box off;

disp(['Now you have keyboard control to play with the example. type the word ''dbquit'' to return to the regular command line.']);
keyboard;


text:
module Reports
  class InventoryAdjustments
    FILTERABLE_REASONS = %w[reconciliation spoilage transfer purchase donation other].freeze

    def initialize(params, _session)
      @params = params
    end

    def start_date
      @start_date ||= Time.strptime(@params[:start_date], "%m/%d/%Y").beginning_of_day
    end

    def end_date
      @end_date ||= Time.strptime(@params[:end_date], "%m/%d/%Y").end_of_day
    end

    def each
      Item.unscoped do
        filtered_scope.each do |version|
          yield Reports::InventoryAdjustments::Row.new(version)
        end
      end
    end

    def filtered_reasons
      reasons = @params[:reasons].presence || Reports::InventoryAdjustments::FILTERABLE_REASONS

      [].tap do |result|
        reasons.each do |reason|
          result <<
            if reason == "other"
              "adjustment"
            else
              reason
            end
        end
      end
    end

    def filtered_scope
      Item.paper_trail_version_class
          .includes(:item)
          .where(edit_reason: filtered_reasons)
          .where(created_at: (start_date..end_date))
    end

    class Row
      attr_reader :version
      delegate :item, to: :version
      delegate :description, to: :item, prefix: true

      def initialize(version)
        @version = version
      end

      def date
        version.created_at
      end

      def edit_description
        version.edit_source
      end

      def reason
        version.edit_reason.capitalize
      end

      def value
        @value ||= version.reify.value
      end

      def amount
        @amount ||=
          case version.edit_method
          when "add"
            version.edit_amount
          when "subtract"
            -version.edit_amount
          else
            changed_amount
          end
      end

      def total_value
        amount * value
      end

      private

      def final_count
        version.changeset["current_quantity"].last
      end

      def current_quantity
        version.changeset["current_quantity"].first
      end

      def changed_amount
        return (final_count - current_quantity) unless final_count.nil? || current_quantity.nil?
        raise "Could not determine changed amount for version: #{version.id}"
      end
    end
  end
end


text:
package com.microsoft.azure.management.logic;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * The reference to the key vault key.
 */
public class KeyVaultKeyReference {
    /**
     * The key vault reference.
     */
    @JsonProperty(value = "keyVault", required = true)
    private KeyVaultKeyReferenceKeyVault keyVault;

    /**
     * The private key name in key vault.
     */
    @JsonProperty(value = "keyName", required = true)
    private String keyName;

    /**
     * The private key version in key vault.
     */
    @JsonProperty(value = "keyVersion")
    private String keyVersion;

    /**
     * Get the keyVault value.
     *
     * @return the keyVault value
     */
    public KeyVaultKeyReferenceKeyVault keyVault() {
        return this.keyVault;
    }

    /**
     * Set the keyVault value.
     *
     * @param keyVault the keyVault value to set
     * @return the KeyVaultKeyReference object itself.
     */
    public KeyVaultKeyReference withKeyVault(KeyVaultKeyReferenceKeyVault keyVault) {
        this.keyVault = keyVault;
        return this;
    }

    /**
     * Get the keyName value.
     *
     * @return the keyName value
     */
    public String keyName() {
        return this.keyName;
    }

    /**
     * Set the keyName value.
     *
     * @param keyName the keyName value to set
     * @return the KeyVaultKeyReference object itself.
     */
    public KeyVaultKeyReference withKeyName(String keyName) {
        this.keyName = keyName;
        return this;
    }

    /**
     * Get the keyVersion value.
     *
     * @return the keyVersion value
     */
    public String keyVersion() {
        return this.keyVersion;
    }

    /**
     * Set the keyVersion value.
     *
     * @param keyVersion the keyVersion value to set
     * @return the KeyVaultKeyReference object itself.
     */
    public KeyVaultKeyReference withKeyVersion(String keyVersion) {
        this.keyVersion = keyVersion;
        return this;
    }

}


text:
<?php

/**
 * A base implementation of a queued job that provides some convenience for implementations
 *
 * This implementation assumes that when you created your job class, you initialised the
 * jobData with relevant variables needed to process() your job later on in execution. If you do not,
 * please ensure you do before you queueJob() the job, to ensure the signature that is generated is 'correct'.
 *
 * @author Marcus Nyeholt <marcus@silverstripe.com.au>
 * @license BSD http://silverstripe.org/bsd-license/
 */
abstract class AbstractQueuedJob implements QueuedJob {

	protected $jobData;
	protected $messages = array();
	protected $totalSteps = 0;
	protected $currentStep = 0;
	protected $isComplete = false;

	public function getTitle() {
		return "This needs a title!";
	}

	/**
	 * Sets a data object for persisting by adding its id and type to the serialised vars
	 *
	 * @param DataObject $object
	 * @param string $name
	 * 				A name to give it, if you want to store more than one
	 */
	protected function setObject(DataObject $object, $name = 'Object') {
		$this->{$name . 'ID'} = $object->ID;
		$this->{$name . 'Type'} = $object->ClassName;
	}

	/**
	 * @param string $name
	 */
	protected function getObject($name = 'Object') {
		$id = $this->{$name . 'ID'};
		$type = $this->{$name . 'Type'};
		if ($id) {
			return DataObject::get_by_id($type, $id);
		}
	}

	/**
	 * Return a signature for this queued job
	 *
	 * @return String
	 */
	public function getSignature() {
		return md5(get_class($this) . serialize($this->jobData));
	}

	/**
	 * Generate a somewhat random signature
	 *
	 * useful if you're want to make sure something is always added
	 */
	protected function randomSignature() {
		return md5(get_class($this) . time() . mt_rand(0, 100000));
	}

	/**
	 * By default jobs should just go into the default processing queue
	 *
	 * @return String
	 */
	public function getJobType() {
		return QueuedJob::QUEUED;
	}

	/**
	 * Performs setup tasks the first time this job is run.
	 *
	 * This is only executed once for every job. If you want to run something on every job restart, use the
	 * {@link prepareForRestart} method.
	 */
	public function setup() {
		$this->loadCustomConfig();
	}

	/**
	 * Run when an already setup job is being restarted.
	 */
	public function prepareForRestart() {
		$this->loadCustomConfig();
	}

	/**
	 * Do some processing yourself!
	 */
	public function process() {

	}

	/**
	 * Method for determining whether the job is finished - you may override it if there's
	 * more to it than just this
	 */
	public function jobFinished() {
		return $this->isComplete;
	}

	/**
	 * Called when the job is determined to be 'complete'
	 */
	public function afterComplete() {

	}

	public function getJobData() {
		// okay, we NEED to store the subsite ID if there's one available
		if (!$this->SubsiteID && class_exists('Subsite')) {
			$this->SubsiteID = Subsite::currentSubsiteID();
		}

		$data = new stdClass();
		$data->totalSteps = $this->totalSteps;
		$data->currentStep = $this->currentStep;
		$data->isComplete = $this->isComplete;
		$data->jobData = $this->jobData;
		$data->messages = $this->messages;

		return $data;
	}

	public function setJobData($totalSteps, $currentStep, $isComplete, $jobData, $messages) {
		$this->totalSteps = $totalSteps;
		$this->currentStep = $currentStep;
		$this->isComplete = $isComplete;
		$this->jobData = $jobData;
		$this->messages = $messages;

	}

	/**
	 * Gets custom config settings to use when running the job.
	 *
	 * @return array|null
	 */
	public function getCustomConfig() {
		return $this->CustomConfig;
	}

	/**
	 * Sets custom config settings to use when the job is run.
	 *
	 * @param array $config
	 */
	public function setCustomConfig(array $config) {
		$this->CustomConfig = $config;
	}

	/**
	 * Sets custom configuration settings from the job data.
	 */
	private function loadCustomConfig() {
		$custom = $this->getCustomConfig();

		if (!is_array($custom)) {
			return;
		}

		foreach ($custom as $class => $settings) {
			foreach ($settings as $setting => $value) Config::inst()->update($class, $setting, $value);
		}
	}

	public function addMessage($message, $severity='INFO') {
		$severity = strtoupper($severity);
		$this->messages[] = '[' . date('Y-m-d H:i:s') . "][$severity] $message";
	}

	/**
	 * Convenience methods for setting and getting job data
	 *
	 * @param mixed $name
	 * @param mixed $value
	 */
	public function __set($name, $value) {
		if (!$this->jobData) {
			$this->jobData = new stdClass();
		}
		$this->jobData->$name = $value;
	}

	/**
	 * Retrieve some job data
	 *
	 * @param mixed $name
	 * @return mixed
	 */
	public function __get($name) {
		return isset($this->jobData->$name) ? $this->jobData->$name : null;
	}

}


text:
@(message: String)

<!doctype html>

		<meta charset="UTF-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel="icon" type="image/x-icon" href="@routes.Assets.versioned("images/logo-IT.png")" />
		<title>Informatika Student Portal</title>

        <link rel="stylesheet" href="@routes.Assets.versioned("bootstrap/css/bootstrap.min.css")">
        <link rel="stylesheet" href="@routes.Assets.versioned("stylesheets/main.css")">

INFORMATIKA STUDENT PORTAL

Portal Akademik Mahasiswa

Teknik Informatika UNPAR

							<form action="@routes.Application.submitLogin()" method="POST" name ="loginForm">

									Email

										<input name="email" type="email" class="form-control" id="email-input" placeholder="co: 7312012@student.unpar.ac.id"/>

									Password

										<input name="pass" type="password" class="form-control" id="pw-input" placeholder="********"/>

								 @Html(message)
								<button name="submit" type="submit" class="form-control">Login </button>
							</form>


text:
/**
 *
 */
package com.cardpay.pccredit.manager.web;

import com.wicresoft.jrad.base.web.form.BaseForm;

/**
 * @author shaoming
 *
 * 2014年11月19日   下午1:33:59
 */
public class InformationOfficerEvaluateForm extends BaseForm{

	/**
	 *
	 */
	private static final long serialVersionUID = 1L;
	private String messengerId;
	private String messengerName;
	private String researcherAttitude;
	private String researcherTimely;
	private String researcherAccuracy;
	private String evaluationPeople;
	public String getMessengerId() {
		return messengerId;
	}
	public void setMessengerId(String messengerId) {
		this.messengerId = messengerId;
	}
	public String getMessengerName() {
		return messengerName;
	}
	public void setMessengerName(String messengerName) {
		this.messengerName = messengerName;
	}
	public String getResearcherAttitude() {
		return researcherAttitude;
	}
	public void setResearcherAttitude(String researcherAttitude) {
		this.researcherAttitude = researcherAttitude;
	}
	public String getResearcherTimely() {
		return researcherTimely;
	}
	public void setResearcherTimely(String researcherTimely) {
		this.researcherTimely = researcherTimely;
	}
	public String getResearcherAccuracy() {
		return researcherAccuracy;
	}
	public void setResearcherAccuracy(String researcherAccuracy) {
		this.researcherAccuracy = researcherAccuracy;
	}
	public String getEvaluationPeople() {
		return evaluationPeople;
	}
	public void setEvaluationPeople(String evaluationPeople) {
		this.evaluationPeople = evaluationPeople;
	}

}


text:
var chalk = require('chalk')
  , util = require('util')
  , mkdirp = require('mkdirp')
  , p = require('path')
  , fs = require('fs')

var logger = {
  out: function(stream) {
    if(!stream || typeof stream.write != 'function') {
      throw new TypeError('logger expects a writable stream instance')
    }

    var newline = this.config.newline === false ? '' : '\n'
      , child = this.config.child ? '(' + this.config.child + ') ' : ''

    var self = this

    return function() {

      var args = [].slice.call(arguments)
      var method = args.shift()

      if(process.argv.indexOf('-q') === -1 && process.argv.indexOf('-quiet') === -1) {
        stream.write(child + method + util.format.apply(null, args) + newline);
      }

      return self.logger
    }
  },
  prefix: function(method) {
    if(this.config.prefix)
      return this.config.prefix

    if(this.config.noprefix)
      return ''

    var prefix = ''
    prefix = this.config.nocolors ? method + ': ' : this.config.colors[method](method) + ': '
    prefix = this.config.time ? '[' + new Date().toLocaleString() + '] ' + prefix : prefix

    return prefix
  },
  init: function(child, config) {

    if(typeof child == 'object') {
      config = child
      child = ''
    }

    config = config ? config : {}
    config.child = child || config.child || ''

    var stdout = config.stdout || process.stdout
      , stderr = config.stderr || process.stderr

    config.colors = config.colors || {
      log: chalk.grey,
      info: chalk.blue,
      debug: chalk.cyan,
      warn: chalk.yellow,
      error: chalk.red
    }

    if(config.cwd) {

      var log_path = p.join(config.cwd, 'logs')

      if(!fs.existsSync(log_path)) {
        mkdirp.sync(log_path)
      }

      stderr = fs.createWriteStream(p.join(log_path, 'err.log'))
      stdout = fs.createWriteStream(p.join(log_path, 'out.log'))
    }

    this.config = config
    this.logger = {}

    var self = this

    ;['log', 'info', 'warn', 'error', 'debug'].forEach(function(method) {
      var binder = method == 'log' || method == 'info' || method == 'debug' ? self.out(stdout) : self.out(stderr)
        , prefixer = self.prefix(method)

      self.logger[method] = prefixer.length === 0 ? binder.bind(self) : binder.bind(self, prefixer)
    })

    return this.logger
  }
}

module.exports = logger.init.bind(logger)


text:
package org.oulipo.services;

import org.oulipo.streams.IRI;
import org.oulipo.streams.IriResourceException;

/**
 * Thrown when a request is missing the request body
 */
public class MissingBodyException extends IriResourceException {

	/**
	 *
	 */
	private static final long serialVersionUID = -4879473897613471882L;

	public MissingBodyException(IRI iri) {
		super(iri);
	}

	public MissingBodyException(IRI iri, String message) {
		super(iri, message);
	}

	public MissingBodyException(IRI iri, String message, Throwable cause) {
		super(iri, message, cause);
	}

	public MissingBodyException(IRI iri, Throwable cause) {
		super(iri, cause);
	}

}


text:
#ifndef __CONFIG_ZYNQ_MICROZED_H
#define __CONFIG_ZYNQ_MICROZED_H

#define CONFIG_SYS_SDRAM_SIZE		(1024 * 1024 * 1024)

#define CONFIG_ZYNQ_SERIAL_UART1
#define CONFIG_ZYNQ_GEM0
#define CONFIG_ZYNQ_GEM_PHY_ADDR0	0

#define CONFIG_SYS_NO_FLASH

#define CONFIG_ZYNQ_SDHCI0
#define CONFIG_DEFAULT_DEVICE_TREE	zynq-microzed

#include <configs/zynq-common.h>

#endif /* __CONFIG_ZYNQ_MICROZED_H */


text:
import { VigenereEncoder } from "../../../main/decryptor/converters/VigenereEncoder";
import { Converter } from "../../../main/decryptor/converters/Converter";

describe("VigenereEncoder", () => {
    describe("constructor", () => {
        it("initializes to empty keyword if none given", () => {
            expect(new VigenereEncoder().getKeyword()).toBe("");
        });
        it("initializes to given keyword", () => {
            expect(new VigenereEncoder("Canonn").getKeyword()).toBe("Canonn");
        });
    });

    describe("setKeyword", () => {
        it("updates the keyword", () => {
            const encoder = new VigenereEncoder("Not this one");
            encoder.setKeyword("Canonn");
            expect(encoder.getKeyword()).toBe("Canonn");
        });
    });

    describe("convert", () => {
        it("converts empty string to empty string", () => {
            expect(new VigenereEncoder().convert("")).toBe("");
        });
        it("keeps white-space only string", () => {
            expect(new VigenereEncoder().convert(" \n\r\t")).toBe(" \n\r\t");
        });
        it("keeps unencodable characters", () => {
            expect(new VigenereEncoder().convert("1ö_<")).toBe("1ö_<");
        });
        it("encodes normal lower-case characters", () => {
            expect(new VigenereEncoder("Eagle Mk3").convert("foobar")).toBe("joumed");
        });
        it("encodes normal upper-case characters", () => {
            expect(new VigenereEncoder("Asp Explorer").convert("FOOBAR")).toBe("FGDFXG");
        });
        it("encodes normal mixed-case characters", () => {
            expect(new VigenereEncoder("Anaconda").convert("FooBar")).toBe("FboDoe");
        });
        it("encodes only normal characters in mixed string", () => {
            expect(new VigenereEncoder("Cobra Mk3").convert("#12FooBar!")).toBe("#12HcpSad!");
        });
    });

    describe("toJSON", () => {
        it("serializes the converter", () => {
            expect(new VigenereEncoder("Secret").toJSON()).toEqual({
                "type": "vigenere-encoder",
                "options": {
                    "keyword": "Secret"
                }
            });
        });
        it("does not serialize default option values", () => {
            expect(new VigenereEncoder("").toJSON()).toEqual({
                "type": "vigenere-encoder"
            });
        });
    });

    describe("fromJSON", () => {
        it("deserializes a converter", () => {
            const converter = Converter.fromJSON<VigenereEncoder>({
                "type": "vigenere-encoder",
                "options": {
                    "keyword": "Secret"
                }
            });
            expect(converter).toEqual(jasmine.any(VigenereEncoder));
            expect(converter.getKeyword()).toBe("Secret");
        });
        it("deserializes a converter with default options", () => {
            const converter = Converter.fromJSON<VigenereEncoder>({ "type": "vigenere-encoder" });
            expect(converter).toEqual(jasmine.any(VigenereEncoder));
            expect(converter.getKeyword()).toBe("");
        });
    });
});


text:
Sequel::MySQL.default_engine = 'InnoDB'
Sequel::MySQL.default_charset = 'utf8'

Sequel::Model.plugin :take
Sequel::Model.plugin :validation_class_methods

Sequel::Model.db.extension :pagination
Sequel::Model.db.extension :server_block


text:
set -eu

echo -n "Enter bump type: "
read type

npm test -s
npm run clean -s
npm run build -s

npm version $type
npm publish
git push origin master
conventional-github-releaser -p angular


text:
<?php

namespace Doctrine\Tests\Mocks;

use Doctrine\DBAL\Driver\Connection;
use Doctrine\DBAL\ParameterType;

class DriverConnectionMock implements Connection
{
    public function prepare($prepareString)
    {
    }
    public function query()
    {
    }

    public function quote($input, $type = ParameterType::STRING)
    {
    }

    public function exec($statement)
    {
    }
    public function lastInsertId($name = null)
    {
    }
    public function beginTransaction()
    {
    }
    public function commit()
    {
    }
    public function rollBack()
    {
    }
    public function errorCode()
    {
    }
    public function errorInfo()
    {
    }
}


text:
namespace CommonMobiles.POCO
{
    public class User : PocoBase
    {
        private string _userName;
        public string UserName
        {
            get { return _userName; }
            set
            {
                _userName = value;
                RaisePropertyChanged(() => UserName);
            }
        }

        private string _password;
        public string Password
        {
            get { return _password; }
            set
            {
                _password = value;
                RaisePropertyChanged(() => Password);
            }
        }

        public override string ToString()
        {
            return UserName;
        }
    }
}


text:
<?php
	/*
	Author                      : AASSOU Abdelilah.
	Creation Date               : 08/10/2013
*/

//*********************** autoload begin *****************************
	function classLoad ($myClass) {
		if(file_exists('../model/'.$myClass.'.class.php')){
			include('../model/'.$myClass.'.class.php');
		}
        elseif(file_exists('../controller/'.$myClass.'.class.php')){
			include('../controller/'.$myClass.'.class.php');
		}
    }
    spl_autoload_register("classLoad");
//*********************** autoload end ********************************
include('../view/config.php');
session_start();
	//search processing begin
	$ville = "";
	$recherche = "";
	if(!empty($_POST['srchVille']) or !empty($_POST['recherche'])){
		$ville = htmlspecialchars($_POST['srchVille']);
		$recherche = htmlspecialchars($_POST['recherche']);
		$db = $pdo;
		$annonceManager = new AnnonceManager($db);
		$_SESSION['resultat_recherche'] = $annonceManager->getAnnoncesBySearch($recherche, $ville);
		header('Location:../view/resultat_recherche.php');
	}
	else{
		$link = $_SESSION['source_page'];
		header("Location:".$link);
	}


text:
package com.rupp.timetrack.config;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;

public class SkipNullObjectMapper extends ObjectMapper {
    public void init() {
        setSerializationInclusion(JsonInclude.Include.NON_NULL);

        disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
    }
}


text:
#ifndef __STDDEF
#define __STDDEF

/* $Id$ */

#ifndef NULL
#define NULL ((void*)0)
#endif
#define offsetof(ty,mem) ((size_t)((char*)&((ty*)0)->mem - (char*)0))

typedef long ptrdiff_t;

#if !defined(_SIZE_T) && !defined(_SIZE_T_) && !defined(_SIZE_T_DEFINED)
#define _SIZE_T
#define _SIZE_T_
#define _SIZE_T_DEFINED
typedef unsigned long size_t;
#endif

#if !defined(_WCHAR_T) && !defined(_WCHAR_T_) && !defined(_WCHAR_T_DEFINED)
#define _WCHAR_T
#define _WCHAR_T_
#define _WCHAR_T_DEFINED
#if   (_WCHAR_T_SIZE + 0) == 1
typedef unsigned char wchar_t;
#elif (_WCHAR_T_SIZE + 0) == 2
typedef unsigned short wchar_t;
#elif (_WCHAR_T_SIZE + 0) == 4
typedef unsigned int wchar_t;
#else
typedef unsigned short wchar_t;
#endif
#endif

#endif /* __STDDEF */


text:
/*
 * This set (target) cpu specific macros:
 *      - Possible values:
 *              NPY_CPU_X86
 *              NPY_CPU_AMD64
 *              NPY_CPU_PPC
 *              NPY_CPU_PPC64
 *              NPY_CPU_PPC64LE
 *              NPY_CPU_SPARC
 *              NPY_CPU_S390
 *              NPY_CPU_IA64
 *              NPY_CPU_HPPA
 *              NPY_CPU_ALPHA
 *              NPY_CPU_ARMEL
 *              NPY_CPU_ARMEB
 *              NPY_CPU_SH_LE
 *              NPY_CPU_SH_BE
 *              NPY_CPU_ARCEL
 *              NPY_CPU_ARCEB
 */
#ifndef _NPY_CPUARCH_H_
#define _NPY_CPUARCH_H_

#include "numpyconfig.h"
#include <string.h> /* for memcpy */

#if defined( __i386__ ) || defined(i386) || defined(_M_IX86)
    /*
     * __i386__ is defined by gcc and Intel compiler on Linux,
     * _M_IX86 by VS compiler,
     * i386 by Sun compilers on opensolaris at least
     */
    #define NPY_CPU_X86
#elif defined(__x86_64__) || defined(__amd64__) || defined(__x86_64) || defined(_M_AMD64)
    /*
     * both __x86_64__ and __amd64__ are defined by gcc
     * __x86_64 defined by sun compiler on opensolaris at least
     * _M_AMD64 defined by MS compiler
     */
    #define NPY_CPU_AMD64
#elif defined(__ppc__) || defined(__powerpc__) || defined(_ARCH_PPC)
    /*
     * __ppc__ is defined by gcc, I remember having seen __powerpc__ once,
     * but can't find it ATM
     * _ARCH_PPC is used by at least gcc on AIX
     */
    #define NPY_CPU_PPC
#elif defined(__ppc64le__)
    #define NPY_CPU_PPC64LE
#elif defined(__ppc64__)
    #define NPY_CPU_PPC64
#elif defined(__sparc__) || defined(__sparc)
    /* __sparc__ is defined by gcc and Forte (e.g. Sun) compilers */
    #define NPY_CPU_SPARC
#elif defined(__s390__)
    #define NPY_CPU_S390
#elif defined(__ia64)
    #define NPY_CPU_IA64
#elif defined(__hppa)
    #define NPY_CPU_HPPA
#elif defined(__alpha__)
    #define NPY_CPU_ALPHA
#elif defined(__arm__) && defined(__ARMEL__)
    #define NPY_CPU_ARMEL
#elif defined(__arm__) && defined(__ARMEB__)
    #define NPY_CPU_ARMEB
#elif defined(__sh__) && defined(__LITTLE_ENDIAN__)
    #define NPY_CPU_SH_LE
#elif defined(__sh__) && defined(__BIG_ENDIAN__)
    #define NPY_CPU_SH_BE
#elif defined(__MIPSEL__)
    #define NPY_CPU_MIPSEL
#elif defined(__MIPSEB__)
    #define NPY_CPU_MIPSEB
#elif defined(__or1k__)
    #define NPY_CPU_OR1K
#elif defined(__aarch64__)
    #define NPY_CPU_AARCH64
#elif defined(__mc68000__)
    #define NPY_CPU_M68K
#elif defined(__arc__) && defined(__LITTLE_ENDIAN__)
    #define NPY_CPU_ARCEL
#elif defined(__arc__) && defined(__BIG_ENDIAN__)
    #define NPY_CPU_ARCEB
#else
    #error Unknown CPU, please report this to numpy maintainers with \
    information about your platform (OS, CPU and compiler)
#endif

#define NPY_COPY_PYOBJECT_PTR(dst, src) memcpy(dst, src, sizeof(PyObject *))

#if (defined(NPY_CPU_X86) || defined(NPY_CPU_AMD64))
#define NPY_CPU_HAVE_UNALIGNED_ACCESS 1
#else
#define NPY_CPU_HAVE_UNALIGNED_ACCESS 0
#endif

#endif


text:
<!DOCTYPE html>

<meta charset="utf-8">

<title>class Credential - Rails Application Documentation</title>

<link href="./css/fonts.css" rel="stylesheet">
<link href="./css/rdoc.css" rel="stylesheet">

    Home

    Pages
    Classes
    Methods

  <form action="#" method="get" accept-charset="utf-8">

      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">

  </form>

Parent

ActiveRecord::Base

Methods

::key_info?

::key_valid?

#expired?

#expiring?

#login

#nonexpired?

#status

    class Credential

SSH Credential class

Constants

EXPIRED_AGE

EXPIRING_AGE

Public Class Methods

          key_info?(key)

          click to toggle source

# File app/models/credential.rb, line 12
def self.key_info?(key)
  info = { valid: key_valid?(key) }
  info.merge!(bits: key_bits(key), fingerprint: key_fingerprint(key)) if info[:valid]
  info
end

          key_valid?(key)

          click to toggle source

# File app/models/credential.rb, line 18
def self.key_valid?(key)
  SSHKey.valid_ssh_public_key? key
end

Public Instance Methods

          expired?()

          click to toggle source

# File app/models/credential.rb, line 22
def expired?
  created_at < EXPIRED_AGE.days.ago
end

          expiring?()

          click to toggle source

# File app/models/credential.rb, line 26
def expiring?
  (created_at < EXPIRING_AGE.days.ago) && !expired?
end

          login()

          click to toggle source

# File app/models/credential.rb, line 44
def login
  [username, host].join '@'
end

          nonexpired?()

          click to toggle source

# File app/models/credential.rb, line 30
def nonexpired?
  !expired?
end

          status()

          click to toggle source

# File app/models/credential.rb, line 34
def status
  if expired?
    'Expired'
  elsif expiring?
    'Expiring'
  else
    'Nonexpired'
  end
end

Validate

Generated by RDoc 4.2.0.

Based on Darkfish by Michael Granger.


text:
namespace res
{
	ReloadNotify::~ReloadNotify()
	{
	}
}


text:
usage() {
	echo 'Select mentions in linked text by CoNLL03 Shared Task entity types.

Usage: '$0' conll03ner/etc/tags.eng.testb linked1 ...

Produces files such as linked1.PER, linked1.LOC, linked1.ORG, linked1.MISC
containing only the corresponding entity mentions in the evaluation format.
' >&2
	exit 2
}

CNE=./nel

CONLL_TAGS_PATH=$1
shift

if [ -z "$CONLL_TAGS_PATH" ]
then
	usage
fi

while [ -n "$1" ]
do
	for netype in PER LOC ORG MISC
	do
		echo $1.$netype >&2
		$CNE filter-mentions $netype -f3 -d' ' --aux "$CONLL_TAGS_PATH" "$1" > "$1.$netype" || exit 1
	done

	shift
done


text:
import { Component } from '@angular/core';
// #docregion imports
import { FormGroup, FormControl } from '@angular/forms';
// #enddocregion imports

@Component({
  selector: 'app-profile-editor',
  templateUrl: './profile-editor.component.html',
  styleUrls: ['./profile-editor.component.css']
})
export class ProfileEditorComponent {
// #docregion formgroup-compare
  profileForm = new FormGroup({
    firstName: new FormControl(''),
    lastName: new FormControl(''),
// #enddocregion formgroup
    address: new FormGroup({
      street: new FormControl(''),
      city: new FormControl(''),
      state: new FormControl(''),
      zip: new FormControl('')
    })
// #docregion formgroup
  });
// #enddocregion formgroup, nested-formgroup, formgroup-compare
// #docregion patch-value
  updateProfile() {
    this.profileForm.patchValue({
      firstName: 'Nancy',
      address: {
        street: '123 Drew Street'
      }
    });
  }
// #enddocregion patch-value
// #docregion formgroup, nested-formgroup
}
// #enddocregion formgroup


text:
using System;
using System.Text.RegularExpressions;

namespace Shouldly.MessageGenerators
{
    internal class DictionaryShouldContainKeyAndValueMessageGenerator : ShouldlyMessageGenerator
    {
        private static readonly Regex Validator = new Regex("ShouldContainKeyAndValue", RegexOptions.Compiled);
        public override bool CanProcess(ShouldlyAssertionContext context)
        {
            return Validator.IsMatch(context.ShouldMethod);
        }

        public override string GenerateErrorMessage(ShouldlyAssertionContext context)
        {
            const string format = @"
    Dictionary
        ""{0}""
    should contain key
        ""{1}""
    with value
        ""{2}""
    {3}";

            var codePart = context.CodePart;
            var expectedValue = context.Expected.ToStringAwesomely();
            var actualValue = context.Actual.ToStringAwesomely();
            var keyValue = context.Key.ToStringAwesomely();

            if (context.HasRelevantKey)
            {
                var valueString = string.Format("but value was \"{0}\"", actualValue.Trim('"'));
                return String.Format(format, codePart, keyValue.Trim('"'), expectedValue.Trim('"'), valueString);
            }
            else
            {
                return String.Format(format, codePart, actualValue.Trim('"'), expectedValue.Trim('"'), "but the key does not exist");
            }
        }
    }
}


text:
/*
 * Hibernate, Relational Persistence for Idiomatic Java
 *
 * License: GNU Lesser General Public License (LGPL), version 2.1 or later
 * See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html
 */
package org.hibernate.query.sqm.produce.spi.criteria.from;

import java.util.List;
import javax.persistence.criteria.Expression;
import javax.persistence.criteria.ListJoin;
import javax.persistence.criteria.Predicate;

/**
 * @author Steve Ebersole
 */
public interface JpaListJoin<Z,E> extends JpaPluralAttributeJoin<Z,List<E>,E>, ListJoin<Z,E> {
	@Override
	JpaListJoin<Z, E> on(Expression<Boolean> restriction);

	@Override
	JpaListJoin<Z, E> on(Predicate... restrictions);
}


text:
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/**
 *	Contains all memory macros.
 *	\file		memory_macros.h
 *	\author		Hua Fei Yu
 *	\date		July 17, 2011
 *  \brief      Based on Pierre Terdiman's IceMemoryMacros
 */
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Include Guard
#ifndef MEMORY_MACROS_H
#define MEMORY_MACROS_H

// Headers
#include <string.h>

#undef ZeroMemory
#undef CopyMemory
#undef MoveMemory
#undef FillMemory

	//!	\fn         Clears a buffer.
	//!	\param		addr	[in] buffer address
	//!	\param		size	[in] buffer length
	inline void ZeroMemory(void* addr, unsigned int size)					    { memset(addr, 0, size);		}

	//!	\fn         Fills a buffer with a given byte.
	//!	\param		addr	[in] buffer address
	//!	\param		size	[in] buffer length
	//!	\param		val		[in] the byte value
	inline void FillMemory(void* dest, unsigned int size, unsigned char val)			{ memset(dest, val, size);		}

	//! \fn         Copies a buffer.
	//!	\param		addr	[in] destination buffer address
	//!	\param		addr	[in] source buffer address
	//!	\param		size	[in] buffer length
	inline void CopyMemory(void* dest, const void* src, unsigned int size)	    { memcpy(dest, src, size);		}

	//!	\fn         Moves a buffer.
	//!	\param		addr	[in] destination buffer address
	//!	\param		addr	[in] source buffer address
	//!	\param		size	[in] buffer length
	inline void MoveMemory(void* dest, const void* src, unsigned int size)	    { memmove(dest, src, size);		}

    #define DELETESINGLE(x)		if (x) { delete x;      x = 0; }		//!< Deletes an instance of a class.
	#define DELETEARRAY(x)		if (x) { delete []x;    x = 0; }		//!< Deletes an array.

#endif // MEMORY_MACROS_H


text:
  /**
   * Abstract base class for implementations of the Observer class.
   * This base class enforces the grammar of observers where OnError and OnCompleted are terminal messages.
   */
  var AbstractObserver = Rx.internals.AbstractObserver = (function (__super__) {
    inherits(AbstractObserver, __super__);

    /**
     * Creates a new observer in a non-stopped state.
     */
    function AbstractObserver() {
      this.isStopped = false;
      __super__.call(this);
    }

    /**
     * Notifies the observer of a new element in the sequence.
     * @param {Any} value Next element in the sequence.
     */
    AbstractObserver.prototype.onNext = function (value) {
      if (!this.isStopped) { this.next(value); }
    };

    /**
     * Notifies the observer that an exception has occurred.
     * @param {Any} error The error that has occurred.
     */
    AbstractObserver.prototype.onError = function (error) {
      if (!this.isStopped) {
        this.isStopped = true;
        this.error(error);
      }
    };

    /**
     * Notifies the observer of the end of the sequence.
     */
    AbstractObserver.prototype.onCompleted = function () {
      if (!this.isStopped) {
        this.isStopped = true;
        this.completed();
      }
    };

    /**
     * Disposes the observer, causing it to transition to the stopped state.
     */
    AbstractObserver.prototype.dispose = function () {
      this.isStopped = true;
    };

    AbstractObserver.prototype.fail = function (e) {
      if (!this.isStopped) {
        this.isStopped = true;
        this.error(e);
        return true;
      }

      return false;
    };

    return AbstractObserver;
  }(Observer));


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Cytodiplospora mori I. Miyake

### Remarks
null