text
stringlengths 2
1.04M
| meta
dict |
|---|---|
#include <aws/elasticache/model/EngineDefaults.h>
#include <aws/core/utils/xml/XmlSerializer.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>
#include <utility>
using namespace Aws::ElastiCache::Model;
using namespace Aws::Utils::Xml;
using namespace Aws::Utils;
EngineDefaults::EngineDefaults() :
m_cacheParameterGroupFamilyHasBeenSet(false),
m_markerHasBeenSet(false),
m_parametersHasBeenSet(false),
m_cacheNodeTypeSpecificParametersHasBeenSet(false)
{
}
EngineDefaults::EngineDefaults(const XmlNode& xmlNode) :
m_cacheParameterGroupFamilyHasBeenSet(false),
m_markerHasBeenSet(false),
m_parametersHasBeenSet(false),
m_cacheNodeTypeSpecificParametersHasBeenSet(false)
{
*this = xmlNode;
}
EngineDefaults& EngineDefaults::operator =(const XmlNode& xmlNode)
{
XmlNode resultNode = xmlNode;
if(!resultNode.IsNull())
{
XmlNode cacheParameterGroupFamilyNode = resultNode.FirstChild("CacheParameterGroupFamily");
if(!cacheParameterGroupFamilyNode.IsNull())
{
m_cacheParameterGroupFamily = StringUtils::Trim(cacheParameterGroupFamilyNode.GetText().c_str());
m_cacheParameterGroupFamilyHasBeenSet = true;
}
XmlNode markerNode = resultNode.FirstChild("Marker");
if(!markerNode.IsNull())
{
m_marker = StringUtils::Trim(markerNode.GetText().c_str());
m_markerHasBeenSet = true;
}
XmlNode parametersNode = resultNode.FirstChild("Parameters");
if(!parametersNode.IsNull())
{
XmlNode parametersMember = parametersNode.FirstChild("Parameter");
while(!parametersMember.IsNull())
{
m_parameters.push_back(parametersMember);
parametersMember = parametersMember.NextNode("Parameter");
}
m_parametersHasBeenSet = true;
}
XmlNode cacheNodeTypeSpecificParametersNode = resultNode.FirstChild("CacheNodeTypeSpecificParameters");
if(!cacheNodeTypeSpecificParametersNode.IsNull())
{
XmlNode cacheNodeTypeSpecificParametersMember = cacheNodeTypeSpecificParametersNode.FirstChild("CacheNodeTypeSpecificParameter");
while(!cacheNodeTypeSpecificParametersMember.IsNull())
{
m_cacheNodeTypeSpecificParameters.push_back(cacheNodeTypeSpecificParametersMember);
cacheNodeTypeSpecificParametersMember = cacheNodeTypeSpecificParametersMember.NextNode("CacheNodeTypeSpecificParameter");
}
m_cacheNodeTypeSpecificParametersHasBeenSet = true;
}
}
return *this;
}
void EngineDefaults::OutputToStream(Aws::OStream& oStream, const char* location, unsigned index, const char* locationValue) const
{
if(m_cacheParameterGroupFamilyHasBeenSet)
{
oStream << location << index << locationValue << ".CacheParameterGroupFamily=" << StringUtils::URLEncode(m_cacheParameterGroupFamily.c_str()) << "&";
}
if(m_markerHasBeenSet)
{
oStream << location << index << locationValue << ".Marker=" << StringUtils::URLEncode(m_marker.c_str()) << "&";
}
if(m_parametersHasBeenSet)
{
for(auto& item : m_parameters)
{
Aws::StringStream parametersSs;
parametersSs << location << index << locationValue << ".Parameter";
item.OutputToStream(oStream, parametersSs.str().c_str());
}
}
if(m_cacheNodeTypeSpecificParametersHasBeenSet)
{
for(auto& item : m_cacheNodeTypeSpecificParameters)
{
Aws::StringStream cacheNodeTypeSpecificParametersSs;
cacheNodeTypeSpecificParametersSs << location << index << locationValue << ".CacheNodeTypeSpecificParameter";
item.OutputToStream(oStream, cacheNodeTypeSpecificParametersSs.str().c_str());
}
}
}
void EngineDefaults::OutputToStream(Aws::OStream& oStream, const char* location) const
{
if(m_cacheParameterGroupFamilyHasBeenSet)
{
oStream << location << ".CacheParameterGroupFamily=" << StringUtils::URLEncode(m_cacheParameterGroupFamily.c_str()) << "&";
}
if(m_markerHasBeenSet)
{
oStream << location << ".Marker=" << StringUtils::URLEncode(m_marker.c_str()) << "&";
}
if(m_parametersHasBeenSet)
{
for(auto& item : m_parameters)
{
Aws::String locationAndListMember(location);
locationAndListMember += ".Parameter";
item.OutputToStream(oStream, locationAndListMember.c_str());
}
}
if(m_cacheNodeTypeSpecificParametersHasBeenSet)
{
for(auto& item : m_cacheNodeTypeSpecificParameters)
{
Aws::String locationAndListMember(location);
locationAndListMember += ".CacheNodeTypeSpecificParameter";
item.OutputToStream(oStream, locationAndListMember.c_str());
}
}
}
|
{
"content_hash": "c2b82d6f4086e0a0aae872c4f46f1597",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 155,
"avg_line_length": 34.474074074074075,
"alnum_prop": 0.715513536742587,
"repo_name": "zeliard/aws-sdk-cpp",
"id": "7dd7403f27c7a520f6e6c7570a86529c3fd666a1",
"size": "5225",
"binary": false,
"copies": "3",
"ref": "refs/heads/windows-custom",
"path": "aws-cpp-sdk-elasticache/source/model/EngineDefaults.cpp",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "13169"
},
{
"name": "C++",
"bytes": "65046472"
},
{
"name": "CMake",
"bytes": "266341"
},
{
"name": "Java",
"bytes": "214644"
},
{
"name": "Python",
"bytes": "45989"
}
],
"symlink_target": ""
}
|
<!-- If you are a future executive adding a new sponsor, make sure the photo is a png with
a transparent texture on it. -->
<head>
<meta charset="UTF-8">
<!-- jQuery -->
<script src="../js/jquery.min.js"></script>
<!-- Bootstrap Core JavaScript -->
<script src="../js/bootstrap.min.js"></script>
<script src="../js/jquery-ui-1.12.1/jquery-ui.js"></script>
<!-- Bootstrap Core JavaScript -->
<script src="../js/bootstrap.min.js"></script>
<link rel="stylesheet" href="../js/jquery-ui-1.12.1/jquery-ui.css">
<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="../css/framework.css">
<link rel="stylesheet" type="text/css" href="../css/main.css">
<title>UW-Madison Software Dev Club</title>
</head>
<!-- Navigation -->
<nav class="navbar-inverse navbar-fixed-top" role="navigation">
<div class="container" id="navbar">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="../index.html">UW-Madison Software Development Club</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li>
<a href="/pages/about.html">About</a>
</li>
<li>
<a href="/pages/calendarview.html">Calendar</a>
</li>
<li>
<a href="/pages/sponsorship.html">Sponsorship</a>
</li>
<li>
<a href="/pages/faq.html">FAQ</a>
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container -->
</nav>
<body>
<div class="text-custom opaque-bg s_msg">
<h2 id="top">Our Sponsors</h2>
<p class="text-custom">On behalf of the entire Software Development Club, we would like to thank our very generous sponsors.
Without your support, we would not be able to continually grow as a club and provide our members with
the best experience possible. Your support is sincerely appreciated. </p>
</div>
<div id="gold" class="s_msg">
<h2 class="black_outline">Gold Level</h2>
<ul class="s_align">
<li class="s_block"><img src="/images/sponsors/gold1.png"></li>
<li class="s_block"><img src="/images/sponsors/gold2.png"><li>
</ul>
</div>
<div id="silver_s" class="s_msg">
<h2 class="black_outline">Silver Level</h2>
<ul class="s_align">
<li id="silver" class="s_block"><img src="/images/sponsors/silver1.png"></li>
</ul>
</div>
<!--
<div id="bronze" class="s_msg">
<h2 class="black_outline">Bronze Level</h2>
<ul class="s_align">
</ul>
</div>
<div id="partners" class="s_msg">
<h2 class="black_outline">Partners</h2>
<ul class="s_align">
</ul>
</div>
-->
<div id=footer_msg class="text-custom opaque-bg s_msg">
<h4>Interested in Becoming a Sponsor?</h4>
<p id= "bottom" class="black_hover text-custom">We are always looking for new partnerships!
Check out our sponsorship packet <a target="_blank" href="/Software%20Development%20Club%20Sponsorship%20Packet%202017-2018.pdf"> here</a></p>
</div>
</body>
|
{
"content_hash": "02c41e64e83ab60f87c90a6ba1a0734e",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 150,
"avg_line_length": 40.375,
"alnum_prop": 0.5624355005159959,
"repo_name": "kreloff-01/new-sdc-site",
"id": "afcd6191e34bd35c962b9fa7991b9ba4e006a60f",
"size": "3878",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "pages/sponsorship.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "10197"
},
{
"name": "HTML",
"bytes": "98041"
},
{
"name": "JavaScript",
"bytes": "15677"
}
],
"symlink_target": ""
}
|
package org.neo4j.cypher.internal.codegen;
import org.neo4j.cypher.internal.frontend.v2_3.ArithmeticException;
import org.neo4j.cypher.internal.frontend.v2_3.CypherTypeException;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.List;
/**
* This is a helper class used by compiled plans for doing basic math operations
*/
public final class CompiledMathHelper
{
private static final double EPSILON = Math.pow( 1, -10 );
/**
* Do not instantiate this class
*/
private CompiledMathHelper()
{
}
/**
* Utility function for doing addition
*/
public static Object add( Object lhs, Object rhs )
{
if ( lhs == null || rhs == null )
{
return null;
}
if ( lhs instanceof String || rhs instanceof String )
{
return String.valueOf( lhs ) + String.valueOf( rhs );
}
//List addition
if ( lhs instanceof List<?> && rhs instanceof List<?> )
{
List<?> lhsList = (List<?>) lhs;
List<?> rhsList = (List<?>) rhs;
List<Object> result = new ArrayList<>( lhsList.size() + rhsList.size() );
result.addAll( lhsList );
result.addAll( rhsList );
return result;
}
else if ( lhs instanceof List<?> )
{
List<?> lhsList = (List<?>) lhs;
List<Object> result = new ArrayList<>( lhsList.size() + 1 );
result.addAll( lhsList );
result.add( rhs );
return result;
}
else if ( rhs instanceof List<?> )
{
List<?> rhsList = (List<?>) rhs;
List<Object> result = new ArrayList<>( rhsList.size() + 1 );
result.add( lhs );
result.addAll( rhsList );
return result;
}
// array addition
Class<?> lhsClass = lhs.getClass();
Class<?> rhsClass = rhs.getClass();
if ( lhsClass.isArray() && rhsClass.isArray() )
{
return addArrays( lhs, rhs );
}
else if ( lhsClass.isArray() )
{
return addArrayWithObject( lhs, rhs );
}
else if ( rhsClass.isArray() )
{
return addObjectWithArray( lhs, rhs );
}
if ( lhs instanceof Number && rhs instanceof Number )
{
if ( lhs instanceof Double || rhs instanceof Double ||
lhs instanceof Float || rhs instanceof Float )
{
return ((Number) lhs).doubleValue() + ((Number) rhs).doubleValue();
}
if ( lhs instanceof Long || rhs instanceof Long ||
lhs instanceof Integer || rhs instanceof Integer ||
lhs instanceof Short || rhs instanceof Short ||
lhs instanceof Byte || rhs instanceof Byte )
{
return ((Number) lhs).longValue() + ((Number) rhs).longValue();
}
// other numbers we cannot add
}
throw new CypherTypeException( "Cannot add " + lhs.getClass().getSimpleName() +
" and " + rhs.getClass().getSimpleName(), null );
}
public static Object subtract( Object lhs, Object rhs )
{
if ( lhs == null || rhs == null )
{
return null;
}
if ( lhs instanceof Number && rhs instanceof Number )
{
if ( lhs instanceof Double || rhs instanceof Double ||
lhs instanceof Float || rhs instanceof Float )
{
return ((Number) lhs).doubleValue() - ((Number) rhs).doubleValue();
}
if ( lhs instanceof Long || rhs instanceof Long ||
lhs instanceof Integer || rhs instanceof Integer ||
lhs instanceof Short || rhs instanceof Short ||
lhs instanceof Byte || rhs instanceof Byte )
{
return ((Number) lhs).longValue() - ((Number) rhs).longValue();
}
// other numbers we cannot subtract
}
throw new CypherTypeException( "Cannot add " + lhs.getClass().getSimpleName() +
" and " + rhs.getClass().getSimpleName(), null );
}
public static Object multiply( Object lhs, Object rhs )
{
if ( lhs == null || rhs == null )
{
return null;
}
if ( lhs instanceof Number && rhs instanceof Number )
{
if ( lhs instanceof Double || rhs instanceof Double ||
lhs instanceof Float || rhs instanceof Float )
{
return ((Number) lhs).doubleValue() * ((Number) rhs).doubleValue();
}
if ( lhs instanceof Long || rhs instanceof Long ||
lhs instanceof Integer || rhs instanceof Integer ||
lhs instanceof Short || rhs instanceof Short ||
lhs instanceof Byte || rhs instanceof Byte )
{
return ((Number) lhs).longValue() * ((Number) rhs).longValue();
}
// other numbers we cannot multiply
}
throw new CypherTypeException( "Cannot multiply " + lhs.getClass().getSimpleName() +
" and " + rhs.getClass().getSimpleName(), null );
}
public static Object divide( Object lhs, Object rhs )
{
if ( lhs == null || rhs == null )
{
return null;
}
if ( lhs instanceof Number && rhs instanceof Number )
{
if ( lhs instanceof Double || rhs instanceof Double ||
lhs instanceof Float || rhs instanceof Float )
{
double left = ((Number) lhs).doubleValue();
double right = ((Number) rhs).doubleValue();
if ( Math.abs( right ) < EPSILON )
{
throw new ArithmeticException( "/ by zero", null );
}
return left / right;
}
if ( lhs instanceof Long || rhs instanceof Long ||
lhs instanceof Integer || rhs instanceof Integer ||
lhs instanceof Short || rhs instanceof Short ||
lhs instanceof Byte || rhs instanceof Byte )
{
long left = ((Number) lhs).longValue();
long right = ((Number) rhs).longValue();
if ( right == 0 )
{
throw new ArithmeticException( "/ by zero", null );
}
return left / right;
}
// other numbers we cannot divide
}
throw new CypherTypeException( "Cannot divide " + lhs.getClass().getSimpleName() +
" and " + rhs.getClass().getSimpleName(), null );
}
public static Object modulo( Object lhs, Object rhs )
{
if ( lhs == null || rhs == null )
{
return null;
}
if ( lhs instanceof Number && rhs instanceof Number )
{
return ((Number) lhs).doubleValue() % ((Number) rhs).doubleValue();
}
throw new CypherTypeException( "Cannot modulo " + lhs.getClass().getSimpleName() +
" and " + rhs.getClass().getSimpleName(), null );
}
public static int transformToInt( Object value )
{
if ( value == null )
{
throw new CypherTypeException( "Expected a numeric value but got null", null );
}
if ( value instanceof Number )
{
Number number = (Number) value;
if ( number.longValue() > Integer.MAX_VALUE )
{
throw new CypherTypeException( value.toString() + " is too large to cast to an int32", null );
}
return number.intValue();
}
throw new CypherTypeException( String.format( "Expected a numeric value but got %s", value.toString() ), null );
}
/**
* Both a1 and a2 must be arrays
*/
private static Object addArrays( Object a1, Object a2 )
{
int l1 = Array.getLength( a1 );
int l2 = Array.getLength( a2 );
Object[] ret = new Object[l1 + l2];
for ( int i = 0; i < l1; i++ )
{
ret[i] = Array.get( a1, i );
}
for ( int i = 0; i < l2; i++ )
{
ret[l1 + i] = Array.get( a2, i );
}
return ret;
}
/**
* array must be an array
*/
private static Object addArrayWithObject( Object array, Object object )
{
int l = Array.getLength( array );
Object[] ret = new Object[l + 1];
int i = 0;
for (; i < l; i++ )
{
ret[i] = Array.get( array, i );
}
ret[i] = object;
return ret;
}
/**
* array must be an array
*/
private static Object addObjectWithArray( Object object, Object array )
{
int l = Array.getLength( array );
Object[] ret = new Object[l + 1];
ret[0] = object;
for ( int i = 1; i < ret.length; i++ )
{
ret[i] = Array.get( array, i );
}
return ret;
}
}
|
{
"content_hash": "ccafadd432f783ae5d8a934afaf5fd70",
"timestamp": "",
"source": "github",
"line_count": 285,
"max_line_length": 120,
"avg_line_length": 32.670175438596495,
"alnum_prop": 0.4970465041348942,
"repo_name": "HuangLS/neo4j",
"id": "aea84c944258a258d3d00064a59702661d22a09c",
"size": "10106",
"binary": false,
"copies": "1",
"ref": "refs/heads/2.3",
"path": "community/cypher/cypher/src/main/java/org/neo4j/cypher/internal/codegen/CompiledMathHelper.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "23732"
},
{
"name": "CSS",
"bytes": "857344"
},
{
"name": "CoffeeScript",
"bytes": "753075"
},
{
"name": "Cucumber",
"bytes": "19027"
},
{
"name": "Elixir",
"bytes": "2696"
},
{
"name": "Groff",
"bytes": "74996"
},
{
"name": "HTML",
"bytes": "486412"
},
{
"name": "Java",
"bytes": "23514509"
},
{
"name": "JavaScript",
"bytes": "1641699"
},
{
"name": "Makefile",
"bytes": "8288"
},
{
"name": "PowerShell",
"bytes": "160123"
},
{
"name": "Ruby",
"bytes": "706"
},
{
"name": "Scala",
"bytes": "5935401"
},
{
"name": "Shell",
"bytes": "99251"
}
],
"symlink_target": ""
}
|
#include "include/core/SkBitmap.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkImageInfo.h"
#include "include/core/SkPaint.h"
#include "include/core/SkRect.h"
#include "include/core/SkSurface.h"
#include <cmath>
void SkRescaleAndReadPixels(SkBitmap bmp,
const SkImageInfo& resultInfo,
const SkIRect& srcRect,
SkImage::RescaleGamma rescaleGamma,
SkImage::RescaleMode rescaleMode,
SkImage::ReadPixelsCallback callback,
SkImage::ReadPixelsContext context) {
int srcW = srcRect.width();
int srcH = srcRect.height();
float sx = (float)resultInfo.width() / srcW;
float sy = (float)resultInfo.height() / srcH;
// How many bilerp/bicubic steps to do in X and Y. + means upscaling, - means downscaling.
int stepsX;
int stepsY;
if (rescaleMode != SkImage::RescaleMode::kNearest) {
stepsX = static_cast<int>((sx > 1.f) ? std::ceil(std::log2f(sx))
: std::floor(std::log2f(sx)));
stepsY = static_cast<int>((sy > 1.f) ? std::ceil(std::log2f(sy))
: std::floor(std::log2f(sy)));
} else {
stepsX = sx != 1.f;
stepsY = sy != 1.f;
}
SkPaint paint;
paint.setBlendMode(SkBlendMode::kSrc);
if (stepsX < 0 || stepsY < 0) {
// Don't trigger MIP generation. We don't currently have a way to trigger bicubic for
// downscaling draws.
// TODO: should we trigger cubic now that we can?
if (rescaleMode != SkImage::RescaleMode::kNearest) {
rescaleMode = SkImage::RescaleMode::kRepeatedLinear;
}
}
auto rescaling_to_sampling = [](SkImage::RescaleMode rescaleMode) {
SkSamplingOptions sampling;
if (rescaleMode == SkImage::RescaleMode::kRepeatedLinear) {
sampling = SkSamplingOptions(SkFilterMode::kLinear);
} else if (rescaleMode == SkImage::RescaleMode::kRepeatedCubic) {
sampling = SkSamplingOptions({1.0f/3, 1.0f/3});
}
return sampling;
};
SkSamplingOptions sampling = rescaling_to_sampling(rescaleMode);
sk_sp<SkSurface> tempSurf;
sk_sp<SkImage> srcImage;
int srcX = srcRect.fLeft;
int srcY = srcRect.fTop;
SkCanvas::SrcRectConstraint constraint = SkCanvas::kStrict_SrcRectConstraint;
// Assume we should ignore the rescale linear request if the surface has no color space since
// it's unclear how we'd linearize from an unknown color space.
if (rescaleGamma == SkSurface::RescaleGamma::kLinear && bmp.info().colorSpace() &&
!bmp.info().colorSpace()->gammaIsLinear()) {
auto cs = bmp.info().colorSpace()->makeLinearGamma();
// Promote to F16 color type to preserve precision.
auto ii = SkImageInfo::Make(srcW, srcH, kRGBA_F16_SkColorType, bmp.info().alphaType(),
std::move(cs));
auto linearSurf = SkSurface::MakeRaster(ii);
if (!linearSurf) {
callback(context, nullptr);
return;
}
linearSurf->getCanvas()->drawImage(bmp.asImage().get(), -srcX, -srcY, sampling, &paint);
tempSurf = std::move(linearSurf);
srcImage = tempSurf->makeImageSnapshot();
srcX = 0;
srcY = 0;
constraint = SkCanvas::kFast_SrcRectConstraint;
} else {
// MakeFromBitmap would trigger a copy if bmp is mutable.
srcImage = SkImage::MakeFromRaster(bmp.pixmap(), nullptr, nullptr);
}
while (stepsX || stepsY) {
int nextW = resultInfo.width();
int nextH = resultInfo.height();
if (stepsX < 0) {
nextW = resultInfo.width() << (-stepsX - 1);
stepsX++;
} else if (stepsX != 0) {
if (stepsX > 1) {
nextW = srcW * 2;
}
--stepsX;
}
if (stepsY < 0) {
nextH = resultInfo.height() << (-stepsY - 1);
stepsY++;
} else if (stepsY != 0) {
if (stepsY > 1) {
nextH = srcH * 2;
}
--stepsY;
}
auto ii = srcImage->imageInfo().makeWH(nextW, nextH);
if (!stepsX && !stepsY) {
// Might as well fold conversion to final info in the last step.
ii = resultInfo;
}
auto next = SkSurface::MakeRaster(ii);
if (!next) {
callback(context, nullptr);
return;
}
next->getCanvas()->drawImageRect(
srcImage.get(), SkRect::Make(SkIRect::MakeXYWH(srcX, srcY, srcW, srcH)),
SkRect::MakeIWH(nextW, nextH), sampling, &paint, constraint);
tempSurf = std::move(next);
srcImage = tempSurf->makeImageSnapshot();
srcX = srcY = 0;
srcW = nextW;
srcH = nextH;
constraint = SkCanvas::kFast_SrcRectConstraint;
}
size_t rowBytes = resultInfo.minRowBytes();
std::unique_ptr<char[]> data(new char[resultInfo.height() * rowBytes]);
SkPixmap pm(resultInfo, data.get(), rowBytes);
if (srcImage->readPixels(nullptr, pm, srcX, srcY)) {
class Result : public SkImage::AsyncReadResult {
public:
Result(std::unique_ptr<const char[]> data, size_t rowBytes)
: fData(std::move(data)), fRowBytes(rowBytes) {}
int count() const override { return 1; }
const void* data(int i) const override { return fData.get(); }
size_t rowBytes(int i) const override { return fRowBytes; }
private:
std::unique_ptr<const char[]> fData;
size_t fRowBytes;
};
callback(context, std::make_unique<Result>(std::move(data), rowBytes));
} else {
callback(context, nullptr);
}
}
|
{
"content_hash": "5e48b63ea92350c5899123805010a3b8",
"timestamp": "",
"source": "github",
"line_count": 151,
"max_line_length": 97,
"avg_line_length": 39.49006622516556,
"alnum_prop": 0.5661579741740734,
"repo_name": "google/skia",
"id": "79d365d3be195daedc946e86b91ee804f376004b",
"size": "6105",
"binary": false,
"copies": "2",
"ref": "refs/heads/main",
"path": "src/image/SkRescaleAndReadPixels.cpp",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Assembly",
"bytes": "1277381"
},
{
"name": "Batchfile",
"bytes": "17474"
},
{
"name": "C",
"bytes": "6724920"
},
{
"name": "C#",
"bytes": "4683"
},
{
"name": "C++",
"bytes": "28759992"
},
{
"name": "CMake",
"bytes": "2850"
},
{
"name": "Cuda",
"bytes": "944096"
},
{
"name": "Dockerfile",
"bytes": "7142"
},
{
"name": "GLSL",
"bytes": "65328"
},
{
"name": "Go",
"bytes": "108521"
},
{
"name": "HTML",
"bytes": "1274414"
},
{
"name": "Java",
"bytes": "165376"
},
{
"name": "JavaScript",
"bytes": "110447"
},
{
"name": "Lex",
"bytes": "2458"
},
{
"name": "Lua",
"bytes": "70982"
},
{
"name": "Makefile",
"bytes": "10499"
},
{
"name": "Objective-C",
"bytes": "55140"
},
{
"name": "Objective-C++",
"bytes": "161861"
},
{
"name": "PHP",
"bytes": "128097"
},
{
"name": "Python",
"bytes": "1028767"
},
{
"name": "Shell",
"bytes": "63875"
}
],
"symlink_target": ""
}
|
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace SrkToolkit.Domain.Tests {
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()]
public class Strings {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Strings() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
public static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SrkToolkit.Domain.Tests.Strings", typeof(Strings).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)]
public static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized string similar to Error1 Hello.
/// </summary>
public static string Error1_Hello {
get {
return ResourceManager.GetString("Error1_Hello", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to WorldCode "{0}".
/// </summary>
public static string Error1_World {
get {
return ResourceManager.GetString("Error1_World", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to here is a format => {0} <=.
/// </summary>
public static string Lalala_Infinity {
get {
return ResourceManager.GetString("Lalala_Infinity", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to a.
/// </summary>
public static string Lalala_Many {
get {
return ResourceManager.GetString("Lalala_Many", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Hello World.
/// </summary>
public static string Lalala_One {
get {
return ResourceManager.GetString("Lalala_One", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to here is a format => {0} <=.
/// </summary>
public static string NestedClass_Lululu_Infinity {
get {
return ResourceManager.GetString("NestedClass_Lululu_Infinity", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to a.
/// </summary>
public static string NestedClass_Lululu_Many {
get {
return ResourceManager.GetString("NestedClass_Lululu_Many", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Hello World.
/// </summary>
public static string NestedClass_Lululu_One {
get {
return ResourceManager.GetString("NestedClass_Lululu_One", resourceCulture);
}
}
}
}
|
{
"content_hash": "9655d7ab5eb524063c84b419abecb6eb",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 174,
"avg_line_length": 39.474074074074075,
"alnum_prop": 0.547757553011822,
"repo_name": "sandrock/SrkToolkit",
"id": "8bc663b94cc6c3eb5e6be7410d4f26ce3efe53df",
"size": "5331",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Sources/NET4.SrkToolkit.Domain.Tests/Strings.Designer.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ASP",
"bytes": "113"
},
{
"name": "Batchfile",
"bytes": "7470"
},
{
"name": "C#",
"bytes": "1366007"
},
{
"name": "CSS",
"bytes": "1086"
},
{
"name": "HTML",
"bytes": "2114"
}
],
"symlink_target": ""
}
|
'use strict';
var path = require('path');
var gulp = require('gulp');
var del = require('del')
var slash = require('slash')
var gutil = require('gulp-util');
var chalk = require('chalk')
var gulpif = require('gulp-if');
var pkg = require('./package');
var sass = require('gulp-ruby-sass');
var minifycss = require('gulp-minify-css');
var scsslint = require('gulp-scss-lint');
var cache = require('gulp-cached');
var mem_cache = require('gulp-memory-cache');
var prefix = require('gulp-autoprefixer');
//useful for ES6 module loader
var rollup = require('rollup');
var uglify = require("gulp-uglify");
var glob = require('glob');
var fs = require('fs');
var q = require('q');
//useful for ES5 build
var concat = require('gulp-concat');
var insert = require('gulp-insert');
var foreach = require('gulp-foreach');
var es = require('event-stream');
var rename = require('gulp-rename');
var sourcemaps = require('gulp-sourcemaps');
var wrapper = require('gulp-wrapper');
var connect = require('gulp-connect');
var opn = require('opn');
var os = require('os');
var watch = require('gulp-watch');
var wait = require('gulp-wait');
var jade = require('gulp-jade');
var zip = require('gulp-zip');
var bump = require('gulp-bump');
// ----------------------------------------------------------------------------
// Config
// ----------------------------------------------------------------------------
var config = {
src: './src',
srcPreview: './preview',
dest: './build',
destLib: './build/dist',
destPreview: './build/preview',
destDownload: './build/download',
destDocs: './build/docs',
modules: './node_modules'
};
// ----------------------------------------------------------------------------
// Clean build folder
// ----------------------------------------------------------------------------
gulp.task('clean', function() {
return del([config.dest]);
});
gulp.task('clean:css', function() {
return del([path.join(config.destLib, '**/*.css')]);
});
gulp.task('clean:js', function() {
return del([
path.join(config.destLib, '**/*.js'),
path.join(config.destLib, '**/*.js.map')
]);
});
gulp.task('clean:indexes', function() {
return del([path.join(config.src, '**/_index.js')]);
});
gulp.task('clean:preview', function() {
return del([config.destPreview]);
});
gulp.task('clean:preview:html', function() {
return del([path.join(config.destPreview, '**/*.html')]);
});
gulp.task('clean:preview:styles', function() {
return del([path.join(config.destPreview, 'assets/css/main.css')]);
});
gulp.task('clean:preview:js', function() {
return del([path.join(config.destPreview, 'assets/js/*.js')]);
});
gulp.task('clean:preview:vendor', function() {
return del([path.join(config.destPreview, 'assets/vendor/**/*')]);
});
gulp.task('clean:preview:data', function() {
return del([path.join(config.destPreview, 'data')]);
});
// ----------------------------------------------------------------------------
// Styles
// ----------------------------------------------------------------------------
gulp.task('scss-lint', function() {
return gulp.src(path.join(config.src, '**/*.scss'))
.pipe(cache('scsslint'))
.pipe(scsslint())
.pipe(scsslint.failReporter())
.on('end', function() {
gutil.log(chalk.green("Linting SCSS... DONE!"));
});;
});
function compileSass(src, dest) {
return sass(src, {
style: 'compact'
})
.on('error', sass.logError)
.pipe(prefix("last 1 version", "> 1%", "ie 8", "ie 7"))
.pipe(minifycss())
.pipe(gulp.dest(dest));
}
gulp.task('styles', ['scss-lint', 'clean:css'], function() {
gutil.log(chalk.yellow("Building CSS..."));
return compileSass(path.join(config.src, 'assets/styles/vizabi.scss'), config.destLib)
.on('end', function() {
gutil.log(chalk.green("Building CSS... DONE!"))
});
});
// ----------------------------------------------------------------------------
// Javascript
// ----------------------------------------------------------------------------
function strToFile(string, name) {
var src = require('stream').Readable({
objectMode: true
});
src._read = function() {
this.push(new gutil.File({
cwd: "",
base: "",
path: name,
contents: new Buffer(string)
}));
this.push(null);
}
return src;
}
//TODO: better way to create index?
function buildImportIndex(folder, subfolder) {
var deferred = q.defer();
var search = (subfolder) ? '*/*.js' : '*.js';
var header = '//file automatically generated during build process\n';
//delete if exists
del(path.join(folder, '_index.js'));
glob(path.join(folder, search), {}, function(err, matches) {
var str_top = [],
str_middle = [],
str_btm = [];
for(var i = 0; i < matches.length; i++) {
var name = path.basename(matches[i], '.js');
var rel_path = slash(path.relative(folder, matches[i]));
str_top.push('import ' + name + ' from \'./' + rel_path + '\';');
str_middle.push(name + ',');
str_btm.push(name + ' : ' + name + ',');
}
str_top = str_top.join('\n');
str_middle = '\nexport {\n' + str_middle.join('\n') + '\n};';
str_btm = '\nexport default {\n' + str_btm.join('\n') + '\n};';
var contents = header + str_top + str_middle + str_btm;
fs.writeFileSync(path.join(folder, '_index.js'), contents);
deferred.resolve();
});
return deferred.promise;
}
function formatTemplateFile(str, filename) {
var content = str.replace(/'/g, '\"')
.replace(/(\r\n|\n|\r)/gm, " ")
.replace(/\s+/g, " ")
.replace(/<!--[\s\S]*?-->/g, "");
return "(function() {" +
"var root = this;" +
"var s = root.document.createElement('script');" +
"s.type = 'text/template';" +
"s.setAttribute('id', '" + filename + "');" +
"s.innerHTML = '" + content + "';" +
"root.document.body.appendChild(s);" +
"}).call(this);";
}
function getTemplates(cb) {
glob(path.join(config.src, '**/*.html'), {}, function(err, matches) {
var contents = [];
for(var i = 0; i < matches.length; i++) {
var data = fs.readFileSync(matches[i]).toString();
contents.push(formatTemplateFile(data, path.basename(matches[i])));
}
cb(contents.join(''));
});
}
//resolve path when finding modules
function resolvePath(id, importer, options) {
//if starts with ".", follow strict path
if(/^\./.test(id)) return path.resolve(path.dirname(importer), id).replace(/\.js$/, "") + ".js";
//else, try to find it
var importee = id.replace(/\.js$/, "");
var pat = path.join(config.src,'/**/',importee.replace(/\//g, '/**/')+'.js');
var match = glob.sync(pat);
if(match.length > 0) return path.resolve('./', match[0]);
else return id;
}
//build JS with banner and/or sourcemaps
//TODO: improve code quality
var buildLock = false;
function buildJS(dev, cb) {
buildLock = true;
getTemplates(function(templates) {
var banner_str = ['/**',
' * ' + pkg.name + ' - ' + pkg.description,
' * @version v' + pkg.version,
' * @link ' + pkg.homepage,
' * @license ' + pkg.license,
' */',
''
].join('\n');
//var version = '; Vizabi._version = "' + pkg.version + '";';
var version = ';(function (Vizabi) {Vizabi._version = "' + pkg.version + '";})(typeof Vizabi !== "undefined"?Vizabi:{});';
var options = {
format: 'umd',
banner: banner_str,
footer: version + templates,
moduleName: 'Vizabi',
dest: path.join(config.destLib, 'vizabi.js')
};
gutil.log(chalk.yellow("Bundling JS..."));
var entryFile = gutil.env.custom || 'gapminder';
entryFile = (entryFile != 'false') ? 'vizabi-' + entryFile + '.js' : 'vizabi.js';
gutil.log(chalk.yellow(" > entry file: " + entryFile));
rollup.rollup({
entry: './' + path.join(config.src, entryFile),
resolveId: resolvePath
}).then(function(bundle) {
if(dev) {
generateSourceMap(bundle, success);
} else {
generateMinified(bundle, success);
}
}, function(err) {
gutil.log(chalk.red("Bundling JS... ERROR!"));
gutil.log(chalk.red(err));
buildLock = false;
cb(false);
});
function generateSourceMap(bundle, cb) {
options.sourceMap = true;
bundle.write(options).then(cb);
}
function generateMinified(bundle, cb) {
var generated = bundle.generate(options);
strToFile(generated.code, 'vizabi.js')
.pipe(gulp.dest(config.destLib))
.pipe(uglify({
preserveComments: 'license'
}))
.pipe(rename('vizabi.min.js'))
.on('error', function(err) {
gutil.log(chalk.red("Bundling JS... ERROR!"));
gutil.log(err);
buildLock = false;
})
.pipe(gulp.dest(config.destLib))
.on('end', function() {
buildLock = false;
cb();
});
}
function success() {
gutil.log(chalk.green("Bundling JS... DONE!"));
buildLock = false;
cb();
}
});
}
gulp.task('buildIndexes', ['clean:indexes'], function() {
return q.all([
buildImportIndex(path.join(config.src, '/components/'), true),
buildImportIndex(path.join(config.src, '/components/buttonlist/dialogs'), true),
buildImportIndex(path.join(config.src, '/models/')),
buildImportIndex(path.join(config.src, '/readers/'))
]);
});
//with source maps
gulp.task('bundle', ['clean:js', 'buildIndexes'], function(cb) {
buildJS(true, cb);
});
gulp.task('buildJS', function() {
if (!buildLock)
gulp.run('bundle');
else
gutil.log(chalk.yellow('NEXT BUILD DISCONTINUED: previous build process is still running.'));
});
//without source maps and with banner
gulp.task('bundle:build', ['clean:js', 'buildIndexes'], function(cb) {
buildJS(false, cb);
});
// ----------------------------------------------------------------------------
// Preview page
// ----------------------------------------------------------------------------
gulp.task('preview:templates', ['clean:preview:html'], function() {
gutil.log(chalk.yellow("Compiling preview page..."));
return gulp.src(path.join(config.srcPreview, '*.jade'))
.pipe(jade())
.pipe(gulp.dest(config.destPreview))
.on('end', function() {
gutil.log(chalk.green("Compiling preview page... DONE!"))
});
});
gulp.task('preview:styles', ['clean:preview:styles'], function() {
gutil.log(chalk.yellow("Building preview CSS..."));
return compileSass(path.join(config.srcPreview, 'assets/css/main.scss'), path.join(config.destPreview,
'assets/css'))
.on('end', function() {
gutil.log(chalk.green("Building preview CSS... DONE!"))
});
});
gulp.task('preview:js', ['clean:preview:js'], function() {
gutil.log(chalk.yellow("Copying preview JS..."));
return gulp.src(path.join(config.srcPreview, 'assets/js/*.js'))
.pipe(gulp.dest(path.join(config.destPreview, 'assets/js')))
.on('end', function() {
gutil.log(chalk.green("Copying preview JS... DONE!"))
});
});
gulp.task('preview:vendor', ['clean:preview:vendor'], function() {
gulp.src(path.join(config.modules, 'font-awesome/css/font-awesome.min.css'))
.pipe(gulp.dest(path.join(config.destPreview, 'assets/vendor/css')));
gulp.src(path.join(config.modules, 'font-awesome/fonts/*'))
.pipe(gulp.dest(path.join(config.destPreview, 'assets/vendor/fonts')));
gulp.src(path.join(config.modules, 'd3/d3.min.js'))
.pipe(gulp.dest(path.join(config.destPreview, 'assets/vendor/js')));
});
gulp.task('preview:data', ['clean:preview:data'], function() {
gutil.log(chalk.yellow("Copying preview data..."));
return gulp.src('./.data/**/*')
.pipe(gulp.dest(path.join(config.destPreview, 'data')))
.on('end', function() {
gutil.log(chalk.green("Copying preview data... DONE!"))
});
});
var previewDeps = ['preview:templates', 'preview:styles', 'preview:js', 'preview:vendor'];
if(!gutil.env.faster) {
previewDeps.push('preview:data');
}
else {
gutil.log(chalk.yellow("DATA NOT CLEANED."));
}
gulp.task('preview', previewDeps, function(cb) {
return cb();
});
// ----------------------------------------------------------------------------
// Watch for changes
// ----------------------------------------------------------------------------
//reload only once every 3000ms
var reloadLock = false;
function notLocked() {
if(!reloadLock) {
setTimeout(function() {
reloadLock = false;
}, 3000);
reloadLock = true;
}
return reloadLock;
}
function reloadOnChange(files) {
watch(files)
.pipe(wait(800))
.pipe(gulpif(notLocked, connect.reload()));
}
gulp.task('watch', function() {
gulp.watch(path.join(config.srcPreview, '**/*.jade'), ['preview:templates']);
gulp.watch(path.join(config.srcPreview, '**/*.scss'), ['preview:styles']);
gulp.watch(path.join(config.srcPreview, '**/*.js'), ['preview:js']);
gulp.watch(path.join(config.src, '**/*.scss'), ['styles']);
gulp.watch([path.join(config.src, '**/*.js'), '!' + path.join(config.src, '**/_index.js')], ['buildJS']);
gulp.watch(path.join(config.src, '**/*.html'), ['buildJS']);
//reloading the browser
reloadOnChange(path.join(config.destPreview, '**/*.js'));
reloadOnChange(path.join(config.destPreview, '**/*.html'));
reloadOnChange(path.join(config.destPreview, '**/*.css'));
reloadOnChange(path.join(config.destLib, 'vizabi.css'));
reloadOnChange(path.join(config.destLib, 'vizabi.js'));
});
gulp.task('watch-lint', function() {
gulp.watch(path.join(config.src, '**/*.js'), ['eslint']);
});
// ----------------------------------------------------------------------------
// Web Server
// ----------------------------------------------------------------------------
gulp.task('connect', ['styles', 'bundle', 'preview'], function() {
var webserver = {
port: 9000,
root: config.dest,
livereload: true
};
var browser = os.platform() === 'linux' ? 'google-chrome' : (
os.platform() === 'darwin' ? 'google chrome' : (
os.platform() === 'win32' ? 'chrome' : 'firefox'));
connect.server(webserver);
opn('http://localhost:' + webserver.port + '/preview/', {
app: browser
});
});
// ----------------------------------------------------------------------------
// Compressed file (for download)
// ----------------------------------------------------------------------------
gulp.task('compress', ['styles', 'bundle:build', 'preview'], function() {
return gulp.src(path.join(config.destLib, '**/*'))
.pipe(zip('vizabi.zip'))
.pipe(gulp.dest(config.destDownload));
});
// ----------------------------------------------------------------------------
// Bump version
// ----------------------------------------------------------------------------
gulp.task('bump', function() {
var src = gulp.src(['./bower.json', './package.json']);
var version = gutil.env.version;
var type = gutil.env.type;
if(!version && !type) type = 'patch';
if(version) src = src.pipe(bump({
version: version
}));
else if(type) src = src.pipe(bump({
type: type
}));
return src.pipe(gulp.dest('./'));
});
// ----------------------------------------------------------------------------
// Command-line tasks
// ----------------------------------------------------------------------------
//Build Vizabi
gulp.task('build', ['compress']);
//Developer task without linting
gulp.task('dev', ['watch', 'connect']);
//Serve = build + connect
gulp.task('serve', ['build', 'connect']);
//Default = dev task
gulp.task('default', ['dev']);
|
{
"content_hash": "d10f0fd7f5dc7d007493be5990ea4414",
"timestamp": "",
"source": "github",
"line_count": 507,
"max_line_length": 126,
"avg_line_length": 30.67258382642998,
"alnum_prop": 0.5460099029001351,
"repo_name": "alliance-timur/vizabi",
"id": "f749750eb9264b610d92839e759205ae187a8531",
"size": "15551",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "gulpfile.js",
"mode": "33261",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "90209"
},
{
"name": "HTML",
"bytes": "28564"
},
{
"name": "JavaScript",
"bytes": "794150"
},
{
"name": "Shell",
"bytes": "1508"
}
],
"symlink_target": ""
}
|
<?php
namespace App\Http\Middleware;
use App\Basket\Merchant;
use Closure;
use Illuminate\Contracts\Auth\Guard;
/**
* Available Features
*
* @author GK
*/
class BetaParticipant
{
/**
* The Guard implementation.
*
* @var Guard
*/
protected $auth;
/**
* Create a new filter instance.
*
* @param Guard $auth
*/
public function __construct(Guard $auth)
{
$this->auth = $auth;
}
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
if ($this->auth->user()) {
if ($this->auth->user()->merchant_id) {
$merchant = Merchant::where('id', $this->auth->user()->merchant_id)->first();
view()->share('beta_participant', $merchant->beta_participant);
} else {
view()->share('beta_participant', true);
}
}
return $next($request);
}
}
|
{
"content_hash": "f42502d79284a237123bec1ad000e57a",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 93,
"avg_line_length": 20,
"alnum_prop": 0.5231481481481481,
"repo_name": "PayBreak/basket",
"id": "e33083e325ef5064a38a3c8d3dd5310a79cc0e71",
"size": "1080",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/Http/Middleware/BetaParticipant.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "2340"
},
{
"name": "HTML",
"bytes": "383294"
},
{
"name": "JavaScript",
"bytes": "187880"
},
{
"name": "PHP",
"bytes": "684725"
},
{
"name": "Shell",
"bytes": "954"
},
{
"name": "Vue",
"bytes": "138696"
}
],
"symlink_target": ""
}
|
"""Support for Verisure sensors."""
import logging
from homeassistant.components.verisure import HUB as hub
from homeassistant.components.verisure import (
CONF_THERMOMETERS, CONF_HYDROMETERS, CONF_MOUSE)
from homeassistant.const import TEMP_CELSIUS
from homeassistant.helpers.entity import Entity
_LOGGER = logging.getLogger(__name__)
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the Verisure platform."""
sensors = []
hub.update_overview()
if int(hub.config.get(CONF_THERMOMETERS, 1)):
sensors.extend([
VerisureThermometer(device_label)
for device_label in hub.get(
'$.climateValues[?(@.temperature)].deviceLabel')])
if int(hub.config.get(CONF_HYDROMETERS, 1)):
sensors.extend([
VerisureHygrometer(device_label)
for device_label in hub.get(
'$.climateValues[?(@.humidity)].deviceLabel')])
if int(hub.config.get(CONF_MOUSE, 1)):
sensors.extend([
VerisureMouseDetection(device_label)
for device_label in hub.get(
"$.eventCounts[?(@.deviceType=='MOUSE1')].deviceLabel")])
add_entities(sensors)
class VerisureThermometer(Entity):
"""Representation of a Verisure thermometer."""
def __init__(self, device_label):
"""Initialize the sensor."""
self._device_label = device_label
@property
def name(self):
"""Return the name of the device."""
return hub.get_first(
"$.climateValues[?(@.deviceLabel=='%s')].deviceArea",
self._device_label) + " temperature"
@property
def state(self):
"""Return the state of the device."""
return hub.get_first(
"$.climateValues[?(@.deviceLabel=='%s')].temperature",
self._device_label)
@property
def available(self):
"""Return True if entity is available."""
return hub.get_first(
"$.climateValues[?(@.deviceLabel=='%s')].temperature",
self._device_label) is not None
@property
def unit_of_measurement(self):
"""Return the unit of measurement of this entity."""
return TEMP_CELSIUS
# pylint: disable=no-self-use
def update(self):
"""Update the sensor."""
hub.update_overview()
class VerisureHygrometer(Entity):
"""Representation of a Verisure hygrometer."""
def __init__(self, device_label):
"""Initialize the sensor."""
self._device_label = device_label
@property
def name(self):
"""Return the name of the device."""
return hub.get_first(
"$.climateValues[?(@.deviceLabel=='%s')].deviceArea",
self._device_label) + " humidity"
@property
def state(self):
"""Return the state of the device."""
return hub.get_first(
"$.climateValues[?(@.deviceLabel=='%s')].humidity",
self._device_label)
@property
def available(self):
"""Return True if entity is available."""
return hub.get_first(
"$.climateValues[?(@.deviceLabel=='%s')].humidity",
self._device_label) is not None
@property
def unit_of_measurement(self):
"""Return the unit of measurement of this entity."""
return '%'
# pylint: disable=no-self-use
def update(self):
"""Update the sensor."""
hub.update_overview()
class VerisureMouseDetection(Entity):
"""Representation of a Verisure mouse detector."""
def __init__(self, device_label):
"""Initialize the sensor."""
self._device_label = device_label
@property
def name(self):
"""Return the name of the device."""
return hub.get_first(
"$.eventCounts[?(@.deviceLabel=='%s')].area",
self._device_label) + " mouse"
@property
def state(self):
"""Return the state of the device."""
return hub.get_first(
"$.eventCounts[?(@.deviceLabel=='%s')].detections",
self._device_label)
@property
def available(self):
"""Return True if entity is available."""
return hub.get_first(
"$.eventCounts[?(@.deviceLabel=='%s')]",
self._device_label) is not None
@property
def unit_of_measurement(self):
"""Return the unit of measurement of this entity."""
return 'Mice'
# pylint: disable=no-self-use
def update(self):
"""Update the sensor."""
hub.update_overview()
|
{
"content_hash": "38ce006fb43c0e0d4aae56e45ce19a7b",
"timestamp": "",
"source": "github",
"line_count": 153,
"max_line_length": 73,
"avg_line_length": 29.797385620915033,
"alnum_prop": 0.5900416758060978,
"repo_name": "nugget/home-assistant",
"id": "13706d8408f77ea9bb48784e1451053da8d87473",
"size": "4559",
"binary": false,
"copies": "2",
"ref": "refs/heads/dev",
"path": "homeassistant/components/verisure/sensor.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "1175"
},
{
"name": "Dockerfile",
"bytes": "1081"
},
{
"name": "HCL",
"bytes": "826"
},
{
"name": "Python",
"bytes": "14492390"
},
{
"name": "Ruby",
"bytes": "745"
},
{
"name": "Shell",
"bytes": "17526"
}
],
"symlink_target": ""
}
|
function out=prox_sum_k_largest(x,k,alpha)
%PROX_SUM_K_LARGEST computes the proximal operator of the function
% alpha*(sum of k largest values of x(:))
%
% Usage:
% out = PROX_SUM_K_LARGEST(x,k,alpha)
% ===========================================
% INPUT:
% x - point to be projected (vector/matrix)
% k - positive integer
% alpha - positive scalar
% ===========================================
% Assumptions:
% k in {1,...,length(x(:))}
% ===========================================
% Output:
% out - proximal operator at x
% This file is part of the FOM package - a collection of first order methods for solving convex optimization problems
% Copyright (C) 2017 Amir and Nili Beck
%
% 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.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with this program. If not, see <http://www.gnu.org/licenses/>.
if (nargin < 3)
error ('usage: prox_sum_k_largest(x,k,alpha)') ;
end
if (alpha < 0)
error('usage: prox_sum_k_largest(x,k,alpha) - alpha should be positive')
end
eps = 1e-10 ; % default value
if ((k < 1) || ( k > length(x(:))) || (abs(round(k) - k) > eps))
error('usage: prox_sum_k_largest(x,k,alpha) - k should be in {1,...,length(x(:))}')
end
out = x - alpha * proj_hyperplane_box(x/alpha,ones(size(x)),k,0,1) ; % proj_simplex (x/alpha,k,0,1) ;
end
|
{
"content_hash": "b166c325753268d1442d41f5f8e11e62",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 117,
"avg_line_length": 35.30769230769231,
"alnum_prop": 0.6258169934640523,
"repo_name": "hiroyuki-kasai/SGDLibrary",
"id": "77f4a634466e34af80665938575ffbddf95b5c87",
"size": "1836",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tool/FOM_prox functions/prox_sum_k_largest.m",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "36448"
},
{
"name": "HTML",
"bytes": "83089"
},
{
"name": "Makefile",
"bytes": "1240"
},
{
"name": "Matlab",
"bytes": "629938"
},
{
"name": "Terra",
"bytes": "1164628"
}
],
"symlink_target": ""
}
|
/* eslint-env browser: true */
import {defaults, find, get, wrap} from 'lodash';
import {debounce} from 'lodash-decorators';
import {parse} from 'sdp-transform';
import uuid from 'uuid';
import {WebexPlugin} from '@webex/webex-core';
import {
base64,
deprecated,
oneFlight,
retry,
tap,
whileInFlight
} from '@webex/common';
import {
USE_INCOMING,
FETCH
} from '@webex/internal-plugin-locus';
import WebRTCMediaEngine, {webrtcHelpers} from '@webex/media-engine-webrtc';
import {
waitForMediaShare,
getState,
getStatus,
getThisDevice,
isCall,
activeParticipants,
direction,
isActive,
joinedOnThisDevice,
makeInternalCallId,
participantsToCallMemberships
} from './state-parsers';
import boolToStatus from './bool-to-status';
import CallMemberships from './call-memberships';
import StatsFilter from './stats/filter';
import StatsStream from './stats/stream';
const {
boolToDirection
} = webrtcHelpers;
const deprecatedCallEventNames = [
'ringing',
'connected',
'disconnected',
'replaced'
];
/**
* Pulls the direction line for the specified media kind from an sdp
* @param {string} kind
* @param {string} sdp
* @private
* @returns {string}
*/
function getMediaDirectionFromSDP(kind, sdp) {
const parsed = typeof sdp === 'string' ? parse(sdp) : sdp;
let media;
if (kind === 'screen') {
media = parsed.media.find((m) => m.type === 'video' && m.content);
}
else {
media = parsed.media.find((m) => m.type === kind);
}
if (!media || !media.direction) {
return 'inactive';
}
return media.direction;
}
/**
* Reverses a media direction from offer to answer (e.g. sendonly -> recvonly)
* @param {string} dir
* @private
* @returns {string}
*/
function reverseMediaDirection(dir) {
switch (dir) {
case 'inactive':
case 'sendrecv':
return dir;
case 'sendonly':
return 'recvonly';
case 'recvonly':
return 'sendonly';
default:
throw new Error(`direction "${dir}" is not valid`);
}
}
const capitalize = {
audio: 'Audio',
video: 'Video'
};
/**
* @event ringing
* @instance
* @memberof Call
* @deprecated with {@link PhoneConfig.enableExperimentalGroupCallingSupport}
* enabled; instead, listen for {@link Call.membership:notified}
*/
/**
* @event connected
* @instance
* @memberof Call
* @deprecated with {@link PhoneConfig.enableExperimentalGroupCallingSupport}
* enabled; instead, listen for {@link Call.active}
*/
/**
* @event disconnected
* @instance
* @memberof Call
* @deprecated with {@link PhoneConfig.enableExperimentalGroupCallingSupport}
* enabled; instead, listen for {@link Call.inactive}
*/
/**
* @event active
* @instance
* @memberof Call
* @description only emitted if enableExperimentalGroupCallingSupport is enabled
*/
/**
* @event initializing
* @instance
* @memberof Call
* @description only emitted if enableExperimentalGroupCallingSupport is enabled
*/
/**
* @event inactive
* @instance
* @memberof Call
* @description only emitted if enableExperimentalGroupCallingSupport is enabled
*/
/**
* @event terminating
* @instance
* @memberof Call
* @description only emitted if enableExperimentalGroupCallingSupport is enabled
*/
/**
* @event localMediaStream:change
* @instance
* @memberof Call
*/
/**
* @event remoteMediaStream:change
* @instance
* @memberof Call
*/
/**
* @event error
* @instance
* @memberof Call
*/
/**
* @event membership:notified
* @instance
* @memberof Call
* @type {CallMembership}
* @description This replaces the {@link Call.ringing} event, but note that it's
* subtly different. {@link Call.ringing} is emitted when the remote party calls
* {@link Call#acknowledge()} whereas {@link Call.membership:notified} emits
* shortly after (but as a direct result of) locally calling
* {@link Phone#dial()}
*/
/**
* @event membership:connected
* @instance
* @memberof Call
* @type {CallMembership}
*/
/**
* @event membership:declined
* @instance
* @memberof Call
* @type {CallMembership}
*/
/**
* @event membership:disconnected
* @instance
* @memberof Call
* @type {CallMembership}
*/
/**
* @event membership:waiting
* @instance
* @memberof Call
* @type {CallMembership}
*/
/**
* @event membership:change
* @instance
* @memberof Call
* @type {CallMembership}
*/
/**
* @event memberships:add
* @instance
* @memberof Call
* @description Emitted when a new {@link CallMembership} is added to
* {@link Call#memberships}. Note that {@link CallMembership#state} still needs
* to be read to determine if the instance represents someone actively
* participating the call.
*/
/**
* @event memberships:remove
* @instance
* @memberof Call
* @description Emitted when a {@link CallMembership} is removed from
* {@link Call#memberships}.
*/
/**
* Payload for {@link Call#sendFeedback}
* @typedef {Object} FeedbackObject
* @property {number} userRating Number between 1 and 5 (5 being best) to let
* the user score the call
* @property {string} userComments Freeform feedback from the user about the
* call
* @property {Boolean} includeLogs set to true to submit client logs to the
* Webex Teams cloud. Note: at this time, all logs, not just call logs,
* generated by the sdk will be uploaded to the Webex Cloud. Care has been taken
* to avoid including PII in these logs, but if you've taken advantage of the
* SDK's logger, you should make sure to avoid logging PII as well.
*/
/**
* @class
*/
const Call = WebexPlugin.extend({
namespace: 'Phone',
mediaConnections: [],
children: {
media: WebRTCMediaEngine
},
collections: {
/**
* @instance
* @memberof Call
* @type CallMemberships
*/
memberships: CallMemberships
},
session: {
activeParticipantsCount: {
default: 0,
required: true,
type: 'number'
},
/**
* Indicates if the other party in the call has turned off their microphone.
* `undefined` for multiparty calls
* @instance
* @memberof Call
* @readonly
* @type {boolean}
*/
remoteAudioMuted: {
default: false,
required: false,
type: 'boolean'
},
/**
* Indicates if the other party in the call has turned off their camera.
* `undefined` for multiparty calls
* @instance
* @memberof Call
* @readonly
* @type {boolean}
*/
remoteVideoMuted: {
default: false,
required: false,
type: 'boolean'
},
correlationId: 'string',
/**
* @instance
* @memberof Call
* @readonly
* @type {string}
*/
facingMode: {
type: 'string',
values: ['user', 'environment']
},
/**
* Derived from locus.id and locus.fullState.lastActive. Not actually a
* "derived" property because it shouldn't be reset in event a locus
* replacement. Marked as private because this isn't necessarily the callId
* that we'll eventually expose as a first-class feature.
* @instance
* @memberof Call
* @private
* @readonly
* @type {string}
*/
internalCallId: {
setOnce: true,
type: 'string'
},
locus: 'object',
/**
* Returns the local MediaStream for the call. May initially be `null`
* between the time @{Phone#dial is invoked and the media stream is
* acquired if {@link Phone#dial} is invoked without a `localMediaStream`
* option.
*
* This property can also be set mid-call in which case the streams sent to
* the remote party are replaced by this stream. On success, the
* {@link Call}'s {@link localMediaStream:change} event fires, notifying any
* listeners that we are now sending media from a new source.
* @instance
* @memberof Call
* @type {MediaStream}
*/
localMediaStream: 'object',
locusJoinInFlight: {
default: false,
type: 'boolean'
},
locusLeaveInFlight: {
default: false,
type: 'boolean'
},
/**
* Test helper. Shortcut to the current user's membership object. not
* official for now, but may get published at some point
* @instance
* @memberof Call
* @private
* @type {CallMembership}
*/
me: {
type: 'object'
}
},
// Note, in its current form, any derived property that is an object will emit
// a change event everytime a locus gets replaced, even if no values change.
// For the moment, this is probably ok; once we have multi-party, regular
// change events on activeParticipants may be a problem.
derived: {
id: {
deps: ['locus'],
/**
* @private
* @returns {mixed}
*/
fn() {
return get(this, 'locus.url');
}
},
isActive: {
deps: ['locus'],
/**
* @private
* @returns {mixed}
*/
fn() {
return !!(this.locus && isActive(this.locus));
}
},
joinedOnThisDevice: {
deps: ['locus'],
default: false,
/**
* @private
* @returns {mixed}
*/
fn() {
return !!(this.locus && joinedOnThisDevice(this.webex, this.locus));
}
},
locusUrl: {
deps: ['locus'],
/**
* @private
* @returns {mixed}
*/
fn() {
return get(this, 'locus.url');
}
},
device: {
deps: ['locus'],
/**
* @private
* @returns {mixed}
*/
fn() {
return getThisDevice(this.webex, this.locus);
}
},
mediaConnection: {
deps: ['locus'],
/**
* @private
* @returns {mixed}
*/
fn() {
const device = getThisDevice(this.webex, this.locus);
return get(device, 'mediaConnections[0]');
}
},
mediaId: {
deps: ['locus'],
/**
* @private
* @returns {mixed}
*/
fn() {
const device = getThisDevice(this.webex, this.locus);
return get(device, 'mediaConnections[0].mediaId');
}
},
/**
* The other participant in a two-party call. `undefined` for multiparty
* calls
* @instance
* @memberof Call
* @readyonly
* @type {CallMembership}
*/
remoteMember: {
deps: [
'memberships',
'locus'
],
/**
* @private
* @returns {mixed}
*/
fn() {
if (isCall(this.locus)) {
return this.memberships.find((m) => !m.isSelf);
}
return undefined;
}
},
direction: {
deps: ['locus'],
/**
* @private
* @returns {mixed}
*/
fn() {
// This seems brittle, but I can't come up with a better way. The only
// way we should have a Call without a locus is if we just initiated a
// call but haven't got the response from locus yet.
if (!this.locus) {
return 'out';
}
return direction(this.locus);
}
},
/**
* The initiating participant in a two-party call.
* @deprecated The {@link Call#from} attribute will likely be replaced by
* the {@link Call#host}.
* @instance
* @memberof Call
* @readyonly
* @type {CallMembership}
*/
from: {
deps: [
'memberships'
],
/**
* @private
* @returns {mixed}
*/
fn() {
if (this.isCall) {
return this.memberships.find((m) => m.isInitiator);
}
return undefined;
}
},
to: {
deps: [
'memberships'
],
/**
* @private
* @returns {mixed}
*/
fn() {
if (this.isCall) {
return this.memberships.find((m) => !m.isInitiator);
}
return undefined;
}
},
/**
* <b>active</b> - At least one person (not necessarily this user) is
* participating in the call<br/>
* <b>inactive</b> - No one is participating in the call<br/>
* <b>initializing</b> - reserved for future use<br/>
* <b>terminating</b> - reserved for future use<br/>
* Only defined if
* {@link PhoneConfig.enableExperimentalGroupCallingSupport} has been
* enabled
* @instance
* @memberof Call
* @member {string}
* @readonly
*/
state: {
deps: [
'locus'
],
/**
* @private
* @returns {mixed}
*/
fn() {
if (this.config.enableExperimentalGroupCallingSupport) {
return getState(this.locus);
}
return undefined;
}
},
/**
* <b>initiated</b> - Offer was sent to remote party but they have not yet
* accepted <br>
* <b>ringing</b> - Remote party has acknowledged the call <br>
* <b>connected</b> - At least one party is still on the call <br>
* <b>disconnected</b> - All parties have dropped <br>
* <b>replaced</b> - In (hopefully) rare cases, the underlying data backing
* a Call instance may change in such a way that further interaction with
* that Call is handled by a different instance. In such cases, the first
* Call's status, will transition to `replaced`, which is almost the same
* state as `disconnected`. Generally speaking, such a transition should not
* happen for a Call instance that is actively sending/receiving media.
* @deprecated The {@link Call#status} attribute will likely be replaced by
* the {@link Call#state}.
* @instance
* @memberof Call
* @member {string}
* @readonly
*/
status: {
deps: [
'locus'
],
/**
* @private
* @returns {mixed}
*/
fn() {
return getStatus(this.webex, this.locus, this.previousAttributes().locus);
}
},
/**
* The host of the call
* Only defined if
* {@link PhoneConfig.enableExperimentalGroupCallingSupport} has been
* enabled
* @instance
* @memberof Call
* @readyonly
* @type {object}
*/
host: {
deps: [
'locus'
],
/**
* @private
* @returns {mixed}
*/
fn() {
if (this.config.enableExperimentalGroupCallingSupport) {
return this.locus.host;
}
return undefined;
}
},
/**
* The room id of the call
* Only defined if
* {@link PhoneConfig.enableExperimentalGroupCallingSupport} has been
* enabled
* @instance
* @memberof Call
* @readyonly
* @type {object}
*/
roomId: {
deps: [
'locus'
],
/**
* @private
* @returns {mixed}
*/
fn() {
if (this.config.enableExperimentalGroupCallingSupport && this.locus.conversationUrl) {
return base64.encode(`ciscospark://us/ROOM/${this.locus.conversationUrl.split('/').pop()}`);
}
return undefined;
}
},
/**
* Access to the remote party’s `MediaStream`.
* @instance
* @memberof Call
* @member {MediaStream}
* @readonly
*/
remoteMediaStream: {
deps: ['media.remoteMediaStream'],
/**
* @private
* @returns {mixed}
*/
fn() {
return this.media.remoteMediaStream;
}
},
/**
* Access to the local party’s screen share `MediaStream`.
* @instance
* @memberof Call
* @member {MediaStream}
* @readonly
*/
localScreenShare: {
deps: ['media.localScreenShare'],
/**
* @private
* @returns {mixed}
*/
fn() {
return this.media.localScreenShare;
}
},
receivingAudio: {
deps: ['media.receivingAudio'],
/**
* @private
* @returns {mixed}
*/
fn() {
return this.media.receivingAudio;
}
},
receivingVideo: {
deps: ['media.receivingVideo'],
/**
* @private
* @returns {mixed}
*/
fn() {
return this.media.receivingVideo;
}
},
sendingAudio: {
deps: ['media.sendingAudio'],
/**
* @private
* @returns {mixed}
*/
fn() {
return this.media.sendingAudio;
}
},
sendingVideo: {
deps: ['media.sendingVideo'],
/**
* @private
* @returns {mixed}
*/
fn() {
return this.media.sendingVideo;
}
},
isCall: {
deps: ['locus'],
/**
* @private
* @returns {mixed}
*/
fn() {
return isCall(this.locus);
}
},
supportsDtmf: {
deps: ['locus'],
/**
* @private
* @returns {mixed}
*/
fn() {
return get(this, 'locus.self.enableDTMF');
}
}
},
@oneFlight
/**
* Use to acknowledge (without answering) an incoming call. Will cause the
* initiator's Call instance to emit the ringing event.
* @instance
* @memberof Call
* @returns {Promise}
*/
acknowledge() {
this.logger.info('call: acknowledging');
return this.webex.internal.locus.alert(this.locus)
.then((locus) => this.setLocus(locus))
.then(tap(() => this.logger.info('call: acknowledged')));
},
@oneFlight
@whileInFlight('locusJoinInFlight')
// Note: the `whileInFlight` decorator screws up name inferrence, so we need
// to include @name below.
/**
* Answers an incoming call.
* @instance
* @name answer
* @memberof Call
* @param {Object} options
* @param {MediaStreamConstraints} options.constraints
* @returns {Promise}
*/
answer(options) {
this.logger.info('call: answering');
if (!this.locus) {
this.logger.info('call: no locus provided, answer() is a noop');
return Promise.resolve();
}
// Locus may think we're joined on this device if we e.g. reload the page,
// so, we need to check if we also have a working peer connection
// this.media.pc.remoteDescription.sdp is a temporary proxy for
// pc.connectionState until chrome catches up to the spec
if (this.joinedOnThisDevice && this.media.pc.remoteDescription && this.media.pc.remoteDescription.sdp) {
this.logger.info('call: already joined on this device');
return Promise.resolve();
}
return this.createOrJoinLocus(this.locus, options)
.then(tap(() => this.logger.info('call: answered')));
},
/**
* Change the receiving media state. may induce a renegoatiation
* @instance
* @memberof Call
* @param {string} kind one of "audio" or "video"
* @param {boolean} value
* @private
* @returns {Promise}
*/
changeReceivingMedia(kind, value) {
return new Promise((resolve) => {
const sdp = parse(this.media.offerSdp);
const section = find(sdp.media, {type: kind});
// If the current offer is going to trigger a renegotiation, then we don't
// need to renegotiate here.
if (!section || !section.direction.includes('recv')) {
this.logger.info('changeReceivingMedia: expecting to renegotiate, waiting for media to emit "answeraccepted"');
this.media.once('answeraccepted', () => resolve());
}
else {
this.logger.info(`changeReceivingMedia: expecting to renegotiate, waiting for call to emit "change:receiving${capitalize[kind]}"`);
this.once(`change:receiving${capitalize[kind]}`, () => resolve());
}
const newDirection = boolToStatus(this.media[`sending${capitalize[kind]}`], value);
console.warn(`starting to setMedia ${kind} to ${newDirection}`);
this.media.setMedia(kind, newDirection);
});
},
/**
* Change the receiving media state. may induce a renegoatiation
* @instance
* @memberof Call
* @param {string} kind one of "audio" or "video"
* @param {boolean} value
* @private
* @returns {Promise}
*/
changeSendingMedia(kind, value) {
// Changing media direction only should not trigger renegotiation as long as a new
// track is not introduced. If that is the case we would expect renegotiation to happen.
this.logger.info(`changeSendingMedia: changing sending "${kind}" to "${value}"`);
if (['audio', 'video'].includes(kind)) {
const tracks = this.media.senderTracks.filter((t) => t.kind === kind);
const newDirection = boolToStatus(value, this.media[`receiving${capitalize[kind]}`]);
if (tracks.length > 0) {
// track already exists, we only need to toggle direction
return this.media.setMedia(kind, newDirection)
.then(() => this.updateMuteToggles(kind, value));
}
// adding a new track and needs renegotiation
return new Promise((resolve) => {
this.once('mediaNegotiationCompleted', () => resolve());
this.media.setMedia(kind, newDirection);
});
}
return Promise.reject(new Error('kind must be one of "audio" or "video"'));
},
/**
* Does the cleanup after a call has ended
* @instance
* @memberof Call
* @private
* @returns {Promise}
*/
cleanup() {
return new Promise((resolve) => {
// need to do this on next tick otherwise this.off() prevents remaining
// events from being received (e.g. other listeners for `disconnected`
// won't execute)
process.nextTick(() => {
this.media.stop();
this.stopListening(this.webex.internal.mercury);
this.off();
resolve();
});
});
},
// The complexity in createOrJoinLocus is largely driven up by fairly readable `||`s
/* eslint-disable complexity */
@oneFlight
/**
* Call and answer require nearly identical logic, so this method unifies them.
* @instance
* @memberof Call
* @param {Object|locus} target
* @param {Object} options
* @todo remove 'locusMethodName' and move that logic to locus plugin
* @todo move options and target processing to separate function
* @todo rename to join()?
* @returns {Promise}
*/
createOrJoinLocus(target, options = {}) {
if (options.localMediaStream) {
this.localMediaStream = options.localMediaStream;
}
else {
if (!options.constraints) {
options.constraints = {
audio: true,
video: {
facingMode: {
ideal: this.webex.phone.defaultFacingMode
}
}
};
}
const mode = get(options, 'constraints.video.facingMode.ideal', get(options, 'constraints.video.facingMode.exact'));
if (mode === 'user' || mode === 'environment') {
this.facingMode = mode;
}
const recvOnly = !options.constraints.audio && !options.constraints.video;
options.offerOptions = defaults(options.offerOptions, {
offerToReceiveAudio: recvOnly || !!options.constraints.audio,
offerToReceiveVideo: recvOnly || !!options.constraints.video
});
if (options.constraints.fake) {
this.media.constraints.fake = true;
}
this.media.setMedia('audio', boolToStatus(options.constraints.audio, options.offerOptions.offerToReceiveAudio), options.constraints.audio);
if (get(options, 'constraints.video.mediaSource') === 'screen' || get(options, 'constraints.video.mediaSource') === 'application') {
this.media.setMedia('screen', 'sendonly');
}
else {
this.media.setMedia('video', boolToStatus(options.constraints.video, options.offerOptions.offerToReceiveVideo), options.constraints.video);
}
}
if (!target.correlationId) {
options.correlationId = uuid.v4();
this.correlationId = options.correlationId;
}
if (!this.correlationId) {
this.correlationId = target.correlationId;
}
// reminder: not doing this copy in initialize() because config may not yet
// be available
this.media.bandwidthLimit = {
audioBandwidthLimit: this.config.audioBandwidthLimit,
videoBandwidthLimit: this.config.videoBandwidthLimit
};
return this.media.createOffer()
.then(tap(() => this.logger.info('created offer')))
.then(() => this.webex.internal.locus.createOrJoin(target, Object.assign({
localSdp: this.media.offerSdp,
correlationId: this.correlationId
}, options)))
.then(tap(() => this.logger.info('sent offer to locus')))
.then(tap(() => this.logger.info('setting locus')))
.then((locus) => this.setLocus(locus))
.then(tap(() => this.logger.info('successfully set locus')))
.then(() => {
const answer = this.mediaConnection.remoteSdp ?
JSON.parse(this.mediaConnection.remoteSdp).sdp :
JSON.parse(this.mediaConnections.remoteSdp).sdp;
this.logger.info('accepting answer');
this.logger.info('peer state', this.media.pc && this.media.pc.signalingState);
if (!this.media.ended) {
return this.media.acceptAnswer(answer)
.then(() => this.logger.info('answer accepted'))
.catch((err) => {
this.logger.error('failed to accept answer', err);
return Promise.reject(err);
});
}
this.logger.info('call: already ended, not accepting answer');
return Promise.resolve();
});
},
/* eslint-enable complexity */
@deprecated('Please use Call#reject()')
/**
* Alias of {@link Call#reject}
* @see {@link Call#reject}
* @instance
* @memberof Call
* @returns {Promise}
*/
decline() {
return this.reject();
},
@oneFlight
/**
* Used by {@link Phone#dial} to initiate an outbound call
* @instance
* @memberof Call
* @param {[type]} invitee
* @param {[type]} options
* @private
* @returns {[type]}
*/
dial(invitee, options) {
this.locusJoinInFlight = true;
this.logger.info('call: dialing');
let target = invitee;
if (base64.validate(invitee)) {
// eslint-disable-next-line no-unused-vars
const parsed = base64.decode(invitee).split('/');
const resourceType = parsed[3];
const id = parsed[4];
const feature = this.webex.internal.feature.getFeature('developer', 'web-high-availability');
if (resourceType === 'PEOPLE') {
target = id;
}
if (resourceType === 'ROOM') {
if (!get(this, 'config.enableExperimentalGroupCallingSupport')) {
throw new Error('Group calling is not enabled. Please enable config.phone.enableExperimentalGroupCallingSupport');
}
if (feature && feature.value) {
this.webex.internal.device.getServiceUrl('conversation')
.then((u) => {
target = {
url: `${u}/conversations/${id}/locus`
};
return target;
});
}
else {
target = {
url: `${this.webex.internal.device.services.conversationServiceUrl}/conversations/${id}/locus`
};
}
}
}
// Note: mercury.connect() will call device.register() if needed. We're not
// using phone.register() here because it guarantees a device refresh, which
// is probably unnecessary.
this.webex.internal.mercury.connect()
.then(() => this.createOrJoinLocus(target, options))
.then(tap(() => this.logger.info('call: dialed')))
.catch((reason) => {
this.trigger('error', reason);
})
.then(() => {
this.locusJoinInFlight = false;
});
return this;
},
/**
* Returns a {@link Readable} that emits {@link Call#media.pc}'s
* {@link RTCStatsReport} every second.
* @instance
* @memberof Call
* @returns {StatsStream}
*/
getRawStatsStream() {
return new StatsStream(this.media.pc);
},
/**
* Returns a {@link StatsStream} piped through a {@link StatsFilter}
* @instance
* @memberof Call
* @returns {Readable}
*/
getStatsStream() {
return this.getRawStatsStream()
.pipe(new StatsFilter());
},
/**
* Disconnects the active call. Applies to both incoming and outgoing calls.
* This method may be invoked in any call state and the SDK should take care
* to tear down the call and free up all resources regardless of the state.
* @instance
* @memberof Call
* @returns {Promise}
*/
hangup() {
// Note: not a @oneFlight because this function must call itself
if (this.direction === 'in' && !this.joinedOnThisDevice) {
return this.reject();
}
this.logger.info('call: hanging up');
this.media.stop();
if (this.locusJoinInFlight) {
this.logger.info('call: locus join in flight, waiting for rest call to complete before hanging up');
return this.when('change:locusJoinInFlight')
.then(() => this.hangup());
}
if (!this.locus) {
return this.cleanup()
.then(() => this.logger.info('call: hang up complete, call never created'));
}
return this.leave();
},
/**
* Initializer
* @instance
* @memberof Call
* @private
* @param {Object} attrs
* @param {Object} options
* @returns {undefined}
*/
initialize(...initArgs) {
Reflect.apply(WebexPlugin.prototype.initialize, this, initArgs);
this.on('change:activeParticipantsCount', (...args) => this.onChangeActiveParticipantsCount(...args));
// This handler is untested because there's no way to provoke it. It's
// probably actually only relevant for group calls.
this.on('change:isActive', (...args) => this.onChangeIsActive(...args));
this.on('change:localMediaStream', (...args) => this.onChangeLocalMediaStream(...args));
// Reminder: this is not a derived property so that we can reassign the
// stream midcall
this.on('change:media.localMediaStream', () => {
this.localMediaStream = this.media.localMediaStream;
});
this.on('change:remoteMember', (...args) => this.onChangeRemoteMember(...args));
[
'localMediaStream',
'remoteAudioMuted',
'remoteMediaStream',
'remoteVideoMuted',
'localScreenShare'
].forEach((key) => {
this.on(`change:${key}`, () => this.trigger(`${key}:change`));
});
this.on('replaced', () => this.cleanup());
this.listenTo(this.memberships, 'add', (...args) => this.trigger('memberships:add', ...args));
this.listenTo(this.memberships, 'change', (...args) => this.trigger('membership:change', ...args));
this.listenTo(this.memberships, 'change:audioMuted', (...args) => this.onMembershipsAudioMuted(...args));
this.listenTo(this.memberships, 'change:state', (...args) => this.onMembershipsChangeState(...args));
this.listenTo(this.memberships, 'change:videoMuted', (...args) => this.onMembershipsVideoMuted(...args));
this.listenTo(this.memberships, 'remove', (...args) => this.trigger('memberships:remove', ...args));
this.listenTo(this.webex.internal.mercury, 'event:locus', (event) => this.onLocusEvent(event));
this.listenTo(this.webex.internal.mercury, 'event:locus.difference', (event) => this.onLocusEvent(event));
this.listenTo(this.media, 'error', (error) => this.trigger('error', error));
this.listenTo(this.media, 'internalTrackUpdate', () => {
this.trigger('remoteMediaStream:change');
});
this.listenTo(this.media, 'negotiationneeded', (...args) => this.onMediaNegotiationNeeded(...args));
if (this.locus) {
this.internalCallId = makeInternalCallId(this.locus);
}
else {
this.once('change:locus', () => {
this.internalCallId = makeInternalCallId(this.locus);
});
}
this.memberships.listenToAndRun(this, 'change:locus', () => {
if (this.locus && this.locus.participants) {
// Reminder: we're parsing here instead of CallMembership(s) so that we
// can avoid making those classes webex aware and therefore keep them a
// lot simpler
this.memberships.set(participantsToCallMemberships(this.webex, this.locus));
this.me = this.memberships.find((m) => m.isSelf);
}
});
if (this.config.enableExperimentalGroupCallingSupport) {
this.on('inactive', () => this.hangup());
this.on('inactive', () => this.cleanup());
this.on('change:state', () => {
process.nextTick(() => this.trigger(this.state));
});
this.on = wrap(this.on, (fn, eventName, ...rest) => {
if (deprecatedCallEventNames.includes(eventName)) {
throw new Error(`The "${eventName}" event is no longer valid with "enableExperimentalGroupCallingSupport===true"`);
}
return Reflect.apply(fn, this, [eventName, ...rest]);
});
}
else {
this.on('disconnected', () => this.hangup());
this.on('disconnected', () => this.cleanup());
this.on('change:status', () => {
process.nextTick(() => this.trigger(this.status));
});
}
},
@oneFlight
@whileInFlight('locusLeaveInFlight')
/**
* Does the internal work necessary to end a call while allowing hangup() to
* call itself without getting stuck in promise change because of oneFlight
* The name of this function is temporary to address the no-underscore-dangle
* rule. A future commit in this PR will rename all of the
* reject/end/hangup/finish functions to be more meaningful and not just be
* synonyms the same word.
* @private
* @instance
* @memberof Call
* @returns {Promise}
*/
leave() {
this.logger.info('leave: attempting to leave locus');
const status = get(this, this.config.enableExperimentalGroupCallingSupport ? 'me.state' : 'status');
if (status === 'disconnected') {
this.logger.info('already hung up, not calling locus again');
return Promise.resolve();
}
if (status === 'declined') {
this.logger.info('call was declined, not leaving again');
return Promise.resolve();
}
if (status !== 'connected') {
this.logger.info('call is neither connected, disconnected, or declined, declining instead of leaving');
return this.decline();
}
this.logger.info('leave: leaving locus');
return this.webex.internal.locus.leave(this.locus)
.catch((err) => {
this.logger.error('leave: locus leave error: ', err.stack || err.toString());
return Promise.reject(err);
})
.then(tap(() => this.logger.info(`leave ${this.locus.id}: finished leaving via locus`)))
.then(tap(() => this.logger.info(`leave ${this.locus.id}: setting locus`)))
.then((locus) => this.setLocus(locus))
.then(tap(() => this.logger.info(`leave ${this.locus.id}: finished setting locus`)))
// Note: not stopping event-listening here; that'll happening
// automatically when `disconnected` fires.
.then(tap(() => this.logger.info('call: hung up')));
},
/**
* Handles an incoming mercury event if relevant to this call.
* @instance
* @memberof Call
* @param {Types~MercuryEvent} event
* @private
* @returns {undefined}
*/
onLocusEvent(event) {
const devices = get(event, 'data.locus.self.devices');
const device = devices && find(devices, (item) => item.url === this.webex.internal.device.url);
const internalCallId = this.locus && makeInternalCallId(event.data.locus);
if (internalCallId === this.internalCallId || device && this.correlationId === device.correlationId) {
this.logger.info(`locus event: ${event.data.eventType}`);
this.setLocus(event.data.locus);
}
if (event.data.locus.replaces) {
for (const replaced of event.data.locus.replaces) {
if (`${replaced.locusUrl}_${replaced.lastActive}` === this.internalCallId) {
this.setLocus(event.data.locus);
this.logger.info(`locus replacement event: ${event.data.eventType}`, this.locusUrl, '->', event.data.locus.url);
return;
}
}
}
},
/**
* Event handler
* @instance
* @memberof Call
* @private
* @returns {undefined}
*/
onMembershipsAudioMuted() {
this.logger.info('onMembershipsAudioMuted');
if (this.remoteMember) {
this.remoteAudioMuted = this.remoteMember.audioMuted;
}
},
/**
* Event handler
* @instance
* @memberof Call
* @private
* @returns {undefined}
*/
onMembershipsVideoMuted() {
this.logger.info('onMembershipsVideoMuted');
if (this.remoteMember) {
this.remoteVideoMuted = this.remoteMember.videoMuted;
}
},
/**
* Event handler
* @instance
* @memberof Call
* @private
* @returns {undefined}
*/
onChangeRemoteMember() {
if (this.remoteMember) {
this.remoteAudioMuted = this.remoteMember.audioMuted;
this.remoteVideoMuted = this.remoteMember.videoMuted;
}
else {
this.remoteAudioMuted = undefined;
this.remoteVideoMuted = undefined;
}
},
/**
* Event handler
* @instance
* @memberof Call
* @param {Membership} model
* @private
* @returns {undefined}
*/
onMembershipsChangeState(model) {
this.activeParticipantsCount = this
.memberships
.filter((m) => m.state === 'connected')
.length;
this.trigger(`membership:${model.state}`, model);
},
@debounce()
/**
* Event handler
* @instance
* @memberof Call
* @private
* @returns {undefined}
*/
onMediaNegotiationNeeded() {
this.logger.info('onMediaNegotiationNeeded');
this.media.createOffer()
.then(() => {
// Determine mute state for locus from sdp
const offer = parse(this.media.offerSdp);
const audioOfferDir = getMediaDirectionFromSDP('audio', offer);
const audioMuted = !audioOfferDir.includes('send');
const videoOfferDir = getMediaDirectionFromSDP('video', offer);
const videoMuted = !videoOfferDir.includes('send');
const screenOfferDir = getMediaDirectionFromSDP('screen', offer);
this.logger.info(`onMediaNegotiationNeeded: audioOfferDir=${audioOfferDir} videoOfferDir=${videoOfferDir} screenOfferDir=${screenOfferDir}`);
this.logger.info(`onMediaNegotiationNeeded: audioMuted=${audioMuted} videoMuted=${videoMuted}`);
const updateMediaOptions = {
sdp: this.media.offerSdp,
mediaId: this.mediaId,
audioMuted,
videoMuted
};
return this.updateMedia(updateMediaOptions);
})
.then(() => this.pollForExpectedLocusAndSdp())
.then(() => {
const {sdp} = JSON.parse(this.mediaConnection.remoteSdp);
return this.media.acceptAnswer(sdp);
})
.then(() => this.emit('mediaNegotiationCompleted'))
.catch((reason) => this.emit('error', reason));
},
/**
* Event handler
* @instance
* @memberof Call
* @private
* @returns {undefined}
*/
onChangeLocalMediaStream() {
if (this.localMediaStream && this.localMediaStream !== this.media.localMediaStream) {
[
'audio',
'video'
]
.forEach((kind) => {
// eslint-disable-next-line max-nested-callbacks
const track = this.localMediaStream.getTracks().find((t) => t.kind === kind);
if (track) {
this.media.setMedia(kind, boolToStatus(track.enabled, this[`receiving${capitalize[kind]}`]), track);
}
else {
this.media.setMedia(kind, boolToStatus(false, this[`receiving${capitalize[kind]}`]));
}
});
this.localMediaStream = this.media.localMediaStream;
}
},
/**
* Event handler
* @instance
* @memberof Call
* @private
* @returns {undefined}
*/
onChangeIsActive() {
if (!this.isActive) {
if (this.joinedOnThisDevice) {
this.logger.info('call: hanging up due to locus going inactive');
this.hangup();
}
}
},
/**
* Event handler
* @instance
* @memberof Call
* @private
* @returns {undefined}
*/
onChangeActiveParticipantsCount() {
if (!this.joinedOnThisDevice) {
return;
}
if (this.activeParticipantsCount !== 1) {
return;
}
if (this.isCall && !this.config.hangupIfLastActive.call) {
return;
}
if (!this.isCall && !this.config.hangupIfLastActive.meeting) {
return;
}
const previousLocus = this.previousAttributes().locus;
if (!previousLocus) {
return;
}
if (activeParticipants(previousLocus).length > 1) {
this.logger.info('call: hanging up due to last participant in call');
this.hangup();
}
},
@retry
/**
* The response to a PUT to LOCUS/media may not be fully up-to-date when we
* receive it. This method polls locus until we get a locus with the status
* properties we expect (or three errors occur)
* @instance
* @memberof Call
* @private
* @returns {Promise<Types~Locus>}
*/
pollForExpectedLocusAndSdp() {
return new Promise((resolve, reject) => {
const offer = parse(this.media.offerSdp);
const audioOfferDir = getMediaDirectionFromSDP('audio', offer);
const videoOfferDir = getMediaDirectionFromSDP('video', offer);
const screenOfferDir = getMediaDirectionFromSDP('screen', offer);
const self = this;
let count = 0;
const validate = () => {
count += 1;
try {
this.logger.info(`iteration ${count}: checking if current locus sdp has the expected audio and video directions`);
if (isExpectedDirection(JSON.parse(this.mediaConnection.remoteSdp).sdp)) {
this.logger.info(`iteration ${count}: the current locus sdp has the expected audio and video directions`);
try {
this.logger.info(`iteration ${count}: checking if current locus has the expected audio and video directions`);
this.validateLocusMediaState(this.locus);
this.logger.info(`iteration ${count}: the current locus has the expected audio and video directions; not syncing`);
resolve();
return;
}
catch (err) {
this.logger.info(`iteration ${count}: the current locus does not have the expected audio and video directions; syncing`);
}
}
else {
this.logger.info(`iteration ${count}: the current locus sdp does not have the expected audio and video directions; syncing`);
}
if (count > 4) {
reject(new Error(`After ${count} attempts polling locus`));
return;
}
setTimeout(() => this.webex.internal.locus.sync(this.locus)
.then((locus) => this.setLocus(locus))
.then(validate)
.catch(reject), 1000 * (2 ** count));
}
catch (err) {
reject(err);
}
};
validate();
/**
* Determine if the incoming sdp has the expected media directions
* @private
* @param {string} sdp
* @returns {boolean}
*/
function isExpectedDirection(sdp) {
const answer = parse(sdp);
const audioAnswerDir = getMediaDirectionFromSDP('audio', answer);
const videoAnswerDir = getMediaDirectionFromSDP('video', answer);
const screenAnswerDir = getMediaDirectionFromSDP('screen', answer);
const expectedAudioAnswerDir = reverseMediaDirection(audioOfferDir);
const expectedVideoAnswerDir = reverseMediaDirection(videoOfferDir);
const expectedScreenAnswerDir = reverseMediaDirection(screenOfferDir);
self.logger.info(`audio: ${audioOfferDir}, ${audioAnswerDir}, ${expectedAudioAnswerDir}`);
self.logger.info(`video: ${videoOfferDir}, ${videoAnswerDir}, ${expectedVideoAnswerDir}`);
self.logger.info(`screen: ${screenOfferDir}, ${screenAnswerDir}, ${expectedScreenAnswerDir}`);
// eslint-disable-next-line max-len
return audioAnswerDir === expectedAudioAnswerDir && videoAnswerDir === expectedVideoAnswerDir && screenAnswerDir === expectedScreenAnswerDir;
}
});
},
/**
* Tells locus we're done sharing some or all of our screen.
* @instance
* @memberof Call
* @private
* @returns {Promise}
*/
releaseFloor() {
this.logger.info('call: releasing floor grant');
return Promise.resolve()
.then(waitForMediaShare(this))
.then((mediaShare) => this.webex.internal.locus.releaseFloorGrant(this.locus, mediaShare));
},
@oneFlight
/**
* Rejects an incoming call. Only applies to incoming calls. Invoking this
* method on an outgoing call is a no-op.
* @instance
* @memberof Call
* @returns {Promise}
*/
reject() {
if (this.direction === 'out') {
return Promise.resolve();
}
this.logger.info('call: rejecting');
/* eslint no-invalid-this: [0] */
return this.webex.internal.locus.decline(this.locus)
.then((locus) => this.setLocus(locus))
.then(tap(() => this.cleanup()))
.then(tap(() => this.logger.info('call: rejected')));
},
/**
* Tells locus we'd like to share some or all of our screen.
* @instance
* @memberof Call
* @private
* @returns {Promise}
*/
requestFloor() {
this.logger.info('call: requesting floor grant');
return Promise.resolve()
.then(waitForMediaShare(this))
.then((mediaShare) => this.webex.internal.locus.requestFloorGrant(this.locus, mediaShare));
},
/**
* Assigns a new locus to this.locus according to locus sequencing rules
* @instance
* @memberof Call
* @param {Types~Locus} incoming
* @param {boolean} recursing - when true, indicates that this method has
* called itself and we should fall back to {@link locus.get()} instead of
* calling {@link locus.sync()}
* @private
* @returns {Promise}
*/
setLocus(incoming, recursing = false) {
const current = this.locus;
if (!current) {
this.locus = incoming;
return Promise.resolve();
}
if (
'self' in current && 'self' in incoming &&
current.self.devices[0] &&
'mediaConnections' in current.self.devices[0] &&
incoming.self.state !== 'LEFT'
) {
if (
'remoteSdp' in current.self.devices[0].mediaConnections[0] &&
!('remoteSdp' in incoming.self.devices[0].mediaConnections[0])
) {
incoming.self.devices.map((item, index) => {
item.mediaConnections = [current.self.devices[index].mediaConnections[index]];
return item;
});
this.setLocus(incoming);
}
else if (
!('remoteSdp' in current.self.devices[0].mediaConnections[0]) &&
'remoteSdp' in incoming.self.devices[0].mediaConnections[0]
) {
this.mediaConnections = incoming.self.devices[0].mediaConnections[0];
this.locus.self.devices.map((item, index) => {
item.mediaConnections = [incoming.self.devices[index].mediaConnections[index]];
return item;
});
this.setLocus(incoming);
}
}
const action = this.webex.internal.locus.compare(current, incoming);
switch (action) {
case USE_INCOMING:
this.locus = this.webex.internal.locus.merge(this.locus, incoming);
if (this.device) {
this.correlationId = this.device.correlationId;
}
break;
case FETCH:
if (recursing) {
this.logger.info('call: fetching locus according to sequencing algorithm');
return this.webex.internal.locus.get(current)
.then((locus) => this.setLocus(locus, true));
}
this.logger.info('call: syncing locus according to sequencing algorithm');
return this.webex.internal.locus.sync(current)
.then((locus) => this.setLocus(locus, true));
default:
// do nothing
}
return Promise.resolve();
},
/**
* Send DTMF tones to the current call
* @instance
* @memberof Call
* @param {string} tones
* @returns {Promise}
*/
sendDtmf(tones) {
if (!this.supportsDtmf) {
return Promise.reject(new Error('this call does not support dtmf'));
}
return this.webex.internal.locus.sendDtmf(this.locus, tones);
},
/**
* Sends feedback about the call to the Webex Teams cloud
* @instance
* @memberof Call
* @param {FeedbackObject} feedback
* @returns {Promise}
*/
sendFeedback(feedback) {
return this.webex.internal.metrics.submit('meetup_call_user_rating', feedback);
},
/**
* Shares a particular application as a second stream in the call
* @returns {Promise}
*/
startApplicationShare() {
this.logger.info('call: sharing application');
return new Promise((resolve) => {
this.media.once('answeraccepted', resolve);
this.media.setMedia('screen', 'sendonly', {
mediaSource: 'application'
});
})
.then(() => this.requestFloor());
},
/**
* Shares the whole screen as a second stream in the call
* @returns {Promise}
*/
startScreenShare() {
this.logger.info('call: sharing screen');
return new Promise((resolve) => {
this.media.once('answeraccepted', resolve);
this.media.setMedia('screen', 'sendonly', {
mediaSource: 'screen'
});
})
.then(() => this.requestFloor());
},
/**
* Start receiving audio
* @instance
* @memberof Call
* @returns {Promise}
*/
startReceivingAudio() {
return this.changeReceivingMedia('audio', true);
},
/**
* Start receiving video
* @instance
* @memberof Call
* @returns {Promise}
*/
startReceivingVideo() {
return this.changeReceivingMedia('video', true);
},
/**
* Starts sending audio to the Webex Teams Cloud
* @instance
* @memberof Call
* @returns {Promise}
*/
startSendingAudio() {
return this.changeSendingMedia('audio', true);
},
/**
* Starts sending video to the Webex Teams Cloud
* @instance
* @memberof Call
* @returns {Promise}
*/
startSendingVideo() {
return this.changeSendingMedia('video', true);
},
/**
* Stops sharing an application or whole screen media stream
* @returns {Promise}
*/
stopScreenShare() {
this.logger.info('call: stopping screen/application share');
return this.releaseFloor()
.then(() => new Promise((resolve) => {
this.media.once('answeraccepted', resolve);
this.media.setMedia('screen', 'inactive');
}));
},
/**
* Stop receiving audio
* @instance
* @memberof Call
* @returns {Promise}
*/
stopReceivingAudio() {
return this.changeReceivingMedia('audio', false);
},
/**
* Stop receiving video
* @instance
* @memberof Call
* @returns {Promise}
*/
stopReceivingVideo() {
return this.changeReceivingMedia('video', false);
},
/**
* Stops sending audio to the Webex Teams Cloud. (stops broadcast immediately,
* even if renegotiation has not completed)
* @instance
* @memberof Call
* @returns {Promise}
*/
stopSendingAudio() {
return this.changeSendingMedia('audio', false);
},
/**
* Stops sending video to the Webex Teams Cloud. (stops broadcast immediately,
* even if renegotiation has not completed)
* @instance
* @memberof Call
* @returns {Promise}
*/
stopSendingVideo() {
return this.changeSendingMedia('video', false);
},
/**
* Replaces the current mediaStrem with one with identical constraints, except
* for an opposite facing mode. If the current facing mode cannot be
* determined, the facing mode will be set to `user`. If the call is audio
* only, this function will throw.
* @instance
* @memberof Call
* @returns {undefined}
*/
toggleFacingMode() {
if (!this.sendingVideo) {
throw new Error('Cannot toggle facingMode if we\'re not sending video');
}
if (this.facingMode !== 'user' && this.facingMode !== 'environment') {
throw new Error('Cannot determine current facing mode; specify a new localMediaStream to change cameras');
}
const constraint = {
facingMode: {
ideal: this.facingMode === 'user' ? 'environment' : 'user'
}
};
// Constraint changes that don't result in a new sender does not trigger renegotiate
// We now use replaceTrack to swap in a new media
return this.media.setMedia('video', boolToStatus(this.sendingAudio, this.sendingVideo), constraint)
.then(() => {
this.facingMode = constraint.facingMode.ideal;
});
},
/**
* Toggles receiving audio from the Webex Teams Cloud
* @instance
* @memberof Call
* @returns {Promise}
*/
toggleReceivingAudio() {
return this.receivingAudio ? this.stopReceivingAudio() : this.startReceivingAudio();
},
/**
* Toggles receiving video from the Webex Teams Cloud
* @instance
* @memberof Call
* @returns {Promise}
*/
toggleReceivingVideo() {
return this.receivingVideo ? this.stopReceivingVideo() : this.startReceivingVideo();
},
/**
* Toggles sending audio to the Webex Teams Cloud
* @instance
* @memberof Call
* @returns {Promise}
*/
toggleSendingAudio() {
return this.sendingAudio ? this.stopSendingAudio() : this.startSendingAudio();
},
/**
* Toggles sending video to the Webex Teams Cloud
* @instance
* @memberof Call
* @returns {Promise}
*/
toggleSendingVideo() {
return this.sendingVideo ? this.stopSendingVideo() : this.startSendingVideo();
},
/**
* Changes the status of media
* @instance
* @memberof Call
* @param {Object} payload
* @private
* @returns {Promise}
*/
updateMedia(payload) {
this.logger.info('updateMedia');
if (payload.sdp && !payload.sdp.includes('b=')) {
throw new Error('outbound sdp should always have a \'b=\' line');
}
return this.webex.internal.locus.updateMedia(this.locus, payload)
.then((locus) => this.setLocus(locus));
},
/**
* Updates sdp with correct video status
* @instance
* @memberof Call
* @param {string} sdp
* @param {boolean} isMuted
* @private
* @returns {Promise}
*/
updateVideoMuteSdp(sdp, isMuted) {
const newDir = boolToDirection(!isMuted, this.receivingVideo);
const oldDir = boolToDirection(isMuted, this.receivingVideo);
return sdp.replace(new RegExp(`a=mid:video[^a]+a=${oldDir}`, 'gi'), `a=mid:video\na=${newDir}`);
},
@oneFlight
/**
* Tells locus we've got a new media direction
* @instance
* @memberof Call
* @param {string} kind of 'audio' or 'video'
* @param {boolean} value
* @private
* @returns {Promise}
*/
updateMuteToggles(kind, value) {
this.logger.info(`updating mute toggles: ${kind}=${value}`);
const payload = {
mediaId: this.mediaId,
audioMuted: !this.sendingAudio,
videoMuted: !this.sendingVideo
};
if (kind === 'audio') {
payload.audioMuted = !value;
}
else if (kind === 'video') {
payload.videoMuted = !value;
payload.sdp = this.updateVideoMuteSdp(this.media.offerSdp, !value);
}
return this.updateMedia(payload);
},
/**
* Checks that this.locus has the expected state
* @instance
* @memberof Call
* @param {Types~Locus} locus
* @private
* @returns {Promise}
*/
validateLocusMediaState(locus) {
const locusAudio = locus.self.status.audioStatus.toLowerCase();
const mediaAudio = this.media.audioDirection;
if (locusAudio !== mediaAudio) {
this.logger.warn(`locus: expected audio ${locusAudio} (locus) to equal ${mediaAudio} (local media)`);
throw new Error('locus.self.status.audioStatus indicates the received DTO is out of date');
}
const locusVideo = locus.self.status.videoStatus.toLowerCase();
const mediaVideo = this.media.videoDirection;
if (locusVideo !== mediaVideo) {
this.logger.warn(`locus: expected video ${locusVideo} (locus) to equal ${mediaVideo} (local media)`);
throw new Error('locus.self.status.videoStatus indicates the received DTO is out of date');
}
return locus;
},
/**
* Waits until this.locus describes the expected state
* @instance
* @memberof Call
* @private
* @returns {Promise}
*/
waitForExpectedLocus() {
return new Promise((resolve) => {
const listener = () => {
try {
this.validateLocusMediaState(this.locus);
this.off('change:locus', listener);
resolve();
}
catch (err) {
this.logger.warn('locus: current locus not in expected state; waiting for next locus');
}
};
this.on('change:locus', listener);
listener();
});
}
});
Call.make = function make(attrs, options) {
return new Call(attrs, options);
};
export default Call;
|
{
"content_hash": "50f99cb65b6633d4dffffc4fb7e3cd3a",
"timestamp": "",
"source": "github",
"line_count": 2047,
"max_line_length": 149,
"avg_line_length": 27.68295065950171,
"alnum_prop": 0.6095434732736866,
"repo_name": "bbender/spark-js-sdk",
"id": "f0876a4aa48bd45d97fd9f7d9fd5d82b692961f9",
"size": "56743",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "packages/node_modules/@webex/plugin-phone/src/call.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Dockerfile",
"bytes": "877"
},
{
"name": "JavaScript",
"bytes": "112240"
},
{
"name": "Python",
"bytes": "4743"
},
{
"name": "Shell",
"bytes": "21329"
}
],
"symlink_target": ""
}
|
ModuleSite.SearchModule = ModuleSite.SearchModule || (function () {
var _args;
var self = this;
return {
init: function (args) {
_args = $.extend({
}, args);
},
start: function () {
//Critères de recherche
var searchCriterias = {
code: ko.observable(),
description: ko.observable(),
url: ko.observable(),
ExportExcel: ko.observable(false)
}
$('#' + Static.SearchPanelAccordionID).accordion({ header: 'h3', animate: false });
var searchViewModel = function () {
var self = this;
self.criterias = searchCriterias;
self.vueID = _args.vueID;
self.panelID = _args.panelID;
self.search = function () {
ko.postbox.publish(Enums.PostboxNotifiers.SearchFilter, ko.toJS(self.criterias));
};
self.clear = function () {
self.criterias.code('');
self.criterias.description('');
self.criterias.url('');
self.criterias.ExportExcel(false);
};
//Abonnement aux actions générales
ko.postbox.subscribe(Enums.PostboxNotifiers.ActionGeneralExecution, function (data) {
if (Vars.CurrentVue.vueID == self.vueID && Vars.CurrentVue.panelID == self.panelID) {
alert('Droits.Search action générale : ' + JSON.stringify(Vars.CurrentVue) + ' - ' + self.vueID + ' - ' + self.panelID);
}
});
//Abonnement aux mises à jour des fiches
ko.postbox.subscribe(Enums.PostboxNotifiers.AGUpdated, function () {
self.search();
});
};
//Results panel
var grid = $("#" + Static.SearchGridResultsID).jqGrid(Func.GetjqGridOptions({
pager: Static.SearchGridResultsPagerID,
colNames: [Func.translate('ID'), Func.translate('CODE'), Func.translate('DESCRIPTION'), Func.translate('URL_SITE')],
colModel: [{ name: 'ID', width: '130px', key: true, sorttype: 'int', hidden: true }, { name: 'Code' }, { name: 'Description' }, {name: 'Url'}],
onSelectRow: function (rowid, iRow, iCol, e) {
var rowdata = $(this).getRowData(rowid);
ko.postbox.publish(Enums.PostboxNotifiers.NewTabAdd, {
id: rowid,
title: Utils.formatPanelTitle(Func.translate("LOADING") + '...', 'italic'),
url: Func.getUrl("SITE_DETAILS", { id: rowid, vueID: null }),
groupeVueID: Resources.GroupeVue.SiteDetails
});
}
})).jqGrid('navGrid', "#" + Static.SearchGridResultsPagerID, { search: false, edit: false, add: false, del: false, refresh: false });
var resultsViewModel = function () {
var self = this;
self.data = ko.observableArray([]);
ko.postbox.subscribe(Enums.PostboxNotifiers.SearchFilter, function (criterias) {
grid.jqGrid('clearGridData').jqGrid('setGridParam', { datatype: 'json', url: Func.getUrl("SITE_RECHERCHE"), postData: criterias }).trigger('reloadGrid');
});
};
ko.applyBindings(new searchViewModel(), document.getElementById(Static.SearchPanelFilterID));
ko.applyBindings(new resultsViewModel(), document.getElementById(Static.SearchPanelResultsID));
}
};
}());
|
{
"content_hash": "8c423ed616ed5c06bc00d609ccd312cc",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 173,
"avg_line_length": 49.06410256410256,
"alnum_prop": 0.5079696890514763,
"repo_name": "apo-j/Projects_Working",
"id": "f2868f9eb773126e420fdaa3f2decac76937bcde",
"size": "3835",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Bivi/src/Bivi.BackOffice/Bivi.BackOffice.Web/JsModules/Administration/Site/SearchModule.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "16118"
},
{
"name": "Batchfile",
"bytes": "1096"
},
{
"name": "C#",
"bytes": "27262375"
},
{
"name": "CSS",
"bytes": "8474090"
},
{
"name": "Groff",
"bytes": "2101703"
},
{
"name": "HTML",
"bytes": "4910101"
},
{
"name": "JavaScript",
"bytes": "20716565"
},
{
"name": "PHP",
"bytes": "9283"
},
{
"name": "XSLT",
"bytes": "930531"
}
],
"symlink_target": ""
}
|
package mockit;
import javax.security.auth.callback.*;
import javax.security.auth.login.*;
import static org.junit.Assert.*;
import org.junit.*;
import mockit.internal.state.*;
public final class MockitTest
{
private Class<?> classRedefined;
static class RealClass
{
int doSomething() { return 1; }
}
@Test
public void redefineMethodsWithEmptyMockClass()
{
Mockit.setUpMock(RealClass.class, EmptyMockClass.class);
assertEquals(0, TestRun.mockFixture().getRedefinedClassCount());
assertEquals(0, TestRun.getMockClasses().getRegularMocks().getInstanceCount());
assertEquals(1, new RealClass().doSomething());
assertEquals(2, new EmptyMockClass().utilityMethod());
}
public static class EmptyMockClass
{
int utilityMethod() { return 2; }
}
@Test
public void redefineMethodsWithMockClass()
{
classRedefined = RealClass.class;
Mockit.setUpMock(RealClass.class, MockClass.class);
assertClassRedefined();
assertEquals(0, TestRun.getMockClasses().getRegularMocks().getInstanceCount());
}
public static class MockClass
{
@Mock
public int doSomething() { return -1; }
}
private void assertClassRedefined()
{
assertEquals(1, TestRun.mockFixture().getRedefinedClassCount());
assertTrue(TestRun.mockFixture().containsRedefinedClass(classRedefined));
}
@Test
public void redefineMethodsWithMockInstance()
{
classRedefined = RealClass.class;
MockClass mockInstance = new MockClass();
Mockit.setUpMock(RealClass.class, mockInstance);
assertClassRedefined();
assertEquals(1, TestRun.getMockClasses().getRegularMocks().getInstanceCount());
assertTrue(TestRun.getMockClasses().getRegularMocks().containsInstance(mockInstance));
}
@Test(expected = IllegalArgumentException.class)
public void redefineMethodsWithMockMethodForNoCorrespondingRealMethod()
{
Mockit.setUpMock(RealClass.class, MockClassWithMethodWithoutRealMethod.class);
}
public static class MockClassWithMethodWithoutRealMethod
{
@Mock
public void doSomethingElse() {}
}
@Test(expected = IllegalArgumentException.class)
public void redefineMethodsWithIncompatibleReturnTypeBetweenRealAndMockMethod()
{
Mockit.setUpMock(RealClass2.class, MockClassWithIncompatibleReturnType.class);
// Force the compiler to generate a synthetic "String access$0(RealClass2)" method:
new RealClass2().dummy();
}
@SuppressWarnings({"InnerClassMayBeStatic"})
class RealClass2
{
@SuppressWarnings({"UnusedDeclaration"})
private String dummy() { return null; }
}
public static class MockClassWithIncompatibleReturnType
{
@Mock
public int dummy() { return 0; }
}
@Test
public void restoreOriginalDefinition()
{
Mockit.setUpMock(RealClass.class, MockClass.class);
Mockit.tearDownMocks(RealClass.class);
assertEquals(0, TestRun.mockFixture().getRedefinedClassCount());
}
@Test
public void restoreOriginalDefinitionWithClassNotRedefined()
{
Mockit.tearDownMocks(RealClass.class);
assertEquals(0, TestRun.mockFixture().getRedefinedClassCount());
}
@Test
public void restoreAllDefinitions()
{
Mockit.setUpMock(RealClass.class, new MockClass());
Mockit.tearDownMocks();
assertEquals(0, TestRun.mockFixture().getRedefinedClassCount());
assertEquals(0, TestRun.getMockClasses().getRegularMocks().getInstanceCount());
}
public interface SomeInterface
{
int method1();
long method2(int i);
boolean method3(String s, boolean b);
String method4();
double method5();
float method6();
char method7();
byte method8();
short method9();
int doSomething();
}
@Test
public void createClassWithNewEmptyProxy()
{
SomeInterface proxy = Mockit.newEmptyProxy(SomeInterface.class);
assertNotNull(proxy);
assertEquals(0, proxy.method1());
assertEquals(0L, proxy.method2(4));
assertFalse(proxy.method3(null, true));
assertNull(proxy.method4());
assertEquals(0.0, proxy.method5(), 0.0);
assertEquals(0.0F, proxy.method6(), 0.0);
assertEquals('\0', proxy.method7());
assertEquals((byte) 0, proxy.method8());
assertEquals((short) 0, proxy.method9());
}
@Test
public void createEmptyProxyForJREInterface()
{
Runnable proxy = Mockit.newEmptyProxy(null, Runnable.class);
proxy.run();
}
@Test
public void redefineMethodsInProxyClass()
{
SomeInterface proxy = Mockit.newEmptyProxy(SomeInterface.class);
classRedefined = proxy.getClass();
Mockit.setUpMock(classRedefined, MockClass.class);
assertClassRedefined();
}
@Test
public void callEqualsMethodOnEmptyProxy()
{
SomeInterface proxy1 = Mockit.newEmptyProxy(SomeInterface.class);
SomeInterface proxy2 = Mockit.newEmptyProxy(SomeInterface.class);
//noinspection SimplifiableJUnitAssertion
assertTrue(proxy1.equals(proxy1));
assertFalse(proxy1.equals(proxy2));
assertFalse(proxy2.equals(proxy1));
//noinspection ObjectEqualsNull
assertFalse(proxy1.equals(null));
}
@Test
public void callHashCodeMethodOnEmptyProxy()
{
SomeInterface proxy = Mockit.newEmptyProxy(SomeInterface.class);
assertEquals(System.identityHashCode(proxy), proxy.hashCode());
}
@Test
public void callToStringMethodOnEmptyProxy()
{
SomeInterface proxy = Mockit.newEmptyProxy(SomeInterface.class);
assertEquals(proxy.getClass().getName() + '@' + Integer.toHexString(proxy.hashCode()), proxy.toString());
}
@Test
public void mockJREMethodAndConstructor() throws Exception
{
Mockit.setUpMock(LoginContext.class, new MockLoginContext());
new LoginContext("test", (CallbackHandler) null).login();
}
public static class MockLoginContext
{
@Mock
public void $init(String name, CallbackHandler callbackHandler)
{
assertEquals("test", name);
assertNull(callbackHandler);
}
@Mock
public void login() {}
}
}
|
{
"content_hash": "0af2bdbf4f33502db57e0ad5726925b7",
"timestamp": "",
"source": "github",
"line_count": 234,
"max_line_length": 111,
"avg_line_length": 27.735042735042736,
"alnum_prop": 0.6644067796610169,
"repo_name": "borisbrodski/jmockit",
"id": "de8bd63a1998460797067128fa200d868c8e8a2c",
"size": "6621",
"binary": false,
"copies": "1",
"ref": "refs/heads/JUnitRuleSupport",
"path": "main/test/mockit/MockitTest.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "2617406"
},
{
"name": "JavaScript",
"bytes": "7998"
}
],
"symlink_target": ""
}
|
package es.tid.topologyModuleBase.COPServiceTopology.client.auth;
import java.util.Map;
import es.tid.topologyModuleBase.COPServiceTopology.client.Pair;
import java.util.List;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-05-27T13:24:30.808+02:00")
public class OAuth implements Authentication {
@Override
public void applyToParams(List<Pair> queryParams, Map<String, String> headerParams) {
// TODO: support oauth
}
}
|
{
"content_hash": "efda56a1043d193ee3911508c3de274c",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 131,
"avg_line_length": 32.8,
"alnum_prop": 0.782520325203252,
"repo_name": "telefonicaid/netphony-topology",
"id": "5ca1935e2fec884ae48586ed29a464989a3d1daa",
"size": "492",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/es/tid/topologyModuleBase/COPServiceTopology/client/auth/OAuth.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "23101"
},
{
"name": "Java",
"bytes": "1425382"
},
{
"name": "Makefile",
"bytes": "2058"
}
],
"symlink_target": ""
}
|
from ..abstract_dma_controller import AbstractDMAController
from ......utils.override import overrides
from m5.objects import MessageBuffer
class DMAController(AbstractDMAController):
"""
A DMA Controller for use in the MI_Example cache hierarchy setup.
"""
class DMAController(AbstractDMAController):
def __init__(self, network, cache_line_size):
super().__init__(network, cache_line_size)
@overrides(AbstractDMAController)
def connectQueues(self, network):
self.mandatoryQueue = MessageBuffer()
self.requestToDir = MessageBuffer()
self.requestToDir.out_port = network.in_port
self.responseFromDir = MessageBuffer(ordered=True)
self.responseFromDir.in_port = network.out_port
|
{
"content_hash": "e3b47979dca39f02d5ddd1074d7cb4e0",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 69,
"avg_line_length": 34.81818181818182,
"alnum_prop": 0.7075718015665796,
"repo_name": "gem5/gem5",
"id": "fb6895f4f8109b6b1cac86bc62fb64bb50681b60",
"size": "2316",
"binary": false,
"copies": "1",
"ref": "refs/heads/stable",
"path": "src/python/gem5/components/cachehierarchies/ruby/caches/mi_example/dma_controller.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Assembly",
"bytes": "145626"
},
{
"name": "Awk",
"bytes": "3386"
},
{
"name": "BASIC",
"bytes": "2884"
},
{
"name": "C",
"bytes": "3927153"
},
{
"name": "C++",
"bytes": "42960484"
},
{
"name": "CMake",
"bytes": "133888"
},
{
"name": "Dockerfile",
"bytes": "34102"
},
{
"name": "Emacs Lisp",
"bytes": "1914"
},
{
"name": "Forth",
"bytes": "354"
},
{
"name": "Fortran",
"bytes": "15436"
},
{
"name": "HTML",
"bytes": "146414"
},
{
"name": "Hack",
"bytes": "139769"
},
{
"name": "Java",
"bytes": "6966"
},
{
"name": "M4",
"bytes": "42624"
},
{
"name": "Makefile",
"bytes": "39573"
},
{
"name": "Perl",
"bytes": "23784"
},
{
"name": "Python",
"bytes": "8079781"
},
{
"name": "Roff",
"bytes": "8754"
},
{
"name": "SCSS",
"bytes": "2971"
},
{
"name": "SWIG",
"bytes": "173"
},
{
"name": "Scala",
"bytes": "5328"
},
{
"name": "Shell",
"bytes": "95638"
},
{
"name": "Starlark",
"bytes": "25668"
},
{
"name": "SuperCollider",
"bytes": "8869"
},
{
"name": "Vim Script",
"bytes": "4343"
},
{
"name": "sed",
"bytes": "3897"
}
],
"symlink_target": ""
}
|
"""Top-level presubmit script for V8.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmit API built into gcl.
"""
def _V8PresubmitChecks(input_api, output_api):
"""Runs the V8 presubmit checks."""
import sys
sys.path.append(input_api.os_path.join(
input_api.PresubmitLocalPath(), 'tools'))
from presubmit import CppLintProcessor
from presubmit import SourceProcessor
results = []
if not CppLintProcessor().Run(input_api.PresubmitLocalPath()):
results.append(output_api.PresubmitError("C++ lint check failed"))
if not SourceProcessor().Run(input_api.PresubmitLocalPath()):
results.append(output_api.PresubmitError(
"Copyright header, trailing whitespaces and two empty lines " \
"between declarations check failed"))
return results
def _CommonChecks(input_api, output_api):
"""Checks common to both upload and commit."""
results = []
results.extend(input_api.canned_checks.CheckOwners(
input_api, output_api, source_file_filter=None))
results.extend(_V8PresubmitChecks(input_api, output_api))
return results
def _SkipTreeCheck(input_api, output_api):
"""Check the env var whether we want to skip tree check.
Only skip if src/version.cc has been updated."""
src_version = 'src/version.cc'
FilterFile = lambda file: file.LocalPath() == src_version
if not input_api.AffectedSourceFiles(
lambda file: file.LocalPath() == src_version):
return False
return input_api.environ.get('PRESUBMIT_TREE_CHECK') == 'skip'
def CheckChangeOnUpload(input_api, output_api):
results = []
results.extend(_CommonChecks(input_api, output_api))
return results
def CheckChangeOnCommit(input_api, output_api):
results = []
results.extend(_CommonChecks(input_api, output_api))
results.extend(input_api.canned_checks.CheckChangeHasDescription(
input_api, output_api))
if not _SkipTreeCheck(input_api, output_api):
results.extend(input_api.canned_checks.CheckTreeIsOpen(
input_api, output_api,
json_url='http://v8-status.appspot.com/current?format=json'))
return results
|
{
"content_hash": "2c2d576814aac54db1bc2e9ff276953e",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 75,
"avg_line_length": 35.766666666666666,
"alnum_prop": 0.7264678471575023,
"repo_name": "h0x91b/redis-v8",
"id": "75e16e3bd79df3876e046983ee9c645cde0c9be0",
"size": "3718",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "redis/deps/v8/PRESUBMIT.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "3522778"
},
{
"name": "C++",
"bytes": "37327587"
},
{
"name": "CSS",
"bytes": "7201"
},
{
"name": "JavaScript",
"bytes": "14084294"
},
{
"name": "Lua",
"bytes": "25752"
},
{
"name": "Objective-C",
"bytes": "470"
},
{
"name": "PHP",
"bytes": "455118"
},
{
"name": "Perl",
"bytes": "170502"
},
{
"name": "Python",
"bytes": "528990"
},
{
"name": "Ruby",
"bytes": "32982"
},
{
"name": "Scheme",
"bytes": "10604"
},
{
"name": "Shell",
"bytes": "97117"
},
{
"name": "Tcl",
"bytes": "303718"
},
{
"name": "XSLT",
"bytes": "303"
}
],
"symlink_target": ""
}
|
<?php
namespace TwBundle\Filter;
use AppBundle\Entity\Medewerker;
use AppBundle\Filter\FilterInterface;
use AppBundle\Filter\KlantFilter;
use AppBundle\Form\Model\AppDateRangeModel;
use Doctrine\ORM\QueryBuilder;
use TwBundle\Entity\Klant;
use TwBundle\Entity\Project;
class HuurovereenkomstFilter implements FilterInterface
{
/**
* @var int
*/
public $id;
/**
* @var AppDateRangeModel
*/
public $startdatum;
/**
* @var AppDateRangeModel
*/
public $opzegdatum;
/**
* @var AppDateRangeModel
*/
public $einddatum;
/**
* @var string
*/
public $vorm;
/**
* @var AppDateRangeModel
*/
public $afsluitdatum;
/**
* @var string
*/
public $actief = 'lopend';
/**
* @var bool
*/
public $isReservering;
/** @var AppDateRangeModel */
public $aanmelddatum;
/**
* @var bool
*/
public $opzegbriefVerstuurd;
/**
* @var Klant
*/
public $klant;
/**
* @var KlantFilter
*/
public $appKlant;
/**
* @var KlantFilter
*/
public $verhuurderKlant;
/**
* @var Medewerker
*/
public $medewerker;
/**
* @var Project
*/
public $project;
public function applyTo(QueryBuilder $builder)
{
if ($this->id) {
$builder
->andWhere('huurovereenkomst.id = :huurovereenkomst_id')
->setParameter('huurovereenkomst_id', $this->id)
;
}
if ($this->startdatum) {
if ($this->startdatum->getStart()) {
$builder
->andWhere('huurovereenkomst.startdatum >= :startdatum_van')
->setParameter('startdatum_van', $this->startdatum->getStart())
;
}
if ($this->startdatum->getEnd()) {
$builder
->andWhere('huurovereenkomst.startdatum <= :startdatum_tot')
->setParameter('startdatum_tot', $this->startdatum->getEnd())
;
}
}
if ($this->opzegdatum) {
if ($this->opzegdatum->getStart()) {
$builder
->andWhere('huurovereenkomst.opzegdatum >= :opzegdatum_van')
->setParameter('opzegdatum_van', $this->opzegdatum->getStart())
;
}
if ($this->opzegdatum->getEnd()) {
$builder
->andWhere('huurovereenkomst.opzegdatum <= :opzegdatum_tot')
->setParameter('opzegdatum_tot', $this->opzegdatum->getEnd())
;
}
}
if ($this->einddatum) {
if ($this->einddatum->getStart() && !$this->einddatum->getEnd()) {
$builder
->andWhere('huurovereenkomst.einddatum >= :einddatum_van OR huurovereenkomst.einddatum IS NULL')
->setParameter('einddatum_van', $this->einddatum->getStart())
;
}
elseif($this->einddatum->getStart())
{
$builder
->andWhere('huurovereenkomst.einddatum >= :einddatum_van')
->setParameter('einddatum_van', $this->einddatum->getStart())
;
}
if ($this->einddatum->getEnd()) {
$builder
->andWhere('huurovereenkomst.einddatum <= :einddatum_tot')
->setParameter('einddatum_tot', $this->einddatum->getEnd())
;
}
}
if ($this->vorm) {
$builder
->andWhere('huurovereenkomst.vorm = :vorm')
->setParameter('vorm', $this->vorm)
;
}
if ($this->afsluitdatum) {
if ($this->afsluitdatum->getStart()) {
$builder
->andWhere('huurovereenkomst.afsluitdatum >= :afsluitdatum_van')
->setParameter('afsluitdatum_van', $this->afsluitdatum->getStart())
;
}
if ($this->afsluitdatum->getEnd()) {
$builder
->andWhere('huurovereenkomst.afsluitdatum <= :afsluitdatum_tot')
->setParameter('afsluitdatum_tot', $this->afsluitdatum->getEnd())
;
}
}
if (!$this->isReservering) {
$builder
->andWhere('huurovereenkomst.isReservering = 0 OR huurovereenkomst IS NULL')
;
}
else if($this->isReservering == true)
{
//INCLUDES reserveringen, not ONLY reserveringen.
$builder
//->andWhere('huurovereenkomst.isReservering IS NULL OR huurovereenkomst.isReservering = 0')
->orWhere('huurovereenkomst.isReservering = 1')
;
}
if ($this->aanmelddatum) {
if ($this->aanmelddatum->getStart()) {
$builder
->andWhere('klant.aanmelddatum >= :aanmelddatum_van')
->setParameter('aanmelddatum_van', $this->aanmelddatum->getStart())
;
}
if ($this->aanmelddatum->getEnd()) {
$builder
->andWhere('klant.aanmelddatum <= :aanmelddatum_tot')
->setParameter('aanmelddatum_tot', $this->aanmelddatum->getEnd())
;
}
}
if ($this->actief == 'lopend') {
$builder
->andWhere('huurovereenkomst.afsluitdatum IS NULL OR huurovereenkomst.afsluitdatum > :now')
->setParameter('now', new \DateTime())
;
}else if($this->actief == 'afgesloten') {
$builder
->andWhere('huurovereenkomst.afsluitdatum IS NOT NULL AND huurovereenkomst.afsluitdatum <= :now')
->setParameter('now', new \DateTime())
;
}else if($this->actief == 'all') {
}
if ($this->opzegbriefVerstuurd) {
$builder
->andWhere('huurovereenkomst.opzegbriefVerstuurd = true')
;
}
if ($this->klant) {
$this->klant->applyTo($builder,'appKlant');
}
if ($this->verhuurderKlant) {
$this->verhuurderKlant->applyTo($builder, 'verhuurderKlant');
}
if ($this->medewerker) {
$builder
->andWhere('huurovereenkomst.medewerker = :medewerker')
->setParameter('medewerker', $this->medewerker)
;
}
if($this->project && count($this->project)>0)
{
$builder->andWhere('huuraanbod.project IN (:project)')
->setParameter("project",$this->project);
}
}
}
|
{
"content_hash": "9b54c8268aa2396e90b150f45a380adf",
"timestamp": "",
"source": "github",
"line_count": 239,
"max_line_length": 116,
"avg_line_length": 28.728033472803347,
"alnum_prop": 0.4908243518788232,
"repo_name": "deregenboog/ecd",
"id": "f574d413d521e71a7718c1349d80ece4966acc64",
"size": "6866",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/TwBundle/Filter/HuurovereenkomstFilter.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "39384"
},
{
"name": "Dockerfile",
"bytes": "1506"
},
{
"name": "JavaScript",
"bytes": "199321"
},
{
"name": "PHP",
"bytes": "4527452"
},
{
"name": "SCSS",
"bytes": "34"
},
{
"name": "Shell",
"bytes": "7702"
},
{
"name": "Twig",
"bytes": "1454381"
}
],
"symlink_target": ""
}
|
from msrest.serialization import Model
class Query(Model):
"""Defines a search query.
Variables are only populated by the server, and will be ignored when
sending a request.
:param text: The query string. Use this string as the query term in a new
search request.
:type text: str
:ivar display_text: The display version of the query term. This version of
the query term may contain special characters that highlight the search
term found in the query string. The string contains the highlighting
characters only if the query enabled hit highlighting
:vartype display_text: str
:ivar web_search_url: The URL that takes the user to the Bing search
results page for the query.Only related search results include this field.
:vartype web_search_url: str
:ivar search_link:
:vartype search_link: str
:ivar thumbnail:
:vartype thumbnail:
~azure.cognitiveservices.search.videosearch.models.ImageObject
"""
_validation = {
'text': {'required': True},
'display_text': {'readonly': True},
'web_search_url': {'readonly': True},
'search_link': {'readonly': True},
'thumbnail': {'readonly': True},
}
_attribute_map = {
'text': {'key': 'text', 'type': 'str'},
'display_text': {'key': 'displayText', 'type': 'str'},
'web_search_url': {'key': 'webSearchUrl', 'type': 'str'},
'search_link': {'key': 'searchLink', 'type': 'str'},
'thumbnail': {'key': 'thumbnail', 'type': 'ImageObject'},
}
def __init__(self, text):
super(Query, self).__init__()
self.text = text
self.display_text = None
self.web_search_url = None
self.search_link = None
self.thumbnail = None
|
{
"content_hash": "9bf00f1dd07bceaa1b5bd1ea1784d5a9",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 79,
"avg_line_length": 35.68,
"alnum_prop": 0.625560538116592,
"repo_name": "AutorestCI/azure-sdk-for-python",
"id": "5cc62783638e9ad9124577d74f5635bf3eca9a27",
"size": "2258",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "azure-cognitiveservices-search-videosearch/azure/cognitiveservices/search/videosearch/models/query.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "34619070"
}
],
"symlink_target": ""
}
|
options/db
===
Scripts for working with MongoDB
Daemon setup
---
For running as upstart daemon on Ubuntu, set up virtual environment,
copy `opttrack.upstart` to `/etc/init/opttrack.conf`.
|
{
"content_hash": "4c239d5be0d3a3aeb8263c61671b89cc",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 68,
"avg_line_length": 23.625,
"alnum_prop": 0.7619047619047619,
"repo_name": "aisthesis/mfstockmkt",
"id": "2499424ea65d82cea276c61348a97545213c706c",
"size": "189",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "options/db/README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "52764"
},
{
"name": "Shell",
"bytes": "1304"
}
],
"symlink_target": ""
}
|
package jigg.nlp.ccg
import lexicon._
import scala.reflect.ClassTag
import java.io.File
trait CCGBank {
val info: Opts.BankInfo
def train: File
def dev: File
def test: File
def template: File
def lexicon: File
def trainSentences: Array[GoldSuperTaggedSentence] =
extractor.readSentences(train, info.trainSize, true)
def devSentences: Array[GoldSuperTaggedSentence] =
extractor.readSentences(dev, info.devSize, false)
def testSentences: Array[GoldSuperTaggedSentence] =
extractor.readSentences(test, info.testSize, false)
def trainTrees: Array[ParseTree[NodeLabel]] =
extractor.readTrees(train, info.trainSize, true)
def devTrees: Array[ParseTree[NodeLabel]] =
extractor.readTrees(dev, info.devSize, false)
def testTrees: Array[ParseTree[NodeLabel]] =
extractor.readTrees(test, info.testSize, false)
def sentences(trees: Array[ParseTree[NodeLabel]]): Array[GoldSuperTaggedSentence] =
extractor.sentences(trees)
def derivations(trees: Array[ParseTree[NodeLabel]]): Array[Derivation] =
extractor.derivations(trees)
protected def extractor: TreeExtractor
}
object CCGBank {
def select(info: Opts.BankInfo, dict: Dictionary) = info.lang match {
case "ja" => new JapaneseCCGBank(info, dict)
case _ => sys.error("yet unsupported.")
}
}
class JapaneseCCGBank(val info: Opts.BankInfo, dict: Dictionary) extends CCGBank {
def train = new File(info.dir, "train.ccgbank")
def dev = new File(info.dir, "devel.ccgbank")
def test = new File(info.dir, "test.ccgbank")
def template = new File(info.dir, "template.lst")
def lexicon = new File(info.dir, "Japanese.lexicon")
val extractor = TreeExtractor(
new JapaneseParseTreeConverter(dict),
new CCGBankReader)
}
case class TreeExtractor(treeConv: ParseTreeConverter, reader: CCGBankReader) {
def readSentences(f: File, size: Int, isTrain: Boolean = false):
Array[GoldSuperTaggedSentence] =
readAndConvertTrees(f, size, treeConv.toSentenceFromStringTree _, isTrain)
def readTrees(f: File, size: Int, isTrain: Boolean = false):
Array[ParseTree[NodeLabel]] =
readAndConvertTrees(f, size, treeConv.toLabelTree _, isTrain)
def readAndConvertTrees[A:ClassTag](
f: File, size: Int, conv: ParseTree[String]=>A, isTrain: Boolean = false): Array[A] =
reader.readParseTrees(f.getPath, size, isTrain).map(conv).toArray
def sentences(trees: Array[ParseTree[NodeLabel]]): Array[GoldSuperTaggedSentence] =
trees map (treeConv.toSentenceFromLabelTree)
def derivations(trees: Array[ParseTree[NodeLabel]]): Array[Derivation] =
trees map (treeConv.toDerivation)
}
|
{
"content_hash": "674c37cb5fe16050a2fdf5df79cc9d78",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 89,
"avg_line_length": 30.068181818181817,
"alnum_prop": 0.7346938775510204,
"repo_name": "mynlp/jigg",
"id": "b1a58511cb5a68c7accdb93e810be842a0ed7e62",
"size": "3220",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/scala/jigg/nlp/ccg/CCGBank.scala",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "1477"
},
{
"name": "Java",
"bytes": "786"
},
{
"name": "Python",
"bytes": "210085"
},
{
"name": "Scala",
"bytes": "703798"
},
{
"name": "Shell",
"bytes": "7990"
}
],
"symlink_target": ""
}
|
require 'chef/knife'
class Chef
class Knife
module VmBase
def self.included(base)
base.class_eval do
deps do
require 'chef/json_compat'
end
end
end
def locate_config_value(key)
key = key.to_sym
config[key] || Chef::Config[:knife][key]
end
end
end
end
|
{
"content_hash": "3814a0ec9f8e4508fa15364cab2ca634",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 48,
"avg_line_length": 16.136363636363637,
"alnum_prop": 0.5352112676056338,
"repo_name": "danryan/knife-vm",
"id": "dac378ecd5655a7c6f3a67b7af3940ec3d07c214",
"size": "355",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/chef/knife/vm_base.rb",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Ruby",
"bytes": "1081"
}
],
"symlink_target": ""
}
|
<?php
/**
* System Info Czech lexicon topic
*
* @language cs
* @package modx
* @subpackage lexicon
*
* @author modxcms.cz
* @updated 2011-10-23
*/
// $_lang['database_charset'] = 'Database charset';
$_lang['database_charset'] = 'Znaková sada databáze';
// $_lang['database_name'] = 'Database name';
$_lang['database_name'] = 'Název databáze';
// $_lang['database_server'] = 'Database server';
$_lang['database_server'] = 'Databázový server';
// $_lang['database_tables'] = 'Database tables';
$_lang['database_tables'] = 'Databázové tabulky';
// $_lang['database_optimize'] = 'Optimize Database';
$_lang['database_optimize'] = 'Optimalizovat databázi';
// $_lang['database_table_clickhere'] = 'Click here';
$_lang['database_table_clickhere'] = 'Zde klikněte';
// $_lang['database_table_clickbackup'] = 'to backup & download the selected tables';
$_lang['database_table_clickbackup'] = 'pro vytvoření zálohy a stažení vybraných tabulek.';
// $_lang['database_table_datasize'] = 'Data size';
$_lang['database_table_datasize'] = 'Velikost dat';
// $_lang['database_table_droptablestatements'] = 'Generate DROP TABLE statements.';
$_lang['database_table_droptablestatements'] = 'Generovat příkazy DROP TABLE.';
// $_lang['database_table_effectivesize'] = 'Effective size';
$_lang['database_table_effectivesize'] = 'Efektivní velikost';
// $_lang['database_table_indexsize'] = 'Index size';
$_lang['database_table_indexsize'] = 'Velikost indexů';
// $_lang['database_table_overhead'] = 'Overhead';
$_lang['database_table_overhead'] = 'Navíc';
// $_lang['database_table_reserved'] = 'Reserved';
$_lang['database_table_reserved'] = 'Rezervováno';
// $_lang['database_table_records'] = 'Records';
$_lang['database_table_records'] = 'Záznamů';
// $_lang['database_table_tablename'] = 'Table name';
$_lang['database_table_tablename'] = 'Název tabulky';
// $_lang['database_table_totalsize'] = 'Total size';
$_lang['database_table_totalsize'] = 'Celková velikost';
// $_lang['database_table_totals'] = 'Totals:';
$_lang['database_table_totals'] = 'Celkem:';
// $_lang['database_table_unused'] = 'Unused';
$_lang['database_table_unused'] = 'Nevyužito';
// $_lang['database_type'] = 'Database type';
$_lang['database_type'] = 'Typ databáze';
// $_lang['database_version'] = 'Database version';
$_lang['database_version'] = 'Verze databáze';
// $_lang['extjs_version'] = '<a href="http://extjs.com/" target="_blank">ExtJS</a> Version';
$_lang['extjs_version'] = '<a href="http://extjs.com/" target="_blank">ExtJS</a> verze';
// $_lang['localtime'] = 'Local Time';
$_lang['localtime'] = 'Místní čas';
// $_lang['magpie_version'] = '<a href="http://magpierss.sourceforge.net/" target="_blank">MagpieRSS</a> Version';
$_lang['magpie_version'] = '<a href="http://magpierss.sourceforge.net/" target="_blank">MagpieRSS</a> verze';
// $_lang['modx_version'] = 'MODX version';
$_lang['modx_version'] = 'MODX verze';
// $_lang['onlineusers_action'] = 'Action';
$_lang['onlineusers_action'] = 'Akce';
// $_lang['onlineusers_actionid'] = 'Action-ID';
$_lang['onlineusers_actionid'] = 'ID Akce';
// $_lang['onlineusers_ipaddress'] = 'User's IP address';
$_lang['onlineusers_ipaddress'] = 'IP adresa uživatele';
// $_lang['onlineusers_lasthit'] = 'Last hit';
$_lang['onlineusers_lasthit'] = 'Poslední klik';
// $_lang['onlineusers_message'] = 'This list shows all users active within the last 20 minutes (current time is ';
$_lang['onlineusers_message'] = 'V tomto seznamu jsou zobrazeni všichni uživatelé, kteří byli aktivní v posledních 20 minutách (nyní je čas ';
// $_lang['onlineusers_title'] = 'Online users';
$_lang['onlineusers_title'] = 'Online uživatelů';
// $_lang['onlineusers_user'] = 'User';
$_lang['onlineusers_user'] = 'Uživatel';
// $_lang['onlineusers_userid'] = 'User's ID';
$_lang['onlineusers_userid'] = 'ID uživatele';
// $_lang['optimize_table'] = 'Click here to optimize this table';
$_lang['optimize_table'] = 'Klikněte pro optimalizování tabulky';
// $_lang['optimize_table_err'] = 'Error optimizing table';
$_lang['optimize_table_err'] = 'Chyba při optimalizaci tabulky';
// $_lang['phpmailer_version'] = '<a href="http://sourceforge.net/projects/phpmailer/" target="_blank">PHPMailer</a> Version';
$_lang['phpmailer_version'] = '<a href="http://sourceforge.net/projects/phpmailer/" target="_blank">PHPMailer</a> verze';
// $_lang['server'] = 'Server';
$_lang['server'] = 'Server';
// $_lang['servertime'] = 'Server Time';
$_lang['servertime'] = 'Čas serveru';
// $_lang['serveroffset'] = 'Server Offset';
$_lang['serveroffset'] = 'Rozdíl serveru';
// $_lang['smarty_version'] = '<a href="http://smarty.net/" target="_blank">Smarty</a> Version';
$_lang['smarty_version'] = '<a href="http://smarty.net/" target="_blank">Smarty</a> verze';
// $_lang['sysinfo_desc'] = 'Here you can view general information about your MODX environment.';
$_lang['sysinfo_desc'] = 'Přehled obecných informací o prostředí MODX.';
// $_lang['view_sysinfo'] = 'System Info';
$_lang['view_sysinfo'] = 'Systémové informace';
// $_lang['table_prefix'] = 'Table prefix';
$_lang['table_prefix'] = 'Prefix tabulek';
// $_lang['truncate_table'] = 'Click here to truncate this table';
$_lang['truncate_table'] = 'Klikněte pro vyprázdnění tabulky';
// $_lang['truncate_table_err'] = 'Error truncating table';
$_lang['truncate_table_err'] = 'Nastala chyba při vyprázdňování tabulky';
// $_lang['version_codename'] = 'Version codename';
$_lang['version_codename'] = 'Kódové jméno verze';
|
{
"content_hash": "b087dd904e735017f7325a4f825c267d",
"timestamp": "",
"source": "github",
"line_count": 145,
"max_line_length": 142,
"avg_line_length": 38,
"alnum_prop": 0.6655172413793103,
"repo_name": "timsvoice/great_green_sources",
"id": "56f8f7b1400a4c2a2aa466195697706875e9110a",
"size": "5583",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "core/lexicon/cs/system_info.inc.php",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "718852"
},
{
"name": "Java",
"bytes": "11903"
},
{
"name": "JavaScript",
"bytes": "1641637"
},
{
"name": "PHP",
"bytes": "13315560"
},
{
"name": "Perl",
"bytes": "25276"
}
],
"symlink_target": ""
}
|
package com.evolveum.midpoint.model.impl.lens;
import com.evolveum.midpoint.prism.PrismContext;
import com.evolveum.midpoint.prism.delta.ObjectDelta;
import com.evolveum.midpoint.schema.DeltaConvertor;
import com.evolveum.midpoint.schema.ObjectDeltaOperation;
import com.evolveum.midpoint.util.DebugUtil;
import com.evolveum.midpoint.util.exception.SchemaException;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType;
import com.evolveum.midpoint.xml.ns._public.model.model_context_3.LensObjectDeltaOperationType;
import java.io.Serializable;
/**
* @author semancik
*
*/
public class LensObjectDeltaOperation<T extends ObjectType> extends ObjectDeltaOperation<T> implements Serializable {
private boolean audited = false;
public LensObjectDeltaOperation() {
super();
}
public LensObjectDeltaOperation(ObjectDelta<T> objectDelta) {
super(objectDelta);
}
public boolean isAudited() {
return audited;
}
public void setAudited(boolean audited) {
this.audited = audited;
}
@Override
public String debugDump(int indent) {
StringBuilder sb = new StringBuilder();
sb.append(super.debugDump(indent));
sb.append("\n");
DebugUtil.debugDumpWithLabel(sb, "audited", audited, indent + 1);
return sb.toString();
}
@Override
protected String getDebugDumpClassName() {
return "LensObjectDeltaOperation";
}
public LensObjectDeltaOperationType toLensObjectDeltaOperationType() throws SchemaException {
LensObjectDeltaOperationType retval = new LensObjectDeltaOperationType();
retval.setObjectDeltaOperation(DeltaConvertor.toObjectDeltaOperationType(this));
retval.setAudited(audited);
return retval;
}
public static LensObjectDeltaOperation fromLensObjectDeltaOperationType(LensObjectDeltaOperationType jaxb, PrismContext prismContext) throws SchemaException {
ObjectDeltaOperation odo = DeltaConvertor.createObjectDeltaOperation(jaxb.getObjectDeltaOperation(), prismContext);
LensObjectDeltaOperation retval = new LensObjectDeltaOperation();
retval.setObjectDelta(odo.getObjectDelta());
retval.setExecutionResult(odo.getExecutionResult());
retval.setAudited(jaxb.isAudited());
return retval;
}
public LensObjectDeltaOperation<T> clone() {
LensObjectDeltaOperation<T> clone = new LensObjectDeltaOperation<T>();
super.copyToClone(clone);
copyToClone(clone);
return clone;
}
protected void copyToClone(LensObjectDeltaOperation<T> clone) {
clone.audited = this.audited;
}
}
|
{
"content_hash": "72563caa3d3359f54b7fdd83aa4b05b7",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 162,
"avg_line_length": 31.469135802469136,
"alnum_prop": 0.7701059238917223,
"repo_name": "gureronder/midpoint",
"id": "be12080f4fedd94d9dea9b57f7ade7ee461c032b",
"size": "3149",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/LensObjectDeltaOperation.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "176525"
},
{
"name": "Groovy",
"bytes": "10361"
},
{
"name": "HTML",
"bytes": "450709"
},
{
"name": "Java",
"bytes": "19619257"
},
{
"name": "JavaScript",
"bytes": "70636"
},
{
"name": "PLSQL",
"bytes": "2171"
},
{
"name": "PLpgSQL",
"bytes": "3307"
},
{
"name": "SQLPL",
"bytes": "4091"
},
{
"name": "Shell",
"bytes": "3606"
}
],
"symlink_target": ""
}
|
<link rel="import" href="../polymer/polymer.html">
<script src="../countdownjs-mirror/countdown.js"></script>
<!--
Provide a simple countdown clock to the specified time. Extends the `time`
element to be semantically correct. Leverages [Countdown.js](http://countdownjs.org).
### Example
<time is="countdown-timer" datetime="2016-01-01T0:00+0:00">New Year's Day</time>
@element countdown-timer
@blurb Simple auto-updating countdown timer to a specific date/time.
@status alpha
@homepage http://elements.divshot.io/countdown-timer
-->
<polymer-element name="countdown-timer" attributes="datetime" extends="time">
<template></template>
<script>
Polymer({
/**
* The JS-parseable [date-time](http://www.w3.org/TR/html-markup/datatypes.html#common.data.datetime)
* that we're counting down to.
*
* @attribute datetime
* @type String
*/
datetime: null,
ready: function() {
this.interval = setInterval(function() {
this.updateString();
}.bind(this), 1000);
},
updateString: function() {
this.shadowRoot.innerHTML = countdown(new Date(this.datetime)).toHTML();
}
});
</script>
</polymer-element>
|
{
"content_hash": "c12a235694130f91efff82ec64bcae90",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 107,
"avg_line_length": 28.511627906976745,
"alnum_prop": 0.6517128874388255,
"repo_name": "divshot/countdown-timer",
"id": "2116c1c3805415c07151a11bc9ad3f1f51e3a1db",
"size": "1226",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "countdown-timer.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "2076"
}
],
"symlink_target": ""
}
|
using log4net;
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using Nini.Config;
using OpenSim.Framework;
using OpenSim.Framework.Communications;
using OpenSim.Framework.Servers.HttpServer;
using OpenSim.Services.Interfaces;
using OpenMetaverse;
namespace OpenSim.Services.Connectors
{
public class UserServicesConnector : IUserAccountService
{
private static readonly ILog m_log =
LogManager.GetLogger(
MethodBase.GetCurrentMethod().DeclaringType);
// private string m_ServerURI = String.Empty;
public UserServicesConnector()
{
}
public UserServicesConnector(string serverURI)
{
// m_ServerURI = serverURI.TrimEnd('/');
}
public UserServicesConnector(IConfigSource source)
{
Initialise(source);
}
public virtual void Initialise(IConfigSource source)
{
IConfig assetConfig = source.Configs["UserService"];
if (assetConfig == null)
{
m_log.Error("[USER CONNECTOR]: UserService missing from OpanSim.ini");
throw new Exception("User connector init error");
}
string serviceURI = assetConfig.GetString("UserServerURI",
String.Empty);
if (serviceURI == String.Empty)
{
m_log.Error("[USER CONNECTOR]: No Server URI named in section UserService");
throw new Exception("User connector init error");
}
//m_ServerURI = serviceURI;
}
public UserAccount GetUserAccount(UUID scopeID, string firstName, string lastName)
{
return null;
}
public UserAccount GetUserAccount(UUID scopeID, UUID userID)
{
return null;
}
public bool SetHomePosition(UserAccount data, UUID regionID, UUID regionSecret)
{
return false;
}
public bool SetUserAccount(UserAccount data, UUID principalID, string token)
{
return false;
}
public bool CreateUserAccount(UserAccount data, UUID principalID, string token)
{
return false;
}
public List<UserAccount> GetUserAccount(UUID scopeID, string query)
{
return null;
}
}
}
|
{
"content_hash": "7f9659187cd266e9c2fbd357b7bf9d97",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 92,
"avg_line_length": 27.258426966292134,
"alnum_prop": 0.5968672712283595,
"repo_name": "AlphaStaxLLC/taiga",
"id": "683990f82636ed9de98f026f932bc30df56bc037",
"size": "4043",
"binary": false,
"copies": "3",
"ref": "refs/heads/develop",
"path": "OpenSim/Services/Connectors/User/UserServiceConnector.cs",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Batchfile",
"bytes": "2164"
},
{
"name": "C#",
"bytes": "16675645"
},
{
"name": "HTML",
"bytes": "382"
},
{
"name": "JavaScript",
"bytes": "556"
},
{
"name": "LSL",
"bytes": "40942"
},
{
"name": "Makefile",
"bytes": "1232"
},
{
"name": "NSIS",
"bytes": "6208"
},
{
"name": "PHP",
"bytes": "1640"
},
{
"name": "PLpgSQL",
"bytes": "69431"
},
{
"name": "Perl",
"bytes": "3578"
},
{
"name": "Python",
"bytes": "196547"
},
{
"name": "Ruby",
"bytes": "1111"
},
{
"name": "SQLPL",
"bytes": "367"
},
{
"name": "Shell",
"bytes": "2917"
}
],
"symlink_target": ""
}
|
<?php
/* including the important configuration file */
include(__DIR__.'/config.php');
$db = new CDatabase($eros['database']);
$movie = new CMovies($db);
$eros['title'] = "Sökresultat";
$query = isset($_GET['search']) ? $_GET['search'] : null;
$query = '%'.$query.'%';
$output = $movie->getSearchResult($db, $query);
$eros['main'] = <<<EOD
<article>
<h3>Sökresultat</h3>
{$output}
</article>
EOD;
include(EROS_THEME_PATH);
|
{
"content_hash": "ef88fd1469dea26030dae6514624148c",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 57,
"avg_line_length": 19.782608695652176,
"alnum_prop": 0.5868131868131868,
"repo_name": "IsaJansson/SNT",
"id": "55990159585dc53c68f37726b2d5541bdc63c571",
"size": "457",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "webroot/search.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "8109"
},
{
"name": "PHP",
"bytes": "165662"
}
],
"symlink_target": ""
}
|
/*
* Licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
* See https://github.com/openiddict/openiddict-core for more information concerning
* the license and the contributors participating to this project.
*/
using System;
using System.Diagnostics;
using System.Threading.Tasks;
using AspNet.Security.OpenIdConnect.Extensions;
using AspNet.Security.OpenIdConnect.Server;
using JetBrains.Annotations;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
namespace OpenIddict.Infrastructure {
public partial class OpenIddictProvider<TUser, TApplication, TAuthorization, TScope, TToken> : OpenIdConnectServerProvider
where TUser : class where TApplication : class where TAuthorization : class where TScope : class where TToken : class {
public override async Task ValidateRevocationRequest([NotNull] ValidateRevocationRequestContext context) {
var services = context.HttpContext.RequestServices.GetRequiredService<OpenIddictServices<TUser, TApplication, TAuthorization, TScope, TToken>>();
// When token_type_hint is specified, reject the request
// if token_type_hint is not equal to "refresh_token".
if (!string.IsNullOrEmpty(context.Request.GetTokenTypeHint()) &&
!string.Equals(context.Request.GetTokenTypeHint(), OpenIdConnectConstants.TokenTypeHints.RefreshToken)) {
context.Reject(
error: OpenIdConnectConstants.Errors.UnsupportedTokenType,
description: "Only refresh tokens can be revoked. When specifying a token_type_hint " +
"parameter, its value must be equal to 'refresh_token'.");
return;
}
// Skip client authentication if the client identifier is missing.
// Note: ASOS will automatically ensure that the calling application
// cannot revoke a refresh token if it's not the intended audience,
// even if client authentication was skipped.
if (string.IsNullOrEmpty(context.ClientId)) {
services.Logger.LogInformation("The revocation request validation process was skipped " +
"because the client_id parameter was missing or empty.");
context.Skip();
return;
}
// Retrieve the application details corresponding to the requested client_id.
var application = await services.Applications.FindByIdAsync(context.ClientId);
if (application == null) {
context.Reject(
error: OpenIdConnectConstants.Errors.InvalidClient,
description: "Application not found in the database: ensure that your client_id is correct.");
return;
}
// Reject tokens requests containing a client_secret if the client application is not confidential.
var type = await services.Applications.GetClientTypeAsync(application);
if (!string.Equals(type, OpenIddictConstants.ClientTypes.Confidential, StringComparison.OrdinalIgnoreCase) &&
!string.IsNullOrEmpty(context.ClientSecret)) {
context.Reject(
error: OpenIdConnectConstants.Errors.InvalidRequest,
description: "Public clients are not allowed to send a client_secret.");
return;
}
// Confidential applications MUST authenticate to protect them from impersonation attacks.
else if (!string.Equals(type, OpenIddictConstants.ClientTypes.Public)) {
if (string.IsNullOrEmpty(context.ClientSecret)) {
context.Reject(
error: OpenIdConnectConstants.Errors.InvalidClient,
description: "Missing credentials: ensure that you specified a client_secret.");
return;
}
if (!await services.Applications.ValidateSecretAsync(application, context.ClientSecret)) {
context.Reject(
error: OpenIdConnectConstants.Errors.InvalidClient,
description: "Invalid credentials: ensure that you specified a correct client_secret.");
return;
}
}
context.Validate();
}
public override async Task HandleRevocationRequest([NotNull] HandleRevocationRequestContext context) {
var services = context.HttpContext.RequestServices.GetRequiredService<OpenIddictServices<TUser, TApplication, TAuthorization, TScope, TToken>>();
// If the received token is not a refresh token, set Revoked
// to false to indicate that the token cannot be revoked.
if (!context.Ticket.IsRefreshToken()) {
services.Logger.LogError("The revocation request was rejected because the token was not a refresh token.");
context.Revoked = false;
return;
}
// Extract the token identifier from the refresh token.
var identifier = context.Ticket.GetTicketId();
Debug.Assert(!string.IsNullOrEmpty(identifier),
"The refresh token should contain a ticket identifier.");
// Retrieve the token from the database. If the token cannot be found,
// assume it is invalid and consider the revocation as successful.
var token = await services.Tokens.FindByIdAsync(identifier);
if (token == null) {
services.Logger.LogInformation("The refresh token '{Identifier}' was already revoked.", identifier);
context.Revoked = true;
return;
}
// Revoke the refresh token.
await services.Tokens.RevokeAsync(token);
services.Logger.LogInformation("The refresh token '{Identifier}' was successfully revoked.", identifier);
context.Revoked = true;
}
}
}
|
{
"content_hash": "0241cda76d59a768c681121a6e9f8c39",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 157,
"avg_line_length": 48.39370078740158,
"alnum_prop": 0.6363488447770907,
"repo_name": "ilmax/core",
"id": "6eb4c543bc750d502d08b572af2e8befb1ef6a9c",
"size": "6148",
"binary": false,
"copies": "1",
"ref": "refs/heads/dev",
"path": "src/OpenIddict.Core/Infrastructure/OpenIddictProvider.Revocation.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "248"
},
{
"name": "C#",
"bytes": "220604"
},
{
"name": "CSS",
"bytes": "1413"
},
{
"name": "PowerShell",
"bytes": "1009"
},
{
"name": "Shell",
"bytes": "892"
}
],
"symlink_target": ""
}
|
TO BUILD: sudo docker build -t knime .
TO RUN: docker run --rm --name knime -p 5901:5901 -e USER=root -i knime /bin/bash -c "vncserver :1 -geometry 1366x768 -depth 24 && tail -F /root/.vnc/*.log"
|
{
"content_hash": "5ed2c4c6851a5bb9ce4edd61c61ccbaf",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 156,
"avg_line_length": 65.66666666666667,
"alnum_prop": 0.6751269035532995,
"repo_name": "neoramon/docker-knime",
"id": "db2c633511295681f821001486f4a4c01e0a72b4",
"size": "219",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Shell",
"bytes": "239"
}
],
"symlink_target": ""
}
|
<?php
/**
* @package POF Settings
*/
/*
Plugin Name: POF Settings
*/
/*
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 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/* Helper functions */
include( plugin_dir_path( __FILE__ ) . 'pof-settings-helpers.php');
add_action( 'admin_menu', 'pof_settings_menu' );
global $pof_settings_db_version;
$pof_settings_db_version = '1.0';
function pof_settings_get_table_name_languages() {
global $wpdb;
return $wpdb->prefix . 'pof_settings_languages';
}
function pof_settings_install() {
global $wpdb;
global $pof_settings_db_version;
$table_name_languages = pof_settings_get_table_name_languages();
$charset_collate = $wpdb->get_charset_collate();
$sql = "CREATE TABLE $table_name_languages (
id bigint(20) NOT NULL AUTO_INCREMENT,
lang_title varchar(255) DEFAULT '' NOT NULL,
lang_code varchar(255) DEFAULT '' NOT NULL,
is_active smallint(4) DEFAULT 0 NOT NULL,
is_default smallint(4) DEFAULT 0 NOT NULL,
UNIQUE KEY id (id),
KEY lang_title (lang_title),
KEY lang_code (lang_code),
KEY lang_active (is_active),
KEY lang_default (is_default)
) $charset_collate;";
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
dbDelta( $sql );
add_option( 'pof_settings_db_version', $pof_settings_db_version );
}
pof_settings_install();
function pof_settings_menu() {
add_menu_page('POF Settings', 'POF Asetukset', 'pof_manage_options', 'pof_settings_frontpage-handle', 'pof_settings_frontpage', 'dashicons-admin-settings');
add_submenu_page( 'pof_settings_frontpage-handle', 'Yleiset asetukset', 'Yleiset asetukset', 'pof_manage_options', 'pof_settings_general-handle', 'pof_settings_general');
add_submenu_page( 'pof_settings_frontpage-handle', 'Kielet', 'Kielet', 'pof_manage_options', 'pof_settings_languages-handle', 'pof_settings_languages');
add_submenu_page( 'pof_settings_frontpage-handle', 'Ikonit', 'Ikonit', 'pof_manage_options', 'pof_settings_icons-handle', 'pof_settings_icons');
}
function pof_settings_frontpage() {
if ( !current_user_can( 'pof_manage_options' ) ) {
wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
}
echo '<div class="wrap">';
echo '<h1>POF Asetukset</h1>';
echo '<p>Valitse vasemmasta valikosta, mitä haluat muokata.</p>';
echo '</div>';
}
function pof_settings_general() {
if ( !current_user_can( 'pof_manage_options' ) ) {
wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
}
if(isset($_POST['Submit'])) {
if (isset($_POST["google_api_certificate_name"])) {
update_option("pof_settings_google_api_certificate_name", $_POST["google_api_certificate_name"]);
}
if (isset($_POST["google_api_user"])) {
update_option("pof_settings_google_api_user", $_POST["google_api_user"]);
}
if (isset($_POST["google_api_password"])) {
update_option("pof_settings_google_api_password", $_POST["google_api_password"]);
}
if (isset($_POST["suggestions_emails"])) {
update_option("pof_settings_suggestions_emails", $_POST["suggestions_emails"]);
}
if (isset($_POST["suggestions_email_interval"])) {
update_option("pof_settings_suggestions_email_interval", $_POST["suggestions_email_interval"]);
}
if (isset($_POST["suggestions_email_sender_name"])) {
update_option("pof_settings_suggestions_email_sender_name", $_POST["suggestions_email_sender_name"]);
}
if (isset($_POST["suggestions_email_sender_email"])) {
update_option("pof_settings_suggestions_email_sender_email", $_POST["suggestions_email_sender_email"]);
}
if (isset($_POST["suggestions_allowed_domains"])) {
update_option("pof_settings_suggestions_allowed_domains", $_POST["suggestions_allowed_domains"]);
}
if (isset($_POST["suggestions_allowed_file_types"])) {
update_option("pof_settings_suggestions_allowed_file_types", $_POST["suggestions_allowed_file_types"]);
}
if (isset($_POST["lastupdate_overwrite"])) {
update_option("pof_settings_lastupdate_overwrite", $_POST["lastupdate_overwrite"]);
}
if (isset($_POST["fulljson_cache_ttl"])) {
update_option("pof_settings_fulljson_cache_ttl", $_POST["fulljson_cache_ttl"]);
}
}
echo '<div class="wrap">';
echo '<h1>POF Settings, yleiset</h1>';
?>
<form method="post" action="">
<?php settings_fields( 'pof_settings-general' ); ?>
<?php do_settings_sections( 'pof_settings-general' ); ?>
<h2>Google Drive API</h2>
<table class="form-table">
<tr valign="top">
<th scope="row">Certifikaatin nimi (sijoita kyseinen tiedosto plugins\pof-settings\certificates-kansioon</th>
<td><input style="width: 600px;" id="google_api_certificate_name_search" autocomplete="off" type="text" name="google_api_certificate_name" value="<?php echo esc_attr( get_option('pof_settings_google_api_certificate_name') ); ?>" /></td>
</tr>
<tr valign="top">
<th scope="row">Api käyttäjä</th>
<td><input style="width: 600px;" id="google_api_user_search" autocomplete="off" type="text" name="google_api_user" value="<?php echo esc_attr( get_option('pof_settings_google_api_user') ); ?>" /></td>
</tr>
<tr valign="top">
<th scope="row">Salasana</th>
<td><input style="width: 600px;" id="google_api_password_search" autocomplete="off" type="password" name="google_api_password" value="<?php echo esc_attr( get_option('pof_settings_google_api_password') ); ?>" /></td>
</tr>
</table>
<h2>Vinkit</h2>
<table class="form-table">
<tr valign="top">
<th scope="row">Kelle lähetetään sähköpostia uuista vinkeistä. Erottele pilkulla</th>
<td><input style="width: 600px;" id="suggestions_emails" autocomplete="off" type="text" name="suggestions_emails" value="<?php echo esc_attr( get_option('pof_settings_suggestions_emails') ); ?>" /></td>
</tr>
<tr valign="top">
<th scope="row">Sähköpostien maksimi lähetysväli (min) ?</th>
<td><input style="width: 600px;" id="suggestions_email_interval" autocomplete="off" type="number" min="0" name="suggestions_email_interval" value="<?php echo esc_attr( get_option('pof_settings_suggestions_email_interval') ); ?>" /></td>
</tr>
<tr valign="top">
<th scope="row">Millä nimellä lähetetään</th>
<td><input style="width: 600px;" id="suggestions_email_sender_name" autocomplete="off" type="text" name="suggestions_email_sender_name" value="<?php echo esc_attr( get_option('pof_settings_suggestions_email_sender_name') ); ?>" /></td>
</tr>
<tr valign="top">
<th scope="row">Mistä osoitteesta lähetetään.</th>
<td><input style="width: 600px;" id="suggestions_email_sender_email" autocomplete="off" type="text" name="suggestions_email_sender_email" value="<?php echo esc_attr( get_option('pof_settings_suggestions_email_sender_email')); ?>" /></td>
</tr>
<tr valign="top">
<th scope="row">Domainit, joista saa lähettä vinkkejä liitteineen (jokainen omalle rivilleen, koko domain, http:n kanssa).</th>
<td>
<textarea id="suggestions_allowed_domains" rows="10" cols="80" autocomplete="off" name="suggestions_allowed_domains"><?php echo esc_attr( get_option('pof_settings_suggestions_allowed_domains')); ?></textarea>
</td>
</tr>
<tr valign="top">
<th scope="row">
Sallitut tiedostotyypit vinkkien liitteille (yksi per rivi, ilman pistettä)<br>
Huom! Käytä MIME-tyyppiä, esim. image/png tai application/pdf
</th>
<td>
<textarea id="suggestions_allowed_file_types" rows="10" cols="80" autocomplete="off" name="suggestions_allowed_file_types"><?php echo esc_attr( get_option('pof_settings_suggestions_allowed_file_types')); ?></textarea>
</td>
</tr>
</table>
<h2>Itemit</h2>
<table class="form-table">
<tr valign="top">
<th scope="row">Yliaja viimeisimmän muokkauksen päivämäärä (Muoto: YYYY-MM-DD HH:mm:ss (esim. 2016-08-29 12:00:00)).</th>
<td>
<input style="width: 600px;" id="lastupdate_overwrite" autocomplete="off" type="text" name="lastupdate_overwrite" value="<?php echo esc_attr( get_option('pof_settings_lastupdate_overwrite') ); ?>" />
</td>
</tr>
<tr valign="top">
<th scope="row">Täyden jsonin cache sekuntteina.</th>
<td>
<input style="width: 600px;" id="fulljson_cache_ttl" autocomplete="off" type="number" min="60" name="fulljson_cache_ttl" value="<?php echo esc_attr( get_option('pof_settings_fulljson_cache_ttl') ); ?>" />
</td>
</tr>
</table>
<input type="submit" name="Submit" value="Submit" />
</form>
<?php
echo '</div>';
}
function pof_settings_languages() {
if ( !current_user_can( 'pof_manage_options' ) ) {
wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
}
$languages = pof_settings_get_all_languages();
if(isset($_POST['Submit'])) {
global $wpdb;
global $pof_settings_db_version;
$table_name_languages = pof_settings_get_table_name_languages(false);
if ( isset($_POST["pof_settings_add_lang"])
&& !empty($_POST["pof_settings_add_lang"])
&& isset($_POST["pof_settings_add_lang"]["title"])
&& !empty($_POST["pof_settings_add_lang"]["title"])
&& isset($_POST["pof_settings_add_lang"]["code"])
&& !empty($_POST["pof_settings_add_lang"]["code"])) {
$lang_active = 0;
if ( isset($_POST["pof_settings_add_lang"]["active"])
&& !empty($_POST["pof_settings_add_lang"]["active"])
&& $_POST["pof_settings_add_lang"]["active"] == "1") {
$lang_active = 1;
}
$default = 0;
if (empty($languages)) {
$default = 1;
$lang_active = 1;
}
$tmp = $wpdb->insert(
$table_name_languages,
array(
'lang_title' => $_POST["pof_settings_add_lang"]["title"],
'lang_code' => $_POST["pof_settings_add_lang"]["code"],
'is_active' => (int) $lang_active,
'is_default' => (int) $default
),
array(
'%s',
'%s',
'%d',
)
);
}
if ( isset($_POST["pof_settings_language"])
&& !empty($_POST["pof_settings_language"])) {
foreach ($_POST["pof_settings_language"] as $lang_id => $lang) {
if ( isset($lang["title"])
&& !empty($lang["title"])
&& isset($lang["code"])
&& !empty($lang["code"])) {
$lang_active = 0;
if ( isset($lang["active"])
&& !empty($lang["active"])
&& $lang["active"] == "1") {
$lang_active = 1;
}
$tmp = $wpdb->update(
$table_name_languages,
array(
'lang_title' => $lang["title"],
'lang_code' => $lang["code"],
'is_active' => (int) $lang_active
),
array(
'id' => $lang_id
),
array(
'%s',
'%s',
'%d'
),
array(
'%d'
)
);
}
}
}
$languages = pof_settings_get_all_languages(false);
}
echo '<div class="wrap">';
echo '<h1>POF Settings, kielet</h1>';
echo '<form method="post" action="">';
echo '<table cellpadding="2" cellspacing="2" border="2">';
echo '<thead>';
echo '<tr>';
echo '<th><h2>Kieli</h2></th>';
echo '<th><h2>Koodi</h2></th>';
echo '<th><h2>Aktiivinen</h2></th>';
echo '<th><h2>Default</h2></th>';
echo '<tr>';
echo '</thead>';
echo '<tbody>';
foreach ($languages as $language) {
?>
<tr>
<td><input type="text" name="pof_settings_language[<?php echo $language->id; ?>][title]" value="<?php echo $language->lang_title; ?>" /></td>
<td><input type="text" name="pof_settings_language[<?php echo $language->id; ?>][code]" value="<?php echo $language->lang_code; ?>" /></td>
<?php
if ($language->is_default) {
?>
<td>X</td>
<td>X</td>
<?php
}
else {
?>
<td><input type="checkbox" name="pof_settings_language[<?php echo $language->id; ?>][active]" value="1" <?php if ( $language->is_active) { echo " checked='checked'"; } ?> /></td>
<td></td>
<?php
}
?>
</tr>
<?php
}
?>
<tr>
<td><input type="text" name="pof_settings_add_lang[title]" /></td>
<td><input type="text" name="pof_settings_add_lang[code]" /></td>
<td><input type="checkbox" name="pof_settings_add_lang[active]" value="1" /></td>
</tr>
<?php
echo '</tbody>';
echo '</table>';
echo '<br /><input type="submit" name="Submit" value="Submit" />';
echo '</form>';
echo '</div>';
}
function pof_settings_icons() {
if (isset($_POST["pof_settings_icons_sizes"])) {
update_option("pof_settings_icons_sizes", $_POST["pof_settings_icons_sizes"]);
}
?>
<div class="wrap">
<h1>POF Settings, ikonit</h1>
<form method="post" action="">
<table class="form-table">
<tr valign="top">
<th scope="row">
Ikoneista generoitavat kuvakoot (Syöttäminen muodossa 64x64 per rivi)<br>
<br>
<a href="/wp-admin/tools.php?page=regenerate-thumbnails#/">Thumbnailien regenerointi</a>
</th>
<td>
<textarea id="pof_settings_icons_sizes" rows="10" cols="80" autocomplete="off" name="pof_settings_icons_sizes"><?php echo esc_attr( get_option('pof_settings_icons_sizes')); ?></textarea>
</td>
</tr>
</table>
<br /><input type="submit" name="Submit" value="Submit" />
</form>
</div>
<?php }
|
{
"content_hash": "04cad34a128e9c52636febc2389499d4",
"timestamp": "",
"source": "github",
"line_count": 407,
"max_line_length": 253,
"avg_line_length": 36.11793611793612,
"alnum_prop": 0.5956462585034014,
"repo_name": "partio-scout/pof_backend",
"id": "7df3b92ef3fb4820ad8963b7806a2a85adabcdec",
"size": "14710",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "wp-content/plugins/pof-settings/pof-settings.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "188171"
},
{
"name": "JavaScript",
"bytes": "275623"
},
{
"name": "PHP",
"bytes": "9642309"
}
],
"symlink_target": ""
}
|
<?php
namespace Ddd\BoundedContextA\UI\Controller;
/**
* @author Guillaume MOREL <guillaume.morel@verylastroom.com>
*/
class AlphaController
{
}
|
{
"content_hash": "415586a897629c77a47ae21b1762ad96",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 61,
"avg_line_length": 13.636363636363637,
"alnum_prop": 0.74,
"repo_name": "gmorel/ddd-symfony2-template",
"id": "1198bfc5ee443705ec78821c56754451bd98833b",
"size": "150",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/BoundedContextA/UI/Controller/AlphaController.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "3073"
},
{
"name": "PHP",
"bytes": "53614"
}
],
"symlink_target": ""
}
|
<?php
use yii\db\Migration;
class m140805_084745_key_storage_item extends Migration
{
public function up()
{
$tableOptions = null;
if ($this->db->driverName === 'mysql') {
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci';
}
$this->createTable('{{%key_storage_item}}', [
'key' => $this->string(128)->notNull(),
'value' => $this->text()->notNull(),
'comment' => $this->text(),
'updated_at' => $this->integer(),
'created_at' => $this->integer()
], $tableOptions);
$this->addPrimaryKey('pk_key_storage_item_key', '{{%key_storage_item}}', 'key');
$this->createIndex('idx_key_storage_item_key', '{{%key_storage_item}}', 'key', true);
}
public function down()
{
$this->dropTable('{{%key_storage_item}}');
}
}
|
{
"content_hash": "14cb32adc2c0544dc1dc46d97dd94bef",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 93,
"avg_line_length": 29.3,
"alnum_prop": 0.5278725824800911,
"repo_name": "Rafalsky/home-finance",
"id": "b5785b7cef3c27dccf90089dc092a8a6018fbf9f",
"size": "879",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "common/migrations/db/m140805_084745_key_storage_item.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "474"
},
{
"name": "Batchfile",
"bytes": "2069"
},
{
"name": "CSS",
"bytes": "7255"
},
{
"name": "JavaScript",
"bytes": "14266"
},
{
"name": "PHP",
"bytes": "716140"
}
],
"symlink_target": ""
}
|
using com.codename1.ui.geom;
namespace com.codename1.impl
{
class DrawArcPainter : AsyncOp
{
private Rectangle clip;
private int x;
private int y;
private int w;
private int h;
private int color;
private int alpha;
private int startAngle;
private int arcAngle;
public DrawArcPainter(Rectangle clip, int x, int y, int w, int h, int color, int alpha, int startAngle, int arcAngle)
: base(clip)
{
this.clip = clip;
this.x = x;
this.y = y;
this.w = w;
this.h = h;
this.color = color;
this.alpha = alpha;
this.startAngle = startAngle;
this.arcAngle = arcAngle;
}
public override void execute(WindowsGraphics underlying)
{
underlying.setColor(color);
underlying.setAlpha(alpha);
underlying.drawArc(x, y, w, h, startAngle, arcAngle);
}
}
}
|
{
"content_hash": "dd02a530a10d9021e92f5b79872eac6f",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 125,
"avg_line_length": 26.46153846153846,
"alnum_prop": 0.5290697674418605,
"repo_name": "Pmovil/CN1WindowsPort",
"id": "90440685a292b91271913894a0bb08b77a755dfe",
"size": "1034",
"binary": false,
"copies": "6",
"ref": "refs/heads/master",
"path": "src/com/codename1/impl/DrawArcPainter.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "46784339"
}
],
"symlink_target": ""
}
|
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="TestDataAnnotations.cs" company="PropertyTools">
// Copyright (c) 2014 PropertyTools contributors
// </copyright>
// --------------------------------------------------------------------------------------------------------------------
namespace ExampleLibrary
{
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Text;
using ValidationResult = System.ComponentModel.DataAnnotations.ValidationResult;
[PropertyGridExample]
public class TestDataAnnotations : TestBase, IDataErrorInfo
{
//// http://msdn.microsoft.com/en-us/library/dd901590(v=vs.95).aspx
[Category("Required")]
[Required(AllowEmptyStrings = true, ErrorMessage = "A value is required.")]
public string AllowEmptyStrings { get; set; }
[Required(AllowEmptyStrings = false, ErrorMessage = "A value is required.")]
public string RequiredString { get; set; }
[Category("Range")]
[Range(0, 360, ErrorMessage = "The angle must be in the interval [0,360].")]
public int AngleInDegrees { get; set; }
[Range(-Math.PI, Math.PI, ErrorMessage = "Angle must be in the interval [-pi,pi].")]
public double AngleInRadians { get; set; }
[Category("StringLength")]
[StringLength(20, MinimumLength = 1, ErrorMessage = "Maximum length is 20. Minimum length is 1.")]
public string CityName { get; set; }
[Category("RegularExpression")]
[RegularExpression(@"^[a-zA-Z''-'\s]{2,40}$", ErrorMessage = "Invalid name.")]
public string FirstName { get; set; }
[Category("CustomValidation")]
[CustomValidation(typeof(AWValidation), "ValidateSalesPerson")]
public string SalesPerson { get; set; }
public TestDataAnnotations()
{
AngleInDegrees = 360;
AngleInRadians = Math.PI / 2;
CityName = "Dublin";
FirstName = "No numbers";
AllowEmptyStrings = "";
RequiredString = "Required value";
SalesPerson = "Joe";
}
public override string ToString()
{
return "Data annotations";
}
string IDataErrorInfo.Error { get { return string.Empty; } }
string IDataErrorInfo.this[string columnName]
{
get
{
var pi = GetType().GetProperty(columnName);
var value = pi.GetValue(this, null);
var context = new ValidationContext(this, null, null) { MemberName = columnName };
var validationResults = new List<ValidationResult>();
if (!Validator.TryValidateProperty(value, context, validationResults))
{
var sb = new StringBuilder();
foreach (var vr in validationResults)
{
sb.AppendLine(vr.ErrorMessage);
}
return sb.ToString().Trim();
}
return null;
}
}
}
public class AWValidation
{
// http://msdn.microsoft.com/en-us/library/system.componentmodel.dataannotations.customvalidationattribute(v=vs.95).aspx
public static ValidationResult ValidateSalesPerson(string salesPerson)
{
bool isValid;
isValid = salesPerson.Contains("Joe");
if (isValid)
{
return ValidationResult.Success;
}
else
{
return new ValidationResult(
"The selected sales person is not available for this customer.");
}
}
}
}
|
{
"content_hash": "91b5c9e7cb6722bad5aee9a4eca35890",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 128,
"avg_line_length": 36.45454545454545,
"alnum_prop": 0.5256857855361596,
"repo_name": "jogibear9988/PropertyTools",
"id": "dbbeaa92e8741257fdcb0851a7802da789200ccd",
"size": "4012",
"binary": false,
"copies": "6",
"ref": "refs/heads/master",
"path": "Source/Examples/PropertyGrid/ExampleLibrary/Tests/TestDataAnnotations.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "1239710"
},
{
"name": "Shell",
"bytes": "236"
},
{
"name": "Smalltalk",
"bytes": "98162"
}
],
"symlink_target": ""
}
|
<?php
try{
$host = "127.0.0.1"; // Use an IP Adresse
$dbName = "ecvchat";
$dbUsername = "root";
$dbPassword = "r00t";
$conn = new PDO("mysql:host=$host;dbname=$dbName", $dbUsername, $dbPassword);
$conn->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION ); // Activate exception
} catch (\PDOException $e){
echo $e->getMessage();
exit;
}
|
{
"content_hash": "3898136f6429fb5d08dede1ba7b04709",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 89,
"avg_line_length": 27.615384615384617,
"alnum_prop": 0.637883008356546,
"repo_name": "Rouksana/ecvd-php",
"id": "a898c8a09902cd595034291ac7a1d89303127cdd",
"size": "359",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "finaltest/solution/pdo.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "213787"
},
{
"name": "HTML",
"bytes": "45075"
},
{
"name": "JavaScript",
"bytes": "169171"
},
{
"name": "PHP",
"bytes": "455935"
},
{
"name": "Shell",
"bytes": "2076"
}
],
"symlink_target": ""
}
|
import { Injectable } from '@angular/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
/**
* @name Flashlight
* @description This plugin allows you to switch the flashlight / torch of the device on and off.
*
* Requires Cordova plugin: `cordova-plugin-flashlight`. For more info, please see the [Flashlight plugin docs](https://github.com/EddyVerbruggen/Flashlight-PhoneGap-Plugin).
*
* @usage
* ```typescript
* import { Flashlight } from '@ionic-native/flashlight';
*
* constructor(private flashlight: Flashlight) { }
*
* ...
*
* this.flashlight.switchOn();
*
* ```
*/
@Plugin({
pluginName: 'Flashlight',
plugin: 'cordova-plugin-flashlight',
pluginRef: 'window.plugins.flashlight',
repo: 'https://github.com/EddyVerbruggen/Flashlight-PhoneGap-Plugin.git',
platforms: ['Android', 'iOS', 'Windows Phone 8']
})
@Injectable()
export class Flashlight extends IonicNativePlugin {
/**
* Checks if the flashlight is available
* @returns {Promise<boolean>} Returns a promise that resolves with a boolean stating if the flashlight is available.
*/
@Cordova()
available(): Promise<boolean> { return; }
/**
* Switches the flashlight on
* @returns {Promise<boolean>}
*/
@Cordova()
switchOn(): Promise<boolean> { return; }
/**
* Switches the flashlight off
* @returns {Promise<boolean>}
*/
@Cordova()
switchOff(): Promise<boolean> { return; }
/**
* Toggles the flashlight
* @returns {Promise<any>}
*/
@Cordova()
toggle(): Promise<any> { return; }
/**
* Checks if the flashlight is turned on.
* @returns {boolean}
*/
@Cordova({
sync: true
})
isSwitchedOn(): boolean { return; }
}
|
{
"content_hash": "9e3dfc1da07a6e5a117cb1f045410900",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 174,
"avg_line_length": 24.457142857142856,
"alnum_prop": 0.6629672897196262,
"repo_name": "klirix/ionic-native",
"id": "5064b04fbc2de3855c4df08988a71bb9964a0c2c",
"size": "1712",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/@ionic-native/plugins/flashlight/index.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "20588"
},
{
"name": "Shell",
"bytes": "9384"
},
{
"name": "TypeScript",
"bytes": "756120"
}
],
"symlink_target": ""
}
|
set -e
if [ -z "${RUNFILES}" ]; then
RUNFILES="$(CDPATH= cd -- "$0.runfiles" && pwd)"
fi
if [ "$(uname)" = "Darwin" ]; then
sedi="sed -i ''"
else
sedi="sed -i"
fi
PLUGIN_RUNFILE_DIR="${RUNFILES}/org_xprof/plugin"
FRONTEND_RUNFILE_DIR="${RUNFILES}/org_xprof/frontend"
dest="/tmp/profile-pip"
mkdir -p "$dest"
cd "$dest"
# Copy all necessary files for setup.
cp "$PLUGIN_RUNFILE_DIR/README.rst" .
# Copy plugin python files.
cd ${PLUGIN_RUNFILE_DIR}
find . -name '*.py' | cpio -updL $dest
cd $dest
chmod -R 755 .
cp ${BUILD_WORKSPACE_DIRECTORY}/bazel-bin/plugin/tensorboard_plugin_profile/protobuf/*_pb2.py tensorboard_plugin_profile/protobuf/
find tensorboard_plugin_profile/protobuf -name \*.py -exec $sedi -e '
s/^from plugin.tensorboard_plugin_profile/from tensorboard_plugin_profile/
' {} +
# Copy static files.
cd tensorboard_plugin_profile
mkdir -p static
cd static
cp "$PLUGIN_RUNFILE_DIR/tensorboard_plugin_profile/static/index.html" .
cp "$PLUGIN_RUNFILE_DIR/tensorboard_plugin_profile/static/index.js" .
cp "$PLUGIN_RUNFILE_DIR/tensorboard_plugin_profile/static/materialicons.woff2" .
cp "$PLUGIN_RUNFILE_DIR/trace_viewer/trace_viewer_index.html" .
cp "$PLUGIN_RUNFILE_DIR/trace_viewer/trace_viewer_index.js" .
cp -LR "$FRONTEND_RUNFILE_DIR/bundle.js" .
cp -LR "$FRONTEND_RUNFILE_DIR/styles.css" .
cp -LR "$FRONTEND_RUNFILE_DIR/zone.js" .
|
{
"content_hash": "94b9fafeeb5269a1c29fc0220551c5f3",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 130,
"avg_line_length": 31.068181818181817,
"alnum_prop": 0.7161667885881492,
"repo_name": "tensorflow/profiler",
"id": "3761b2233703de3404c184fcef1e29e6d759a901",
"size": "1988",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "plugin/build_pip_package.sh",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "99622"
},
{
"name": "JavaScript",
"bytes": "3029"
},
{
"name": "Python",
"bytes": "164616"
},
{
"name": "SCSS",
"bytes": "32775"
},
{
"name": "Shell",
"bytes": "1988"
},
{
"name": "Starlark",
"bytes": "95479"
},
{
"name": "TypeScript",
"bytes": "466656"
}
],
"symlink_target": ""
}
|
{% extends "dojango/base_btoscript.html" %}
<!-- ########### Script Area: ###########-->
{% block dojango_content_script %}
{% include "lighthouse/btoscript/script.html" %}
{% endblock %}
{% block dojango_content_aboutBTO %}
{% include "lighthouse/btoscript/aboutBTO.html" %}
{% endblock %}
{% block dojango_content_script_output %}
{% include "lighthouse/btoscript/script_output.html" %}
{% endblock %}
|
{
"content_hash": "73a76fcb48a4a9c6131173a843b232ca",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 55,
"avg_line_length": 25.5625,
"alnum_prop": 0.6454767726161369,
"repo_name": "LighthouseHPC/lighthouse",
"id": "158d863163bebcde5ccbb80fe7a54499054b7d30",
"size": "409",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Dlighthouse/lighthouse/templates/lighthouse/btoscript/index.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
}
|
/*
* Translated default messages for the jQuery validation plugin.
* Locale: ET (Estonian; eesti, eesti keel)
*/
$.extend($.validator.messages, {
required: "See väli peab olema täidetud.",
maxlength: $.validator.format("Palun sisestage vähem kui {0} tähemärki."),
minlength: $.validator.format("Palun sisestage vähemalt {0} tähemärki."),
rangelength: $.validator.format("Palun sisestage väärtus vahemikus {0} kuni {1} tähemärki."),
email: "Palun sisestage korrektne e-maili aadress.",
url: "Palun sisestage korrektne URL.",
date: "Palun sisestage korrektne kuupäev.",
dateISO: "Palun sisestage korrektne kuupäev (YYYY-MM-DD).",
number: "Palun sisestage korrektne number.",
digits: "Palun sisestage ainult numbreid.",
equalTo: "Palun sisestage sama väärtus uuesti.",
range: $.validator.format("Palun sisestage väärtus vahemikus {0} kuni {1}."),
max: $.validator.format("Palun sisestage väärtus, mis on väiksem või võrdne arvuga {0}."),
min: $.validator.format("Palun sisestage väärtus, mis on suurem või võrdne arvuga {0}."),
creditcard: "Palun sisestage korrektne krediitkaardi number."
});
|
{
"content_hash": "90d9937ff0e650addb75803d3c55a3e7",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 95,
"avg_line_length": 53.523809523809526,
"alnum_prop": 0.7277580071174378,
"repo_name": "Azollas/org.azolla.p.roc",
"id": "aaec19320d087e58a226bacd119886dff06b7399",
"size": "1151",
"binary": false,
"copies": "1",
"ref": "refs/heads/mirror",
"path": "src/main/webapp/bower_components/jquery-validation/src/localization/messages_et.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "150289"
},
{
"name": "Java",
"bytes": "179109"
},
{
"name": "JavaScript",
"bytes": "2241125"
}
],
"symlink_target": ""
}
|
'use strict';
grimm.factory('AuthFactory', function(firebaseURL, $location, $timeout) {
let userId = null;
let token = null;
firebase.auth().onAuthStateChanged((user) => {
if (user){
userId = user.uid;
user.getToken()
.then(t => token = t)
// .then($location.path('/menu'))
.then($timeout);
}
});
return {
register(email, password){
firebase.auth().createUserWithEmailAndPassword(email, password);
// .then( (response) => {
// // console.log(response);
// })
// .catch(function(error) {
// var errorCode = error.code;
// var errorMessage = error.message;
// });
},
logIn(email, password) {
// if (email && password != undefined ){
firebase.auth().signInWithEmailAndPassword(email, password);
// .then( (response) => {console.log(response)})
// .catch(function(error) {
// var errorCode = error.code;
// var errorMessage = error.message;
// });
// } else {
// alert('Please login or register');
// }
},
logout () {
firebase.auth().signOut();
},
currentUser() {
return {user: userId, user_token: token};
}
};
// let ref = firebaseURL; // this is a Firebase setup (allows us to use Firebase methods)
// let currentUserData = null; // Set to null so no initial info can be there at start
//
// return {
// isAuthenticated () {
// let authData = ref.getAuth();
// return (authData) ? true : false;
// },
//
// getUser () {
// return currentUserData;
// },
//
// authenticate (credentials) {
// return new Promise((resolve, reject) => {
// ref.authWithPassword({
// "email": credentials.email,
// "password": credentials.password
// }, (error, authData) => {
// if (error) {
// reject(error);
// console.log("Login did not work");
// } else {
// console.log("authWithPassword method completed successfully");
// currentUserData = authData;
// resolve(authData);
// }
// });
// });
// },
//
// storeUser (authData) {
// let stringifiedUser = JSON.stringify({ uid: authData.uid });
//
// return new Promise((resolve, reject) => {
// $http
// .post(`${firebaseURL}/users.json`, stringifiedUser)
// .then(
// res => resolve(res),
// err => reject(err)
// );
// });
// }
//
// };
});
|
{
"content_hash": "741197dcae0d309ccc7807a8ef34562c",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 92,
"avg_line_length": 27.1875,
"alnum_prop": 0.5038314176245211,
"repo_name": "Jessicashinjo/Grimm",
"id": "472531d4b56118aa35caa60dbac8271f0b1c7ad9",
"size": "2610",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "public/app/factories/login.factory.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "2338"
},
{
"name": "HTML",
"bytes": "3255"
},
{
"name": "JavaScript",
"bytes": "23920"
}
],
"symlink_target": ""
}
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>QRoundProgressBar: Class Index</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="Logo.png"/></td>
<td style="padding-left: 0.5em;">
<div id="projectname">QRoundProgressBar
 <span id="projectnumber">0.1.b</span>
</div>
<div id="projectbrief">Qt circular progress bar widget</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class List</span></a></li>
<li class="current"><a href="classes.html"><span>Class Index</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Pages</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle">
<div class="title">Class Index</div> </div>
</div><!--header-->
<div class="contents">
<div class="qindex"><a class="qindex" href="#letter_Q">Q</a></div>
<table style="margin: 10px; white-space: nowrap;" align="center" width="95%" border="0" cellspacing="0" cellpadding="0">
<tr><td rowspan="2" valign="bottom"><a name="letter_Q"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">  Q  </div></td></tr></table>
</td><td></td></tr>
<tr><td></td></tr>
<tr><td valign="top"><a class="el" href="class_q_round_progress_bar.html">QRoundProgressBar</a>   </td><td></td></tr>
<tr><td></td><td></td></tr>
</table>
<div class="qindex"><a class="qindex" href="#letter_Q">Q</a></div>
</div><!-- contents -->
<hr>
Designed by Sintegrial Technologies (c) 2015-now
|
{
"content_hash": "01e56594d65ffe494bf97c466c8abb38",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 826,
"avg_line_length": 50.80392156862745,
"alnum_prop": 0.6549594751061366,
"repo_name": "ozmartian/QRoundProgressBar",
"id": "2d0baed38679237efc31ddcff68ada639f57e0b1",
"size": "5182",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/classes.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Python",
"bytes": "39785"
}
],
"symlink_target": ""
}
|
import logging
import os
import unittest
from telemetry import test
from telemetry.core import bitmap
from telemetry.core import util
from telemetry.core.platform import android_platform_backend
from telemetry.unittest import system_stub
class MockAdbCommands(object):
def __init__(self, mock_content):
self.mock_content = mock_content
def CanAccessProtectedFileContents(self):
return True
# pylint: disable=W0613
def GetProtectedFileContents(self, file_name, log_result):
return self.mock_content
def PushIfNeeded(self, host_binary, device_path):
pass
def RunShellCommand(self, command):
return []
class AndroidPlatformBackendTest(unittest.TestCase):
def setUp(self):
self._stubs = system_stub.Override(android_platform_backend,
['perf_control', 'thermal_throttle'])
def tearDown(self):
self._stubs.Restore()
@test.Disabled('chromeos')
def testGetCpuStats(self):
proc_stat_content = [
'7702 (.android.chrome) S 167 167 0 0 -1 1077936448 '
'3247 0 0 0 4 1 0 0 20 0 9 0 5603962 337379328 5867 '
'4294967295 1074458624 1074463824 3197495984 3197494152 '
'1074767676 0 4612 0 38136 4294967295 0 0 17 0 0 0 0 0 0 '
'1074470376 1074470912 1102155776']
adb_valid_proc_content = MockAdbCommands(proc_stat_content)
backend = android_platform_backend.AndroidPlatformBackend(
adb_valid_proc_content, False)
cpu_stats = backend.GetCpuStats('7702')
self.assertEquals(cpu_stats, {'CpuProcessTime': 5.0})
@test.Disabled('chromeos')
def testGetCpuStatsInvalidPID(self):
# Mock an empty /proc/pid/stat.
adb_empty_proc_stat = MockAdbCommands([])
backend = android_platform_backend.AndroidPlatformBackend(
adb_empty_proc_stat, False)
cpu_stats = backend.GetCpuStats('7702')
self.assertEquals(cpu_stats, {})
@test.Disabled
def testFramesFromMp4(self):
mock_adb = MockAdbCommands([])
backend = android_platform_backend.AndroidPlatformBackend(mock_adb, False)
try:
backend.InstallApplication('avconv')
finally:
if not backend.CanLaunchApplication('avconv'):
logging.warning('Test not supported on this platform')
return # pylint: disable=W0150
vid = os.path.join(util.GetUnittestDataDir(), 'vid.mp4')
expected_timestamps = [
0,
763,
783,
940,
1715,
1732,
1842,
1926,
]
# pylint: disable=W0212
for i, timestamp_bitmap in enumerate(backend._FramesFromMp4(vid)):
timestamp, bmp = timestamp_bitmap
self.assertEquals(timestamp, expected_timestamps[i])
expected_bitmap = bitmap.Bitmap.FromPngFile(os.path.join(
util.GetUnittestDataDir(), 'frame%d.png' % i))
self.assertTrue(expected_bitmap.IsEqual(bmp))
|
{
"content_hash": "cbf3fcde014d7da8652aa7f8c6f93725",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 78,
"avg_line_length": 31.13186813186813,
"alnum_prop": 0.6858453935757148,
"repo_name": "ChromiumWebApps/chromium",
"id": "c5cbe65f8a90795afbf54cf97e398bfa20a9d080",
"size": "2996",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tools/telemetry/telemetry/core/platform/android_platform_backend_unittest.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "ASP",
"bytes": "853"
},
{
"name": "AppleScript",
"bytes": "6973"
},
{
"name": "Arduino",
"bytes": "464"
},
{
"name": "Assembly",
"bytes": "52960"
},
{
"name": "Awk",
"bytes": "8660"
},
{
"name": "C",
"bytes": "42286199"
},
{
"name": "C#",
"bytes": "1132"
},
{
"name": "C++",
"bytes": "198616766"
},
{
"name": "CSS",
"bytes": "937333"
},
{
"name": "DOT",
"bytes": "2984"
},
{
"name": "Java",
"bytes": "5695686"
},
{
"name": "JavaScript",
"bytes": "21967126"
},
{
"name": "M",
"bytes": "2190"
},
{
"name": "Matlab",
"bytes": "2262"
},
{
"name": "Objective-C",
"bytes": "7602057"
},
{
"name": "PHP",
"bytes": "97817"
},
{
"name": "Perl",
"bytes": "1210885"
},
{
"name": "Python",
"bytes": "10774996"
},
{
"name": "R",
"bytes": "262"
},
{
"name": "Shell",
"bytes": "1316721"
},
{
"name": "Tcl",
"bytes": "277091"
},
{
"name": "TypeScript",
"bytes": "1560024"
},
{
"name": "XSLT",
"bytes": "13493"
},
{
"name": "nesC",
"bytes": "15243"
}
],
"symlink_target": ""
}
|
require 'rubygems'
require 'oauth'
require 'json'
require 'unirest'
require 'twitter'
def return_tweets
# response = Unirest.get "https://api.twitter.com/1.1/lists/statuses",
# headers:{ "oauth_consumer_key"=> "6E8kVpweOJNV3xJg21eVskMc0",
# "oauth_nonce"=>"53b7d39ea4dba924ce6f6d2d14687ac6",
# "oauth_signature"=>"NlG9w08Qh%2BLXQcGRllGcRrj4eQA%3D",
# "oauth_signature_method"=>"HMAC-SHA1",
# "oauth_timestamp"=>"1427871835",
# "oauth_token"=>"38801784-PhpwqtwhxLbEPrqWxTIIM1b1JkcoI6Vjp633yMBjK",
# "oauth_version"=>"1.0" }
# parameters:{ "slug" => "nba", "owner_screen_name" => "baottran" }
client = Twitter::REST::Client.new do |config|
config.consumer_key = "6E8kVpweOJNV3xJg21eVskMc0"
config.consumer_secret = "53b7d39ea4dba924ce6f6d2d14687ac6"
config.access_token = "38801784-PhpwqtwhxLbEPrqWxTIIM1b1JkcoI6Vjp633yMBjK"
# config.access_token_secret = "YOUR_ACCESS_SECRET"
end
p response.code # Status code
response.headers # Response headers
response.body # Parsed body
response.raw_body # Unparsed body
end
return_list
# # Now you will fetch /1.1/statuses/show.json, which
# # takes an 'id' parameter and returns the
# # representation of a single Tweet.
# https://api.twitter.com/1.1/lists/statuses.json?slug=teams&owner_screen_name=MLS&count=1
# baseurl = "https://api.twitter.com"
# path = "/1.1/statuses/show.json"
# query = URI.encode_www_form("id" => 266270116780576768)
# address = URI("#{baseurl}#{path}?#{query}")
# request = Net::HTTP::Get.new address.request_uri
# # Print data about a Tweet
# def print_tweet(tweet)
# # puts JSON.pretty_generate(tweet)
# # ADD CODE TO PRINT THE TWEET IN "<screen name> - <text>" FORMAT
# puts tweet["user"]["screen_name"] + " - " + tweet["text"]
# end
# # Set up HTTP.
# http = Net::HTTP.new address.host, address.port
# http.use_ssl = true
# http.verify_mode = OpenSSL::SSL::VERIFY_PEER
# # If you entered your credentials in the first
# # exercise, no need to enter them again here. The
# # ||= operator will only assign these values if
# # they are not already set.
# consumer_key = OAuth::Consumer.new(
# "6E8kVpweOJNV3xJg21eVskMc0",
# "5Y10wM2IlEdXvgzu3hV0utIMzLiTIdSZ4efEioV7uuWWOFehso")
# access_token = OAuth::Token.new(
# "38801784-PhpwqtwhxLbEPrqWxTIIM1b1JkcoI6Vjp633yMBjK",
# "2ugh5cVsUn73fop6LrWrAyIUTyeCfbDYBXwZ9wHNsaIWf")
# # Issue the request.
# request.oauth! http, consumer_key, access_token
# http.start
# response = http.request request
# # Parse and print the Tweet if the response code was 200
# tweet = nil
# if response.code == '200' then
# tweet = JSON.parse(response.body)
# print_tweet(tweet)
# end
|
{
"content_hash": "cb4b254a7b5c5dd279d7ce1befd719c0",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 90,
"avg_line_length": 33.40243902439025,
"alnum_prop": 0.6903979554581964,
"repo_name": "baottran/CRITIQ",
"id": "d1603a2e89404b186f8c1e9ae77b7b3fc1f90f80",
"size": "3302",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "_tests/twitterlist.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "280648"
},
{
"name": "HTML",
"bytes": "15195"
},
{
"name": "JavaScript",
"bytes": "5564"
},
{
"name": "Ruby",
"bytes": "75922"
}
],
"symlink_target": ""
}
|
using KotoriCore.Exceptions;
using KotoriQuery.Helpers;
using System.Collections.Generic;
using System.Text;
namespace KotoriCore.Translators
{
/// <summary>
/// Base translator.
/// </summary>
public static class BaseTranslator
{
/// <summary>
/// Translates complex query for a given entity / field transformations to a valid query for document db.
/// </summary>
/// <param name="query">Complex query.</param>
/// <param name="entity">Entity name.</param>
/// <param name="fieldTransformations">A collection fo field transformations.</param>
/// <param name="additionalWhereConditions">Additional where conditions</param>
/// <returns>Translated query.</returns>
public static string Translate(ComplexQuery query, string entity, IEnumerable<FieldTransformation> fieldTransformations, string additionalWhereConditions)
{
if (entity == null)
throw new System.ArgumentNullException(nameof(entity));
if (query.Instance == null)
throw new KotoriException("Instance not set. Query cannot be created.");
var sb = new StringBuilder();
if (query != null)
{
if (!string.IsNullOrWhiteSpace(query.Select))
{
if (query.Count)
{
sb.Append("select count(1) ");
}
else
{
sb.Append("select ");
if (query.Top != null &&
!query.Count)
sb.Append($"top {query.Top} ");
var select = new KotoriQuery.Translator.DocumentDbSelect(query.Select, fieldTransformations);
sb.Append(select.GetTranslatedQuery());
}
}
else if (query.Count)
{
sb.Append("select count(1)");
}
else
{
sb.Append("select ");
if (query.Top != null &&
!query.Count)
sb.Append($"top {query.Top} ");
sb.Append("*");
}
sb.Append(" from c where ");
if (!string.IsNullOrWhiteSpace(query.Filter))
{
var filter = query.Filter;
filter += $" and entity eq '{entity}' and instance eq '{query.Instance}' ";
var select = new KotoriQuery.Translator.DocumentDbFilter(filter, fieldTransformations);
sb.Append(select.GetTranslatedQuery());
}
else
{
var select = new KotoriQuery.Translator.DocumentDbFilter($"entity eq '{entity}' and instance eq '{query.Instance}' ", fieldTransformations);
sb.Append(select.GetTranslatedQuery());
}
if (!string.IsNullOrWhiteSpace(additionalWhereConditions))
{
var awc = $" and {additionalWhereConditions.Trim()} ";
var select = new KotoriQuery.Translator.DocumentDbFilter(awc, fieldTransformations);
sb.Append(select.GetTranslatedQuery());
}
if (!string.IsNullOrWhiteSpace(query.OrderBy) &&
!query.Count)
{
sb.Append("order by ");
var select = new KotoriQuery.Translator.DocumentDbOrderBy(query.OrderBy, fieldTransformations);
sb.Append(select.GetTranslatedQuery());
}
}
return sb.ToString();
}
}
}
|
{
"content_hash": "d2ecc6144d87ad4ece903368037eacf3",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 162,
"avg_line_length": 37.705882352941174,
"alnum_prop": 0.4971398855954238,
"repo_name": "kotorihq/kotori-core",
"id": "4b9ccd05349e9284f234ba7544801f807825f310",
"size": "3848",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "KotoriCore/Translators/BaseTranslator.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "428239"
}
],
"symlink_target": ""
}
|
// (C) Copyright 2015 Martin Dougiamas
//
// 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.
import { Injectable } from '@angular/core';
import { CoreContentLinksModuleListHandler } from '@core/contentlinks/classes/module-list-handler';
import { CoreContentLinksHelperProvider } from '@core/contentlinks/providers/helper';
import { TranslateService } from '@ngx-translate/core';
import { AddonModLessonProvider } from './lesson';
/**
* Handler to treat links to lesson list page.
*/
@Injectable()
export class AddonModLessonListLinkHandler extends CoreContentLinksModuleListHandler {
name = 'AddonModLessonListLinkHandler';
constructor(linkHelper: CoreContentLinksHelperProvider, translate: TranslateService,
protected lessonProvider: AddonModLessonProvider) {
super(linkHelper, translate, 'AddonModLesson', 'lesson');
}
/**
* Check if the handler is enabled on a site level.
*
* @return {Promise<boolean>} Promise resolved with boolean: whether or not the handler is enabled on a site level.
*/
isEnabled(): Promise<boolean> {
return this.lessonProvider.isPluginEnabled();
}
}
|
{
"content_hash": "396c1a6001ce39db66867813c310e953",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 119,
"avg_line_length": 40.48780487804878,
"alnum_prop": 0.736144578313253,
"repo_name": "saman222/moodlemobile2",
"id": "d208a3bbaf79a0306ba9d8576e5eaba4c4837036",
"size": "1660",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/addon/mod/lesson/providers/list-link-handler.ts",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "165487"
},
{
"name": "Dockerfile",
"bytes": "619"
},
{
"name": "HTML",
"bytes": "662413"
},
{
"name": "JavaScript",
"bytes": "24290"
},
{
"name": "PHP",
"bytes": "15635"
},
{
"name": "Shell",
"bytes": "14280"
},
{
"name": "TypeScript",
"bytes": "7972962"
}
],
"symlink_target": ""
}
|
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE690_NULL_Deref_From_Return__int_realloc_34.c
Label Definition File: CWE690_NULL_Deref_From_Return.free.label.xml
Template File: source-sinks-34.tmpl.c
*/
/*
* @description
* CWE: 690 Unchecked Return Value To NULL Pointer
* BadSource: realloc Allocate data using realloc()
* Sinks:
* GoodSink: Check to see if the data allocation failed and if not, use data
* BadSink : Don't check for NULL and use data
* Flow Variant: 34 Data flow: use of a union containing two methods of accessing the same data (within the same function)
*
* */
#include "std_testcase.h"
#include <wchar.h>
typedef union
{
int * unionFirst;
int * unionSecond;
} CWE690_NULL_Deref_From_Return__int_realloc_34_unionType;
#ifndef OMITBAD
void CWE690_NULL_Deref_From_Return__int_realloc_34_bad()
{
int * data;
CWE690_NULL_Deref_From_Return__int_realloc_34_unionType myUnion;
data = NULL; /* Initialize data */
/* POTENTIAL FLAW: Allocate memory without checking if the memory allocation function failed */
data = (int *)realloc(data, 1*sizeof(int));
myUnion.unionFirst = data;
{
int * data = myUnion.unionSecond;
/* FLAW: Initialize memory buffer without checking to see if the memory allocation function failed */
data[0] = 5;
printIntLine(data[0]);
free(data);
}
}
#endif /* OMITBAD */
#ifndef OMITGOOD
/* goodB2G() uses the BadSource with the GoodSink */
static void goodB2G()
{
int * data;
CWE690_NULL_Deref_From_Return__int_realloc_34_unionType myUnion;
data = NULL; /* Initialize data */
/* POTENTIAL FLAW: Allocate memory without checking if the memory allocation function failed */
data = (int *)realloc(data, 1*sizeof(int));
myUnion.unionFirst = data;
{
int * data = myUnion.unionSecond;
/* FIX: Check to see if the memory allocation function was successful before initializing the memory buffer */
if (data != NULL)
{
data[0] = 5;
printIntLine(data[0]);
free(data);
}
}
}
void CWE690_NULL_Deref_From_Return__int_realloc_34_good()
{
goodB2G();
}
#endif /* OMITGOOD */
/* Below is the main(). It is only used when building this testcase on
its own for testing or for building a binary to use in testing binary
analysis tools. It is not used when compiling all the testcases as one
application, which is how source code analysis tools are tested. */
#ifdef INCLUDEMAIN
int main(int argc, char * argv[])
{
/* seed randomness */
srand( (unsigned)time(NULL) );
#ifndef OMITGOOD
printLine("Calling good()...");
CWE690_NULL_Deref_From_Return__int_realloc_34_good();
printLine("Finished good()");
#endif /* OMITGOOD */
#ifndef OMITBAD
printLine("Calling bad()...");
CWE690_NULL_Deref_From_Return__int_realloc_34_bad();
printLine("Finished bad()");
#endif /* OMITBAD */
return 0;
}
#endif
|
{
"content_hash": "0f3ccde957349bba6d3c080d43206f15",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 122,
"avg_line_length": 30.405940594059405,
"alnum_prop": 0.6463692608270921,
"repo_name": "maurer/tiamat",
"id": "47122e9c55e2b123c20e94ae72696c5f49222e0f",
"size": "3071",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "samples/Juliet/testcases/CWE690_NULL_Deref_From_Return/s01/CWE690_NULL_Deref_From_Return__int_realloc_34.c",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
}
|
g3server
========
G3Chat Server
1. Get the original openfire 3.7.1 source code from :http://olex.openlogic.com/packages/openfire/3.7.1
2. Merge the source code with G3Chat Server: https://github.com/coodeer/g3server
3. Install JDK and Ant tools for openfire build :http://apache.xmlcity.org/ant/binaries/
4. Build with Ant:
Configure your JAVA_HOME and ANT_HOME, Enter openfire/build, run ant.
5. Build with Eclipse GUI.
a. Read configure_openfire.pdf
b. Merge the source code to original openfire 3.7.1 source code, build your xmpp server.
c. Open with eclipse(configure refer to configure_openfire.pdf)。
d. Install mysql in local for debug, and setup your database( run src/database/openfire_sqlserver.sql) to initialize the database[ I add a table ofG3ChatUser].
e. Run configure, then you can configure with http://127.0.0.1:9090 ,login with admin user, configure the database。
f. Configure the openfile( email setting for get password server)。
g. Run your g3chat client to connect with your local server。
h. If the debug is OK, build your project with ant. then you can get your target/openfire folder ( check the target/openfire/lib/openfire.jar was updated by ant and plugin was updated)
i. Upload your target/openfire folder to you really server, /bin/openfire.sh to run it( need configure with web again).
|
{
"content_hash": "284e3f5e74b088c08a78942afaca7205",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 185,
"avg_line_length": 40.75757575757576,
"alnum_prop": 0.758364312267658,
"repo_name": "coodeer/g3server",
"id": "50b262926f366331bd4d3e3d976ff4f42bf30c5d",
"size": "1353",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "196329"
},
{
"name": "Java",
"bytes": "8665348"
},
{
"name": "JavaScript",
"bytes": "440518"
},
{
"name": "Shell",
"bytes": "25315"
}
],
"symlink_target": ""
}
|
from aiohttp.helpers import sentinel
from aiohttp.web import Response as aioResponse
from datetime import datetime
from plone.server import configure
from plone.server.browser import Response
from plone.server.interfaces import IFrameFormatsJson
from plone.server.interfaces import IRendered
from plone.server.interfaces import IRendererFormatHtml
from plone.server.interfaces import IRendererFormatJson
from plone.server.interfaces import IRendererFormatRaw
from plone.server.interfaces import IRenderFormats
from plone.server.interfaces import IRequest
from plone.server.interfaces import IView
from zope.component import queryAdapter
from zope.interface.interface import InterfaceClass
from plone.server.interfaces.security import PermissionSetting
import json
class PServerJSONEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, complex):
return [obj.real, obj.imag]
elif isinstance(obj, datetime):
return obj.isoformat()
elif isinstance(obj, type):
return obj.__module__ + '.' + obj.__name__
elif isinstance(obj, InterfaceClass):
return [x.__module__ + '.' + x.__name__ for x in obj.__iro__] # noqa
try:
iterable = iter(obj)
except TypeError:
pass
else:
return list(iterable)
if isinstance(obj, PermissionSetting):
return obj.getName()
if callable(obj):
return obj.__module__ + '.' + obj.__name__
# Let the base class default method raise the TypeError
return json.JSONEncoder.default(self, obj)
def json_response(data=sentinel, *, text=None, body=None, status=200,
reason=None, headers=None, content_type='application/json',
dumps=json.dumps):
if data is not sentinel:
if text or body:
raise ValueError(
"only one of data, text, or body should be specified"
)
else:
text = dumps(data, cls=PServerJSONEncoder)
return aioResponse(
text=text, body=body, status=status, reason=reason,
headers=headers, content_type=content_type)
@configure.adapter(for_=IRequest, provides=IRenderFormats)
class RendererFormats(object):
def __init__(self, request):
self.request = request
@configure.adapter(for_=IRequest, provides=IRendererFormatJson)
class RendererFormatJson(object):
def __init__(self, request):
self.request = request
@configure.adapter(for_=IRequest, provides=IRendererFormatHtml)
class RendererFormatHtml(object):
def __init__(self, request):
self.request = request
@configure.adapter(for_=IRequest, provides=IRendererFormatRaw)
class RendererFormatRaw(object):
def __init__(self, request):
self.request = request
# Real objects
@configure.adapter(
for_=(IRenderFormats, IView, IRequest),
provides=IRendered)
class Renderer(object):
def __init__(self, renderformat, view, request):
self.view = view
self.request = request
self.renderformat = renderformat
def _is_pserver_response(resp):
return hasattr(resp, '__class__') and issubclass(resp.__class__, Response)
@configure.adapter(
for_=(IRendererFormatJson, IView, IRequest),
provides=IRendered)
class RendererJson(Renderer):
async def __call__(self, value):
headers = {}
if _is_pserver_response(value):
json_value = value.response
headers = value.headers
status = value.status
else:
# Not a Response object, don't convert
return value
# Framing of options
frame = self.request.get('frame')
frame = self.request.GET['frame'] if 'frame' in self.request.GET else ''
if frame:
framer = queryAdapter(self.request, IFrameFormatsJson, frame)
json_value = framer(json_value)
resp = json_response(json_value)
resp.headers.update(headers)
resp.headers.update(
{'Content-Type': 'application/json'})
resp.set_status(status)
# Actions / workflow / roles
return resp
@configure.adapter(
for_=(IRendererFormatHtml, IView, IRequest),
provides=IRendered)
class RendererHtml(Renderer):
async def __call__(self, value):
# Safe html transformation
if _is_pserver_response(value):
body = value.response
if not isinstance(body, bytes):
if not isinstance(body, str):
body = json.dumps(value.response)
body = body.encode('utf8')
value = aioResponse(
body=body, status=value.status,
headers=value.headers)
if 'content-type' not in value.headers:
value.headers.update({
'content-type': 'text/html'
})
return value
@configure.adapter(
for_=(IRendererFormatRaw, IView, IRequest),
provides=IRendered)
class RendererRaw(Renderer):
def guess_response(self, value):
resp = value.response
if isinstance(resp, dict):
resp = aioResponse(body=bytes(json.dumps(resp, cls=PServerJSONEncoder), 'utf-8'))
resp.headers['Content-Type'] = 'application/json'
elif isinstance(resp, list):
resp = aioResponse(body=bytes(json.dumps(resp, cls=PServerJSONEncoder), 'utf-8'))
resp.headers['Content-Type'] = 'application/json'
elif isinstance(resp, str):
resp = aioResponse(body=bytes(resp, 'utf-8'))
resp.headers['Content-Type'] = 'text/html'
elif resp is None:
# missing result...
resp = aioResponse(body=b'{}')
resp.headers['Content-Type'] = 'application/json'
resp.headers.update(value.headers)
if not resp.prepared:
resp.set_status(value.status)
return resp
async def __call__(self, value):
resp = value
if isinstance(value, Response):
resp = self.guess_response(value)
return resp
|
{
"content_hash": "a827033e757b4ca5be87a50d5bf2e495",
"timestamp": "",
"source": "github",
"line_count": 184,
"max_line_length": 93,
"avg_line_length": 33.22282608695652,
"alnum_prop": 0.6335678063144119,
"repo_name": "plone/plone.server",
"id": "31e55b83d72173f38ab88680e94dcadd06a9169c",
"size": "6139",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/plone.server/plone/server/renderers.py",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "C",
"bytes": "2201"
},
{
"name": "Nix",
"bytes": "22528"
},
{
"name": "Python",
"bytes": "502454"
}
],
"symlink_target": ""
}
|
class ApplicationHelper::Toolbar::EmsConfigurationCenter < ApplicationHelper::Toolbar::Basic
button_group('ems_configuration_vmdb', [
select(
:ems_configuration_vmdb_choice,
nil,
t = N_('Configuration'),
t,
:enabled => true,
:items => [
button(
:ems_configuration_refresh_provider,
'fa fa-refresh fa-lg',
N_('Refresh relationships for all items related to this Provider'),
N_('Refresh Relationships and Power states'),
:confirm => N_("Refresh relationships for all items related to this Provider?"),
:klass => ApplicationHelper::Button::EmsRefresh),
separator,
button(
:ems_configuration_edit_provider,
'pficon pficon-edit fa-lg',
t = N_('Edit this Provider'),
t),
button(
:ems_configuration_delete_provider,
'pficon pficon-delete fa-lg',
t = N_('Remove this Provider from Inventory'),
t,
:data => {'function' => 'sendDataWithRx',
'function-data' => {:controller => 'provider_dialogs',
:modal_title => N_('Delete Configuration Management Provider'),
:modal_text => N_('Are you sure you want to delete the following Configuration Management Provider?'),
:api_url => 'providers',
:async_delete => true,
:redirect_url => '/ems_configuration/show_list',
:component_name => 'RemoveGenericItemModal'}})
]
),
])
button_group('ems_configuration_policy', [
select(
:ems_configuration_policy_choice,
nil,
t = N_('Policy'),
t,
:items => [
button(
:ems_configuration_tag,
'pficon pficon-edit fa-lg',
N_('Edit Tags for this Configuration Manager'),
N_('Edit Tags')),
]
),
])
end
|
{
"content_hash": "28eec7193f09e88591115716f3529bf4",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 147,
"avg_line_length": 38.833333333333336,
"alnum_prop": 0.5035765379113019,
"repo_name": "ManageIQ/manageiq-ui-classic",
"id": "22a2222ad30d4be427812a45dfe71779f13e9a5c",
"size": "2097",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/helpers/application_helper/toolbar/ems_configuration_center.rb",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "181"
},
{
"name": "HTML",
"bytes": "1292"
},
{
"name": "Haml",
"bytes": "1139195"
},
{
"name": "JavaScript",
"bytes": "1956794"
},
{
"name": "Ruby",
"bytes": "5623827"
},
{
"name": "SCSS",
"bytes": "114797"
},
{
"name": "Shell",
"bytes": "1480"
}
],
"symlink_target": ""
}
|
* AWS PaaS: EC2, ELB, etc.
* AWS ECS: Docker Orchestration
* Weave Net: Docker Networking
* Consul: Service Discovery
* Keycloak: Identify & Access management
* Fabio: Transparent HTTP(s) proxy
* Grafana: Monitoring
### Instructions
* Import cloudformation.json into AWS CloudFormation to create the platform
* Deploy microservices using AWS [ecs-cli](http://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_CLI.html) tool.
|
{
"content_hash": "fc05d77eafff5c6aff0b3140bef74629",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 121,
"avg_line_length": 36,
"alnum_prop": 0.7731481481481481,
"repo_name": "panga/tdc2017microservices",
"id": "ce92350b19e202ca6e95667d89b32ff1940e13fd",
"size": "498",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Shell",
"bytes": "3139"
}
],
"symlink_target": ""
}
|
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null
|
{
"content_hash": "d1ed100d6f49a3848204640655bfa069",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 31,
"avg_line_length": 9.692307692307692,
"alnum_prop": 0.7063492063492064,
"repo_name": "mdoering/backbone",
"id": "eefbd1f1099ebbbc44946eeccd077bab59035d79",
"size": "189",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Gentianales/Rubiaceae/Uragoga/Uragoga weddelliana/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
}
|
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>xRPC-parent</artifactId>
<groupId>org.yaccc</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<packaging>jar</packaging>
<modelVersion>4.0.0</modelVersion>
<groupId>org.yaccc</groupId>
<artifactId>xRPC-build</artifactId>
<dependencies>
<dependency>
<groupId>org.yaccc</groupId>
<artifactId>xRPC-transport</artifactId>
<version>1.0-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.yaccc</groupId>
<artifactId>xRPC-serialization</artifactId>
</exclusion>
<exclusion>
<groupId>org.yaccc</groupId>
<artifactId>xRPC-common</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.yaccc</groupId>
<artifactId>xRPC-common</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.yaccc</groupId>
<artifactId>xRPC-serialization</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.yaccc</groupId>
<artifactId>xRPC-Spring</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
|
{
"content_hash": "ce7817d019f6677ee823d082c2686bcd",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 108,
"avg_line_length": 34.18,
"alnum_prop": 0.5576360444704506,
"repo_name": "Yaccc/xRPC",
"id": "79f366c3265a2e56ac137c54a4d61d9228cde32f",
"size": "1709",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "xRPC-build/pom.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "36658"
}
],
"symlink_target": ""
}
|
#.rst:
# FindSDL_ttf
# -----------
#
# Locate SDL_ttf library
#
# This module defines:
#
# ::
#
# SDL_TTF_LIBRARIES, the name of the library to link against
# SDL_TTF_INCLUDE_DIRS, where to find the headers
# SDL_TTF_FOUND, if false, do not try to link against
# SDL_TTF_VERSION_STRING - human-readable string containing the version of SDL_ttf
#
#
#
# For backward compatibility the following variables are also set:
#
# ::
#
# SDLTTF_LIBRARY (same value as SDL_TTF_LIBRARIES)
# SDLTTF_INCLUDE_DIR (same value as SDL_TTF_INCLUDE_DIRS)
# SDLTTF_FOUND (same value as SDL_TTF_FOUND)
#
#
#
# $SDLDIR is an environment variable that would correspond to the
# ./configure --prefix=$SDLDIR used in building SDL.
#
# Created by Eric Wing. This was influenced by the FindSDL.cmake
# module, but with modifications to recognize OS X frameworks and
# additional Unix paths (FreeBSD, etc).
if(NOT SDL_TTF_INCLUDE_DIR AND SDLTTF_INCLUDE_DIR)
set(SDL_TTF_INCLUDE_DIR ${SDLTTF_INCLUDE_DIR} CACHE PATH "directory cache
entry initialized from old variable name")
endif()
find_path(SDL_TTF_INCLUDE_DIR SDL_ttf.h
HINTS
ENV SDLTTFDIR
ENV SDLDIR
PATH_SUFFIXES SDL
# path suffixes to search inside ENV{SDLDIR}
include/SDL include/SDL12 include/SDL11 include
)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(VC_LIB_PATH_SUFFIX lib/x64)
else()
set(VC_LIB_PATH_SUFFIX lib/x86)
endif()
if(NOT SDL_TTF_LIBRARY AND SDLTTF_LIBRARY)
set(SDL_TTF_LIBRARY ${SDLTTF_LIBRARY} CACHE FILEPATH "file cache entry
initialized from old variable name")
endif()
find_library(SDL_TTF_LIBRARY
NAMES SDL_ttf
HINTS
ENV SDLTTFDIR
ENV SDLDIR
PATH_SUFFIXES lib ${VC_LIB_PATH_SUFFIX}
)
if(SDL_TTF_INCLUDE_DIR AND EXISTS "${SDL_TTF_INCLUDE_DIR}/SDL_ttf.h")
file(STRINGS "${SDL_TTF_INCLUDE_DIR}/SDL_ttf.h" SDL_TTF_VERSION_MAJOR_LINE REGEX "^#define[ \t]+SDL_TTF_MAJOR_VERSION[ \t]+[0-9]+$")
file(STRINGS "${SDL_TTF_INCLUDE_DIR}/SDL_ttf.h" SDL_TTF_VERSION_MINOR_LINE REGEX "^#define[ \t]+SDL_TTF_MINOR_VERSION[ \t]+[0-9]+$")
file(STRINGS "${SDL_TTF_INCLUDE_DIR}/SDL_ttf.h" SDL_TTF_VERSION_PATCH_LINE REGEX "^#define[ \t]+SDL_TTF_PATCHLEVEL[ \t]+[0-9]+$")
string(REGEX REPLACE "^#define[ \t]+SDL_TTF_MAJOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL_TTF_VERSION_MAJOR "${SDL_TTF_VERSION_MAJOR_LINE}")
string(REGEX REPLACE "^#define[ \t]+SDL_TTF_MINOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL_TTF_VERSION_MINOR "${SDL_TTF_VERSION_MINOR_LINE}")
string(REGEX REPLACE "^#define[ \t]+SDL_TTF_PATCHLEVEL[ \t]+([0-9]+)$" "\\1" SDL_TTF_VERSION_PATCH "${SDL_TTF_VERSION_PATCH_LINE}")
set(SDL_TTF_VERSION_STRING ${SDL_TTF_VERSION_MAJOR}.${SDL_TTF_VERSION_MINOR}.${SDL_TTF_VERSION_PATCH})
unset(SDL_TTF_VERSION_MAJOR_LINE)
unset(SDL_TTF_VERSION_MINOR_LINE)
unset(SDL_TTF_VERSION_PATCH_LINE)
unset(SDL_TTF_VERSION_MAJOR)
unset(SDL_TTF_VERSION_MINOR)
unset(SDL_TTF_VERSION_PATCH)
endif()
set(SDL_TTF_LIBRARIES ${SDL_TTF_LIBRARY})
set(SDL_TTF_INCLUDE_DIRS ${SDL_TTF_INCLUDE_DIR})
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL_ttf
REQUIRED_VARS SDL_TTF_LIBRARIES SDL_TTF_INCLUDE_DIRS
VERSION_VAR SDL_TTF_VERSION_STRING)
# for backward compatibility
set(SDLTTF_LIBRARY ${SDL_TTF_LIBRARIES})
set(SDLTTF_INCLUDE_DIR ${SDL_TTF_INCLUDE_DIRS})
set(SDLTTF_FOUND ${SDL_TTF_FOUND})
mark_as_advanced(SDL_TTF_LIBRARY SDL_TTF_INCLUDE_DIR)
|
{
"content_hash": "4f5026fcd34b595a536b417b509c0eb0",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 136,
"avg_line_length": 36.845360824742265,
"alnum_prop": 0.6759932848349188,
"repo_name": "pipou/rae",
"id": "e941dd44d2a7774f169b548eb0d1651028055c5c",
"size": "3718",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "builder/cmake/windows/share/cmake-3.8/Modules/FindSDL_ttf.cmake",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "2544"
},
{
"name": "C",
"bytes": "48544"
},
{
"name": "C++",
"bytes": "6334"
},
{
"name": "CMake",
"bytes": "8152333"
},
{
"name": "CSS",
"bytes": "56991"
},
{
"name": "Cuda",
"bytes": "901"
},
{
"name": "Emacs Lisp",
"bytes": "44259"
},
{
"name": "Fortran",
"bytes": "6400"
},
{
"name": "HTML",
"bytes": "36295522"
},
{
"name": "JavaScript",
"bytes": "296574"
},
{
"name": "M4",
"bytes": "4433"
},
{
"name": "Roff",
"bytes": "4627932"
},
{
"name": "Shell",
"bytes": "59955"
},
{
"name": "Vim script",
"bytes": "140497"
}
],
"symlink_target": ""
}
|
npm install -g grunt-cli
npm install
karma start karma.conf.js
grunt build
|
{
"content_hash": "7463d97cac247b84cc2ad5b3105c8d5b",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 25,
"avg_line_length": 18.75,
"alnum_prop": 0.8,
"repo_name": "gsaini/angular-workshop",
"id": "11bc61d7c9dcb3b821fd24396f1eee1c08b1465b",
"size": "75",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "jenkins-grunt.sh",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "8813"
},
{
"name": "HTML",
"bytes": "15419"
},
{
"name": "JavaScript",
"bytes": "273311"
},
{
"name": "PowerShell",
"bytes": "468"
},
{
"name": "Shell",
"bytes": "5036"
}
],
"symlink_target": ""
}
|
<HTML><HEAD>
<TITLE>Review for Bachelor, The (1999)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1 ALIGN="CENTER" CLASS="title"><A HREF="/Title?0120596">Bachelor, The (1999)</A></H1><H3 ALIGN=CENTER>reviewed by<BR><A HREF="/ReviewsBy?Brandon+Herring+">Brandon Herring </A></H3><HR WIDTH="40%" SIZE="4">
<PRE>Rating: * out of * * * * </PRE>
<PRE>Rated: PG-13 for language.</PRE>
<P>Starring: Chris O'Donnell, Rene Zellwegar, Artie Lange, Ed Anser, Hal Holbrook,
James Cromwell, Marley Shelton, Mariah Carey.</P>
<PRE>Running Time: 106 minutes</PRE>
<P>Well there goes another one. Sadly this like other movies this year wasn't
good. This one being almost as bad as 'The Omega Code' but not quite. From the
opening credits I had a good feeling this would be bad, and well I guess I was
right. With bad excuses for acting, a horrible screenplay and straight-out bad
direction 'The Bachelor' is a terribly unfunny movie that doesn't work on any
levels accept that fact that Rene Zellwegar who does give a good performance.
The two cameos by Brooke Shields and Mariah Carey are also good with Brooke
being the best. The movie is troubled from the start because Chris O'Donnell is
hugely miscast and gives one of the worst performances to date.</P>
<P>Here is the stupid plot: Chris O'Donnell plays Jimmie Shelton a man who has
just broken up with his girlfriend, he meets Anne (Rene Zellwegar) they
instantly hit it off and are together for three years. Jimmie decides that he
wants to bring their relationship a little bit up. He really doesn't realize
that Anne thinks he wants to marry her (what he wants I never did catch). So he
proposes in a really bad way, and she shoots him down and is very mad. He of
course tries to apologize but nothing seems to help any. Then his grandfather
dies and he learns that he has left Jimmie 100 million dollars....as long as he
marries before the next day at 6:05 pm. Now Jimmie must find Anne and try to
marry her to get the money and because he loves her, or get married to someone
else to get the money itself, leading to an un-funny and predictable ending
that leaves a bad taste in our mouths.</P>
<P>Ok so maybe this could be one of the dumbest, cliched, silliest romantic comedy
to date that has no real big laughs. Even the supporting roles of Artie Lange,
Hal Holbrook and Ed Anser aren't even good. The plot was a good idea, but the
script would have to have been written in less than five minutes and by a five
year old. The choppy dialogue and bad directing don't help things any. Even
though Chris O'Donnell gave an OK performance in the two Batman movies, he does
not give even a remotely good or funny performance here and I wanted to boo and
throw my pop at the screen to get rid of him.</P>
<P>Rene Zelweggar is a different story and gave a charming, sweet and likable
performance (as usual) and really was the only thing that saved this confused
movie from being a total huge washout. Her sister played by Marley Shelton is
also good and the two have good chemistry onscreen. Brooke Shields showed up in
a funny little performance as a big-headed mogul who after a while became
routine and old. One really can't help but think that we have seen this stuff
before. It's not like this is an original idea and in the end, everyone knows
what is going to happen due do its cliches and typicalness.</P>
<P>'The Bachelor' works on no good levels and in fact doesn't work at all. Ed
Anser and Hal Holbrook were wasted in terrible roles and Mariah Carey can not
act to save her soul, and this could be the only film of her movie career
dispite her terrific music career. Chris O'Donnell is not as bad an actor as
Casper Van Dien but that is not saying a great deal. He seems held back and
really doesn't get into his character much and after even the first 30 minutes
gets annoying and old. Artie Lange just to me seems like he is trying to
another Chris Farley and was completely unfunny and un-nerving.</P>
<P>Why the filmmakers would want to waste such a cast in such a bad movie, with
such bad acting and dialogue is a question only they will know. Maybe they
thought it would become a hit or a critical success, and sometimes I don't
agree with other critics on movies, even from the trailers for this film they
made it look bad and showed all the mildly funny parts. Its based on the 1925
silent film 'Seven Chances' which I am sure is very better than this mess. Even
though some may think of this as a good date movie, most who see this will want
to pull out thier hair and scream for thier money back. </P>
<P>Besides being a terrible movie, 'The Bachelor' is well a terrible movie. It has
nothing worth recommending therefore I really can't recommend this movie. I did
not have a good time and I laughed only three times. The running time of the
movie is 106 minutes which is wayyyy over time and needs to be shortened at
least thirty minutes. Parts of it seems to go on forever and parts of seem to
not last enough time. Being one of the worst movies of the year, we can be sure
that I hope they will not make anymore stupid unfunny romantic comedies, and if
they do they I give up on filmmakers.</P>
<P>Reviewed by Brandon Herring November 13, 1999.
Brandon Herring
<A HREF="Http://www.geocities.com/hollywood/movie/3160/moviereviewheaven.html">Http://www.geocities.com/hollywood/movie/3160/moviereviewheaven.html</A></P>
<PRE>"He Came Home"- Halloween
"I don't know if anyone can stop him!"- H4
"Im so scared!"- Blair Witch
" "- Silent Bob</PRE>
<HR><P CLASS=flush><SMALL>The review above was posted to the
<A HREF="news:rec.arts.movies.reviews">rec.arts.movies.reviews</A> newsgroup (<A HREF="news:de.rec.film.kritiken">de.rec.film.kritiken</A> for German reviews).<BR>
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.<BR>
Please direct comments/criticisms of the review to relevant newsgroups.<BR>
Broken URLs inthe reviews are the responsibility of the author.<BR>
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
</SMALL></P>
<P ALIGN=CENTER>Related links: <A HREF="/Reviews/">index of all rec.arts.movies.reviews reviews</A></P>
</P></BODY></HTML>
|
{
"content_hash": "d275f97ff7f431679ac822cb4cfd9796",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 207,
"avg_line_length": 68.81914893617021,
"alnum_prop": 0.7583861493275622,
"repo_name": "xianjunzhengbackup/code",
"id": "c68cb52b9da57c5e20de80b959b2cc124e6211f1",
"size": "6469",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "data science/machine_learning_for_the_web/chapter_4/movie/21695.html",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "BitBake",
"bytes": "113"
},
{
"name": "BlitzBasic",
"bytes": "256"
},
{
"name": "CSS",
"bytes": "49827"
},
{
"name": "HTML",
"bytes": "157006325"
},
{
"name": "JavaScript",
"bytes": "14029"
},
{
"name": "Jupyter Notebook",
"bytes": "4875399"
},
{
"name": "Mako",
"bytes": "2060"
},
{
"name": "Perl",
"bytes": "716"
},
{
"name": "Python",
"bytes": "874414"
},
{
"name": "R",
"bytes": "454"
},
{
"name": "Shell",
"bytes": "3984"
}
],
"symlink_target": ""
}
|
using NetCoreCMS.Framework.Utility;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NetCoreCMS.Framework.Core.Models.ViewModels;
using NetCoreCMS.Framework.Core.Models;
using NetCoreCMS.Framework.Modules;
namespace Core.Admin.Models.ViewModels.UserAuthViewModels
{
[Serializable]
public class PermissionViewModel
{
public long Id { get; set; }
public string Name { get; set; }
public string Group { get; set; }
public string Description { get; set; }
public int Rank { get; set; }
public int ModuleCount { get; set; }
public int MenuCount { get; set; }
public int UserCount { get; set; }
public List<ModuleViewModel> Modules { get; set; }
private NccPermission _permission;
public PermissionViewModel()
{
Modules = new List<ModuleViewModel>();
foreach (var item in GlobalContext.GetActiveModules())
{
var module = new ModuleViewModel();
var menus = item.Menus;
var adminMenus = menus
.Where(x => x.Type == Menu.MenuType.Admin)
.GroupBy(y => y.DisplayName,
(key, g) => new { MenuName = key, Menu = g.FirstOrDefault(), Items = g.SelectMany(x => x.MenuItems).ToList() }
).ToList();
var siteMenus = menus.Where(x => x.Type == Menu.MenuType.WebSite)
.GroupBy(y => y.DisplayName,
(key, g) => new { MenuName = key, Menu = g.FirstOrDefault(), Items = g.SelectMany(z => z.MenuItems).ToList() }
).ToList();
foreach (var adminMenu in adminMenus)
{
var menu = new MenuViewModel() {
Type = "Admin",
Name = adminMenu.MenuName,
Order = adminMenu.Menu.Order,
MenuItems = GetMenuItems(adminMenu.Items, item),
};
module.AdminMenus.Add(menu);
}
foreach (var webSiteMenu in siteMenus)
{
var menu = new MenuViewModel()
{
Type = "WebSite",
Name = webSiteMenu.MenuName,
Order = webSiteMenu.Menu.Order,
MenuItems = GetMenuItems(webSiteMenu.Items, item),
};
module.SiteMenus.Add(menu);
}
Modules.Add(module);
}
}
public PermissionViewModel(NccPermission permission)
{
_permission = permission;
Id = permission.Id;
Group = permission.Group;
Name = permission.Name;
Description = permission.Description;
Rank = permission.Rank;
ModuleCount = permission.PermissionDetails.GroupBy(x => x.ModuleName).Count();
MenuCount = permission.PermissionDetails.GroupBy(x => x.Action).Count();
UserCount = permission.Users.Count;
Modules = new List<ModuleViewModel>();
foreach (var item in GlobalContext.GetActiveModules())
{
var module = new ModuleViewModel();
var menus = item.Menus;
var adminMenus = menus
.Where(x => x.Type == Menu.MenuType.Admin)
.GroupBy(y => y.DisplayName,
(key, g) => new { MenuName = key, Menu = g.FirstOrDefault(), Items = g.SelectMany(x => x.MenuItems).ToList() }
).ToList();
var siteMenus = menus.Where(x => x.Type == Menu.MenuType.WebSite)
.GroupBy(y => y.DisplayName,
(key, g) => new { MenuName = key, Menu = g.FirstOrDefault(), Items = g.SelectMany(z => z.MenuItems).ToList() }
).ToList();
foreach (var adminMenu in adminMenus)
{
var menu = new MenuViewModel()
{
Type = "Admin",
Name = adminMenu.MenuName,
Order = adminMenu.Menu.Order,
MenuItems = GetMenuItems(adminMenu.Items, item),
};
module.AdminMenus.Add(menu);
}
foreach (var webSiteMenu in siteMenus)
{
var menu = new MenuViewModel()
{
Type = "WebSite",
Name = webSiteMenu.MenuName,
Order = webSiteMenu.Menu.Order,
MenuItems = GetMenuItems(webSiteMenu.Items, item),
};
module.SiteMenus.Add(menu);
}
Modules.Add(module);
}
}
private List<MenuItemViewModel> GetMenuItems(List<MenuItem> menuItems, IModule module)
{
var list = new List<MenuItemViewModel>();
foreach (var item in menuItems)
{
string controller = "", action = "";
//if (string.IsNullOrEmpty(item.Url) == false)
//{
// var parts = item.Url.Split("/".ToArray(), StringSplitOptions.RemoveEmptyEntries);
// if (parts.Length > 1)
// {
// controller = parts[0];
// action = parts[1];
// }
// else if (parts.Length == 1) {
// controller = parts[0];
// action = "Index";
// }
//}
if (string.IsNullOrEmpty(item.Url) == false)
{
(controller, action) = NccUrlHelper.GetControllerActionFromUrl(item.Url);
}
else
{
controller = item.Controller;
action = item.Action;
}
var mip = _permission?.PermissionDetails?.Where(x => x.ModuleName == module.ModuleName && x.Action == action && x.Controller == controller).FirstOrDefault();
if (mip != null)
{
var mi = new MenuItemViewModel()
{
Id = mip.Id,
Area = module.Area,
Action = action,
Controller = controller,
Name = mip.Name,
Order = mip.Order,
IsChecked = true,
};
list.Add(mi);
}
else
{
var mi = new MenuItemViewModel()
{
Id = 0,
Action = action,
Controller = controller,
Name = item.Name,
Order = item.Order
};
list.Add(mi);
}
}
return list;
}
}
[Serializable]
public class ModuleViewModel
{
public string Name { get; set; }
public string ModuleName { get; set; }
public bool IsChecked { get; set; }
public List<MenuViewModel> AdminMenus { get; set; }
public List<MenuViewModel> SiteMenus { get; set; }
public ModuleViewModel()
{
Name = "";
ModuleName = "";
IsChecked = false;
AdminMenus = new List<MenuViewModel>();
SiteMenus = new List<MenuViewModel>();
}
}
[Serializable]
public class MenuViewModel
{
public long Id { get; set; }
public string Name { get; set; }
public string Url { get; set; }
public string Type { get; set; }
public bool IsChecked { get; set; }
public int Order { get; set; }
public List<MenuItemViewModel> MenuItems { get; set; }
public MenuViewModel()
{
MenuItems = new List<MenuItemViewModel>();
Name = "";
Url = "";
Type = "";
IsChecked = false;
Order = 0;
}
}
[Serializable]
public class MenuItemViewModel
{
public long Id { get; set; }
public string Name { get; set; }
public string Area { get; set; }
public string Controller { get; set; }
public string Action { get; set; }
public bool IsChecked { get; set; }
public int Order { get; set; }
public MenuItemViewModel()
{
Name = "";
Controller = "";
Action = "";
IsChecked = false;
Order = 0;
}
}
}
|
{
"content_hash": "51368e283c678b242daa153d89f624cd",
"timestamp": "",
"source": "github",
"line_count": 255,
"max_line_length": 173,
"avg_line_length": 35.67058823529412,
"alnum_prop": 0.4515171503957784,
"repo_name": "xonaki/NetCoreCMS",
"id": "2da07ffc2d97626e546462c28193698b952bc103",
"size": "9098",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "NetCoreCMS.Web/Core/Core.Admin/Models/ViewModels/UserAuthViewModels/PermissionViewModel.cs",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C#",
"bytes": "559312"
},
{
"name": "CSS",
"bytes": "707810"
},
{
"name": "HTML",
"bytes": "1713492"
},
{
"name": "JavaScript",
"bytes": "818558"
},
{
"name": "PHP",
"bytes": "1684"
},
{
"name": "PowerShell",
"bytes": "471"
},
{
"name": "Ruby",
"bytes": "9265"
},
{
"name": "Shell",
"bytes": "816"
}
],
"symlink_target": ""
}
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>tactician-dummy: 14 s 🏆</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.15.1 / tactician-dummy - 1.0~beta1</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
tactician-dummy
<small>
1.0~beta1
<span class="label label-success">14 s 🏆</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-04-22 11:54:29 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-04-22 11:54:29 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
conf-findutils 1 Virtual package relying on findutils
conf-gmp 4 Virtual package relying on a GMP lib system installation
coq 8.15.1 Formal proof management system
dune 3.0.3 Fast, portable, and opinionated build system
ocaml 4.12.1 The OCaml compiler (virtual package)
ocaml-base-compiler 4.12.1 Official release 4.12.1
ocaml-config 2 OCaml Switch Configuration
ocaml-options-vanilla 1 Ensure that OCaml is compiled with no special options enabled
ocamlfind 1.9.3 A library manager for OCaml
zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers
# opam file:
opam-version: "2.0"
name: "coq-tactician-dummy"
synopsis: "A dummy implementation of Tactician"
description: """
This package acts as a stand-in for the Tactician plugin (`coq-tactician`).
It provides short files that replicate Tactician's tactics without actually
doing much. This is useful when you have a development that uses Tactician
that you want to package up. In most situations, it is not a good idea to
have your package directly depend on `coq-tactician`. Instead you should load
Tactician through your `coqrc` file. In order for your package to be compilable
by others, your package can depend on this package. Just add
`From Tactician import Ltac1Dummy` in your development and you are good to go.
"""
homepage: "https://coq-tactician.github.io"
dev-repo: "git+https://github.com/coq-tactician/coq-tactician-dummy"
bug-reports: "https://github.com/coq-tactician/coq-tactician-dummy/issues"
maintainer: "Lasse Blaauwbroek <lasse@blaauwbroek.eu>"
authors: "Lasse Blaauwbroek <lasse@blaauwbroek.eu"
depends: [
"coq" {>= "8.6.1"}
"dune" {>= "2.5"}
]
build: [
["dune" "build" "--release" "-j" jobs]
]
url {
src: "https://github.com/coq-tactician/coq-tactician-dummy/archive/1.0-beta1.tar.gz"
}
tags: [
"keyword:tactic-learning"
"keyword:machine-learning"
"keyword:automation"
"keyword:proof-synthesis"
"category:Miscellaneous/Coq Extensions"
"logpath:Tactician"
]
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install 🏜️</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-tactician-dummy.1.0~beta1 coq.8.15.1</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam list; echo; ulimit -Sv 4000000; timeout 4h opam install -y --deps-only coq-tactician-dummy.1.0~beta1 coq.8.15.1</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>11 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam list; echo; ulimit -Sv 16000000; timeout 4h opam install -y -v coq-tactician-dummy.1.0~beta1 coq.8.15.1</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>14 s</dd>
</dl>
<h2>Installation size</h2>
<p>Total: 29 K</p>
<ul>
<li>27 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Tactician/Ltac1Dummy.vo</code></li>
<li>1 K <code>../ocaml-base-compiler.4.12.1/lib/coq-tactician-dummy/opam</code></li>
<li>1 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Tactician/Ltac1Dummy.v</code></li>
<li>1 K <code>../ocaml-base-compiler.4.12.1/doc/coq-tactician-dummy/LICENSE.md</code></li>
<li>1 K <code>../ocaml-base-compiler.4.12.1/lib/coq-tactician-dummy/dune-package</code></li>
<li>0 K <code>../ocaml-base-compiler.4.12.1/lib/coq-tactician-dummy/META</code></li>
</ul>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq-tactician-dummy.1.0~beta1</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
|
{
"content_hash": "41a9ebefc3bff8848b446c2b048bffd0",
"timestamp": "",
"source": "github",
"line_count": 178,
"max_line_length": 159,
"avg_line_length": 45.151685393258425,
"alnum_prop": 0.56227448052756,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "a8bf86649af89145b3eebd9e73da021c5c224aa8",
"size": "8062",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.12.1-2.0.8/released/8.15.1/tactician-dummy/1.0~beta1.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
}
|
layout: default
---
<div class="panel panel-default">
<div class="panel-heading">{% if page.language %}{{ site.languages[page.language] }}: {% endif %}<strong>{{ page.title }}</strong></div>
<ul class="list-group">
{% if page.date %}
<li class="list-group-item"><i class="fa fa-calendar"><time datetime="{{ page.date | date_to_xmlschema }}" class="page-date"> {{ page.date | date_to_string }}</time></i></li>
{% endif %}
{% if page.author %}
<li class="list-group-item"><i class="fa fa-user"> By <strong>{{ page.author }}</strong></i></li>
{% endif %}
{% if page.source %}
<a class="list-group-item" href="{{ page.source }}" target="_blank"><i class="fa fa-code-fork"> Source Code</i></a>
{% endif %}
{% if page.license %}
<a class="list-group-item" href="{{ page.source }}" target="_blank"><i class="fa fa-file-text-o"> {{ page.license }}</i></a>
{% endif %}
{% if page.link %}
<a class="list-group-item" href="{{ page.link }}" target="_blank"><i class="fa fa-external-link"> Visit</i></a>
{% endif %}
</ul>
<div class="panel-body">
{% if page.link contains 'youtube' %}
<div class="embed-responsive embed-responsive-16by9">
<iframe class="embed-responsive-item" src="https://www.youtube.com/embed/{{ page.link | split:'?v=' | last }}" frameborder="0" allowfullscreen></iframe>
</div>
<hr/>
{% endif %}
{{ content }}
{% if page.screenshot %}
<hr/>
<img class="thumbnail center-block" src="{{ page.screenshot }}"/>
{% endif %}
</div>
</article>
|
{
"content_hash": "12e17aae28cb60134927dfb7d2011eaa",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 180,
"avg_line_length": 36.18181818181818,
"alnum_prop": 0.5703517587939698,
"repo_name": "ahmadnassri/har-resources",
"id": "21195d80b1cf3bb26ae0d88c330232d8e57cf3d2",
"size": "1596",
"binary": false,
"copies": "1",
"ref": "refs/heads/gh-pages",
"path": "_layouts/post.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "12204"
},
{
"name": "Ruby",
"bytes": "3136"
}
],
"symlink_target": ""
}
|
from uuid import uuid1
from unittest import TestCase
from deferrable.backoff import apply_exponential_backoff_options, apply_exponential_backoff_delay
from deferrable.delay import MAXIMUM_DELAY_SECONDS
class TestBackoff(TestCase):
"""Apologies for how annoying these tests will be if the backoff constants
are changed. Testing the actual value felt like a better idea than testing
that the math is performed the same way on both sides."""
def setUp(self):
self.item = {'id': uuid1()}
def test_apply_exponential_backoff_options_enable(self):
apply_exponential_backoff_options(self.item, True)
self.assertEqual(self.item['use_exponential_backoff'], True)
def test_apply_exponential_backoff_options_disable(self):
apply_exponential_backoff_options(self.item, False)
self.assertEqual(self.item['use_exponential_backoff'], False)
def test_apply_exponential_backoff_delay_one_attempt_enabled(self):
self.item['attempts'] = 1
self.item['use_exponential_backoff'] = True
apply_exponential_backoff_delay(self.item)
self.assertEqual(self.item['delay'], 4)
def test_apply_exponential_backoff_delay_one_attempt_disabled(self):
self.item['attempts'] = 1
self.item['use_exponential_backoff'] = False
apply_exponential_backoff_delay(self.item)
self.assertIsNone(self.item.get('delay'))
def test_apply_exponential_backoff_delay_three_attempts(self):
self.item['attempts'] = 3
self.item['use_exponential_backoff'] = True
apply_exponential_backoff_delay(self.item)
self.assertEqual(self.item['delay'], 10)
def test_apply_exponential_backoff_limited_by_max_delay(self):
self.item['attempts'] = 100
self.item['use_exponential_backoff'] = True
apply_exponential_backoff_delay(self.item)
self.assertEqual(self.item['delay'], MAXIMUM_DELAY_SECONDS)
|
{
"content_hash": "dd47a34522f2b94682c044d97bd918f2",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 97,
"avg_line_length": 43.17777777777778,
"alnum_prop": 0.7035512094698919,
"repo_name": "gamechanger/deferrable",
"id": "dfff22f44aa1b71e46c522d1d78ac72872108e6a",
"size": "1943",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tests/backoff_test.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Lua",
"bytes": "423"
},
{
"name": "Makefile",
"bytes": "297"
},
{
"name": "Python",
"bytes": "75588"
}
],
"symlink_target": ""
}
|
import calendar
import datetime
import json
import os
import shutil
import stat
import sys
import tempfile
import time
import uuid
import fixtures
import httpretty
import iso8601
import mock
import testresources
import testtools
import webob
from keystoneclient.common import cms
from keystoneclient import exceptions
from keystoneclient.middleware import auth_token
from keystoneclient.openstack.common import jsonutils
from keystoneclient.openstack.common import memorycache
from keystoneclient.openstack.common import timeutils
from keystoneclient.tests import client_fixtures
EXPECTED_V2_DEFAULT_ENV_RESPONSE = {
'HTTP_X_IDENTITY_STATUS': 'Confirmed',
'HTTP_X_TENANT_ID': 'tenant_id1',
'HTTP_X_TENANT_NAME': 'tenant_name1',
'HTTP_X_USER_ID': 'user_id1',
'HTTP_X_USER_NAME': 'user_name1',
'HTTP_X_ROLES': 'role1,role2',
'HTTP_X_USER': 'user_name1', # deprecated (diablo-compat)
'HTTP_X_TENANT': 'tenant_name1', # deprecated (diablo-compat)
'HTTP_X_ROLE': 'role1,role2', # deprecated (diablo-compat)
}
BASE_HOST = 'https://keystone.example.com:1234'
BASE_URI = '%s/testadmin' % BASE_HOST
FAKE_ADMIN_TOKEN_ID = 'admin_token2'
FAKE_ADMIN_TOKEN = jsonutils.dumps(
{'access': {'token': {'id': FAKE_ADMIN_TOKEN_ID,
'expires': '2022-10-03T16:58:01Z'}}})
VERSION_LIST_v3 = jsonutils.dumps({
"versions": {
"values": [
{
"id": "v3.0",
"status": "stable",
"updated": "2013-03-06T00:00:00Z",
"links": [{'href': '%s/v3' % BASE_URI, 'rel': 'self'}]
},
{
"id": "v2.0",
"status": "stable",
"updated": "2011-11-19T00:00:00Z",
"links": [{'href': '%s/v2.0' % BASE_URI, 'rel': 'self'}]
}
]
}
})
VERSION_LIST_v2 = jsonutils.dumps({
"versions": {
"values": [
{
"id": "v2.0",
"status": "stable",
"updated": "2011-11-19T00:00:00Z",
"links": []
}
]
}
})
ERROR_TOKEN = '7ae290c2a06244c4b41692eb4e9225f2'
MEMCACHED_SERVERS = ['localhost:11211']
MEMCACHED_AVAILABLE = None
def memcached_available():
"""Do a sanity check against memcached.
Returns ``True`` if the following conditions are met (otherwise, returns
``False``):
- ``python-memcached`` is installed
- a usable ``memcached`` instance is available via ``MEMCACHED_SERVERS``
- the client is able to set and get a key/value pair
"""
global MEMCACHED_AVAILABLE
if MEMCACHED_AVAILABLE is None:
try:
import memcache
c = memcache.Client(MEMCACHED_SERVERS)
c.set('ping', 'pong', time=1)
MEMCACHED_AVAILABLE = c.get('ping') == 'pong'
except ImportError:
MEMCACHED_AVAILABLE = False
return MEMCACHED_AVAILABLE
class NoModuleFinder(object):
"""Disallow further imports of 'module'."""
def __init__(self, module):
self.module = module
def find_module(self, fullname, path):
if fullname == self.module or fullname.startswith(self.module + '.'):
raise ImportError
def cleanup_revoked_file(filename):
try:
os.remove(filename)
except OSError:
pass
class DisableModuleFixture(fixtures.Fixture):
"""A fixture to provide support for unloading/disabling modules."""
def __init__(self, module, *args, **kw):
super(DisableModuleFixture, self).__init__(*args, **kw)
self.module = module
self._finders = []
self._cleared_modules = {}
def tearDown(self):
super(DisableModuleFixture, self).tearDown()
for finder in self._finders:
sys.meta_path.remove(finder)
sys.modules.update(self._cleared_modules)
def clear_module(self):
cleared_modules = {}
for fullname in sys.modules.keys():
if (fullname == self.module or
fullname.startswith(self.module + '.')):
cleared_modules[fullname] = sys.modules.pop(fullname)
return cleared_modules
def setUp(self):
"""Ensure ImportError for the specified module."""
super(DisableModuleFixture, self).setUp()
# Clear 'module' references in sys.modules
self._cleared_modules.update(self.clear_module())
finder = NoModuleFinder(self.module)
self._finders.append(finder)
sys.meta_path.insert(0, finder)
class TimezoneFixture(fixtures.Fixture):
@staticmethod
def supported():
# tzset is only supported on Unix.
return hasattr(time, 'tzset')
def __init__(self, new_tz):
super(TimezoneFixture, self).__init__()
self.tz = new_tz
self.old_tz = os.environ.get('TZ')
def setUp(self):
super(TimezoneFixture, self).setUp()
if not self.supported():
raise NotImplementedError('timezone override is not supported.')
os.environ['TZ'] = self.tz
time.tzset()
self.addCleanup(self.cleanup)
def cleanup(self):
if self.old_tz is not None:
os.environ['TZ'] = self.old_tz
elif 'TZ' in os.environ:
del os.environ['TZ']
time.tzset()
class FakeApp(object):
"""This represents a WSGI app protected by the auth_token middleware."""
SUCCESS = b'SUCCESS'
def __init__(self, expected_env=None):
self.expected_env = dict(EXPECTED_V2_DEFAULT_ENV_RESPONSE)
if expected_env:
self.expected_env.update(expected_env)
def __call__(self, env, start_response):
for k, v in self.expected_env.items():
assert env[k] == v, '%s != %s' % (env[k], v)
resp = webob.Response()
resp.body = FakeApp.SUCCESS
return resp(env, start_response)
class v3FakeApp(FakeApp):
"""This represents a v3 WSGI app protected by the auth_token middleware."""
def __init__(self, expected_env=None):
# with v3 additions, these are for the DEFAULT TOKEN
v3_default_env_additions = {
'HTTP_X_PROJECT_ID': 'tenant_id1',
'HTTP_X_PROJECT_NAME': 'tenant_name1',
'HTTP_X_PROJECT_DOMAIN_ID': 'domain_id1',
'HTTP_X_PROJECT_DOMAIN_NAME': 'domain_name1',
'HTTP_X_USER_DOMAIN_ID': 'domain_id1',
'HTTP_X_USER_DOMAIN_NAME': 'domain_name1'
}
if expected_env:
v3_default_env_additions.update(expected_env)
super(v3FakeApp, self).__init__(v3_default_env_additions)
class BaseAuthTokenMiddlewareTest(testtools.TestCase):
"""Base test class for auth_token middleware.
All the tests allow for running with auth_token
configured for receiving v2 or v3 tokens, with the
choice being made by passing configuration data into
setUp().
The base class will, by default, run all the tests
expecting v2 token formats. Child classes can override
this to specify, for instance, v3 format.
"""
def setUp(self, expected_env=None, auth_version=None, fake_app=None):
testtools.TestCase.setUp(self)
self.expected_env = expected_env or dict()
self.fake_app = fake_app or FakeApp
self.middleware = None
self.conf = {
'identity_uri': 'https://keystone.example.com:1234/testadmin/',
'signing_dir': client_fixtures.CERTDIR,
'auth_version': auth_version,
'auth_uri': 'https://keystone.example.com:1234',
}
self.auth_version = auth_version
self.response_status = None
self.response_headers = None
def set_middleware(self, expected_env=None, conf=None):
"""Configure the class ready to call the auth_token middleware.
Set up the various fake items needed to run the middleware.
Individual tests that need to further refine these can call this
function to override the class defaults.
"""
if conf:
self.conf.update(conf)
if expected_env:
self.expected_env.update(expected_env)
self.middleware = auth_token.AuthProtocol(
self.fake_app(self.expected_env), self.conf)
self.middleware._iso8601 = iso8601
with tempfile.NamedTemporaryFile(dir=self.middleware.signing_dirname,
delete=False) as f:
pass
self.middleware.revoked_file_name = f.name
self.addCleanup(cleanup_revoked_file,
self.middleware.revoked_file_name)
self.middleware.token_revocation_list = jsonutils.dumps(
{"revoked": [], "extra": "success"})
def start_fake_response(self, status, headers):
self.response_status = int(status.split(' ', 1)[0])
self.response_headers = dict(headers)
def assertLastPath(self, path):
if path:
self.assertEqual(path, httpretty.last_request().path)
else:
self.assertIsInstance(httpretty.last_request(),
httpretty.core.HTTPrettyRequestEmpty)
class MultiStepAuthTokenMiddlewareTest(BaseAuthTokenMiddlewareTest,
testresources.ResourcedTestCase):
resources = [('examples', client_fixtures.EXAMPLES_RESOURCE)]
@httpretty.activate
def test_fetch_revocation_list_with_expire(self):
self.set_middleware()
# Get a token, then try to retrieve revocation list and get a 401.
# Get a new token, try to retrieve revocation list and return 200.
httpretty.register_uri(httpretty.POST, "%s/v2.0/tokens" % BASE_URI,
body=FAKE_ADMIN_TOKEN)
responses = [httpretty.Response(body='', status=401),
httpretty.Response(
body=self.examples.SIGNED_REVOCATION_LIST)]
httpretty.register_uri(httpretty.GET,
"%s/v2.0/tokens/revoked" % BASE_URI,
responses=responses)
fetched_list = jsonutils.loads(self.middleware.fetch_revocation_list())
self.assertEqual(fetched_list, self.examples.REVOCATION_LIST)
# Check that 4 requests have been made
self.assertEqual(len(httpretty.httpretty.latest_requests), 4)
class DiabloAuthTokenMiddlewareTest(BaseAuthTokenMiddlewareTest,
testresources.ResourcedTestCase):
resources = [('examples', client_fixtures.EXAMPLES_RESOURCE)]
"""Auth Token middleware should understand Diablo keystone responses."""
def setUp(self):
# pre-diablo only had Tenant ID, which was also the Name
expected_env = {
'HTTP_X_TENANT_ID': 'tenant_id1',
'HTTP_X_TENANT_NAME': 'tenant_id1',
# now deprecated (diablo-compat)
'HTTP_X_TENANT': 'tenant_id1',
}
super(DiabloAuthTokenMiddlewareTest, self).setUp(
expected_env=expected_env)
httpretty.reset()
httpretty.enable()
self.addCleanup(httpretty.disable)
httpretty.register_uri(httpretty.GET,
"%s/" % BASE_URI,
body=VERSION_LIST_v2,
status=300)
httpretty.register_uri(httpretty.POST,
"%s/v2.0/tokens" % BASE_URI,
body=FAKE_ADMIN_TOKEN)
self.token_id = self.examples.VALID_DIABLO_TOKEN
token_response = self.examples.JSON_TOKEN_RESPONSES[self.token_id]
httpretty.register_uri(httpretty.GET,
"%s/v2.0/tokens/%s" % (BASE_URI, self.token_id),
body=token_response)
self.set_middleware()
def test_valid_diablo_response(self):
req = webob.Request.blank('/')
req.headers['X-Auth-Token'] = self.token_id
self.middleware(req.environ, self.start_fake_response)
self.assertEqual(self.response_status, 200)
self.assertIn('keystone.token_info', req.environ)
class NoMemcacheAuthToken(BaseAuthTokenMiddlewareTest):
def setUp(self):
super(NoMemcacheAuthToken, self).setUp()
self.useFixture(DisableModuleFixture('memcache'))
def test_nomemcache(self):
conf = {
'admin_token': 'admin_token1',
'auth_host': 'keystone.example.com',
'auth_port': 1234,
'memcached_servers': MEMCACHED_SERVERS,
'auth_uri': 'https://keystone.example.com:1234',
}
auth_token.AuthProtocol(FakeApp(), conf)
def test_not_use_cache_from_env(self):
env = {'swift.cache': 'CACHE_TEST'}
conf = {
'memcached_servers': MEMCACHED_SERVERS
}
self.set_middleware(conf=conf)
self.middleware._init_cache(env)
with self.middleware._cache_pool.reserve() as cache:
self.assertNotEqual(cache, 'CACHE_TEST')
def test_multiple_context_managers_share_single_client(self):
env = {}
conf = {
'memcached_servers': MEMCACHED_SERVERS
}
self.set_middleware(conf=conf)
self.middleware._init_cache(env)
caches = []
with self.middleware._cache_pool.reserve() as cache:
caches.append(cache)
with self.middleware._cache_pool.reserve() as cache:
caches.append(cache)
self.assertIs(caches[0], caches[1])
self.assertEqual(set(caches), set(self.middleware._cache_pool))
def test_nested_context_managers_create_multiple_clients(self):
env = {}
conf = {
'memcached_servers': MEMCACHED_SERVERS
}
self.set_middleware(conf=conf)
self.middleware._init_cache(env)
with self.middleware._cache_pool.reserve() as outer_cache:
with self.middleware._cache_pool.reserve() as inner_cache:
self.assertNotEqual(outer_cache, inner_cache)
self.assertEqual(
set([inner_cache, outer_cache]), set(self.middleware._cache_pool))
class CommonAuthTokenMiddlewareTest(object):
def test_init_does_not_call_http(self):
conf = {
'revocation_cache_time': 1
}
self.set_middleware(conf=conf)
self.assertLastPath(None)
def test_init_by_ipv6Addr_auth_host(self):
del self.conf['identity_uri']
conf = {
'auth_host': '2001:2013:1:f101::1',
'auth_port': 1234,
'auth_protocol': 'http',
'auth_uri': None,
}
self.set_middleware(conf=conf)
expected_auth_uri = 'http://[2001:2013:1:f101::1]:1234'
self.assertEqual(expected_auth_uri, self.middleware.auth_uri)
def assert_valid_request_200(self, token, with_catalog=True):
req = webob.Request.blank('/')
req.headers['X-Auth-Token'] = token
body = self.middleware(req.environ, self.start_fake_response)
self.assertEqual(self.response_status, 200)
if with_catalog:
self.assertTrue(req.headers.get('X-Service-Catalog'))
else:
self.assertNotIn('X-Service-Catalog', req.headers)
self.assertEqual(body, [FakeApp.SUCCESS])
self.assertIn('keystone.token_info', req.environ)
def test_valid_uuid_request(self):
for _ in range(2): # Do it twice because first result was cached.
token = self.token_dict['uuid_token_default']
self.assert_valid_request_200(token)
self.assert_valid_last_url(token)
def test_valid_uuid_request_with_auth_fragments(self):
del self.conf['identity_uri']
self.conf['auth_protocol'] = 'https'
self.conf['auth_host'] = 'keystone.example.com'
self.conf['auth_port'] = 1234
self.conf['auth_admin_prefix'] = '/testadmin'
self.set_middleware()
self.assert_valid_request_200(self.token_dict['uuid_token_default'])
self.assert_valid_last_url(self.token_dict['uuid_token_default'])
def _test_cache_revoked(self, token, revoked_form=None):
# When the token is cached and revoked, 401 is returned.
self.middleware.check_revocations_for_cached = True
req = webob.Request.blank('/')
req.headers['X-Auth-Token'] = token
# Token should be cached as ok after this.
self.middleware(req.environ, self.start_fake_response)
self.assertEqual(200, self.response_status)
# Put it in revocation list.
self.middleware.token_revocation_list = self.get_revocation_list_json(
token_ids=[revoked_form or token])
self.middleware(req.environ, self.start_fake_response)
self.assertEqual(401, self.response_status)
def test_cached_revoked_uuid(self):
# When the UUID token is cached and revoked, 401 is returned.
self._test_cache_revoked(self.token_dict['uuid_token_default'])
def test_valid_signed_request(self):
for _ in range(2): # Do it twice because first result was cached.
self.assert_valid_request_200(
self.token_dict['signed_token_scoped'])
#ensure that signed requests do not generate HTTP traffic
self.assertLastPath(None)
def test_valid_signed_compressed_request(self):
self.assert_valid_request_200(
self.token_dict['signed_token_scoped_pkiz'])
# ensure that signed requests do not generate HTTP traffic
self.assertLastPath(None)
def test_revoked_token_receives_401(self):
self.middleware.token_revocation_list = self.get_revocation_list_json()
req = webob.Request.blank('/')
req.headers['X-Auth-Token'] = self.token_dict['revoked_token']
self.middleware(req.environ, self.start_fake_response)
self.assertEqual(self.response_status, 401)
def test_cached_revoked_pki(self):
# When the PKI token is cached and revoked, 401 is returned.
token = self.token_dict['signed_token_scoped']
revoked_form = cms.cms_hash_token(token)
self._test_cache_revoked(token, revoked_form)
def get_revocation_list_json(self, token_ids=None):
if token_ids is None:
token_ids = [self.token_dict['revoked_token_hash']]
revocation_list = {'revoked': [{'id': x, 'expires': timeutils.utcnow()}
for x in token_ids]}
return jsonutils.dumps(revocation_list)
def test_is_signed_token_revoked_returns_false(self):
#explicitly setting an empty revocation list here to document intent
self.middleware.token_revocation_list = jsonutils.dumps(
{"revoked": [], "extra": "success"})
result = self.middleware.is_signed_token_revoked(
self.token_dict['revoked_token'])
self.assertFalse(result)
def test_is_signed_token_revoked_returns_true(self):
self.middleware.token_revocation_list = self.get_revocation_list_json()
result = self.middleware.is_signed_token_revoked(
self.token_dict['revoked_token'])
self.assertTrue(result)
def test_verify_signed_token_raises_exception_for_revoked_token(self):
self.middleware.token_revocation_list = self.get_revocation_list_json()
self.assertRaises(auth_token.InvalidUserToken,
self.middleware.verify_signed_token,
self.token_dict['revoked_token'])
def test_verify_signed_token_raises_exception_for_revoked_pkiz_token(self):
self.middleware.token_revocation_list = (
self.examples.REVOKED_TOKEN_PKIZ_LIST_JSON)
self.assertRaises(auth_token.InvalidUserToken,
self.middleware.verify_pkiz_token,
self.token_dict['revoked_token_pkiz'])
def assertIsValidJSON(self, text):
json.loads(text)
def test_verify_signed_token_succeeds_for_unrevoked_token(self):
self.middleware.token_revocation_list = self.get_revocation_list_json()
text = self.middleware.verify_signed_token(
self.token_dict['signed_token_scoped'])
self.assertIsValidJSON(text)
def test_verify_signed_compressed_token_succeeds_for_unrevoked_token(self):
self.middleware.token_revocation_list = self.get_revocation_list_json()
text = self.middleware.verify_pkiz_token(
self.token_dict['signed_token_scoped_pkiz'])
self.assertIsValidJSON(text)
def test_verify_signing_dir_create_while_missing(self):
tmp_name = uuid.uuid4().hex
test_parent_signing_dir = "/tmp/%s" % tmp_name
self.middleware.signing_dirname = "/tmp/%s/%s" % ((tmp_name,) * 2)
self.middleware.signing_cert_file_name = (
"%s/test.pem" % self.middleware.signing_dirname)
self.middleware.verify_signing_dir()
# NOTE(wu_wenxiang): Verify if the signing dir was created as expected.
self.assertTrue(os.path.isdir(self.middleware.signing_dirname))
self.assertTrue(os.access(self.middleware.signing_dirname, os.W_OK))
self.assertEqual(os.stat(self.middleware.signing_dirname).st_uid,
os.getuid())
self.assertEqual(
stat.S_IMODE(os.stat(self.middleware.signing_dirname).st_mode),
stat.S_IRWXU)
shutil.rmtree(test_parent_signing_dir)
def test_get_token_revocation_list_fetched_time_returns_min(self):
self.middleware.token_revocation_list_fetched_time = None
self.middleware.revoked_file_name = ''
self.assertEqual(self.middleware.token_revocation_list_fetched_time,
datetime.datetime.min)
def test_get_token_revocation_list_fetched_time_returns_mtime(self):
self.middleware.token_revocation_list_fetched_time = None
mtime = os.path.getmtime(self.middleware.revoked_file_name)
fetched_time = datetime.datetime.utcfromtimestamp(mtime)
self.assertEqual(fetched_time,
self.middleware.token_revocation_list_fetched_time)
@testtools.skipUnless(TimezoneFixture.supported(),
'TimezoneFixture not supported')
def test_get_token_revocation_list_fetched_time_returns_utc(self):
with TimezoneFixture('UTC-1'):
self.middleware.token_revocation_list = jsonutils.dumps(
self.examples.REVOCATION_LIST)
self.middleware.token_revocation_list_fetched_time = None
fetched_time = self.middleware.token_revocation_list_fetched_time
self.assertTrue(timeutils.is_soon(fetched_time, 1))
def test_get_token_revocation_list_fetched_time_returns_value(self):
expected = self.middleware._token_revocation_list_fetched_time
self.assertEqual(self.middleware.token_revocation_list_fetched_time,
expected)
def test_get_revocation_list_returns_fetched_list(self):
# auth_token uses v2 to fetch this, so don't allow the v3
# tests to override the fake http connection
self.middleware.token_revocation_list_fetched_time = None
os.remove(self.middleware.revoked_file_name)
self.assertEqual(self.middleware.token_revocation_list,
self.examples.REVOCATION_LIST)
def test_get_revocation_list_returns_current_list_from_memory(self):
self.assertEqual(self.middleware.token_revocation_list,
self.middleware._token_revocation_list)
def test_get_revocation_list_returns_current_list_from_disk(self):
in_memory_list = self.middleware.token_revocation_list
self.middleware._token_revocation_list = None
self.assertEqual(self.middleware.token_revocation_list, in_memory_list)
def test_invalid_revocation_list_raises_service_error(self):
httpretty.register_uri(httpretty.GET,
"%s/v2.0/tokens/revoked" % BASE_URI,
body="{}",
status=200)
self.assertRaises(auth_token.ServiceError,
self.middleware.fetch_revocation_list)
def test_fetch_revocation_list(self):
# auth_token uses v2 to fetch this, so don't allow the v3
# tests to override the fake http connection
fetched_list = jsonutils.loads(self.middleware.fetch_revocation_list())
self.assertEqual(fetched_list, self.examples.REVOCATION_LIST)
def test_request_invalid_uuid_token(self):
# remember because we are testing the middleware we stub the connection
# to the keystone server, but this is not what gets returned
invalid_uri = "%s/v2.0/tokens/invalid-token" % BASE_URI
httpretty.register_uri(httpretty.GET, invalid_uri, body="", status=404)
req = webob.Request.blank('/')
req.headers['X-Auth-Token'] = 'invalid-token'
self.middleware(req.environ, self.start_fake_response)
self.assertEqual(self.response_status, 401)
self.assertEqual(self.response_headers['WWW-Authenticate'],
"Keystone uri='https://keystone.example.com:1234'")
def test_request_invalid_signed_token(self):
req = webob.Request.blank('/')
req.headers['X-Auth-Token'] = self.examples.INVALID_SIGNED_TOKEN
self.middleware(req.environ, self.start_fake_response)
self.assertEqual(401, self.response_status)
self.assertEqual("Keystone uri='https://keystone.example.com:1234'",
self.response_headers['WWW-Authenticate'])
def test_request_invalid_signed_pkiz_token(self):
req = webob.Request.blank('/')
req.headers['X-Auth-Token'] = self.examples.INVALID_SIGNED_PKIZ_TOKEN
self.middleware(req.environ, self.start_fake_response)
self.assertEqual(401, self.response_status)
self.assertEqual("Keystone uri='https://keystone.example.com:1234'",
self.response_headers['WWW-Authenticate'])
def test_request_no_token(self):
req = webob.Request.blank('/')
self.middleware(req.environ, self.start_fake_response)
self.assertEqual(self.response_status, 401)
self.assertEqual(self.response_headers['WWW-Authenticate'],
"Keystone uri='https://keystone.example.com:1234'")
def test_request_no_token_log_message(self):
class FakeLog(object):
def __init__(self):
self.msg = None
self.debugmsg = None
def warn(self, msg=None, *args, **kwargs):
self.msg = msg
def debug(self, msg=None, *args, **kwargs):
self.debugmsg = msg
self.middleware.LOG = FakeLog()
self.middleware.delay_auth_decision = False
self.assertRaises(auth_token.InvalidUserToken,
self.middleware._get_user_token_from_header, {})
self.assertIsNotNone(self.middleware.LOG.msg)
self.assertIsNotNone(self.middleware.LOG.debugmsg)
def test_request_no_token_http(self):
req = webob.Request.blank('/', environ={'REQUEST_METHOD': 'HEAD'})
self.set_middleware()
body = self.middleware(req.environ, self.start_fake_response)
self.assertEqual(self.response_status, 401)
self.assertEqual(self.response_headers['WWW-Authenticate'],
"Keystone uri='https://keystone.example.com:1234'")
self.assertEqual(body, [''])
def test_request_blank_token(self):
req = webob.Request.blank('/')
req.headers['X-Auth-Token'] = ''
self.middleware(req.environ, self.start_fake_response)
self.assertEqual(self.response_status, 401)
self.assertEqual(self.response_headers['WWW-Authenticate'],
"Keystone uri='https://keystone.example.com:1234'")
def _get_cached_token(self, token):
token_id = cms.cms_hash_token(token)
# NOTE(vish): example tokens are expired so skip the expiration check.
return self.middleware._cache_get(token_id, ignore_expires=True)
def test_memcache(self):
# NOTE(jamielennox): it appears that httpretty can mess with the
# memcache socket. Just disable it as it's not required here anyway.
httpretty.disable()
req = webob.Request.blank('/')
token = self.token_dict['signed_token_scoped']
req.headers['X-Auth-Token'] = token
self.middleware(req.environ, self.start_fake_response)
self.assertIsNotNone(self._get_cached_token(token))
def test_expired(self):
httpretty.disable()
req = webob.Request.blank('/')
token = self.token_dict['signed_token_scoped_expired']
req.headers['X-Auth-Token'] = token
self.middleware(req.environ, self.start_fake_response)
self.assertEqual(self.response_status, 401)
def test_memcache_set_invalid_uuid(self):
invalid_uri = "%s/v2.0/tokens/invalid-token" % BASE_URI
httpretty.register_uri(httpretty.GET, invalid_uri, body="", status=404)
req = webob.Request.blank('/')
token = 'invalid-token'
req.headers['X-Auth-Token'] = token
self.middleware(req.environ, self.start_fake_response)
self.assertRaises(auth_token.InvalidUserToken,
self._get_cached_token, token)
def test_memcache_set_invalid_signed(self):
req = webob.Request.blank('/')
token = self.token_dict['signed_token_scoped_expired']
req.headers['X-Auth-Token'] = token
self.middleware(req.environ, self.start_fake_response)
self.assertRaises(auth_token.InvalidUserToken,
self._get_cached_token, token)
def test_memcache_set_expired(self, extra_conf={}, extra_environ={}):
httpretty.disable()
token_cache_time = 10
conf = {
'token_cache_time': token_cache_time,
'signing_dir': client_fixtures.CERTDIR,
}
conf.update(extra_conf)
self.set_middleware(conf=conf)
req = webob.Request.blank('/')
token = self.token_dict['signed_token_scoped']
req.headers['X-Auth-Token'] = token
req.environ.update(extra_environ)
timeutils_utcnow = 'keystoneclient.openstack.common.timeutils.utcnow'
now = datetime.datetime.utcnow()
with mock.patch(timeutils_utcnow) as mock_utcnow:
mock_utcnow.return_value = now
self.middleware(req.environ, self.start_fake_response)
self.assertIsNotNone(self._get_cached_token(token))
expired = now + datetime.timedelta(seconds=token_cache_time)
with mock.patch(timeutils_utcnow) as mock_utcnow:
mock_utcnow.return_value = expired
self.assertIsNone(self._get_cached_token(token))
def test_swift_memcache_set_expired(self):
extra_conf = {'cache': 'swift.cache'}
extra_environ = {'swift.cache': memorycache.Client()}
self.test_memcache_set_expired(extra_conf, extra_environ)
def test_use_cache_from_env(self):
env = {'swift.cache': 'CACHE_TEST'}
conf = {
'cache': 'swift.cache',
'memcached_servers': MEMCACHED_SERVERS
}
self.set_middleware(conf=conf)
self.middleware._init_cache(env)
with self.middleware._cache_pool.reserve() as cache:
self.assertEqual(cache, 'CACHE_TEST')
def test_will_expire_soon(self):
tenseconds = datetime.datetime.utcnow() + datetime.timedelta(
seconds=10)
self.assertTrue(auth_token.will_expire_soon(tenseconds))
fortyseconds = datetime.datetime.utcnow() + datetime.timedelta(
seconds=40)
self.assertFalse(auth_token.will_expire_soon(fortyseconds))
def test_token_is_v2_accepts_v2(self):
token = self.examples.UUID_TOKEN_DEFAULT
token_response = self.examples.TOKEN_RESPONSES[token]
self.assertTrue(auth_token._token_is_v2(token_response))
def test_token_is_v2_rejects_v3(self):
token = self.examples.v3_UUID_TOKEN_DEFAULT
token_response = self.examples.TOKEN_RESPONSES[token]
self.assertFalse(auth_token._token_is_v2(token_response))
def test_token_is_v3_rejects_v2(self):
token = self.examples.UUID_TOKEN_DEFAULT
token_response = self.examples.TOKEN_RESPONSES[token]
self.assertFalse(auth_token._token_is_v3(token_response))
def test_token_is_v3_accepts_v3(self):
token = self.examples.v3_UUID_TOKEN_DEFAULT
token_response = self.examples.TOKEN_RESPONSES[token]
self.assertTrue(auth_token._token_is_v3(token_response))
@testtools.skipUnless(memcached_available(), 'memcached not available')
def test_encrypt_cache_data(self):
httpretty.disable()
conf = {
'memcached_servers': MEMCACHED_SERVERS,
'memcache_security_strategy': 'encrypt',
'memcache_secret_key': 'mysecret'
}
self.set_middleware(conf=conf)
token = b'my_token'
some_time_later = timeutils.utcnow() + datetime.timedelta(hours=4)
expires = timeutils.strtime(some_time_later)
data = ('this_data', expires)
self.middleware._init_cache({})
self.middleware._cache_store(token, data)
self.assertEqual(self.middleware._cache_get(token), data[0])
@testtools.skipUnless(memcached_available(), 'memcached not available')
def test_sign_cache_data(self):
httpretty.disable()
conf = {
'memcached_servers': MEMCACHED_SERVERS,
'memcache_security_strategy': 'mac',
'memcache_secret_key': 'mysecret'
}
self.set_middleware(conf=conf)
token = b'my_token'
some_time_later = timeutils.utcnow() + datetime.timedelta(hours=4)
expires = timeutils.strtime(some_time_later)
data = ('this_data', expires)
self.middleware._init_cache({})
self.middleware._cache_store(token, data)
self.assertEqual(self.middleware._cache_get(token), data[0])
@testtools.skipUnless(memcached_available(), 'memcached not available')
def test_no_memcache_protection(self):
httpretty.disable()
conf = {
'memcached_servers': MEMCACHED_SERVERS,
'memcache_secret_key': 'mysecret'
}
self.set_middleware(conf=conf)
token = 'my_token'
some_time_later = timeutils.utcnow() + datetime.timedelta(hours=4)
expires = timeutils.strtime(some_time_later)
data = ('this_data', expires)
self.middleware._init_cache({})
self.middleware._cache_store(token, data)
self.assertEqual(self.middleware._cache_get(token), data[0])
def test_assert_valid_memcache_protection_config(self):
# test missing memcache_secret_key
conf = {
'memcached_servers': MEMCACHED_SERVERS,
'memcache_security_strategy': 'Encrypt'
}
self.assertRaises(auth_token.ConfigurationError, self.set_middleware,
conf=conf)
# test invalue memcache_security_strategy
conf = {
'memcached_servers': MEMCACHED_SERVERS,
'memcache_security_strategy': 'whatever'
}
self.assertRaises(auth_token.ConfigurationError, self.set_middleware,
conf=conf)
# test missing memcache_secret_key
conf = {
'memcached_servers': MEMCACHED_SERVERS,
'memcache_security_strategy': 'mac'
}
self.assertRaises(auth_token.ConfigurationError, self.set_middleware,
conf=conf)
conf = {
'memcached_servers': MEMCACHED_SERVERS,
'memcache_security_strategy': 'Encrypt',
'memcache_secret_key': ''
}
self.assertRaises(auth_token.ConfigurationError, self.set_middleware,
conf=conf)
conf = {
'memcached_servers': MEMCACHED_SERVERS,
'memcache_security_strategy': 'mAc',
'memcache_secret_key': ''
}
self.assertRaises(auth_token.ConfigurationError, self.set_middleware,
conf=conf)
def test_config_revocation_cache_timeout(self):
conf = {
'revocation_cache_time': 24,
'auth_uri': 'https://keystone.example.com:1234',
}
middleware = auth_token.AuthProtocol(self.fake_app, conf)
self.assertEqual(middleware.token_revocation_list_cache_timeout,
datetime.timedelta(seconds=24))
def test_http_error_not_cached_token(self):
"""Test to don't cache token as invalid on network errors.
We use UUID tokens since they are the easiest one to reach
get_http_connection.
"""
req = webob.Request.blank('/')
req.headers['X-Auth-Token'] = ERROR_TOKEN
self.middleware.http_request_max_retries = 0
self.middleware(req.environ, self.start_fake_response)
self.assertIsNone(self._get_cached_token(ERROR_TOKEN))
self.assert_valid_last_url(ERROR_TOKEN)
def test_http_request_max_retries(self):
times_retry = 10
req = webob.Request.blank('/')
req.headers['X-Auth-Token'] = ERROR_TOKEN
conf = {'http_request_max_retries': times_retry}
self.set_middleware(conf=conf)
with mock.patch('time.sleep') as mock_obj:
self.middleware(req.environ, self.start_fake_response)
self.assertEqual(mock_obj.call_count, times_retry)
def test_nocatalog(self):
conf = {
'include_service_catalog': False
}
self.set_middleware(conf=conf)
self.assert_valid_request_200(self.token_dict['uuid_token_default'],
with_catalog=False)
def assert_kerberos_bind(self, token, bind_level,
use_kerberos=True, success=True):
conf = {
'enforce_token_bind': bind_level,
'auth_version': self.auth_version,
}
self.set_middleware(conf=conf)
req = webob.Request.blank('/')
req.headers['X-Auth-Token'] = token
if use_kerberos:
if use_kerberos is True:
req.environ['REMOTE_USER'] = self.examples.KERBEROS_BIND
else:
req.environ['REMOTE_USER'] = use_kerberos
req.environ['AUTH_TYPE'] = 'Negotiate'
body = self.middleware(req.environ, self.start_fake_response)
if success:
self.assertEqual(self.response_status, 200)
self.assertEqual(body, [FakeApp.SUCCESS])
self.assertIn('keystone.token_info', req.environ)
self.assert_valid_last_url(token)
else:
self.assertEqual(self.response_status, 401)
self.assertEqual(self.response_headers['WWW-Authenticate'],
"Keystone uri='https://keystone.example.com:1234'"
)
def test_uuid_bind_token_disabled_with_kerb_user(self):
for use_kerberos in [True, False]:
self.assert_kerberos_bind(self.token_dict['uuid_token_bind'],
bind_level='disabled',
use_kerberos=use_kerberos,
success=True)
def test_uuid_bind_token_disabled_with_incorrect_ticket(self):
self.assert_kerberos_bind(self.token_dict['uuid_token_bind'],
bind_level='kerberos',
use_kerberos='ronald@MCDONALDS.COM',
success=False)
def test_uuid_bind_token_permissive_with_kerb_user(self):
self.assert_kerberos_bind(self.token_dict['uuid_token_bind'],
bind_level='permissive',
use_kerberos=True,
success=True)
def test_uuid_bind_token_permissive_without_kerb_user(self):
self.assert_kerberos_bind(self.token_dict['uuid_token_bind'],
bind_level='permissive',
use_kerberos=False,
success=False)
def test_uuid_bind_token_permissive_with_unknown_bind(self):
token = self.token_dict['uuid_token_unknown_bind']
for use_kerberos in [True, False]:
self.assert_kerberos_bind(token,
bind_level='permissive',
use_kerberos=use_kerberos,
success=True)
def test_uuid_bind_token_permissive_with_incorrect_ticket(self):
self.assert_kerberos_bind(self.token_dict['uuid_token_bind'],
bind_level='kerberos',
use_kerberos='ronald@MCDONALDS.COM',
success=False)
def test_uuid_bind_token_strict_with_kerb_user(self):
self.assert_kerberos_bind(self.token_dict['uuid_token_bind'],
bind_level='strict',
use_kerberos=True,
success=True)
def test_uuid_bind_token_strict_with_kerbout_user(self):
self.assert_kerberos_bind(self.token_dict['uuid_token_bind'],
bind_level='strict',
use_kerberos=False,
success=False)
def test_uuid_bind_token_strict_with_unknown_bind(self):
token = self.token_dict['uuid_token_unknown_bind']
for use_kerberos in [True, False]:
self.assert_kerberos_bind(token,
bind_level='strict',
use_kerberos=use_kerberos,
success=False)
def test_uuid_bind_token_required_with_kerb_user(self):
self.assert_kerberos_bind(self.token_dict['uuid_token_bind'],
bind_level='required',
use_kerberos=True,
success=True)
def test_uuid_bind_token_required_without_kerb_user(self):
self.assert_kerberos_bind(self.token_dict['uuid_token_bind'],
bind_level='required',
use_kerberos=False,
success=False)
def test_uuid_bind_token_required_with_unknown_bind(self):
token = self.token_dict['uuid_token_unknown_bind']
for use_kerberos in [True, False]:
self.assert_kerberos_bind(token,
bind_level='required',
use_kerberos=use_kerberos,
success=False)
def test_uuid_bind_token_required_without_bind(self):
for use_kerberos in [True, False]:
self.assert_kerberos_bind(self.token_dict['uuid_token_default'],
bind_level='required',
use_kerberos=use_kerberos,
success=False)
def test_uuid_bind_token_named_kerberos_with_kerb_user(self):
self.assert_kerberos_bind(self.token_dict['uuid_token_bind'],
bind_level='kerberos',
use_kerberos=True,
success=True)
def test_uuid_bind_token_named_kerberos_without_kerb_user(self):
self.assert_kerberos_bind(self.token_dict['uuid_token_bind'],
bind_level='kerberos',
use_kerberos=False,
success=False)
def test_uuid_bind_token_named_kerberos_with_unknown_bind(self):
token = self.token_dict['uuid_token_unknown_bind']
for use_kerberos in [True, False]:
self.assert_kerberos_bind(token,
bind_level='kerberos',
use_kerberos=use_kerberos,
success=False)
def test_uuid_bind_token_named_kerberos_without_bind(self):
for use_kerberos in [True, False]:
self.assert_kerberos_bind(self.token_dict['uuid_token_default'],
bind_level='kerberos',
use_kerberos=use_kerberos,
success=False)
def test_uuid_bind_token_named_kerberos_with_incorrect_ticket(self):
self.assert_kerberos_bind(self.token_dict['uuid_token_bind'],
bind_level='kerberos',
use_kerberos='ronald@MCDONALDS.COM',
success=False)
def test_uuid_bind_token_with_unknown_named_FOO(self):
token = self.token_dict['uuid_token_bind']
for use_kerberos in [True, False]:
self.assert_kerberos_bind(token,
bind_level='FOO',
use_kerberos=use_kerberos,
success=False)
class V2CertDownloadMiddlewareTest(BaseAuthTokenMiddlewareTest,
testresources.ResourcedTestCase):
resources = [('examples', client_fixtures.EXAMPLES_RESOURCE)]
def __init__(self, *args, **kwargs):
super(V2CertDownloadMiddlewareTest, self).__init__(*args, **kwargs)
self.auth_version = 'v2.0'
self.fake_app = None
self.ca_path = '/v2.0/certificates/ca'
self.signing_path = '/v2.0/certificates/signing'
def setUp(self):
super(V2CertDownloadMiddlewareTest, self).setUp(
auth_version=self.auth_version,
fake_app=self.fake_app)
self.base_dir = tempfile.mkdtemp()
self.addCleanup(shutil.rmtree, self.base_dir)
self.cert_dir = os.path.join(self.base_dir, 'certs')
os.makedirs(self.cert_dir, stat.S_IRWXU)
conf = {
'signing_dir': self.cert_dir,
'auth_version': self.auth_version,
}
self.set_middleware(conf=conf)
httpretty.reset()
httpretty.enable()
self.addCleanup(httpretty.disable)
# Usually we supply a signed_dir with pre-installed certificates,
# so invocation of /usr/bin/openssl succeeds. This time we give it
# an empty directory, so it fails.
def test_request_no_token_dummy(self):
cms._ensure_subprocess()
httpretty.register_uri(httpretty.GET,
"%s%s" % (BASE_URI, self.ca_path),
status=404)
httpretty.register_uri(httpretty.GET,
"%s%s" % (BASE_URI, self.signing_path),
status=404)
self.assertRaises(exceptions.CertificateConfigError,
self.middleware.verify_signed_token,
self.examples.SIGNED_TOKEN_SCOPED)
def test_fetch_signing_cert(self):
data = 'FAKE CERT'
httpretty.register_uri(httpretty.GET,
"%s%s" % (BASE_URI, self.signing_path),
body=data)
self.middleware.fetch_signing_cert()
with open(self.middleware.signing_cert_file_name, 'r') as f:
self.assertEqual(f.read(), data)
self.assertEqual("/testadmin%s" % self.signing_path,
httpretty.last_request().path)
def test_fetch_signing_ca(self):
data = 'FAKE CA'
httpretty.register_uri(httpretty.GET,
"%s%s" % (BASE_URI, self.ca_path),
body=data)
self.middleware.fetch_ca_cert()
with open(self.middleware.signing_ca_file_name, 'r') as f:
self.assertEqual(f.read(), data)
self.assertEqual("/testadmin%s" % self.ca_path,
httpretty.last_request().path)
def test_prefix_trailing_slash(self):
del self.conf['identity_uri']
self.conf['auth_protocol'] = 'https'
self.conf['auth_host'] = 'keystone.example.com'
self.conf['auth_port'] = 1234
self.conf['auth_admin_prefix'] = '/newadmin/'
httpretty.register_uri(httpretty.GET,
"%s/newadmin%s" % (BASE_HOST, self.ca_path),
body='FAKECA')
httpretty.register_uri(httpretty.GET,
"%s/newadmin%s" %
(BASE_HOST, self.signing_path), body='FAKECERT')
self.set_middleware(conf=self.conf)
self.middleware.fetch_ca_cert()
self.assertEqual('/newadmin%s' % self.ca_path,
httpretty.last_request().path)
self.middleware.fetch_signing_cert()
self.assertEqual('/newadmin%s' % self.signing_path,
httpretty.last_request().path)
def test_without_prefix(self):
del self.conf['identity_uri']
self.conf['auth_protocol'] = 'https'
self.conf['auth_host'] = 'keystone.example.com'
self.conf['auth_port'] = 1234
self.conf['auth_admin_prefix'] = ''
httpretty.register_uri(httpretty.GET,
"%s%s" % (BASE_HOST, self.ca_path),
body='FAKECA')
httpretty.register_uri(httpretty.GET,
"%s%s" % (BASE_HOST, self.signing_path),
body='FAKECERT')
self.set_middleware(conf=self.conf)
self.middleware.fetch_ca_cert()
self.assertEqual(self.ca_path,
httpretty.last_request().path)
self.middleware.fetch_signing_cert()
self.assertEqual(self.signing_path,
httpretty.last_request().path)
class V3CertDownloadMiddlewareTest(V2CertDownloadMiddlewareTest):
def __init__(self, *args, **kwargs):
super(V3CertDownloadMiddlewareTest, self).__init__(*args, **kwargs)
self.auth_version = 'v3.0'
self.fake_app = v3FakeApp
self.ca_path = '/v3/OS-SIMPLE-CERT/ca'
self.signing_path = '/v3/OS-SIMPLE-CERT/certificates'
def network_error_response(method, uri, headers):
raise auth_token.NetworkError("Network connection error.")
class v2AuthTokenMiddlewareTest(BaseAuthTokenMiddlewareTest,
CommonAuthTokenMiddlewareTest,
testresources.ResourcedTestCase):
"""v2 token specific tests.
There are some differences between how the auth-token middleware handles
v2 and v3 tokens over and above the token formats, namely:
- A v3 keystone server will auto scope a token to a user's default project
if no scope is specified. A v2 server assumes that the auth-token
middleware will do that.
- A v2 keystone server may issue a token without a catalog, even with a
tenant
The tests below were originally part of the generic AuthTokenMiddlewareTest
class, but now, since they really are v2 specific, they are included here.
"""
resources = [('examples', client_fixtures.EXAMPLES_RESOURCE)]
def setUp(self):
super(v2AuthTokenMiddlewareTest, self).setUp()
self.token_dict = {
'uuid_token_default': self.examples.UUID_TOKEN_DEFAULT,
'uuid_token_unscoped': self.examples.UUID_TOKEN_UNSCOPED,
'uuid_token_bind': self.examples.UUID_TOKEN_BIND,
'uuid_token_unknown_bind': self.examples.UUID_TOKEN_UNKNOWN_BIND,
'signed_token_scoped': self.examples.SIGNED_TOKEN_SCOPED,
'signed_token_scoped_pkiz': self.examples.SIGNED_TOKEN_SCOPED_PKIZ,
'signed_token_scoped_expired':
self.examples.SIGNED_TOKEN_SCOPED_EXPIRED,
'revoked_token': self.examples.REVOKED_TOKEN,
'revoked_token_pkiz': self.examples.REVOKED_TOKEN_PKIZ,
'revoked_token_hash': self.examples.REVOKED_TOKEN_HASH
}
httpretty.reset()
httpretty.enable()
self.addCleanup(httpretty.disable)
httpretty.register_uri(httpretty.GET,
"%s/" % BASE_URI,
body=VERSION_LIST_v2,
status=300)
httpretty.register_uri(httpretty.POST,
"%s/v2.0/tokens" % BASE_URI,
body=FAKE_ADMIN_TOKEN)
httpretty.register_uri(httpretty.GET,
"%s/v2.0/tokens/revoked" % BASE_URI,
body=self.examples.SIGNED_REVOCATION_LIST,
status=200)
for token in (self.examples.UUID_TOKEN_DEFAULT,
self.examples.UUID_TOKEN_UNSCOPED,
self.examples.UUID_TOKEN_BIND,
self.examples.UUID_TOKEN_UNKNOWN_BIND,
self.examples.UUID_TOKEN_NO_SERVICE_CATALOG):
httpretty.register_uri(httpretty.GET,
"%s/v2.0/tokens/%s" % (BASE_URI, token),
body=
self.examples.JSON_TOKEN_RESPONSES[token])
httpretty.register_uri(httpretty.GET,
'%s/v2.0/tokens/%s' % (BASE_URI, ERROR_TOKEN),
body=network_error_response)
self.set_middleware()
def assert_unscoped_default_tenant_auto_scopes(self, token):
"""Unscoped v2 requests with a default tenant should "auto-scope."
The implied scope is the user's tenant ID.
"""
req = webob.Request.blank('/')
req.headers['X-Auth-Token'] = token
body = self.middleware(req.environ, self.start_fake_response)
self.assertEqual(self.response_status, 200)
self.assertEqual(body, [FakeApp.SUCCESS])
self.assertIn('keystone.token_info', req.environ)
def assert_valid_last_url(self, token_id):
self.assertLastPath("/testadmin/v2.0/tokens/%s" % token_id)
def test_default_tenant_uuid_token(self):
self.assert_unscoped_default_tenant_auto_scopes(
self.examples.UUID_TOKEN_DEFAULT)
def test_default_tenant_signed_token(self):
self.assert_unscoped_default_tenant_auto_scopes(
self.examples.SIGNED_TOKEN_SCOPED)
def assert_unscoped_token_receives_401(self, token):
"""Unscoped requests with no default tenant ID should be rejected."""
req = webob.Request.blank('/')
req.headers['X-Auth-Token'] = token
self.middleware(req.environ, self.start_fake_response)
self.assertEqual(self.response_status, 401)
self.assertEqual(self.response_headers['WWW-Authenticate'],
"Keystone uri='https://keystone.example.com:1234'")
def test_unscoped_uuid_token_receives_401(self):
self.assert_unscoped_token_receives_401(
self.examples.UUID_TOKEN_UNSCOPED)
def test_unscoped_pki_token_receives_401(self):
self.assert_unscoped_token_receives_401(
self.examples.SIGNED_TOKEN_UNSCOPED)
def test_request_prevent_service_catalog_injection(self):
req = webob.Request.blank('/')
req.headers['X-Service-Catalog'] = '[]'
req.headers['X-Auth-Token'] = (
self.examples.UUID_TOKEN_NO_SERVICE_CATALOG)
body = self.middleware(req.environ, self.start_fake_response)
self.assertEqual(self.response_status, 200)
self.assertFalse(req.headers.get('X-Service-Catalog'))
self.assertEqual(body, [FakeApp.SUCCESS])
class CrossVersionAuthTokenMiddlewareTest(BaseAuthTokenMiddlewareTest,
testresources.ResourcedTestCase):
resources = [('examples', client_fixtures.EXAMPLES_RESOURCE)]
@httpretty.activate
def test_valid_uuid_request_forced_to_2_0(self):
"""Test forcing auth_token to use lower api version.
By installing the v3 http hander, auth_token will be get
a version list that looks like a v3 server - from which it
would normally chose v3.0 as the auth version. However, here
we specify v2.0 in the configuration - which should force
auth_token to use that version instead.
"""
conf = {
'signing_dir': client_fixtures.CERTDIR,
'auth_version': 'v2.0'
}
httpretty.register_uri(httpretty.GET,
"%s/" % BASE_URI,
body=VERSION_LIST_v3,
status=300)
httpretty.register_uri(httpretty.POST,
"%s/v2.0/tokens" % BASE_URI,
body=FAKE_ADMIN_TOKEN)
token = self.examples.UUID_TOKEN_DEFAULT
httpretty.register_uri(httpretty.GET,
"%s/v2.0/tokens/%s" % (BASE_URI, token),
body=
self.examples.JSON_TOKEN_RESPONSES[token])
self.set_middleware(conf=conf)
# This tests will only work is auth_token has chosen to use the
# lower, v2, api version
req = webob.Request.blank('/')
req.headers['X-Auth-Token'] = self.examples.UUID_TOKEN_DEFAULT
self.middleware(req.environ, self.start_fake_response)
self.assertEqual(self.response_status, 200)
self.assertEqual("/testadmin/v2.0/tokens/%s" %
self.examples.UUID_TOKEN_DEFAULT,
httpretty.last_request().path)
class v3AuthTokenMiddlewareTest(BaseAuthTokenMiddlewareTest,
CommonAuthTokenMiddlewareTest,
testresources.ResourcedTestCase):
"""Test auth_token middleware with v3 tokens.
Re-execute the AuthTokenMiddlewareTest class tests, but with the
auth_token middleware configured to expect v3 tokens back from
a keystone server.
This is done by configuring the AuthTokenMiddlewareTest class via
its Setup(), passing in v3 style data that will then be used by
the tests themselves. This approach has been used to ensure we
really are running the same tests for both v2 and v3 tokens.
There a few additional specific test for v3 only:
- We allow an unscoped token to be validated (as unscoped), where
as for v2 tokens, the auth_token middleware is expected to try and
auto-scope it (and fail if there is no default tenant)
- Domain scoped tokens
Since we don't specify an auth version for auth_token to use, by
definition we are thefore implicitely testing that it will use
the highest available auth version, i.e. v3.0
"""
resources = [('examples', client_fixtures.EXAMPLES_RESOURCE)]
def setUp(self):
super(v3AuthTokenMiddlewareTest, self).setUp(
auth_version='v3.0',
fake_app=v3FakeApp)
self.token_dict = {
'uuid_token_default': self.examples.v3_UUID_TOKEN_DEFAULT,
'uuid_token_unscoped': self.examples.v3_UUID_TOKEN_UNSCOPED,
'uuid_token_bind': self.examples.v3_UUID_TOKEN_BIND,
'uuid_token_unknown_bind':
self.examples.v3_UUID_TOKEN_UNKNOWN_BIND,
'signed_token_scoped': self.examples.SIGNED_v3_TOKEN_SCOPED,
'signed_token_scoped_pkiz':
self.examples.SIGNED_v3_TOKEN_SCOPED_PKIZ,
'signed_token_scoped_expired':
self.examples.SIGNED_TOKEN_SCOPED_EXPIRED,
'revoked_token': self.examples.REVOKED_v3_TOKEN,
'revoked_token_pkiz': self.examples.REVOKED_v3_TOKEN_PKIZ,
'revoked_token_hash': self.examples.REVOKED_v3_TOKEN_HASH
}
httpretty.reset()
httpretty.enable()
self.addCleanup(httpretty.disable)
httpretty.register_uri(httpretty.GET,
"%s" % BASE_URI,
body=VERSION_LIST_v3,
status=300)
# TODO(jamielennox): auth_token middleware uses a v2 admin token
# regardless of the auth_version that is set.
httpretty.register_uri(httpretty.POST,
"%s/v2.0/tokens" % BASE_URI,
body=FAKE_ADMIN_TOKEN)
# TODO(jamielennox): there is no v3 revocation url yet, it uses v2
httpretty.register_uri(httpretty.GET,
"%s/v2.0/tokens/revoked" % BASE_URI,
body=self.examples.SIGNED_REVOCATION_LIST,
status=200)
httpretty.register_uri(httpretty.GET,
"%s/v3/auth/tokens" % BASE_URI,
body=self.token_response)
self.set_middleware()
def token_response(self, request, uri, headers):
auth_id = request.headers.get('X-Auth-Token')
token_id = request.headers.get('X-Subject-Token')
self.assertEqual(auth_id, FAKE_ADMIN_TOKEN_ID)
headers.pop('status')
status = 200
response = ""
if token_id == ERROR_TOKEN:
raise auth_token.NetworkError("Network connection error.")
try:
response = self.examples.JSON_TOKEN_RESPONSES[token_id]
except KeyError:
status = 404
return status, headers, response
def assert_valid_last_url(self, token_id):
self.assertLastPath('/testadmin/v3/auth/tokens')
def test_valid_unscoped_uuid_request(self):
# Remove items that won't be in an unscoped token
delta_expected_env = {
'HTTP_X_PROJECT_ID': None,
'HTTP_X_PROJECT_NAME': None,
'HTTP_X_PROJECT_DOMAIN_ID': None,
'HTTP_X_PROJECT_DOMAIN_NAME': None,
'HTTP_X_TENANT_ID': None,
'HTTP_X_TENANT_NAME': None,
'HTTP_X_ROLES': '',
'HTTP_X_TENANT': None,
'HTTP_X_ROLE': '',
}
self.set_middleware(expected_env=delta_expected_env)
self.assert_valid_request_200(self.examples.v3_UUID_TOKEN_UNSCOPED,
with_catalog=False)
self.assertLastPath('/testadmin/v3/auth/tokens')
def test_domain_scoped_uuid_request(self):
# Modify items compared to default token for a domain scope
delta_expected_env = {
'HTTP_X_DOMAIN_ID': 'domain_id1',
'HTTP_X_DOMAIN_NAME': 'domain_name1',
'HTTP_X_PROJECT_ID': None,
'HTTP_X_PROJECT_NAME': None,
'HTTP_X_PROJECT_DOMAIN_ID': None,
'HTTP_X_PROJECT_DOMAIN_NAME': None,
'HTTP_X_TENANT_ID': None,
'HTTP_X_TENANT_NAME': None,
'HTTP_X_TENANT': None
}
self.set_middleware(expected_env=delta_expected_env)
self.assert_valid_request_200(
self.examples.v3_UUID_TOKEN_DOMAIN_SCOPED)
self.assertLastPath('/testadmin/v3/auth/tokens')
class TokenEncodingTest(testtools.TestCase):
def test_unquoted_token(self):
self.assertEqual('foo%20bar', auth_token.safe_quote('foo bar'))
def test_quoted_token(self):
self.assertEqual('foo%20bar', auth_token.safe_quote('foo%20bar'))
class TokenExpirationTest(BaseAuthTokenMiddlewareTest):
def setUp(self):
super(TokenExpirationTest, self).setUp()
self.now = timeutils.utcnow()
self.delta = datetime.timedelta(hours=1)
self.one_hour_ago = timeutils.isotime(self.now - self.delta,
subsecond=True)
self.one_hour_earlier = timeutils.isotime(self.now + self.delta,
subsecond=True)
def create_v2_token_fixture(self, expires=None):
v2_fixture = {
'access': {
'token': {
'id': 'blah',
'expires': expires or self.one_hour_earlier,
'tenant': {
'id': 'tenant_id1',
'name': 'tenant_name1',
},
},
'user': {
'id': 'user_id1',
'name': 'user_name1',
'roles': [
{'name': 'role1'},
{'name': 'role2'},
],
},
'serviceCatalog': {}
},
}
return v2_fixture
def create_v3_token_fixture(self, expires=None):
v3_fixture = {
'token': {
'expires_at': expires or self.one_hour_earlier,
'user': {
'id': 'user_id1',
'name': 'user_name1',
'domain': {
'id': 'domain_id1',
'name': 'domain_name1'
}
},
'project': {
'id': 'tenant_id1',
'name': 'tenant_name1',
'domain': {
'id': 'domain_id1',
'name': 'domain_name1'
}
},
'roles': [
{'name': 'role1', 'id': 'Role1'},
{'name': 'role2', 'id': 'Role2'},
],
'catalog': {}
}
}
return v3_fixture
def test_no_data(self):
data = {}
self.assertRaises(auth_token.InvalidUserToken,
auth_token.confirm_token_not_expired,
data)
def test_bad_data(self):
data = {'my_happy_token_dict': 'woo'}
self.assertRaises(auth_token.InvalidUserToken,
auth_token.confirm_token_not_expired,
data)
def test_v2_token_not_expired(self):
data = self.create_v2_token_fixture()
expected_expires = data['access']['token']['expires']
actual_expires = auth_token.confirm_token_not_expired(data)
self.assertEqual(actual_expires, expected_expires)
def test_v2_token_expired(self):
data = self.create_v2_token_fixture(expires=self.one_hour_ago)
self.assertRaises(auth_token.InvalidUserToken,
auth_token.confirm_token_not_expired,
data)
@mock.patch('keystoneclient.openstack.common.timeutils.utcnow')
def test_v2_token_with_timezone_offset_not_expired(self, mock_utcnow):
current_time = timeutils.parse_isotime('2000-01-01T00:01:10.000123Z')
current_time = timeutils.normalize_time(current_time)
mock_utcnow.return_value = current_time
data = self.create_v2_token_fixture(
expires='2000-01-01T00:05:10.000123-05:00')
expected_expires = '2000-01-01T05:05:10.000123Z'
actual_expires = auth_token.confirm_token_not_expired(data)
self.assertEqual(actual_expires, expected_expires)
@mock.patch('keystoneclient.openstack.common.timeutils.utcnow')
def test_v2_token_with_timezone_offset_expired(self, mock_utcnow):
current_time = timeutils.parse_isotime('2000-01-01T00:01:10.000123Z')
current_time = timeutils.normalize_time(current_time)
mock_utcnow.return_value = current_time
data = self.create_v2_token_fixture(
expires='2000-01-01T00:05:10.000123+05:00')
data['access']['token']['expires'] = '2000-01-01T00:05:10.000123+05:00'
self.assertRaises(auth_token.InvalidUserToken,
auth_token.confirm_token_not_expired,
data)
def test_v3_token_not_expired(self):
data = self.create_v3_token_fixture()
expected_expires = data['token']['expires_at']
actual_expires = auth_token.confirm_token_not_expired(data)
self.assertEqual(actual_expires, expected_expires)
def test_v3_token_expired(self):
data = self.create_v3_token_fixture(expires=self.one_hour_ago)
self.assertRaises(auth_token.InvalidUserToken,
auth_token.confirm_token_not_expired,
data)
@mock.patch('keystoneclient.openstack.common.timeutils.utcnow')
def test_v3_token_with_timezone_offset_not_expired(self, mock_utcnow):
current_time = timeutils.parse_isotime('2000-01-01T00:01:10.000123Z')
current_time = timeutils.normalize_time(current_time)
mock_utcnow.return_value = current_time
data = self.create_v3_token_fixture(
expires='2000-01-01T00:05:10.000123-05:00')
expected_expires = '2000-01-01T05:05:10.000123Z'
actual_expires = auth_token.confirm_token_not_expired(data)
self.assertEqual(actual_expires, expected_expires)
@mock.patch('keystoneclient.openstack.common.timeutils.utcnow')
def test_v3_token_with_timezone_offset_expired(self, mock_utcnow):
current_time = timeutils.parse_isotime('2000-01-01T00:01:10.000123Z')
current_time = timeutils.normalize_time(current_time)
mock_utcnow.return_value = current_time
data = self.create_v3_token_fixture(
expires='2000-01-01T00:05:10.000123+05:00')
self.assertRaises(auth_token.InvalidUserToken,
auth_token.confirm_token_not_expired,
data)
def test_cached_token_not_expired(self):
token = 'mytoken'
data = 'this_data'
self.set_middleware()
self.middleware._init_cache({})
some_time_later = timeutils.strtime(at=(self.now + self.delta))
expires = some_time_later
self.middleware._cache_put(token, data, expires)
self.assertEqual(self.middleware._cache_get(token), data)
def test_cached_token_not_expired_with_old_style_nix_timestamp(self):
"""Ensure we cannot retrieve a token from the cache.
Getting a token from the cache should return None when the token data
in the cache stores the expires time as a \*nix style timestamp.
"""
token = 'mytoken'
data = 'this_data'
self.set_middleware()
self.middleware._init_cache({})
some_time_later = self.now + self.delta
# Store a unix timestamp in the cache.
expires = calendar.timegm(some_time_later.timetuple())
self.middleware._cache_put(token, data, expires)
self.assertIsNone(self.middleware._cache_get(token))
def test_cached_token_expired(self):
token = 'mytoken'
data = 'this_data'
self.set_middleware()
self.middleware._init_cache({})
some_time_earlier = timeutils.strtime(at=(self.now - self.delta))
expires = some_time_earlier
self.middleware._cache_put(token, data, expires)
self.assertIsNone(self.middleware._cache_get(token))
def test_cached_token_with_timezone_offset_not_expired(self):
token = 'mytoken'
data = 'this_data'
self.set_middleware()
self.middleware._init_cache({})
timezone_offset = datetime.timedelta(hours=2)
some_time_later = self.now - timezone_offset + self.delta
expires = timeutils.strtime(some_time_later) + '-02:00'
self.middleware._cache_put(token, data, expires)
self.assertEqual(self.middleware._cache_get(token), data)
def test_cached_token_with_timezone_offset_expired(self):
token = 'mytoken'
data = 'this_data'
self.set_middleware()
self.middleware._init_cache({})
timezone_offset = datetime.timedelta(hours=2)
some_time_earlier = self.now - timezone_offset - self.delta
expires = timeutils.strtime(some_time_earlier) + '-02:00'
self.middleware._cache_put(token, data, expires)
self.assertIsNone(self.middleware._cache_get(token))
def load_tests(loader, tests, pattern):
return testresources.OptimisingTestSuite(tests)
|
{
"content_hash": "74961de6c48f9371f9651ef603bb9bd8",
"timestamp": "",
"source": "github",
"line_count": 1810,
"max_line_length": 79,
"avg_line_length": 40.06685082872928,
"alnum_prop": 0.5892086430137478,
"repo_name": "UTSA-ICS/python-keystoneclient-SID",
"id": "6b81f2368a4babac0ae0547a13f74c78c2127708",
"size": "73107",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "keystoneclient/tests/test_auth_token_middleware.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "16002"
},
{
"name": "JavaScript",
"bytes": "7403"
},
{
"name": "Python",
"bytes": "1044183"
},
{
"name": "Shell",
"bytes": "12048"
}
],
"symlink_target": ""
}
|
<Alloy>
<NavigationWindow platform="ios">
<Window title="Window Toolbar">
<WindowToolbar platform="ios">
<FlexSpace/>
<TextField id="tf" />
<FlexSpace/>
<Button id="btn1">Btn 1</Button>
<FlexSpace/>
<Button onClick="doClick" id="btn2">Btn 2</Button>
<FlexSpace/>
</WindowToolbar>
<Label text="The window should have a toolbar with two buttons and a text field."/>
</Window>
</NavigationWindow>
<Window platform="android,mobileweb,blackberry">
<Label platform="android,mobileweb">Window.toolbar supported only on iOS</Label>
</Window>
</Alloy>
|
{
"content_hash": "8b0a279357c46b017c79133d733742a7",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 95,
"avg_line_length": 32.421052631578945,
"alnum_prop": 0.650974025974026,
"repo_name": "FokkeZB/alloy",
"id": "49c986cfd0b3758595f6140f6ed4e6d122140815",
"size": "616",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/apps/ui/window_toolbar/views/index.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "12555"
},
{
"name": "CoffeeScript",
"bytes": "872"
},
{
"name": "JavaScript",
"bytes": "3442482"
},
{
"name": "Perl",
"bytes": "6664"
},
{
"name": "Python",
"bytes": "5251"
}
],
"symlink_target": ""
}
|
create database if not exists `tv_report`;
use `tv_report`;
CREATE EXTERNAL TABLE `tv_report.appinstall`(
`sv` string,
`flag` string,
`ts` string,
`ip` string,
`country` string,
`province` string,
`district` string,
`isp` string,
`mac` string,
`model` string,
`modelid` string,
`groupid` string,
`sn` string,
`osver` string,
`osvern` string,
`uiver` string,
`sid` string,
`pn` string,
`ver` string,
`status` string,
`ecode` string,
`emsg` string,
`extvendor` string,
`extbrand` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/appinstall'
TBLPROPERTIES (
'transient_lastDdlTime'='1449630143')
;
CREATE EXTERNAL TABLE `tv_report.appuninstall`(
`sv` string,
`flag` string,
`ts` string,
`ip` string,
`country` string,
`province` string,
`district` string,
`isp` string,
`mac` string,
`model` string,
`modelid` string,
`groupid` string,
`sn` string,
`osver` string,
`osvern` string,
`uiver` string,
`sid` string,
`pn` string,
`ver` string,
`status` string,
`ecode` string,
`emsg` string,
`extvendor` string,
`extbrand` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/appuninstall'
TBLPROPERTIES (
'transient_lastDdlTime'='1449630143')
;
CREATE EXTERNAL TABLE `tv_report.avro_appstartup`(
`sv` string,
`flag` string,
`ts` string,
`ip` string,
`country` string,
`province` string,
`district` string,
`isp` string,
`mac` string,
`model` string,
`modelid` string,
`groupid` string,
`sn` string,
`osver` string,
`osvern` string,
`uiver` string,
`sid` string,
`pn` string,
`ver` string,
`status` string,
`ecode` string,
`emsg` string,
`extvendor` string,
`extbrand` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/avro_appstartup'
TBLPROPERTIES (
'transient_lastDdlTime'='1449630143')
;
CREATE EXTERNAL TABLE `tv_report.avro_bootstrap`(
`sv` string,
`flag` string,
`ts` string,
`ip` string,
`country` string,
`province` string,
`district` string,
`isp` string,
`mac` string,
`model` string,
`modelid` string,
`groupid` string,
`sn` string,
`osver` string,
`osvern` string,
`uiver` string,
`sid` string,
`nt` string,
`hwver` string,
`hwbrand` string,
`hwdevice` string,
`hwhardware` string,
`hwmodel` string,
`hwserial` string,
`hwid` string,
`os` string,
`dls` string,
`dts` string,
`extvendor` string,
`extbrand` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/avro_bootstrap_20151209'
TBLPROPERTIES (
'last_modified_by'='data_quality',
'last_modified_time'='1453275449',
'transient_lastDdlTime'='1453275449')
;
CREATE EXTERNAL TABLE `tv_report.avro_bootstrap_20160120`(
`sv` string,
`flag` string,
`ts` string,
`ip` string,
`country` string,
`province` string,
`district` string,
`isp` string,
`mac` string,
`model` string,
`modelid` string,
`groupid` string,
`sn` string,
`osver` string,
`osvern` string,
`uiver` string,
`sid` string,
`nt` string,
`hwver` string,
`hwbrand` string,
`hwdevice` string,
`hwhardware` string,
`hwmodel` string,
`hwserial` string,
`hwid` string,
`os` string,
`dls` string,
`dts` string,
`extvendor` string,
`extbrand` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/avro_bootstrap'
TBLPROPERTIES (
'last_modified_by'='data_quality',
'last_modified_time'='1453275416',
'transient_lastDdlTime'='1453275416')
;
CREATE EXTERNAL TABLE `tv_report.avro_endplay`(
`sv` string,
`flag` string,
`ts` string,
`ip` string,
`country` string,
`province` string,
`district` string,
`isp` string,
`mac` string,
`model` string,
`modelid` string,
`groupid` string,
`sn` string,
`osver` string,
`osvern` string,
`uiver` string,
`sid` string,
`spid` string,
`type` string,
`dur` string,
`ecode` string,
`emsg` string,
`extvendor` string,
`extbrand` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/avro_endplay'
TBLPROPERTIES (
'transient_lastDdlTime'='1449822200')
;
CREATE EXTERNAL TABLE `tv_report.avro_heartbeat`(
`sv` string,
`flag` string,
`ts` string,
`ip` string,
`country` string,
`province` string,
`district` string,
`isp` string,
`mac` string,
`model` string,
`modelid` string,
`groupid` string,
`sn` string,
`osver` string,
`osvern` string,
`uiver` string,
`sid` string,
`tick` string,
`factor` string,
`bps` string,
`csize` string,
`extvendor` string,
`extbrand` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/avro_heartbeat'
TBLPROPERTIES (
'transient_lastDdlTime'='1449630144')
;
CREATE EXTERNAL TABLE `tv_report.avro_startplay`(
`sv` string,
`flag` string,
`ts` string,
`ip` string,
`country` string,
`province` string,
`district` string,
`isp` string,
`mac` string,
`model` string,
`modelid` string,
`groupid` string,
`sn` string,
`osver` string,
`osvern` string,
`uiver` string,
`sid` string,
`mmsid` string,
`aid` string,
`cid` string,
`offset` string,
`type` string,
`action` string,
`vid` string,
`fspid` string,
`ecode` string,
`emsg` string,
`extvendor` string,
`extbrand` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/avro_startplay'
TBLPROPERTIES (
'transient_lastDdlTime'='1449822201')
;
CREATE EXTERNAL TABLE `tv_report.boot_oversea`(
`ts` string,
`ip` string,
`country` string,
`province` string,
`district` string,
`isp` string,
`mac` string,
`model` string,
`modelid` string,
`groupid` string,
`osver` string,
`osvern` string)
PARTITIONED BY (
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/boot_oversea'
TBLPROPERTIES (
'transient_lastDdlTime'='1450778873')
;
CREATE EXTERNAL TABLE `tv_report.browser_dur`(
`mac` string,
`model` string,
`dur` string,
`bundle` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/browser_dur'
TBLPROPERTIES (
'transient_lastDdlTime'='1450771383')
;
CREATE EXTERNAL TABLE `tv_report.browser_ver`(
`sv` string,
`mac` string,
`ver` string,
`hwbrand` string,
`hwdevice` string,
`hwmodel` string,
`hwhardware` string,
`hwid` string,
`hwserial` string,
`model` string,
`brand` string,
`ro` string,
`nt` string,
`uuid` string,
`ip` string,
`country` string,
`province` string,
`district` string,
`ts` string,
`bundle` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/browser_ver'
TBLPROPERTIES (
'transient_lastDdlTime'='1450770992')
;
CREATE EXTERNAL TABLE `tv_report.browserbaidusrch`(
`ts` string,
`ip` string,
`country` string,
`province` string,
`district` string,
`isp` string,
`sv` string,
`mac` string,
`ver` string,
`hwbrand` string,
`hwdevice` string,
`hwmodel` string,
`hwhardware` string,
`hwid` string,
`hwserial` string,
`model` string,
`brand` string,
`ro` string,
`nt` string,
`uuid` string,
`bundle` string,
`channel` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/browserbaidusrch'
TBLPROPERTIES (
'transient_lastDdlTime'='1449822199')
;
CREATE EXTERNAL TABLE `tv_report.browserbaiduvideosrch`(
`ts` string,
`ip` string,
`country` string,
`province` string,
`district` string,
`isp` string,
`sv` string,
`mac` string,
`ver` string,
`hwbrand` string,
`hwdevice` string,
`hwmodel` string,
`hwhardware` string,
`hwid` string,
`hwserial` string,
`model` string,
`brand` string,
`ro` string,
`nt` string,
`uuid` string,
`bundle` string,
`channel` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/browserbaiduvideosrch'
TBLPROPERTIES (
'transient_lastDdlTime'='1449822199')
;
CREATE EXTERNAL TABLE `tv_report.browserheartbeat`(
`ts` string,
`ip` string,
`country` string,
`province` string,
`district` string,
`isp` string,
`sv` string,
`mac` string,
`ver` string,
`hwbrand` string,
`hwdevice` string,
`hwmodel` string,
`hwhardware` string,
`hwid` string,
`hwserial` string,
`model` string,
`brand` string,
`ro` string,
`nt` string,
`uuid` string,
`dur` string,
`bundle` string,
`channel` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/browserheartbeat'
TBLPROPERTIES (
'transient_lastDdlTime'='1449822199')
;
CREATE EXTERNAL TABLE `tv_report.browserlink`(
`ts` string,
`ip` string,
`country` string,
`province` string,
`district` string,
`isp` string,
`sv` string,
`mac` string,
`ver` string,
`hwbrand` string,
`hwdevice` string,
`hwmodel` string,
`hwhardware` string,
`hwid` string,
`hwserial` string,
`model` string,
`brand` string,
`ro` string,
`nt` string,
`uuid` string,
`url` string,
`bundle` string,
`channel` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/browserlink'
TBLPROPERTIES (
'transient_lastDdlTime'='1449822200')
;
CREATE EXTERNAL TABLE `tv_report.browsernav`(
`ts` string,
`ip` string,
`country` string,
`province` string,
`district` string,
`isp` string,
`sv` string,
`mac` string,
`ver` string,
`hwbrand` string,
`hwdevice` string,
`hwmodel` string,
`hwhardware` string,
`hwid` string,
`hwserial` string,
`model` string,
`brand` string,
`ro` string,
`nt` string,
`uuid` string,
`url` string,
`bundle` string,
`channel` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/browsernav'
TBLPROPERTIES (
'transient_lastDdlTime'='1449822200')
;
CREATE TABLE `tv_report.browsernew`(
`ts` bigint,
`ip` string,
`country` string,
`province` string,
`district` string,
`isp` string,
`sv` string,
`mac` string,
`ver` string,
`hwbrand` string,
`hwdevice` string,
`hwmodel` string,
`hwhardware` string,
`hwid` string,
`hwserial` string,
`model` string,
`brand` string,
`ro` string,
`nt` string,
`uuid` string,
`bundle` string,
`channel` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/browsernew'
TBLPROPERTIES (
'transient_lastDdlTime'='1450771797')
;
CREATE EXTERNAL TABLE `tv_report.browserplayvideo`(
`ts` string,
`ip` string,
`country` string,
`province` string,
`district` string,
`isp` string,
`sv` string,
`mac` string,
`ver` string,
`hwbrand` string,
`hwdevice` string,
`hwmodel` string,
`hwhardware` string,
`hwid` string,
`hwserial` string,
`model` string,
`brand` string,
`ro` string,
`nt` string,
`title` string,
`url` string,
`uuid` string,
`bundle` string,
`channel` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/browserplayvideo'
TBLPROPERTIES (
'transient_lastDdlTime'='1449822200')
;
CREATE EXTERNAL TABLE `tv_report.browserstartup`(
`ts` string,
`ip` string,
`country` string,
`province` string,
`district` string,
`isp` string,
`sv` string,
`mac` string,
`ver` string,
`hwbrand` string,
`hwdevice` string,
`hwmodel` string,
`hwhardware` string,
`hwid` string,
`hwserial` string,
`model` string,
`brand` string,
`ro` string,
`nt` string,
`uuid` string,
`bundle` string,
`channel` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/browserstartup'
TBLPROPERTIES (
'transient_lastDdlTime'='1449822200')
;
CREATE EXTERNAL TABLE `tv_report.cdndispatch`(
`sv` string,
`flag` string,
`ts` string,
`ip` string,
`country` string,
`province` string,
`district` string,
`isp` string,
`mac` string,
`model` string,
`modelid` string,
`groupid` string,
`sn` string,
`osver` string,
`osvern` string,
`uiver` string,
`sid` string,
`respt` string,
`retry` string,
`url` string,
`status` string,
`cdnarea` string,
`cdnec` string,
`nodenum` string,
`ecode` string,
`emsg` string,
`extvendor` string,
`extbrand` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/cdndispatch'
TBLPROPERTIES (
'transient_lastDdlTime'='1449822200')
;
CREATE TABLE `tv_report.devicetrace`(
`mac` string,
`boxgroup` string,
`mode` string,
`country` string,
`province` string,
`district` string,
`isp` string,
`osver` string,
`ts` string,
`ip` string,
`sn` string,
`model` string,
`osvern` string,
`extvendor` string,
`extbrand` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/devicetrace'
TBLPROPERTIES (
'transient_lastDdlTime'='1451458125')
;
CREATE EXTERNAL TABLE `tv_report.errlog`(
`log` string,
`err` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/errlog'
TBLPROPERTIES (
'transient_lastDdlTime'='1449630146')
;
CREATE EXTERNAL TABLE `tv_report.geraction`(
`ts` string,
`ip` string,
`country` string,
`province` string,
`district` string,
`isp` string,
`sv` string,
`mac` string,
`udid` string,
`pn` string,
`ver` string,
`vern` string,
`os` string,
`osver` string,
`hwbrand` string,
`hwdevice` string,
`hwmodel` string,
`hwhardware` string,
`hwid` string,
`hwserial` string,
`model` string,
`brand` string,
`ro` string,
`nt` string,
`uuid` string,
`bundle` string,
`action` string,
`props` map<string,string>,
`ecode` string,
`emsg` string,
`appkey` string,
`channel` string)
PARTITIONED BY (
`dt` string,
`pt1` string,
`pt2` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/geraction'
TBLPROPERTIES (
'transient_lastDdlTime'='1450772073')
;
CREATE EXTERNAL TABLE `tv_report.gerdur`(
`mac` string,
`model` string,
`appkey` string,
`dur` string,
`bundle` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/gerdur'
TBLPROPERTIES (
'transient_lastDdlTime'='1450772162')
;
CREATE EXTERNAL TABLE `tv_report.gerheartbeat`(
`ts` string COMMENT 'from deserializer',
`ip` string COMMENT 'from deserializer',
`country` string COMMENT 'from deserializer',
`province` string COMMENT 'from deserializer',
`district` string COMMENT 'from deserializer',
`isp` string COMMENT 'from deserializer',
`sv` string COMMENT 'from deserializer',
`mac` string COMMENT 'from deserializer',
`udid` string COMMENT 'from deserializer',
`pn` string COMMENT 'from deserializer',
`ver` string COMMENT 'from deserializer',
`vern` string COMMENT 'from deserializer',
`os` string COMMENT 'from deserializer',
`osver` string COMMENT 'from deserializer',
`hwbrand` string COMMENT 'from deserializer',
`hwdevice` string COMMENT 'from deserializer',
`hwmodel` string COMMENT 'from deserializer',
`hwhardware` string COMMENT 'from deserializer',
`hwid` string COMMENT 'from deserializer',
`hwserial` string COMMENT 'from deserializer',
`model` string COMMENT 'from deserializer',
`brand` string COMMENT 'from deserializer',
`ro` string COMMENT 'from deserializer',
`nt` string COMMENT 'from deserializer',
`uuid` string COMMENT 'from deserializer',
`dur` string COMMENT 'from deserializer',
`bundle` string COMMENT 'from deserializer',
`appkey` string COMMENT 'from deserializer',
`channel` string COMMENT 'from deserializer')
PARTITIONED BY (
`area` string,
`dt` string,
`pt1` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.LazyBinaryColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/gerheartbeat'
TBLPROPERTIES (
'transient_lastDdlTime'='1450667362')
;
CREATE EXTERNAL TABLE `tv_report.gernew`(
`sv` string,
`mac` string,
`udid` string,
`pn` string,
`ver` string,
`vern` string,
`os` string,
`osver` string,
`hwbrand` string,
`hwdevice` string,
`hwmodel` string,
`hwhardware` string,
`hwid` string,
`hwserial` string,
`model` string,
`brand` string,
`ro` string,
`nt` string,
`uuid` string,
`bundle` string,
`appkey` string,
`channel` string,
`ip` string,
`country` string,
`province` string,
`district` string,
`ts` bigint)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/gernew'
TBLPROPERTIES (
'transient_lastDdlTime'='1450772438')
;
CREATE EXTERNAL TABLE `tv_report.gerstartup`(
`ts` string,
`ip` string,
`country` string,
`province` string,
`district` string,
`isp` string,
`sv` string,
`mac` string,
`udid` string,
`pn` string,
`ver` string,
`vern` string,
`os` string,
`osver` string,
`hwbrand` string,
`hwdevice` string,
`hwmodel` string,
`hwhardware` string,
`hwid` string,
`hwserial` string,
`model` string,
`brand` string,
`ro` string,
`nt` string,
`uuid` string,
`bundle` string,
`appkey` string,
`channel` string)
PARTITIONED BY (
`area` string,
`dt` string,
`pt1` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/gerstartup'
TBLPROPERTIES (
'transient_lastDdlTime'='1450667345')
;
CREATE EXTERNAL TABLE `tv_report.iptv_box`(
`id` bigint,
`mac` string,
`sn` string,
`mode` string,
`boxgroup` string,
`deliverydate` string,
`createtime` string,
`modename` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\t'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/iptv_box'
TBLPROPERTIES (
'COLUMN_STATS_ACCURATE'='false',
'numFiles'='5',
'numRows'='-1',
'rawDataSize'='-1',
'totalSize'='506365977',
'transient_lastDdlTime'='1452159161')
;
CREATE EXTERNAL TABLE `tv_report.iptv_group`(
`boxgroupid` bigint,
`name` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\u0001'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/iptv_group'
TBLPROPERTIES (
'COLUMN_STATS_ACCURATE'='false',
'numFiles'='1',
'numRows'='-1',
'rawDataSize'='-1',
'totalSize'='24277',
'transient_lastDdlTime'='1451471409')
;
CREATE EXTERNAL TABLE `tv_report.iptv_mode`(
`boxmodeid` bigint,
`mode` string,
`displaymode` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\u0001'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/iptv_mode'
TBLPROPERTIES (
'COLUMN_STATS_ACCURATE'='false',
'numFiles'='1',
'numRows'='-1',
'rawDataSize'='-1',
'totalSize'='1134',
'transient_lastDdlTime'='1451471401')
;
CREATE EXTERNAL TABLE `tv_report.iptv_upgrade`(
`id` bigint,
`mac` string,
`sn` string,
`mode` string,
`boxgroup` string,
`deliverydate` string,
`createtime` string,
`modename` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\u0001'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/iptv_upgrade'
TBLPROPERTIES (
'COLUMN_STATS_ACCURATE'='false',
'numFiles'='2',
'numRows'='-1',
'rawDataSize'='-1',
'totalSize'='48461',
'transient_lastDdlTime'='1451471431')
;
CREATE EXTERNAL TABLE `tv_report.letv_play_dur`(
`mode` string,
`boxgroup` string,
`osver` string,
`mac` string,
`ch` string,
`uuid` string,
`dur` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/letv_play_dur'
TBLPROPERTIES (
'transient_lastDdlTime'='1450776540')
;
CREATE EXTERNAL TABLE `tv_report.letvblock`(
`sv` string,
`flag` string,
`ts` string,
`ip` string,
`country` string,
`province` string,
`district` string,
`isp` string,
`mac` string,
`model` string,
`modelid` string,
`groupid` string,
`sn` string,
`osver` string,
`osvern` string,
`uiver` string,
`uid` string,
`sid` string,
`appver` string,
`ver` string,
`p1` string,
`p2` string,
`p3` string,
`ac` string,
`err` string,
`pt` string,
`ut` string,
`lc` string,
`auid` string,
`uuid` string,
`cid` string,
`pid` string,
`vid` string,
`vlen` string,
`ch` string,
`ry` string,
`ty` string,
`vt` string,
`url` string,
`ref` string,
`pv` string,
`py` string,
`st` string,
`ilu` string,
`pcode` string,
`weid` string,
`r` string,
`extvendor` string,
`extbrand` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/letvblock'
TBLPROPERTIES (
'transient_lastDdlTime'='1449630144')
;
CREATE EXTERNAL TABLE `tv_report.letvchswitch`(
`ts` string,
`ip` string,
`country` string,
`province` string,
`district` string,
`isp` string,
`sv` string,
`flag` string,
`mac` string,
`model` string,
`modelid` string,
`groupid` string,
`sn` string,
`osver` string,
`osvern` string,
`uiver` string,
`uid` string,
`sid` string,
`appver` string,
`srcch` string,
`switchway` string,
`ver` string,
`p1` string,
`p2` string,
`p3` string,
`acode` string,
`ap` string,
`ar` string,
`cid` string,
`pid` string,
`vid` string,
`uuid` string,
`lc` string,
`cururl` string,
`ch` string,
`pcode` string,
`auid` string,
`ilu` string,
`r` string,
`extvendor` string,
`extbrand` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/letvchswitch'
TBLPROPERTIES (
'transient_lastDdlTime'='1449630144')
;
CREATE EXTERNAL TABLE `tv_report.letvend`(
`sv` string,
`flag` string,
`ts` string,
`ip` string,
`country` string,
`province` string,
`district` string,
`isp` string,
`mac` string,
`model` string,
`modelid` string,
`groupid` string,
`sn` string,
`osver` string,
`osvern` string,
`uiver` string,
`uid` string,
`sid` string,
`appver` string,
`ver` string,
`p1` string,
`p2` string,
`p3` string,
`ac` string,
`err` string,
`pt` string,
`ut` string,
`lc` string,
`auid` string,
`uuid` string,
`cid` string,
`pid` string,
`vid` string,
`vlen` string,
`ch` string,
`ry` string,
`ty` string,
`vt` string,
`url` string,
`ref` string,
`pv` string,
`py` string,
`st` string,
`ilu` string,
`pcode` string,
`weid` string,
`r` string,
`extvendor` string,
`extbrand` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/letvend'
TBLPROPERTIES (
'transient_lastDdlTime'='1449630144')
;
CREATE EXTERNAL TABLE `tv_report.letvenv`(
`sv` string,
`flag` string,
`ts` string,
`ip` string,
`country` string,
`province` string,
`district` string,
`isp` string,
`mac` string,
`model` string,
`modelid` string,
`groupid` string,
`sn` string,
`osver` string,
`osvern` string,
`uiver` string,
`sid` string,
`p1` string,
`p2` string,
`p3` string,
`lc` string,
`uuid` string,
`nt` string,
`os` string,
`osv` string,
`app` string,
`bd` string,
`xh` string,
`ro` string,
`br` string,
`r` string,
`extvendor` string,
`extbrand` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/letvenv'
TBLPROPERTIES (
'transient_lastDdlTime'='1449630144')
;
CREATE EXTERNAL TABLE `tv_report.letvinit`(
`sv` string,
`flag` string,
`ts` string,
`ip` string,
`country` string,
`province` string,
`district` string,
`isp` string,
`mac` string,
`model` string,
`modelid` string,
`groupid` string,
`sn` string,
`osver` string,
`osvern` string,
`uiver` string,
`uid` string,
`sid` string,
`appver` string,
`ver` string,
`p1` string,
`p2` string,
`p3` string,
`ac` string,
`err` string,
`pt` string,
`ut` string,
`lc` string,
`auid` string,
`uuid` string,
`cid` string,
`pid` string,
`vid` string,
`vlen` string,
`ch` string,
`ry` string,
`ty` string,
`vt` string,
`url` string,
`ref` string,
`pv` string,
`py` string,
`st` string,
`ilu` string,
`pcode` string,
`weid` string,
`r` string,
`extvendor` string,
`extbrand` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/letvinit'
TBLPROPERTIES (
'transient_lastDdlTime'='1449630144')
;
CREATE EXTERNAL TABLE `tv_report.letvplay`(
`sv` string,
`flag` string,
`ts` string,
`ip` string,
`country` string,
`province` string,
`district` string,
`isp` string,
`mac` string,
`model` string,
`modelid` string,
`groupid` string,
`sn` string,
`osver` string,
`osvern` string,
`uiver` string,
`uid` string,
`sid` string,
`appver` string,
`ver` string,
`p1` string,
`p2` string,
`p3` string,
`ac` string,
`err` string,
`pt` string,
`ut` string,
`lc` string,
`auid` string,
`uuid` string,
`cid` string,
`pid` string,
`vid` string,
`vlen` string,
`ch` string,
`ry` string,
`ty` string,
`vt` string,
`url` string,
`ref` string,
`pv` string,
`py` string,
`st` string,
`ilu` string,
`pcode` string,
`weid` string,
`r` string,
`extvendor` string,
`extbrand` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/letvplay'
TBLPROPERTIES (
'transient_lastDdlTime'='1449630144')
;
CREATE EXTERNAL TABLE `tv_report.letvplistshow`(
`sv` string,
`flag` string,
`ts` string,
`ip` string,
`country` string,
`province` string,
`district` string,
`isp` string,
`mac` string,
`model` string,
`modelid` string,
`groupid` string,
`sn` string,
`osver` string,
`osvern` string,
`uiver` string,
`uid` string,
`sid` string,
`appver` string,
`ver` string,
`p1` string,
`p2` string,
`p3` string,
`acode` string,
`ap` string,
`ar` string,
`cid` string,
`pid` string,
`vid` string,
`uuid` string,
`lc` string,
`cururl` string,
`ch` string,
`pcode` string,
`auid` string,
`ilu` string,
`r` string,
`extvendor` string,
`extbrand` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/letvplistshow'
TBLPROPERTIES (
'transient_lastDdlTime'='1449630145')
;
CREATE EXTERNAL TABLE `tv_report.letvtime`(
`sv` string,
`flag` string,
`ts` string,
`ip` string,
`country` string,
`province` string,
`district` string,
`isp` string,
`mac` string,
`model` string,
`modelid` string,
`groupid` string,
`sn` string,
`osver` string,
`osvern` string,
`uiver` string,
`uid` string,
`sid` string,
`appver` string,
`ver` string,
`p1` string,
`p2` string,
`p3` string,
`ac` string,
`err` string,
`pt` string,
`ut` string,
`lc` string,
`auid` string,
`uuid` string,
`cid` string,
`pid` string,
`vid` string,
`vlen` string,
`ch` string,
`ry` string,
`ty` string,
`vt` string,
`url` string,
`ref` string,
`pv` string,
`py` string,
`st` string,
`ilu` string,
`pcode` string,
`weid` string,
`r` string,
`extvendor` string,
`extbrand` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/letvtime'
TBLPROPERTIES (
'transient_lastDdlTime'='1449630145')
;
CREATE EXTERNAL TABLE `tv_report.mobileappboot`(
`sv` string,
`mobile` string,
`type` string,
`os` string,
`osver` string,
`aver` string,
`sid` string,
`mac` string,
`udid` string,
`ip` string,
`country` string,
`province` string,
`district` string,
`isp` string,
`ts` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/mobileappboot'
TBLPROPERTIES (
'transient_lastDdlTime'='1449822200')
;
CREATE EXTERNAL TABLE `tv_report.mobileappinstall`(
`sv` string,
`mobile` string,
`type` string,
`os` string,
`osver` string,
`aver` string,
`udid` string,
`mac` string,
`ip` string,
`country` string,
`province` string,
`district` string,
`isp` string,
`ts` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/mobileappinstall'
TBLPROPERTIES (
'transient_lastDdlTime'='1449822200')
;
CREATE EXTERNAL TABLE `tv_report.ott_box`(
`id` bigint,
`mac` string,
`type` string,
`boxgroup` string,
`oprid` string,
`time` bigint,
`smart` int)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\u0001'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/ott_box'
TBLPROPERTIES (
'COLUMN_STATS_ACCURATE'='false',
'numFiles'='1',
'numRows'='-1',
'rawDataSize'='-1',
'totalSize'='10842610',
'transient_lastDdlTime'='1451471813')
;
CREATE EXTERNAL TABLE `tv_report.oversea_tv_ad`(
`ip` string,
`time` string,
`cookie` string,
`inu` string,
`country` string,
`area` string,
`province` string,
`city` string,
`ver` string COMMENT 'The version of the log',
`act` string,
`p1` string,
`p2` string,
`p3` string,
`uuid` string,
`err` string,
`atype` string COMMENT 'The ad type, such as : pre-ad, pause-ad...',
`id` string,
`ct` string,
`ut` string COMMENT 'The durational time from requesting to ac.',
`dur_total` string,
`dur` string,
`ch` string,
`cid` string,
`mmsid` string,
`ref` string,
`vlen` string,
`py` string COMMENT 'Extended field, which means the play attribute.',
`pid` string,
`sys` string,
`vid` string,
`ftype` string,
`aps` string,
`loc` string,
`ord` string,
`ry` string COMMENT 'The retry counts of the last report log, regardless of whether it is successful',
`oiid` string,
`v` string COMMENT 'The download speed.',
`size` string,
`ontime` string,
`uid` string,
`vuser` string COMMENT 'This field has not used currently.',
`ty` string COMMENT 'The type of video play, such as : live, demand...',
`cur_url` string,
`lc` string,
`pv` string COMMENT 'The version of the player.',
`ia` string,
`pcode` string,
`error` string,
`fake` string,
`status` string,
`tdur` string)
PARTITIONED BY (
`sale_area` string,
`dt` string,
`hour` string,
`product` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/oversea_tv_ad'
TBLPROPERTIES (
'transient_lastDdlTime'='1452840628')
;
CREATE EXTERNAL TABLE `tv_report.oversea_tv_env`(
`ip` string,
`time` string,
`cookie` string,
`inu` string,
`country` string,
`area` string,
`province` string,
`city` string,
`p1` string,
`p2` string,
`p3` string,
`letv_cookie` string,
`uuid` string,
`mac` string,
`nettype` string,
`os` string,
`os_version` string,
`app` string,
`brand` string,
`terminal_id` string,
`resolution` string,
`browser` string,
`src` string,
`schoolname` string,
`property` string,
`zid` string,
`error` string,
`fake` string,
`ch` string,
`cs` string,
`ssid` string,
`lo` string,
`la` string,
`auid` string,
`apprunid` string)
PARTITIONED BY (
`sale_area` string,
`dt` string,
`hour` string,
`product` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/oversea_tv_env'
TBLPROPERTIES (
'transient_lastDdlTime'='1447350523')
;
CREATE EXTERNAL TABLE `tv_report.oversea_tv_env_20150422`(
`ip` string,
`time` string,
`cookie` string,
`inu` string,
`country` string,
`area` string,
`province` string,
`city` string,
`p1` string,
`p2` string,
`p3` string,
`letv_cookie` string,
`uuid` string,
`mac` string,
`nettype` string,
`os` string,
`os_version` string,
`app` string,
`brand` string,
`terminal_id` string,
`resolution` string,
`browser` string,
`src` string,
`schoolname` string,
`property` string,
`zid` string,
`error` string,
`fake` string,
`ch` string,
`cs` string,
`ssid` string,
`lo` string,
`la` string,
`auid` string,
`apprunid` string)
PARTITIONED BY (
`dt` string,
`hour` string,
`product` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/oversea_tv_env_20150422'
TBLPROPERTIES (
'last_modified_by'='zhangjiachao',
'last_modified_time'='1437658286',
'transient_lastDdlTime'='1437658286')
;
CREATE EXTERNAL TABLE `tv_report.oversea_tv_env_20151112`(
`ip` string,
`time` string,
`cookie` string,
`inu` string,
`country` string,
`district` string,
`province` string,
`city` string,
`p1` string,
`p2` string,
`p3` string,
`letv_cookie` string,
`uuid` string,
`mac` string,
`nettype` string,
`os` string,
`os_version` string,
`app` string,
`brand` string,
`terminal_id` string,
`resolution` string,
`browser` string,
`src` string,
`schoolname` string,
`property` string,
`zid` string,
`error` string,
`fake` string,
`ch` string,
`cs` string,
`ssid` string,
`lo` string,
`la` string,
`auid` string,
`apprunid` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/oversea_tv_env'
TBLPROPERTIES (
'last_modified_by'='data_quality',
'last_modified_time'='1447350505',
'transient_lastDdlTime'='1447350505')
;
CREATE EXTERNAL TABLE `tv_report.oversea_tv_env_20160108`(
`ip` string,
`time` string,
`cookie` string,
`inu` string,
`country` string,
`area` string,
`province` string,
`city` string,
`p1` string,
`p2` string,
`p3` string,
`letv_cookie` string,
`uuid` string,
`mac` string,
`nettype` string,
`os` string,
`os_version` string,
`app` string,
`brand` string,
`terminal_id` string,
`resolution` string,
`browser` string,
`src` string,
`schoolname` string,
`property` string,
`zid` string,
`error` string,
`fake` string,
`ch` string,
`cs` string,
`ssid` string,
`lo` string,
`la` string,
`auid` string,
`apprunid` string)
PARTITIONED BY (
`sale_area` string,
`dt` string,
`hour` string,
`product` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/oversea_tv_env_20160108'
TBLPROPERTIES (
'transient_lastDdlTime'='1452494836')
;
CREATE EXTERNAL TABLE `tv_report.oversea_tv_er`(
`ip` string,
`time` string,
`cookie` string,
`inu` string,
`country` string,
`area` string,
`province` string,
`city` string,
`log_version` string,
`p1` string,
`p2` string,
`p3` string,
`err` string,
`letv_cookie` string,
`auid` string,
`mac` string,
`nettype` string,
`os` string,
`os_version` string,
`app` string,
`brand` string,
`terminaltype` string,
`model` string,
`resolution` string,
`browser` string,
`src` string,
`property` string,
`cid` string,
`pid` string,
`vid` string,
`zid` string,
`error` string,
`fake` string,
`uuid` string)
PARTITIONED BY (
`sale_area` string,
`dt` string,
`hour` string,
`product` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/oversea_tv_er'
TBLPROPERTIES (
'transient_lastDdlTime'='1452840685')
;
CREATE EXTERNAL TABLE `tv_report.oversea_tv_hkanyplex`(
`vid` string,
`vidname` string)
PARTITIONED BY (
`bi` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/oversea_tv_hkanyplex'
TBLPROPERTIES (
'transient_lastDdlTime'='1451380677')
;
CREATE EXTERNAL TABLE `tv_report.oversea_tv_login`(
`ip` string,
`time` string,
`cookie` string,
`inu` string,
`country` string,
`area` string,
`province` string,
`city` string,
`log_version` string,
`p1` string,
`p2` string,
`p3` string,
`uid` string,
`letv_cookie` string,
`deviceid` string,
`uuid` string,
`login_property` string,
`ch` string,
`ref` string,
`login_time` string,
`pcode` string,
`status` string,
`schoolname` string,
`zid` string,
`error` string,
`fake` string,
`apprunid` string)
PARTITIONED BY (
`sale_area` string,
`dt` string,
`hour` string,
`product` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/oversea_tv_login'
TBLPROPERTIES (
'transient_lastDdlTime'='1447350604')
;
CREATE EXTERNAL TABLE `tv_report.oversea_tv_login_20150422`(
`ip` string,
`time` string,
`cookie` string,
`inu` string,
`country` string,
`area` string,
`province` string,
`city` string,
`log_version` string,
`p1` string,
`p2` string,
`p3` string,
`uid` string,
`letv_cookie` string,
`deviceid` string,
`uuid` string,
`login_property` string,
`ch` string,
`ref` string,
`login_time` string,
`pcode` string,
`status` string,
`schoolname` string,
`zid` string,
`error` string,
`fake` string,
`apprunid` string)
PARTITIONED BY (
`dt` string,
`hour` string,
`product` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/oversea_tv_login_20150422'
TBLPROPERTIES (
'last_modified_by'='zhangjiachao',
'last_modified_time'='1437659183',
'transient_lastDdlTime'='1437659183')
;
CREATE EXTERNAL TABLE `tv_report.oversea_tv_login_20151112`(
`ip` string,
`time` string,
`cookie` string,
`inu` string,
`country` string,
`district` string,
`province` string,
`city` string,
`log_version` string,
`p1` string,
`p2` string,
`p3` string,
`uid` string,
`letv_cookie` string,
`deviceid` string,
`uuid` string,
`login_property` string,
`ch` string,
`ref` string,
`login_time` string,
`pcode` string,
`status` string,
`schoolname` string,
`zid` string,
`error` string,
`fake` string,
`apprunid` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/oversea_tv_login'
TBLPROPERTIES (
'last_modified_by'='data_quality',
'last_modified_time'='1447350580',
'transient_lastDdlTime'='1447350580')
;
CREATE EXTERNAL TABLE `tv_report.oversea_tv_login_20160108`(
`ip` string,
`time` string,
`cookie` string,
`inu` string,
`country` string,
`area` string,
`province` string,
`city` string,
`log_version` string,
`p1` string,
`p2` string,
`p3` string,
`uid` string,
`letv_cookie` string,
`deviceid` string,
`uuid` string,
`login_property` string,
`ch` string,
`ref` string,
`login_time` string,
`pcode` string,
`status` string,
`schoolname` string,
`zid` string,
`error` string,
`fake` string,
`apprunid` string)
PARTITIONED BY (
`sale_area` string,
`dt` string,
`hour` string,
`product` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/oversea_tv_login_20160108'
TBLPROPERTIES (
'transient_lastDdlTime'='1452494836')
;
CREATE EXTERNAL TABLE `tv_report.oversea_tv_new`(
`mac` string,
`model` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/oversea_tv_new'
TBLPROPERTIES (
'transient_lastDdlTime'='1450777133')
;
CREATE EXTERNAL TABLE `tv_report.oversea_tv_op`(
`ip` string,
`time` string,
`cookie` string,
`inu` string,
`country` string,
`area` string,
`province` string,
`city` string,
`log_version` string,
`p1` string,
`p2` string,
`p3` string,
`act_code` string,
`act_property` string,
`act_result` string,
`cid` string,
`pid` string,
`vid` string,
`uid` string,
`uuid` string,
`letv_cookie` string,
`cur_url` string,
`ch` string,
`pcode` string,
`deviceid` string,
`ilu` string,
`schoolname` string,
`reid` string,
`rearea` string,
`rebucket` string,
`rank` string,
`targeturl` string,
`zid` string,
`liveid` string,
`error` string,
`fake` string,
`nt` string,
`tick` string,
`pn` string,
`vc` string,
`at` string,
`apprunid` string)
PARTITIONED BY (
`sale_area` string,
`dt` string,
`hour` string,
`product` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/oversea_tv_op'
TBLPROPERTIES (
'transient_lastDdlTime'='1447350652')
;
CREATE EXTERNAL TABLE `tv_report.oversea_tv_op_20150422`(
`ip` string,
`time` string,
`cookie` string,
`inu` string,
`country` string,
`area` string,
`province` string,
`city` string,
`log_version` string,
`p1` string,
`p2` string,
`p3` string,
`act_code` string,
`act_property` string,
`act_result` string,
`cid` string,
`pid` string,
`vid` string,
`uid` string,
`uuid` string,
`letv_cookie` string,
`cur_url` string,
`ch` string,
`pcode` string,
`deviceid` string,
`ilu` string,
`schoolname` string,
`reid` string,
`rearea` string,
`rebucket` string,
`rank` string,
`targeturl` string,
`zid` string,
`liveid` string,
`error` string,
`fake` string,
`nt` string,
`tick` string,
`pn` string,
`vc` string,
`at` string,
`apprunid` string)
PARTITIONED BY (
`dt` string,
`hour` string,
`product` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/oversea_tv_op_20150422'
TBLPROPERTIES (
'last_modified_by'='zhangjiachao',
'last_modified_time'='1437659572',
'transient_lastDdlTime'='1437659572')
;
CREATE EXTERNAL TABLE `tv_report.oversea_tv_op_20151112`(
`ip` string,
`time` string,
`cookie` string,
`inu` string,
`country` string,
`district` string,
`province` string,
`city` string,
`log_version` string,
`p1` string,
`p2` string,
`p3` string,
`act_code` string,
`act_property` string,
`act_result` string,
`cid` string,
`pid` string,
`vid` string,
`uid` string,
`uuid` string,
`letv_cookie` string,
`cur_url` string,
`ch` string,
`pcode` string,
`deviceid` string,
`ilu` string,
`schoolname` string,
`reid` string,
`rearea` string,
`rebucket` string,
`rank` string,
`targeturl` string,
`zid` string,
`liveid` string,
`error` string,
`fake` string,
`nt` string,
`tick` string,
`pn` string,
`vc` string,
`at` string,
`apprunid` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/oversea_tv_op'
TBLPROPERTIES (
'last_modified_by'='data_quality',
'last_modified_time'='1447350638',
'transient_lastDdlTime'='1447350638')
;
CREATE EXTERNAL TABLE `tv_report.oversea_tv_op_20160108`(
`ip` string,
`time` string,
`cookie` string,
`inu` string,
`country` string,
`area` string,
`province` string,
`city` string,
`log_version` string,
`p1` string,
`p2` string,
`p3` string,
`act_code` string,
`act_property` string,
`act_result` string,
`cid` string,
`pid` string,
`vid` string,
`uid` string,
`uuid` string,
`letv_cookie` string,
`cur_url` string,
`ch` string,
`pcode` string,
`deviceid` string,
`ilu` string,
`schoolname` string,
`reid` string,
`rearea` string,
`rebucket` string,
`rank` string,
`targeturl` string,
`zid` string,
`liveid` string,
`error` string,
`fake` string,
`nt` string,
`tick` string,
`pn` string,
`vc` string,
`at` string,
`apprunid` string)
PARTITIONED BY (
`sale_area` string,
`dt` string,
`hour` string,
`product` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/oversea_tv_op_20160108'
TBLPROPERTIES (
'transient_lastDdlTime'='1452494837')
;
CREATE EXTERNAL TABLE `tv_report.oversea_tv_play`(
`ip` string,
`time` string,
`cookie` string,
`inu` string,
`country` string,
`area` string,
`province` string,
`city` string,
`log_version` string,
`p1` string,
`p2` string,
`p3` string,
`act` string,
`error` string,
`pt` string,
`utime` string,
`uid` string,
`letv_cookie` string,
`deviceid` string,
`uuid` string,
`cid` string,
`pid` string,
`vid` string,
`vlen` string,
`ch` string,
`retry` string,
`playtype` string,
`videotype` string,
`url` string,
`ref` string,
`player_version` string,
`property` string,
`station` string,
`ilu` string,
`pcode` string,
`weid` string,
`ap` string,
`schoolname` string,
`prg` string,
`zid` string,
`liveid` string,
`err_msg` string,
`fake` string,
`cdnip` string,
`provider` string,
`nt` string,
`utype` string,
`r` string,
`stc` string,
`sid` string,
`prl` string,
`cdev` string,
`caid` string,
`ctime` string,
`pay` string,
`joint` string,
`ipt` string,
`custid` string,
`apprunid` string)
PARTITIONED BY (
`sale_area` string,
`dt` string,
`hour` string,
`product` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/oversea_tv_play'
TBLPROPERTIES (
'transient_lastDdlTime'='1447350701')
;
CREATE EXTERNAL TABLE `tv_report.oversea_tv_play_20150422`(
`ip` string,
`time` string,
`cookie` string,
`inu` string,
`country` string,
`area` string,
`province` string,
`city` string,
`log_version` string,
`p1` string,
`p2` string,
`p3` string,
`act` string,
`error` string,
`pt` string,
`utime` string,
`uid` string,
`letv_cookie` string,
`deviceid` string,
`uuid` string,
`cid` string,
`pid` string,
`vid` string,
`vlen` string,
`ch` string,
`retry` string,
`playtype` string,
`videotype` string,
`url` string,
`ref` string,
`player_version` string,
`property` string,
`station` string,
`ilu` string,
`pcode` string,
`weid` string,
`ap` string,
`schoolname` string,
`prg` string,
`zid` string,
`liveid` string,
`err_msg` string,
`fake` string,
`cdnip` string,
`provider` string,
`nt` string,
`utype` string,
`r` string,
`stc` string,
`sid` string,
`prl` string,
`cdev` string,
`caid` string,
`ctime` string,
`pay` string,
`joint` string,
`ipt` string,
`custid` string,
`apprunid` string)
PARTITIONED BY (
`dt` string,
`hour` string,
`product` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/oversea_tv_play_20150422'
TBLPROPERTIES (
'last_modified_by'='zhangjiachao',
'last_modified_time'='1437660572',
'transient_lastDdlTime'='1437660572')
;
CREATE EXTERNAL TABLE `tv_report.oversea_tv_play_20151112`(
`ip` string,
`time` string,
`cookie` string,
`inu` string,
`country` string,
`district` string,
`province` string,
`city` string,
`log_version` string,
`p1` string,
`p2` string,
`p3` string,
`act` string,
`error` string,
`pt` string,
`utime` string,
`uid` string,
`letv_cookie` string,
`deviceid` string,
`uuid` string,
`cid` string,
`pid` string,
`vid` string,
`vlen` string,
`ch` string,
`retry` string,
`playtype` string,
`videotype` string,
`url` string,
`ref` string,
`player_version` string,
`property` string,
`station` string,
`ilu` string,
`pcode` string,
`weid` string,
`ap` string,
`schoolname` string,
`prg` string,
`zid` string,
`liveid` string,
`err_msg` string,
`fake` string,
`cdnip` string,
`provider` string,
`nt` string,
`utype` string,
`r` string,
`stc` string,
`sid` string,
`prl` string,
`cdev` string,
`caid` string,
`ctime` string,
`pay` string,
`joint` string,
`ipt` string,
`custid` string,
`apprunid` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/oversea_tv_play'
TBLPROPERTIES (
'last_modified_by'='data_quality',
'last_modified_time'='1447350685',
'transient_lastDdlTime'='1447350685')
;
CREATE EXTERNAL TABLE `tv_report.oversea_tv_play_20160108`(
`ip` string,
`time` string,
`cookie` string,
`inu` string,
`country` string,
`area` string,
`province` string,
`city` string,
`log_version` string,
`p1` string,
`p2` string,
`p3` string,
`act` string,
`error` string,
`pt` string,
`utime` string,
`uid` string,
`letv_cookie` string,
`deviceid` string,
`uuid` string,
`cid` string,
`pid` string,
`vid` string,
`vlen` string,
`ch` string,
`retry` string,
`playtype` string,
`videotype` string,
`url` string,
`ref` string,
`player_version` string,
`property` string,
`station` string,
`ilu` string,
`pcode` string,
`weid` string,
`ap` string,
`schoolname` string,
`prg` string,
`zid` string,
`liveid` string,
`err_msg` string,
`fake` string,
`cdnip` string,
`provider` string,
`nt` string,
`utype` string,
`r` string,
`stc` string,
`sid` string,
`prl` string,
`cdev` string,
`caid` string,
`ctime` string,
`pay` string,
`joint` string,
`ipt` string,
`custid` string,
`apprunid` string)
PARTITIONED BY (
`sale_area` string,
`dt` string,
`hour` string,
`product` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/oversea_tv_play_20160108'
TBLPROPERTIES (
'transient_lastDdlTime'='1452494837')
;
CREATE EXTERNAL TABLE `tv_report.oversea_tv_pv`(
`ip` string,
`time` string,
`cookie` string,
`inu` string,
`country` string,
`area` string,
`province` string,
`city` string,
`log_version` string,
`p1` string,
`p2` string,
`p3` string,
`cid` string,
`pid` string,
`vid` string,
`uid` string,
`uuid` string,
`letv_cookie` string,
`ref` string,
`ct` string,
`rcid` string,
`kw` string,
`cur_url` string,
`ch` string,
`click_area` string,
`pcode` string,
`deviceid` string,
`ilu` string,
`weid` string,
`schoolname` string,
`property` string,
`zid` string,
`error` string,
`fake` string,
`apprunid` string)
PARTITIONED BY (
`sale_area` string,
`dt` string,
`hour` string,
`product` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/oversea_tv_pv'
TBLPROPERTIES (
'transient_lastDdlTime'='1447350763')
;
CREATE EXTERNAL TABLE `tv_report.oversea_tv_pv_20150422`(
`ip` string,
`time` string,
`cookie` string,
`inu` string,
`country` string,
`area` string,
`province` string,
`city` string,
`log_version` string,
`p1` string,
`p2` string,
`p3` string,
`cid` string,
`pid` string,
`vid` string,
`uid` string,
`uuid` string,
`letv_cookie` string,
`ref` string,
`ct` string,
`rcid` string,
`kw` string,
`cur_url` string,
`ch` string,
`click_area` string,
`pcode` string,
`deviceid` string,
`ilu` string,
`weid` string,
`schoolname` string,
`property` string,
`zid` string,
`error` string,
`fake` string,
`apprunid` string)
PARTITIONED BY (
`dt` string,
`hour` string,
`product` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/oversea_tv_pv_20150422'
TBLPROPERTIES (
'last_modified_by'='data_quality',
'last_modified_time'='1437723367',
'transient_lastDdlTime'='1437723367')
;
CREATE EXTERNAL TABLE `tv_report.oversea_tv_pv_20151112`(
`ip` string,
`time` string,
`cookie` string,
`inu` string,
`country` string,
`district` string,
`province` string,
`city` string,
`log_version` string,
`p1` string,
`p2` string,
`p3` string,
`cid` string,
`pid` string,
`vid` string,
`uid` string,
`uuid` string,
`letv_cookie` string,
`ref` string,
`ct` string,
`rcid` string,
`kw` string,
`cur_url` string,
`ch` string,
`click_area` string,
`pcode` string,
`deviceid` string,
`ilu` string,
`weid` string,
`schoolname` string,
`property` string,
`zid` string,
`error` string,
`fake` string,
`apprunid` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/oversea_tv_pv'
TBLPROPERTIES (
'last_modified_by'='data_quality',
'last_modified_time'='1447350749',
'transient_lastDdlTime'='1447350749')
;
CREATE EXTERNAL TABLE `tv_report.oversea_tv_pv_20160108`(
`ip` string,
`time` string,
`cookie` string,
`inu` string,
`country` string,
`area` string,
`province` string,
`city` string,
`log_version` string,
`p1` string,
`p2` string,
`p3` string,
`cid` string,
`pid` string,
`vid` string,
`uid` string,
`uuid` string,
`letv_cookie` string,
`ref` string,
`ct` string,
`rcid` string,
`kw` string,
`cur_url` string,
`ch` string,
`click_area` string,
`pcode` string,
`deviceid` string,
`ilu` string,
`weid` string,
`schoolname` string,
`property` string,
`zid` string,
`error` string,
`fake` string,
`apprunid` string)
PARTITIONED BY (
`sale_area` string,
`dt` string,
`hour` string,
`product` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/oversea_tv_pv_20160108'
TBLPROPERTIES (
'transient_lastDdlTime'='1452494837')
;
CREATE EXTERNAL TABLE `tv_report.oversea_tv_qy`(
`ip` string,
`time` string,
`cookie` string,
`inu` string,
`country` string,
`area` string,
`province` string,
`city` string,
`log_version` string,
`p1` string,
`p2` string,
`p3` string,
`search_id` string,
`type` string,
`position` string,
`click` string,
`uid` string,
`uuid` string,
`letv_cookie` string,
`deviceid` string,
`ch` string,
`ilu` string,
`query` string,
`pageid` string,
`result` string,
`seid` string,
`schoolname` string,
`zid` string,
`error` string,
`fake` string,
`ref` string,
`src` string,
`way` string,
`apprunid` string)
PARTITIONED BY (
`sale_area` string,
`dt` string,
`hour` string,
`product` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/oversea_tv_qy'
TBLPROPERTIES (
'transient_lastDdlTime'='1447350811')
;
CREATE EXTERNAL TABLE `tv_report.oversea_tv_qy_20150422`(
`ip` string,
`time` string,
`cookie` string,
`inu` string,
`country` string,
`area` string,
`province` string,
`city` string,
`log_version` string,
`p1` string,
`p2` string,
`p3` string,
`search_id` string,
`type` string,
`position` string,
`click` string,
`uid` string,
`uuid` string,
`letv_cookie` string,
`deviceid` string,
`ch` string,
`ilu` string,
`query` string,
`pageid` string,
`result` string,
`seid` string,
`schoolname` string,
`zid` string,
`error` string,
`fake` string,
`ref` string,
`src` string,
`way` string,
`apprunid` string)
PARTITIONED BY (
`dt` string,
`hour` string,
`product` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/oversea_tv_qy_20150422'
TBLPROPERTIES (
'last_modified_by'='zhangjiachao',
'last_modified_time'='1437661038',
'transient_lastDdlTime'='1437661038')
;
CREATE EXTERNAL TABLE `tv_report.oversea_tv_qy_20151112`(
`ip` string,
`time` string,
`cookie` string,
`inu` string,
`country` string,
`district` string,
`province` string,
`city` string,
`log_version` string,
`p1` string,
`p2` string,
`p3` string,
`search_id` string,
`type` string,
`position` string,
`click` string,
`uid` string,
`uuid` string,
`letv_cookie` string,
`deviceid` string,
`ch` string,
`ilu` string,
`query` string,
`pageid` string,
`result` string,
`seid` string,
`schoolname` string,
`zid` string,
`error` string,
`fake` string,
`ref` string,
`src` string,
`way` string,
`apprunid` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/oversea_tv_qy'
TBLPROPERTIES (
'last_modified_by'='data_quality',
'last_modified_time'='1447350798',
'transient_lastDdlTime'='1447350798')
;
CREATE EXTERNAL TABLE `tv_report.oversea_tv_qy_20160108`(
`ip` string,
`time` string,
`cookie` string,
`inu` string,
`country` string,
`area` string,
`province` string,
`city` string,
`log_version` string,
`p1` string,
`p2` string,
`p3` string,
`search_id` string,
`type` string,
`position` string,
`click` string,
`uid` string,
`uuid` string,
`letv_cookie` string,
`deviceid` string,
`ch` string,
`ilu` string,
`query` string,
`pageid` string,
`result` string,
`seid` string,
`schoolname` string,
`zid` string,
`error` string,
`fake` string,
`ref` string,
`src` string,
`way` string,
`apprunid` string)
PARTITIONED BY (
`sale_area` string,
`dt` string,
`hour` string,
`product` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/oversea_tv_qy_20160108'
TBLPROPERTIES (
'transient_lastDdlTime'='1452494837')
;
CREATE EXTERNAL TABLE `tv_report.playblock`(
`sv` string,
`flag` string,
`ts` string,
`ip` string,
`country` string,
`province` string,
`district` string,
`isp` string,
`mac` string,
`model` string,
`modelid` string,
`groupid` string,
`sn` string,
`osver` string,
`osvern` string,
`uiver` string,
`sid` string,
`pn` string,
`aver` string,
`uuid` string,
`type` string,
`dur` string,
`extvendor` string,
`extbrand` string,
`breason` string,
`bflag` string,
`crate` string,
`dspeed` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/playblock'
TBLPROPERTIES (
'transient_lastDdlTime'='1449630145')
;
CREATE EXTERNAL TABLE `tv_report.playend`(
`sv` string,
`flag` string,
`ts` string,
`ip` string,
`country` string,
`province` string,
`district` string,
`isp` string,
`mac` string,
`model` string,
`modelid` string,
`groupid` string,
`sn` string,
`osver` string,
`osvern` string,
`uiver` string,
`sid` string,
`pn` string,
`aver` string,
`uuid` string,
`type` string,
`extvendor` string,
`extbrand` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/playend'
TBLPROPERTIES (
'transient_lastDdlTime'='1449630145')
;
CREATE EXTERNAL TABLE `tv_report.playerror`(
`sv` string,
`flag` string,
`ts` string,
`ip` string,
`country` string,
`province` string,
`district` string,
`isp` string,
`mac` string,
`model` string,
`modelid` string,
`groupid` string,
`sn` string,
`osver` string,
`osvern` string,
`uiver` string,
`sid` string,
`pn` string,
`aver` string,
`uuid` string,
`type` string,
`url` string,
`errid` string,
`errcode` string,
`haslog` string,
`extvendor` string,
`extbrand` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/playerror'
TBLPROPERTIES (
'transient_lastDdlTime'='1449630145')
;
CREATE EXTERNAL TABLE `tv_report.playinit`(
`sv` string,
`flag` string,
`ts` string,
`ip` string,
`country` string,
`province` string,
`district` string,
`isp` string,
`mac` string,
`model` string,
`modelid` string,
`groupid` string,
`sn` string,
`osver` string,
`osvern` string,
`uiver` string,
`sid` string,
`pn` string,
`aver` string,
`uuid` string,
`type` string,
`url` string,
`ut` string,
`uta` string,
`utb` string,
`extvendor` string,
`extbrand` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/playinit'
TBLPROPERTIES (
'transient_lastDdlTime'='1449630145')
;
CREATE EXTERNAL TABLE `tv_report.playseek`(
`sv` string,
`flag` string,
`ts` string,
`ip` string,
`country` string,
`province` string,
`district` string,
`isp` string,
`mac` string,
`model` string,
`modelid` string,
`groupid` string,
`sn` string,
`osver` string,
`osvern` string,
`uiver` string,
`sid` string,
`pn` string,
`aver` string,
`uuid` string,
`type` string,
`extvendor` string,
`extbrand` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/playseek'
TBLPROPERTIES (
'transient_lastDdlTime'='1449630145')
;
CREATE EXTERNAL TABLE `tv_report.playstart`(
`sv` string,
`flag` string,
`ts` string,
`ip` string,
`country` string,
`province` string,
`district` string,
`isp` string,
`mac` string,
`model` string,
`modelid` string,
`groupid` string,
`sn` string,
`osver` string,
`osvern` string,
`uiver` string,
`sid` string,
`pn` string,
`aver` string,
`uuid` string,
`type` string,
`url` string,
`extvendor` string,
`extbrand` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/playstart'
TBLPROPERTIES (
'transient_lastDdlTime'='1449630145')
;
CREATE EXTERNAL TABLE `tv_report.playtime`(
`sv` string,
`flag` string,
`ts` string,
`ip` string,
`country` string,
`province` string,
`district` string,
`isp` string,
`mac` string,
`model` string,
`modelid` string,
`groupid` string,
`sn` string,
`osver` string,
`osvern` string,
`uiver` string,
`sid` string,
`pn` string,
`aver` string,
`uuid` string,
`type` string,
`dur` string,
`crcng` string,
`extvendor` string,
`extbrand` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/playtime'
TBLPROPERTIES (
'transient_lastDdlTime'='1449630145')
;
CREATE EXTERNAL TABLE `tv_report.resource_app`(
`pn` string,
`name` string,
`type` int,
`createtime` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\u0001'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/resource_app'
TBLPROPERTIES (
'COLUMN_STATS_ACCURATE'='false',
'numFiles'='1',
'numRows'='-1',
'rawDataSize'='-1',
'totalSize'='1317008',
'transient_lastDdlTime'='1451471733')
;
CREATE EXTERNAL TABLE `tv_report.resource_channellist`(
`ch` string,
`channelname` string,
`numerickey` int)
PARTITIONED BY (
`dt` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\u0001'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/resource_channellist'
TBLPROPERTIES (
'transient_lastDdlTime'='1452079157')
;
CREATE EXTERNAL TABLE `tv_report.resource_country`(
`code` string,
`name` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/resource_country'
TBLPROPERTIES (
'COLUMN_STATS_ACCURATE'='true',
'numFiles'='1',
'numRows'='184',
'rawDataSize'='2819',
'totalSize'='1830',
'transient_lastDdlTime'='1451375223')
;
CREATE EXTERNAL TABLE `tv_report.resource_province`(
`id` int,
`name` string,
`country` string,
`code` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/resource_province'
TBLPROPERTIES (
'COLUMN_STATS_ACCURATE'='true',
'numFiles'='1',
'numRows'='35',
'rawDataSize'='506',
'totalSize'='509',
'transient_lastDdlTime'='1451375228')
;
CREATE EXTERNAL TABLE `tv_report.sdkappcrash`(
`ts` string,
`ip` string,
`country` string,
`province` string,
`district` string,
`isp` string,
`sv` string,
`sdkver` string,
`wfmac` string,
`wdmac` string,
`udid` string,
`mac` string,
`imei` string,
`uuid` string,
`adid` string,
`os` string,
`osver` string,
`sn` string,
`appkey` string,
`appver` string,
`pn` string,
`dn` string,
`letv` string,
`hwbrand` string,
`hwdevice` string,
`hwmodel` string,
`hwhardware` string,
`hwid` string,
`hwserial` string,
`channel` string,
`ro` string,
`nt` string,
`bundle` string,
`dvt` string,
`pvt` string,
`sid` string,
`en` string,
`es` string,
`seq` string)
PARTITIONED BY (
`dt` string,
`pt1` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/sdkappcrash'
TBLPROPERTIES (
'transient_lastDdlTime'='1436409704')
;
CREATE EXTERNAL TABLE `tv_report.sdkappdur`(
`ts` string,
`ip` string,
`country` string,
`province` string,
`district` string,
`isp` string,
`sv` string,
`sdkver` string,
`wfmac` string,
`wdmac` string,
`udid` string,
`mac` string,
`imei` string,
`uuid` string,
`adid` string,
`os` string,
`osver` string,
`sn` string,
`appkey` string,
`appver` string,
`pn` string,
`dn` string,
`letv` string,
`hwbrand` string,
`hwdevice` string,
`hwmodel` string,
`hwhardware` string,
`hwid` string,
`hwserial` string,
`channel` string,
`ro` string,
`nt` string,
`bundle` string,
`dvt` string,
`pvt` string,
`sid` string,
`dur` string,
`seq` string)
PARTITIONED BY (
`dt` string,
`pt1` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/sdkappdur'
TBLPROPERTIES (
'transient_lastDdlTime'='1436409706')
;
CREATE EXTERNAL TABLE `tv_report.sdkapppagejump`(
`ts` string,
`ip` string,
`country` string,
`province` string,
`district` string,
`isp` string,
`sv` string,
`sdkver` string,
`wfmac` string,
`wdmac` string,
`udid` string,
`mac` string,
`imei` string,
`uuid` string,
`adid` string,
`os` string,
`osver` string,
`sn` string,
`appkey` string,
`appver` string,
`pn` string,
`dn` string,
`letv` string,
`hwbrand` string,
`hwdevice` string,
`hwmodel` string,
`hwhardware` string,
`hwid` string,
`hwserial` string,
`channel` string,
`ro` string,
`nt` string,
`bundle` string,
`dvt` string,
`pvt` string,
`sid` string,
`pgn` string,
`ppn` string,
`pgt` string,
`st` string,
`seq` string)
PARTITIONED BY (
`dt` string,
`pt1` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/sdkapppagejump'
TBLPROPERTIES (
'transient_lastDdlTime'='1436409707')
;
CREATE EXTERNAL TABLE `tv_report.sdkappstartup`(
`ts` string,
`ip` string,
`country` string,
`province` string,
`district` string,
`isp` string,
`sv` string,
`sdkver` string,
`wfmac` string,
`wdmac` string,
`udid` string,
`mac` string,
`imei` string,
`uuid` string,
`adid` string,
`os` string,
`osver` string,
`sn` string,
`appkey` string,
`appver` string,
`pn` string,
`dn` string,
`letv` string,
`hwbrand` string,
`hwdevice` string,
`hwmodel` string,
`hwhardware` string,
`hwid` string,
`hwserial` string,
`channel` string,
`ro` string,
`nt` string,
`bundle` string,
`dvt` string,
`pvt` string,
`sid` string,
`seq` string)
PARTITIONED BY (
`dt` string,
`pt1` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/sdkappstartup'
TBLPROPERTIES (
'transient_lastDdlTime'='1436409708')
;
CREATE EXTERNAL TABLE `tv_report.sdkcustomevent`(
`ts` string,
`ip` string,
`country` string,
`province` string,
`district` string,
`isp` string,
`sv` string,
`sdkver` string,
`wfmac` string,
`wdmac` string,
`udid` string,
`mac` string,
`imei` string,
`uuid` string,
`adid` string,
`os` string,
`osver` string,
`sn` string,
`appkey` string,
`appver` string,
`pn` string,
`dn` string,
`letv` string,
`hwbrand` string,
`hwdevice` string,
`hwmodel` string,
`hwhardware` string,
`hwid` string,
`hwserial` string,
`channel` string,
`ro` string,
`nt` string,
`bundle` string,
`dvt` string,
`pvt` string,
`sid` string,
`eid` string,
`peid` string,
`ep` map<string,string>,
`edur` string,
`seq` string)
PARTITIONED BY (
`dt` string,
`pt1` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/sdkcustomevent'
TBLPROPERTIES (
'transient_lastDdlTime'='1436409709')
;
CREATE EXTERNAL TABLE `tv_report.shutdown`(
`sv` string,
`flag` string,
`ts` string,
`ip` string,
`country` string,
`province` string,
`district` string,
`isp` string,
`mac` string,
`model` string,
`modelid` string,
`groupid` string,
`sn` string,
`osver` string,
`osvern` string,
`uiver` string,
`sid` string,
`extvendor` string,
`extbrand` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/shutdown'
TBLPROPERTIES (
'transient_lastDdlTime'='1449822200')
;
CREATE EXTERNAL TABLE `tv_report.stag_appstartup_mac_pn`(
`mac` string,
`pn` string,
`model` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/stag_appstartup_mac_pn'
TBLPROPERTIES (
'transient_lastDdlTime'='1450778507')
;
CREATE EXTERNAL TABLE `tv_report.stat_crash_daily`(
`model` string,
`province` string,
`channel` string,
`appkey` string,
`appver` string,
`total` string,
`mtotal` string,
`lastupdate` string)
PARTITIONED BY (
`dt` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\u0001'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/stat_crash_daily'
TBLPROPERTIES (
'transient_lastDdlTime'='1451527064')
;
CREATE EXTERNAL TABLE `tv_report.stat_crash_total`(
`model` string,
`province` string,
`channel` string,
`appkey` string,
`appver` string,
`total` string,
`mtotal` string,
`lastupdate` string)
PARTITIONED BY (
`dt` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\u0001'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/stat_crash_total'
TBLPROPERTIES (
'transient_lastDdlTime'='1451528998')
;
CREATE EXTERNAL TABLE `tv_report.stat_dur_daily`(
`year` string,
`month` string,
`day` string,
`model` string,
`province` string,
`channel` string,
`appkey` string,
`appver` string,
`dur` int)
PARTITIONED BY (
`dt` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\u0001'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/stat_dur_daily'
TBLPROPERTIES (
'transient_lastDdlTime'='1451529135')
;
CREATE EXTERNAL TABLE `tv_report.stat_dur_total`(
`year` string,
`month` string,
`day` string,
`model` string,
`province` string,
`channel` string,
`appkey` string,
`appver` string,
`dur` int)
PARTITIONED BY (
`dt` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\u0001'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/stat_dur_total'
TBLPROPERTIES (
'transient_lastDdlTime'='1451529198')
;
CREATE EXTERNAL TABLE `tv_report.stat_error_detail`(
`ts` string,
`ip` string,
`mac` string,
`hwid` string,
`country` string,
`province` string,
`district` string,
`isp` string,
`sdkver` string,
`wfmac` string,
`udid` string,
`imei` string,
`uuid` string,
`adid` string,
`appkey` string,
`appver` string,
`channel` string,
`sid` string,
`en` string,
`es` string,
`lastupdate` string)
PARTITIONED BY (
`dt` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\u0001'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/stat_error_detail'
TBLPROPERTIES (
'last_modified_by'='data_platform',
'last_modified_time'='1453095085',
'transient_lastDdlTime'='1453095085')
;
CREATE EXTERNAL TABLE `tv_report.stat_error_total`(
`province` string,
`appkey` string,
`appver` string,
`en` string,
`td_error_ts` string,
`lastupdate` string)
PARTITIONED BY (
`dt` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\u0001'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/stat_error_total'
TBLPROPERTIES (
'transient_lastDdlTime'='1451529423')
;
CREATE EXTERNAL TABLE `tv_report.stat_new_daily`(
`year` string,
`month` string,
`day` string,
`model` string,
`province` string,
`channel` string,
`appkey` string,
`version` string,
`total` string)
PARTITIONED BY (
`dt` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\u0001'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/stat_new_daily'
TBLPROPERTIES (
'transient_lastDdlTime'='1451529474')
;
CREATE EXTERNAL TABLE `tv_report.stat_new_total`(
`year` string,
`month` string,
`day` string,
`model` string,
`province` string,
`channel` string,
`appkey` string,
`version` string,
`total` int)
PARTITIONED BY (
`dt` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\u0001'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/stat_new_total'
TBLPROPERTIES (
'transient_lastDdlTime'='1451529554')
;
CREATE EXTERNAL TABLE `tv_report.stat_open_daily`(
`year` string,
`month` string,
`day` string,
`model` string,
`province` string,
`channel` string,
`appkey` string,
`appver` string,
`total` string,
`mtotal` string)
PARTITIONED BY (
`dt` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\u0001'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/stat_open_daily'
TBLPROPERTIES (
'transient_lastDdlTime'='1451529604')
;
CREATE EXTERNAL TABLE `tv_report.stat_open_monthly`(
`model` string,
`province` string,
`channel` string,
`appkey` string,
`appver` string,
`total` string,
`mtotal` string,
`lastupdate` string)
PARTITIONED BY (
`dt` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\u0001'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/stat_open_monthly'
TBLPROPERTIES (
'transient_lastDdlTime'='1451529645')
;
CREATE EXTERNAL TABLE `tv_report.stat_open_total`(
`year` string,
`month` string,
`day` string,
`model` string,
`province` string,
`channel` string,
`appkey` string,
`appver` string,
`total` string,
`mtotal` string)
PARTITIONED BY (
`dt` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\u0001'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/stat_open_total'
TBLPROPERTIES (
'transient_lastDdlTime'='1451529694')
;
CREATE EXTERNAL TABLE `tv_report.stat_open_weekly`(
`model` string,
`province` string,
`channel` string,
`appkey` string,
`appver` string,
`total` string,
`mtotal` string,
`lastupdate` string)
PARTITIONED BY (
`dt` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\u0001'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/stat_open_weekly'
TBLPROPERTIES (
'transient_lastDdlTime'='1451529736')
;
CREATE EXTERNAL TABLE `tv_report.stat_pagejump_daily`(
`year` string,
`month` string,
`day` string,
`province` string,
`appkey` string,
`appver` string,
`pgn` string,
`td_pagejump_ts` int)
PARTITIONED BY (
`dt` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\u0001'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/stat_pagejump_daily'
TBLPROPERTIES (
'transient_lastDdlTime'='1451529783')
;
CREATE EXTERNAL TABLE `tv_report.stat_pageview_daily`(
`model` string,
`province` string,
`channel` string,
`appkey` string,
`appver` string,
`pgn` string,
`total` string,
`mtotal` string,
`lastupdate` string)
PARTITIONED BY (
`dt` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\u0001'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/stat_pageview_daily'
TBLPROPERTIES (
'transient_lastDdlTime'='1451529826')
;
CREATE EXTERNAL TABLE `tv_report.stat_pageview_total`(
`province` string,
`channel` string,
`appkey` string,
`appver` string,
`pgn` string,
`total` int,
`mtotal` int,
`tol_st` int,
`lastupdate` string)
PARTITIONED BY (
`dt` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\u0001'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/stat_pageview_total'
TBLPROPERTIES (
'last_modified_by'='data_platform',
'last_modified_time'='1453095121',
'transient_lastDdlTime'='1453095121')
;
CREATE EXTERNAL TABLE `tv_report.stat_url_daily`(
`url` string,
`total` string)
PARTITIONED BY (
`dt` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\u0001'
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/stat_url_daily'
TBLPROPERTIES (
'transient_lastDdlTime'='1450942327')
;
CREATE EXTERNAL TABLE `tv_report.surf`(
`sv` string,
`flag` string,
`ts` string,
`ip` string,
`country` string,
`province` string,
`district` string,
`isp` string,
`mac` string,
`model` string,
`modelid` string,
`groupid` string,
`sn` string,
`osver` string,
`osvern` string,
`uiver` string,
`sid` string,
`url` string,
`ont` string,
`extvendor` string,
`extbrand` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/surf'
TBLPROPERTIES (
'transient_lastDdlTime'='1449630145')
;
CREATE EXTERNAL TABLE `tv_report.tvaction`(
`sv` string,
`flag` string,
`ts` string,
`ip` string,
`country` string,
`province` string,
`district` string,
`isp` string,
`mac` string,
`model` string,
`modelid` string,
`groupid` string,
`sn` string,
`osver` string,
`osvern` string,
`uiver` string,
`sid` string,
`action` string,
`props` map<string,string>,
`ecode` string,
`emsg` string,
`extvendor` string,
`extbrand` string)
PARTITIONED BY (
`area` string,
`dt` string,
`pt1` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/tvaction'
TBLPROPERTIES (
'transient_lastDdlTime'='1449630146')
;
CREATE EXTERNAL TABLE `tv_report.tvplusend`(
`ts` string,
`ip` string,
`country` string,
`province` string,
`district` string,
`isp` string,
`sv` string,
`mac` string,
`ver` string,
`vern` string,
`hwbrand` string,
`hwdevice` string,
`hwmodel` string,
`hwhardware` string,
`hwid` string,
`hwserial` string,
`model` string,
`brand` string,
`ro` string,
`nt` string,
`login` string,
`uuid` string,
`ch` string,
`chn` string,
`pr` string,
`prn` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/tvplusend'
TBLPROPERTIES (
'transient_lastDdlTime'='1449822201')
;
CREATE EXTERNAL TABLE `tv_report.tvplusinit`(
`ts` string,
`ip` string,
`country` string,
`province` string,
`district` string,
`isp` string,
`sv` string,
`mac` string,
`ver` string,
`vern` string,
`hwbrand` string,
`hwdevice` string,
`hwmodel` string,
`hwhardware` string,
`hwid` string,
`hwserial` string,
`model` string,
`brand` string,
`ro` string,
`nt` string,
`login` string,
`uuid` string,
`ch` string,
`chn` string,
`pr` string,
`prn` string,
`srcch` string,
`srcchn` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/tvplusinit'
TBLPROPERTIES (
'transient_lastDdlTime'='1449822201')
;
CREATE EXTERNAL TABLE `tv_report.tvplusplay`(
`ts` string,
`ip` string,
`country` string,
`province` string,
`district` string,
`isp` string,
`sv` string,
`mac` string,
`ver` string,
`vern` string,
`hwbrand` string,
`hwdevice` string,
`hwmodel` string,
`hwhardware` string,
`hwid` string,
`hwserial` string,
`model` string,
`brand` string,
`ro` string,
`nt` string,
`login` string,
`uuid` string,
`ch` string,
`chn` string,
`pr` string,
`prn` string,
`srcch` string,
`srcchn` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/tvplusplay'
TBLPROPERTIES (
'transient_lastDdlTime'='1449822201')
;
CREATE EXTERNAL TABLE `tv_report.tvplustime`(
`ts` string,
`ip` string,
`country` string,
`province` string,
`district` string,
`isp` string,
`sv` string,
`mac` string,
`ver` string,
`vern` string,
`hwbrand` string,
`hwdevice` string,
`hwmodel` string,
`hwhardware` string,
`hwid` string,
`hwserial` string,
`model` string,
`brand` string,
`ro` string,
`nt` string,
`login` string,
`uuid` string,
`ch` string,
`chn` string,
`pr` string,
`prn` string,
`dur` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/tvplustime'
TBLPROPERTIES (
'transient_lastDdlTime'='1449822201')
;
CREATE EXTERNAL TABLE `tv_report.tvremoterbtn`(
`flag` int,
`ts` bigint,
`ip` string,
`country` string,
`province` int,
`district` int,
`isp` int,
`sv` string,
`mac` string,
`model` string,
`modelid` int,
`sn` string,
`osver` string,
`osvern` string,
`uiver` string,
`sid` string,
`extvendor` string,
`extbrand` string,
`type` int,
`event` map<string,bigint>)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/tvremoterbtn'
TBLPROPERTIES (
'transient_lastDdlTime'='1449630145')
;
CREATE EXTERNAL TABLE `tv_report.unicom_mac`(
`mac` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/unicom_mac'
TBLPROPERTIES (
'COLUMN_STATS_ACCURATE'='true',
'numFiles'='1',
'numRows'='601',
'rawDataSize'='7217',
'totalSize'='2084',
'transient_lastDdlTime'='1451375245')
;
CREATE EXTERNAL TABLE `tv_report.updownloadfinish`(
`sv` string,
`flag` string,
`ts` string,
`ip` string,
`country` string,
`province` string,
`district` string,
`isp` string,
`mac` string,
`model` string,
`modelid` string,
`groupid` string,
`sn` string,
`osver` string,
`osvern` string,
`uiver` string,
`sid` string,
`usn` string,
`result` string,
`ecode` string,
`emsg` string,
`extvendor` string,
`extbrand` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/updownloadfinish'
TBLPROPERTIES (
'transient_lastDdlTime'='1449630145')
;
CREATE EXTERNAL TABLE `tv_report.updownloadstartup`(
`sv` string,
`flag` string,
`ts` string,
`ip` string,
`country` string,
`province` string,
`district` string,
`isp` string,
`mac` string,
`model` string,
`modelid` string,
`groupid` string,
`sn` string,
`osver` string,
`osvern` string,
`uiver` string,
`sid` string,
`usn` string,
`extvendor` string,
`extbrand` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/updownloadstartup'
TBLPROPERTIES (
'transient_lastDdlTime'='1449630146')
;
CREATE EXTERNAL TABLE `tv_report.upfinish`(
`sv` string,
`flag` string,
`ts` string,
`ip` string,
`country` string,
`province` string,
`district` string,
`isp` string,
`mac` string,
`model` string,
`modelid` string,
`groupid` string,
`sn` string,
`osver` string,
`osvern` string,
`uiver` string,
`sid` string,
`usn` string,
`result` string,
`type` string,
`strategy` string,
`ust` string,
`uft` string,
`dst` string,
`dft` string,
`ecode` string,
`emsg` string,
`extvendor` string,
`extbrand` string)
PARTITIONED BY (
`area` string,
`dt` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
LOCATION
'hdfs://basic.internal.hadoop.10-148-10-10.scloud.letv.com:8020/user/cloudland/warehouse/tv/datamarts/tv_report.db/upfinish'
TBLPROPERTIES (
'transient_lastDdlTime'='1449630146')
;
|
{
"content_hash": "76e238d2bfcd8aa93ee7f0d8edd2bdd6",
"timestamp": "",
"source": "github",
"line_count": 4640,
"max_line_length": 143,
"avg_line_length": 25.082112068965518,
"alnum_prop": 0.6777824558991588,
"repo_name": "lhfei/cluster-conf",
"id": "c1e4006570161128dea969f095786c2e1ba0ecd5",
"size": "116454",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "db-scripts/tv_report/tv_report_ddl_create.sql",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "471450"
},
{
"name": "PLSQL",
"bytes": "10076"
},
{
"name": "Shell",
"bytes": "793431"
},
{
"name": "XSLT",
"bytes": "1326"
}
],
"symlink_target": ""
}
|
var fs = require('fs');
var path = require('path');
var nodemailer = require('nodemailer');
var ejs = require('ejs');
var config = require('./config');
var cache = require('./cache');
// create reusable transporter object using SMTP transport
var transporter = nodemailer.createTransport(config.notify.transport);
// The e-mail template
var emailTpl = fs.readFileSync(path.join(__dirname, 'views', 'emails', 'post.ejs')).toString();
module.exports = function (options, cb) {
cb = cb || function () {};
var group = options.group,
post = options.post,
to = group.notify;
// Notifications disabled or no recipient
if (!config.notify.enabled || !to || (typeof to != 'string' && !to.length)) {
process.nextTick(function () {
cb();
});
return;
}
var renderOptions = {
to: to,
group: group,
post: post,
host: config.host
};
var from = config.notify.from;
if (!~from.indexOf('<')) {
from = post.from.name+' <'+from+'>'
}
var domain = config.notify.transport.host,
domainSuffix = (domain) ? '@'+domain : '';
// send mail with defined transport object
transporter.sendMail({
messageId: 'unfacebookify/'+group.id+'/'+post.id+domainSuffix,
references: 'unfacebookify/'+group.id+domainSuffix,
inReplyTo: 'unfacebookify/'+group.id+domainSuffix,
from: from,
to: to,
subject: ejs.render(config.notify.subject, renderOptions),
text: ejs.render(emailTpl, renderOptions)
}, function (err, info) {
console.log(err, info);
cb(err);
});
};
|
{
"content_hash": "4fb30486b8c2d30dc2bd94a493b8fe02",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 95,
"avg_line_length": 26.035087719298247,
"alnum_prop": 0.6677897574123989,
"repo_name": "emersion/unfacebookify",
"id": "2fc137ad29707e2e18025b42d02362f5693c756c",
"size": "1484",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/notifier.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "9451"
},
{
"name": "JavaScript",
"bytes": "18588"
}
],
"symlink_target": ""
}
|
#if defined(CONFIG_OF) && defined(CONFIG_COMMON_CLK)
struct clk *__of_clk_get_from_provider(struct of_phandle_args *clkspec);
void of_clk_lock(void);
void of_clk_unlock(void);
#endif
|
{
"content_hash": "ec809a2951576574a2609e174188e636",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 72,
"avg_line_length": 26.428571428571427,
"alnum_prop": 0.7297297297297297,
"repo_name": "lokeshjindal15/pd-gem5",
"id": "795cc9f0dac0c0594474b24e7cfd9a2ab8b0565e",
"size": "510",
"binary": false,
"copies": "262",
"ref": "refs/heads/master",
"path": "kernel_dvfs/linux-linaro-tracking-gem5/drivers/clk/clk.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Assembly",
"bytes": "10138943"
},
{
"name": "Awk",
"bytes": "19269"
},
{
"name": "C",
"bytes": "469972635"
},
{
"name": "C++",
"bytes": "18163034"
},
{
"name": "CMake",
"bytes": "2202"
},
{
"name": "Clojure",
"bytes": "333"
},
{
"name": "Emacs Lisp",
"bytes": "1969"
},
{
"name": "Groff",
"bytes": "63956"
},
{
"name": "HTML",
"bytes": "136898"
},
{
"name": "Hack",
"bytes": "2489"
},
{
"name": "Java",
"bytes": "3096"
},
{
"name": "Jupyter Notebook",
"bytes": "1231954"
},
{
"name": "Lex",
"bytes": "59257"
},
{
"name": "M4",
"bytes": "52982"
},
{
"name": "Makefile",
"bytes": "1453704"
},
{
"name": "Objective-C",
"bytes": "1315749"
},
{
"name": "Perl",
"bytes": "716374"
},
{
"name": "Perl6",
"bytes": "3727"
},
{
"name": "Protocol Buffer",
"bytes": "3246"
},
{
"name": "Python",
"bytes": "4102365"
},
{
"name": "Scilab",
"bytes": "21433"
},
{
"name": "Shell",
"bytes": "512873"
},
{
"name": "SourcePawn",
"bytes": "4687"
},
{
"name": "UnrealScript",
"bytes": "10556"
},
{
"name": "Visual Basic",
"bytes": "2884"
},
{
"name": "XS",
"bytes": "1239"
},
{
"name": "Yacc",
"bytes": "121715"
}
],
"symlink_target": ""
}
|
<!doctype html>
<html>
<title>CLINIC </title>
<head>
<link rel="stylesheet" href="index2.css">
<link rel="stylesheet" href="css/bootstrap.css">
</head>
<body>
<form>
<br>
<div class="search" align="right"><input id="mysearch" type="search" placeholder="USN #"/>
<button type="button" class="btn btn-primary">Search</button><br>
</div>
<div class="container ama">
<legend><center>CLINIC</center></legend>
<div class="image">
<img src="../web/profile.jpg" alt="..." class="img-thumbnail"></>
<div class="picture">
<a href="">Change picture</a>
</div></div>
<table>
<tr> <th> </th> <th> </th> </tr>
<tr> <td> Name: </td> <td><input></input></td> </tr>
<tr> <td> USN No: </td> <td> <select><option>12343254</select></option></td>
<tr> <td> Year Level:</td>
<td><select><option>First year</option><option>Second Year</option>
<option>Third Year</option><option>Fourth Year</option></select></td> </tr>
<tr> <td>
<tr> <td> SY Term: </td> <td><input> </input> </td></tr>
<tr> <td> Courses: </td> <td> <select> <option>BS IT</option> <option>BS CS</option>
<option>BS IS</option> </td> </tr>
<tr> <td>Section: </td> <td> <select> <option>A4</option> <option>C4</option>
<option> B4</option> <option>C4</option> </select> </td> </tr>
<tr> <td> Age: </td> <td> <input> </input> </tr></td>
<tr> <td>Gender: </td> <td> <select> <option>Male</Option> <option>Female</option></select></td></tr>
<tr> <td> Address:</td> <td> <input></input></tr></td>
<tr><td> Current Status: </td> <td> <select><option>Cleared</option> <option>Not Cleared</option> </td> </tr>
</form>
</table>
</div>
<div class="button all">
<div class="update1">
<button type="button" class="btn btn-primary">Update</button></li><br>
</div>
<div class="update2">
<button type="button" class="btn btn-primary">Edit</button></li><br>
</div>
<div class="update3">
<button type="button" class="btn btn-primary">Save</button></li><br>
</div>
<div class="update4">
<button type="button" class="btn btn-primary">New</button></li><br>
</div>
<div class="update5">
<button type="button" class="btn btn-primary">Delete</button></li><br>
</div>
<div class="update6">
<button type="button" class="btn btn-primary">View Records</button></li><br>
</div>
</div>
<br> <br>
<br> <br>
<br> <br>
<div class="row">
<div class="col-md-6 square2">
<p>SSC</p>
<p>SSC Requirement(s) for the </p>
<p>signing of clearance</p>
<ul>
<li>SSC project fee p 150.00
<li>College Night Fee</li>
</ul>
</div>
<div class="col-md-5 button">
<ul>
<li><button type="button" class="btn btn-primary">Update Post</button></li><br>
<li><button type="button" class="btn btn-primary">Edit Post</button></li><br>
<li><button type="button" class="btn btn-primary">New Post</button></li><br>
<li><button type="button" class="btn btn-primary">Delete Records</button></li><br>
</ul>
</div>
</div>
</div>
<div class="col-md-6">
<textarea rows="10 " cols="60" > </textarea>
<button type="button" class="btn btn-primary">Feedbacks</button>
<button type="button"class="btn btn-primary cancelbutton"> Cancel </button>
</div>
</div>
</body>
</table>
</html>
|
{
"content_hash": "787392b3460efbbb9c553fefa014bdc4",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 109,
"avg_line_length": 26.71186440677966,
"alnum_prop": 0.6224619289340102,
"repo_name": "zhacky/studentclearance",
"id": "e96cb2dd51c2ec1728eb7b6e63f86f41310b0ae9",
"size": "3152",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "files/rafe/CLINIC.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ActionScript",
"bytes": "15982"
},
{
"name": "ApacheConf",
"bytes": "1476"
},
{
"name": "CSS",
"bytes": "134530"
},
{
"name": "HTML",
"bytes": "5442267"
},
{
"name": "JavaScript",
"bytes": "894737"
},
{
"name": "PHP",
"bytes": "2189597"
},
{
"name": "Shell",
"bytes": "87"
}
],
"symlink_target": ""
}
|
/*
Style for comment section
*/
div.comments {
padding:10px;
margin-bottom:10px;
}
div.comments article {
margin-bottom:20px;
}
span.comment-name, span.comment-time {
font-size:0.8em;
}
span.comment-name {
color:#494;
}
span.comment-content {
font-size:1em;
display:block;
margin:10px;
}
span.comment-ip {
color:#777;
display:block;
font-size:0.5em;
}
span.comment-edit {
font-size:0.7em;
}
/* New Comment form */
div.comment-form {
}
div.comment-form fieldset {
background:#EEE;
border-radius:5px;
}
|
{
"content_hash": "c8e757bcde61d73731ef684db951b3e3",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 38,
"avg_line_length": 12.340425531914894,
"alnum_prop": 0.6206896551724138,
"repo_name": "Racetrac/Anax-MVC",
"id": "f88deac8e07ca0f411f86744f91b428da61bc1f5",
"size": "580",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "webroot/css/comment.css",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "22145"
},
{
"name": "JavaScript",
"bytes": "61375"
},
{
"name": "PHP",
"bytes": "277698"
}
],
"symlink_target": ""
}
|
package com.sujeet.library;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Response;
@Path("/hello")
public class HelloWorld {
@GET
@Path("/echo/{input}")
@Produces("text/plain")
public String ping(@PathParam("input") String input) {
return input;
}
@POST
@Produces("application/json")
@Consumes("application/json")
@Path("/jsonBean")
public Response modifyJson(JsonBean input) {
input.setVal2(input.getVal1());
return Response.ok().entity(input).build();
}
}
|
{
"content_hash": "1a1b23c1510e43ec05209c1095e2b636",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 58,
"avg_line_length": 23.137931034482758,
"alnum_prop": 0.6646795827123696,
"repo_name": "sujeetr/learn",
"id": "921935ada5d944ef3db8a7ff45673ae03aa606c4",
"size": "671",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "library/src/main/java/com/sujeet/library/HelloWorld.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "2880"
}
],
"symlink_target": ""
}
|
<?php
namespace App\Classes;
use PayPal\Rest\ApiContext;
class PayPal
{
public function init()
{
return new ApiContext;
}
}
|
{
"content_hash": "3f4be5900509720f16fc8312c3c4c861",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 30,
"avg_line_length": 11.307692307692308,
"alnum_prop": 0.6326530612244898,
"repo_name": "itinnovator/myphp-app",
"id": "a9880fafa33d67c70317e61c5a493147bdebd182",
"size": "147",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/Classes/PayPal.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "160"
},
{
"name": "HTML",
"bytes": "47"
},
{
"name": "PHP",
"bytes": "3003"
}
],
"symlink_target": ""
}
|
<html lang="en">
<head>
<title>GETPID - The GNU Fortran Compiler</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="The GNU Fortran Compiler">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Intrinsic-Procedures.html#Intrinsic-Procedures" title="Intrinsic Procedures">
<link rel="prev" href="GETLOG.html#GETLOG" title="GETLOG">
<link rel="next" href="GETUID.html#GETUID" title="GETUID">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
Copyright (C) 1999-2013 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being ``Funding Free Software'', the Front-Cover
Texts being (a) (see below), and with the Back-Cover Texts being (b)
(see below). A copy of the license is included in the section entitled
``GNU Free Documentation License''.
(a) The FSF's Front-Cover Text is:
A GNU Manual
(b) The FSF's Back-Cover Text is:
You have freedom to copy and modify this GNU Manual, like GNU
software. Copies published by the Free Software Foundation raise
funds for GNU development.-->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
</head>
<body>
<div class="node">
<a name="GETPID"></a>
<p>
Next: <a rel="next" accesskey="n" href="GETUID.html#GETUID">GETUID</a>,
Previous: <a rel="previous" accesskey="p" href="GETLOG.html#GETLOG">GETLOG</a>,
Up: <a rel="up" accesskey="u" href="Intrinsic-Procedures.html#Intrinsic-Procedures">Intrinsic Procedures</a>
<hr>
</div>
<h3 class="section">8.106 <code>GETPID</code> — Process ID function</h3>
<p><a name="index-GETPID-694"></a><a name="index-system_002c-process-ID-695"></a><a name="index-process-ID-696"></a>
<dl>
<dt><em>Description</em>:<dd>Returns the numerical process identifier of the current process.
<br><dt><em>Standard</em>:<dd>GNU extension
<br><dt><em>Class</em>:<dd>Function
<br><dt><em>Syntax</em>:<dd><code>RESULT = GETPID()</code>
<br><dt><em>Return value</em>:<dd>The return value of <code>GETPID</code> is an <code>INTEGER</code> of the default
kind.
<br><dt><em>Example</em>:<dd>
<pre class="smallexample"> program info
print *, "The current process ID is ", getpid()
print *, "Your numerical user ID is ", getuid()
print *, "Your numerical group ID is ", getgid()
end program info
</pre>
<br><dt><em>See also</em>:<dd><a href="GETGID.html#GETGID">GETGID</a>, <a href="GETUID.html#GETUID">GETUID</a>
</dl>
</body></html>
|
{
"content_hash": "317effb453ecdeba247a5b3b96ebb506",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 120,
"avg_line_length": 40.839506172839506,
"alnum_prop": 0.6880290205562273,
"repo_name": "vtslab/sensafety-midterm",
"id": "f3e868eeb6bf642ff5bf4f7ac0dc53c55e42ff57",
"size": "3308",
"binary": false,
"copies": "12",
"ref": "refs/heads/master",
"path": "ilp/Raspberry_Pi_Toolchain/gcc-linaro-arm-linux-gnueabihf-raspbian/share/doc/gcc-linaro-arm-linux-gnueabihf-raspbian/html/gfortran/GETPID.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "19219688"
},
{
"name": "C++",
"bytes": "4757546"
},
{
"name": "CSS",
"bytes": "26571"
},
{
"name": "Clean",
"bytes": "6801"
},
{
"name": "Component Pascal",
"bytes": "1754"
},
{
"name": "D",
"bytes": "2232"
},
{
"name": "Erlang",
"bytes": "169"
},
{
"name": "FORTRAN",
"bytes": "10216"
},
{
"name": "JavaScript",
"bytes": "62412"
},
{
"name": "Max",
"bytes": "296"
},
{
"name": "Objective-C",
"bytes": "59128"
},
{
"name": "PHP",
"bytes": "19144"
},
{
"name": "Perl",
"bytes": "3028"
},
{
"name": "Python",
"bytes": "1625891"
},
{
"name": "Ruby",
"bytes": "273"
},
{
"name": "Shell",
"bytes": "815331"
},
{
"name": "VCL",
"bytes": "4153"
},
{
"name": "XC",
"bytes": "17615"
},
{
"name": "XSLT",
"bytes": "179445"
}
],
"symlink_target": ""
}
|
@(post: PostEntity, tags: Seq[PostTagEntity])(implicit request: LocalizedRequest[AnyContent], messagesApi: MessagesApi)
@import controllers.Implicits._
@import dao.Options
@main(post.title.localize + " - " + Options.blogName.localize, post.headerImage) {
<div class="post-heading">
<h1>@post.title.localize</h1>
<h2 class="subheading">@post.subtitle.localize</h2>
<span class="meta">@Messages("time", post.time.localize) -
<span class="post-tags">
@for((tag, index) <- tags.zipWithIndex) {
@if(index != 0) {/ }
<a href="@routes.Application.tag(request.lang, tag.slug)">@tag.name.localize</a>
}
</span>
</span>
</div>
} {
<article>
@Html(Utils.parseMarkdown(post.content.localize))
</article>
@if(!Options.disqusShortName.isEmpty) {
<div id="disqus_thread"></div>
<script type="text/javascript">
var disqus_config=function(){this.page.identifier = '@post.slug';};
(function() {
var d=document,s=d.createElement('script');
s.src='https://@{Options.disqusShortName}.disqus.com/embed.js';
s.setAttribute('data-timestamp',+new Date());
(d.head||d.body).appendChild(s);
})();
</script>
}
}
|
{
"content_hash": "0cdc5283406cc2bbd2403d8a39bf65f3",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 119,
"avg_line_length": 38.470588235294116,
"alnum_prop": 0.5871559633027523,
"repo_name": "terro/virblog",
"id": "b8f432490a227a3469afd17d73f21da113a69536",
"size": "1308",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/views/post.scala.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "218025"
},
{
"name": "HTML",
"bytes": "40840"
},
{
"name": "JavaScript",
"bytes": "28383"
},
{
"name": "Scala",
"bytes": "35617"
}
],
"symlink_target": ""
}
|
package org.openbaton.catalogue.nfvo;
import java.util.Iterator;
import java.util.Set;
import javax.persistence.*;
import org.openbaton.catalogue.util.IdGenerator;
/** Created by tbr on 07.07.16. */
@Entity(name = "requiresParameters")
public class RequiresParameters {
@Id private String id;
@Version private int version;
@Column
@ElementCollection(targetClass = String.class)
private Set<String> parameters;
@PrePersist
public void ensureId() {
id = IdGenerator.createUUID();
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public int getVersion() {
return version;
}
public void setVersion(int version) {
this.version = version;
}
@OneToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL, orphanRemoval = true)
public Set<String> getParameters() {
return parameters;
}
public void setParameters(Set<String> params) {
this.parameters = params;
}
@Override
public String toString() {
return "requiresParameters{"
+ "id='"
+ id
+ '\''
+ ", version="
+ version
+ ", parameters=["
+ parametersToString()
+ ']'
+ '}';
}
private String parametersToString() {
String returnString = "";
for (Iterator<String> iterator = parameters.iterator(); iterator.hasNext(); ) {
returnString += "\'" + iterator.next() + "\'";
if (iterator.hasNext()) returnString += ", ";
}
return returnString;
}
}
|
{
"content_hash": "6faa583cb54c1395f2b6eb21c5eb8837",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 86,
"avg_line_length": 20.863013698630137,
"alnum_prop": 0.6270518713066316,
"repo_name": "openbaton/openbaton-libs",
"id": "780edad9db18b6c860fb44f3d29f59cccb10bc48",
"size": "2151",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "catalogue/src/main/java/org/openbaton/catalogue/nfvo/RequiresParameters.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "619479"
}
],
"symlink_target": ""
}
|
<resources>
<string name="app_name">SensorLibraryTestApp</string>
</resources>
|
{
"content_hash": "51bb8a15c444274c61cedbe26e875ba0",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 57,
"avg_line_length": 27.666666666666668,
"alnum_prop": 0.7349397590361446,
"repo_name": "rzetzsche/sensorlibrary",
"id": "33109d57e96bfd01ef1c578940b791da30c945f1",
"size": "83",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/src/main/res/values/strings.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "136161"
}
],
"symlink_target": ""
}
|
def array_concat(array_1, array_2)
concat = (array_1 + array_2)
return concat
end
|
{
"content_hash": "d3d3531d136fd6dfe6d7a54b9de0324e",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 34,
"avg_line_length": 21.25,
"alnum_prop": 0.6941176470588235,
"repo_name": "sharonjean/phase-0",
"id": "c944ab64aee4bceed5066cca88f643ae42c3d986",
"size": "186",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "week-4/concatenate-arrays/my_solution.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1506"
},
{
"name": "HTML",
"bytes": "18309"
},
{
"name": "JavaScript",
"bytes": "25960"
},
{
"name": "Ruby",
"bytes": "97369"
}
],
"symlink_target": ""
}
|
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Bootstrap, a sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.">
<meta name="keywords" content="HTML, CSS, JS, JavaScript, framework, bootstrap, front-end, frontend, web development">
<meta name="author" content="Mark Otto, Jacob Thornton, and Bootstrap contributors">
<title>
{% if page.title == "Bootstrap" %}
{{ page.title }}
{% else %}
{{ page.title }} · Bootstrap
{% endif %}
</title>
<!-- Bootstrap core CSS -->
<link href="../dist/css/bootstrap.min.css" rel="stylesheet">
{% if page.slug == "css" or page.slug == "components" or page.slug == "js" %}
<!-- Optional Bootstrap Theme -->
<!--<link href="data:text/css;charset=utf-8," data-href="../dist/css/bootstrap-theme.min.css" rel="stylesheet" id="bs-theme-stylesheet">-->
{% endif %}
<link href="../assets/css/fancytree/skin-fenixedu/ui.fancytree.less" rel="stylesheet/less" type="text/css">
<!-- Documentation extras -->
<link href="../assets/css/docs.min.css" rel="stylesheet">
<!--[if lt IE 9]><script src="../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="../assets/js/ie10-viewport-bug-workaround.js"></script>
<script src="../assets/js/ie-emulation-modes-warning.js"></script>
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<!-- Favicons -->
<link rel="apple-touch-icon-precomposed" href="/apple-touch-icon-precomposed.png">
<link rel="icon" href="/favicon.ico">
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-146052-10', 'getbootstrap.com');
ga('send', 'pageview');
</script>
|
{
"content_hash": "97b2bd08b4f9e90e71c1226741f4a814",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 151,
"avg_line_length": 47.55102040816327,
"alnum_prop": 0.6772532188841202,
"repo_name": "ist-dsi-archive/fenixedu-canvas",
"id": "44b59541e39fa54ecf45eb64e89fd649f73e07ec",
"size": "2330",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/_includes/header.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "472199"
},
{
"name": "HTML",
"bytes": "237531"
},
{
"name": "JavaScript",
"bytes": "810316"
},
{
"name": "Python",
"bytes": "5734"
},
{
"name": "Shell",
"bytes": "129"
}
],
"symlink_target": ""
}
|
var audioPlayerPlugin = {
play: function(success, failure){
cordova.exec(success, failure, "AudioPlayerPlugin", "play", []);
},
pause: function(success, failure){
cordova.exec(success, failure, "AudioPlayerPlugin", "pause", []);
},
playURL: function(success, failure){
cordova.exec(success, failure, "AudioPlayerPlugin", "playURL", [urlString]);
},
addNextURL: function(success, failure){
cordova.exec(success, failure, "AudioPlayerPlugin", "addNextURL", [urlString]);
},
playNext: function(success, failure){
cordova.exec(success, failure, "AudioPlayerPlugin", "playNext", []);
}
};
|
{
"content_hash": "57709a367bd668458f126c227b5ec2a9",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 87,
"avg_line_length": 31.636363636363637,
"alnum_prop": 0.6120689655172413,
"repo_name": "vadimf/phonegap-audio-payer",
"id": "eaca05457eced9ee4b1e2e9250d5e0d2cded99a3",
"size": "696",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "www/js/AudioPlayerPlugin.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "AppleScript",
"bytes": "1208"
},
{
"name": "C",
"bytes": "1025"
},
{
"name": "CSS",
"bytes": "7438"
},
{
"name": "JavaScript",
"bytes": "5301"
},
{
"name": "Objective-C",
"bytes": "213767"
},
{
"name": "Shell",
"bytes": "27244"
}
],
"symlink_target": ""
}
|
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Azure.Core.TestFramework;
using Azure.Storage.Shared;
using Azure.Storage.Test;
using Moq;
using NUnit.Framework;
namespace Azure.Storage.Tests
{
public class LazyLoadingReadOnlyStreamTests
{
private class DownloadedContent : IDownloadedContent
{
private readonly Stream _content;
public Stream Content => _content;
public DownloadedContent(Stream stream)
{
_content = stream;
}
}
// int just fills the generic requirements, we don't care about data type and go straight for the raw response
private static Mock<LazyLoadingReadOnlyStream<int>.DownloadInternalAsync> GetDownloadBehavior(byte[] data)
{
// just mocking a response from injectable behavior
var downloadMock = new Mock<LazyLoadingReadOnlyStream<int>.DownloadInternalAsync>();
downloadMock.Setup(_ => _(It.IsAny<HttpRange>(), It.IsAny<DownloadTransferValidationOptions>(), It.IsAny<bool>(), It.IsAny<CancellationToken>()))
.Returns<HttpRange, DownloadTransferValidationOptions, bool, CancellationToken>((range, validationOptions, async, CancellationToken) =>
{
var mockResponse = new Mock<Response<IDownloadedContent>>(MockBehavior.Strict);
mockResponse.SetupGet(r => r.Value)
.Returns(new DownloadedContent(new MemoryStream(data, (int)range.Offset, (int)(range.Length ?? (data.Length - range.Offset)))));
mockResponse.Setup(r => r.GetRawResponse())
.Returns(() => new MockResponse(201).AddHeader("Content-Range", $"bytes {range.Offset}-{range.Offset + range.Length - 1}/{data.Length}"));
return Task.FromResult(mockResponse.Object);
});
return downloadMock;
}
// int just fills the generic requirements, we don't care about data type and go straight for the raw response
private static Mock<LazyLoadingReadOnlyStream<int>.GetPropertiesAsync> GetPropertiesBehavior(int totalResourceLength)
{
// just mocking a response from injectable behavior
var propertiesMock = new Mock<LazyLoadingReadOnlyStream<int>.GetPropertiesAsync>();
propertiesMock.Setup(_ => _(It.IsAny<bool>(), It.IsAny<CancellationToken>()))
.Returns<bool, CancellationToken>((value, cancellationToken) =>
{
var mockResponse = new Mock<Response<int>>(MockBehavior.Strict);
mockResponse.Setup(r => r.GetRawResponse())
.Returns(() => new MockResponse(200).AddHeader("Content-Length", totalResourceLength.ToString()));
return Task.FromResult(mockResponse.Object);
});
return propertiesMock;
}
[TestCase(0, Constants.KB, Constants.KB)]
[TestCase(0 * Constants.KB, Constants.KB, 3 * Constants.KB)]
[TestCase(1 * Constants.KB, Constants.KB, 3 * Constants.KB)]
[TestCase(2 * Constants.KB, Constants.KB, 3 * Constants.KB)]
public async Task AvoidRebuffer(int offset, int bufferSize, int dataSize)
{
if (offset < 0 || offset + bufferSize > dataSize)
{
throw new ArgumentException("Bad test definition.");
}
// Arrange
byte[] data = TestHelper.GetRandomBuffer(dataSize);
var downloadMock = GetDownloadBehavior(data);
var propertiesMock = GetPropertiesBehavior(data.Length);
var readStream = new LazyLoadingReadOnlyStream<int>(
downloadMock.Object,
propertiesMock.Object,
transferValidation: default,
allowModifications: false,
initialLenght: dataSize,
position: offset,
bufferSize: bufferSize);
// Act
var readTest = new byte[bufferSize];
foreach (var _ in Enumerable.Range(0, 10))
{
await readStream.ReadAsync(readTest, 0, readTest.Length);
// seek back to exact start of current buffer
readStream.Position = offset;
}
// Assert
Assert.AreEqual(1, downloadMock.Invocations.Count);
}
}
}
|
{
"content_hash": "155d5c0c406ea457d8a8cfb4f923a263",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 162,
"avg_line_length": 44.36538461538461,
"alnum_prop": 0.6098829648894668,
"repo_name": "Azure/azure-sdk-for-net",
"id": "b131558e82b0b4e9f14dd5bf01b9e59185ce7046",
"size": "4616",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "sdk/storage/Azure.Storage.Common/tests/LazyLoadingReadOnlyStreamTests.cs",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
}
|
package kafka.api
import kafka.controller.LeaderIsrAndControllerEpoch
import kafka.utils._
import scala.collection.Set
object LeaderAndIsr {
val initialLeaderEpoch: Int = 0
val initialZKVersion: Int = 0
val NoLeader = -1
val LeaderDuringDelete = -2
}
case class LeaderAndIsr(var leader: Int, var leaderEpoch: Int, var isr: List[Int], var zkVersion: Int) {
def this(leader: Int, isr: List[Int]) = this(leader, LeaderAndIsr.initialLeaderEpoch, isr, LeaderAndIsr.initialZKVersion)
override def toString: String = {
Json.encode(Map("leader" -> leader, "leader_epoch" -> leaderEpoch, "isr" -> isr))
}
}
case class PartitionStateInfo(leaderIsrAndControllerEpoch: LeaderIsrAndControllerEpoch, allReplicas: Set[Int]) {
def replicationFactor = allReplicas.size
override def toString: String = {
val partitionStateInfo = new StringBuilder
partitionStateInfo.append("(LeaderAndIsrInfo:" + leaderIsrAndControllerEpoch.toString)
partitionStateInfo.append(",ReplicationFactor:" + replicationFactor + ")")
partitionStateInfo.append(",AllReplicas:" + allReplicas.mkString(",") + ")")
partitionStateInfo.toString()
}
}
|
{
"content_hash": "70a68d91a0debe1f006c8665eee7de6a",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 123,
"avg_line_length": 32.111111111111114,
"alnum_prop": 0.7474048442906575,
"repo_name": "geeag/kafka",
"id": "e68ad866834ca23c65bc1c2e456fe1ebc87cf0fe",
"size": "1957",
"binary": false,
"copies": "4",
"ref": "refs/heads/trunk",
"path": "core/src/main/scala/kafka/api/LeaderAndIsr.scala",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "22196"
},
{
"name": "HTML",
"bytes": "5443"
},
{
"name": "Java",
"bytes": "5890050"
},
{
"name": "Python",
"bytes": "452869"
},
{
"name": "Scala",
"bytes": "3503598"
},
{
"name": "Shell",
"bytes": "54956"
},
{
"name": "XSLT",
"bytes": "7116"
}
],
"symlink_target": ""
}
|
namespace ofp {
namespace detail {
template <class T>
struct has_FixedHeaderSize {
template <typename U>
static char test(decltype(U::FixedHeaderSize) *);
template <typename U>
static double test(...);
static bool const value = (sizeof(test<T>(nullptr)) == 1);
};
} // namespace detail
class PropertyList : public ProtocolList<PropertyRange> {
using Inherited = ProtocolList<PropertyRange>;
public:
using Inherited::Inherited;
template <class PropertyType>
EnableIf<detail::has_FixedHeaderSize<PropertyType>::value, void> add(
const PropertyType &property) {
assert((buf_.size() % 8) == 0);
ByteRange value = property.valueRef();
size_t propSize = PropertyType::FixedHeaderSize + value.size();
buf_.add(&property, PropertyType::FixedHeaderSize);
buf_.add(value.data(), value.size());
buf_.addZeros(PadLength(propSize) - propSize);
assert(property.size() == propSize);
assert((buf_.size() % 8) == 0);
}
template <class PropertyType>
EnableIf<!detail::has_FixedHeaderSize<PropertyType>::value, void> add(
const PropertyType &property) {
static_assert((sizeof(property) % 8) == 0, "Expected multiple of 8.");
buf_.add(&property, sizeof(property));
}
};
} // namespace ofp
#endif // OFP_PROPERTYLIST_H_
|
{
"content_hash": "849037bf8fefc6bb6d607ceb5f321fc3",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 74,
"avg_line_length": 26.408163265306122,
"alnum_prop": 0.6792890262751159,
"repo_name": "byllyfish/oftr",
"id": "91a092488ffb0d24b215f95cb47bf0882a4a3e0b",
"size": "1598",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "include/ofp/propertylist.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "2989"
},
{
"name": "C++",
"bytes": "2157366"
},
{
"name": "CMake",
"bytes": "42760"
},
{
"name": "Dockerfile",
"bytes": "2897"
},
{
"name": "Go",
"bytes": "1531"
},
{
"name": "Python",
"bytes": "21034"
},
{
"name": "Shell",
"bytes": "18878"
}
],
"symlink_target": ""
}
|
'use strict';
// Setting up route
angular.module('users').config(['$stateProvider','$urlRouterProvider',
function($stateProvider,$urlRouterProvider) {
// For any unmatched url, send to /route1
$urlRouterProvider.otherwise("/signin")
// Users state routing
$stateProvider
.state('profile', {
url: '/settings/profile',
templateUrl: 'modules/users/views/settings/edit-profile.client.view.html'
})
.state('password', {
url: '/settings/password',
templateUrl: 'modules/users/views/settings/change-password.client.view.html'
})
.state('accounts', {
url: '/settings/accounts',
templateUrl: 'modules/users/views/settings/social-accounts.client.view.html'
})
.state('signup', {
url: '/signup',
templateUrl: 'modules/users/views/authentication/signup.client.view.html'
})
.state('signin', {
url: '/signin',
templateUrl: 'modules/users/views/authentication/signin.client.view.html'
})
.state('admin_forgot_password', {
url: '/password/admin/forgot',
templateUrl: 'modules/users/views/password/forgot-password.admin.view.html'
})
.state('forgot', {
url: '/password/forgot',
templateUrl: 'modules/users/views/password/forgot-password.client.view.html'
})
.state('reset-invalid', {
url: '/password/reset/invalid',
templateUrl: 'modules/users/views/password/reset-password-invalid.client.view.html'
})
.state('reset-success', {
url: '/password/reset/success',
templateUrl: 'modules/users/views/password/reset-password-success.client.view.html'
})
.state('reset', {
url: '/password/reset/:token',
templateUrl: 'modules/users/views/password/reset-password.client.view.html'
})
.state('vendor-thanks', {
url: '/vendor/success',
templateUrl: 'modules/users/views/settings/vendor-thanks.client.view.html'
})
.state('add-client', {
url: '/client/signup',
templateUrl: 'modules/users/views/authentication/clientSignup.client.view.html'
});
}
]);
|
{
"content_hash": "c1f83ad8ebcbe4f16a4a5b37f2b66592",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 86,
"avg_line_length": 33.11864406779661,
"alnum_prop": 0.6965199590583419,
"repo_name": "chauhanmohit/meanStack",
"id": "63c2d44253963dc1ffa466713587ffc41733260c",
"size": "1954",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "public/modules/users/config/users.client.routes.js",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "443374"
},
{
"name": "HTML",
"bytes": "105473"
},
{
"name": "JavaScript",
"bytes": "4731934"
},
{
"name": "Shell",
"bytes": "694"
}
],
"symlink_target": ""
}
|
function Tile(position, value) {
this.x = position.x;
this.y = position.y;
this.value = value || 10;
this.previousPosition = null;
this.mergedFrom = null; // Tracks tiles that merged together
}
Tile.prototype.savePosition = function () {
this.previousPosition = { x: this.x, y: this.y };
};
Tile.prototype.updatePosition = function (position) {
this.x = position.x;
this.y = position.y;
};
Tile.prototype.serialize = function () {
return {
position: {
x: this.x,
y: this.y
},
value: this.value
};
};
|
{
"content_hash": "2e0117216a0918ffbcec9bbe1fe83ad9",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 68,
"avg_line_length": 22.037037037037038,
"alnum_prop": 0.5815126050420169,
"repo_name": "ars123/2048-code",
"id": "9a4348b68f4c179c669c9c6b0c6b3b594db63936",
"size": "595",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "2048-code/js/tile.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "67733"
},
{
"name": "HTML",
"bytes": "7965"
},
{
"name": "JavaScript",
"bytes": "46960"
},
{
"name": "Ruby",
"bytes": "300"
}
],
"symlink_target": ""
}
|
package org.apache.maven.project;
import java.util.List;
import org.apache.maven.model.Plugin;
import org.apache.maven.model.PluginContainer;
/** @deprecated */
@Deprecated
public final class ModelUtils
{
/**
* This should be the resulting ordering of plugins after merging:
* <p>
* Given:
* <pre>
* parent: X -> A -> B -> D -> E
* child: Y -> A -> C -> D -> F
* </pre>
* Result:
* <pre>
* X -> Y -> A -> B -> C -> D -> E -> F
* </pre>
*/
public static void mergePluginLists( PluginContainer childContainer, PluginContainer parentContainer,
boolean handleAsInheritance )
{
throw new UnsupportedOperationException();
}
public static List<Plugin> orderAfterMerge( List<Plugin> merged, List<Plugin> highPrioritySource,
List<Plugin> lowPrioritySource )
{
throw new UnsupportedOperationException();
}
public static void mergePluginDefinitions( Plugin child, Plugin parent, boolean handleAsInheritance )
{
throw new UnsupportedOperationException();
}
public static void mergeFilterLists( List<String> childFilters, List<String> parentFilters )
{
throw new UnsupportedOperationException();
}
}
|
{
"content_hash": "d5a5411543514fcd46e31691e1b91447",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 105,
"avg_line_length": 26.980392156862745,
"alnum_prop": 0.6075581395348837,
"repo_name": "cstamas/maven",
"id": "2c94f7a6f651440547b36c49b89bb1ee6da7f682",
"size": "2182",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "maven-compat/src/main/java/org/apache/maven/project/ModelUtils.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "8860"
},
{
"name": "HTML",
"bytes": "2379"
},
{
"name": "Java",
"bytes": "5779369"
},
{
"name": "Shell",
"bytes": "5741"
}
],
"symlink_target": ""
}
|
/* -------------------------------------------------------------------
// ReST!
// ------------------------------------------------------------------*/
.ReST .markItUpButton1 a {
background-image:url(images/h1.png);
}
.ReST .markItUpButton2 a {
background-image:url(images/h2.png);
}
.ReST .markItUpButton3 a {
background-image:url(images/h3.png);
}
.ReST .markItUpButton4 a {
background-image:url(images/h4.png);
}
.ReST .markItUpButton5 a {
background-image:url(images/h5.png);
}
.ReST .markItUpButton6 a {
background-image:url(images/h6.png);
}
.ReST .markItUpButton7 a {
background-image:url(images/bold.png);
}
.ReST .markItUpButton8 a {
background-image:url(images/italic.png);
}
.ReST .markItUpButton9 a {
background-image:url(images/list-bullet.png);
}
.ReST .markItUpButton10 a {
background-image:url(images/list-numeric.png);
}
.ReST .markItUpButton11 a {
background-image:url(images/picture.png);
}
.ReST .markItUpButton12 a {
background-image:url(images/link.png);
}
.ReST .markItUpButton13 a {
background-image:url(images/quotes.png);
}
.ReST .markItUpButton14 a {
background-image:url(images/code.png);
}
.ReST .preview a {
background-image:url(images/preview.png);
}
.ReST .markItUpHeader ul {
padding-left: 0px;
margin-left: 0px;
}
.ReST .markItUpHeader a:hover {
border-bottom: none;
}
/* Overlay */
#simplemodal-overlay {
height:100%;
width:100%;
position:fixed;
left:0;
top:0;
z-index:3000;
background-color:#000000;
}
/* Container */
#simplemodal-container {
position:fixed;
margin:0 auto 0 auto;
left:50%;
top:10%;
z-index:3100;
background-color:#fff;
border:3px solid #3C769D;
}
#simplemodal-container a.modalCloseImg {
background: url(images/close.png) no-repeat;
width:25px;
height:29px;
display:inline;
z-index:3200;
position:absolute;
top:-15px;
right:-16px;
cursor:pointer;
}
#simplemodal-container {
width:600px;
height:400px;
padding: 10px;
margin: 0px;
}
#simplemodal-container iframe {
width:100%;
height:100%;
border:none;
}
|
{
"content_hash": "ba54bb8102cd7e4a770acdf1f11686eb",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 71,
"avg_line_length": 20.12037037037037,
"alnum_prop": 0.6194201564657156,
"repo_name": "indexofire/feincms-markup",
"id": "e9ac62fb446ae3138d520b08297084ae2e471e5e",
"size": "2173",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "feincms_markup/static/markitup/sets/restructuredtext/style.css",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "58257"
},
{
"name": "Python",
"bytes": "12215"
}
],
"symlink_target": ""
}
|
var id_quote = 0;
$(function(){
$('#confirmPay').on('show.bs.modal', function (event) {
var link = $(event.relatedTarget);
id_quote = link.data('quote');
var number_quote = link.data('number');
$("#message_modal_confirmPay").text("Are you sure want to pay the quote number " + number_quote + "?");
});
$('#pay_button').on('click', function () {
var $btn = $(this).button('loading');
$.post( "/sales/quotes/pay/" + id_quote, function() {
})
.done(function() {
$('#confirmPay').modal('hide');
$('#quote_' + id_quote + '_pay').parent().html("Paid");
$btn.button('reset');
})
.fail(function() {
alert( "error" );
$btn.button('reset');
});
})
});
|
{
"content_hash": "9f2ce2b1e8c8f9373abafc6e16fb8dc9",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 111,
"avg_line_length": 29.24137931034483,
"alnum_prop": 0.45754716981132076,
"repo_name": "caballerojavier13/credit_control",
"id": "80fbf9307a166db75ad01d96b46694325d74983c",
"size": "848",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/assets/javascripts/quotes.js",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "927587"
},
{
"name": "HTML",
"bytes": "51708"
},
{
"name": "JavaScript",
"bytes": "2884"
},
{
"name": "Ruby",
"bytes": "42927"
}
],
"symlink_target": ""
}
|
package com.andforce.keyboardlayout;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
}
|
{
"content_hash": "f89f61d655ae08f7be18704b0d19da83",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 81,
"avg_line_length": 22.823529411764707,
"alnum_prop": 0.6881443298969072,
"repo_name": "andforce/KeyboardLayout",
"id": "541a6ee8cb139fade4ba51a6524cc474c1bba9cb",
"size": "388",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "keyboardlayout/src/test/java/com/andforce/keyboardlayout/ExampleUnitTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "54881"
}
],
"symlink_target": ""
}
|
package robowars.test;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.PrintWriter;
import java.net.Socket;
import java.net.UnknownHostException;
import java.text.SimpleDateFormat;
import java.util.Date;
import robowars.server.controller.ClientCommand;
import robowars.server.controller.LobbyChatEvent;
import robowars.server.controller.LobbyGameEvent;
import robowars.server.controller.LobbyRobotEvent;
import robowars.server.controller.LobbyUserEvent;
import robowars.shared.model.GameEvent;
/**
* A command line configurable TCP connection simulator.
*/
public class ClientSimulator {
/** The network socket to communicate through */
private Socket streamSocket;
/** The writer to the log file */
private PrintWriter logOut;
/** Buffered reader to read from console */
private BufferedReader consoleIn;
/** The stream to write out to the socket */
private ObjectOutputStream socketOut;
/** The stream to read in from the socket */
private ObjectInputStream socketIn;
/**
* ClientSimulator Constructor
*
* @param hostname The host address to connect to
* @param port The port to attempt a connection on
* @param username The username to send to the server upon connection
* @param logFilename The name of the output file to log to
*/
public ClientSimulator(String hostname, int port, String username, String logFilename) {
try {
// Bind a socket to any available port on the local host machine.
streamSocket = new Socket(hostname.split(":")[0], port);
System.out.println("Client simulator connected to " + streamSocket.getInetAddress().getHostName());
} catch (UnknownHostException e1) {
System.err.println("Hostname is unknown.");
System.exit(1);
} catch (IOException e2) {
System.err.println("Couldn't get port.");
System.exit(1);
}
try {
// Setup the socket input/output and console input
socketOut = new ObjectOutputStream(streamSocket.getOutputStream());
socketIn = new ObjectInputStream(streamSocket.getInputStream());
consoleIn = new BufferedReader(new InputStreamReader(System.in));
// Setup the log file
File logOutFile = new File(logFilename);
if (logOutFile.exists()) {
System.out.println("Log file exists, appending to existing log file.");
} else {
System.out.println("Generating new log file.");
logOutFile.createNewFile();
}
logOut = new PrintWriter(new FileWriter(logOutFile, true), true);
// Start the thread to receive messages from the socket
new Thread(new Runnable() {
@Override
public void run() {
Object incomingMessage;
try {
while (true) {
incomingMessage = socketIn.readObject();
if(incomingMessage == null) break;
if(incomingMessage instanceof GameEvent) break;
String msgText = "";
if(incomingMessage instanceof LobbyChatEvent) msgText = ((LobbyChatEvent)incomingMessage).toString();
if(incomingMessage instanceof LobbyGameEvent) msgText = ((LobbyGameEvent)incomingMessage).toString();
if(incomingMessage instanceof LobbyUserEvent) msgText = ((LobbyUserEvent)incomingMessage).toString();
if(incomingMessage instanceof LobbyRobotEvent) msgText = ((LobbyRobotEvent)incomingMessage).toString();
SimpleDateFormat dateFormat = new SimpleDateFormat("[yyyy/MM/dd h:mm:ss a] ");
StringBuffer sb = new StringBuffer();
sb.append("Recv: ");
sb.append(dateFormat.format(new Date()));
sb.append(msgText);
logOut.println(sb.toString());
System.out.println(sb.toString());
}
} catch (IOException e) {
System.out.println("Lost connection with server, terminating listen thread.");
System.exit(1);
} catch (ClassNotFoundException e) {
System.out.println("Error in reading message from server.");
System.exit(1);
}
}
}).start();
// Automatically send protocol string and username
logAndSendUTF("RoboWars V0.2");
logAndSendUTF(username);
} catch (IOException e2) {
System.err.println("Couldn't get I/O connection:");
System.err.println(e2.getMessage());
System.exit(1);
}
}
/**
* Starts the interactive mode of the client simulator. The client will run
* until a "QUIT" command is entered by the user.
*/
public void interactive() {
System.out.println("Client simulator succesfully initiated connection.");
System.out.println("Type any message to send string, or \"QUIT\" to exit client.");
while(true) {
String sendMessage = "";
System.out.print("> ");
try {
sendMessage = consoleIn.readLine();
} catch (IOException e) {
System.err.println("Error fetching input from console.");
e.printStackTrace();
break;
}
if(sendMessage.equals("QUIT")) {
logAndSendCmd("q");
System.out.println("Exiting client simulator.");
break;
} else {
logAndSendCmd(sendMessage);
}
}
}
/**
* Sends the passed message to the network as a plain UTF string, and logs
* the message to screen and to log file. This should only be used to send the
* protocol string and username (all subsequent communications should use
* serialized ClientCommands).
* @param message The message to send / log
*/
private void logAndSendUTF(String message) {
SimpleDateFormat dateFormat = new SimpleDateFormat("[yyyy/MM/dd h:mm:ss a] ");
StringBuffer sb = new StringBuffer();
sb.append("Sent: ");
sb.append(dateFormat.format(new Date()));
sb.append(message);
logOut.println(sb.toString());
System.out.println(sb.toString());
try {
socketOut.writeUTF(message);
socketOut.reset();
} catch (IOException e) {
e.printStackTrace();
}
}
/**
* Attempts to parse the passed string into a ClientCommand, and sends the
* serialized ClientCommand to the server. If no valid client command could
* be generated, the entire string is sent as a chat message.
* @param message The client command string to parse. See ClientCommand.parse()
* for valid formats.
*/
private void logAndSendCmd(String cmdString) {
SimpleDateFormat dateFormat = new SimpleDateFormat("[yyyy/MM/dd h:mm:ss a] ");
StringBuffer sb = new StringBuffer();
sb.append("Sent: ");
sb.append(dateFormat.format(new Date()));
sb.append(cmdString);
logOut.println(sb.toString());
System.out.println(sb.toString());
ClientCommand cmd = ClientCommand.parse(cmdString);
if(cmd == null) {
cmd = new ClientCommand(ClientCommand.CHAT_MESSAGE);
cmd.setStringData(cmdString);
}
try {
socketOut.writeObject(cmd);
socketOut.reset();
} catch (IOException e) {
e.printStackTrace();
}
}
/**
* Closes all possible open streams.
*/
public void close() {
try {
socketOut.close();
consoleIn.close();
streamSocket.close();
logOut.close();
} catch (IOException e) {
System.err.println("Couldn't get I/O for the connection");
System.exit(1);
}
}
/**
* Starts the TCP client simulator
* @param args [0] - hostname / ip - the hostname or ip address to connect to
* [1] - port - the port to attempt a connection on
* [2] - username - the username to send the server upon connection
* [3] - logging file - the name of the file to log client activity to
*/
public static void main(String args[]) {
if(args.length>=4){
try {
int connectionPort = Integer.parseInt(args[1]);
ClientSimulator c = new ClientSimulator(args[0], connectionPort, args[2], args[3]);
c.interactive();
c.close();
} catch (NumberFormatException e) {
System.out.println("Invalid port specified.");
System.out.println("Argument syntax is: <host_IP> <port> <username> <logging_file_path>");
System.exit(1);
}
}
else{
System.out.println("Invalid Number of Arguments.");
System.out.println("Argument syntax is: <host_IP> <port> <username> <logging_file_path>");
System.exit(1);
}
}
}
|
{
"content_hash": "c2b41a1ce60c3d73e91434dfbe7134cb",
"timestamp": "",
"source": "github",
"line_count": 252,
"max_line_length": 110,
"avg_line_length": 33.12301587301587,
"alnum_prop": 0.6713789385407931,
"repo_name": "alexcraig/RoboWars",
"id": "2a404b2e6841d36d96ae02b062147b3fb2dd7838",
"size": "8347",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "robowars_server/src/robowars/test/ClientSimulator.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "377673"
}
],
"symlink_target": ""
}
|
package com.zigorsalvador.phoenix.jackson;
import java.io.IOException;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.zigorsalvador.phoenix.messages.Address;
import com.zigorsalvador.phoenix.utilities.AddressParser;
public class AddressDeserializer extends JsonDeserializer<Address>
{
@Override
public Address deserialize(JsonParser parser, DeserializationContext context) throws IOException, JsonProcessingException
{
return AddressParser.address(parser.readValuesAs(String.class).next());
}
}
|
{
"content_hash": "86049c86c4abedaf84bd39af20be3076",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 122,
"avg_line_length": 33.04761904761905,
"alnum_prop": 0.8443804034582133,
"repo_name": "zigorsalvador/phoenix",
"id": "8985a04075a3a125ec01ff71b01cfc5f23338300",
"size": "694",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/com/zigorsalvador/phoenix/jackson/AddressDeserializer.java",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "173610"
}
],
"symlink_target": ""
}
|
from argparse import ArgumentParser
from typing import Any
from django.db.models import Q
from zerver.actions.user_settings import bulk_regenerate_api_keys
from zerver.lib.management import ZulipBaseCommand
from zerver.lib.sessions import (
delete_all_deactivated_user_sessions,
delete_all_user_sessions,
delete_realm_user_sessions,
)
from zerver.models import UserProfile
class Command(ZulipBaseCommand):
help = """\
Log out all users from active browser sessions.
Does not disable API keys, and thus will not log users out of the
mobile apps.
"""
def add_arguments(self, parser: ArgumentParser) -> None:
parser.add_argument(
"--deactivated-only",
action="store_true",
help="Only log out all users who are deactivated",
)
parser.add_argument(
"--rotate-api-keys",
action="store_true",
help="Also rotate API keys of the affected users",
)
self.add_realm_args(parser, help="Only log out all users in a particular realm")
def handle(self, *args: Any, **options: Any) -> None:
realm = self.get_realm(options)
rotate_api_keys = options["rotate_api_keys"]
if realm:
delete_realm_user_sessions(realm)
regenerate_api_key_queryset = UserProfile.objects.filter(realm=realm).values_list(
"id", flat=True
)
elif options["deactivated_only"]:
delete_all_deactivated_user_sessions()
regenerate_api_key_queryset = UserProfile.objects.filter(
Q(is_active=False) | Q(realm__deactivated=True)
).values_list("id", flat=True)
else:
delete_all_user_sessions()
regenerate_api_key_queryset = UserProfile.objects.values_list("id", flat=True)
if rotate_api_keys:
bulk_regenerate_api_keys(regenerate_api_key_queryset)
|
{
"content_hash": "c2fc3d9a4efb18348d91a5cd789429b4",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 94,
"avg_line_length": 34.981818181818184,
"alnum_prop": 0.6403326403326404,
"repo_name": "zulip/zulip",
"id": "5580cb5fa12140cf7dd4118530d1b4d57f982768",
"size": "1924",
"binary": false,
"copies": "3",
"ref": "refs/heads/main",
"path": "zerver/management/commands/logout_all_users.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "509211"
},
{
"name": "Dockerfile",
"bytes": "4219"
},
{
"name": "Emacs Lisp",
"bytes": "157"
},
{
"name": "HTML",
"bytes": "696430"
},
{
"name": "Handlebars",
"bytes": "384277"
},
{
"name": "JavaScript",
"bytes": "4098367"
},
{
"name": "Perl",
"bytes": "10163"
},
{
"name": "Puppet",
"bytes": "112433"
},
{
"name": "Python",
"bytes": "10336945"
},
{
"name": "Ruby",
"bytes": "3166"
},
{
"name": "Shell",
"bytes": "147162"
},
{
"name": "TypeScript",
"bytes": "286785"
}
],
"symlink_target": ""
}
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_07) on Thu Sep 10 14:11:05 CST 2015 -->
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>Uses of Class org.xclcharts.renderer.XEnum.TickType</title>
<meta name="date" content="2015-09-10">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class org.xclcharts.renderer.XEnum.TickType";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../org/xclcharts/renderer/XEnum.TickType.html" title="enum in org.xclcharts.renderer">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/xclcharts/renderer/class-use/XEnum.TickType.html" target="_top">Frames</a></li>
<li><a href="XEnum.TickType.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="Uses of Class org.xclcharts.renderer.XEnum.TickType" class="title">Uses of Class<br>org.xclcharts.renderer.XEnum.TickType</h2>
</div>
<div class="classUseContainer">
<ul class="blockList">
<li class="blockList">
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation">
<caption><span>Packages that use <a href="../../../../org/xclcharts/renderer/XEnum.TickType.html" title="enum in org.xclcharts.renderer">XEnum.TickType</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Package</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="#org.xclcharts.renderer">org.xclcharts.renderer</a></td>
<td class="colLast"> </td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="org.xclcharts.renderer">
<!-- -->
</a>
<h3>Uses of <a href="../../../../org/xclcharts/renderer/XEnum.TickType.html" title="enum in org.xclcharts.renderer">XEnum.TickType</a> in <a href="../../../../org/xclcharts/renderer/package-summary.html">org.xclcharts.renderer</a></h3>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../org/xclcharts/renderer/package-summary.html">org.xclcharts.renderer</a> that return <a href="../../../../org/xclcharts/renderer/XEnum.TickType.html" title="enum in org.xclcharts.renderer">XEnum.TickType</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>static <a href="../../../../org/xclcharts/renderer/XEnum.TickType.html" title="enum in org.xclcharts.renderer">XEnum.TickType</a></code></td>
<td class="colLast"><span class="strong">XEnum.TickType.</span><code><strong><a href="../../../../org/xclcharts/renderer/XEnum.TickType.html#valueOf(java.lang.String)">valueOf</a></strong>(java.lang.String name)</code>
<div class="block">Returns the enum constant of this type with the specified name.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="../../../../org/xclcharts/renderer/XEnum.TickType.html" title="enum in org.xclcharts.renderer">XEnum.TickType</a>[]</code></td>
<td class="colLast"><span class="strong">XEnum.TickType.</span><code><strong><a href="../../../../org/xclcharts/renderer/XEnum.TickType.html#values()">values</a></strong>()</code>
<div class="block">Returns an array containing the constants of this enum type, in
the order they are declared.</div>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../org/xclcharts/renderer/XEnum.TickType.html" title="enum in org.xclcharts.renderer">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/xclcharts/renderer/class-use/XEnum.TickType.html" target="_top">Frames</a></li>
<li><a href="XEnum.TickType.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
|
{
"content_hash": "4fc4f9566b091faa87c788768fe0a2b9",
"timestamp": "",
"source": "github",
"line_count": 165,
"max_line_length": 304,
"avg_line_length": 40.82424242424243,
"alnum_prop": 0.6466745843230404,
"repo_name": "yswheye/XCL-Charts",
"id": "6797b50ec9410c36901fa99d6ec165c432a215a3",
"size": "6736",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "doc/org/xclcharts/renderer/class-use/XEnum.TickType.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "1"
},
{
"name": "C++",
"bytes": "1"
},
{
"name": "Java",
"bytes": "1281349"
}
],
"symlink_target": ""
}
|
#pragma once
#include <aws/route53/Route53_EXPORTS.h>
#include <aws/route53/Route53Request.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>
namespace Aws
{
namespace Route53
{
namespace Model
{
/**
* <p>Gets information about a specific traffic policy version.</p><p><h3>See
* Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetTrafficPolicyRequest">AWS
* API Reference</a></p>
*/
class AWS_ROUTE53_API GetTrafficPolicyRequest : public Route53Request
{
public:
GetTrafficPolicyRequest();
// Service request name is the Operation name which will send this request out,
// each operation should has unique request name, so that we can get operation's name from this request.
// Note: this is not true for response, multiple operations may have the same response name,
// so we can not get operation's name from response.
inline virtual const char* GetServiceRequestName() const override { return "GetTrafficPolicy"; }
Aws::String SerializePayload() const override;
/**
* <p>The ID of the traffic policy that you want to get information about.</p>
*/
inline const Aws::String& GetId() const{ return m_id; }
/**
* <p>The ID of the traffic policy that you want to get information about.</p>
*/
inline void SetId(const Aws::String& value) { m_idHasBeenSet = true; m_id = value; }
/**
* <p>The ID of the traffic policy that you want to get information about.</p>
*/
inline void SetId(Aws::String&& value) { m_idHasBeenSet = true; m_id = std::move(value); }
/**
* <p>The ID of the traffic policy that you want to get information about.</p>
*/
inline void SetId(const char* value) { m_idHasBeenSet = true; m_id.assign(value); }
/**
* <p>The ID of the traffic policy that you want to get information about.</p>
*/
inline GetTrafficPolicyRequest& WithId(const Aws::String& value) { SetId(value); return *this;}
/**
* <p>The ID of the traffic policy that you want to get information about.</p>
*/
inline GetTrafficPolicyRequest& WithId(Aws::String&& value) { SetId(std::move(value)); return *this;}
/**
* <p>The ID of the traffic policy that you want to get information about.</p>
*/
inline GetTrafficPolicyRequest& WithId(const char* value) { SetId(value); return *this;}
/**
* <p>The version number of the traffic policy that you want to get information
* about.</p>
*/
inline int GetVersion() const{ return m_version; }
/**
* <p>The version number of the traffic policy that you want to get information
* about.</p>
*/
inline void SetVersion(int value) { m_versionHasBeenSet = true; m_version = value; }
/**
* <p>The version number of the traffic policy that you want to get information
* about.</p>
*/
inline GetTrafficPolicyRequest& WithVersion(int value) { SetVersion(value); return *this;}
private:
Aws::String m_id;
bool m_idHasBeenSet;
int m_version;
bool m_versionHasBeenSet;
};
} // namespace Model
} // namespace Route53
} // namespace Aws
|
{
"content_hash": "c8c609fa33b73e24b6583978ba2537b5",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 108,
"avg_line_length": 31.574257425742573,
"alnum_prop": 0.6613358419567262,
"repo_name": "JoyIfBam5/aws-sdk-cpp",
"id": "691b8f85885d41d976830cac94f402bf75dbf13e",
"size": "3762",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "aws-cpp-sdk-route53/include/aws/route53/model/GetTrafficPolicyRequest.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "11868"
},
{
"name": "C++",
"bytes": "167818064"
},
{
"name": "CMake",
"bytes": "591577"
},
{
"name": "HTML",
"bytes": "4471"
},
{
"name": "Java",
"bytes": "271801"
},
{
"name": "Python",
"bytes": "85650"
},
{
"name": "Shell",
"bytes": "5277"
}
],
"symlink_target": ""
}
|
package chapter4.car;
public interface Component {
}
|
{
"content_hash": "4304c63f7e7eda3ca31be7c6077bc53c",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 28,
"avg_line_length": 13.5,
"alnum_prop": 0.7777777777777778,
"repo_name": "hogeschool/INFDEV-Homework",
"id": "0d255ba5a4d5aa69914fd383acc5d22caef80064",
"size": "54",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "Solutions to homework/java/chapter4/car/Component.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "22249"
},
{
"name": "Java",
"bytes": "46485"
},
{
"name": "Python",
"bytes": "15681"
},
{
"name": "TeX",
"bytes": "42211"
}
],
"symlink_target": ""
}
|
package org.springframework.boot.context.properties;
import org.springframework.beans.factory.BeanCreationException;
import org.springframework.util.ClassUtils;
/**
* Exception thrown when {@link ConfigurationProperties @ConfigurationProperties} binding
* fails.
*
* @author Phillip Webb
* @author Stephane Nicoll
* @since 2.0.0
*/
public class ConfigurationPropertiesBindException extends BeanCreationException {
private final Class<?> beanType;
private final ConfigurationProperties annotation;
ConfigurationPropertiesBindException(String beanName, Object bean,
ConfigurationProperties annotation, Exception cause) {
super(beanName, getMessage(bean, annotation), cause);
this.beanType = bean.getClass();
this.annotation = annotation;
}
/**
* Return the bean type that was being bound.
* @return the bean type
*/
public Class<?> getBeanType() {
return this.beanType;
}
/**
* Return the configuration properties annotation that triggered the binding.
* @return the configuration properties annotation
*/
public ConfigurationProperties getAnnotation() {
return this.annotation;
}
private static String getMessage(Object bean, ConfigurationProperties annotation) {
StringBuilder message = new StringBuilder();
message.append("Could not bind properties to '");
message.append(ClassUtils.getShortName(bean.getClass())).append("' : ");
message.append("prefix=").append(annotation.prefix());
message.append(", ignoreInvalidFields=").append(annotation.ignoreInvalidFields());
message.append(", ignoreUnknownFields=").append(annotation.ignoreUnknownFields());
return message.toString();
}
}
|
{
"content_hash": "25392a86a1ad64163124a6a6d2f9eaa8",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 89,
"avg_line_length": 30.036363636363635,
"alnum_prop": 0.7645278450363197,
"repo_name": "donhuvy/spring-boot",
"id": "c1ef3453365862954f7f0ff4eb36be8053d75a1d",
"size": "2272",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindException.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "1948"
},
{
"name": "CSS",
"bytes": "115"
},
{
"name": "Dockerfile",
"bytes": "1770"
},
{
"name": "FreeMarker",
"bytes": "3599"
},
{
"name": "Groovy",
"bytes": "59146"
},
{
"name": "HTML",
"bytes": "70214"
},
{
"name": "Java",
"bytes": "14728751"
},
{
"name": "JavaScript",
"bytes": "37789"
},
{
"name": "Kotlin",
"bytes": "36215"
},
{
"name": "Ruby",
"bytes": "884"
},
{
"name": "Shell",
"bytes": "37223"
},
{
"name": "Smarty",
"bytes": "2885"
},
{
"name": "XSLT",
"bytes": "3545"
}
],
"symlink_target": ""
}
|
package main
import (
"os"
_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
_ "k8s.io/client-go/plugin/pkg/client/auth/oidc"
"knative.dev/client-contrib/plugins/admin/core"
)
func main() {
if err := core.NewAdminCommand().Execute(); err != nil {
os.Exit(1)
}
}
|
{
"content_hash": "1dde8cfa43a8737d5cbf3bd2fe620e7e",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 57,
"avg_line_length": 18.066666666666666,
"alnum_prop": 0.6678966789667896,
"repo_name": "knative/client-contrib",
"id": "cf425c3822e00c62dcc8ee7f98a7bbb03fa0ca72",
"size": "870",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "plugins/admin/cmd/kn-admin.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Go",
"bytes": "212717"
},
{
"name": "Shell",
"bytes": "166202"
}
],
"symlink_target": ""
}
|
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Product extends CI_Model {
public function getAll()
{
return $this->db->query("SELECT products.id, images.src AS img, products.name, inventory, SUM(quantity) as sold FROM products LEFT JOIN images ON products.id=images.product_id AND images.is_main = 1 LEFT JOIN orders_products ON products.id = orders_products.product_id WHERE products.id != 9999 GROUP BY products.id ORDER BY sold DESC")->result_array();
}
public function getInventory($data)
{
// $inCart = [];
// foreach ($data as $cart) {
// array_push($inCart, $cart['id']);
// }
return $this->db->query("SELECT id, inventory FROM products")->result_array(); // WHERE id IN ('$inCart') ???
}
public function getItemDetails($id)
{
$sql="SELECT products.id as id, name, category_id, price, images.src AS img, description, inventory FROM products LEFT JOIN images ON products.id=images.product_id WHERE products.id = $id AND is_main = 1 OR is_main = 2";
$result = $this->db->query($sql)->row_array();
$result['images'] = $this->db->query("SELECT * FROM images WHERE product_id = {$result['id']}")->result_array();
return $result;
}
public function getDummyProductImages() {
return $this->db->query("SELECT * FROM images WHERE product_id = 9999")->result_array();
}
public function deleteImage($id) {
return $this->db->query("DELETE FROM images WHERE id = $id");
}
public function getSimilarItems($id)
{
$cat = $this->db->query("SELECT parent_id FROM categories JOIN products ON products.category_id = categories.id WHERE products.id = $id")->row_array();
return $this->db->query("SELECT products.id id, products.name, price, images.src AS img FROM products JOIN images ON products.id=images.product_id JOIN categories ON products.category_id=categories.id WHERE parent_id = {$cat['parent_id']} AND products.id != $id LIMIT 3")->result_array();
}
public function linkImage($imageID, $productID) {
$this->db->query("UPDATE images SET product_id = $productID, is_main = 1 WHERE id = $imageID");
}
public function deleteTempImages() {
return $this->db->query("DELETE FROM images WHERE product_id = 9999 AND is_main != 2");
}
public function addImage($imageInfo) {
$query = "INSERT INTO images (product_id, src, is_main, created_at, updated_at) VALUES(?, ?, 0, now(), now())";
$values = array($imageInfo['productID'], $imageInfo['src']);
return $this->db->query($query, $values);
}
public function addProduct($productInfo) {
$query = "INSERT INTO products (name, price, inventory, description, category_id) VALUES (?, ?, ?, ?, ?)";
$values = array($productInfo['name'], intval($productInfo['price']), intval($productInfo['inventory']), $productInfo['description'], intval($productInfo['category']));
return $this->db->query($query, $values);
}
public function getCategories() {
$results = array();
$results = $this->db->query("select id, name as category_name FROM categories WHERE parent_id = 0")->result_array();
for ($i = 0; $i < count($results); $i++) {
$results[$i]['children'] = $this->db->query("SELECT id, name FROM categories WHERE parent_id = {$results[$i]['id']}")->result_array();
}
return $results;
}
public function getProductsByCategory($categoryID) {
$query = "SELECT products.id as id, images.src as img, categories.id as cat_id, parent_id FROM products LEFT JOIN images ON products.id = images.product_id AND images.is_main = 1 LEFT JOIN categories ON categories.id = products.category_id WHERE categories.id = $categoryID OR parent_id = $categoryID";
return $this->db->query($query)->result_array();
}
public function getProductsByCategoryA($categoryID) {
$query = "SELECT products.id as id, images.src as img, categories.id as cat_id, parent_id FROM products LEFT JOIN images ON products.id = images.product_id AND images.is_main = 1 LEFT JOIN categories ON categories.id = products.category_id WHERE categories.id = $categoryID OR parent_id = $categoryID";
return $this->db->query($query)->result_array();
}
public function paginateCategories($id, $limit)
{
if ($id == 0) {
$query = "SELECT products.id as id, images.src as img, categories.id as cat_id, parent_id FROM products LEFT JOIN images ON products.id = images.product_id AND images.is_main = 1 LEFT JOIN categories ON categories.id = products.category_id";
$numRows = $this->db->query($query)->num_rows();
$lim = ($limit-1)*9;
$query.=" LIMIT $lim, 9";
$result = $this->db->query($query)->result_array();
}
else {
$query = "SELECT products.id as id, images.src as img, categories.id as cat_id, parent_id FROM products LEFT JOIN images ON products.id = images.product_id AND images.is_main = 1 LEFT JOIN categories ON categories.id = products.category_id WHERE categories.id = $id OR parent_id = $id";
$numRows = $this->db->query($query)->num_rows();
$lim = ($limit-1)*9;
$query.=" LIMIT $lim, 9";
$result = $this->db->query($query)->result_array();
}
return array("numItems" => $numRows, "products" => $result, "catID" => $id);
}
public function paginateAllProducts($limit) {
$query ="SELECT products.id, images.src AS img, products.name, inventory, SUM(quantity) as sold FROM products LEFT JOIN images ON products.id=images.product_id AND images.is_main = 1 LEFT JOIN orders_products ON products.id = orders_products.product_id WHERE products.id != 9999 GROUP BY products.id ";
$numRows = $this->db->query($query)->num_rows();
$limit = ($limit-1) * 6;
$query.=" LIMIT $lim, 6";
$result = $this->db->query($query)->result_array();
return array("numItems" => $numRows, "products" => $result);
}
public function deleteProduct($id) {
$this->db->query("DELETE FROM products WHERE id = $id");
}
public function editProduct($productInfo) {
$query = "UPDATE products SET name=? , price=?, inventory=?, description = ?, category_id = ? WHERE id = ?";
$values = array($productInfo['name'],$productInfo['price'], $productInfo['inventory'], $productInfo['description'], $productInfo['category'], $productInfo['product_id']);
$this->db->query($query, $values);
$query = "UPDATE images set is_main = 0 WHERE product_id = {$productInfo['product_id']}";
$this->db->query($query);
$query = "UPDATE images SET is_main = 1 WHERE product_id = ? AND id = ?";
$values = array($productInfo['product_id'], $productInfo['image']);
$this->db->query($query, $values);
}
}
|
{
"content_hash": "a563968d1c28b13d95032e649711bfd4",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 355,
"avg_line_length": 56.473684210526315,
"alnum_prop": 0.6845293569431501,
"repo_name": "mingjianjzhang/lpproject",
"id": "87a9ab3a298036922eba46244808110af9889563",
"size": "6438",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "application/models/Product.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "1498"
},
{
"name": "CSS",
"bytes": "17590"
},
{
"name": "HTML",
"bytes": "8276744"
},
{
"name": "JavaScript",
"bytes": "56968"
},
{
"name": "PHP",
"bytes": "1801126"
}
],
"symlink_target": ""
}
|
<?php
namespace App\Events;
use App\Events\Event;
use App\Ping;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
class PingFailure extends Event
{
use SerializesModels;
/**
* @var Ping
*/
public $ping;
/**
* Create a new event instance.
*/
public function __construct(Ping $ping)
{
$this->ping = $ping;
}
/**
* Get the channels the event should be broadcast on.
*
* @return array
*/
public function broadcastOn()
{
return [];
}
}
|
{
"content_hash": "cd92511525a1ab2e4203f28c453c273f",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 57,
"avg_line_length": 16.13888888888889,
"alnum_prop": 0.5920826161790017,
"repo_name": "vestd/ProcessMonitor",
"id": "efdeffc478749cf2d2c95f06d143e20cd5f70233",
"size": "581",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/Events/PingFailure.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "412"
},
{
"name": "CSS",
"bytes": "11183"
},
{
"name": "JavaScript",
"bytes": "55932"
},
{
"name": "PHP",
"bytes": "127822"
},
{
"name": "Shell",
"bytes": "364"
}
],
"symlink_target": ""
}
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("8.IsoscelesTriangle")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("8.IsoscelesTriangle")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("a6dc6cbf-8a30-44d2-9eb2-fba96ea5a2fe")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
|
{
"content_hash": "d4ed269924d748de6c278a2022e3a2e7",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 84,
"avg_line_length": 39.19444444444444,
"alnum_prop": 0.7462792345854005,
"repo_name": "aliv59git/C-1N_HomeAndExam",
"id": "0446a6e44cc8bcf052d308406ede3abf79e1a1e7",
"size": "1414",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "CSharp1_Home2/8.IsoscelesTriangle/Properties/AssemblyInfo.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "291240"
}
],
"symlink_target": ""
}
|
module VagrantPlugins
module Ohai
class Config < Vagrant.plugin(2, :config)
attr_accessor :enable
attr_accessor :primary_nic
attr_accessor :plugins_dir
def initialize
@enable = UNSET_VALUE
@primary_nic = UNSET_VALUE
@plugins_dir = UNSET_VALUE
end
def finalize!
@enable = true if @enable == UNSET_VALUE
@primary_nic = nil if @primary_nic == UNSET_VALUE
@plugins_dir = nil if @plugins_dir == UNSET_VALUE
end
def validate(machine)
case @primary_nic
when /eth[0-9]+/
{}
when nil
{}
else
{"primary_nic" => ["primary_nic must match eth[0-9]+"]}
end
case @enable
when TrueClass, FalseClass
{}
else
{"enable" => ["enable must be true or false"] }
end
case @plugins_dir
when nil
{}
else
if !File.directory?(@plugins_dir.to_s) or @plugins_dir.to_s !~ /^\//
{"plugins_dir" => ["plugins_dir must be an absolute path to a folder"]}
else
{}
end
end
end
end
end
end
|
{
"content_hash": "2d0b895684fe8243accaaa4467f7e028",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 83,
"avg_line_length": 24.833333333333332,
"alnum_prop": 0.5067114093959731,
"repo_name": "avishai-ish-shalom/vagrant-ohai",
"id": "e5c673f98e2c5813b7453b8fc2403a844e398f37",
"size": "1192",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/vagrant-ohai/config.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "9133"
}
],
"symlink_target": ""
}
|
<?php
namespace lukniewiara\BlogBundle\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class PostControllerTest extends WebTestCase
{
/*
public function testCompleteScenario()
{
// Create a new client to browse the application
$client = static::createClient();
// Create a new entry in the database
$crawler = $client->request('GET', '/admin/post/');
$this->assertEquals(200, $client->getResponse()->getStatusCode(), "Unexpected HTTP status code for GET /admin/post/");
$crawler = $client->click($crawler->selectLink('Create a new entry')->link());
// Fill in the form and submit it
$form = $crawler->selectButton('Create')->form(array(
'lukniewiara_blogbundle_posttype[field_name]' => 'Test',
// ... other fields to fill
));
$client->submit($form);
$crawler = $client->followRedirect();
// Check data in the show view
$this->assertGreaterThan(0, $crawler->filter('td:contains("Test")')->count(), 'Missing element td:contains("Test")');
// Edit the entity
$crawler = $client->click($crawler->selectLink('Edit')->link());
$form = $crawler->selectButton('Edit')->form(array(
'lukniewiara_blogbundle_posttype[field_name]' => 'Foo',
// ... other fields to fill
));
$client->submit($form);
$crawler = $client->followRedirect();
// Check the element contains an attribute with value equals "Foo"
$this->assertGreaterThan(0, $crawler->filter('[value="Foo"]')->count(), 'Missing element [value="Foo"]');
// Delete the entity
$client->submit($crawler->selectButton('Delete')->form());
$crawler = $client->followRedirect();
// Check the entity has been delete on the list
$this->assertNotRegExp('/Foo/', $client->getResponse()->getContent());
}
*/
}
|
{
"content_hash": "4053b496a2d200bc957596e3ce565e84",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 126,
"avg_line_length": 35.54545454545455,
"alnum_prop": 0.6056265984654732,
"repo_name": "lukniewiara/Kurs-PHP",
"id": "cc3f4836e8ac536f5744614b48993c99d6fa62be",
"size": "1955",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/lukniewiara/BlogBundle/Tests/Controller/PostControllerTest.php",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
}
|
package org.apache.hadoop.hive.ql.exec.repl.ranger;
import java.util.LinkedHashMap;
import java.util.Map;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
/**
* RangerExportPolicyList class to extends RangerPolicyList class.
*/
@JsonAutoDetect(getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE,
fieldVisibility = Visibility.ANY)
@JsonInclude(Include.NON_NULL)
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
public class RangerExportPolicyList extends RangerPolicyList implements java.io.Serializable {
private static final long serialVersionUID = 1L;
private Map<String, Object> metaDataInfo = new LinkedHashMap<String, Object>();
public Map<String, Object> getMetaDataInfo() {
return metaDataInfo;
}
public void setMetaDataInfo(Map<String, Object> metaDataInfo) {
this.metaDataInfo = metaDataInfo;
}
}
|
{
"content_hash": "3bb110c1e7bae96f167137c7a19983a9",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 94,
"avg_line_length": 30.1,
"alnum_prop": 0.8056478405315615,
"repo_name": "lirui-apache/hive",
"id": "8f6229708e140d8bdfe80c3e8af370853c60ea92",
"size": "2009",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ranger/RangerExportPolicyList.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "54376"
},
{
"name": "Batchfile",
"bytes": "845"
},
{
"name": "C",
"bytes": "28218"
},
{
"name": "C++",
"bytes": "45308"
},
{
"name": "CSS",
"bytes": "5157"
},
{
"name": "GAP",
"bytes": "179818"
},
{
"name": "HTML",
"bytes": "58711"
},
{
"name": "HiveQL",
"bytes": "7568849"
},
{
"name": "Java",
"bytes": "52828789"
},
{
"name": "JavaScript",
"bytes": "43855"
},
{
"name": "M4",
"bytes": "2276"
},
{
"name": "PHP",
"bytes": "148097"
},
{
"name": "PLSQL",
"bytes": "5261"
},
{
"name": "PLpgSQL",
"bytes": "302587"
},
{
"name": "Perl",
"bytes": "319842"
},
{
"name": "PigLatin",
"bytes": "12333"
},
{
"name": "Python",
"bytes": "408633"
},
{
"name": "Roff",
"bytes": "5379"
},
{
"name": "SQLPL",
"bytes": "409"
},
{
"name": "Shell",
"bytes": "299497"
},
{
"name": "TSQL",
"bytes": "2556735"
},
{
"name": "Thrift",
"bytes": "144783"
},
{
"name": "XSLT",
"bytes": "20199"
},
{
"name": "q",
"bytes": "320552"
}
],
"symlink_target": ""
}
|
package com.bustiblelemons.cthulhator.character.skills.ui;
import android.os.Bundle;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import com.bustiblelemons.cthulhator.R;
import com.bustiblelemons.cthulhator.character.creation.ui.AbsCharacterCreationActivity;
import com.bustiblelemons.cthulhator.character.persistance.CharacterWrapper;
import com.bustiblelemons.cthulhator.character.skills.logic.OnSaveSkills;
import com.bustiblelemons.cthulhator.character.skills.logic.OnSkillPointsPoolChanged;
import com.bustiblelemons.cthulhator.character.skills.model.SkillsPackage;
import com.bustiblelemons.cthulhator.system.properties.CharacterProperty;
import java.util.Collection;
import butterknife.ButterKnife;
import butterknife.InjectView;
import butterknife.OnClick;
import butterknife.Optional;
/**
* Created by bhm on 31.08.14.
*/
public class SkillsChooserActivity extends AbsCharacterCreationActivity
implements OnSkillPointsPoolChanged,
OnSaveSkills {
public static final int REQUEST_CODE = 6;
@InjectView(R.id.header)
Toolbar mToolbar;
private CharacterWrapper mSavedCharacter;
private SkillsListFragment mSkillEditorFragment;
private String mPoolPrefix = "";
private int mPointsAvailable;
@Optional
@InjectView(android.R.id.list)
RecyclerView mRecyclerView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_skill_chooser);
ButterKnife.inject(this);
if (mRecyclerView != null) {
mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
}
if (mToolbar != null) {
setSupportActionBar(mToolbar);
}
mSavedCharacter = getInstanceArgument();
attachSkillEditor();
}
private void attachSkillEditor() {
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
SkillsPackage skillsPackage = getSkillsPackage();
mSkillEditorFragment = SkillsListFragment.newInstance(skillsPackage);
transaction.replace(R.id.skill_editor_frame, mSkillEditorFragment, SkillsListFragment.TAG);
transaction.setCustomAnimations(R.anim.slide_in_left, R.anim.slide_out_right,
R.anim.slide_in_left, R.anim.slide_out_right);
transaction.commit();
}
private SkillsPackage getSkillsPackage() {
SkillsPackage skillsPackage = new SkillsPackage();
skillsPackage.setData(mSavedCharacter.getSkills());
skillsPackage.setHobbyPoints(mSavedCharacter.getHobbyPoints());
skillsPackage.setCareerPoints(mSavedCharacter.getCareerPoints());
skillsPackage.setAvailableSkillPoints(mSavedCharacter.getSkillPointsAvailable());
return skillsPackage;
}
@Override
protected void onInstanceArgumentRead(CharacterWrapper arg) {
mSavedCharacter = arg;
}
@OnClick(R.id.done)
public void onDone() {
if (mSavedCharacter != null) {
if (mSkillEditorFragment != null) {
mSavedCharacter.setPropertyValues(mSkillEditorFragment.getSkills());
}
mSavedCharacter.setSkillPointsAvailable(mPointsAvailable);
}
setResult(RESULT_OK, mSavedCharacter);
onBackPressed();
}
private void detachSkillEditor() {
FragmentTransaction t = getSupportFragmentManager().beginTransaction();
t.setCustomAnimations(R.anim.slide_in_left, R.anim.slide_out_right,
R.anim.slide_in_left, R.anim.slide_out_right);
t.detach(mSkillEditorFragment).commitAllowingStateLoss();
}
@Override
public void onBackPressed() {
overridePendingTransition(R.anim.abc_slide_in_top, R.anim.abc_slide_out_bottom);
super.onBackPressed();
}
@Override
public void finish() {
super.finish();
overridePendingTransition(R.anim.abc_slide_in_bottom, R.anim.abc_slide_out_bottom);
}
@Override
public void onSaveSkills(Collection<CharacterProperty> skills) {
if (mSavedCharacter != null) {
mSavedCharacter.setPropertyValues(skills);
}
}
@Override
public void onSkillPointsPoolChanged(int pointsAvailable) {
if (mToolbar != null) {
mPointsAvailable = pointsAvailable;
mToolbar.setSubtitle(mPoolPrefix + mPointsAvailable);
}
}
}
|
{
"content_hash": "568cc906ff862bfd2eb32c43d40b1494",
"timestamp": "",
"source": "github",
"line_count": 131,
"max_line_length": 99,
"avg_line_length": 35.14503816793893,
"alnum_prop": 0.7130755864465682,
"repo_name": "bhm/Cthulhator",
"id": "5416e4e7e86b2c6ea86012fb4f2de4be7f4c1347",
"size": "4604",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "cthulhator/src/main/java/com/bustiblelemons/cthulhator/character/skills/ui/SkillsChooserActivity.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "1511868"
}
],
"symlink_target": ""
}
|
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("DynamicMenu.DataLayer.Tests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DynamicMenu.DataLayer.Tests")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("40f5e461-a102-4712-81ba-29a50f23fc40")]
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
|
{
"content_hash": "31ec1f93d82088d78bafb8fada6356ce",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 58,
"avg_line_length": 32.31578947368421,
"alnum_prop": 0.754071661237785,
"repo_name": "Micle257/Coding",
"id": "32138f268e3862b618c386ea8da6f102137cd88d",
"size": "879",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "DynamicMenu/DynamicMenu.Infrastructure.Tests/Properties/AssemblyInfo.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "53294"
},
{
"name": "CSS",
"bytes": "985"
},
{
"name": "JavaScript",
"bytes": "34"
}
],
"symlink_target": ""
}
|
/**
* UpdateSharedEntitiesRequest.java
* <p>
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
*/
package com.microsoft.bingads.v10.campaignmanagement;
public class UpdateSharedEntitiesRequest implements java.io.Serializable {
// Type metadata
private static org.apache.axis.description.TypeDesc typeDesc =
new org.apache.axis.description.TypeDesc(UpdateSharedEntitiesRequest.class, true);
static {
typeDesc.setXmlType(new javax.xml.namespace.QName("https://bingads.microsoft.com/CampaignManagement/v10", ">UpdateSharedEntitiesRequest"));
org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("sharedEntities");
elemField.setXmlName(new javax.xml.namespace.QName("https://bingads.microsoft.com/CampaignManagement/v10", "SharedEntities"));
elemField.setXmlType(new javax.xml.namespace.QName("https://bingads.microsoft.com/CampaignManagement/v10", "SharedEntity"));
elemField.setMinOccurs(0);
elemField.setNillable(true);
elemField.setItemQName(new javax.xml.namespace.QName("https://bingads.microsoft.com/CampaignManagement/v10", "SharedEntity"));
typeDesc.addFieldDesc(elemField);
}
private com.microsoft.bingads.v10.campaignmanagement.SharedEntity[] sharedEntities;
private java.lang.Object __equalsCalc = null;
private boolean __hashCodeCalc = false;
public UpdateSharedEntitiesRequest() {
}
public UpdateSharedEntitiesRequest(
com.microsoft.bingads.v10.campaignmanagement.SharedEntity[] sharedEntities) {
this.sharedEntities = sharedEntities;
}
/**
* Return type metadata object
*/
public static org.apache.axis.description.TypeDesc getTypeDesc() {
return typeDesc;
}
/**
* Get Custom Serializer
*/
public static org.apache.axis.encoding.Serializer getSerializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanSerializer(
_javaType, _xmlType, typeDesc);
}
/**
* Get Custom Deserializer
*/
public static org.apache.axis.encoding.Deserializer getDeserializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanDeserializer(
_javaType, _xmlType, typeDesc);
}
/**
* Gets the sharedEntities value for this UpdateSharedEntitiesRequest.
*
* @return sharedEntities
*/
public com.microsoft.bingads.v10.campaignmanagement.SharedEntity[] getSharedEntities() {
return sharedEntities;
}
/**
* Sets the sharedEntities value for this UpdateSharedEntitiesRequest.
*
* @param sharedEntities
*/
public void setSharedEntities(com.microsoft.bingads.v10.campaignmanagement.SharedEntity[] sharedEntities) {
this.sharedEntities = sharedEntities;
}
public synchronized boolean equals(java.lang.Object obj) {
if (!(obj instanceof UpdateSharedEntitiesRequest)) return false;
UpdateSharedEntitiesRequest other = (UpdateSharedEntitiesRequest) obj;
if (obj == null) return false;
if (this == obj) return true;
if (__equalsCalc != null) {
return (__equalsCalc == obj);
}
__equalsCalc = obj;
boolean _equals;
_equals = true &&
((this.sharedEntities == null && other.getSharedEntities() == null) ||
(this.sharedEntities != null &&
java.util.Arrays.equals(this.sharedEntities, other.getSharedEntities())));
__equalsCalc = null;
return _equals;
}
public synchronized int hashCode() {
if (__hashCodeCalc) {
return 0;
}
__hashCodeCalc = true;
int _hashCode = 1;
if (getSharedEntities() != null) {
for (int i = 0;
i < java.lang.reflect.Array.getLength(getSharedEntities());
i++) {
java.lang.Object obj = java.lang.reflect.Array.get(getSharedEntities(), i);
if (obj != null &&
!obj.getClass().isArray()) {
_hashCode += obj.hashCode();
}
}
}
__hashCodeCalc = false;
return _hashCode;
}
}
|
{
"content_hash": "4c1eb84511eddb336e71c692955fadd9",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 143,
"avg_line_length": 33.98425196850393,
"alnum_prop": 0.6770157553290084,
"repo_name": "feedeo/bingads-api",
"id": "33ca59714c8d18dad7fd9dc421f6fb08aa156ef6",
"size": "4316",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/com/microsoft/bingads/v10/campaignmanagement/UpdateSharedEntitiesRequest.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "4732706"
}
],
"symlink_target": ""
}
|
require 'eventful_api'
require 'json'
def get_eventful_client
@client ||= EventfulApi::Client.new oauth_token: 'token', oauth_secret: 'token secret'
end
def get_categories
@categories ||= get_categories2
end
def get_events q
res = get_eventful_client.get '/events/search', q
res['events']['event'] if res['events']
end
def get_event_by_id id
res = get_eventful_client.get '/events/get', id: id
end
private
def get_categories2
cs = get_eventful_client.get '/categories/list', {}
res = {}
cs['category'].each do |h|
res[h['name']] = h['id']
end
res
end
|
{
"content_hash": "8d84862f6efd7a3c36dcad4e5f21107d",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 88,
"avg_line_length": 18.774193548387096,
"alnum_prop": 0.6718213058419243,
"repo_name": "gisborne/mashup",
"id": "45c4bfb23df942c896b034d024c4e443f24ea8f8",
"size": "582",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "config/initializers/events.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "15164"
},
{
"name": "CoffeeScript",
"bytes": "211"
},
{
"name": "HTML",
"bytes": "23332"
},
{
"name": "JavaScript",
"bytes": "779"
},
{
"name": "Ruby",
"bytes": "52014"
}
],
"symlink_target": ""
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.