text:
package android.graphics;

import android.content.res.AssetManager;
import android.util.SparseArray;

import java.io.File;

/**
 * The Typeface class specifies the typeface and intrinsic style of a font.
 * This is used in the paint, along with optionally Paint settings like
 * textSize, textSkewX, textScaleX to specify
 * how text appears when drawn (and measured).
 */
public class Typeface {

    /** The default NORMAL typeface object */
    public static final Typeface DEFAULT;
    /**
     * The default BOLD typeface object. Note: this may be not actually be
     * bold, depending on what fonts are installed. Call getStyle() to know
     * for sure.
     */
    public static final Typeface DEFAULT_BOLD;
    /** The NORMAL style of the default sans serif typeface. */
    public static final Typeface SANS_SERIF;
    /** The NORMAL style of the default serif typeface. */
    public static final Typeface SERIF;
    /** The NORMAL style of the default monospace typeface. */
    public static final Typeface MONOSPACE;

    static Typeface[] sDefaults;
    private static final SparseArray<SparseArray<Typeface>> sTypefaceCache =
            new SparseArray<SparseArray<Typeface>>(3);

    int native_instance;

    // Style
    public static final int NORMAL = 0;
    public static final int BOLD = 1;
    public static final int ITALIC = 2;
    public static final int BOLD_ITALIC = 3;

    private int mStyle = 0;

    /** Returns the typeface's intrinsic style attributes */
    public int getStyle() {
        return mStyle;
    }

    /** Returns true if getStyle() has the BOLD bit set. */
    public final boolean isBold() {
        return (mStyle & BOLD) != 0;
    }

    /** Returns true if getStyle() has the ITALIC bit set. */
    public final boolean isItalic() {
        return (mStyle & ITALIC) != 0;
    }

    /**
     * Create a typeface object given a family name, and option style information.
     * If null is passed for the name, then the "default" font will be chosen.
     * The resulting typeface object can be queried (getStyle()) to discover what
     * its "real" style characteristics are.
     *
     * @param familyName May be null. The name of the font family.
     * @param style  The style (normal, bold, italic) of the typeface.
     *               e.g. NORMAL, BOLD, ITALIC, BOLD_ITALIC
     * @return The best matching typeface.
     */
    public static Typeface create(String familyName, int style) {
        return new Typeface(nativeCreate(familyName, style));
    }

    /**
     * Create a typeface object that best matches the specified existing
     * typeface and the specified Style. Use this call if you want to pick a new
     * style from the same family of an existing typeface object. If family is
     * null, this selects from the default font's family.
     *
     * @param family May be null. The name of the existing type face.
     * @param style  The style (normal, bold, italic) of the typeface.
     *               e.g. NORMAL, BOLD, ITALIC, BOLD_ITALIC
     * @return The best matching typeface.
     */
    public static Typeface create(Typeface family, int style) {
        int ni = 0;
        if (family != null) {
            // Return early if we're asked for the same face/style
            if (family.mStyle == style) {
                return family;
            }

            ni = family.native_instance;
        }

        Typeface typeface;
        SparseArray<Typeface> styles = sTypefaceCache.get(ni);

        if (styles != null) {
            typeface = styles.get(style);
            if (typeface != null) {
                return typeface;
            }
        }

        typeface = new Typeface(nativeCreateFromTypeface(ni, style));
        if (styles == null) {
            styles = new SparseArray<Typeface>(4);
            sTypefaceCache.put(ni, styles);
        }
        styles.put(style, typeface);

        return typeface;
    }

    /**
     * Returns one of the default typeface objects, based on the specified style
     *
     * @return the default typeface that corresponds to the style
     */
    public static Typeface defaultFromStyle(int style) {
        return sDefaults[style];
    }

    /**
     * Create a new typeface from the specified font data.
     * @param mgr The application's asset manager
     * @param path  The file name of the font data in the assets directory
     * @return The new typeface.
     */
    public static Typeface createFromAsset(AssetManager mgr, String path) {
        return new Typeface(nativeCreateFromAsset(mgr, path));
    }

    /**
     * Create a new typeface from the specified font file.
     *
     * @param path The path to the font data.
     * @return The new typeface.
     */
    public static Typeface createFromFile(File path) {
        return new Typeface(nativeCreateFromFile(path.getAbsolutePath()));
    }

    /**
     * Create a new typeface from the specified font file.
     *
     * @param path The full path to the font data.
     * @return The new typeface.
     */
    public static Typeface createFromFile(String path) {
        return new Typeface(nativeCreateFromFile(path));
    }

    // don't allow clients to call this directly
    private Typeface(int ni) {
        if (ni == 0) {
            throw new RuntimeException("native typeface cannot be made");
        }

        native_instance = ni;
        mStyle = nativeGetStyle(ni);
    }

    static {
        DEFAULT         = create((String) null, 0);
        DEFAULT_BOLD    = create((String) null, Typeface.BOLD);
        SANS_SERIF      = create("sans-serif", 0);
        SERIF           = create("serif", 0);
        MONOSPACE       = create("monospace", 0);

        sDefaults = new Typeface[] {
            DEFAULT,
            DEFAULT_BOLD,
            create((String) null, Typeface.ITALIC),
            create((String) null, Typeface.BOLD_ITALIC),
        };
    }

    protected void finalize() throws Throwable {
        try {
            nativeUnref(native_instance);
        } finally {
            super.finalize();
        }
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Typeface typeface = (Typeface) o;

        return mStyle == typeface.mStyle && native_instance == typeface.native_instance;
    }

    @Override
    public int hashCode() {
        int result = native_instance;
        result = 31 * result + mStyle;
        return result;
    }

    private static native int  nativeCreate(String familyName, int style);
    private static native int  nativeCreateFromTypeface(int native_instance, int style);
    private static native void nativeUnref(int native_instance);
    private static native int  nativeGetStyle(int native_instance);
    private static native int  nativeCreateFromAsset(AssetManager mgr, String path);
    private static native int nativeCreateFromFile(String path);
}


text:
import App from 'app';

test('fetchAppData creates correct async action', () => {
  expect(App.actions.fetchAppData()).toEqual({
    type: App.actions.FETCH_APP_DATA,
    payload: new Promise(() => {}),
  });
});

test('uploadMedia creates correct async action', () => {
  expect(App.actions.uploadMedia()).toEqual({
    type: App.actions.UPLOAD_MEDIA,
    payload: new Promise(() => {}),
  });
});

redpajama_set_name: RedPajamaGithub


text:
package org.spongepowered.common.mixin.core.block.properties;

import net.minecraft.block.properties.PropertyEnum;
import org.spongepowered.api.block.trait.EnumTrait;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import java.util.Collection;

@Mixin(value = PropertyEnum.class)
public abstract class MixinPropertyEnum<E extends Enum<E>> extends MixinPropertyHelper<E> implements EnumTrait<E> {

}


text:
<?xml version="1.0" encoding="utf-8"?>

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.noveogroup.clap.test">

    <application
        android:allowBackup="false"
        android:icon="@drawable/ic_launcher"
        android:label="@string/application_name">

        <activity
            android:name=".TestActivity"
            android:screenOrientation="landscape">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

    </application>

</manifest>


text:
/**
* Author: Bob Chen
*/

package com.jcommerce.core.service;

import java.util.List;

import com.jcommerce.core.model.FriendLink;
import com.jcommerce.core.service.Criteria;
public interface FriendLinkManager extends Manager {
    public FriendLink initialize(FriendLink obj);

    public List<FriendLink> getFriendLinkList(int firstRow, int maxRow);

    public int getFriendLinkCount(Criteria criteria);

    public List<FriendLink> getFriendLinkList(Criteria criteria);

    public List<FriendLink> getFriendLinkList(int firstRow, int maxRow, Criteria criteria);

    public List<FriendLink> getFriendLinkList();

    public FriendLink getFriendLink(Long id);

    public void saveFriendLink(FriendLink obj);

    public void removeFriendLink(Long id);
}


text:
package com.wrapper.spotify.requests.data.playlists;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.wrapper.spotify.exceptions.SpotifyWebApiException;
import com.wrapper.spotify.requests.data.AbstractDataRequest;
import org.apache.hc.core5.http.ContentType;
import org.apache.hc.core5.http.ParseException;
import org.apache.hc.core5.http.io.entity.StringEntity;

import java.io.IOException;

/**
 * Replace the image used to represent a specific playlist.
 */
@JsonDeserialize(builder = UploadCustomPlaylistCoverImageRequest.Builder.class)
public class UploadCustomPlaylistCoverImageRequest extends AbstractDataRequest<String> {

  /**
   * The private {@link UploadCustomPlaylistCoverImageRequest} constructor.
   *
   * @param builder A {@link UploadCustomPlaylistCoverImageRequest.Builder}.
   */
  private UploadCustomPlaylistCoverImageRequest(final Builder builder) {
    super(builder);
  }

  /**
   * Upload a new playlist image.
   *
   * @return A string. Note: This endpoint doesn't return something in its response body.
   * @throws IOException            In case of networking issues.
   * @throws SpotifyWebApiException The Web API returned an error further specified in this exception's root cause.
   */
  public String execute() throws
    IOException,
    SpotifyWebApiException,
    ParseException {
    return putJson();
  }

  /**
   * Builder class for building an {@link UploadCustomPlaylistCoverImageRequest}.
   */
  public static final class Builder extends AbstractDataRequest.Builder<String, Builder> {

    /**
     * Create a new {@link UploadCustomPlaylistCoverImageRequest.Builder}.
     *

     * This access token must be tied to the user who owns the playlist, and must have the scope
     * {@code ugc-image-upload} granted. In addition, the token must also contain {@code playlist-modify-public}
     * and/or {@code playlist-modify-private}, depending the public status of the playlist you want to update.
     *
     * @param accessToken Required. A valid access token from the Spotify Accounts service.
     * @see Spotify: Using Scopes
     */
    public Builder(final String accessToken) {
      super(accessToken);
    }

    /**
     * The user ID setter.
     *
     * @param user_id The user's Spotify user ID.
     * @return A {@link UploadCustomPlaylistCoverImageRequest.Builder}.
     * @see Spotify: URIs & IDs
     * @deprecated Playlist IDs are unique for themselves. This parameter is thus no longer used.
     * (https://developer.spotify.com/community/news/2018/06/12/changes-to-playlist-uris/)
     */
    @Deprecated
    public Builder user_id(final String user_id) {
      assert (user_id != null);
      assert (!user_id.equals(""));
      return setPathParameter("user_id", user_id);
    }

