text:
/*!
 * Copyright (c) 2015 by Contributors
 * \file engine.h
 * \brief Engine that schedules all the operations according to dependency.
 */
#ifndef MXNET_ENGINE_H_
#define MXNET_ENGINE_H_

#if DMLC_USE_CXX11
#include <algorithm>
#include <memory>
#include <functional>
#endif
#include <vector>
#include "./base.h"

namespace mxnet {

// forward declare engine
class Engine;

/*! \brief namespace of engine internal types. */
namespace engine {
/*! \brief base class of engine variables.*/
struct Var {
  virtual size_t version() {
    return version_;
  }
  virtual ~Var() = default;
  /*!
   * \brief cast variable to derived type T
   * \tparam T the type we want to cast into.
   * \return A casted variable.
   */
  template <typename T>
  inline T* Cast();
  /*!
   * \brief version number of the var. Every time the object it is associated with
   * is modified, the version number is incremented by 1.
   */
  size_t version_{0};
};  // struct Var

/*! \brief Internal representation of operator.  */
struct Opr;
/*! \brief Variable pointer type, usually hold by user used to specify dependencies. */
typedef Var* VarHandle;
/*! \brief Operator pointer type, usually hold by user.*/
typedef Opr* OprHandle;
/*!
 * \brief OnComplete Callback to the engine,
 *  called by AsyncFn when action completes
 */
class CallbackOnComplete {
 public:
  // use implicit copy and assign
  /*! \brief involve the callback */
  inline void operator()(const dmlc::Error* error = nullptr) const {
    (*callback_)(engine_, param_, error);
  }

 private:
  /*! \brief engine can see content of callback */
  friend class ::mxnet::Engine;
  /*! \brief the real callback */
  void (*callback_)(Engine *, void *, const dmlc::Error *);
  /*! \brief the engine class passed to callback */
  Engine* engine_;
  /*! \brief the parameter set on callback */
  void* param_;
};
}  // namespace engine

#if DMLC_USE_CXX11
/*! \brief Function property, used to hint what action is pushed to engine. */
enum class FnProperty {
  /*! \brief Normal operation */
  kNormal,
  /*! \brief Copy operation from GPU to other devices */
  kCopyFromGPU,
  /*! \brief Copy operation from CPU to other devices */
  kCopyToGPU,
  /*! \brief Prioritized sync operation on CPU */
  kCPUPrioritized,
  /*! \brief Asynchronous function call */
  kAsync,
  /*! \brief Delete variable call */
  kDeleteVar,
  /*! \brief Prioritized sync operation on GPU */
  kGPUPrioritized,
  /*! \brief Operation not to be skipped even with associated exception */
  kNoSkip
};  // enum class FnProperty

/*!
 * \brief Dependency engine that schedules operations.
*/
class MXNET_API Engine {
 public:
  /*! \brief callback on complete*/
  typedef engine::CallbackOnComplete CallbackOnComplete;
  /*! \brief Synchronous operation to pass to engine. */
  typedef std::function<void(RunContext)> SyncFn;
  /*! \brief Asynchronous operation to pass to engine. */
  typedef std::function<void(RunContext, CallbackOnComplete)> AsyncFn;
  /*! \brief Variable pointer */
  typedef engine::VarHandle VarHandle;
  /*! \brief Operator pointer */
  typedef engine::OprHandle OprHandle;
  /*!
   * \brief Notify the engine about a shutdown,
   *  This can help engine to print less messages into display.
   *
   *  User do not have to call this function.
   * \return 0 when success, -1 when failure happens.
   */
  virtual void NotifyShutdown() = 0;
  /*!
   *\brief Stop all workers in the engine
   */
  virtual void Stop() {
    LOG(FATAL) << "Engine cannot be stopped";
  }
  /*!
   * \brief Restart all workers in the engine
   */
  virtual void Start() {
    LOG(FATAL) << "Engine cannot be restarted";
  }
  /*!
   * \brief Allocate a new variable, the variable can then
   *        be used to schedule the operation concurrently via dependency
   *        patterns.
   * \return The new variable allocated.
   */
  virtual VarHandle NewVariable() = 0;
  /*!
   * \brief Create a new operator. The returned operator could be saved
   *        externally so that it could be resued for scheduling.
   * \param fn The execution function.
   * \param const_vars The variables that current operation will use but not
   *                   mutate.
   * \param mutable_vars The variables that current operation will mutate.
   * \param prop Property of the function.
   * \param opr_name The operator name.
   * \param wait Whether this is a WaitForVar operation
   * \return The new operator allocated.
   */
  virtual OprHandle NewOperator(AsyncFn fn,
                                std::vector<VarHandle> const& const_vars,
                                std::vector<VarHandle> const& mutable_vars,
                                FnProperty prop = FnProperty::kNormal,
                                const char* opr_name = nullptr,
                                bool wait = false) = 0;
  /*!
   * \brief Delete the given operator.
   * \param op The operator to delete.
   *
   * The delete will not happen immediately, but will wait until all the
   * operations using this operator are completed.
   */
  virtual void DeleteOperator(OprHandle op) = 0;
  /*!
   * \brief Push an operator to the engine.
   * \param op The operator to push.
   * \param exec_ctx Execution context.
   * \param priority Priority of the action, as hint to the engine.
   * \param profiling The variable indicate whether to profile this operator.
   */
  virtual void Push(OprHandle op, Context exec_ctx, int priority = 0, bool profiling = false) = 0;
  /*!
   * \brief Push an asynchronous operation to the engine.
   * \param exec_fun Execution function, this function takes a parameter
   *                 on_complete that must be called when the execution
   *                 completes.
   * \param exec_ctx Execution context.
   * \param const_vars The variables that current operation will use but not
   *                   mutate.
   * \param mutable_vars The variables that current operation will mutate.
   * \param prop Property of the function.
   * \param priority Priority of the action, as hint to the engine.
   * \param opr_name The operator name.
   * \param wait Whether this is a WaitForVar operation
   */
  virtual void PushAsync(AsyncFn exec_fun, Context exec_ctx,
                         std::vector<VarHandle> const& const_vars,
                         std::vector<VarHandle> const& mutable_vars,
                         FnProperty prop = FnProperty::kNormal,
                         int priority = 0,
                         const char* opr_name = nullptr,
                         bool wait = false) = 0;
  /*!
   * \brief Schedule the deletion of a variable.
   *
   * The delete will not happen immediately, but will wait until all the
   * operations depending on var are completed.
   *
   * \param delete_fn A function that will be called after the variable is
   *                   deleted.
   * \param exec_ctx Execution context.
   * \param var The variable to be deleted.
   */
  virtual void DeleteVariable(SyncFn delete_fn,
                              Context exec_ctx,
                              VarHandle var) = 0;
  /*!
   * \brief Wait for a variable.
   * \param var The variable we should wait for. This function returns when the
   *            variable is ready.
   */
  virtual void WaitForVar(VarHandle var) = 0;
  /*!
   * \brief Wait until all the activity of engine finishes.
   */
  virtual void WaitForAll() = 0;
  /*!\brief Throw if threre are associated exception with var */
  virtual void Throw(VarHandle var) = 0;
  /*!\brief virtual destructor */
  virtual ~Engine() noexcept(false) {}
  /*!
   * \return Engine singleton.
   */
  static Engine* Get();
  /*!
   * \brief Get shared pointer reference to engine singleton.
   *  Most user should not call this function.
   *  This function is called by another singleton X who requires
   *  engine to be destructed after X.
   *
   * \return A shared pointer to Engine singleton.
   */
  static std::shared_ptr<Engine> _GetSharedRef();
  /*!
   * \brief Push an synchronous operation to the engine.
   * \param exec_fn Execution function that executes the operation.
   * \param exec_ctx Execution context.
   * \param const_vars The variables that current operation will use but not
   *                   mutate.
   * \param mutable_vars The variables that current operation will mutate.
   * \param prop Property of the function.
   * \param priority Priority of the action, as hint to the engine.
   * \param opr_name The operator name.
   * \tparam SyncFn the synchronous function to be pushed.
   */
  virtual void PushSync(SyncFn exec_fn, Context exec_ctx,
                        std::vector<VarHandle> const& const_vars,
                        std::vector<VarHandle> const& mutable_vars,
                        FnProperty prop = FnProperty::kNormal,
                        int priority = 0,
                        const char* opr_name = nullptr) {
    this->PushAsync([exec_fn](RunContext ctx, CallbackOnComplete on_complete) {
        exec_fn(ctx);
        on_complete();
      }, exec_ctx, const_vars, mutable_vars, prop, priority, opr_name);
  }

