text:
/**
 UpdateController.js
  - requires jQuery, Bacon.js
*/

;(function(exports) {

	var ReleasesUrl = 'https://api.github.com/repos/secdec/codepulse/releases'
	var CheckInterval = 6 * 60 * 60 * 1000 // check for updates every 6 hours

	function UpdateController() {
		var self = this

		var releaseBus = new Bacon.Bus
		this.release = releaseBus.toProperty().noLazy()

		function getVersion(callback) {
			$.getJSON(CodePulse.apiPath('version'), function(versionInfo) {
				callback(versionInfo.appVersion)
			})
		}

		function getLatestRelease(callback) {
			function getReleasePage(page, callback) {
				$.getJSON(ReleasesUrl, { page: page }, callback)
			}

			function recurse(page) {
				getReleasePage(page, function(releases) {
					if (releases.length > 0) {
						var filtered = releases.filter(function(release) { return !release.prerelease })
						var rel = filtered[0]

						if (rel)
							callback(rel)
						else
							recurse(page + 1)
					}
				})
			}

			recurse(1)
		}

		/** returns true if `releaseVersion` is newer than `ourVersion` */
		function compareVersions(ourVersion, releaseVersion) {
			// strip off any suffix (like -RC1)
			var ourParts = ourVersion.split('-')[0].split('.'), releaseParts = releaseVersion.split('-')[0].split('.')
			for (var i = 0, l = Math.max(ourParts.length, releaseParts.length); i < l; i++) {
				var our = parseInt(ourParts[i]) || 0,
					current = parseInt(releaseParts[i]) || 0

				if (our < current) return true
				else if (our > current) break
			}

			return false
		}

		/** returns true if the user has ignored this version */
		function isUpdateIgnored(version) {
			return CodePulse.storage.getItem('updater.ignoredVersion') == version
		}

		this.ignoreCurrentRelease = function() { CodePulse.storage.setItem('updater.ignoredVersion', self.releaseVersion) }

		/** checks `release`, firing off the appropriate events as necessary */
		function checkRelease(release) {
			getVersion(function (ourVersion) {
                if (ourVersion == "UNVERSIONED") {
                    return;
                }
				var releaseVersion = release.tag_name.replace(/^v/, '')
				self.releaseVersion = releaseVersion

				if (compareVersions(ourVersion, releaseVersion) && !isUpdateIgnored(releaseVersion))
					releaseBus.push({
						version: releaseVersion,
						url: release.html_url
					})
			})
		}

		function runUpdateCheck() {
			console.log('Fetching latest Code Pulse release on GitHub...')
			getLatestRelease(function(latestRelease) {
				checkRelease(latestRelease)

				CodePulse.storage.setItem('updater.latestReleaseCache', JSON.stringify(latestRelease))
				CodePulse.storage.setItem('updater.lastCheck', Date.now())
				setTimeout(runUpdateCheck, CheckInterval)
			})
		}

		/** schedule an update check (or run one immediately), based on the last check time */
		function scheduleUpdateCheck() {
			var lastCheck = parseInt(CodePulse.storage.getItem('updater.lastCheck'))
			var curTime = Date.now()

			if (!lastCheck || curTime > (lastCheck + CheckInterval))
				runUpdateCheck()
			else {
				// run full update check later
				setTimeout(runUpdateCheck, lastCheck + CheckInterval - curTime)

				// for now, check what's cached, if we can
				var cachedRelease = JSON.parse(CodePulse.storage.getItem('updater.latestReleaseCache'))
				if (cachedRelease)
					checkRelease(cachedRelease)
			}
		}

		scheduleUpdateCheck()
	}

	exports.updateController = new UpdateController

})(this)

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 333046 $ -->
<refentry xml:id="function.oci-num-fields" xmlns="http://docbook.org/ns/docbook">
 <refnamediv>
  <refname>oci_num_fields</refname>
  <refpurpose>Returns the number of result columns in a statement</refpurpose>
 </refnamediv>

 <refsect1 role="description">
  &reftitle.description;
  <methodsynopsis>
   <type>int</type><methodname>oci_num_fields</methodname>
   <methodparam><type>resource</type><parameter>statement</parameter></methodparam>
  </methodsynopsis>
  <para>
   Gets the number of columns in the given <parameter>statement</parameter>.
  </para>
 </refsect1>

 <refsect1 role="parameters">
  &reftitle.parameters;
  <para>
   <variablelist>
    <varlistentry>
     <term><parameter>statement</parameter></term>
     <listitem>
      <para>
       A valid OCI statement identifier.
      </para>
     </listitem>
    </varlistentry>
   </variablelist>
  </para>
 </refsect1>

 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   Returns the number of columns as an integer, or &false; on errors.
  </para>
 </refsect1>

 <refsect1 role="examples">
  &reftitle.examples;
  <para>
   <example>
    <title><function>oci_num_fields</function> example</title>
    <programlisting role="php">
<![CDATA[
<?php

// Create the table with:
//   CREATE TABLE mytab (id NUMBER, quantity NUMBER);

$conn = oci_connect("hr", "hrpwd", "localhost/XE");
if (!$conn) {
    $m = oci_error();
    trigger_error(htmlentities($m['message']), E_USER_ERROR);
}

$stid = oci_parse($conn, "SELECT * FROM mytab");
oci_execute($stid, OCI_DESCRIBE_ONLY); // Use OCI_DESCRIBE_ONLY if not fetching rows

$ncols = oci_num_fields($stid);
for ($i = 1; $i <= $ncols; $i++) {
    echo oci_field_name($stid, $i) . " " . oci_field_type($stid, $i) . "<br>\n";
}

// Outputs:
//    ID NUMBER
//    QUANTITY NUMBER

oci_free_statement($stid);
oci_close($conn);

?>
]]>
    </programlisting>
   </example>
  </para>
 </refsect1>

 <refsect1 role="notes">
  &reftitle.notes;
  <note>
   <para>
    In PHP versions before 5.0.0 you must use <function>ocinumcols</function> instead.
    This name still can be used, it was left as alias of
    <function>oci_num_fields</function> for downwards compatability.
    This, however, is deprecated and not recommended.
   </para>
  </note>
 </refsect1>

</refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->


text:
# Running the OrientDB Server

When you finish installing OrientDB, whether you build it from source or download the binary package, you are ready to launch the database server.  You can either start it through the system daemon or through the provided server script.  This article only covers the latter.

>**Note**: If you would like to run OrientDB as a service on your system, there are some additional steps that you need to take.  This provides alternate methods for starting the server and allows you to launch it as a daemon when your system boots.  For more information on this process see:
>
>- [Install OrientDB as a Service on Unix, Linux and Mac OS X ](Unix-Service.md)
>- [Install OrientDB as a Service on Microsoft Windows](Windows-Service.md)

## Starting the Database Server

While you can run the database server as system daemon, you also have the option of starting it directly.  In the OrientDB installation directory, (that is `$ORIENTDB_HOME`), under `bin`, there is a file named `server.sh` on Unix-based systems and `server.bat` on Windows.  Executing this file starts the server.

To launch the OrientDB database server, run the following commands:

$ cd $ORIENTDB_HOME/bin
$ ./server.sh

            .
           .`        `
        ,      `:.
          `,`    ,:`
          .,.   :,,
          .,,  ,,,
     .    .,.:::::  ````
     ,`   .::,,,,::.,,,,,,`;;                      .:
     `,.  ::,,,,,,,:.,,.`  `                       .:
      ,,:,:,,,,,,,,::.   `        `         ``     .:
       ,,:.,,,,,,,,,: `::, ,,   ::,::`   : :,::`  ::::
        ,:,,,,,,,,,,::,:   ,,  :.    :   ::    :   .:
         :,,,,,,,,,,:,::   ,,  :      :  :     :   .:
   `     :,,,,,,,,,,:,::,  ,, .::::::::  :     :   .:
   `,...,,:,,,,,,,,,: .:,. ,, ,,         :     :   .:
     .,,,,::,,,,,,,:  `: , ,,  :     `   :     :   .:
       ...,::,,,,::.. `:  .,,  :,    :   :     :   .:
            ,::::,,,. `:   ,,   :::::    :     :   .:
            ,,:` `,,.
           ,,,    .,`
          ,,.     `,                      S E R V E R
        ``        `.
                  ``
                  `

2012-12-28 01:25:46:319 INFO Loading configuration from: config/orientdb-server-config.xml... [OServerConfigurationLoaderXml]
2012-12-28 01:25:46:625 INFO OrientDB Server v1.6 is starting up... [OServer]
2012-12-28 01:25:47:142 INFO -> Loaded memory database 'temp' [OServer]
2012-12-28 01:25:47:289 INFO Listening binary connections on 0.0.0.0:2424 [OServerNetworkListener]
2012-12-28 01:25:47:290 INFO Listening http connections on 0.0.0.0:2480 [OServerNetworkListener]
2012-12-28 01:25:47:317 INFO OrientDB Server v1.6 is active. [OServer]

The database server is now running.  It is accessible on your system through ports `2424` and `2480`.
At the first startup the server will ask for the root user password. The password is stored in the config file.

### Stop the Server

On the console where the server is running a simple CTRL+c will shutdown the server.

The shutdown.sh (shutdown.bat) script could be used to stop the server:

$ cd $ORIENTDB_HOME/bin
$ ./shutdown.sh -p ROOT_PASSWORD

On ***nix** systems a simple call to shutdown.sh will stop the server running on localhost:

$ cd $ORIENTDB_HOME/bin
$ ./shutdown.sh

It is possible to stop servers running on remote hosts or even on different ports on localhost:

$ cd $ORIENTDB_HOME/bin
$ ./shutdown.sh -h odb1.mydomain.com -P 2424-2430 -u root -p ROOT_PASSWORD

List of params

- -h | --host **HOSTNAME or IP ADDRESS** : the host or ip where OrientDB is running, default to **localhost**
- -P | --ports **PORT or PORT RANGE** : single port value or range of ports; default to **2424-2430**
- -u | --user **ROOT USERNAME** : root's username; deafult to  **root**
- -p | --password **ROOT PASSWORD** : root's user password; **mandatory**

**NOTE**
On Windows systems password is always **mandatory** because the script isn't able to discover the pid of the OrientDB's process.

### Server Log Messages

Following the masthead, the database server begins to print log messages to standard output.  This provides you with a guide to what OrientDB does as it starts up on your system.

1. The database server loads its configuration file from the file `$ORIENTDB_HOME/config/orientdb-server-config.xml`.

   >For more information on this step, see [OrientDB Server](DB-Server.md).

1. The database server loads the `temp` database into memory.  You can use this database in storing temporary data.

1. The database server begins listening for binary connections on port `2424` for all configured networks, (`0.0.0.0`).

1. The database server begins listening for HTTP connections on port `2480` for all configured networks, (`0.0.0.0`).

## Accessing the Database Server

By default, OrientDB listens on two different ports for external connections.

- **Binary**: OrientDB listens on port `2424` for binary connections from the console and for clients and drivers that support the [Network Binary Protocol](Network-Binary-Protocol.md).