    /**
     * The playlist ID setter.
     *
     * @param playlist_id The Spotify ID for the playlist.
     * @return A {@link UploadCustomPlaylistCoverImageRequest.Builder}.
     * @see Spotify: URIs & IDs
     */
    public Builder playlist_id(final String playlist_id) {
      assert (playlist_id != null);
      assert (!playlist_id.equals(""));
      return setPathParameter("playlist_id", playlist_id);
    }

    /**
     * The image data setter.
     *
     * @param image_data Base64 encoded JPEG image data, maximum payload size is 256 KB.
     * @return A {@link UploadCustomPlaylistCoverImageRequest.Builder}.
     */
    public Builder image_data(final String image_data) {
      assert (image_data != null);
      assert (!image_data.equals(""));
      assert (image_data.getBytes().length <= 256000);
      return setBody(new StringEntity(image_data, ContentType.IMAGE_JPEG));
    }

    /**
     * The request build method.
     *
     * @return A custom {@link UploadCustomPlaylistCoverImageRequest}.
     */
    @Override
    public UploadCustomPlaylistCoverImageRequest build() {
      setContentType(ContentType.IMAGE_JPEG);
      setPath("/v1/playlists/{playlist_id}/images");
      return new UploadCustomPlaylistCoverImageRequest(this);
    }

    @Override
    protected Builder self() {
      return this;
    }
  }
}


text:
// Template Source: Enum.java.tt
// ------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation.  All Rights Reserved.  Licensed under the MIT License.  See License in the project root for license information.
// ------------------------------------------------------------------------------

package com.microsoft.graph.models;

/**
 * The Enum Managed Device Owner Type.
*/
public enum ManagedDeviceOwnerType
{
    /**
    * unknown
    */
    UNKNOWN,
    /**
    * company
    */
    COMPANY,
    /**
    * personal
    */
    PERSONAL,
    /**
    * For ManagedDeviceOwnerType values that were not expected from the service
    */
    UNEXPECTED_VALUE
}


text:
package dbService;

/**
 * @author v.chibrikov
 */
public class DBException extends Exception {
    public DBException(Throwable throwable) {
        super(throwable);
    }
}


text:
ACCEPTED

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

#### Published in
Mycotaxon 34(2): 558 (1989)

#### Original name
Xanthoparmelia saleruptens Hale

### Remarks
null


text:
package org.seasar.doma.jdbc;

import java.lang.reflect.Method;
import java.util.Optional;
import org.seasar.doma.DomaNullPointerException;
import org.seasar.doma.jdbc.builder.SelectBuilder;

/** A context for a comment. */
@SuppressWarnings("OptionalUsedAsFieldOrParameterType")
public class CommentContext {

  protected final String className;

  protected final String methodName;

  protected final Config config;

  protected final Optional<Method> method;

  protected final Optional<String> message;

  /**
   * Creates an instance.
   *
   * @param className the class name that executes the SQL
   * @param methodName the method name that executes the SQL
   * @param config the configuration
   * @param method the DAO method
   * @param message the message
   */
  public CommentContext(
      String className, String methodName, Config config, Method method, String message) {
    if (className == null) {
      throw new DomaNullPointerException("className");
    }
    if (methodName == null) {
      throw new DomaNullPointerException("methodName");
    }
    if (config == null) {
      throw new DomaNullPointerException("config");
    }
    this.className = className;
    this.methodName = methodName;
    this.config = config;
    this.method = Optional.ofNullable(method);
    this.message = Optional.ofNullable(message);
  }

  /**
   * Returns the class name that executes the SQL.
   *
   * @return the class name
   */
  public String getClassName() {
    return className;
  }

  /**
   * Returns the method name that executes the SQL.
   *
   * @return the method name
   */
  public String getMethodName() {
    return methodName;
  }

  /**
   * Returns the configuration.
   *
   * @return the configuration
   */
  public Config getConfig() {
    return config;
  }

  /**
   * Returns the DAO method or {@link Optional#empty()} if the SQL is built by the builder classes
   * such as {@link SelectBuilder}.
   *
   * @return the DAO method or {@link Optional#empty()} if it does not exit
   */
  public Optional<Method> getMethod() {
    return method;
  }

  /**
   * Returns the message or {@link Optional#empty()}.
   *
   * @return the message or {@link Optional#empty()} if it does not exit
   */
  public Optional<String> getMessage() {
    return message;
  }
}


text:
namespace dcpupp
{
	typedef std::uint16_t Word;

	static const Word MaxWord = 0xffff;
}

#endif


text:
var modal = {};

modal.background = document.createElement("div");
modal.background.style.zIndex = 1000;
modal.background.style.position = "fixed";
modal.background.style.left = 0;
modal.background.style.top = 0;
modal.background.style.bottom = 0;
modal.background.style.left = 0;
modal.background.style.width = "100%";
modal.background.style.height = "100%";
modal.background.style.backgroundColor = "rgba(0,0,0,0.5)";

modal.dialog = document.createElement("div");
modal.dialog.style.backgroundColor = "white";
modal.dialog.style.width = "80%";
modal.dialog.style.maxWidth = "600px";
modal.dialog.style.padding = "30px";
modal.dialog.style.boxSizing = "border-box";
modal.dialog.style.margin = "50px auto";

modal.background.appendChild(modal.dialog);

modal.menu = document.createElement("div");
modal.menu.style.backgroundColor = "white";
modal.menu.style.display = "none";

modal.background.appendChild(modal.menu);

modal.showDeferredTimeout = null;

modal.htmlEscape = function(html) {
  var escaped = '';
  for (var i = 0; i < html.length; i++) {
    var c = html[i];
    switch (c) {
    case '<': escaped += '<'; break;
    case '>': escaped += '>'; break;
    case '&': escaped += '&'; break;
    case '"': escaped += '"'; break;
    default: escaped += c;
    }
  }
  return escaped;
}