  /*!
   * \brief factory function to create OnComplete callback.
   * \param callback th static callback function.
   * \param param the paramter passed to callback.
   */
  inline CallbackOnComplete CreateCallback(
      void (*callback)(Engine *, void *, const dmlc::Error *), void *param) {
    CallbackOnComplete ret;
    ret.callback_ = callback;
    ret.engine_ = this;
    ret.param_ = param;
    return ret;
  }
  // For each var vector, sort it and remove the duplicated vars.
  // Also remove vars from read_vars if it also appears in write_vars
  inline void DeduplicateVarHandle(std::vector<engine::VarHandle> *read_vars,
                                   std::vector<engine::VarHandle> *write_vars) {
    std::sort(write_vars->begin(), write_vars->end());
    write_vars->resize(std::unique(write_vars->begin(), write_vars->end()) -
                      write_vars->begin());
    std::sort(read_vars->begin(), read_vars->end());
    read_vars->resize(std::unique(read_vars->begin(), read_vars->end()) -
                      read_vars->begin());
    auto wit = write_vars->begin();
    auto rtop = read_vars->begin();
    for (auto rit = read_vars->begin(); rit != read_vars->end(); ++rit) {
      while (wit != write_vars->end() && *wit < *rit) ++wit;
      if (wit == write_vars->end() || *wit != *rit) {
        *rtop = *rit;
        ++rtop;
      }
    }
    read_vars->resize(rtop - read_vars->begin());
  }
  /*! \brief query current limit for bulk size */
  virtual int bulk_size() const {
    return 0;
  }
  /*! \brief set maximum limit for bulk size */
  virtual int set_bulk_size(int) {
    return 0;
  }
};  // class Engine
#endif  // DMLC_USE_CXX11
}  // namespace mxnet
#endif  // MXNET_ENGINE_H_


text:
NSString *const SCTranscriptThemeDidChangeNotification;

@interface SCThemeManager : NSObject

@property (strong, readonly) NSString *pathOfCurrentThemeDirectory;
@property (readonly) NSDictionary *themeDictionary;

+ (instancetype)sharedManager;
+ (BOOL)isValidThemeAtPath:(NSString *)path;
- (NSColor *)backgroundColorOfCurrentTheme;
- (NSColor *)barTopColorOfCurrentTheme;
- (NSColor *)barHighlightColorOfCurrentTheme;
- (NSColor *)barBottomColorOfCurrentTheme;
- (NSColor *)barTextColorOfCurrentTheme;
- (NSColor *)barBorderColorOfCurrentTheme;
- (NSURL *)baseTemplateURLOfCurrentTheme;
- (NSURL *)baseDirectoryURLOfCurrentTheme;
- (NSArray *)availableThemes;
- (void)changeThemePath:(NSString *)themePath;

@end

redpajama_set_name: RedPajamaGithub


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

<title>Using the GNU Compiler Collection (GCC): C++ Extensions</title>