- **HTTP**: OrientDB listens on port `2480` for HTTP connections from [OrientDB Studio Web Tool](http://www.orientechnologies.com/docs/last/orientdb-studio.wiki/Home-page.html) and clients and drivers that support the [HTTP/REST protocol](OrientDB-REST.md), or similar tools, such as [cURL](http://en.wikipedia.org/wiki/cURL).

If you would like the database server to listen at different ports or IP address, you can define these values in the configuration file `config/orientdb-server-config.xml`.


text:
require 'spec_helper'

describe 'Given a SitePrism page object with a date field' do
  let(:page_object) { page_object_klass.new }

  let(:page_object_klass) do
    Class.new(SitePrism::Page) do
      date_field :date_of_birth
    end
  end

  before do
    visit 'date'
  end

  it 'fills up all the tokens' do
    page_object.date_of_birth_field.set Date.new(1985, 2, 15)

    expect(page_object.date_of_birth_field.year_element.value).to eq '1985'
    expect(page_object.date_of_birth_field.month_element.value).to eq '2'
    expect(page_object.date_of_birth_field.day_element.value).to eq '15'
  end
end


text:
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="dpl-info" content="status=ok">
		<title>特效底层</title>
		<script src="../../System/Core/assets/scripts/Base.js" type="text/javascript"></script>
		<script src="../../System/Utils/assets/scripts/Deferrable.js" type="text/javascript"></script>
		<script src="../../System/Fx/assets/scripts/Base.js" type="text/javascript"></script>

		<script src="../../../assets/demo/demo.js" type="text/javascript"></script>
	</head>
	<body>

        <article class="demo">

		    <script>

		        var fx = new Fx();
		        fx.set = function (value) {
                    trace(value);
                };

		        Demo.writeExamples({

				    // 简单创建一个特效。
				    'createAnimate': function () {
				        fx.run({});
                        fx.run({}, 'abort');
                        fx.run({});
				    }
			    }, {times: 8});

		    </script>

        </article>
	</body>
</html>


text:
#ifndef QUICKFMAPPLICATION_H
#define QUICKFMAPPLICATION_H

// [[[ begin generated region: do not modify [Generated Includes]
#include <aknapp.h>
// ]]] end generated region [Generated Includes]

// [[[ begin generated region: do not modify [Generated Constants]
const TUid KUidquickFMApplication = { 0x20040CBC };
// ]]] end generated region [Generated Constants]

/**
 *
 * @class	CquickFMApplication quickFMApplication.h
 * @brief	A CAknApplication-derived class is required by the S60 application
 *          framework. It is subclassed to create the application's document
 *          object.
 */
class CquickFMApplication : public CAknApplication
	{
private:
	TUid AppDllUid() const;
	CApaDocument* CreateDocumentL();

	};

#endif // QUICKFMAPPLICATION_H


text:
body {
  font-family: 'Lora', 'Times New Roman', serif;
  font-size: 20px;
  color: #404040;
}
article,
p {
  line-height: 1.5;
  margin: 30px 0;
}
article a,
p a {
  text-decoration: underline;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 800;
}
a {
  color: #404040;
}
a:hover,
a:focus {
  color: #0085a1;
}
blockquote {
  color: #808080;
  font-style: italic;
}
hr.small {
  max-width: 100px;
  margin: 15px auto;
  border-width: 4px;
  border-color: white;
}
.navbar-custom {
  background: white;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 3;
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
.navbar-custom .navbar-brand {
  font-weight: 800;
}
.navbar-custom .nav li a {
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
}
@media only screen and (min-width: 768px) {
  .navbar-custom {
    background: transparent;
    border-bottom: 1px solid transparent;
  }
  .navbar-custom .navbar-brand {
    color: white;
    padding: 20px;
  }
  .navbar-custom .navbar-brand:hover,
  .navbar-custom .navbar-brand:focus {
    color: rgba(255, 255, 255, 0.8);
  }
  .navbar-custom .nav li a {
    color: white;
    padding: 20px;
  }
  .navbar-custom .nav li a:hover,
  .navbar-custom .nav li a:focus {
    color: rgba(255, 255, 255, 0.8);
  }
}
@media only screen and (min-width: 1170px) {
  .navbar-custom {
    -webkit-transition: background-color 0.3s;
    -moz-transition: background-color 0.3s;
    transition: background-color 0.3s;
    /* Force Hardware Acceleration in WebKit */
    -webkit-transform: translate3d(0, 0, 0);
    -moz-transform: translate3d(0, 0, 0);
    -ms-transform: translate3d(0, 0, 0);
    -o-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
  }
  .navbar-custom.is-fixed {
    /* when the user scrolls down, we hide the header right above the viewport */
    position: fixed;
    top: -61px;
    background-color: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid #f2f2f2;
    -webkit-transition: -webkit-transform 0.3s;
    -moz-transition: -moz-transform 0.3s;
    transition: transform 0.3s;
  }
  .navbar-custom.is-fixed .navbar-brand {
    color: #404040;
  }
  .navbar-custom.is-fixed .navbar-brand:hover,
  .navbar-custom.is-fixed .navbar-brand:focus {
    color: #0085a1;
  }
  .navbar-custom.is-fixed .nav li a {
    color: #404040;
  }
  .navbar-custom.is-fixed .nav li a:hover,
  .navbar-custom.is-fixed .nav li a:focus {
    color: #0085a1;
  }
  .navbar-custom.is-visible {
    /* if the user changes the scrolling direction, we show the header */
    -webkit-transform: translate3d(0, 100%, 0);
    -moz-transform: translate3d(0, 100%, 0);
    -ms-transform: translate3d(0, 100%, 0);
    -o-transform: translate3d(0, 100%, 0);
    transform: translate3d(0, 100%, 0);
  }
}
.intro-header {
  background: no-repeat center center;
  background-color: #808080;
  background-attachment: scroll;
  -webkit-background-size: cover;
  -moz-background-size: cover;
  background-size: cover;
  -o-background-size: cover;
  margin-bottom: 50px;
}
.intro-header .site-heading,
.intro-header .post-heading,
.intro-header .page-heading {
  padding: 100px 0 50px;
  color: white;
}
@media only screen and (min-width: 768px) {
  .intro-header .site-heading,
  .intro-header .post-heading,
  .intro-header .page-heading {
    padding: 150px 0;
  }
}
.intro-header .site-heading,
.intro-header .page-heading {
  text-align: center;
}
.intro-header .site-heading h1,
.intro-header .page-heading h1 {
  margin-top: 0;
  font-size: 50px;
}
.intro-header .site-heading .subheading,
.intro-header .page-heading .subheading {
  font-size: 24px;
  line-height: 1.1;
  display: block;
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 300;
  margin: 10px 0 0;
}
@media only screen and (min-width: 768px) {
  .intro-header .site-heading h1,
  .intro-header .page-heading h1 {
    font-size: 80px;
  }
}
.intro-header .post-heading h1 {
  font-size: 35px;
}
.intro-header .post-heading .subheading,
.intro-header .post-heading .meta {
  line-height: 1.1;
  display: block;
}
.intro-header .post-heading .subheading {
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 24px;
  margin: 10px 0 30px;
  font-weight: 600;
}
.intro-header .post-heading .meta {
  font-family: 'Lora', 'Times New Roman', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 20px;
  color: rgba(255, 255, 255, 0.8);
}
.intro-header .post-heading .meta a {
  color: white;
}
@media only screen and (min-width: 768px) {
  .intro-header .post-heading h1 {
    font-size: 55px;
  }
  .intro-header .post-heading .subheading {
    font-size: 30px;
  }
}
.post-preview > a {
  color: #404040;
}
.post-preview > a:hover,
.post-preview > a:focus {
  text-decoration: none;
  color: #0085a1;
}
.post-preview > a > .post-title {
  font-size: 26px;
  font-weight: 600;
  margin-top: 30px;
  margin-bottom: 10px;
}
.post-preview > a > .post-subtitle {
  margin: 0;
  font-weight: 300;
  margin-bottom: 10px;
}
.post-preview > .post-meta {
  color: rgba(0, 0, 0, 0.3);
  font-size: 16px;
  margin-top: 0;
}
.post-preview > .post-meta > a {
  text-decoration: none;
  color: #404040;
}
.post-preview > .post-meta > a:hover,
.post-preview > .post-meta > a:focus {
  color: #0085a1;
  text-decoration: underline;
}
@media only screen and (min-width: 768px) {
  .post-preview > a > .post-title {
    font-size: 32px;
  }
}
.section-heading {
  font-size: 36px;
  margin-top: 60px;
  font-weight: 700;
}
.caption {
  text-align: center;
  font-size: 14px;
  padding: 10px;
  font-style: italic;
  margin: 0;
  display: block;
  border-bottom-right-radius: 5px;
  border-bottom-left-radius: 5px;
}
footer {
  padding: 50px 0 65px;
}
footer .list-inline {
  margin: 0;
  padding: 0;
}
footer .copyright {
  font-size: 14px;
  text-align: center;
  margin-bottom: 0;
}
.floating-label-form-group {
  font-size: 14px;
  position: relative;
  margin-bottom: 0;
  padding-bottom: 0.5em;
  border-bottom: 1px solid #eeeeee;
}
.floating-label-form-group input,
.floating-label-form-group textarea {
  z-index: 1;
  position: relative;
  padding-right: 0;
  padding-left: 0;
  border: none;
  border-radius: 0;
  font-size: 1.5em;
  background: none;
  box-shadow: none !important;
  resize: none;
}
.floating-label-form-group label {
  display: block;
  z-index: 0;
  position: relative;
  top: 2em;
  margin: 0;
  font-size: 0.85em;
  line-height: 1.764705882em;
  vertical-align: middle;
  vertical-align: baseline;
  opacity: 0;
  -webkit-transition: top 0.3s ease,opacity 0.3s ease;
  -moz-transition: top 0.3s ease,opacity 0.3s ease;
  -ms-transition: top 0.3s ease,opacity 0.3s ease;
  transition: top 0.3s ease,opacity 0.3s ease;
}
.floating-label-form-group::not(:first-child) {
  padding-left: 14px;
  border-left: 1px solid #eeeeee;
}
.floating-label-form-group-with-value label {
  top: 0;
  opacity: 1;
}
.floating-label-form-group-with-focus label {
  color: #0085a1;
}
form .row:first-child .floating-label-form-group {
  border-top: 1px solid #eeeeee;
}
.btn {
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  text-transform: uppercase;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1px;
  border-radius: 0;
  padding: 15px 25px;
}
.btn-lg {
  font-size: 16px;
  padding: 25px 35px;
}
.btn-default:hover,
.btn-default:focus {
  background-color: #0085a1;
  border: 1px solid #0085a1;
  color: white;
}
.pager {
  margin: 20px 0 0;
}
.pager li > a,
.pager li > span {
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  text-transform: uppercase;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 10px 5px;
  background-color: white;
  border-radius: 0;
  margin: 10px 0px;
}
@media only screen and (min-width: 768px) {
  .pager li > a,
  .pager li > span {
    font-size: 14px;
    padding: 15px 25px;
  }
}
.pager li > a:hover,
.pager li > a:focus {
  color: white;
  background-color: #0085a1;
  border: 1px solid #0085a1;
}
.pager .previous > a {
  text-align: left;
  max-width: 48%;
}
.pager .next > a {
  text-align: right;
  max-width: 48%;
}
.pager .disabled > a,
.pager .disabled > a:hover,
.pager .disabled > a:focus,
.pager .disabled > span {
  color: #808080;
  background-color: #404040;
  cursor: not-allowed;
}
::-moz-selection {
  color: white;
  text-shadow: none;
  background: #0085a1;
}
::selection {
  color: white;
  text-shadow: none;
  background: #0085a1;
}
img::selection {
  color: white;
  background: transparent;
}
img::-moz-selection {
  color: white;
  background: transparent;
}
body {
  webkit-tap-highlight-color: #0085a1;
}
li > span.page-number {
  border: 0px;
  font-weight: 400;
}
div.container li a {
  text-decoration: underline;
}
p.post-meta {
  margin: 15px 0;
}
h3.post-subtitle {
  font-size: 18px;
}
.post-preview > a > p {
  margin: 0px 0px 10px;
  line-height: 1.2;
  font-size: 16px;
}
.post-preview > hr {
  margin-top: 10px;
}
blockquote > p {
  margin: 0px 0;
}
img.border {
  border: 1px solid #000000;
}
article > h1,
h2 {
  margin-top: 80px;
  margin-bottom: 30px;
}
article > h3 {
  margin-top: 60px;
  margin-bottom: 20px;
}
article li {
  margin-bottom: 8px;
}
article p img {
  margin: auto;
}
.archive-group {
  position: relative;
}
.archive-group > p {
  margin: 0;
}
.archive-group > a {
  position: absolute;
  top: -60px;
}
div.ads {
  margin: 20px 0px 20px;
}
ul.tag-cloud {
  list-style: none;
  padding: 0;
  text-align: justify;
  font-size: 16px;
}
ul.tag-cloud li {
  display: inline-block;
  margin: 0 12px 12px 0;
}
ul.tag-cloud li a {
  text-decoration: none;
}
.post-tags {
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  margin: auto;
  text-align: center;
}
.post-tags .label {
  color: #808080;
  font-size: 12px;
}
.post-tags .tags a {
  color: #404040;
  text-decoration: underline;
}


text:
from lxml import etree

def parse_ahpi_xml(path):
    """
    Parses the AHPI XML export format of the queensland heritage register
    and calls a function with each heritage place.

    :param path: The location of a heritage_places xml file.
    """
    ns = {'hp': 'http://www.heritage.gov.au/ahpi/heritage_places'}

    tree = etree.parse(path)
    root = tree.getroot()

    for hp_element in root.xpath('//hp:heritage_place', namespaces=ns):
        hp = {
            "date_created": hp_element.get('date_created'),
            "date_modified": hp_element.get('date_modified'),
            "id": hp_element.get('id'),
            "name": hp_element.xpath('hp:name', namespaces=ns)[0].text,
            "addresses": [{
                "street_name": hp_element.xpath('hp:address', namespaces=ns)[0].text,
                "lga_name": hp_element.xpath('hp:lga', namespaces=ns)[0].text,
                "suburb": hp_element.xpath('hp:town', namespaces=ns)[0].text,
                "state": hp_element.xpath('hp:state', namespaces=ns)[0].text,
                "country": hp_element.xpath('hp:country', namespaces=ns)[0].text,
            }],
            "state": hp_element.xpath('hp:state', namespaces=ns)[0].text,
            "category": hp_element.xpath('hp:category', namespaces=ns)[0].text,
            "significance": hp_element.xpath('hp:sos', namespaces=ns)[0].text,
            "description": hp_element.xpath('hp:description', namespaces=ns)[0].text,
            "url": hp_element.xpath('hp:url', namespaces=ns)[0].text,
        }
        try:
            # import ipdb; ipdb.set_trace()
            lat = hp_element.xpath('hp:latitude', namespaces=ns)[0].text
            lon = hp_element.xpath('hp:longitude', namespaces=ns)[0].text
            hp['geolocation'] = {
                "lat": float(lat), "lon": float(lon)
            }
        except TypeError:
            print "error parsing lat/lon %s/%s" % (lat, lon)
            pass

        yield hp

if __name__ == "__main__":
    def myPrint(arg): print arg

    hp_filename = "/mnt/groups/maenad/activities/e-Heritage/QLD/heritage_list.xml"

    result = parse_ahpi_xml(hp_filename, myPrint)
    print result


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC
        "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
        "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>
    <class name="com.ZombieRun.persistence.data.User" table="`user`">
        <id name="idUser" column="iduser">
            <generator class="identity" />
        </id>
        <property name="username" type="string" column="username" />
        <property name="password" type="string" column="password" />
        <property name="email" type="string" column="email" />
        <property name="premium" type="boolean" column="premium" />
        <property name="createTime" type="timestamp" column="create_time"/>
        <property name="lastLoginTime" type="timestamp" column="lastlogin_time" />
        <property name="lastLoginRetry" type="int" column="lastlogin_retry" />
    </class>

    <class name="com.ZombieRun.persistence.data.Character" table="`character`">
        <id name="idCharacter" column="idcharacter">
            <generator class="identity" />
        </id>
        <property name="name" type="string" column="name" />
        <property name="level" type="int" column="level" />
        <property name="experience" type="int" column="experience" />
        <property name="idUser" type="int" column="iduser" />
        <property name="idCharacterClass" type="int" column="idcharacterclass" />
        <property name="idAttribute" type="int" column="idattribute" />
        <property name="active" type="boolean" column="active" />
        <property name="createTime" type="timestamp" column="create_time" />
    </class>

    <class name="com.ZombieRun.persistence.data.Attribute" table="`attribute`">
        <id name="idAttribute" column="idattribute">
            <generator class="identity" />
        </id>
        <property name="strength" type="int" column="strength" />
        <property name="intelligence" type="int" column="intelligence" />
        <property name="dexterity" type="int" column="dexterity" />
    </class>
</hibernate-mapping>


text:
/**
 * (c) 2014 by Christian Schenk
 **/
package de.schenk.objectweb.asm.addons;

/**
 * (c) 2014 by Christian Schenk
 **/
import java.io.IOException;
import java.io.InputStream;
import java.util.HashSet;
import java.util.Set;

import de.schenk.objectweb.asm.ClassReader;
import de.schenk.objectweb.asm.Opcodes;
import de.schenk.objectweb.asm.Type;

public class CommonSuperClassUtil {

	private ClassLoader classLoader;
	private String targetClassName;
	private String superOfTargetClass;
	private Type[] interfacesOfTargetClass;

	/**
	 * Simplified constructor. Slightly less efficient. If you know the
	 * currently instrumented class and its superclass use the other
	 * constructor.
	 *
	 * @param classLoader
	 */
	public CommonSuperClassUtil(ClassLoader classLoader) {
		this(classLoader, "java/lang/Object", null, new Type[0]);
	}

	/**
	 *
	 * Note: targetClassName and superClassName increase the efficiency for the
	 * case that both classes are subtypes of the currently being instrumented
	 * class. (slighty, really necessary?)
	 *
	 * @param classLoader
	 *            the classloader to load the classes in the hierarchy
	 * @param targetClassName
	 *            the currently instrumented class (internal name:
	 *            "java/lang/Object")
	 * @param superClassName
	 *            the superclass of the currently instrumented class (internal
	 *            name: "java/lang/Object")
	 * @param theInterfaceTypes
	 */
	public CommonSuperClassUtil(ClassLoader classLoader,
			String targetClassName, String superClassName,
			Type[] theInterfaceTypes) {

		this.targetClassName = targetClassName;
		this.superOfTargetClass = superClassName;
		this.classLoader = classLoader;
		this.interfacesOfTargetClass = theInterfaceTypes;
	}

	/**
	 * Why is this so complicated: As a rule, all types that extend the object
	 * that is currently instrumented are not yet available as class<?>es. If
	 * the type references it's supertypes ASM will need the commonsuperclass.
	 *
	 * Corner Case: If only one object cannot be loaded, this is definitely
	 * subtype of the instrumented class. Then we search the common subtype of
	 * the instrumented class and the loadable class. -> done.
	 *
	 * If both classes cannot be loaded, they are both either the instrumented
	 * type or a subtype. Currently this method returns the instrumented type as
	 * "guess", but this is wrong in a case like:
	 *
	 * A <-C <-D when class A contains something like:
	 *
	 * <pre>
	 * 		B = new C();
	 *      if(...) B=new D();
	 *      B.methodThatExistsOnCAndDbutnotonA();
	 * </pre>
	 *
	 * (because in this case the common supertype is C and here A is returned.
	 *
	 * Possible options to improve: option a: load resource and parse
	 * super/subtype hierarchy. option b: skip transformation, and schedule for
	 * retransformation and hoep the subtypes are available... :-(
	 */

	public String getCommonSuperClass(String type1, String type2) {

		Class<?> type1Class, type2Class;

		type1Class = tryLoadClass(type1);
		type2Class = tryLoadClass(type2);

		if (type1Class == null || type2Class == null) {
			if (type2Class == null) {
				String swap = type1;
				type1 = type2;
				type2 = swap;
				Class<?> swapClass = type1Class;
				type1Class = type2Class;
				type2Class = swapClass;
			}

			if (type2Class != null) { /*
									 * case: only one of the classes cannot be
									 * loaded
									 */
				if (type2Class.isInterface()) {
					return "java/lang/Object";
				}
				type1 = getSuperClassName(type1);
				return getCommonSuperClass(type1, type2);

			}
			/* case: both types cannot be loaded */
			Set<String> allSuperTypesOfType1 = getAllSuperClassNames(type1);
			while (!allSuperTypesOfType1.contains(type2)) {
				type2 = getSuperClassName(type2);
			}
			return type2;

		} else {

			if (type1Class.isAssignableFrom(type2Class)) {
				return type1;
			}
			if (type2Class.isAssignableFrom(type1Class)) {
				return type2;
			}
			if (type1Class.isInterface() || type2Class.isInterface()) {
				return "java/lang/Object";
			} else {
				do {
					type1Class = type1Class.getSuperclass();
				} while (!type1Class.isAssignableFrom(type2Class));
				return type1Class.getName().replace('.', '/');
			}
		}
	}

	/**
	 *
	 * @param type1
	 *            internal name of the object to load
	 * @return null: if the object is not loadable, the class else.
	 */
	private Class<?> tryLoadClass(String type1) {
		Class<?> type1Class;
		type1Class = null;
		try {

			type1Class = Class.forName(type1.replace('/', '.'), false,
					classLoader);

		} catch (Throwable e) {
			// don't do anything, we will handle that later
		}
		return type1Class;
	}

	/**
	 * recursively walks up the supertype hierarchy stopping only at the
	 * instrumented type and returns everything in a hashset
	 *
	 * @param type1
	 * @return a set containing the class itself and all the supertypes stopping
	 *         and including the currently instrumented type
	 */
	private Set<String> getAllSuperClassNames(String type1) {
		Set<String> set = new HashSet<String>();
		while (true) {
			set.add(type1);
			if (targetClassName.equals(type1))
				return set;
			type1 = getSuperClassName(type1);
		}

	}

	private String getSuperClassName(String type1) {
		if (type1.equals(targetClassName))
			type1 = superOfTargetClass;
		else
			type1 = getSuperAndInterfacesFromBytes(type1).getSuperClass();

		return type1;
	}

	/**
	 * read the classbytes of the type with ASM and extract the supertype from
	 * it.
	 *
	 * @param theType
	 * @return the sueprtype of theType
	 */
	public SuperClassExtractVisitor getSuperAndInterfacesFromBytes(
			String theType) {
		SuperClassExtractVisitor readSuperTypeVisitor = readClassFromBytes(theType);

		return readSuperTypeVisitor;
	}

	private SuperClassExtractVisitor readClassFromBytes(String theType) {
		SuperClassExtractVisitor readSuperTypeVisitor = null;
		InputStream stream = null;
		try {
			stream = ClassByteUtil.getClassBytesStream(theType, classLoader);

			ClassReader reader = new ClassReader(stream);

			readSuperTypeVisitor = new SuperClassExtractVisitor(Opcodes.ASM5);

			reader.accept(readSuperTypeVisitor, 0);
			if (!theType.equals(readSuperTypeVisitor.getType())) {
				throw new RuntimeException("That was unexpected");
			}

			stream.close();
		} catch (IOException e) {
			throw new RuntimeException("Failed reading classbytes for "
					+ theType);
		}
		return readSuperTypeVisitor;
	}

	public boolean getIsInterface(String internalName) {

		Class<?> theClass = tryLoadClass(internalName);
		if (theClass != null)
			return theClass.isInterface();
		SuperClassExtractVisitor readSuperTypeVisitor = readClassFromBytes(internalName);

		return readSuperTypeVisitor.getIsInterface();
	}

	/**
	 * Checks if the input is the output element or an of the interfaces or
	 * supertypes of output.
	 *
	 * @param output
	 *            an object internal name
	 * @param input
	 *            an object internal name
	 *
	 * @return true, if yes
	 */
	public boolean isObjectAssignable(Type output, Type input) {
		/* everything can be assigned to an object */
		if (output.equals(Type.getType(Object.class)))

			return true;

		if (input.equals(output))
			return true;
		Class<?> inputClass = tryLoadClass(input.getInternalName());
		Type inputSuperClassType = null;
		Type[] theInputInterfaces = new Type[0];

		if (input.getInternalName().equals(this.targetClassName)) {
			inputSuperClassType = superOfTargetClass == null ? null : Type
					.getType("L" + this.superOfTargetClass + ";");
			theInputInterfaces = this.interfacesOfTargetClass;

		} else if (inputClass != null) {

			if (inputClass.getSuperclass() != null) {
				inputSuperClassType = Type.getType(inputClass.getSuperclass());

			}

			else
				inputSuperClassType = null;

			Class<?>[] ifaces = inputClass.getInterfaces();
			theInputInterfaces = new Type[ifaces.length];
			for (int i = 0; i < ifaces.length; i++) {
				theInputInterfaces[i] = Type.getType(ifaces[i]);
			}
		}

		else {

			SuperClassExtractVisitor superAndInterfaces = getSuperAndInterfacesFromBytes(input
					.getInternalName());
			inputSuperClassType = superAndInterfaces.getSuperClassAsType();
			theInputInterfaces = superAndInterfaces.getInterfacesAsTypes();

		}

		if (inputSuperClassType != null
				&& isObjectAssignable(output, inputSuperClassType))
			return true;
		for (Type oneInputInterface : theInputInterfaces) {
			if (output.equals(oneInputInterface))
				return true;
			if (isObjectAssignable(output, oneInputInterface))
				return true;
		}
		return false;
	}

}


text:
var fluent = require('..');
var should = require('should');

describe('dynamo.deleteItem(table)', function() {
  var aws, dynamo;

  beforeEach(function() {
    aws = { };

    dynamo = fluent(aws)
      .withAccessKeyId('access')
      .withEndpoint('endpoint')
      .withRegion('region')
      .withSecretAccessKey('secret');
  })

  function deleteItem() {
    return dynamo.deleteItem('Thread')
      .withHashKey('ForumName').asString('Amazon')
      .withRangeKey('Subject').asString('DynamoDB');
  }

  it('should delete the item', function(done) {
    aws.DynamoDB = function(options) {
      should(options).eql({
        accessKeyId: 'access',
        endpoint: 'endpoint',
        region: 'region',
        secretAccessKey: 'secret'
      });
    };

    aws.DynamoDB.prototype.deleteItem = function(options, callback) {
      should(options).eql({
        Key: {
          ForumName: { S: 'Amazon' },
          Subject: { S: 'DynamoDB' },
        },
        TableName: 'Thread'
      });

      done();
    };

    deleteItem();
  })

  describe('when the request fails', function() {
    beforeEach(function() {
      aws.DynamoDB = function() { };
      aws.DynamoDB.prototype.deleteItem = function(request, callback) {
        callback('failure');
      };
    })

    it('should throw an error', function(done) {
      deleteItem().catch(function(reason) {
        should(reason).eql('failure');
        done();
      });
    })
  })

  describe('when the request succeeds', function() {
    beforeEach(function() {
      aws.DynamoDB = function() { };
      aws.DynamoDB.prototype.deleteItem = function(request, callback) {
        callback(null, 'success');
      };
    })

    it('should return the response', function(done) {
      deleteItem().then(function(response) {
        should(response).eql('success');
        done();
      });
    })
  })
})


text:
int main( int argc, const char *argv[] ) {
    printf( "hello world\n" );
    return 0;
}


text:
package com.bsobe.BauAssistant;

import android.app.Activity;
import android.content.ContentResolver;
import android.content.ContentUris;
import android.content.ContentValues;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.Bundle;
import android.provider.CalendarContract;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

public class UserMain extends Activity {

    private Functions functions;

    @Override
    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_user_main);

        init();
    }

    private void init() {
        functions = Functions.getInstance();
    }

    public void clickedCourseProgram(View v) {
        //Show Syylabus
        Intent courseProgram = new Intent(getApplicationContext(), CourseProgram.class);
        startActivity(courseProgram);
    }

    public void clickedUserInfo(View v) {
        //Show User Information
        Intent infoScreen = new Intent(getApplicationContext(), UserInfo.class);
        startActivity(infoScreen);
    }

    public void clickedLogOut(View v) {
        //Log out - Delete user db - Delete app data
        logout(getApplicationContext());
        Intent loginActivity = new Intent(getApplicationContext(), LoginWebView.class);
        startActivity(loginActivity);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.

        getMenuInflater().inflate(R.menu.user_main_menu, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();
        switch (id) {
            /*
            case R.id.action_refresh_user_data:
                reLoadUserFromBau(UserMain.this);
                break;
                */
            case R.id.action_add_event:
                if (SplashScreen.eventIDs.isEmpty()) {
                    addEventOnCalendar(UserMain.this);
                } else {
                    new Notification(UserMain.this, false, "Bau Assistant", "Course events already added your calendar");
                }
                break;
            case R.id.action_delete_event:
                if (!SplashScreen.eventIDs.isEmpty()) {
                    deleteCalendarEvents(UserMain.this);
                } else {
                    new Notification(UserMain.this, false, "Bau Assistant", "No any events related to Bau Assistant on Calendar");
                }
            /*
            case R.id.action_add_final_event:
                if (SplashScreen.finalEventIDs.isEmpty()) {
                    addFinalEventOnCalendar(UserMain.this);
                } else {
                    new Notification(UserMain.this, false, "Bau Assistant", "Final events already added your calendar");
                }
                break;
            case R.id.action_delete_final_event:
                if (!SplashScreen.finalEventIDs.isEmpty()) {
                    deleteCalendarFinalEvents(UserMain.this);
                } else {
                    new Notification(UserMain.this, false, "Bau Assistant", "No any final events related to Bau Assistant on Calendar");
                }
                break;
                */
            default:
                break;
        }
        return super.onOptionsItemSelected(item);
    }

    private void reLoadUserFromBau(Activity activity) {
        if (functions.isNetworkAvailable(activity)) {
            String args[] = functions.getUserPreferences();
            SplashScreen.activeUser = new User();
            SplashScreen.firstLogin = true;
            logout(activity.getApplicationContext());
            new SyncWithBauAsync(activity, args[0], args[1], Integer.parseInt(args[2])).execute();
            Log.i("App Status", "Successfully finished refreshing user's data with default username&password");
        } else {
            new Notification(activity, "Bau Assistant",
                    "Internet Connection Failure\nPlease Check the Connection!", "Close");
        }
    }

    private void logout(Context context) {
        SharedPreferences preferences = SplashScreen.userPreferences;
        SharedPreferences.Editor editor = preferences.edit();
        editor.clear();
        editor.apply();
        functions.reCreateDatabase(context);
        Log.i("App Status", "Successfully done log out process");
    }

    private void addEventOnCalendar(Activity activity) {

        final Uri EVENTS_URI = CalendarContract.Events.CONTENT_URI;
        final ContentResolver cr = activity.getContentResolver();
        try {
            for (int dayPosition = 0; dayPosition < 7; dayPosition++) {
                final ArrayList<Course> dayCourses = SplashScreen.userDB.getDayCourses(dayPosition);
                for (Course selectedCourse : dayCourses) {
                    Calendar cDate = Calendar.getInstance();

                    int year = cDate.get(Calendar.YEAR);
                    int month = cDate.get(Calendar.MONTH);
                    int day = cDate.get(Calendar.DAY_OF_MONTH);
                    int weekOfYear = cDate.get(Calendar.WEEK_OF_YEAR);
                    Calendar temp = Calendar.getInstance();
                    temp.set(2015, 4, 20);
                    GregorianCalendar endTime = new GregorianCalendar(2015, 4, 20);
                    int difOfWeek = (temp.get(Calendar.WEEK_OF_YEAR) - (weekOfYear));
                    System.out.println(temp.get(Calendar.WEEK_OF_YEAR));
                    System.out.println(weekOfYear);
                    System.out.println(difOfWeek);
                    for (Integer cDay : selectedCourse.dayList) {
                        int difOfDays = ((day % 7) - cDay - 2);
                        GregorianCalendar calDate = new GregorianCalendar(year, month, day - difOfDays,
                                selectedCourse.getCourseBeginTimeINT(cDay), 30);
                        System.out.println(calDate.getTime().toString());

                        ContentValues values = new ContentValues();
                        values.put("calendar_id", 1);
                        values.put("title", selectedCourse.toAddEventString(cDay));
                        values.put("eventLocation", selectedCourse.dayRoom.get(cDay));
                        values.put("allDay", 0);
                        values.put("dtstart", calDate.getTimeInMillis());
                        values.put("dtend", (calDate.getTimeInMillis() + selectedCourse.getCourseHour(cDay) * 60 * 60 * 1000));
                        System.out.println(difOfWeek);
                        values.put("rrule", "FREQ=WEEKLY;COUNT=" + Integer.toString(difOfWeek) );
                        values.put("description", "BAU Assistant Reminder");
                        values.put("hasAlarm", 1);
                        values.put("eventTimezone", "Turkey");
                        System.out.println(values.toString());
                        Uri event = cr.insert(EVENTS_URI, values);

                        int eventID = Integer.parseInt(event.getLastPathSegment());
                        // reminder insert
                        values = new ContentValues();
                        values.put("event_id", eventID);
                        values.put("method", 1);
                        values.put("minutes", 30);
                        cr.insert(CalendarContract.Reminders.CONTENT_URI, values);
                        SplashScreen.eventIDs.add(eventID);

                    }
                }

            }

            new Notification(activity, false, "Bau Assistant", "Successfully added events on Calendar");
        } catch (Exception calendarException) {
            calendarException.printStackTrace();
            Log.e("Calendar Exception", calendarException.toString());
            System.out.println(calendarException.getCause().toString());
        }
    }

    private void deleteCalendarEvents(Activity activity) {
        final ContentResolver cr = activity.getContentResolver();
        for (final int entryID : SplashScreen.eventIDs) {
            new Thread(new Runnable() {
                @Override
                public void run() {
                    Uri eventsUri = CalendarContract.Events.CONTENT_URI;
                    Uri eventUri = ContentUris.withAppendedId(eventsUri, entryID);
                    if (eventUri != null) {
                        cr.delete(eventUri, null, null);
                        Log.i("App Status", "Deleted calendar entry.");
                    }
                }
            }).start();
        }
        SplashScreen.eventIDs = new ArrayList<Integer>();
        new Notification(activity, false, "Bau Assistant", "Successfully deleted events on Calendar");
    }

    private void addFinalEventOnCalendar(Activity activity) {
        final Uri EVENTS_URI = CalendarContract.Events.CONTENT_URI;
        final ContentResolver cr = activity.getContentResolver();
        try {
            final ArrayList<String> finalIDs = SplashScreen.userDB.getFinalIDs();
            for (final String id : finalIDs) {
                new Thread(new Runnable() {
                    @Override
                    public void run() {
                        try {
                            ArrayList<String> finalEntity = SplashScreen.userDB.getFinalEntity(id);

                            String entityDateString = finalEntity.get(3);
                            String startTime = entityDateString.substring(0, 18);
                            String endTime = entityDateString.substring(0, 13) + entityDateString.substring(21, 26);
                            DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd : hh:mm");
                            Date startDate = dateFormat.parse(startTime);
                            Date endDate = dateFormat.parse(endTime);
                            if (startDate != null && endDate != null) {
                                ContentValues values = new ContentValues();
                                values.put("calendar_id", 1);
                                values.put("title", "Final Exam - " + finalEntity.get(0) + " " + finalEntity.get(1));
                                values.put("eventLocation", finalEntity.get(4));
                                values.put("allDay", 0);
                                values.put("dtstart", startDate.getTime());
                                values.put("dtend", endDate.getTime());
                                values.put("description", "BAU Assistant Reminder");
                                values.put("hasAlarm", 1);
                                values.put("eventTimezone", "Turkey");

                                Uri event = cr.insert(EVENTS_URI, values);

                                int eventID = Integer.parseInt(event.getLastPathSegment());
                                // reminder insert
                                values = new ContentValues();
                                values.put("event_id", eventID);
                                values.put("method", 1);
                                values.put("minutes", 60);
                                cr.insert(CalendarContract.Reminders.CONTENT_URI, values);
                                SplashScreen.eventIDs.add(eventID);
                            }

                        } catch (ParseException e) {
                            e.printStackTrace();
                        }
                    }
                }).start();
            }
            new Notification(activity, false, "Bau Assistant", "Successfully added events on Calendar");
        } catch (Exception e) {
            e.printStackTrace();
            Log.e("Calendar Exception", e.toString());
            System.out.println(e.getCause().toString());
        }
    }

    private void deleteCalendarFinalEvents(Activity activity) {

        final ContentResolver cr = activity.getContentResolver();
        for (final int entryID : SplashScreen.finalEventIDs) {
            new Thread(new Runnable() {
                @Override
                public void run() {
                    Uri eventsUri = CalendarContract.Events.CONTENT_URI;
                    Uri eventUri = ContentUris.withAppendedId(eventsUri, entryID);
                    if (eventUri != null) {
                        cr.delete(eventUri, null, null);
                        Log.i("App Status", "Deleted calendar final entry.");
                    }
                }
            }).start();
        }
        SplashScreen.eventIDs = new ArrayList<Integer>();
        new Notification(activity, false, "Bau Assistant", "Successfully deleted final events on Calendar");
    }
}


text:
.class Lcom/android/server/am/AppErrorDialog;
.super Lcom/android/server/am/BaseErrorDialog;
.source "AppErrorDialog.java"

# static fields
.field static final DISMISS_TIMEOUT:J = 0x493e0L

.field static final FORCE_QUIT:I = 0x0

.field static final FORCE_QUIT_AND_REPORT:I = 0x1

.field private static final TAG:Ljava/lang/String; = "AppErrorDialog"

# instance fields
.field private final mHandler:Landroid/os/Handler;

.field private final mProc:Lcom/android/server/am/ProcessRecord;

.field private final mResult:Lcom/android/server/am/AppErrorResult;

.field private mTargetProcess:Z

# direct methods
.method public constructor <init>(Landroid/content/Context;Lcom/android/server/am/AppErrorResult;Lcom/android/server/am/ProcessRecord;)V
    .locals 13
    .parameter "context"
    .parameter "result"
    .parameter "app"

    .prologue
    const/4 v9, 0x2

    const/4 v10, -0x1

    const/4 v12, 0x1

    const/4 v11, 0x0

    .line 50
    invoke-direct {p0, p1}, Lcom/android/server/am/BaseErrorDialog;-><init>(Landroid/content/Context;)V

    .line 47
    iput-boolean v11, p0, Lcom/android/server/am/AppErrorDialog;->mTargetProcess:Z

    .line 150
    new-instance v7, Lcom/android/server/am/AppErrorDialog$1;

    invoke-direct {v7, p0}, Lcom/android/server/am/AppErrorDialog$1;-><init>(Lcom/android/server/am/AppErrorDialog;)V

    iput-object v7, p0, Lcom/android/server/am/AppErrorDialog;->mHandler:Landroid/os/Handler;

    .line 52
    invoke-virtual {p1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v6

    .line 54
    .local v6, res:Landroid/content/res/Resources;
    move-object/from16 v0, p3

    iput-object v0, p0, Lcom/android/server/am/AppErrorDialog;->mProc:Lcom/android/server/am/ProcessRecord;

    .line 55
    iput-object p2, p0, Lcom/android/server/am/AppErrorDialog;->mResult:Lcom/android/server/am/AppErrorResult;

    .line 59
    const-string v7, "devicestoragemonitor"

    invoke-static {v7}, Landroid/os/ServiceManager;->getService(Ljava/lang/String;)Landroid/os/IBinder;

    move-result-object v2

    check-cast v2, Lcom/android/server/DeviceStorageMonitorService;

    .line 61
    .local v2, dsm:Lcom/android/server/DeviceStorageMonitorService;
    invoke-virtual {v2}, Lcom/android/server/DeviceStorageMonitorService;->isMemoryCriticalLow()Z

    move-result v1

    .line 62
    .local v1, criticalLow:Z
    move-object/from16 v0, p3

    iget-object v7, v0, Lcom/android/server/am/ProcessRecord;->pkgList:Ljava/util/HashSet;

    invoke-virtual {v7}, Ljava/util/HashSet;->size()I

    move-result v7

    if-ne v7, v12, :cond_4

    invoke-virtual {p1}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;

    move-result-object v7

    move-object/from16 v0, p3

    iget-object v8, v0, Lcom/android/server/am/ProcessRecord;->info:Landroid/content/pm/ApplicationInfo;

    invoke-virtual {v7, v8}, Landroid/content/pm/PackageManager;->getApplicationLabel(Landroid/content/pm/ApplicationInfo;)Ljava/lang/CharSequence;

    move-result-object v5

    .local v5, name:Ljava/lang/CharSequence;
    if-eqz v5, :cond_4

    .line 64
    iput-boolean v11, p0, Lcom/android/server/am/AppErrorDialog;->mTargetProcess:Z

    .line 65
    if-ne v1, v12, :cond_3

    .line 66
    const v7, 0x2050045

    new-array v8, v9, [Ljava/lang/Object;

    invoke-virtual {v5}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v9

    aput-object v9, v8, v11

    move-object/from16 v0, p3

    iget-object v9, v0, Lcom/android/server/am/ProcessRecord;->info:Landroid/content/pm/ApplicationInfo;

    iget-object v9, v9, Landroid/content/pm/ApplicationInfo;->processName:Ljava/lang/String;

    aput-object v9, v8, v12

    invoke-virtual {v6, v7, v8}, Landroid/content/res/Resources;->getString(I[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v4

    .line 75
    .local v4, message:Ljava/lang/CharSequence;
    :goto_0
    invoke-virtual {p0, v4}, Lcom/android/server/am/AppErrorDialog;->setMessage(Ljava/lang/CharSequence;)V

    .line 99
    :goto_1
    invoke-virtual {p0, v11}, Lcom/android/server/am/AppErrorDialog;->setCancelable(Z)V

    .line 101
    const v7, 0x10403d8

    invoke-virtual {v6, v7}, Landroid/content/res/Resources;->getText(I)Ljava/lang/CharSequence;

    move-result-object v7

    iget-object v8, p0, Lcom/android/server/am/AppErrorDialog;->mHandler:Landroid/os/Handler;

    invoke-virtual {v8, v11}, Landroid/os/Handler;->obtainMessage(I)Landroid/os/Message;

    move-result-object v8

    invoke-virtual {p0, v10, v7, v8}, Lcom/android/server/am/AppErrorDialog;->setButton(ILjava/lang/CharSequence;Landroid/os/Message;)V

    .line 105
    move-object/from16 v0, p3

    iget-object v7, v0, Lcom/android/server/am/ProcessRecord;->errorReportReceiver:Landroid/content/ComponentName;

    if-eqz v7, :cond_0

    .line 106
    const/4 v7, -0x2

    const v8, 0x10403d9

    invoke-virtual {v6, v8}, Landroid/content/res/Resources;->getText(I)Ljava/lang/CharSequence;

    move-result-object v8

    iget-object v9, p0, Lcom/android/server/am/AppErrorDialog;->mHandler:Landroid/os/Handler;

    invoke-virtual {v9, v12}, Landroid/os/Handler;->obtainMessage(I)Landroid/os/Message;

    move-result-object v9

    invoke-virtual {p0, v7, v8, v9}, Lcom/android/server/am/AppErrorDialog;->setButton(ILjava/lang/CharSequence;Landroid/os/Message;)V

    .line 111
    :cond_0
    const/4 v3, 0x0

    .line 113
    .local v3, lsh:Lcom/mediatek/common/lowstorage/ILowStorageHandle;
    :try_start_0
    const-class v7, Lcom/mediatek/common/lowstorage/ILowStorageHandle;

    const/4 v8, 0x1

    new-array v8, v8, [Ljava/lang/Object;

    const/4 v9, 0x0

    aput-object p0, v8, v9

    invoke-static {v7, v8}, Lcom/mediatek/common/MediatekClassFactory;->createInstance(Ljava/lang/Class;[Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v7

    move-object v0, v7

    check-cast v0, Lcom/mediatek/common/lowstorage/ILowStorageHandle;

    move-object v3, v0
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 117
    :goto_2
    if-eqz v3, :cond_8

    .line 118
    invoke-interface {v3}, Lcom/mediatek/common/lowstorage/ILowStorageHandle;->GetCurrentFlag()Z

    move-result v7

    if-ne v7, v12, :cond_1

    .line 119
    const/4 v7, -0x3

    const v8, 0x2050047

    invoke-virtual {v6, v8}, Landroid/content/res/Resources;->getText(I)Ljava/lang/CharSequence;

    move-result-object v8

    iget-object v9, p0, Lcom/android/server/am/AppErrorDialog;->mHandler:Landroid/os/Handler;

    invoke-interface {v3}, Lcom/mediatek/common/lowstorage/ILowStorageHandle;->getLowStorageFlag()I

    move-result v10

    invoke-virtual {v9, v10}, Landroid/os/Handler;->obtainMessage(I)Landroid/os/Message;

    move-result-object v9

    invoke-virtual {p0, v7, v8, v9}, Lcom/android/server/am/AppErrorDialog;->setButton(ILjava/lang/CharSequence;Landroid/os/Message;)V

    .line 127
    :cond_1
    :goto_3
    const v7, 0x10403d0

    invoke-virtual {v6, v7}, Landroid/content/res/Resources;->getText(I)Ljava/lang/CharSequence;

    move-result-object v7

    invoke-virtual {p0, v7}, Lcom/android/server/am/AppErrorDialog;->setTitle(Ljava/lang/CharSequence;)V

    .line 128
    invoke-virtual {p0}, Lcom/android/server/am/AppErrorDialog;->getWindow()Landroid/view/Window;

    move-result-object v7

    const/high16 v8, 0x4000

    invoke-virtual {v7, v8}, Landroid/view/Window;->addFlags(I)V

    .line 129
    invoke-virtual {p0}, Lcom/android/server/am/AppErrorDialog;->getWindow()Landroid/view/Window;

    move-result-object v7

    new-instance v8, Ljava/lang/StringBuilder;

    invoke-direct {v8}, Ljava/lang/StringBuilder;-><init>()V

    const-string v9, "Application Error: "

    invoke-virtual {v8, v9}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v8

    move-object/from16 v0, p3

    iget-object v9, v0, Lcom/android/server/am/ProcessRecord;->info:Landroid/content/pm/ApplicationInfo;

    iget-object v9, v9, Landroid/content/pm/ApplicationInfo;->processName:Ljava/lang/String;

    invoke-virtual {v8, v9}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v8

    invoke-virtual {v8}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v7, v8}, Landroid/view/Window;->setTitle(Ljava/lang/CharSequence;)V

    .line 130
    move-object/from16 v0, p3

    iget-boolean v7, v0, Lcom/android/server/am/ProcessRecord;->persistent:Z

    if-eqz v7, :cond_2

    .line 131
    invoke-virtual {p0}, Lcom/android/server/am/AppErrorDialog;->getWindow()Landroid/view/Window;

    move-result-object v7

    const/16 v8, 0x7da

    invoke-virtual {v7, v8}, Landroid/view/Window;->setType(I)V

    .line 135
    :cond_2
    if-ne v1, v12, :cond_9

    iget-boolean v7, p0, Lcom/android/server/am/AppErrorDialog;->mTargetProcess:Z

    if-eqz v7, :cond_9

    .line 136
    const-string v7, "AppErrorDialog"

    const-string v8, "do not show the error dialog!"

    invoke-static {v7, v8}, Landroid/util/Slog;->v(Ljava/lang/String;Ljava/lang/String;)I

    .line 137
    iget-object v7, p0, Lcom/android/server/am/AppErrorDialog;->mHandler:Landroid/os/Handler;

    iget-object v8, p0, Lcom/android/server/am/AppErrorDialog;->mHandler:Landroid/os/Handler;

    invoke-virtual {v8, v11}, Landroid/os/Handler;->obtainMessage(I)Landroid/os/Message;

    move-result-object v8

    const-wide/16 v9, 0x0

    invoke-virtual {v7, v8, v9, v10}, Landroid/os/Handler;->sendMessageDelayed(Landroid/os/Message;J)Z

    .line 148
    :goto_4
    return-void

    .line 71
    .end local v3           #lsh:Lcom/mediatek/common/lowstorage/ILowStorageHandle;
    .end local v4           #message:Ljava/lang/CharSequence;
    :cond_3
    const v7, 0x10403d1

    new-array v8, v9, [Ljava/lang/Object;

    invoke-virtual {v5}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v9

    aput-object v9, v8, v11

    move-object/from16 v0, p3

    iget-object v9, v0, Lcom/android/server/am/ProcessRecord;->info:Landroid/content/pm/ApplicationInfo;

    iget-object v9, v9, Landroid/content/pm/ApplicationInfo;->processName:Ljava/lang/String;

    aput-object v9, v8, v12

    invoke-virtual {v6, v7, v8}, Landroid/content/res/Resources;->getString(I[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v4

    .restart local v4       #message:Ljava/lang/CharSequence;
    goto/16 :goto_0

    .line 77
    .end local v4           #message:Ljava/lang/CharSequence;
    .end local v5           #name:Ljava/lang/CharSequence;
    :cond_4
    move-object/from16 v0, p3

    iget-object v5, v0, Lcom/android/server/am/ProcessRecord;->processName:Ljava/lang/String;

    .line 79
    .restart local v5       #name:Ljava/lang/CharSequence;
    invoke-virtual {v5}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v7

    const-string v8, "com.mediatek.bluetooth"

    invoke-virtual {v7, v8}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result v7

    if-ne v7, v10, :cond_5

    invoke-virtual {v5}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v7

    const-string v8, "android.process.acore"

    invoke-virtual {v7, v8}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result v7

    if-eq v7, v10, :cond_6

    .line 81
    :cond_5
    const-string v7, "AppErrorDialog"

    const-string v8, "got target error process"

    invoke-static {v7, v8}, Landroid/util/Slog;->v(Ljava/lang/String;Ljava/lang/String;)I

    .line 82
    iput-boolean v12, p0, Lcom/android/server/am/AppErrorDialog;->mTargetProcess:Z

    .line 87
    :goto_5
    if-ne v1, v12, :cond_7

    .line 88
    const v7, 0x2050046

    new-array v8, v12, [Ljava/lang/Object;

    invoke-virtual {v5}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v9

    aput-object v9, v8, v11

    invoke-virtual {v6, v7, v8}, Landroid/content/res/Resources;->getString(I[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v4

    .line 96
    .restart local v4       #message:Ljava/lang/CharSequence;
    :goto_6
    invoke-virtual {p0, v4}, Lcom/android/server/am/AppErrorDialog;->setMessage(Ljava/lang/CharSequence;)V

    goto/16 :goto_1

    .line 84
    .end local v4           #message:Ljava/lang/CharSequence;
    :cond_6
    iput-boolean v11, p0, Lcom/android/server/am/AppErrorDialog;->mTargetProcess:Z

    goto :goto_5

    .line 92
    :cond_7
    const v7, 0x10403d2

    new-array v8, v12, [Ljava/lang/Object;

    invoke-virtual {v5}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v9

    aput-object v9, v8, v11

    invoke-virtual {v6, v7, v8}, Landroid/content/res/Resources;->getString(I[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v4

    .restart local v4       #message:Ljava/lang/CharSequence;
    goto :goto_6

    .line 124
    .restart local v3       #lsh:Lcom/mediatek/common/lowstorage/ILowStorageHandle;
    :cond_8
    const-string v7, "AppErrorDialog"

    const-string v8, "Failed to get ILowStorageHandle instance"

    invoke-static {v7, v8}, Landroid/util/Slog;->e(Ljava/lang/String;Ljava/lang/String;)I

    goto/16 :goto_3

    .line 142
    :cond_9
    iget-object v7, p0, Lcom/android/server/am/AppErrorDialog;->mHandler:Landroid/os/Handler;

    iget-object v8, p0, Lcom/android/server/am/AppErrorDialog;->mHandler:Landroid/os/Handler;

    invoke-virtual {v8, v11}, Landroid/os/Handler;->obtainMessage(I)Landroid/os/Message;

    move-result-object v8

    const-wide/32 v9, 0x493e0

    invoke-virtual {v7, v8, v9, v10}, Landroid/os/Handler;->sendMessageDelayed(Landroid/os/Message;J)Z

    goto :goto_4

    .line 114
    :catch_0
    move-exception v7

    goto/16 :goto_2
.end method

.method static synthetic access$000(Lcom/android/server/am/AppErrorDialog;)Lcom/android/server/am/ProcessRecord;
    .locals 1
    .parameter "x0"

    .prologue
    .line 34
    iget-object v0, p0, Lcom/android/server/am/AppErrorDialog;->mProc:Lcom/android/server/am/ProcessRecord;

    return-object v0
.end method

.method static synthetic access$100(Lcom/android/server/am/AppErrorDialog;)Lcom/android/server/am/AppErrorResult;
    .locals 1
    .parameter "x0"

    .prologue
    .line 34
    iget-object v0, p0, Lcom/android/server/am/AppErrorDialog;->mResult:Lcom/android/server/am/AppErrorResult;

    return-object v0
.end method


text:
import * as React from "react";
import type { Observable } from "core/Misc/observable";
import type { PropertyChangedEvent } from "shared-ui-components/propertyChangedEvent";
import { CommonControlPropertyGridComponent } from "../gui/commonControlPropertyGridComponent";
import type { LockObject } from "shared-ui-components/tabs/propertyGrids/lockObject";
import { TextLineComponent } from "shared-ui-components/lines/textLineComponent";
import type { DisplayGrid } from "gui/2D/controls/displayGrid";
import { FloatLineComponent } from "shared-ui-components/lines/floatLineComponent";
import { ColorLineComponent } from "shared-ui-components/lines/colorLineComponent";
import { makeTargetsProxy } from "shared-ui-components/lines/targetsProxy";

import sizeIcon from "shared-ui-components/imgs/sizeIcon.svg";
import colorIcon from "shared-ui-components/imgs/colorIcon.svg";
import strokeWeightIcon from "shared-ui-components/imgs/strokeWeightIcon.svg";
import displayGridLine1Icon from "shared-ui-components/imgs/displayGridLine1Icon.svg";
import frequencyIcon from "shared-ui-components/imgs/frequencyIcon.svg";
import displayGridLine2Icon from "shared-ui-components/imgs/displayGridLine2Icon.svg";
import { IconComponent } from "shared-ui-components/lines/iconComponent";
import { UnitButton } from "shared-ui-components/lines/unitButton";
import { CheckBoxLineComponent } from "shared-ui-components/lines/checkBoxLineComponent";
import type { GlobalState } from "../../../../globalState";

interface IDisplayGridPropertyGridComponentProps {
    displayGrids: DisplayGrid[];
    lockObject: LockObject;
    onPropertyChangedObservable?: Observable<PropertyChangedEvent>;
    onFontsParsedObservable?: Observable<void>;
    globalState?: GlobalState;
}

export class DisplayGridPropertyGridComponent extends React.Component<IDisplayGridPropertyGridComponentProps> {
    constructor(props: IDisplayGridPropertyGridComponentProps) {
        super(props);
    }

    render() {
        const { displayGrids, lockObject, onPropertyChangedObservable } = this.props;
        const proxy = makeTargetsProxy(displayGrids, onPropertyChangedObservable);

        return (

                <CommonControlPropertyGridComponent
                    lockObject={lockObject}
                    controls={displayGrids}
                    onPropertyChangedObservable={onPropertyChangedObservable}
                    onFontsParsedObservable={this.props.onFontsParsedObservable}
                    globalState={this.props.globalState}
                />

                <TextLineComponent label="DISPLAY GRID" value=" " color="grey"></TextLineComponent>

                    <IconComponent icon={sizeIcon} label="Cell Size" />
                    <FloatLineComponent
                        min={1}
                        isInteger={true}
                        lockObject={lockObject}
                        label="W"
                        target={proxy}
                        propertyName="cellWidth"
                        onPropertyChangedObservable={onPropertyChangedObservable}
                        unit={<UnitButton locked unit="PX" />}
                        arrows
                    />
                    <FloatLineComponent
                        min={1}
                        isInteger={true}
                        lockObject={lockObject}
                        label="H"
                        target={proxy}
                        propertyName="cellHeight"
                        onPropertyChangedObservable={onPropertyChangedObservable}
                        unit={<UnitButton locked unit="PX" />}
                        arrows
                    />

                    <IconComponent icon={displayGridLine1Icon} label="Show Minor Lines" />
                    <CheckBoxLineComponent label="SHOW MINOR LINES" onValueChanged={() => this.forceUpdate()} target={proxy} propertyName="_displayMinorLines" />

                {proxy._displayMinorLines && (
                    <>

                            <IconComponent icon={strokeWeightIcon} label="Minor Line Tickness" />
                            <FloatLineComponent
                                min={1}
                                isInteger={true}
                                lockObject={lockObject}
                                label=""
                                target={proxy}
                                propertyName="minorLineTickness"
                                onPropertyChangedObservable={onPropertyChangedObservable}
                                unit={<UnitButton locked unit="PX" />}
                                arrows
                            />

                            <IconComponent icon={colorIcon} label="Minor Line Color" />
                            <ColorLineComponent
                                lockObject={lockObject}
                                label=""
                                target={proxy}
                                propertyName="minorLineColor"
                                onPropertyChangedObservable={onPropertyChangedObservable}
                            />

                    </>
                )}

                    <IconComponent icon={displayGridLine2Icon} label="Show Major Lines" />
                    <CheckBoxLineComponent label="SHOW MAJOR LINES" onValueChanged={() => this.forceUpdate()} target={proxy} propertyName="_displayMajorLines" />

                {proxy._displayMajorLines && (
                    <>

                            <IconComponent icon={strokeWeightIcon} label="Major Line Tickness" />
                            <FloatLineComponent
                                min={1}
                                isInteger={true}
                                lockObject={lockObject}
                                label=""
                                target={proxy}
                                propertyName="majorLineTickness"
                                onPropertyChangedObservable={onPropertyChangedObservable}
                                unit={<UnitButton locked unit="PX" />}
                                arrows
                            />

                            <IconComponent icon={colorIcon} label="Major Line Color" />
                            <ColorLineComponent
                                lockObject={lockObject}
                                label=""
                                target={proxy}
                                propertyName="majorLineColor"
                                onPropertyChangedObservable={onPropertyChangedObservable}
                            />

                            <IconComponent icon={frequencyIcon} label="Major Line Frequency" />
                            <FloatLineComponent
                                min={1}
                                isInteger={true}
                                lockObject={lockObject}
                                label=""
                                target={proxy}
                                propertyName="majorLineFrequency"
                                onPropertyChangedObservable={onPropertyChangedObservable}
                                arrows
                            />

                    </>
                )}

        );
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context="com.xandrev.mbandroid.gui.logger.NotificationLoggerActivity">

        <ListView
            android:layout_width="wrap_content"
            android:layout_height="0dp"
            android:id="@+id/listView2"
            android:layout_alignParentTop="true"
            android:layout_alignParentEnd="true"
            android:layout_weight="1" />

        <Button
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="Limpiar Logs"
            android:id="@+id/cleanLogs"
            android:layout_alignParentBottom="true"
            android:layout_alignParentStart="true"
            android:layout_marginStart="0dp" />
    </LinearLayout>


text:
from django.shortcuts import render
from django.utils.translation import gettext_lazy as _

from rdmo.core.plugins import get_plugin

PROVIDER_TYPES = [
    'PROJECT_ISSUE_PROVIDERS',
    'PROJECT_EXPORTS',
    'PROJECT_IMPORTS'
]

def oauth_callback(request, provider_key):
    for provider_type in PROVIDER_TYPES:
        provider = get_plugin(provider_type, provider_key)
        if provider and provider.get_from_session(request, 'state'):
            return provider.callback(request)

    return render(request, 'core/error.html', {
        'title': _('Integration Error'),
        'errors': [_('Something went wrong. Please contact support.')]
    }, status=500)


text:
typedef enum {
  kTERenderStyleNone          = 0,
  kTERenderStyleConstantColor = 1 << 0,
  kTERenderStyleVertexColors  = 1 << 1,
  kTERenderStyleTexture       = 1 << 2,
} TERenderStyle;

@interface TEShape : TEDrawable {
  GLKBaseEffect *effect;
  TERenderStyle renderStyle;
  GLKVector4 color;

  NSMutableData *vertexData, *textureData, *colorData;
  GLKVector2 *vertices, *textureCoordinates;
  GLKVector4 *colorVertices;
}

@property(strong, nonatomic) GLKBaseEffect *effect;
@property TERenderStyle renderStyle;
@property GLKVector4 color;

@property(readonly) int numVertices;
@property(readonly) GLKVector2 *vertices;
@property(readonly) GLKVector2 *textureCoordinates;
@property(strong,readonly) NSMutableData *colorData;
@property(readonly) GLKVector4 *colorVertices;

@property(readonly) float radius; // for bounding circle collision detection

@property(readonly) GLenum renderMode;

-(void)updateVertices;
-(BOOL)isPolygon;
-(BOOL)isCircle;

@end


text:
<?php

namespace PoolPort\AP;

use DateTime;
use PoolPort\Config;
use PoolPort\SoapClient;
use PoolPort\PortAbstract;
use PoolPort\PortInterface;
use PoolPort\DataBaseManager;

class AP extends PortAbstract implements PortInterface
{
    /**
     * Address of main SOAP server
     *
     * @var string
     */
    protected $serverUrl = "https://services.asanpardakht.net/paygate/merchantservices.asmx?wsdl";

    /**
     * Address of verify SOAP server
     *
     * @var string
     */
    protected $verifyUrl = "https://services.asanpardakht.net/paygate/statuswatch.asmx?wsdl";

    /**
     * Address of time SOAP server
     *
     * @var string
     */
    protected $timeUrl = "https://services.asanpardakht.net/paygate/servertime.asmx?wsdl";

    /**
     * Encrypted credintial
     *
     * @var string
     */
    private $encryptedCredintial = null;

    /**
     * {@inheritdoc}
     */
    public function __construct(Config $config, DataBaseManager $db, $portId)
    {
        parent::__construct($config, $db, $portId);
    }

    /**
     * {@inheritdoc}
     */
    public function set($amount)
    {
        $this->amount = $amount;

        return $this;
    }

    /**
     * {@inheritdoc}
     */
    public function ready()
    {
        $this->sendPayRequest();

        return $this;
    }

    /**
     * {@inheritdoc}
     */
    public function redirect()
    {
        $token = $this->refId;
        $mobile = $this->config->get('ap.user-mobile');

        require 'APRedirector.php';
    }

    /**
     * {@inheritdoc}
     */
    public function verify($transaction)
    {
        parent::verify($transaction);

        $this->userPayment();
        $this->verifyPayment();

        return $this;
    }

    /**
     * Send pay request to server
     *
     * @return void
     *
     * @throws APException
     */
    protected function sendPayRequest()
    {
        $dateTime = new DateTime();

        $this->newTransaction();

        try {
            $fields = array(
                "merchantConfigurationID" => $this->config->get('ap.merchant-config-id'),
                "encryptedRequest" => $this->encrypt(array(
                    '1',
                    $this->config->get('ap.username'),
                    $this->config->get('ap.password'),
                    $this->transactionId(),
                    $this->amount,
                    $this->syncTime(),
                    '',
                    $this->buildQuery($this->config->get('ap.callback-url'), array('transaction_id' => $this->transactionId())),
                    '0'
                ))
            );

            $soap = new SoapClient($this->serverUrl, $this->config);
            $response = $soap->RequestOperation($fields);

        } catch(\SoapFault $e) {
            $this->transactionFailed();
            $this->newLog('SoapFault', $e->getMessage());
            throw $e;
        }

        $response = explode(',', $response->RequestOperationResult);
        if (count($response) == 2 && $response[0] == 0) {
            $this->refId = $response[1];
            $this->transactionSetRefId($this->transactionId);

        } else {
            $this->transactionFailed();
            $this->newLog($response[0], APException::getError($response[0]));
            throw new APException($response[0]);
        }
    }

    /**
     * Check user payment
     *
     * @return void
     */
    protected function userPayment()
    {
        // Because this port use an old algorithm for encryption and decryption and we must do it from their server
        // We ignore this step to avoid reduce speed
        return true;
    }

    /**
     * Verify user payment from bank server
     *
     * @return void
     */
    protected function verifyPayment()
    {
        try {
            // Checking payment
            $fields = array(
                "merchantConfigurationID" => $this->config->get('ap.merchant-config-id'),
                "encryptedCredintials" => $this->encryptedCredintials(),
                "localInvoiceID" => $this->transactionId()
            );

            $soap = new SoapClient($this->verifyUrl, $this->config);
            $response = $soap->CheckTransactionResult($fields);

            $result = json_decode($response->CheckTransactionResultResult);
            if ($result->Result != '1100') {
                $this->transactionFailed();
                $this->newLog($result->Result, APException::getError($result->Result));
                throw new APException($result->Result);
            }

            $this->trackingCode = $result->PayGateTranID;
            $this->cardNumber = $result->CardNumber;

            // Verify payment
            $fields = array(
                "merchantConfigurationID" => $this->config->get('ap.merchant-config-id'),
                "encryptedCredentials" => $this->encryptedCredintials(),
                "payGateTranID" => $this->trackingCode()
            );

            $soap = new SoapClient($this->serverUrl, $this->config);
            $response = $soap->RequestVerification($fields);

            if ($response->RequestVerificationResult != '500') {
                $this->transactionFailed();
                $this->newLog($response->RequestVerificationResult, APException::getError($response->RequestVerificationResult));
                throw new APException($response->RequestVerificationResult);
            }

            // Reconciliation payment
            $fields = array(
                "merchantConfigurationID" => $this->config->get('ap.merchant-config-id'),
                "encryptedCredentials" => $this->encryptedCredintials(),
                "payGateTranID" => $this->trackingCode()
            );

            $soap = new SoapClient($this->serverUrl, $this->config);
            $response = $soap->RequestReconciliation($fields);

            if ($response->RequestReconciliationResult != '600') {
                $this->transactionFailed();
                $this->newLog($response->RequestReconciliationResult, APException::getError($response->RequestReconciliationResult));
                throw new APException($response->RequestReconciliationResult);
            }

        } catch(\SoapFault $e) {
            $this->transactionFailed();
            $this->newLog('SoapFault', $e->getMessage());
            throw $e;
        }

        $this->transactionSucceed();
        $this->newLog('00', self::TRANSACTION_SUCCEED_TEXT);
        return true;
    }

    /**
     * Return Synchronize time or just server time
     *
     * @return string
     */
    protected function syncTime()
    {
        if ($this->config->get('ap.sync-time')) {
            $soap = new SoapClient($this->timeUrl, $this->config);
            $response = $soap->GetPaymentServerTime();
            return $response->GetPaymentServerTimeResult;

        } else {
            $date = new DateTime;
            return $date->format('Ymd His');
        }
    }

    /**
     * Encrypt with Asan Pardakht server
     *
     * @param array $data
     *
     * @return string
     */
    protected function encrypt($data)
    {
        $fields = array(
            'aesKey' => $this->config->get('ap.encryption-key'),
            'aesVector' => $this->config->get('ap.encryption-vector'),
            'toBeEncrypted' => implode(',', $data)
        );

        $soap = new SoapClient('https://services.asanpardakht.net/paygate/internalutils.asmx?wsdl', $this->config);
        $response = $soap->EncryptInAES($fields);

        return $response->EncryptInAESResult;
    }

    /**
     * Return encrypted credintial
     *
     * @return string
     */
    protected function encryptedCredintials()
    {
        if (is_null($this->encryptedCredintial)) {
            $this->encryptedCredintial = $this->encrypt(array(
                $this->config->get('ap.username').','.$this->config->get('ap.password')
            ));
        }

        return $this->encryptedCredintial;
    }
}


text:
import acm.program.*;
import java.util.*;

import flyTunes.Album;
import flyTunes.Song;

public class FlyTunes extends ConsoleProgram {

	private static final int ADD_SONG = 1;
	private static final int ADD_ALBUM = 2;
	private static final int ADD_SONGS_TO_ALBUM = 3;
	private static final int LIST_ALBUMS = 4;
	private static final int LIST_SONGS = 5;
	private static final int LIST_SONGS_ON_ALBUM = 6;
	private static final int CHANGE_PRICE = 7;
	private static final int EXIT = 8;

	private ArrayList<Song> songs = new ArrayList<Song>();
	private HashMap<String, Album> albums = new HashMap<String, Album>();

	public void run() {
		int selection = 0;
		while (selection != EXIT) {
			selection = getSelection();
			processSelection(selection);
		}
		println("Good bye!");
	}

	private int getSelection() {
		println("Welcome to FlyTunes!");
		println("1) Add a song");
		println("2) Add an album");
		println("3) Add a song to an album");
		println("4) List albums");
		println("5) List songs");
		println("6) List songs on an album");
		println("7) Change the price for a song");
		println("8) Exit");
		return readInt("Enter your selection: ");
	}

	private void processSelection(int selection) {
		switch (selection) {
		case ADD_SONG:
			addSong();
			break;
		case ADD_ALBUM:
			addAlbum();
			break;
		case ADD_SONGS_TO_ALBUM:
			addSongsToAlbumMenu();
			break;
		case LIST_ALBUMS:
			listAlbums();
			break;
		case LIST_SONGS:
			listSongs();
			break;
		case LIST_SONGS_ON_ALBUM:
			listSongsOnAlbum();
			break;
		case CHANGE_PRICE:
			changePrice();
			break;
		case EXIT:
			break;
		default:
			println("Invalid selection, please select another option.");
			break;
		}
	}

	private void addSong() {
		println("Adding a song.");
		String title = readLine("Enter the title: ");
		String band = readLine("Enter the name of the band: ");
		Double price = readDouble("Enter the price: ");
		songs.add(new Song(title, band, price));
	}

	private void addAlbum() {
		println("Adding an album.");
		String title = readLine("Enter the title: ");
		String band = readLine("Enter the name of the band: ");
		Album album = new Album(title, band);
		albums.put(title, album);
		addSongsToAlbum(album);
	}

	private void addSongsToAlbumMenu() {
		println("Adding songs to an album.");
		String title = readLine("Enter the album title: ");
		Album album = albums.get(title);
		if (album != null) {
			addSongsToAlbum(album);
		} else {
			println("Album not found: " + title);
		}
	}

	private void addSongsToAlbum(Album album) {
		while (true) {
			String title = readLine("Enter a song title (Enter to quit): ");
			if (title.equals("")) {
				break;
			}
			Song song = findSong(title);
			if (song == null) {
				String band = readLine("Enter the name of the band: ");
				Double price = readDouble("Enter the price: ");
				song = new Song(title, band, price);
				println("Song added to songs' list and to album.");
				songs.add(song);
			} else {
				println("Song already exists in song's list. Added to album");
			}
			album.addTrack(song);
		}
	}

	private Song findSong(String title) {
		for (int i = 0; i < songs.size(); i++) {
			Song song = songs.get(i);
			if (song.getTitle().equals(title)) {
				return songs.get(i);
			}
		}
		return null;
	}

	private void listAlbums() {
		println("Listing albums.");
		for (String title : albums.keySet()) {
			println(albums.get(title).toString());
		}
	}

	private void listSongs() {
		println("Listing songs.");
		for (int i = 0; i < songs.size(); i++) {
			println(songs.get(i).toString());
		}
	}

	private void listSongsOnAlbum() {
		println("Listing songs on an album.");
		String title = readLine("Enter the album title: ");
		Album album = albums.get(title);
		if (album != null) {
			Iterator<Song> iterSongs = album.getTracks();
			while (iterSongs.hasNext()) {
				println(iterSongs.next().toString());
			}
		} else {
			println("Album not found: " + title);
		}
	}

	private void changePrice() {
		println("Changing the price on a song.");
		String title = readLine("Enter the song's title: ");
		Song song = findSong(title);
		if (song == null) {
			println("Song not found: " + title);
		} else {
			Double price = readDouble("Enter the new price: ");
			song.setPrice(price);
		}
	}

}


text:
@interface ABI43_0_0AIRMapCircleManager : ABI43_0_0RCTViewManager
@end


text:
from inspect import isroutine

from mri.util import generate_hex_ticks

from matplotlib import pyplot as plt
import matplotlib.ticker as ticker

def draw_graph_mpl(graph_data, **kwargs):
        thumb = kwargs.pop('thumb', False)
        outputfile = kwargs.pop('filename', None)
        title = kwargs.pop('title', None)
        xlabel = kwargs.pop('xlabel', None)
        size = kwargs.pop('size', None)
        dpi = kwargs.pop('dpi', 100.0)
        legend = kwargs.pop('legend', False)
        font_size = kwargs.pop('xtick_font_size', False)

        # Set up subplots.
        fig, ax = plt.subplots()
        fig.hold(True)

        for n, plot_data in enumerate(graph_data['plots']):
            pt = plot_data['type']
            if pt in _plot_map:
                _plot_map[pt](ax, plot_data, thumb=thumb, zorder=n)
            else:
                raise Exception("Invalid plot type")

        xlim = graph_data['xlim']
        ylim = graph_data['ylim']

        if not thumb:
            # Omitting boundary labels for now
            for bound in graph_data.get('boundaries', []):
                ax.vlines(bound['offset'], ylim[0], ylim[1],
                    linewidth=1.5, zorder=100, linestyle='dashed')

            # Omitting point labels
            # Just marking points of interest e.g. entrypoint.
            for point in graph_data.get('points', []):
                ax.scatter(bound['offset'], 0, s=60.0, color='black', zorder=100)

        ax.set_xlim(*xlim)
        ax.set_ylim(*ylim)
        xaxis_max = xlim[1]

        if not thumb:
            # Adjust x-ticks to be in hex, and on sane boundaries.
            ticks = ax.get_xticks()
            ax.set_xticks(generate_hex_ticks(ticks, xaxis_max))
            ax.xaxis.set_major_formatter(ticker.FormatStrFormatter('%x'))
            locs, labels = plt.xticks()
            if font_size:
                plt.setp(labels, rotation=25, horizontalalignment='right', fontsize=font_size)
            else:
                plt.setp(labels, rotation=25, horizontalalignment='right')
            ax.grid()

            if xlabel:
                ax.set_xlabel(xlabel)
            if title:
                ax.set_title(title)

            if legend and 'legend_order' in graph_data:
                order = graph_data['legend_order']
                labels = ax.get_legend_handles_labels()
                labels = zip(*labels)
                labels = sorted(labels, key=lambda x: order.index(x[1]))

                ax.legend(*zip(*labels), loc="best", prop={'size':8})
        else:
            plt.tick_params(axis='x', which='both',bottom='off',
                top='off',labelbottom='off')

        # Omit the y coordinates altogether since they're sort of normalised.
        plt.tick_params(axis='y', which='both',left='off',
            top='off',labelleft='off', right='off')

        if outputfile is None:
            plt.show()
        else:
            if size:
                fig.set_size_inches(size)
            fig.savefig(outputfile, bbox_inches='tight', dpi=dpi, pad_inches=0.01)

def _plot_graph_plot(ax, plot_data, **kwargs):
    plot_args = []
    plot_kwargs = {}

    thumb = kwargs.get('thumb', False)

    plot_args = plot_data['data']
    xaxis, yaxis = plot_args
    color = plot_data['color']

    for prop in [ 'label', 'linewidth', 'zorder']:
        if prop not in plot_data:
            continue
        value = plot_data[prop]
        if isroutine(value):
            value = value(thumb)
        plot_kwargs[prop] = value

    ax.plot(xaxis, yaxis, color, **plot_kwargs)

    if plot_data.get('fill', False):
        where = [ True for x in xaxis ]
        alpha = plot_data.get('fillalpha', 1.0)
        plt.fill_between(xaxis, yaxis, where=where, interpolate=True,
            color=color, alpha=alpha)

def _plot_graph_bar(ax, plot_data, **kwargs):
    plot_kwargs = {}

    color = plot_data['color']
    plot_kwargs['color'] = color
    plot_kwargs['edgecolor'] = color
    for prop in ['label', 'width', 'zorder']:
        if prop not in plot_data:
            continue
        plot_kwargs[prop] = plot_data[prop]
    data = plot_data['data']
    if not data:
        return

    ax.bar(*data, **plot_kwargs)

_plot_map = {
    'plot': _plot_graph_plot,
    'bar': _plot_graph_bar,
}


text:
<?php

namespace OAuth2\OpenID\ResponseType;

use OAuth2\ResponseType\ResponseTypeInterface;

interface IdTokenInterface extends ResponseTypeInterface
{
    /**
     * Create the id token.
     *
     * If Authorization Code Flow is used, the id_token is generated when the
     * authorization code is issued, and later returned from the token endpoint
     * together with the access_token.
     * If the Implicit Flow is used, the token and id_token are generated and
     * returned together.
     *
     * @param string $client_id    The client id.
     * @param string $user_id      The user id.
     * @param string $nonce        OPTIONAL The nonce.
     * @param string $userClaims   OPTIONAL Claims about the user.
     * @param string $access_token OPTIONAL The access token, if known.
     *
     * @return string The ID Token represented as a JSON Web Token (JWT).
     *
     * @see http://openid.net/specs/openid-connect-core-1_0.html#IDToken
     */
    public function createIdToken($client_id, $userInfo, $nonce = null, $userClaims = null, $access_token = null);
}


text:
'use strict';

import config from 'config';
import mongoose from 'mongoose';

export default callback => {
    // connect to a database if needed, then pass it to `callback`:
    mongoose.Promise = global.Promise;
    mongoose.connect(config.mongoDB, { useMongoClient: true });
    let db = mongoose.connection;
    db.on('error', console.error.bind(console, 'MongoDB connection error:'));
    db.once('open', () => console.log('Connected to MongoDB'));
    db.on('disconnected', () => {
        console.log('Disconnected from MongoDB');
        db = mongoose.connect(config.mongoDB);
        db.on('open', () => console.log('Reconnected to MongoDB'));
    });
    console.log('CONNECTING');
    callback(db);
}


text:
using Cofoundry.Domain.Extendable;

namespace Cofoundry.Domain.Internal;

public class ContentRepositoryUserByIdQueryBuilder
    : IContentRepositoryUserByIdQueryBuilder
    , IExtendableContentRepositoryPart
{
    private readonly int _userId;

    public ContentRepositoryUserByIdQueryBuilder(
        IExtendableContentRepository contentRepository,
        int userId
        )
    {
        ExtendableContentRepository = contentRepository;
        _userId = userId;
    }

    public IExtendableContentRepository ExtendableContentRepository { get; }

    public IDomainRepositoryQueryContext<UserMicroSummary> AsMicroSummary()
    {
        var query = new GetUserMicroSummaryByIdQuery(_userId);
        return DomainRepositoryQueryContextFactory.Create(query, ExtendableContentRepository);
    }

    public IDomainRepositoryQueryContext<UserDetails> AsDetails()
    {
        var query = new GetUserDetailsByIdQuery(_userId);
        return DomainRepositoryQueryContextFactory.Create(query, ExtendableContentRepository);
    }
}


text:
package com.raquo.domtypes.generic.builders

import com.raquo.domtypes.generic.codecs.{Codec, DoubleAsStringCodec, IntAsStringCodec, StringAsIsCodec}

/** This trait builds attribute objects which are typically found on the left hand side
  * of the `htmlAttr := value` syntax.
  *
  * @tparam A HTML Attribute
  */
trait HtmlAttrBuilder[A[_]] {

  /** Create an HTML Attribute */
  protected def htmlAttr[V](key: String, codec: Codec[V, String]): A[V]

  @inline protected def intHtmlAttr(key: String): A[Int] = htmlAttr(key, IntAsStringCodec)

  @inline protected def doubleHtmlAttr(key: String): A[Double] = htmlAttr(key, DoubleAsStringCodec)

  @inline protected def stringHtmlAttr(key: String): A[String] = htmlAttr(key, StringAsIsCodec)
}