modal.alert = function(html, callback) {
  modal.show('
' + html +'

<button>Ok</button>
');
  var button = modal.dialog.querySelector("button");
  button.onclick = function() {
     modal.hide();
     if (callback) {
       callback();
     }
  };
}

modal.confirm = function(label, callback) {
  modal.show('
' + label +'

<button>Cancel</button><button>Ok</button>
');
  modal.dialog.querySelector("p").innerHTML = label;
  var buttons = modal.dialog.querySelectorAll("button");
  buttons[0].onclick = buttons[1].onclick = function() {
     modal.hide();
     if (callback) {
       callback(this.textContent == "Ok");
     }
  };
};

modal.getDocumentPosition = function(element) {
  var r = element.getBoundingClientRect();
  return {
    x: r.left + window.scrollX,
    y: r.top + window.scrollY
  }
};

modal.getViewportPosition = function(element) {
  var x = 0;
  var y = 0;
  while(element && !isNaN(element.offsetLeft) && !isNaN(element.offsetTop)) {
        x += element.offsetLeft - element.scrollLeft;
        y += element.offsetTop - element.scrollTop;
        element = element.offsetParent;
    }
    return {x: x, y: y};
};

modal.hide = function() {
  if (modal.showDeferredTimeout) {
    window.clearTimeout(modal.showDeferredTimeout);
    modal.showDeferredTimeout = null;
  } else {
    document.body.removeChild(modal.background);
  }
}

modal.prompt = function(html, value, callback) {
  modal.show('
' + html + '

<input style="width:100%"></input>
' +
      '
<button>Cancel</button><button>Ok</button>
');
  var input = modal.dialog.querySelector("input");
  input.value = value;
  input.setSelectionRange(0, value.length)

  var buttons = modal.dialog.querySelectorAll("button");
  buttons[0].onclick = buttons[1].onclick = function() {
     modal.hide();
     if (callback && this.textContent == "Ok") {
       callback(input.value);
     }
  };
}

modal.choice = function(html, options, callback) {
  var optionsHtml = "";
  for (var i = 0; i < options.length; i += 2) {
    if (options[i] == null) {
      optionsHtml += '<option selected value="">(select)</option>'
    } else {
      optionsHtml += '"<option value="' + modal.htmlEscape(options[i+1]) + '">' +
        modal.htmlEscape(options[i]) + '</option>';
    }
  }

  modal.show('
' + html + '

<select style="width:100%">' + optionsHtml + '</select>' +
       '
<button>Cancel</button><button>Ok</button>
');

  var select = modal.dialog.querySelector("select");
  var buttons = modal.dialog.querySelectorAll("button");
  buttons[0].onclick = buttons[1].onclick = function() {
     modal.hide();
     if (callback && this.textContent == "Ok" && select.value) {
       callback(select.value);
     }
  };
}

modal.show = function(html) {
  modal.dialog.style.display = "block";
  modal.showDeferredTimeout = null;
  modal.dialog.innerHTML = html;
  document.body.appendChild(modal.background);
}

modal.showDeferred = function(label) {
  modal.showDeferredTimeout = window.setTimeout(function() {modal.show(label);}, 500);
}


text:
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Elasticsearch.Net;
using Nest.Domain;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Nest.Resolvers;

namespace Nest
{
	//TODO rethink IHIT<T> deserialization where T is covariant
	internal class DefaultHitJsonConverter : JsonConverter
	{
		private static readonly ConcurrentDictionary<Type, JsonConverter> _hitTypes = new ConcurrentDictionary<Type, JsonConverter>();

		public override bool CanWrite { get { return false; } }
		public override bool CanRead { get { return true; } }

		public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
		{
			throw new NotImplementedException();
		}

		public override bool CanConvert(Type objectType)
		{
			return true;
		}

		public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
		{
			JsonConverter converter;
			if (_hitTypes.TryGetValue(objectType, out converter))
				return converter.ReadJson(reader, objectType, existingValue, serializer);

			var genericType = typeof(ConcreteTypeConverter<>);
			var closedType = genericType.MakeGenericType(objectType.GetGenericArguments()[0]);
			converter = (JsonConverter)closedType.CreateInstance();
			_hitTypes.TryAdd(objectType, converter);
			return converter.ReadJson(reader, objectType, existingValue, serializer);
		}

	}

	internal class FieldsSetter
	{
		//This method is used through reflection (cached though)
		// do not remove
		private static void SetFields<TFieldsType>(
			Hit<TFieldsType> hit, FieldSelection<TFieldsType> fieldSelection)
			where TFieldsType : class
		{
			hit.Fields = fieldSelection;
		}
	}

	internal class ConcreteTypeConverter<T> : JsonConverter where T : class
	{
		internal readonly Type _baseType;
		internal readonly Func<dynamic, Hit<dynamic>, Type> _concreteTypeSelector;

		public override bool CanWrite => false;
		public override bool CanRead => true;

		public ConcreteTypeConverter() {}

		public ConcreteTypeConverter(Func<dynamic, Hit<dynamic>, Type> concreteTypeSelector)
		{
			concreteTypeSelector.ThrowIfNull(nameof(concreteTypeSelector));

			this._baseType = typeof(T);
			this._concreteTypeSelector = concreteTypeSelector;
		}

		public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
		{
			var realConverter = serializer.GetStatefulConverter<ConcreteTypeConverter<T>>();
			if (realConverter != null)
				return ConcreteTypeConverter.GetUsingConcreteTypeConverter<T>(reader, serializer, realConverter);

			var instance = (Hit<T>)(typeof(Hit<T>).CreateInstance());
			serializer.Populate(reader, instance);
			instance.Fields = new FieldSelection<T>(serializer.GetConnectionSettings(), instance._fields);
			return instance;
		}

		public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
		{
			throw new NotImplementedException();
		}

		public override bool CanConvert(Type objectType)
		{
			return typeof(IHit<object>).IsAssignableFrom(objectType);
		}
	}

	internal static class ConcreteTypeConverter
	{
		internal static ConcurrentDictionary<Type, Action<object, object>>
			FieldDelegates = new ConcurrentDictionary<Type, Action<object, object>>();

		internal static ConcurrentDictionary<Type, Type> TypeToFieldTypes =
			new ConcurrentDictionary<Type, Type>();

		internal static MethodInfo MakeDelegateMethodInfo =
			typeof(FieldsSetter).GetMethod("SetFields", BindingFlags.Static | BindingFlags.NonPublic);

		internal static object GetUsingConcreteTypeConverter<T>(
			JsonReader reader, JsonSerializer serializer, ConcreteTypeConverter<T> realConcreteConverter)
			where T : class
		{
			var jObject = CreateIntermediateJObject(reader);
			object fieldSelection;
			var concreteType = GetConcreteTypeUsingSelector(serializer, realConcreteConverter, jObject, out fieldSelection);
			var hit = GetHitTypeInstance(concreteType);
			PopulateHit(serializer, jObject.CreateReader(), hit);

			Action<object, object> cachedLookup;
			if (ConcreteTypeConverter.FieldDelegates.TryGetValue(concreteType, out cachedLookup))
			{
				cachedLookup(hit, fieldSelection);
				return hit;
			}

			var generic = ConcreteTypeConverter.MakeDelegateMethodInfo.MakeGenericMethod(concreteType);
			cachedLookup = (h, f) => generic.Invoke(null, new[] { h, f });
			cachedLookup(hit, fieldSelection);
			ConcreteTypeConverter.FieldDelegates.TryAdd(concreteType, cachedLookup);
			return hit;
		}
		private static void PopulateHit(JsonSerializer serializer, JsonReader reader, object hit) {
			serializer.Populate(reader, hit);
		}
		private static JObject CreateIntermediateJObject(JsonReader reader)
		{
			JObject jObject = JObject.Load(reader);
			return jObject;
		}

		private static object GetHitTypeInstance(Type concreteType)
		{
			var hitType = typeof (Hit<>).MakeGenericType(concreteType);
			return hitType.CreateInstance();
		}

		internal static Type GetConcreteTypeUsingSelector<T>(
			JsonSerializer serializer,
			ConcreteTypeConverter<T> realConcreteConverter,
			JObject jObject, out object selection)
			where T: class
		{
			var settings = serializer.GetConnectionSettings();
			var baseType = realConcreteConverter._baseType;
			var selector = realConcreteConverter._concreteTypeSelector;

			//Hit<dynamic> hitDynamic = new Hit<dynamic>();
			dynamic d = jObject;
			var fields = jObject["fields"];
			var fieldSelectionData = fields?.ToObject<IDictionary<string, object>>();
			var sel = new FieldSelection<T>(settings, fieldSelectionData);
			var hitDynamic = new Hit<dynamic>();
			//favor manual mapping over doing Populate twice.
			hitDynamic._fields = fieldSelectionData;
			hitDynamic.Fields = sel;
			hitDynamic.Source = d._source;
			hitDynamic.Index = d._index;
			hitDynamic._score = (d._score is double) ? d._score : default(double);
			hitDynamic.Type = d._type;
			hitDynamic.Version = d._version;
			hitDynamic.Id = d._id;
			hitDynamic.Sorts = d.sort;
			hitDynamic._Highlight = d.highlight is Dictionary<string, List<string>> ? d.highlight : null;
			hitDynamic.Explanation = d._explanation is Explanation ? d._explanation : null;
			object o = d._source ?? DynamicResponse.Create(fieldSelectionData) ?? new object {};
			var concreteType = selector(o, hitDynamic);

			Type fieldSelectionType;
			if (!ConcreteTypeConverter.TypeToFieldTypes.TryGetValue(concreteType, out fieldSelectionType))
			{
				fieldSelectionType = typeof(FieldSelection<>).MakeGenericType(concreteType);
				ConcreteTypeConverter.TypeToFieldTypes.TryAdd(concreteType, fieldSelectionType);
			}
			selection = fieldSelectionType.CreateInstance(settings, fieldSelectionData);
			return concreteType;
		}
	}
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Hook result - Boost.Outcome documentation</title>
<link rel="stylesheet" href="../../../css/boost.css" type="text/css">
<meta name="generator" content="Hugo 0.52 with Boostdoc theme">
<meta name="viewport" content="width=device-width,initial-scale=1.0"/>

<link rel="icon" href="../../../images/favicon.ico" type="image/ico"/>

Hook result

We now tell Outcome that for every instance of our localised result<T>, that
on failure construction only, we want custom code to be run which increments the current
slot in TLS storage and writes the current stack backtrace into it.

For Outcome before v2.2, we must do this by inserting a specially named free function into
a namespace searched by ADL:

namespace error_code_extended
{
  // Specialise the result construction hook for our localised result
  // We hook any non-copy, non-move, non-inplace construction, capturing a stack backtrace
  // if the result is errored.
  template <class T, class U> inline void hook_result_construction(result<T> *res, U && /*unused*/) noexcept
  {
    if(res->has_error())
    {
      // Grab the next extended info slot in the TLS
      extended_error_info &eei = mythreadlocaldata().next();

      // Write the index just grabbed into the spare uint16_t
      BOOST_OUTCOME_V2_NAMESPACE::hooks::set_spare_storage(res, mythreadlocaldata().current - 1);

      // Capture a backtrace into my claimed extended info slot in the TLS
      eei.items = ::backtrace(eei.backtrace.data(), eei.backtrace.size());
    }
  }
}

View this code on Github

For Outcome v2.2 and later, we must do this by using a custom no value policy which contains
a function named on_result_construction(). The function implementation is identical between
both mechanisms, just the name and placement of the function declaration differs.

The only non-obvious part above is the call to void set_spare_storage(basic_result|basic_outcome *, uint16_t) noexcept
.

Both result and outcome keep their internal state metadata in a uint32_t,
half of which is not used by Outcome. As it can be very useful to keep a small
unique number attached to any particular result or outcome instance, we
permit user code to set those sixteen bits to anything they feel like.
The corresponding function to retrieve those sixteen bits is uint16_t spare_storage(const basic_result|basic_outcome *) noexcept
.

The state of the sixteen bits of spare storage are ignored during comparison operations.

The sixteen bits of spare storage propagate during the following operations:

Copy and move construction between result’s.

Copy and move construction between outcome’s.

Copy and move construction from a result to an outcome.

Converting copy and move constructions for all the above.

Assignment for all of the above.

They are NOT propagated in these operations:

Any conversion or translation which goes through a failure_type or success_type.

Any conversion or translation which goes through a ValueOrError concept match.

Any unpacking or repacking of value/error/exception e.g. a manual repack of an
outcome into a result.

Last revised: December 15, 2020 at 12:22:39 UTC


text:
package signalproc.filtering.freqdomain;

import org.trianacode.taskgraph.Unit;
import signalproc.algorithms.Shift;
import triana.types.ComplexSpectrum;
import triana.types.Const;
import triana.types.ProcessDoublesInterface;
import triana.types.util.Str;

/**
 * A HetdyneF_old unit to take an input ComplexSpectrum and output two ComplexSpectrum's that represent the FTs of the
 * two quadruature components of the heterodyne of the time-series that led to the input ComplexSpectrum. (These are the
 * results of heterodyning with cosine and sine at the heterodyne frequency.) The user can choose the heterodyne
 * frequency and bandwidth. The user can select that the output spectra should have their Nyquist frequency reduced so
 * that when they are inverted to the time-domain they are sampled at the rate given by the heterodyne bandwidth rather
 * than the original sampling rate.
 *
 * @author B F Schutz
 * @version $Revision: 2921 $
 */
public class HetdyneF extends Unit implements ProcessDoublesInterface {

    // parameter data type definitions
    private double freq;
    private double bandwidth;
    private String window;
    private boolean nyquist;

    /*
     * Called whenever there is data for the unit to process
     */

    public void process() throws Exception {

        ComplexSpectrum inputPos = (ComplexSpectrum) getInputAtNode(0);
        ComplexSpectrum inputNeg = (ComplexSpectrum) inputPos.copyMe();

        int steps = (int) Math.round(freq / inputPos.getFrequencyResolution());
        /*
        println("inputPos:");
        for ( k = 0; k < inputPos.size(); k++ ) println( String.valueOf( inputPos.getDataReal()[k] ) );
        */
        Shift.shiftData(inputPos, -steps);
        /*
        println("inputPos after shift to right:");
        for ( k = 0; k < inputPos.size(); k++ ) println( String.valueOf( inputPos.getDataReal()[k] ) );
        */
        Shift.shiftData(inputNeg, steps);
        /*
        println("inputNeg after shift to left:");
        for ( k = 0; k < inputNeg.size(); k++ ) println( String.valueOf( inputNeg.getDataReal()[k] ) );
        */

        ComplexSpectrum temp = (ComplexSpectrum) inputPos.copyMe();
        inputPos = (ComplexSpectrum) inputPos.add(inputNeg);
        /*
        println("inputPos after adding:");
        for ( k = 0; k < inputPos.size(); k++ ) println( String.valueOf( inputPos.getDataReal()[k] ) );
        */
        temp = (ComplexSpectrum) temp.subtract(inputNeg);
        temp = (ComplexSpectrum) temp.multiply(new Const(0.0, 1.0));
        /*
        println("temp after subtracting and multiplying:");
        for ( k = 0; k < temp.size(); k++ ) println( String.valueOf( temp.getDataReal()[k] ) );
        */

        ComplexSpectrum cosineQuad = inputPos;
        ComplexSpectrum sineQuad = temp;

        ComplexSpectrum sineHet = (ComplexSpectrum) LowPass.filterToMax(sineQuad, bandwidth / 2, true, window, nyquist);
        /*
        println("sineHet:");
        for ( k = 0; k < sineHet.size(); k++ ) println( String.valueOf( sineHet.getDataReal()[k] ) );
        */
        ComplexSpectrum cosineHet = (ComplexSpectrum) LowPass
                .filterToMax(cosineQuad, bandwidth / 2, true, window, nyquist);
        /*
        println("cosineHet:");
        for ( k = 0; k < cosineHet.size(); k++ ) println( String.valueOf( cosineHet.getDataReal()[k] ) );
        */

        outputAtNode(0, cosineHet);
        outputAtNode(1, sineHet);
    }

    /**
     * Called when the unit is created. Initialises the unit's properties and parameters.
     */
    public void init() {
        super.init();

        defineParameter("requireDoubleInputs", new Boolean(false), INTERNAL);
        defineParameter("canProcessDoubleArrays", new Boolean(false), INTERNAL);

        // Initialise node properties
        setDefaultInputNodes(1);
        setMinimumInputNodes(1);
        setMaximumInputNodes(1);

        setDefaultOutputNodes(2);
        setMinimumOutputNodes(2);
        setMaximumOutputNodes(2);

        // Initialise parameter update policy
        setParameterUpdatePolicy(PROCESS_UPDATE);

        // Initialise pop-up description and help file location
        setPopUpDescription(
                "Produce heterodyned narrow-band ComplexSpectra (cosine and sine quadratures) from input ComplexSpectrum");
        setHelpFileLocation("HetdyneF.html");

        // Define initial value and type of parameters
        defineParameter("freq", "500", USER_ACCESSIBLE);
        defineParameter("bandwidth", "100", USER_ACCESSIBLE);
        defineParameter("window", "Rectangle", USER_ACCESSIBLE);
        defineParameter("nyquist", "true", USER_ACCESSIBLE);

        // Initialise custom panel interface
        setParameterPanelClass("signalproc.filtering.freqdomain.HetdyneFpanel");
    }

    /**
     * Called when the unit is reset. Restores the unit's variables to values specified by the parameters.
     */
    public void reset() {
        // Set unit variables to the values specified by the parameters
        freq = new Double((String) getParameter("freq")).doubleValue();
        bandwidth = new Double((String) getParameter("bandwidth")).doubleValue();
        window = (String) getParameter("window");
        nyquist = new Boolean((String) getParameter("nyquist")).booleanValue();
    }

    /**
     * Called when the unit is disposed of.
     */
    public void dispose() {
        // Insert code to clean-up NewHetdyneF (e.g. close open files)
    }

    /**
     * Called a parameters is updated (e.g. by the GUI)
     */
    public void parameterUpdate(String paramname, Object value) {
        // Code to update local variables
        if (paramname.equals("freq")) {
            freq = Str.strToDouble((String) value);
        }

        if (paramname.equals("bandwidth")) {
            bandwidth = Str.strToDouble((String) value);
        }

        if (paramname.equals("window")) {
            window = (String) value;
        }

        if (paramname.equals("nyquist")) {
            nyquist = Str.strToBoolean((String) value);
        }
    }

    public boolean getRequireDoubleInputs() {
        return ((Boolean) getParameter("requireDoubleInputs")).booleanValue();
    }

    public boolean getCanProcessDoubleArrays() {
        return ((Boolean) getParameter("canProcessDoubleArrays")).booleanValue();
    }

    public void setRequireDoubleInputs(boolean state) {
        setParameter("requireDoubleInputs", new Boolean(state));
    }

    public void setCanProcessDoubleArrays(boolean state) {
        setParameter("canProcessDoubleArrays", new Boolean(state));
    }

    /**
     * @return an array of the input types for NewHetdyneF
     */
    public String[] getInputTypes() {
        return new String[]{"ComplexSpectrum"};
    }

    /**
     * @return an array of the output types for NewHetdyneF
     */
    public String[] getOutputTypes() {
        return new String[]{"ComplexSpectrum"};
    }

}


text:
"""
test_consolidate.py
-------------------------------

Tests for the `consolidate.py` module

"""

import unittest
import os
import sys
import shutil
import utils

# Include the parent directory in the PYTHONPATH for relative imports
sys.path.append('..')
import consolidate

TEST_OUTPUT_PATH = 'output'
TEST_DATA_FILES = {'read1': 'data/umitagged/mysample.r1.umitagged.fastq',
                  'read2': 'data/umitagged/mysample.r2.umitagged.fastq',
                  'read1_out': os.path.join(TEST_OUTPUT_PATH, 'mysample.r1.consolidated.fastq'),
                  'read2_out': os.path.join(TEST_OUTPUT_PATH, 'mysample.r2.consolidated.fastq')}
TEST_MIN_QUAL = 15
TEST_MIN_FREQ = 0.9
CORRECT_UMITAGGED_OUTPUT_FOLDER = 'data/consolidated'

class TestConsolidate(unittest.TestCase):

    def setUp(self):
        # Create the output folder
        os.makedirs(TEST_OUTPUT_PATH)

    def testConsolidateTestCase(self):
        # Run the consolidation module on the test data
        consolidate.consolidate(TEST_DATA_FILES['read1'],
                                TEST_DATA_FILES['read1_out'],
                                TEST_MIN_QUAL,
                                TEST_MIN_FREQ)

        consolidate.consolidate(TEST_DATA_FILES['read2'],
                                TEST_DATA_FILES['read2_out'],
                                TEST_MIN_QUAL,
                                TEST_MIN_FREQ)

        self.assertTrue(utils.checkFolderEquality(TEST_OUTPUT_PATH, CORRECT_UMITAGGED_OUTPUT_FOLDER))

    def tearDown(self):
        # Delete the output folder and the results
        shutil.rmtree(TEST_OUTPUT_PATH)

if __name__ == '__main__':
    unittest.main()


text:
**Subtitle Shifter**
Manage subtitles
Only srt format for now.

*Usage*

java -jar sshifter.jar -f <subtitle-file> [-l|-s|-m|-h|-o|-a]

*Example Usages*

java -r sshifter.jar -f orj.srt -l10 -s20 -m1
# subtitle 1 minutes, 20 seconds and 10 milliseconds shifted
# new subtitle: resycn-orj.srt

java -r sshifter.jar -f orj.srt -l-35
# subtitle -35 milliseconds shifted
# subtitle overrided

Commands

usage: java -jar sshifter.jar -f <subtitle-file> [-l|-s|-m|-h|-o|-a]
     -a,--after <arg>           After time
     -e,--encoding <arg>        Subtitle encoding
     -f,--subtitle-file <arg>   Subtitle file
     -h,--Hours <arg>           Hours
     -l,--Milliseconds <arg>    Milliseconds
     -m,--Minutes <arg>         Minutes
     -o,--override              Override subtitle
     -s,--Seconds <arg>         Seconds


text:
#wrapper{
	background: #ffffff;
}
/*  header contact info section ***/
.header_section{
	background-color:#31A3DD;
	color:#fff;
        top:0px;
}
/** navbar menus ***/
.navigation_menu{
	background-color: #fff;
	border-top:2px solid #31A3DD;
}
.navbar-default .navbar-nav > .active > a, .navbar-default .navbar-nav > .active > a:hover, .navbar-default .navbar-nav > .active > a:focus,
.dropdown-menu .active a {
	background-color: #31A3DD;
}
.collapse ul.nav li.current-menu-parent .dropdown-toggle, .collapse ul.nav li.current-menu-item .dropdown-toggle,
.navbar-default .navbar-collapse ul.nav li.current-menu-parent .dropdown-toggle,.navbar-default .navbar-collapse ul.nav li.current-menu-item .dropdown-toggle
.collapse ul.nav li.current_page_ancestor .dropdown-toggle,.collapse ul.nav li.current_page_ancestor .dropdown-toggle,
.navbar-default .navbar-collapse ul.nav li.current_page_ancestor .dropdown-toggle,.navbar-default .navbar-collapse ul.nav li.current_page_ancestor .dropdown-toggle
{
	background-color: #31A3DD;
	box-shadow: 3px 3px 0 rgba(201, 201, 201, 1);
	color: #fff !important;
	border-radius:0px;
}

.navbar-default .navbar-nav > .open > a,
.navbar-default .navbar-nav > .open > a:hover,
.navbar-default .navbar-nav > .open > a:focus {
	background-color: #31A3DD;
}

.navbar-default .navbar-nav > li > a:hover,
.navbar-default .navbar-nav > li > a:focus {
	background-color: #31A3DD;
}

.dropdown-menu {
	background-color: rgba(49, 162, 221, 0.9);
}
/** headings titles css ***/
.enigma_heading_title h3 {
	border-bottom: 4px solid #31A3DD;
	color: #3b3b3b;
}
.enigma_heading_title2 h3 {
	border-bottom: 2px solid #31A3DD;
	color: #3b3b3b;
}
/** slider css ***/
.carousel-list li {
	background:rgba(49, 162, 221, 0.8);
}

/** service  section css ***/
.enigma_service_iocn{
	border: 4px solid #31A3DD;
	background-color:#31A3DD;
	background-size: 100% 200%;
	background-image: linear-gradient(to bottom, #31A3DD 50%, #fff 50%);
}
.enigma_service_area:hover .enigma_service_iocn i {
	color:#31A3DD;
}
.enigma_service_area:hover .enigma_service_iocn{background-color:#ffffff;}
.enigma_service_iocn_2 i{
	background: #fff;
	border: 4px solid #31A3DD;
}
.enigma_service_iocn_2 i{
	color: #31A3DD;
	background-size: 100% 200%;
	background-image: linear-gradient(to bottom, #fff 50%, #31A3DD 50%);
 }

/****************portfolio css ********************************************************
********************************************************************************/

.enigma_home_portfolio_showcase .enigma_home_portfolio_showcase_icons a {
	background-color: #31A3DD;
	border:2px solid #31A3DD;
	color:#fff;
}
.enigma_home_portfolio_showcase .enigma_home_portfolio_showcase_icons a:hover{
	background-color: #ffffff;
	border:2px solid #31A3DD;
	color:#31A3DD;
}
.enigma_home_portfolio_caption {
	border-left:1px solid #ccc;
	border-bottom:4px solid #31A3DD;
	border-right:1px solid #ccc;
}

.enigma_home_portfolio_caption:hover{
    background: #31A3DD;
}
.enigma_home_portfolio_caption:hover  h3 a ,.enigma_home_portfolio_caption:hover  small{
   color: #ffffff;
}
.img-wrapper:hover .enigma_home_portfolio_caption{
 background: #31A3DD;
 border-left:1px solid #31A3DD;
	border-bottom:4px solid #31A3DD;
	border-right:1px solid #31A3DD;
}
.img-wrapper:hover .enigma_home_portfolio_caption  h3 a,.img-wrapper:hover .enigma_home_portfolio_caption  small{
 color: #ffffff;
}

.enigma_proejct_button a {
	background-color: #f8504b;
	color: #FFFFFF;
	border: 2px solid #31A3DD;
	transition: all 0.4s ease 0s;
}
.enigma_proejct_button a:hover {
	background-color: #ffffff;
	color: #31A3DD;
	border: 2px solid #31A3DD;
	text-decoration:none;

}

.enigma_carousel-prev, .enigma_carousel-next {
    background-color: #fff;
	border: 2px solid #31A3DD;
}
.enigma_carousel-prev:hover, .enigma_carousel-next:hover {
    background-color: #31A3DD;
	color:#fff;
}
.enigma_carousel-prev:hover i, .enigma_carousel-next:hover i{
    color:#fff;
}
.enigma_carousel-prev i,
.enigma_carousel-next i {
	color: #31A3DD;
}

/*** project detail ***/
.enigma_portfolio_detail_pagi li a {
	color: #404040;
	border:2px solid #31A3DD;
	text-align:center;
	background-size: 100% 200%;
    background-image: linear-gradient(to bottom, #31A3DD 50%, #ffffff 50%);
   -webkit-transition: all ease 0.5s;
    -moz-transition: all ease 0.5s;
    transition: all ease 0.5s;

}
.enigma_portfolio_detail_pagi li a:hover {
	color: #404040;
	border:2px solid #31A3DD;
	background-position: 0 -100%;
}

.enigma_portfolio_detail_pagi li a span{
	color:#fff;
	line-height:35px;
}
.enigma_portfolio_detail_pagi li a:hover span{
	color:31A3DD;
}
.enigma-project-detail-sidebar p small {
	color:#777777;

}

.enigma-project-detail-sidebar .launch-enigma-project a {

	color: #ffffff;
	border: 2px solid #31A3DD;
	background-size: 100% 200%;
    background-image: linear-gradient(to bottom, #31A3DD 50%, #ffffff 50%);
   -webkit-transition: all ease 0.5s;
    -moz-transition: all ease 0.5s;
    transition: all ease 0.5s;
}
.enigma-project-detail-sidebar .launch-enigma-project a:hover {
	background-color: #ffffff;
	color: #31A3DD;
	border: 2px solid #31A3DD;
	background-position: 0 -100%;
}

/** gallery css **/

.enigma_gallery_showcase .enigma_gallery_showcase_icons a {
	background-color: #31A3DD;
	border:2px solid #31A3DD;
	color:#fff;
}

.enigma_gallery_showcase .enigma_gallery_showcase_icons a:hover{
	background-color: #ffffff;
	border:2px solid #31A3DD;
	color:#31A3DD;
}

/**************** blog css ********************************************************
********************************************************************************/

/** blog thumbnail css **/
.enigma_blog_thumb_wrapper{
	background:#fff;
	border-bottom: 5px solid #31A3DD;
	box-shadow: 0 0 6px rgba(0,0,0,.7);

}
.enigma_blog_thumb_wrapper h2 a{
	color:#31A3DD;
	transition: all 0.4s ease 0s;
}

.enigma_blog_thumb_wrapper h2:hover a{
	color:#31A3DD;

}
.enigma_blog_thumb_date li i{
	color: #31A3DD;
}
.enigma_tags a ,.enigma_cats a{
	background-size: 100% 200%;
	background-color:#edf0f2;
    background-image: linear-gradient(to bottom, #edf0f2 50%, #31A3DD 50%);
 }

.enigma_tags a:hover , .enigma_cats a:hover{
	color:#fff;
	background-position: 0 -100%;
	background-color:#31A3DD;
}
.enigma_tags a i ,.enigma_cats a i{
	color:#31A3DD;
}
.enigma_tags a:hover i ,.enigma_cats a:hover i{
	color:#fff;
}

.enigma_blog_thumb_wrapper span a i{
	color: #31A3DD;
}
.enigma_blog_thumb_wrapper span a {
	color:#555;

}.enigma_blog_thumb_footer{
	padding-top:20px;
	padding-bottom:10px;
	border-top:3px solid  #f5f5f5;
}

.enigma_blog_read_btn{
	border: 2px solid #31A3DD;
	background-size: 100% 200%;
	background-color:#31A3DD;
    background-image: linear-gradient(to bottom, #31A3DD 50%, #fff 50%);
   }
.enigma_blog_read_btn i {
	margin-right:5px;
}
.enigma_blog_read_btn:hover{
	background-position: 0 -100%;
	background-color:#ffffff;
	color: #31A3DD;
}
.enigma_blog_read_btn a{color:#ffffff;}

.enigma_blog_thumb_wrapper_showcase .enigma_blog_thumb_wrapper_showcase_icons a {
	background-color: #31A3DD;
	color: #fff;
	-webkit-transition: all .25s ease-in;
    -moz-transition: all .25s ease-in;
    -o-transition: all .25s ease-in;
    transition: all .25s ease-in;
}
.enigma_blog_thumb_wrapper_showcase .enigma_blog_thumb_wrapper_showcase_icons a:hover{
	background-color: #ffffff;
	border: 2px solid #31A3DD;
	color: #31A3DD;
}
/********* Blog Full width css ********/
.enigma_post_date {
	background: #31A3DD;
	color: #ffffff;
}
.enigma_blog_comment:hover i, .enigma_blog_comment:hover h6{
	color:#31A3DD;
}
.enigma_fuul_blog_detail_padding h2 a ,.enigma_fuul_blog_detail_padding h2{
	color:#31A3DD;
}
.enigma_fuul_blog_detail_padding h2  a:hover{
	color:#31A3DD;
}
/*** blog sidebar css **/
.enigma_recent_widget_post h3 a {
	color:#31A3DD;
}
.enigma_sidebar_widget {
	border-left: 3px solid #31A3DD;
	border-right: 3px solid #31A3DD;
	border-bottom: 3px solid #31A3DD;
	background-color:#ffffff;
}
.enigma_sidebar_widget_title{
	background:#31A3DD;
}
.enigma_sidebar_link p a:hover  , .enigma_sidebar_widget ul li a:hover {
	color: #31A3DD;
}

.enigma_widget_tags a , .tagcloud a {
	background-size: 100% 200%;
	background-color:#edf0f2;
    background-image: linear-gradient(to bottom, #edf0f2 50%, #31A3DD 50%);
 }
.enigma_widget_tags a:hover , .tagcloud a:hover {
	border: 1px solid #31A3DD;
	background-color:#31A3DD;
	background-position: 0 -100%;

	color: #ffffff;
}

/** blog detail **/
.enigma_author_detail_wrapper{
	background: #31A3DD;
	padding:15px;
	margin-bottom:40px;

}
.enigma_author_detail_wrapper{
	border-left:2px solid #31A3DD;
}
/** blog  form input css **/
.reply a {
	color: #31A3DD;
}
.enigma_con_input_control:focus, .enigma_con_textarea_control:focus,
.enigma_contact_input_control:focus, .enigma_contact_textarea_control:focus {
  border-color: #31A3DD;
  -webkit-box-shadow: inset 0 0px 0px #31A3DD, 0 0 5px #31A3DD;
          box-shadow: inset 0 0px 0px #31A3DD, 0 0 5px #31A3DD;
}
.enigma_send_button , #enigma_send_button{
	border-color: #31A3DD;
	color: #6a6a6a;
	background-color:#ffffff;
	background-size: 100% 200%;
    background-image: linear-gradient(to bottom, #fff 50%, #31A3DD 50%);
   -webkit-transition: all ease 0.5s;
    -moz-transition: all ease 0.5s;
    transition: all ease 0.5s;
}
.enigma_send_button:hover ,#enigma_send_button:hover{
	background-position: 0 -100%;
    border: 2px solid #31A3DD;
	color: #ffffff;
	background-color:#31A3DD;
}

.enigma_blog_pagination {
	background-color: #FFFFFF;
}
.enigma_blog_pagi a {
	border: 1px solid #dbdbdb !important;
	background-color: #ffffff;
	background-size: 100% 200%;
	background-image: linear-gradient(to bottom, #fff 50%, #31A3DD 50%);
   -webkit-transition: all ease 0.5s;
    -moz-transition: all ease 0.5s;
    transition: all ease 0.5s;
	color: #777777;
}
.enigma_blog_pagi a:hover, .enigma_blog_pagi a.active {
	background-position: 0 -100%;
	color: #ffffff;
}

/****** Testimonial css *******************************************
****************************************************************/
.enigma_testimonial_area i{
	color:#31A3DD;
}
.enigma_testimonial_area img{
	border: 10px solid #31A3DD;
}
.pager a{
	background: #fff;
	border: 2px solid #31A3DD;
}
.pager a.selected{
	background: #31A3DD;
	border: 2px solid #31A3DD;
}
/**** Client Css *************************************************
****************************************************************/
.enigma_client_wrapper:hover {
	border: 4px solid #31A3DD;

}
.enigma_client_prev, .enigma_client_next {
    background-color: #fff;
	border: 2px solid #31A3DD;
}
.enigma_client_prev:hover, .enigma_client_next:hover {
    background-color: #31A3DD;
	color:#fff;
}
.enigma_client_prev:hover i, .enigma_client_next:hover i{
    color:#fff;
}

.enigma_carousel-prev i,
.enigma_carousel-next i {
	color: #31A3DD;
}
/**** About us page Css *************************************************
****************************************************************/
.enigma_team_showcase .enigma_team_showcase_icons a {
	background-color: #31A3DD;
	border:2px solid #31A3DD;
	color:#fff;
}

.enigma_team_showcase .enigma_team_showcase_icons a:hover{
	background-color: #ffffff;
	border:2px solid #31A3DD;
	color:#31A3DD;
}

.enigma_team_caption:hover{
    background: #31A3DD;
}
.enigma_team_caption:hover  h3 a ,.enigma_team_caption:hover  small{
   color: #ffffff;
}

.enigma_team_wrapper:hover .enigma_team_caption{
 background: #31A3DD;
}
.enigma_team_wrapper:hover .enigma_team_caption  h3 ,.enigma_team_wrapper:hover .enigma_team_caption  small{
 color: #ffffff;
}
/***** Call Out Section *****************************************************************
***************************************************************************************/
.enigma_callout_area {
	background-color: #31A3DD;

}
/***** Footer Area Css *****************************************************************
***************************************************************************************/
.enigma_footer_area{
	background: #31A3DD;
	border-top: 0px solid #6B6B6B;
}
/***** Contact Info Css *****************************************************************
***************************************************************************************/
.enigma_contact_info li .desc {
	color: #31A3DD;
}
/***** Shortcode  Css *****************************************************************
***************************************************************************************/
/*Dropcaps Styles*/
.enigma_dropcape_square span {
	background-color: #31A3DD;
    color: #FFFFFF;
}
.enigma_dropcape_simple span {
    color: #31A3DD;
}
.enigma_dropcape_circle span {
	background-color: #31A3DD;
    color: #FFFFFF;
}
/*** breadcum style css **/
.breadcrumb li a {
color: #31A3DD !important;
}
/** progress bar or nav button css */
.progress-bar {
	background-color: #31A3DD !important;
}
.btn-search{
	background:#31A3DD !important;
}
.nav-pills > li  > a{
	border: 3px solid #31A3DD !important;
	background-size: 100% 200%;
    background-image: linear-gradient(to bottom, #fff 50%, #31A3DD 50%) !important;
}
.nav-pills > li.active > a, .nav-pills > li.active > a:hover, .nav-pills > li.active > a:focus {
	background-image: linear-gradient(to bottom, #31A3DD 50%, #31A3DD 50%) !important;
	background-color:#31A3DD;
}
.nav-stacked > li  > a
{
	border: 3px solid #31A3DD !important;
	background-size: 100% 200%;
    background-image: linear-gradient(to bottom, #fff 50%, #31A3DD 50%) !important;
 }
 .nav-stacked > li.active > a, .nav-stacked > li.active > a:hover, .nav-stacked > li.active > a:focus {
	background-image: linear-gradient(to bottom, #31A3DD 50%, #31A3DD 50%) !important;
	background-color:#31A3DD;
}

.navbar-toggle {
background-color: #31A3DD !important;
border: 1px solid #31A3DD !important;
}

.navbar-default .navbar-toggle:hover, .navbar-default .navbar-toggle:focus {
background-color: #31A3DD !important;
}
.enigma_blockquote_section blockquote {
border-left: 5px solid #31A3DD ;
}
#wp-calendar caption {
background-color: #31a3dd;
color: #ffffff;
padding: 10px;
}
#wp-calendar thead tr th {
text-align: center;
}
table th {
border: 1px solid #dddddd;
padding: 8px;
line-height: 20px;
text-align: center;
vertical-align: top;
}
table td {
border: 1px solid #dddddd;
padding: 8px;
line-height: 20px;
text-align: center;
vertical-align: top;
}
table td {
border: 1px solid #dddddd;
padding: 8px;
line-height: 20px;
text-align: center;
vertical-align: top;
}
#wp-calendar tbody tr td {
text-align: center;
}
.enigma_footer_widget_column ul li a ,.enigma_footer_widget_column ul#recentcomments li {color: #f2f2f2;}
.enigma_footer_widget_column ul li a:hover{color: #31a3dd;}
.enigma_callout_area a:hover{background-color:#393c40;}
ul .social li .facebook a:hover ,ul .social li .twitter a:hover,ul .social li .linkedin a:hover ,ul .social li .youtube a:hover {background-color:#34495e;}
.enigma_blog_pagi a:hover, .enigma_blog_pagi a.active {
background-color: #31A3DD;
color: white;
}


text:
#pragma once

#include "il2cpp-config.h"

#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif

#include <stdint.h>

#include "mscorlib_System_Object2689449295.h"
#include "mscorlib_System_Collections_Generic_Dictionary_2_E2246772328.h"

#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif

// System.Collections.Generic.Dictionary`2/ShimEnumerator<UnityEngine.Networking.NetworkInstanceId,System.Object>
struct  ShimEnumerator_t1031872447  : public Il2CppObject
{
public:
	// System.Collections.Generic.Dictionary`2/Enumerator<TKey,TValue> System.Collections.Generic.Dictionary`2/ShimEnumerator::host_enumerator
	Enumerator_t2246772328  ___host_enumerator_0;

public:
	inline static int32_t get_offset_of_host_enumerator_0() { return static_cast<int32_t>(offsetof(ShimEnumerator_t1031872447, ___host_enumerator_0)); }
	inline Enumerator_t2246772328  get_host_enumerator_0() const { return ___host_enumerator_0; }
	inline Enumerator_t2246772328 * get_address_of_host_enumerator_0() { return &___host_enumerator_0; }
	inline void set_host_enumerator_0(Enumerator_t2246772328  value)
	{
		___host_enumerator_0 = value;
	}
};

#ifdef __clang__
#pragma clang diagnostic pop
#endif


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

	<modelVersion>4.0.0</modelVersion>

	<parent>
		<groupId>com.zenika</groupId>
		<artifactId>it-parent</artifactId>
		<version>1.0-SNAPSHOT</version>
	</parent>

	<artifactId>run-war</artifactId>
	<packaging>war</packaging>

	<name>Test module for embedded war tests</name>

	<build>
		<resources>
			<resource>
				<directory>src/config</directory>
				<targetPath>${project.build.directory}/config</targetPath>
				<filtering>true</filtering>
			</resource>
		</resources>
		<plugins>
			<plugin>
				<groupId>org.apache.tomcat.maven</groupId>
				<artifactId>tomcat6-maven-plugin</artifactId>
				<version>2.0</version>
				<configuration>
					<path>/</path>
					<fork>true</fork>
					<port>${server.port}</port>
					<warDirectory>${project.build.directory}/${project.build.finalName}</warDirectory>
				</configuration>
				<executions>
					<execution>
						<id>start-tomcat</id>
						<phase>pre-integration-test</phase>
						<goals>
							<goal>run-war-only</goal>
						</goals>
					</execution>
					<execution>
						<id>stop-tomcat</id>
						<phase>post-integration-test</phase>
						<goals>
							<goal>shutdown</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>com.zenika</groupId>
				<artifactId>varnishtest-maven-plugin</artifactId>
				<executions>
					<execution>
						<goals>
							<goal>run</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-verifier-plugin</artifactId>
			</plugin>
		</plugins>
	</build>
</project>


text:
using System;

namespace Microsoft.Management.UI.Internal
{
    /// <summary>
    /// The TextDoesNotEqualFilterRule class evaluates a string item to
    /// check if it is not equal to the rule's value.
    /// </summary>
    [Serializable]
    [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA903:InternalNamespaceShouldNotContainPublicTypes")]
    public class TextDoesNotEqualFilterRule : TextEqualsFilterRule
    {
        /// <summary>
        /// Initializes a new instance of the TextDoesNotEqualFilterRule class.
        /// </summary>
        public TextDoesNotEqualFilterRule()
        {
            this.DisplayName = UICultureResources.FilterRule_DoesNotEqual;
            this.DefaultNullValueEvaluation = true;
        }

        /// <summary>
        /// Determines if data is not equal to Value.
        /// </summary>
        /// <param name="data">
        /// The value to compare against.
        /// </param>
        /// <returns>
        /// Returns true is data does not equal Value, false otherwise.
        /// </returns>
        protected override bool Evaluate(string data)
        {
            return !base.Evaluate(data);
        }
    }
}


text:
// This is a generated file. Not intended for manual editing.
package ws.epigraph.schema.parser.psi.impl;

import java.util.List;
import org.jetbrains.annotations.*;
import com.intellij.lang.ASTNode;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiElementVisitor;
import com.intellij.psi.util.PsiTreeUtil;
import static ws.epigraph.schema.lexer.SchemaElementTypes.*;
import com.intellij.extapi.psi.StubBasedPsiElementBase;
import ws.epigraph.schema.parser.psi.stubs.SchemaSupplementDefStub;
import ws.epigraph.schema.parser.psi.*;
import com.intellij.navigation.ItemPresentation;
import com.intellij.psi.stubs.IStubElementType;
import com.intellij.psi.tree.IElementType;

public class SchemaSupplementDefImpl extends StubBasedPsiElementBase<SchemaSupplementDefStub> implements SchemaSupplementDef {

  public SchemaSupplementDefImpl(SchemaSupplementDefStub stub, IStubElementType type) {
    super(stub, type);
  }

  public SchemaSupplementDefImpl(ASTNode node) {
    super(node);
  }

  public SchemaSupplementDefImpl(SchemaSupplementDefStub stub, IElementType type, ASTNode node) {
    super(stub, type, node);
  }

  public void accept(@NotNull SchemaVisitor visitor) {
    visitor.visitSupplementDef(this);
  }

  public void accept(@NotNull PsiElementVisitor visitor) {
    if (visitor instanceof SchemaVisitor) accept((SchemaVisitor)visitor);
    else super.accept(visitor);
  }

  @Override
  @NotNull
  public List<SchemaQnTypeRef> getQnTypeRefList() {
    return PsiTreeUtil.getChildrenOfTypeAsList(this, SchemaQnTypeRef.class);
  }

  @Override
  @NotNull
  public PsiElement getSupplement() {
    return notNullChild(findChildByType(S_SUPPLEMENT));
  }

  @Override
  @Nullable
  public PsiElement getWith() {
    return findChildByType(S_WITH);
  }

  @Nullable
  public SchemaQnTypeRef sourceRef() {
    return SchemaPsiImplUtil.sourceRef(this);
  }

  @NotNull
  public List<SchemaQnTypeRef> supplementedRefs() {
    return SchemaPsiImplUtil.supplementedRefs(this);
  }

  @Nullable
  public SchemaTypeDef source() {
    return SchemaPsiImplUtil.source(this);
  }

  @NotNull
  public List<SchemaTypeDef> supplemented() {
    return SchemaPsiImplUtil.supplemented(this);
  }

  @NotNull
  public ItemPresentation getPresentation() {
    return SchemaPsiImplUtil.getPresentation(this);
  }

  @NotNull
  public String toString() {
    return SchemaPsiImplUtil.toString(this);
  }

}


text:
.. _tutorialtwocellsgapjunction:

Two cells connected via a gap junction
======================================

In this example, we will set up two cells connected via a gap junction.
The cells have different leak potentials.
We will investigate how the equilibrium potentials of the two cells change because of the gap junction connection.

.. figure:: network_two_cells_gap_junctions_circuit.svg
    :width: 400
    :align: center

    The equivalent circuit used to calculate the equilibrium potentials.

.. Note::

   **Concepts covered in this example:**

   1. Creating a simulation recipe for two cells.
   2. Placing probes.
   3. Running the simulation and extracting the results.
   4. Adding a gap junction connection.

Walk-through
************

We set up a recipe for the simulation of two cells with some parameters.

.. literalinclude:: ../../python/example/network_two_cells_gap_junctions.py
   :language: python
   :lines: 12-64

Implementing the ``cell_description`` member function constructs the morphology and sets the properties of the cells as well as the gap junction mechanisms and the discretization policy.

.. literalinclude:: ../../python/example/network_two_cells_gap_junctions.py
   :language: python
   :lines: 66-101

The bidirection gap junction is created in the function ``gap_junctions_on``.

.. literalinclude:: ../../python/example/network_two_cells_gap_junctions.py
   :language: python
   :lines: 103-117

We parse the command line arguments, instantiate the recipe, run the simulation, extract results and plot:

.. literalinclude:: ../../python/example/network_two_cells_gap_junctions.py
   :language: python
   :lines: 114-

The output plot below shows how the potential of the two cells approaches their equilibrium potentials.
The expected values are denoted by dashed lines.

.. figure:: network_two_cells_gap_junctions_result.svg
    :width: 800
    :align: center

The full code
*************

You can find the full code of the example at ``python/examples/network_two_cells_gap_junctions.py``

Executing the script will run the simulation with default parameters.


text:
import React, { Component } from "react";
import ProjectPage from "../../../components/ProjectPage/index";
import ProjectSection from "../../../components/ProjectSection/index";
import SyntaxHighlighter from "react-syntax-highlighter";
import { obsidian } from "react-syntax-highlighter/dist/styles";
import Helmet from "react-helmet";
import PortfolioDelegate from "../../../utils/PortfolioDelegate";

class FactsOfToday extends Component {
  constructor(props) {
    super(props);

    const delegate = new PortfolioDelegate();

    let index = delegate.getProjectIndex("Facts of Today");

    this.state = {
      project: delegate.projects[index]
    };
  }
  render() {
    let style = {
      title: {
        color: this.state.project.color,
        fontWeight: "bold"
      }
    };
    return (
      <ProjectPage
        name={this.state.project.name}
        title={this.state.project.name}
        color={this.state.project.color}
        technologies={this.state.project.technologies}
        description={this.state.project.description}
        github={this.state.project.github_url}
        liveUrl={this.state.project.live_url}
        bgColor={this.state.project.background_color}
        images={this.state.project.image_urls.screenshots}
        bigPicture={this.state.project.big_picture}
      >
        <Helmet
          title={this.state.project.name}
          meta={[
            {
              name: "description",
              content: this.state.project.description
            },
            {
              name: "keywords",
              content: `${this.state.project.name.toLowerCase()}, front end development, ui/ux, web development, full stack development, malik browne, malik`
            },
            {
              property: "og:title",
              content: `${this.state.project.name} | Malik Browne`
            },
            {
              property: "og:description",
              content: this.state.project.description
            },
            {
              property: "og:url",
              content: `https://malikbrowne.com/${this.state.project.path.substr(
                1
              )}`
            },
            {
              property: "og:image",
              content: this.state.project.image_urls.screenshots[0]
            }
          ]}
        />

        <ProjectSection title="Background">

            I'm a big fan of random facts. A couple of classmates wanted
            to make an app that we could eventually publish to the app store.

            We looked for ideas that we couldn't find a solid application for,
            as we wanted to fill a need that didn't quite exist yet.

            After gathering a list of a few ideas and a long brainstorming
            session, we decided on{" "}
            Facts of Today, an app where you
            could see the different events that happened every day in history.

        </ProjectSection>
        <ProjectSection title="Requirements">

            We wanted a chance to practice{" "}
            agile methodologies, and
            produce an app the same way a professional mobile app developer
            would approach it. To reproduce this, we would need to do the
            following things:

Create a wireframe for our application

              Lay out user stories for a basic MVP (minimum viable product)

Separate our work for each person by issues on Github

              Define a game plan for core app flows, potential stakeholders, and
              a basic pitch

Define our data schemas used for the app

              Work on each part of the project in sprints of about 3 weeks.

            The app was going to be primarily built in Swift, as it was a
            language we had recently learned.

        </ProjectSection>
        <ProjectSection title="Implementation">

Defining our user stories

            The first thing our team did was define our required user stories
            for Facts of Today. For the minimum
            viable product, our basic user stories were:

              As a user, I would like the app to open and search for today's
              date by default.

              As a user, I would like to see preview of the three categories on
              the main screen: events, births, deaths.

              As a user, I would like to tap the preview to go to a table view
              that lists more items in that category for that day.

              As a user, I would like to tap the links available in each cell to
              open a web view of the related Wikipedia page.

              As a user, I would like to swipe left and right on the main page
              to switch to adjacent dates.

              As a user, I would like to open a calendar view to pick from
              further dates more quickly.

              As a user, I would like to tap the 'today' button to get back to
              the current day.

            These are the points that we needed to make sure we got done at the
            end of each sprint. We also included some optional items to do such
            as:

The ability to change the color scheme of the app

Setting and receiving daily event notifications

If looking at a location, pull up a map of the area

Sharing information and links via Twitter

Creating a wireframe

            With all of these awesome ideas, we created a wireframe to represent
            how all of this data would interact on a basic level. The wireframe
            includes each part of the app:

Screen for Events, Births, and Deaths

Detailed screen for each category

A calendar to choose a specific day

Links to specific Wikipedia articles

Settings screen

            Here's the final result of the wireframe, with arrows to show how a
            user could navigate:

Defining our data scheme (resources)

            We needed to figure out how we could get this information. Our first
            thought was to use an encyclopedia website API, as that would
            contain the most accurate information we could find. Unfortunately
            we couldn't find anything like that.

            However, we had a backup:{" "}

              The Today In History API
            . Using this API as well as using parts of Wikipedia API to get
            thumbnails, we established a History Model that for a single event
            would contain:

The event's information

Year of the Event

A list of related links to the event

A thumbnail image to represent the event.

            This model had two functions: getEventsByDate, and a cache function
            to persist data across app refreshes. The important function was
            getEventsbyDate:

          <SyntaxHighlighter language="swift" showLineNumbers style={obsidian}>
            {`// HistoryClient.swift

class func getEventsByDate(month: String, day: String, completion: (events: [Event]?, births: [Event]?, deaths: [Event]?) -> ()) {
let url = NSURL(string: "http://history.muffinlabs.com/date/\\(month)/\\(day)")
let request = NSURLRequest(URL: url!)
let session = NSURLSession(
  configuration: NSURLSessionConfiguration.defaultSessionConfiguration(),
  delegate: nil,
  delegateQueue:  NSOperationQueue.mainQueue()
)

let task : NSURLSessionDataTask = session.dataTaskWithRequest(request,
  completionHandler: { (dataOrNil, response, error) in
    if error != nil {
      print("retrieving information for date:\\n\\(error?.localizedDescription)")
      completion(events: nil, births: nil, deaths: nil)
      return
    }

    if let data = dataOrNil {
      if let responseDictionary = try! NSJSONSerialization.JSONObjectWithData(data, options: []) as? NSDictionary {
        if let unsortedEvents = responseDictionary["data"]!["Events"] as? NSArray {
            let descriptor = NSSortDescriptor(key: "year", ascending: false, comparator: { (obj1, obj2) -> NSComparisonResult in
                if (obj1.integerValue > obj2.integerValue) {
                    return NSComparisonResult.OrderedDescending
                }
                if (obj1.integerValue < obj2.integerValue) {
                    return NSComparisonResult.OrderedAscending
                }

                return NSComparisonResult.OrderedSame

            })
            let events: NSArray = unsortedEvents.sortedArrayUsingDescriptors([descriptor])

            for i in 0 ..< events.count {
                var dictResult = events.objectAtIndex(i) as! NSDictionary
            }
        }
        let events2 = Event.getEventObjectsWithDictionary(responseDictionary, type: Type.EVENT)
        let births = Event.getEventObjectsWithDictionary(responseDictionary, type: Type.BIRTH)
        let deaths = Event.getEventObjectsWithDictionary(responseDictionary, type: Type.DEATH)
        completion(events: events2, births: births, deaths: deaths)
        return
      }
    }

    completion(events: nil, births: nil, deaths: nil)
});
task.resume()
}
`}
          </SyntaxHighlighter>

Sprint #1: Swipeable View to Switch Days

            The first component I worked on was a swipeable view to switch
            between different days on the main screen. This SwipeView would be
            the main part of the app, as people would most likely navigate
            through days this way.

            This component would also have to pass in the data for the calendar
            and load different data based on the day the user is on.

            After adding in lifecycle methods, adding in the data from our
            HistoryClient, and importing a base swipe view component I was able
            to get the Swipe View functioning. The code is a bit long, so if
            you're interested in seeing the code for the component,{" "}

              you can view it on Github.

At the end of the first sprint, we made awesome progress:

            Sprint #2: Adding Local App Notifications, and a Web View to
            Wikipedia

            This sprint was the most challenging part of the project. We quickly
            found out that you can't implement automatic push notifications
            without a pre-configured web server. To work around this, we
            implemented the solution via iOS's Local Notification System.

            In order to get the notifications working, we needed to make sure
            that our AppDelegate (our class to handle all application states)
            was notified whenever someone changed the notification settings.

            This required that we have two functions: scheduleNotification, and
            getCachedMessage.

            To schedule the notification, we use the{" "}

              NSUserDefaults
            {" "}
            class to check for a specific notification key that we set. Once
            that is done, all we need to do is provide the information that the{" "}

              UILocalNotification
            {" "}
            needs to create the notification:

          <SyntaxHighlighter language="swift" showLineNumbers style={obsidian}>
            {`func scheduleNotification() {
let defaults = NSUserDefaults.standardUserDefaults()

//User has turned on notifications
if defaults.objectForKey(SettingsViewController.notificationKey) != nil &&
  defaults.boolForKey(SettingsViewController.notificationKey) {

  let formatter = NSDateFormatter()
  formatter.locale = NSLocale(localeIdentifier: "en_US_POSIX")
  formatter.timeZone = NSTimeZone.defaultTimeZone()
  formatter.dateFormat = "H:m"

  let calendar = NSCalendar(calendarIdentifier: NSCalendarIdentifierGregorian)
  let currentTime = NSDate()

  //Compare the current time and notification time to see if the notification should be scheduled for the next day
  let notificationTimeString = defaults.stringForKey(SettingsViewController.notificationTime)!
  let notificationTime = formatter.dateFromString(notificationTimeString)!

  let currentComponents = calendar?.components([.Hour, .Minute], fromDate: currentTime)
  let notificationComponents = calendar?.components([.Hour, .Minute], fromDate: notificationTime)

  let truncatedCurrent = calendar?.dateFromComponents(currentComponents!)
  let truncatedNotification = calendar?.dateFromComponents(notificationComponents!)

  let result = truncatedCurrent?.compare(truncatedNotification!)

  var addDay: Bool
  //Current time is earlier in the day than the notification
  if result == NSComparisonResult.OrderedAscending {
    addDay = false

    //Current time is equal to or later than the notification
  } else {
    addDay = true
  }

  let hourMinute = notificationTimeString.characters.split{$0 == ":"}.map(String.init)

  let gregorian = NSCalendar(calendarIdentifier: NSCalendarIdentifierGregorian)
  let components = gregorian!.components([.Year, .Month, .Day, .Hour, .Minute], fromDate: currentTime)
  components.setValue(Int(hourMinute[0])!, forComponent: NSCalendarUnit.Hour)
  components.setValue(Int(hourMinute[1])!, forComponent: NSCalendarUnit.Minute)
  var timeToFire = gregorian!.dateFromComponents(components)

  if addDay {
    timeToFire = calendar?.dateByAddingUnit(.Day, value: 1, toDate: timeToFire!, options: NSCalendarOptions(rawValue: 0))
  }

  let notification = UILocalNotification()
  notification.alertBody = getCachedMessage()
  notification.fireDate = timeToFire
  notification.soundName = UILocalNotificationDefaultSoundName
  notification.timeZone = NSTimeZone.defaultTimeZone()
//notification.repeatInterval = NSCalendarUnit.Day
  UIApplication.sharedApplication().scheduleLocalNotification(notification)
}

}
`}
          </SyntaxHighlighter>

            Now, all we have to do is declare the actual notification that would
            be sent to the user. We thought it'd be cute to send personalized
            little messages like:

              Want to learn a cool new fact? Check out what interesting events
              happened today!

              Come and explore in{" "}
              Facts of Today to find out what
              interesting events happened today!

              It's about that time! Come and check out what different events
              happened today on Facts of Today!

              Ever wondered what happened today in history? Come find out on{" "}
              Facts of Today!

              Come and expand your knowledge of what happened today in history
              on Facts of Today!

            Loading the webview is as simple as passing the Wikipedia URL from
            our HistoryClient to iOS's web view. One of my teammates decided to
            work on adding the view for the calendar as well. Here's the result
            after our second sprint:

Sprint #3: Adding the Color Scheme Delegate, and Map View

            At this point, we had completed all of our basic requirements for{" "}
            Facts of Today and had some extra
            time to work on some of the extra user stories.

            The color scheme changer was my idea: as I love apps where I can
            customize it to the tee for myself. For this, all we had to do was
            declare which components would be part of the color scheme. We
            decided on:

The text color

The app bar color

The tint color of the calendar.

            We defined 6 basic colors that{" "}
            Facts of Today could use and passed
            in the associated colors for that color scheme depending on which
            color the user chose.

            It was that simple. In our code, we define our collection
            view for the different color squares, and associate each square with
            a color:

          <SyntaxHighlighter language="swift" showLineNumbers style={obsidian}>
            {`//  ColorSchemeViewController.swift

import UIKit

let ColorSchemeKey = "ColorSchemeKey"

class ColorSchemeViewController: UIViewController, UICollectionViewDelegate, UICollectionViewDataSource {
    @IBOutlet weak var collectionView: UICollectionView!
    var colors: [Int]!
    var delegate: ColorSchemeDelegate?

    override func viewDidLoad() {
        super.viewDidLoad()

        collectionView.delegate = self
        collectionView.dataSource = self

        colors = [Int]()
        colors.append(0x000000)
        colors.append(0x85AE26)
        colors.append(0xFB5144)
        colors.append(0x338acc)
        colors.append(0x936798)
        colors.append(0xe89726)
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

    func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) {
        let colorScheme = ColorScheme.getInstance()
        let nb = self.navigationController?.navigationBar

        colorScheme.setColorScheme(UIColor(netHex: colors[indexPath.row]), tintColor: UIColor.whiteColor(), titleColor: UIColor.whiteColor())
        colorScheme.alreadySet = false
        nb?.barTintColor = colorScheme.barTintColor
        nb?.titleTextAttributes = [NSForegroundColorAttributeName : colorScheme.titleColor]
        nb?.tintColor = colorScheme.tintColor
        NSUserDefaults.standardUserDefaults().setInteger(colors[indexPath.row], forKey: ColorSchemeKey)
    }

    func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
        return colors.count
    }

    func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
        let cell = collectionView.dequeueReusableCellWithReuseIdentifier("ColorCell", forIndexPath: indexPath)
        cell.backgroundColor = UIColor(netHex: colors[indexPath.row])

        return cell
    }

    func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize {
        let numberOfCellInRow : Int = 2
        let collectionCellWidth : CGFloat = (self.view.frame.size.width/CGFloat(numberOfCellInRow))
        return CGSize(width: collectionCellWidth , height: collectionCellWidth)
    }
}

extension UIColor {
    convenience init(red: Int, green: Int, blue: Int) {
        assert(red >= 0 && red <= 255, "Invalid red component")
        assert(green >= 0 && green <= 255, "Invalid green component")
        assert(blue >= 0 && blue <= 255, "Invalid blue component")

        self.init(red: CGFloat(red) / 255.0, green: CGFloat(green) / 255.0, blue: CGFloat(blue) / 255.0, alpha: 1.0)
    }

    convenience init(netHex:Int) {
        self.init(red:(netHex >> 16) & 0xff, green:(netHex >> 8) & 0xff, blue:netHex & 0xff)
    }
}
`}
          </SyntaxHighlighter>

For the MapView, there were only a few simple things to do:

              Import{" "}

                MapKit

              Update our WebView if a Wikipedia URL had a location provided

Place a pin at the coordinates of the location

            We also had to make sure the navigation bar knew if there was a
            location provided in the event, and update the UI accordingly. This
            was included in the Wikipedia API we had found.

            After a few tests, we got the MapView working just in time for the
            end of Sprint #3! Here is the result, notice the color!

            After a couple of tweaks, and an idea to represent links as images
            so that the details section doesn't look like a wall of text, we
            finally reached our last iteration. Here's the final result:

            We successfully deployed our application to the App Store as well
            and got a bunch of downloads.

            In order to do that we had to submit some screenshots, so I went
            into Photoshop and made some banners for our application on the App
            Store. Here are some of those banners:

        </ProjectSection>
        <ProjectSection title="Project Challenges">

            Facts of Today definitely
            solidified my interest in mobile development. The process of
            developing mobile apps is completely different from web
            applications, so I learned a lot. Deploying a mobile application in
            specific is a long process, and there are many places where your app
            can get rejected if you don't format your submission correctly.

Some things that I struggled with initially were:

Creating delegates to handle tasks for each component

Working with UIPopover to get the calendar to load smoothly

Implementing controller lifecycle methods

Proper usage of NSURLSessionDataTask

Component subscription to other components

Building and deploying an app to the App Store

        </ProjectSection>
      </ProjectPage>
    );
  }
}

export default FactsOfToday;


text:
<?php

namespace Dscorp\WarriorsBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * accionmenu
 */
class accionmenu
{

    /**
     * @var integer
     */
    private $id;

    /**
     * @var string
     */
    private $descripcionAccionmenu;

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set descripcionAccionmenu
     *
     * @param string $descripcionAccionmenu
     * @return accionmenu
     */
    public function setDescripcionAccionmenu($descripcionAccionmenu)
    {
        $this->descripcionAccionmenu = $descripcionAccionmenu;

        return $this;
    }

    /**
     * Get descripcionAccionmenu
     *
     * @return string
     */
    public function getDescripcionAccionmenu()
    {
        return $this->descripcionAccionmenu;
    }
    /**
     * @var \Dscorp\WarriorsBundle\Entity\menu
     */
    private $menu;

    /**
     * Set menu
     *
     * @param \Dscorp\WarriorsBundle\Entity\menu $menu
     * @return accionmenu
     */
    public function setMenu(\Dscorp\WarriorsBundle\Entity\menu $menu = null)
    {
        $this->menu = $menu;

        return $this;
    }

    /**
     * Get menu
     *
     * @return \Dscorp\WarriorsBundle\Entity\menu
     */
    public function getMenu()
    {
        return $this->menu;
    }
}


text: mvn clean install -Pmysql,instrument -DargLine="-Dactivejdbc.log"


text:
CSS Media Query
===============

[![Build Status](https://travis-ci.org/ericf/css-mediaquery.png?branch=master)](https://travis-ci.org/ericf/css-mediaquery)
[![Dependency Status](https://gemnasium.com/ericf/css-mediaquery.png)](https://gemnasium.com/ericf/css-mediaquery)
[![npm Version](https://badge.fury.io/js/css-mediaquery.png)](https://npmjs.org/package/css-mediaquery)

Parses and determines if a given CSS Media Query matches a set of values via
JavaScript.

Installation
------------

Install via npm:

```shell
$ npm install css-mediaquery
```

Usage
-----

This package has two exports: `parse()`, and `match()` which can parse CSS Media
Queries and determine if a media query matches a given set of values.

### Matching

The `match()` method lets you compare a media query expression with a JavaScript
object and determine if a media query matches a given set of values.

```javascript
var mediaQuery = require('css-mediaquery');

var isMatch = mediaQuery.match('screen and (min-width: 40em)', {
    type : 'screen',
    width: '1024px'
});

console.log(isMatch); // => true
```

The values specified to check a media query string against should be thought of
as if they are the current state of a device/browser. A `type` value _must_ be
specified, and it can _not_ be `"all"`.

### Parsing

Existing CSS Parsers don't do a great job at parsing the details of media
queries. That's where `css-mediaquery` shines. You can parse a media query
expression and get an AST back by using the `parse()` method.

```javascript
var mediaQuery = require('css-mediaquery'),
    ast        = mediaQuery.parse('screen and (min-width: 48em)');
```

The `ast` variable will have the following payload:

```javascript
[
    {
        inverse: false,
        type   : 'screen',

        expressions: [
            {
                modifier: 'min',
                feature : 'width',
                value   : '48em'
            }
        ]
    }
]
```

This package was written with care to following the W3C Recommendations for
[CSS3 Media Queries][w3c-mq] and [CSS3 Values and Units][w3c-vu]. It supports
all of the [Media Features][w3c-mq-features] and will properly convert values to
a common unit before comparing them.

[w3c-mq]: http://www.w3.org/TR/css3-mediaqueries/
[w3c-mq-features]: http://www.w3.org/TR/css3-mediaqueries/#media1
[w3c-vu]: http://www.w3.org/TR/css3-values/

License
-------

This software is free to use under the Yahoo! Inc. BSD license.
See the [LICENSE file][] for license text and copyright information.

[LICENSE file]: https://github.com/ericf/css-mediaquery/blob/master/LICENSE