<meta name="description" content="Using the GNU Compiler Collection (GCC): C++ Extensions">
<meta name="keywords" content="Using the GNU Compiler Collection (GCC): C++ Extensions">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="Option-Index.html#Option-Index" rel="index" title="Option Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="index.html#Top" rel="up" title="Top">
<link href="C_002b_002b-Volatiles.html#C_002b_002b-Volatiles" rel="next" title="C++ Volatiles">
<link href="Binary-constants.html#Binary-constants" rel="prev" title="Binary constants">

Next: Objective-C, Previous: C Extensions, Up: Top   [Contents][Index]

7 Extensions to the C++ Language

The GNU compiler provides these extensions to the C++ language (and you
can also use most of the C language extensions in your C++ programs).  If you
want to write code that checks whether these features are available, you can
test for the GNU compiler the same way as for C programs: check for a
predefined macro __GNUC__.  You can also use __GNUG__ to
test specifically for GNU C++ (see Predefined Macros in The GNU C Preprocessor).

• C++ Volatiles:	  	What constitutes an access to a volatile object.

• Restricted Pointers:	  	C99 restricted pointers and references.

• Vague Linkage:	  	Where G++ puts inlines, vtables and such.

• C++ Interface:	  	You can use a single C++ header file for both
                        declarations and definitions.

• Template Instantiation:	  	Methods for ensuring that exactly one copy of
                        each needed template instantiation is emitted.

• Bound member functions:	  	You can extract a function pointer to the
                        method denoted by a ‘<samp>->*</samp>’ or ‘<samp>.*</samp>’ expression.

• C++ Attributes:	  	Variable, function, and type attributes for C++ only.

• Function Multiversioning:	  	Declaring multiple function versions.

• Namespace Association:	  	Strong using-directives for namespace association.

• Type Traits:	  	Compiler support for type traits

• Java Exceptions:	  	Tweaking exception handling to work with Java.

• Deprecated Features:	  	Things will disappear from G++.

• Backwards Compatibility:	  	Compatibilities with earlier definitions of C++.

Next: Objective-C, Previous: C Extensions, Up: Top   [Contents][Index]


text:
package adaptive

import (
	"fmt"
	"math"
	"time"
)

// Sketches represents an set of Adaptive Count-Min Sketch algorithm (Ada-CMS),
// which is just CMS but with the update and query mechanisms adapted to use the pre-emphasis and de-emphasis mechanism.
type Sketches struct {
	sketches    []*ACMS
	maxDuration time.Duration
	timeUnit    time.Duration
	w           uint64
	d           uint64
	alpha       float64
}

// NewSketches returns an adaptive Sketch (representing multiple Adaptive Count-Min Sketches) with:
// maxDuration: specifies the max queriable range
// timeUnit: degines the unit of measurment, ns, ms, s, etc...
// w: width of CMS is 2^w
// d: depth of CMS
// alpha: ussed to pre-emphasis and de-emphasis the counters using alpha^timestamp
func NewSketches(maxDuration, timeUnit time.Duration, w, d uint64, alpha float64) *Sketches {
	convDuration := maxDuration / timeUnit
	numSketches := uint64(math.Log2(float64(convDuration))) + 1
	sketches := make([]*ACMS, numSketches)
	for i := range sketches {
		sketches[i] = NewACMS(w, d, alpha)
	}
	return &Sketches{
		sketches:    sketches,
		maxDuration: maxDuration,
		timeUnit:    timeUnit,
		w:           w,
		d:           d,
		alpha:       alpha,
	}
}

func (sks *Sketches) generateTimestamp(timestamp uint64, i int) uint64 {
	return 1 + timestamp/(uint64(math.Pow(2, float64(i))))
}

// Insert an item with a new count with at a given timestamp
func (sks *Sketches) Insert(item []byte, timestamp time.Time, count uint64) error {
	tmpTimestamp := uint64(timestamp.UnixNano() / int64(sks.timeUnit))
	for i := range sks.sketches {
		t := sks.generateTimestamp(tmpTimestamp, i)
		sks.sketches[i].Insert(item, t, count)
	}
	return nil
}

func (sks *Sketches) estimate(item []byte, start, end uint64) uint64 {
	estimate := uint64(0)
	for start <= end {
		pow2 := float64(start & (^start + 1))
		logpow2 := math.Log2(pow2)
		for i := logpow2; i >= 0; i-- {
			if float64(start)+math.Pow(2, i)-1 <= float64(end) {
				t := sks.generateTimestamp(start, int(i))
				estimate += sks.sketches[uint64(i)].Estimate(item, t)
				start += uint64(math.Pow(2, i))
				break
			}
		}
	}
	return estimate
}

// Estimate returns the count of an item within a given timerange [start, end], if timerange > maxDuration return error
func (sks *Sketches) Estimate(item []byte, start, end time.Time) (uint64, error) {
	tmpStart := uint64(start.UnixNano() / int64(sks.timeUnit))
	tmpEnd := uint64(end.UnixNano() / int64(sks.timeUnit))
	maxDuration := uint64(sks.maxDuration) / uint64(sks.timeUnit)

	if tmpEnd-tmpStart > maxDuration {
		return 0, fmt.Errorf("window to big [start, end] %d > %d", end.Sub(start)/sks.timeUnit, sks.maxDuration/sks.timeUnit)
	}

	return sks.estimate(item, tmpStart, tmpEnd), nil
}

// MultiEstimate returns the count of an item within a given timerange [start, end], where range can be > maxDuration
// Complexity however becomes O(n^3)
func (sks *Sketches) MultiEstimate(item []byte, start, end time.Time) uint64 {
	estimate := uint64(0)
	orgEnd := uint64(end.UnixNano() / int64(sks.timeUnit))
	tmpStart := uint64(start.UnixNano() / int64(sks.timeUnit))
	maxDuration := uint64(sks.maxDuration) / uint64(sks.timeUnit)

	for i := tmpStart; i <= orgEnd; i += maxDuration {
		tmpEnd := i + maxDuration - 1
		if tmpEnd > orgEnd {
			tmpEnd = orgEnd
		}
		res := sks.estimate(item, i, tmpEnd)
		estimate += res
	}
	return estimate
}


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

<title>MerkleTrees.TreeRangeIterator (apache-cassandra API)</title>
<meta name="date" content="2016-04-13">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

org.apache.cassandra.utils

Class MerkleTrees.TreeRangeIterator

java.lang.Object

com.google.common.collect.UnmodifiableIterator<T>

com.google.common.collect.AbstractIterator<MerkleTree.TreeRange>

org.apache.cassandra.utils.MerkleTrees.TreeRangeIterator

All Implemented Interfaces:

com.google.common.collect.PeekingIterator<MerkleTree.TreeRange>, java.lang.Iterable<MerkleTree.TreeRange>, java.util.Iterator<MerkleTree.TreeRange>

Enclosing class:

MerkleTrees

public class MerkleTrees.TreeRangeIterator
extends com.google.common.collect.AbstractIterator<MerkleTree.TreeRange>
implements java.lang.Iterable<MerkleTree.TreeRange>, com.google.common.collect.PeekingIterator<MerkleTree.TreeRange>

Method Summary

All Methods Instance Methods Concrete Methods

Modifier and Type
Method and Description

MerkleTree.TreeRange
computeNext()

java.util.Iterator<MerkleTree.TreeRange>
iterator()

Methods inherited from class com.google.common.collect.AbstractIterator

endOfData, hasNext, next, peek

Methods inherited from class com.google.common.collect.UnmodifiableIterator

remove

Methods inherited from class java.lang.Object

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

Methods inherited from interface java.lang.Iterable

forEach, spliterator

Methods inherited from interface com.google.common.collect.PeekingIterator

next, peek, remove

Methods inherited from interface java.util.Iterator

forEachRemaining, hasNext

Method Detail

computeNext

public MerkleTree.TreeRange computeNext()

Specified by:

computeNext in class com.google.common.collect.AbstractIterator<MerkleTree.TreeRange>

iterator

public java.util.Iterator<MerkleTree.TreeRange> iterator()

Specified by:

iterator in interface java.lang.Iterable<MerkleTree.TreeRange>

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

Copyright © 2016 The Apache Software Foundation


text:
	position: fixed;
    z-index: 100000000;
	opacity: 0.4;
	background-color: #0D8EC7;
	display: none;
	cursor: pointer;
	transition-property: top, left, width, height, display;
	transition-duration: 0.2s;
	transition-timing-function: ease-in-out;
}

div#__wrapper.active{
    border: 2px dashed aliceblue;
}

div#__wrapper.active::after {
    content: 'x';
    color: #1D1919;
    font-size: 21px;
    font-weight: bolder;
    width: 21px;
    height: 21px;
    border: 1px dashed rgb(8, 84, 117);
    border-radius: 50%;
    display: block;
    font-family: sans-serif;
    text-align: center;
    background-color: white;
    position: absolute;
    top: -12px;
    z-index: 9999999;
    right: -2px;
}
.bvi-qtip{
    z-index: 100000001!important;
}
.bvi-qtip .qtip-content{
    color: #333!important;
}


text:
namespace c4html {
	class Config {
		public:
			static std::string getName();
			static std::string getTitle();
			static std::string getUrl();
			static bool isBuildDebug();
			static std::string getBuildDistribution();
			static std::string getBuildType();
			static bool isBuildJquery();
			static bool isBuildSqlite();
			static bool isBuildBoost();
			static bool isBuildSoci();
			static std::string getBuildSociBackend();
			static std::string getTemplateMakeMain();
			static std::string getTemplateMakeDebug();
			static std::string getTemplateMakeRedhat();
			static std::string getTemplateMakeDebian();
			static std::string getTemplateMakeWui();
			static std::string getTemplateMakeCgi();
			static std::string getTemplateMakeInclude();
			static std::string getTemplateMakePre();
			static std::string getTemplateMakePost();
			static std::string getTemplateMakeJquery();
			static std::string getTemplateMakeSqlite();
			static std::string getTemplateMakeBoost();
			static std::string getTemplateMakeSoci();
			static std::string getTemplateModuleModelCc();
			static std::string getTemplateModuleModelH();
			static std::string getTemplateModuleConfigCfg();
			static std::string getTemplateModuleViewHtml();
			static std::string getTemplateModuleControllerCc();
			static std::string getTemplateModuleControllerH();
			static std::string getTemplateModuleCgiCc();
			static std::string getServerName();
			static std::string getServerUser();
			static std::string getServerGroup();
			static std::string getServerHost();
			static std::string getServerConfig();
			static std::string getServerRoot();
			static std::string getNetworkListen();
			static int getNetworkPort();
			static std::string getContentType();
			static std::string getContentEncoding();
			static std::string getContentLanguage();
			static int getParameterKeySize();
			static int getParameterValueSize();
			static int getParameterQuerySize();
			static bool isDatabase();
			static std::string getDatabaseType();
			static std::string getDatabaseHost();
			static int getDatabasePort();
			static std::string getDatabaseName();
			static std::string getDatabaseSchema();
			static std::string getDatabaseUser();
			static std::string getDatabasePassword();
			static bool isApplication();
			static bool isApplicationPersistence();
			static std::string getApplicationType();
			static std::string getApplicationFile();
			static bool isTask();
			static int getTaskSize();
			static int getTaskSchedule();
			static std::string getTaskType();
			static std::string getTaskFile();
			static bool isSession();
			static std::string getSessionType();
			static std::string getSessionPrefix();
			static int getSessionSize();
			static bool isText();
			static std::string getTextDefaut();
			static int getSecurityRandom();
			static std::string getDirectoryBinary();
			static std::string getDirectoryConfig();
			static std::string getDirectoryLocale();
			static std::string getDirectoryManual();
			static std::string getDirectoryModule();
			static std::string getDirectoryRandom();
			static std::string getDirectorySource();
			static std::string getDirectoryStatic();
	};
}

#endif


text:
package com.Rain.musicsearch;

import java.util.ArrayList;
import java.util.List;

import com.Rain.musicsearch.domain.Company;

import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.graphics.Matrix;
import android.os.Bundle;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v4.view.ViewPager.OnPageChangeListener;
import android.util.DisplayMetrics;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.View.OnClickListener;
import android.view.animation.Animation;
import android.view.animation.TranslateAnimation;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;

public class ResultActivity4 extends Activity{
	private boolean flag = false;
	private static final int RESULT_CHANGE = 11;
	private static final int RESULT_DELETE = 9;

	private EditText ed_company_name;
	private EditText ed_company_area;
	private EditText ed_company_found;
	private ImageView iv_brand;

	/*---------------------*/
	private ViewPager viewPager;// Ò³¿¨ÄÚÈÝ
	private ImageView imageView;// ¶¯»Í¼Æ¬
	private TextView textView1, textView2, textView3;
	private List<View> views;// TabÒ³ÃæÁбí
	private int offset = 0;// ¶¯»Í¼Æ¬Æ«ÒÆÁ¿
	private int currIndex = 0;// µ±Ç°Ò³¿¨±àºÅ
	private int bmpW;// ¶¯»Í¼Æ¬¿í¶È
	private View view1, view2, view3;// ¸÷¸öÒ³¿¨

	/*---------------------*/

	private int[] brands = { R.drawable.companynull, R.drawable.brand1,
			R.drawable.brand2, R.drawable.brand3 };

	String name;
	String area;
	String found;
	String[] artists;
	String[] ablums;

	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_viewpager3);
		/*------------------------*/
		InitImageView();
		InitTextView();
		InitViewPager();
		/*-------------------------*/

		ed_company_name = (EditText) view1.findViewById(R.id.ed_company_name);
		ed_company_area = (EditText) view1.findViewById(R.id.ed_company_area);
		ed_company_found = (EditText) view1.findViewById(R.id.ed_company_found);
		iv_brand = (ImageView) view1.findViewById(R.id.iv_brand);

		Intent intent = getIntent();
		String name = intent.getStringExtra("name");
		String area = intent.getStringExtra("area");
		String found = intent.getStringExtra("found");
		int brand = intent.getIntExtra("brand", -1);
		flag = intent.getBooleanExtra("flag", false);

		String[] tracks = intent.getStringArrayExtra("artists");
		setTracks(tracks);
		String[] albums = intent.getStringArrayExtra("albums");
		setAlbums(albums);

		Company result = new Company(name, area, found, brand);
		setText(result);

	}

	public void setText(Company company) {

		ed_company_name.setText(company.getName());
		ed_company_area.setText(company.getArea());
		ed_company_found.setText(company.getFound());
		int brandResult = company.getBrand();
		iv_brand.setImageResource(brands[brandResult + 1]);

	}

	public void setTracks(String[] artists) {
		LinearLayout company_our_artists_list = (LinearLayout) view2
				.findViewById(R.id.company_ourartists_list);
		if (artists == null) {// null¶ÔÏó²»ÄÜʹÓà equalÀ´Åжϣ¬Ò²²»ÄÜʹÓÃtoStringº¯Êý.
			TextView tv = new TextView(this);
			tv.setTextSize(20);
			tv.setTextColor(Color.WHITE);
			tv.setText("");
			company_our_artists_list.addView(tv);
		} else {
			for (String artist : artists) {
				TextView tv = new TextView(this);
				tv.setTextSize(20);
				tv.setTextColor(Color.WHITE);
				tv.setText(artist);
				company_our_artists_list.addView(tv);
			}
		}
	}

	public void setAlbums(String[] albums) {
		LinearLayout company_ouralbums_list = (LinearLayout) view3
				.findViewById(R.id.company_ouralbums_list);
		if (albums == null) {// null¶ÔÏó²»ÄÜʹÓà equalÀ´Åжϣ¬Ò²²»ÄÜʹÓÃtoStringº¯Êý.
			TextView tv = new TextView(this);
			tv.setTextSize(20);
			tv.setTextColor(Color.WHITE);
			tv.setText("");
			company_ouralbums_list.addView(tv);
		} else {
			for (String album : albums) {
				TextView tv = new TextView(this);
				tv.setTextSize(20);
				tv.setTextColor(Color.WHITE);
				tv.setText(album);
				company_ouralbums_list.addView(tv);
			}
		}
	}

	public void changeInfo(View view) {
		if (flag) {
			String name = ed_company_name.getText().toString().trim();
			String newarea = ed_company_area.getText().toString().trim();
			String newfound = ed_company_found.getText().toString().trim();
			Intent intent = new Intent(ResultActivity4.this, MainActivity.class);
			intent.putExtra("name", name);
			intent.putExtra("newarea", newarea);
			intent.putExtra("newfound", newfound);
			setResult(RESULT_CHANGE, intent);
			Toast.makeText(this, "¸üгɹ¦", Toast.LENGTH_SHORT).show();
			finish();
		}else {
			Toast.makeText(this, "ÎÞ²Ù×÷ȨÏÞ", Toast.LENGTH_SHORT).show();
		}
	}

	public void deleteInfo(View view) {
		if (flag) {
			Dialog dialog = new AlertDialog.Builder(this)
					.setTitle("Sure to delete£¿")
					.setIcon(android.R.drawable.ic_dialog_info)
					.setPositiveButton("Yes",
							new DialogInterface.OnClickListener() {

								public void onClick(DialogInterface dialog,
										int which) {
									String company = ed_company_name.getText()
											.toString().trim();
									Intent intent = new Intent(
											ResultActivity4.this,
											MainActivity.class);
									intent.putExtra("name", company);
									setResult(RESULT_DELETE, intent);

									Toast.makeText(ResultActivity4.this,
											"ɾ³ý³É¹¦", Toast.LENGTH_SHORT).show();
									finish();

								}
							})
					.setNegativeButton("No",
							new DialogInterface.OnClickListener() {

								public void onClick(DialogInterface dialog,
										int which) {
									// µã»÷¡°·µ»Ø¡±ºóµÄ²Ù×÷,ÕâÀï²»ÉèÖÃûÓÐÈκβÙ×÷
									finish();
								}
							}).create();
			dialog.show();
		}else {
			Toast.makeText(this, "ÎÞ²Ù×÷ȨÏÞ", Toast.LENGTH_SHORT).show();
		}

	}

	/*****************************************/
	private void InitViewPager() {
		viewPager = (ViewPager) ResultActivity4.this
				.findViewById(R.id.viewpager3);
		views = new ArrayList<View>();
		LayoutInflater inflater = getLayoutInflater();
		view1 = inflater.inflate(R.layout.activity_result_company1, null);
		view2 = inflater.inflate(R.layout.activity_result_company2, null);
		view3 = inflater.inflate(R.layout.activity_result_company3, null);
		views.add(view1);
		views.add(view2);
		views.add(view3);
		viewPager.setAdapter(new MyViewPagerAdapter(views));
		viewPager.setCurrentItem(0);
		viewPager.setOnPageChangeListener(new MyOnPageChangeListener());
	}

	/**
	 * ³õ'»¯Í·±ê
	 */

	private void InitTextView() {
		textView1 = (TextView) ResultActivity4.this.findViewById(R.id.text7);
		textView2 = (TextView) ResultActivity4.this.findViewById(R.id.text8);
		textView3 = (TextView) ResultActivity4.this.findViewById(R.id.text9);

		textView1.setOnClickListener(new MyOnClickListener(0));
		textView2.setOnClickListener(new MyOnClickListener(1));
		textView3.setOnClickListener(new MyOnClickListener(2));
	}

	/**
	 * 2 * ³õ'»¯¶¯»£¬Õâ¸ö¾ÍÊÇÒ³¿¨»¬¶¯Ê±£¬ÏÂÃæµÄºáÏßÒ²»¬¶¯µÄЧ¹û£¬ÔÚÕâÀïÐèÒª¼ÆËãһЩÊý¾Ý 3
	 */

	private void InitImageView() {
		imageView = (ImageView) findViewById(R.id.cursor3);
		bmpW = BitmapFactory.decodeResource(getResources(), R.drawable.b)
				.getWidth();// »ñȡͼƬ¿í¶È
		DisplayMetrics dm = new DisplayMetrics();
		getWindowManager().getDefaultDisplay().getMetrics(dm);
		int screenW = dm.widthPixels;// »ñÈ¡·Ö±æÂÊ¿í¶È
		offset = (screenW / 3 - bmpW) / 2;// ¼ÆËãÆ«ÒÆÁ¿
		Matrix matrix = new Matrix();
		matrix.postTranslate(offset, 0);
		imageView.setImageMatrix(matrix);// ÉèÖö¯»³õ'λÖÃ
	}

	/**
	 *
	 * Í·±êµã»÷¼àÌý 3
	 */
	private class MyOnClickListener implements OnClickListener {
		private int index = 0;

		public MyOnClickListener(int i) {
			index = i;
		}

		public void onClick(View v) {
			viewPager.setCurrentItem(index);
		}

	}

	public class MyViewPagerAdapter extends PagerAdapter {
		private List<View> mListViews;

		public MyViewPagerAdapter(List<View> mListViews) {
			this.mListViews = mListViews;
		}

		@Override
		public void destroyItem(ViewGroup container, int position, Object object) {
			container.removeView(mListViews.get(position));
		}

		@Override
		public Object instantiateItem(ViewGroup container, int position) {
			container.addView(mListViews.get(position), 0);
			return mListViews.get(position);
		}

		@Override
		public int getCount() {
			return mListViews.size();
		}

		@Override
		public boolean isViewFromObject(View arg0, Object arg1) {
			return arg0 == arg1;
		}
	}

	public class MyOnPageChangeListener implements OnPageChangeListener {

		int one = offset * 2 + bmpW;// Ò³¿¨1 -> Ò³¿¨2 Æ«ÒÆÁ¿
		int two = one * 2;// Ò³¿¨1 -> Ò³¿¨3 Æ«ÒÆÁ¿

		public void onPageScrollStateChanged(int arg0) {

		}

		public void onPageScrolled(int arg0, float arg1, int arg2) {

		}

		public void onPageSelected(int arg0) {

			Animation animation = new TranslateAnimation(one * currIndex, one
					* arg0, 0, 0);
			currIndex = arg0;
			animation.setFillAfter(true);// True:ͼƬͣÔÚ¶¯»½áÊøλÖÃ
			animation.setDuration(300);
			imageView.startAnimation(animation);
		}

	}

}


text:
package com.coolweather.android.gson;

import com.google.gson.annotations.SerializedName;

/**
 * Created by chen on 2017/4/15.
 */

public class AQI {

    public AQICity city;

    public class AQICity {

        @SerializedName("aqi")
        public String aqi;

        @SerializedName("pm25")
        public String pm25;
    }
}


text:
/**
 * @file   apple.hpp
 * @brief  apple platform config.
 * @author zer0
 * @date   2016-11-24
 */

#ifndef __INCLUDE_LIBTBAG__LIBTBAG_MACRO_PLATFORM_APPLE_HPP__
#define __INCLUDE_LIBTBAG__LIBTBAG_MACRO_PLATFORM_APPLE_HPP__

// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif

#if defined(__APPLE__)
#define TBAG_PLATFORM_APPLE
#endif

#if (defined(__APPLE__) && defined(__MACH__))
# if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__)
#  define TBAG_PLATFORM_IOS
# else
#  define TBAG_PLATFORM_MACOS
# endif
#elif defined(macintosh) || defined(Macintosh)
# define TBAG_PLATFORM_MACOS
#endif

#endif // __INCLUDE_LIBTBAG__LIBTBAG_MACRO_PLATFORM_APPLE_HPP__


text:
/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * Written (W) 2012-2013 Heiko Strathmann
 */

#include <shogun/statistics/MMDKernelSelectionOpt.h>
#include <shogun/statistics/LinearTimeMMD.h>
#include <shogun/kernel/CombinedKernel.h>

using namespace shogun;

CMMDKernelSelectionOpt::CMMDKernelSelectionOpt() :
		CMMDKernelSelection()
{
	init();
}

CMMDKernelSelectionOpt::CMMDKernelSelectionOpt(
		CKernelTwoSampleTest* mmd, float64_t lambda) :
		CMMDKernelSelection(mmd)
{
	init();

	/* currently, this method is only developed for the linear time MMD */
	REQUIRE(dynamic_cast<CLinearTimeMMD*>(mmd), "%s::%s(): Only "
			"CLinearTimeMMD is currently supported! Provided instance is "
			"\"%s\"\n", get_name(), get_name(), mmd->get_name());

	m_lambda=lambda;
}

CMMDKernelSelectionOpt::~CMMDKernelSelectionOpt()
{
}

SGVector<float64_t> CMMDKernelSelectionOpt::compute_measures()
{
	/* comnpute mmd on all subkernels using the same data. Note that underlying
	 * kernel was asserted to be a combined one */
	SGVector<float64_t> mmds;
	SGVector<float64_t> vars;
	((CLinearTimeMMD*)m_estimator)->compute_statistic_and_variance(mmds, vars, true);

	/* we know that the underlying MMD is linear time version, cast is safe */
	SGVector<float64_t> measures(mmds.vlen);

	for (index_t i=0; i<measures.vlen; ++i)
		measures[i]=mmds[i]/(CMath::sqrt(vars[i])+m_lambda);

	return measures;
}

void CMMDKernelSelectionOpt::init()
{
	/* set to a sensible standard value that proved to be useful in
	 * experiments, see NIPS paper */
	m_lambda=1E-5;
}


text:
import re
from bson import ObjectId

from boto.iam import IAMConnection
from boto.s3.cors import CORSConfiguration
from boto.exception import BotoServerError

from website.util import web_url_for
from api import get_bucket_list
import settings as s3_settings

def adjust_cors(s3wrapper, clobber=False):
    """Set CORS headers on a bucket, removing pre-existing headers set by the
    OSF. Optionally clear all pre-existing headers.

    :param S3Wrapper s3wrapper: S3 wrapper instance
    :param bool clobber: Remove all pre-existing rules. Note: if this option
        is set to True, remember to warn or prompt the user first!

    """
    rules = s3wrapper.get_cors_rules()

    # Remove some / all pre-existing rules
    if clobber:
        rules = CORSConfiguration([])
    else:
        rules = CORSConfiguration([
            rule
            for rule in rules
            if 'osf-s3' not in (rule.id or '')
        ])

    # Add new rule
    rules.add_rule(
        ['PUT', 'GET'],
        s3_settings.ALLOWED_ORIGIN,
        allowed_header=['*'],
        id='osf-s3-{0}'.format(ObjectId()),
    )

    # Save changes
    s3wrapper.set_cors_rules(rules)

def get_bucket_drop_down(user_settings):
    try:
        return [
            bucket.name
            for bucket in get_bucket_list(user_settings)
        ]
    except BotoServerError:
        return None

def create_osf_user(access_key, secret_key, name):

    connection = IAMConnection(access_key, secret_key)

    user_name = u'osf-{0}'.format(ObjectId())

    try:
        connection.get_user(user_name)
    except BotoServerError:
        connection.create_user(user_name)

    try:
        connection.get_user_policy(
            user_name,
            s3_settings.OSF_USER_POLICY
        )
    except BotoServerError:
        connection.put_user_policy(
            user_name,
            s3_settings.OSF_USER_POLICY_NAME,
            s3_settings.OSF_USER_POLICY
        )

    response = connection.create_access_key(user_name)
    access_key = response['create_access_key_response']['create_access_key_result']['access_key']
    return user_name, access_key

def remove_osf_user(user_settings):
    connection = IAMConnection(user_settings.access_key, user_settings.secret_key)
    connection.delete_access_key(
        user_settings.access_key,
        user_settings.s3_osf_user
    )
    connection.delete_user_policy(
        user_settings.s3_osf_user,
        s3_settings.OSF_USER_POLICY_NAME
    )
    return connection.delete_user(user_settings.s3_osf_user)

def validate_bucket_name(name):
    validate_name = re.compile('^(?!.*(\.\.|-\.))[^.][a-z0-9\d.-]{2,61}[^.]$')
    return bool(validate_name.match(name))

def serialize_urls(node_addon, user):

    node = node_addon.owner
    user_settings = node_addon.user_settings

    result = {
        'create_bucket': node.api_url_for('create_new_bucket'),
        'import_auth': node.api_url_for('s3_node_import_auth'),
        'create_auth': node.api_url_for('s3_authorize_node'),
        'deauthorize': node.api_url_for('s3_remove_node_settings'),
        'bucket_list': node.api_url_for('s3_bucket_list'),
        'set_bucket': node.api_url_for('s3_node_settings'),
        'settings': web_url_for('user_addons'),
        'files': node.web_url_for('collect_file_trees'),
    }
    if user_settings:
        result['owner'] = web_url_for('profile_view_id',
                                      uid=user_settings.owner._id)
    return result


text:
Kies een maand

            <datepicker ng-model="dot.month" datepicker-options="monthOptions" min-mode="month" datepicker-mode="'month'"></datepicker>

Dot bestand genereren

{{dot.month|date:'MMMM yyyy'}}

                            {{ progress.done/progress.total * 100 | number:0}}% Complete (success)
                            {{ progress.done/progress.total * 100 | number:0}}% Complete (errors!)

                            T-Mobile gegevens ophalen

                            KPN gegevens ophalen

                            Dot-bestand genereren


text:
package org.apache.hadoop.hive.ql.parse;

import java.util.List;
import java.util.Map;

import org.apache.hadoop.hive.ql.exec.Operator;
import org.apache.hadoop.hive.ql.lib.NodeProcessorCtx;
import org.apache.hadoop.hive.ql.plan.OperatorDesc;

/**
 * This class implements the context information that is used for typechecking
 * phase in query compilation.
 */
public class TableAccessCtx implements NodeProcessorCtx {

  /**
   * Map of operator id to table and key names.
   */
  private final TableAccessInfo tableAccessInfo;

  /**
   * Constructor.
   */
  public TableAccessCtx() {
    tableAccessInfo = new TableAccessInfo();
  }

  public TableAccessInfo getTableAccessInfo() {
    return tableAccessInfo;
  }

  public void addOperatorTableAccess(Operator<? extends OperatorDesc> op,
      Map<String, List<String>> tableToKeysMap) {
    assert(tableToKeysMap != null);
    assert(op != null);
    tableAccessInfo.add(op, tableToKeysMap);
  }

}


text:
package org.openfact.core.utils.finance.internal.languages;

public class MissingFormException extends RuntimeException {
    public MissingFormException(String message) {
        super(message);
    }
}


text:
This repository is a collection of various guideline documents that outline how Hipo iOS & Android teams should collaborate within the mobile team and how they should interact with the rest of the company and our clients.

### Topics
- [Best Practices](BestPractices.md)
- [Project Structure](ProjectStructure.md)
- [Review Flows](ReviewFlows.md)
- [Deployments](Deployments.md)
- [Project Huddle Etiquette](ProjectHuddleEtiquette.md)
- [Weekly Huddle Etiquette](WeeklyHuddleEtiquette.md)
- [Jenkins Setup Guide](JenkinsSetupGuide.md)
- [Swift Style Guide](SwiftStyleGuide.md)
- [Linter Rules](LinterRules.md)


text:
MIME-Version: 1.0
Server: CERN/3.0
Date: Monday, 06-Jan-97 21:29:36 GMT
Content-Type: text/html
Content-Length: 2996
Last-Modified: Sunday, 21-Jul-96 15:14:20 GMT

<title>The Robot Group</title>

The Robot Group

 The Robot Group

The Robot Group is a not-for-profit arts/technology organization
located in Austin, Texas, USA.

 The Robot Group Mission

The purpose of The Robot Group shall be:

 To promote excellence and innovation in the integration of
        advanced technology with the arts;

 To provide a forum for interaction between artists and
        technologists;

 To serve as a non-profit umbrella for and to secure
        funding for projects which explore the relationship
        between arts and technology;

 To combat technophobia through educational outreach by staging
        public events and by involving youth in Robot Group
        projects as defined above.

 The Robot Group Logo

 The Robot Group T-shirt

You may order a t-shirt with The Robot Group logo on it.

 Annual Robofest

Annually, The Robot Group and the City of Austin (among others)
sponsor Robofest, an art and technology
extravaganza.

 PULSE Newsletter

The Robot Group publishes a weekly newletter, PULSE.  PULSE is
designed to help keep members of The Robot Group informed about group
activities as well as providing information on current topics related
to robotics and art.

Glenn Currie

glenn@mpd.tandem.com

 Contact Information

If you would like to contact us, here is the info:

         The Robot Group

         P.O. Box 16334

         Austin, TX 78716

         robot-group@cs.utexas.edu

         (512) 794-9105

Meetings are held in "Ted's Greek Corner" restaurant in downtown
Austin, in Congress Av. and 5th street, every Thursday at
7:30pm. Everyone is welcome to join the meetings!

 Emailing List

There is an associated mailing list for discussion on issues related
to the group, announcements, or anything else related to robotics. If
you want to join it, please send mail to
robot-group-net-request@cs.utexas.edu.

If you have any problem with this server, please report them to
robot-group-request@cs.utexas.edu.  The voting members of the group
can be reached by sending mail to robot-group@cs.utexas.edu.

 Other Robot Group WEB Pages

   The official Robot Group Homepage

     Carlos Puchol's WEB pages on The Robot Group

 Copyright

Please note that the images and information displayed in the WWW pages
of The Robot Group are copyrighted by The Robot Group. You can use
them for your personal use as long as you don't use them for profit.

This WWW page is prepared by

<address>Wan Yik Lee</address>

wylee@cs.utexas.edu


text:
package smc

//Licensed under the Apache License, Version 2.0 (the "License");
//you may not use this file except in compliance with the License.
//You may obtain a copy of the License at
//
//http://www.apache.org/licenses/LICENSE-2.0
//
//Unless required by applicable law or agreed to in writing, software
//distributed under the License is distributed on an "AS IS" BASIS,
//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//See the License for the specific language governing permissions and
//limitations under the License.
//
// Code generated by Alibaba Cloud SDK Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.

// Part is a nested struct in smc response
type Part struct {
	Path      string `json:"Path" xml:"Path"`
	Need      bool   `json:"Need" xml:"Need"`
	CanBlock  bool   `json:"CanBlock" xml:"CanBlock"`
	Device    string `json:"Device" xml:"Device"`
	Block     bool   `json:"Block" xml:"Block"`
	SizeBytes int64  `json:"SizeBytes" xml:"SizeBytes"`
}