text
stringlengths 2
1.04M
| meta
dict |
|---|---|
from verta._swagger.base_type import BaseType
class UacDeleteUserResponse(BaseType):
def __init__(self, status=None):
required = {
"status": False,
}
self.status = status
for k, v in required.items():
if self[k] is None and v:
raise ValueError('attribute {} is required'.format(k))
@staticmethod
def from_json(d):
tmp = d.get('status', None)
if tmp is not None:
d['status'] = tmp
return UacDeleteUserResponse(**d)
|
{
"content_hash": "d35f6455aa57798fed2b9acb38ffed87",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 62,
"avg_line_length": 22,
"alnum_prop": 0.6177685950413223,
"repo_name": "mitdbg/modeldb",
"id": "8779b8e17aca2e049fc28126996cd40e9b2cd1bb",
"size": "527",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "client/verta/verta/_swagger/_public/uac/model/UacDeleteUserResponse.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "43352"
},
{
"name": "Dockerfile",
"bytes": "235"
},
{
"name": "HTML",
"bytes": "30924"
},
{
"name": "Java",
"bytes": "393927"
},
{
"name": "JavaScript",
"bytes": "1017682"
},
{
"name": "Python",
"bytes": "178774"
},
{
"name": "Scala",
"bytes": "251259"
},
{
"name": "Shell",
"bytes": "16870"
},
{
"name": "Thrift",
"bytes": "55683"
}
],
"symlink_target": ""
}
|
<?php
namespace oasis\names\specification\ubl\schema\xsd\CommonBasicComponents_2;
use un\unece\uncefact\data\specification\UnqualifiedDataTypesSchemaModule\_2;
/**
* @xmlNamespace urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2
* @xmlType TimeType
* @xmlName EndTimeType
* @var oasis\names\specification\ubl\schema\xsd\CommonBasicComponents_2\EndTimeType
*/
class EndTimeType extends _2\TimeType
{
} // end class EndTimeType
|
{
"content_hash": "f70e98e3b413d62fabf4e311d4d32f14",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 85,
"avg_line_length": 32.357142857142854,
"alnum_prop": 0.8035320088300221,
"repo_name": "intuit/QuickBooks-V3-PHP-SDK",
"id": "18e0ed26076aac760cde55fd8f4737c383b6f453",
"size": "453",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "src/XSD2PHP/test/data/expected/ContactCompany/oasis/names/specification/ubl/schema/xsd/CommonBasicComponents_2/EndTimeType.php",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "9685"
},
{
"name": "HTML",
"bytes": "586385"
},
{
"name": "PHP",
"bytes": "6194516"
},
{
"name": "Shell",
"bytes": "99"
},
{
"name": "XSLT",
"bytes": "12092"
}
],
"symlink_target": ""
}
|
from __future__ import absolute_import, unicode_literals
from django_services.api import DjangoServiceAPI, register
from .service.instance import InstanceService
from .service.databaseinfra import DatabaseInfraService
from .service.plan import PlanService
from .service.engine import EngineService, EngineTypeService
from .serializers import InstanceSerializer, DatabaseInfraSerializer, \
EngineSerializer, EngineTypeSerializer, PlanSerializer
class EngineTypeAPI(DjangoServiceAPI):
serializer_class = EngineTypeSerializer
service_class = EngineTypeService
class EngineAPI(DjangoServiceAPI):
serializer_class = EngineSerializer
service_class = EngineService
class PlanAPI(DjangoServiceAPI):
serializer_class = PlanSerializer
service_class = PlanService
class DatabaseInfraAPI(DjangoServiceAPI):
serializer_class = DatabaseInfraSerializer
service_class = DatabaseInfraService
operations = ('list', 'retrieve', 'create', 'update', 'destroy')
class InstanceAPI(DjangoServiceAPI):
serializer_class = InstanceSerializer
service_class = InstanceService
register('enginetype', EngineTypeAPI)
register('engine', EngineAPI)
register('plan', PlanAPI)
register('instance', InstanceAPI)
register('databaseinfra', DatabaseInfraAPI)
|
{
"content_hash": "58e473d945af3da932dbeef9579d2109",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 71,
"avg_line_length": 30.476190476190474,
"alnum_prop": 0.8,
"repo_name": "globocom/database-as-a-service",
"id": "959bf840fc97058d6a02b6f6ae195f35685f8a01",
"size": "1304",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "dbaas/physical/api.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "243568"
},
{
"name": "Dockerfile",
"bytes": "1372"
},
{
"name": "HTML",
"bytes": "310401"
},
{
"name": "JavaScript",
"bytes": "988830"
},
{
"name": "Makefile",
"bytes": "5199"
},
{
"name": "Python",
"bytes": "9674426"
},
{
"name": "Shell",
"bytes": "215115"
}
],
"symlink_target": ""
}
|
I ran out of podcasts, but there's a ton of great content on youtube that I could listen to.
Just need need to get them in a good audio only format in a parseable feed.
This is that project.
This service runs and generates a feed each time it's ran. To keep a feed up to date, run the script multiple days a day.
It will not redownload files if retrieved once before.
# Config.conf
This project relies on a configuration file. A sample is included with the project.
```
[youtube]
channel_ids=test_id,another_test_id, test_with_strip
[paths]
mp3_folder=downloads
deploy_path=./
url=http://localhost/
```
* ```channel_ids``` indicates the channel ids that channels that the service will fetch. A channel id can typically be found by going to a youtube channel's home page.
* ```mp3_folder``` indicates where the mp3 files should be downloaded to.
* ```deploy_path``` indicates where the feeds would be moved to. This project expects that the mp3_folder is a subdirectory to the ```deploy_path```
* ```url``` is the host of the files.
|
{
"content_hash": "58e2c079fad6aeada38bd3176bec2567",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 167,
"avg_line_length": 41.52,
"alnum_prop": 0.7475915221579962,
"repo_name": "Raytray/pyytcast",
"id": "9a2622ead40e603d2e14fef4c57ec7b480da5a71",
"size": "1050",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Readme.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "4707"
}
],
"symlink_target": ""
}
|
exports.definition = {
config : {
"columns" : {
name : 'TEXT',
nickname : 'TEXT', // column values can have types with keywords
fighterId : 'TEXT PRIMARY KEY'
},
"adapter" : {
"type" : "sql_new",
// The table name inside the sqlite database to use for
// models and collections based on this definition.
"collection_name" : "fighters",
// idAttribute tells Alloy/Backbone to use this column in
// my table as its unique identifier field. Without
// specifying this, Alloy's default behavior is to create
// and "alloy_id" field which will uniquely identify your
// rows in the table with a text GUID.
"idAttribute" : "fighterId"
}
},
extendModel : function(Model) {
_.extend(Model.prototype, {
});
// end extend
return Model;
},
extendCollection : function(Collection) {
_.extend(Collection.prototype, {
// extended functions go here
});
// end extend
return Collection;
}
}
|
{
"content_hash": "9b90f18367470af6509f9ab541089312",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 67,
"avg_line_length": 22.738095238095237,
"alnum_prop": 0.6544502617801047,
"repo_name": "aaronksaunders/ci.behave.test",
"id": "e0f990f163d78e52a926ab742357f1483e8f3002",
"size": "955",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/models/stuff.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "JavaScript",
"bytes": "38597"
},
{
"name": "Python",
"bytes": "4668"
}
],
"symlink_target": ""
}
|
module ClearCMS
class AssetsController < ClearCMS::ApplicationController
before_filter :authenticate_user!
skip_before_filter :verify_authenticity_token, :only=>[:email]
load_and_authorize_resource :class=>'ClearCMS::Asset'
def create
@clear_cms_site = ClearCMS::Site.find(params[:site_id])
if params[:asset][:image_url]
@clear_cms_asset = ClearCMS::Asset.new(:original_file_url=>ActiveSupport::Multibyte::Unicode.normalize(params[:asset][:image_url]),:path=>File.join([@clear_cms_site.slug,Time.now.strftime('%Y/%m/%d')]))
else
@clear_cms_asset = ClearCMS::Asset.new(:file=>params[:files][0],:path=>File.join([@clear_cms_site.slug,Time.now.strftime('%Y/%m/%d')]))
end
#@clear_cms_content_asset.content_logs.build(:user=>current_user, :entry=>"created")
respond_to do |format|
if @clear_cms_asset.save
if params[:asset][:image_url]
format.json {render json: @clear_cms_asset, status: :created, location: clear_cms.site_asset_url(@clear_cms_site,@clear_cms_asset) }
else
#format.html { redirect_to([:edit, @clear_cms_content], notice: 'Content was successfully created.')}
format.json { render json: "{\"files\": [#{@clear_cms_asset.uploader_json}]}", status: :created, location: clear_cms.site_asset_url(@clear_cms_site,@clear_cms_asset)}
end
else
#format.html { render action: "new" }
format.json { render json: @clear_cms_asset.errors, status: :unprocessable_entity }
end
end
end
def show
@clear_cms_asset=ClearCMS::Asset.find(params[:id])
respond_to do |format|
format.json { render json: @clear_cms_asset}
end
end
def resize
end
# {"files": [
# {
# "name": "picture1.jpg",
# "size": 902604,
# "url": "http:\/\/example.org\/files\/picture1.jpg",
# "thumbnail_url": "http:\/\/example.org\/files\/thumbnail\/picture1.jpg",
# "delete_url": "http:\/\/example.org\/files\/picture1.jpg",
# "delete_type": "DELETE"
# },
# {
# "name": "picture2.jpg",
# "size": 841946,
# "url": "http:\/\/example.org\/files\/picture2.jpg",
# "thumbnail_url": "http:\/\/example.org\/files\/thumbnail\/picture2.jpg",
# "delete_url": "http:\/\/example.org\/files\/picture2.jpg",
# "delete_type": "DELETE"
# }
# ]}
# def index
# if params[:q]
# @clear_cms_contents=current_site.contents.includes(:site).search {fulltext params[:q]; paginate page: params[:page]; with :site_id, current_site.id}.results
# else
# #@clear_cms_contents=current_site.contents.where("content_blocks.body"=>/#{Regexp.escape(params[:search]||'')}/i).desc(:updated_at).page(params[:page])
# @clear_cms_contents=current_site.contents.includes(:site).desc(:updated_at).page(params[:page])
# end
# end
#
# def show
# @content=Content.find(params[:id])
# end
#
# def new
# @clear_cms_content = ClearCMS::Content.new
# # @clear_cms_content.content_notes.build
# # @clear_cms_content.content_blocks.build
# @clear_cms_content.source='web'
# @clear_cms_content.content_blocks.build
#
# respond_to do |format|
# format.html # new.html.erb
# format.json { render json: @clear_cms_content }
# end
# end
#
# def edit
# @clear_cms_content=Content.find(params[:id])
# # @clear_cms_content.content_notes.build
# # @clear_cms_content.content_notes.build
# # @clear_cms_content.content_blocks.build
# end
#
# def update
# @clear_cms_content=Content.find(params[:id])
#
# @clear_cms_content.content_logs.build(:user=>current_user, :entry=>"edited")
#
# if @clear_cms_content.update_attributes(params[:clear_cms_content])
# redirect_to({:action=>:edit}, notice: 'Content was successfully updated.')
# else
# flash.now[:notice]='Error saving content!'
# render :action=>:edit
# end
# end
end
end
|
{
"content_hash": "63b40577cc116142902215089b8ea038",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 210,
"avg_line_length": 33.27049180327869,
"alnum_prop": 0.6109879280610988,
"repo_name": "captain-lucas/clear_cms",
"id": "192488fd09883dea88d7532f0950b1c2eccc8c86",
"size": "4059",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/controllers/clear_cms/assets_controller.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "18421"
},
{
"name": "CoffeeScript",
"bytes": "1716"
},
{
"name": "JavaScript",
"bytes": "21484"
},
{
"name": "Ruby",
"bytes": "114001"
}
],
"symlink_target": ""
}
|
using Microsoft::WRL::ComPtr;
using namespace DirectX;
using namespace DirectX::LoaderHelpers;
namespace
{
//--------------------------------------------------------------------------------------
HRESULT CaptureTexture(
_In_ ID3D11DeviceContext* pContext,
_In_ ID3D11Resource* pSource,
D3D11_TEXTURE2D_DESC& desc,
ComPtr<ID3D11Texture2D>& pStaging)
{
if (!pContext || !pSource)
return E_INVALIDARG;
D3D11_RESOURCE_DIMENSION resType = D3D11_RESOURCE_DIMENSION_UNKNOWN;
pSource->GetType(&resType);
if (resType != D3D11_RESOURCE_DIMENSION_TEXTURE2D)
{
DebugTrace("ERROR: ScreenGrab does not support 1D or volume textures. Consider using DirectXTex instead.\n");
return HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED);
}
ComPtr<ID3D11Texture2D> pTexture;
HRESULT hr = pSource->QueryInterface(IID_GRAPHICS_PPV_ARGS(pTexture.GetAddressOf()));
if (FAILED(hr))
return hr;
assert(pTexture);
pTexture->GetDesc(&desc);
if (desc.ArraySize > 1 || desc.MipLevels > 1)
{
DebugTrace("WARNING: ScreenGrab does not support 2D arrays, cubemaps, or mipmaps; only the first surface is written. Consider using DirectXTex instead.\n");
}
ComPtr<ID3D11Device> d3dDevice;
pContext->GetDevice(d3dDevice.GetAddressOf());
if (desc.SampleDesc.Count > 1)
{
// MSAA content must be resolved before being copied to a staging texture
desc.SampleDesc.Count = 1;
desc.SampleDesc.Quality = 0;
ComPtr<ID3D11Texture2D> pTemp;
hr = d3dDevice->CreateTexture2D(&desc, nullptr, pTemp.GetAddressOf());
if (FAILED(hr))
return hr;
assert(pTemp);
DXGI_FORMAT fmt = EnsureNotTypeless(desc.Format);
UINT support = 0;
hr = d3dDevice->CheckFormatSupport(fmt, &support);
if (FAILED(hr))
return hr;
if (!(support & D3D11_FORMAT_SUPPORT_MULTISAMPLE_RESOLVE))
return E_FAIL;
for (UINT item = 0; item < desc.ArraySize; ++item)
{
for (UINT level = 0; level < desc.MipLevels; ++level)
{
UINT index = D3D11CalcSubresource(level, item, desc.MipLevels);
pContext->ResolveSubresource(pTemp.Get(), index, pSource, index, fmt);
}
}
desc.BindFlags = 0;
desc.MiscFlags &= D3D11_RESOURCE_MISC_TEXTURECUBE;
desc.CPUAccessFlags = D3D11_CPU_ACCESS_READ;
desc.Usage = D3D11_USAGE_STAGING;
hr = d3dDevice->CreateTexture2D(&desc, nullptr, pStaging.ReleaseAndGetAddressOf());
if (FAILED(hr))
return hr;
assert(pStaging);
pContext->CopyResource(pStaging.Get(), pTemp.Get());
}
else if ((desc.Usage == D3D11_USAGE_STAGING) && (desc.CPUAccessFlags & D3D11_CPU_ACCESS_READ))
{
// Handle case where the source is already a staging texture we can use directly
pStaging = pTexture;
}
else
{
// Otherwise, create a staging texture from the non-MSAA source
desc.BindFlags = 0;
desc.MiscFlags &= D3D11_RESOURCE_MISC_TEXTURECUBE;
desc.CPUAccessFlags = D3D11_CPU_ACCESS_READ;
desc.Usage = D3D11_USAGE_STAGING;
hr = d3dDevice->CreateTexture2D(&desc, nullptr, pStaging.ReleaseAndGetAddressOf());
if (FAILED(hr))
return hr;
assert(pStaging);
pContext->CopyResource(pStaging.Get(), pSource);
}
#if defined(_XBOX_ONE) && defined(_TITLE)
if (d3dDevice->GetCreationFlags() & D3D11_CREATE_DEVICE_IMMEDIATE_CONTEXT_FAST_SEMANTICS)
{
ComPtr<ID3D11DeviceX> d3dDeviceX;
hr = d3dDevice.As(&d3dDeviceX);
if (FAILED(hr))
return hr;
ComPtr<ID3D11DeviceContextX> d3dContextX;
hr = pContext->QueryInterface(IID_GRAPHICS_PPV_ARGS(d3dContextX.GetAddressOf()));
if (FAILED(hr))
return hr;
UINT64 copyFence = d3dContextX->InsertFence(0);
while (d3dDeviceX->IsFencePending(copyFence))
{
SwitchToThread();
}
}
#endif
return S_OK;
}
} // anonymous namespace
//--------------------------------------------------------------------------------------
_Use_decl_annotations_
HRESULT DirectX::SaveDDSTextureToFile(
ID3D11DeviceContext* pContext,
ID3D11Resource* pSource,
const wchar_t* fileName)
{
if (!fileName)
return E_INVALIDARG;
D3D11_TEXTURE2D_DESC desc = {};
ComPtr<ID3D11Texture2D> pStaging;
HRESULT hr = CaptureTexture(pContext, pSource, desc, pStaging);
if (FAILED(hr))
return hr;
// Create file
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
ScopedHandle hFile(safe_handle(CreateFile2(fileName, GENERIC_WRITE | DELETE, 0, CREATE_ALWAYS, nullptr)));
#else
ScopedHandle hFile(safe_handle(CreateFileW(fileName, GENERIC_WRITE | DELETE, 0, nullptr, CREATE_ALWAYS, 0, nullptr)));
#endif
if (!hFile)
return HRESULT_FROM_WIN32(GetLastError());
auto_delete_file delonfail(hFile.get());
// Setup header
const size_t MAX_HEADER_SIZE = sizeof(uint32_t) + sizeof(DDS_HEADER) + sizeof(DDS_HEADER_DXT10);
uint8_t fileHeader[MAX_HEADER_SIZE];
*reinterpret_cast<uint32_t*>(&fileHeader[0]) = DDS_MAGIC;
auto header = reinterpret_cast<DDS_HEADER*>(&fileHeader[0] + sizeof(uint32_t));
size_t headerSize = sizeof(uint32_t) + sizeof(DDS_HEADER);
memset(header, 0, sizeof(DDS_HEADER));
header->size = sizeof(DDS_HEADER);
header->flags = DDS_HEADER_FLAGS_TEXTURE | DDS_HEADER_FLAGS_MIPMAP;
header->height = desc.Height;
header->width = desc.Width;
header->mipMapCount = 1;
header->caps = DDS_SURFACE_FLAGS_TEXTURE;
// Try to use a legacy .DDS pixel format for better tools support, otherwise fallback to 'DX10' header extension
DDS_HEADER_DXT10* extHeader = nullptr;
switch (desc.Format)
{
case DXGI_FORMAT_R8G8B8A8_UNORM: memcpy_s(&header->ddspf, sizeof(header->ddspf), &DDSPF_A8B8G8R8, sizeof(DDS_PIXELFORMAT)); break;
case DXGI_FORMAT_R16G16_UNORM: memcpy_s(&header->ddspf, sizeof(header->ddspf), &DDSPF_G16R16, sizeof(DDS_PIXELFORMAT)); break;
case DXGI_FORMAT_R8G8_UNORM: memcpy_s(&header->ddspf, sizeof(header->ddspf), &DDSPF_A8L8, sizeof(DDS_PIXELFORMAT)); break;
case DXGI_FORMAT_R16_UNORM: memcpy_s(&header->ddspf, sizeof(header->ddspf), &DDSPF_L16, sizeof(DDS_PIXELFORMAT)); break;
case DXGI_FORMAT_R8_UNORM: memcpy_s(&header->ddspf, sizeof(header->ddspf), &DDSPF_L8, sizeof(DDS_PIXELFORMAT)); break;
case DXGI_FORMAT_A8_UNORM: memcpy_s(&header->ddspf, sizeof(header->ddspf), &DDSPF_A8, sizeof(DDS_PIXELFORMAT)); break;
case DXGI_FORMAT_R8G8_B8G8_UNORM: memcpy_s(&header->ddspf, sizeof(header->ddspf), &DDSPF_R8G8_B8G8, sizeof(DDS_PIXELFORMAT)); break;
case DXGI_FORMAT_G8R8_G8B8_UNORM: memcpy_s(&header->ddspf, sizeof(header->ddspf), &DDSPF_G8R8_G8B8, sizeof(DDS_PIXELFORMAT)); break;
case DXGI_FORMAT_BC1_UNORM: memcpy_s(&header->ddspf, sizeof(header->ddspf), &DDSPF_DXT1, sizeof(DDS_PIXELFORMAT)); break;
case DXGI_FORMAT_BC2_UNORM: memcpy_s(&header->ddspf, sizeof(header->ddspf), &DDSPF_DXT3, sizeof(DDS_PIXELFORMAT)); break;
case DXGI_FORMAT_BC3_UNORM: memcpy_s(&header->ddspf, sizeof(header->ddspf), &DDSPF_DXT5, sizeof(DDS_PIXELFORMAT)); break;
case DXGI_FORMAT_BC4_UNORM: memcpy_s(&header->ddspf, sizeof(header->ddspf), &DDSPF_BC4_UNORM, sizeof(DDS_PIXELFORMAT)); break;
case DXGI_FORMAT_BC4_SNORM: memcpy_s(&header->ddspf, sizeof(header->ddspf), &DDSPF_BC4_SNORM, sizeof(DDS_PIXELFORMAT)); break;
case DXGI_FORMAT_BC5_UNORM: memcpy_s(&header->ddspf, sizeof(header->ddspf), &DDSPF_BC5_UNORM, sizeof(DDS_PIXELFORMAT)); break;
case DXGI_FORMAT_BC5_SNORM: memcpy_s(&header->ddspf, sizeof(header->ddspf), &DDSPF_BC5_SNORM, sizeof(DDS_PIXELFORMAT)); break;
case DXGI_FORMAT_B5G6R5_UNORM: memcpy_s(&header->ddspf, sizeof(header->ddspf), &DDSPF_R5G6B5, sizeof(DDS_PIXELFORMAT)); break;
case DXGI_FORMAT_B5G5R5A1_UNORM: memcpy_s(&header->ddspf, sizeof(header->ddspf), &DDSPF_A1R5G5B5, sizeof(DDS_PIXELFORMAT)); break;
case DXGI_FORMAT_R8G8_SNORM: memcpy_s(&header->ddspf, sizeof(header->ddspf), &DDSPF_V8U8, sizeof(DDS_PIXELFORMAT)); break;
case DXGI_FORMAT_R8G8B8A8_SNORM: memcpy_s(&header->ddspf, sizeof(header->ddspf), &DDSPF_Q8W8V8U8, sizeof(DDS_PIXELFORMAT)); break;
case DXGI_FORMAT_R16G16_SNORM: memcpy_s(&header->ddspf, sizeof(header->ddspf), &DDSPF_V16U16, sizeof(DDS_PIXELFORMAT)); break;
case DXGI_FORMAT_B8G8R8A8_UNORM: memcpy_s(&header->ddspf, sizeof(header->ddspf), &DDSPF_A8R8G8B8, sizeof(DDS_PIXELFORMAT)); break; // DXGI 1.1
case DXGI_FORMAT_B8G8R8X8_UNORM: memcpy_s(&header->ddspf, sizeof(header->ddspf), &DDSPF_X8R8G8B8, sizeof(DDS_PIXELFORMAT)); break; // DXGI 1.1
case DXGI_FORMAT_YUY2: memcpy_s(&header->ddspf, sizeof(header->ddspf), &DDSPF_YUY2, sizeof(DDS_PIXELFORMAT)); break; // DXGI 1.2
case DXGI_FORMAT_B4G4R4A4_UNORM: memcpy_s(&header->ddspf, sizeof(header->ddspf), &DDSPF_A4R4G4B4, sizeof(DDS_PIXELFORMAT)); break; // DXGI 1.2
// Legacy D3DX formats using D3DFMT enum value as FourCC
case DXGI_FORMAT_R32G32B32A32_FLOAT: header->ddspf.size = sizeof(DDS_PIXELFORMAT); header->ddspf.flags = DDS_FOURCC; header->ddspf.fourCC = 116; break; // D3DFMT_A32B32G32R32F
case DXGI_FORMAT_R16G16B16A16_FLOAT: header->ddspf.size = sizeof(DDS_PIXELFORMAT); header->ddspf.flags = DDS_FOURCC; header->ddspf.fourCC = 113; break; // D3DFMT_A16B16G16R16F
case DXGI_FORMAT_R16G16B16A16_UNORM: header->ddspf.size = sizeof(DDS_PIXELFORMAT); header->ddspf.flags = DDS_FOURCC; header->ddspf.fourCC = 36; break; // D3DFMT_A16B16G16R16
case DXGI_FORMAT_R16G16B16A16_SNORM: header->ddspf.size = sizeof(DDS_PIXELFORMAT); header->ddspf.flags = DDS_FOURCC; header->ddspf.fourCC = 110; break; // D3DFMT_Q16W16V16U16
case DXGI_FORMAT_R32G32_FLOAT: header->ddspf.size = sizeof(DDS_PIXELFORMAT); header->ddspf.flags = DDS_FOURCC; header->ddspf.fourCC = 115; break; // D3DFMT_G32R32F
case DXGI_FORMAT_R16G16_FLOAT: header->ddspf.size = sizeof(DDS_PIXELFORMAT); header->ddspf.flags = DDS_FOURCC; header->ddspf.fourCC = 112; break; // D3DFMT_G16R16F
case DXGI_FORMAT_R32_FLOAT: header->ddspf.size = sizeof(DDS_PIXELFORMAT); header->ddspf.flags = DDS_FOURCC; header->ddspf.fourCC = 114; break; // D3DFMT_R32F
case DXGI_FORMAT_R16_FLOAT: header->ddspf.size = sizeof(DDS_PIXELFORMAT); header->ddspf.flags = DDS_FOURCC; header->ddspf.fourCC = 111; break; // D3DFMT_R16F
case DXGI_FORMAT_AI44:
case DXGI_FORMAT_IA44:
case DXGI_FORMAT_P8:
case DXGI_FORMAT_A8P8:
DebugTrace("ERROR: ScreenGrab does not support video textures. Consider using DirectXTex.\n");
return HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED);
default:
memcpy_s(&header->ddspf, sizeof(header->ddspf), &DDSPF_DX10, sizeof(DDS_PIXELFORMAT));
headerSize += sizeof(DDS_HEADER_DXT10);
extHeader = reinterpret_cast<DDS_HEADER_DXT10*>(fileHeader + sizeof(uint32_t) + sizeof(DDS_HEADER));
memset(extHeader, 0, sizeof(DDS_HEADER_DXT10));
extHeader->dxgiFormat = desc.Format;
extHeader->resourceDimension = D3D11_RESOURCE_DIMENSION_TEXTURE2D;
extHeader->arraySize = 1;
break;
}
size_t rowPitch, slicePitch, rowCount;
hr = GetSurfaceInfo(desc.Width, desc.Height, desc.Format, &slicePitch, &rowPitch, &rowCount);
if (FAILED(hr))
return hr;
if (rowPitch > UINT32_MAX || slicePitch > UINT32_MAX)
return HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW);
if (IsCompressed(desc.Format))
{
header->flags |= DDS_HEADER_FLAGS_LINEARSIZE;
header->pitchOrLinearSize = static_cast<uint32_t>(slicePitch);
}
else
{
header->flags |= DDS_HEADER_FLAGS_PITCH;
header->pitchOrLinearSize = static_cast<uint32_t>(rowPitch);
}
// Setup pixels
std::unique_ptr<uint8_t[]> pixels(new (std::nothrow) uint8_t[slicePitch]);
if (!pixels)
return E_OUTOFMEMORY;
D3D11_MAPPED_SUBRESOURCE mapped;
hr = pContext->Map(pStaging.Get(), 0, D3D11_MAP_READ, 0, &mapped);
if (FAILED(hr))
return hr;
auto sptr = static_cast<const uint8_t*>(mapped.pData);
if (!sptr)
{
pContext->Unmap(pStaging.Get(), 0);
return E_POINTER;
}
uint8_t* dptr = pixels.get();
size_t msize = std::min<size_t>(rowPitch, mapped.RowPitch);
for (size_t h = 0; h < rowCount; ++h)
{
memcpy_s(dptr, rowPitch, sptr, msize);
sptr += mapped.RowPitch;
dptr += rowPitch;
}
pContext->Unmap(pStaging.Get(), 0);
// Write header & pixels
DWORD bytesWritten;
if (!WriteFile(hFile.get(), fileHeader, static_cast<DWORD>(headerSize), &bytesWritten, nullptr))
return HRESULT_FROM_WIN32(GetLastError());
if (bytesWritten != headerSize)
return E_FAIL;
if (!WriteFile(hFile.get(), pixels.get(), static_cast<DWORD>(slicePitch), &bytesWritten, nullptr))
return HRESULT_FROM_WIN32(GetLastError());
if (bytesWritten != slicePitch)
return E_FAIL;
delonfail.clear();
return S_OK;
}
//--------------------------------------------------------------------------------------
namespace DirectX
{
extern bool _IsWIC2();
extern IWICImagingFactory* _GetWIC();
}
_Use_decl_annotations_
HRESULT DirectX::SaveWICTextureToFile(
ID3D11DeviceContext* pContext,
ID3D11Resource* pSource,
REFGUID guidContainerFormat,
const wchar_t* fileName,
const GUID* targetFormat,
std::function<void(IPropertyBag2*)> setCustomProps)
{
if (!fileName)
return E_INVALIDARG;
D3D11_TEXTURE2D_DESC desc = {};
ComPtr<ID3D11Texture2D> pStaging;
HRESULT hr = CaptureTexture(pContext, pSource, desc, pStaging);
if (FAILED(hr))
return hr;
// Determine source format's WIC equivalent
WICPixelFormatGUID pfGuid;
bool sRGB = false;
switch (desc.Format)
{
case DXGI_FORMAT_R32G32B32A32_FLOAT: pfGuid = GUID_WICPixelFormat128bppRGBAFloat; break;
case DXGI_FORMAT_R16G16B16A16_FLOAT: pfGuid = GUID_WICPixelFormat64bppRGBAHalf; break;
case DXGI_FORMAT_R16G16B16A16_UNORM: pfGuid = GUID_WICPixelFormat64bppRGBA; break;
case DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM: pfGuid = GUID_WICPixelFormat32bppRGBA1010102XR; break; // DXGI 1.1
case DXGI_FORMAT_R10G10B10A2_UNORM: pfGuid = GUID_WICPixelFormat32bppRGBA1010102; break;
case DXGI_FORMAT_B5G5R5A1_UNORM: pfGuid = GUID_WICPixelFormat16bppBGRA5551; break;
case DXGI_FORMAT_B5G6R5_UNORM: pfGuid = GUID_WICPixelFormat16bppBGR565; break;
case DXGI_FORMAT_R32_FLOAT: pfGuid = GUID_WICPixelFormat32bppGrayFloat; break;
case DXGI_FORMAT_R16_FLOAT: pfGuid = GUID_WICPixelFormat16bppGrayHalf; break;
case DXGI_FORMAT_R16_UNORM: pfGuid = GUID_WICPixelFormat16bppGray; break;
case DXGI_FORMAT_R8_UNORM: pfGuid = GUID_WICPixelFormat8bppGray; break;
case DXGI_FORMAT_A8_UNORM: pfGuid = GUID_WICPixelFormat8bppAlpha; break;
case DXGI_FORMAT_R8G8B8A8_UNORM:
pfGuid = GUID_WICPixelFormat32bppRGBA;
break;
case DXGI_FORMAT_R8G8B8A8_UNORM_SRGB:
pfGuid = GUID_WICPixelFormat32bppRGBA;
sRGB = true;
break;
case DXGI_FORMAT_B8G8R8A8_UNORM: // DXGI 1.1
pfGuid = GUID_WICPixelFormat32bppBGRA;
break;
case DXGI_FORMAT_B8G8R8A8_UNORM_SRGB: // DXGI 1.1
pfGuid = GUID_WICPixelFormat32bppBGRA;
sRGB = true;
break;
case DXGI_FORMAT_B8G8R8X8_UNORM: // DXGI 1.1
pfGuid = GUID_WICPixelFormat32bppBGR;
break;
case DXGI_FORMAT_B8G8R8X8_UNORM_SRGB: // DXGI 1.1
pfGuid = GUID_WICPixelFormat32bppBGR;
sRGB = true;
break;
default:
DebugTrace("ERROR: ScreenGrab does not support all DXGI formats (%u). Consider using DirectXTex.\n", static_cast<uint32_t>(desc.Format));
return HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED);
}
auto pWIC = _GetWIC();
if (!pWIC)
return E_NOINTERFACE;
ComPtr<IWICStream> stream;
hr = pWIC->CreateStream(stream.GetAddressOf());
if (FAILED(hr))
return hr;
hr = stream->InitializeFromFilename(fileName, GENERIC_WRITE);
if (FAILED(hr))
return hr;
auto_delete_file_wic delonfail(stream, fileName);
ComPtr<IWICBitmapEncoder> encoder;
hr = pWIC->CreateEncoder(guidContainerFormat, nullptr, encoder.GetAddressOf());
if (FAILED(hr))
return hr;
hr = encoder->Initialize(stream.Get(), WICBitmapEncoderNoCache);
if (FAILED(hr))
return hr;
ComPtr<IWICBitmapFrameEncode> frame;
ComPtr<IPropertyBag2> props;
hr = encoder->CreateNewFrame(frame.GetAddressOf(), props.GetAddressOf());
if (FAILED(hr))
return hr;
if (targetFormat && memcmp(&guidContainerFormat, &GUID_ContainerFormatBmp, sizeof(WICPixelFormatGUID)) == 0 && _IsWIC2())
{
// Opt-in to the WIC2 support for writing 32-bit Windows BMP files with an alpha channel
PROPBAG2 option = {};
option.pstrName = const_cast<wchar_t*>(L"EnableV5Header32bppBGRA");
VARIANT varValue;
varValue.vt = VT_BOOL;
varValue.boolVal = VARIANT_TRUE;
(void)props->Write(1, &option, &varValue);
}
if (setCustomProps)
{
setCustomProps(props.Get());
}
hr = frame->Initialize(props.Get());
if (FAILED(hr))
return hr;
hr = frame->SetSize(desc.Width, desc.Height);
if (FAILED(hr))
return hr;
hr = frame->SetResolution(72, 72);
if (FAILED(hr))
return hr;
// Pick a target format
WICPixelFormatGUID targetGuid;
if (targetFormat)
{
targetGuid = *targetFormat;
}
else
{
// Screenshots don't typically include the alpha channel of the render target
switch (desc.Format)
{
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8) || defined(_WIN7_PLATFORM_UPDATE)
case DXGI_FORMAT_R32G32B32A32_FLOAT:
case DXGI_FORMAT_R16G16B16A16_FLOAT:
if (_IsWIC2())
{
targetGuid = GUID_WICPixelFormat96bppRGBFloat;
}
else
{
targetGuid = GUID_WICPixelFormat24bppBGR;
}
break;
#endif
case DXGI_FORMAT_R16G16B16A16_UNORM: targetGuid = GUID_WICPixelFormat48bppBGR; break;
case DXGI_FORMAT_B5G5R5A1_UNORM: targetGuid = GUID_WICPixelFormat16bppBGR555; break;
case DXGI_FORMAT_B5G6R5_UNORM: targetGuid = GUID_WICPixelFormat16bppBGR565; break;
case DXGI_FORMAT_R32_FLOAT:
case DXGI_FORMAT_R16_FLOAT:
case DXGI_FORMAT_R16_UNORM:
case DXGI_FORMAT_R8_UNORM:
case DXGI_FORMAT_A8_UNORM:
targetGuid = GUID_WICPixelFormat8bppGray;
break;
default:
targetGuid = GUID_WICPixelFormat24bppBGR;
break;
}
}
hr = frame->SetPixelFormat(&targetGuid);
if (FAILED(hr))
return hr;
if (targetFormat && memcmp(targetFormat, &targetGuid, sizeof(WICPixelFormatGUID)) != 0)
{
// Requested output pixel format is not supported by the WIC codec
return E_FAIL;
}
// Encode WIC metadata
ComPtr<IWICMetadataQueryWriter> metawriter;
if (SUCCEEDED(frame->GetMetadataQueryWriter(metawriter.GetAddressOf())))
{
PROPVARIANT value;
PropVariantInit(&value);
value.vt = VT_LPSTR;
value.pszVal = const_cast<char*>("DirectXTK");
if (memcmp(&guidContainerFormat, &GUID_ContainerFormatPng, sizeof(GUID)) == 0)
{
// Set Software name
(void)metawriter->SetMetadataByName(L"/tEXt/{str=Software}", &value);
// Set sRGB chunk
if (sRGB)
{
value.vt = VT_UI1;
value.bVal = 0;
(void)metawriter->SetMetadataByName(L"/sRGB/RenderingIntent", &value);
}
else
{
// add gAMA chunk with gamma 1.0
value.vt = VT_UI4;
value.uintVal = 100000; // gama value * 100,000 -- i.e. gamma 1.0
(void)metawriter->SetMetadataByName(L"/gAMA/ImageGamma", &value);
// remove sRGB chunk which is added by default.
(void)metawriter->RemoveMetadataByName(L"/sRGB/RenderingIntent");
}
}
#if defined(_XBOX_ONE) && defined(_TITLE)
else if (memcmp(&guidContainerFormat, &GUID_ContainerFormatJpeg, sizeof(GUID)) == 0)
{
// Set Software name
(void)metawriter->SetMetadataByName(L"/app1/ifd/{ushort=305}", &value);
if (sRGB)
{
// Set EXIF Colorspace of sRGB
value.vt = VT_UI2;
value.uiVal = 1;
(void)metawriter->SetMetadataByName(L"/app1/ifd/exif/{ushort=40961}", &value);
}
}
else if (memcmp(&guidContainerFormat, &GUID_ContainerFormatTiff, sizeof(GUID)) == 0)
{
// Set Software name
(void)metawriter->SetMetadataByName(L"/ifd/{ushort=305}", &value);
if (sRGB)
{
// Set EXIF Colorspace of sRGB
value.vt = VT_UI2;
value.uiVal = 1;
(void)metawriter->SetMetadataByName(L"/ifd/exif/{ushort=40961}", &value);
}
}
#else
else
{
// Set Software name
(void)metawriter->SetMetadataByName(L"System.ApplicationName", &value);
if (sRGB)
{
// Set EXIF Colorspace of sRGB
value.vt = VT_UI2;
value.uiVal = 1;
(void)metawriter->SetMetadataByName(L"System.Image.ColorSpace", &value);
}
}
#endif
}
D3D11_MAPPED_SUBRESOURCE mapped;
hr = pContext->Map(pStaging.Get(), 0, D3D11_MAP_READ, 0, &mapped);
if (FAILED(hr))
return hr;
if (memcmp(&targetGuid, &pfGuid, sizeof(WICPixelFormatGUID)) != 0)
{
// Conversion required to write
ComPtr<IWICBitmap> source;
hr = pWIC->CreateBitmapFromMemory(desc.Width, desc.Height, pfGuid,
mapped.RowPitch, mapped.RowPitch * desc.Height,
static_cast<BYTE*>(mapped.pData), source.GetAddressOf());
if (FAILED(hr))
{
pContext->Unmap(pStaging.Get(), 0);
return hr;
}
ComPtr<IWICFormatConverter> FC;
hr = pWIC->CreateFormatConverter(FC.GetAddressOf());
if (FAILED(hr))
{
pContext->Unmap(pStaging.Get(), 0);
return hr;
}
BOOL canConvert = FALSE;
hr = FC->CanConvert(pfGuid, targetGuid, &canConvert);
if (FAILED(hr) || !canConvert)
{
return E_UNEXPECTED;
}
hr = FC->Initialize(source.Get(), targetGuid, WICBitmapDitherTypeNone, nullptr, 0, WICBitmapPaletteTypeMedianCut);
if (FAILED(hr))
{
pContext->Unmap(pStaging.Get(), 0);
return hr;
}
WICRect rect = { 0, 0, static_cast<INT>(desc.Width), static_cast<INT>(desc.Height) };
hr = frame->WriteSource(FC.Get(), &rect);
if (FAILED(hr))
{
pContext->Unmap(pStaging.Get(), 0);
return hr;
}
}
else
{
// No conversion required
hr = frame->WritePixels(desc.Height, mapped.RowPitch, mapped.RowPitch * desc.Height, static_cast<BYTE*>(mapped.pData));
if (FAILED(hr))
return hr;
}
pContext->Unmap(pStaging.Get(), 0);
hr = frame->Commit();
if (FAILED(hr))
return hr;
hr = encoder->Commit();
if (FAILED(hr))
return hr;
delonfail.clear();
return S_OK;
}
|
{
"content_hash": "c513ac0c0cd7c46e876aab023bd7f7a3",
"timestamp": "",
"source": "github",
"line_count": 640,
"max_line_length": 186,
"avg_line_length": 39.68125,
"alnum_prop": 0.5934005355174043,
"repo_name": "PlayFab/PlayFab-Samples",
"id": "3c6a8c19347bd70b87b7137b226319c719c2b917",
"size": "26519",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Samples/Xbox/Kits/DirectXTK/Src/ScreenGrab.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "18539962"
},
{
"name": "CSS",
"bytes": "7618"
},
{
"name": "HTML",
"bytes": "8483"
},
{
"name": "JavaScript",
"bytes": "36171"
},
{
"name": "Objective-C",
"bytes": "281669"
},
{
"name": "Objective-C++",
"bytes": "40571"
},
{
"name": "Python",
"bytes": "34120"
},
{
"name": "Shell",
"bytes": "508"
}
],
"symlink_target": ""
}
|
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>W28694_text</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<div style="margin-left: auto; margin-right: auto; width: 800px; overflow: hidden;">
<div style="float: left;">
<a href="page27.html">«</a>
</div>
<div style="float: right;">
</div>
</div>
<hr/>
<div style="position: absolute; margin-left: 27px; margin-top: 0px;">
<img src="images/tmp8rVwIu.png" alt="tmp8rVwIu.png" />
</div>
<div style="position: absolute; margin-left: 864px; margin-top: 567px;">
<p class="styleSans5.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">‘— ouoo A omoo </p>
</div>
<div style="position: absolute; margin-left: 972px; margin-top: 0px;">
<img src="images/tmpjFHSWT.png" alt="tmpjFHSWT.png" />
</div>
</body>
</html>
|
{
"content_hash": "5ff4abba92a869c51e9a68bb1adb63c5",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 140,
"avg_line_length": 33.96774193548387,
"alnum_prop": 0.5764482431149098,
"repo_name": "datamade/elpc_bakken",
"id": "ecbde5530f0217a0bfefc27f88a5838bca2b693b",
"size": "1058",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ocr_extracted/W28694_text/page28.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "17512999"
},
{
"name": "HTML",
"bytes": "421900941"
},
{
"name": "Makefile",
"bytes": "991"
},
{
"name": "Python",
"bytes": "7186"
}
],
"symlink_target": ""
}
|
[](https://travis-ci.org/dlna/DLNA_HTML5_Test_Tool_Installer)
[](https://www.codacy.com/app/DLNA/DLNA_HTML5_Test_Tool_Installer?utm_source=github.com&utm_medium=referral&utm_content=dlna/DLNA_HTML5_Test_Tool_Installer&utm_campaign=Badge_Grade)
This repository provides an instillation script for the DLNA HTML5 Test Tool
## Usage
```
wget https://raw.githubusercontent.com/dlna/DLNA_HTML5_Test_Tool_Installer/master/DLNA_HTML5_Test_Tool_Installer.sh
sudo bash DLNA_HTML5_Test_Tool_Installer.sh
```
## Command line options
__Help__: ```-h```/```--help```
Display a quick reference of the command usage of the installer.
__Version__: ```-v```/```--version```
Display the installer version number
__Revision__: ```-r <revision>```/```--revision <revision>```
The Git tag/branch to install. Current valid values (for the DLNA repository) are;
* [Release_2014.09.31](https://github.com/dlna/web-platform-tests/releases/tag/Release_2014.09.31) (default)
* [Release_2016.03.11_Alpha](https://github.com/dlna/web-platform-tests/releases/tag/Release_2016.03.11_Alpha)
* master
__GitHub User__: ```-u <user>```/```--user <user>```
The Github user to use when cloning the tests/support. Currently the same user is used for all the repositories
so all of the following will be need to be forked;
* [web-platform-tests](https://github.com/dlna/web-platform-tests)
* [WPT_Results_Collection_Server](https://github.com/dlna/WPT_Results_Collection_Server)
* [HTML5_Test_Suite_Server_Support](https://github.com/dlna/HTML5_Test_Suite_Server_Support)
__DRM Content__: ```-d```/```--drm-content```
Download the content needed for DRM testing if supported in the test suite. You will need to be granted access to the
content by DLNA staff, email [admin@dlna.org](mailto:admin@dlna.org) for more details.
__Answer Yes__: ```-y```/```--yes```
Answer 'yes' to any applicable questions from the installer. For use in automated setup, not recommended for normal
use.
__Disable Network Setup__: ```--disable-network```
Do not make changes to the network interface setup of the machine. The required setup will need to be made manyally.
For use in automated setup, not recommended for normal use.
|
{
"content_hash": "a5c845d07b6b82cb9afb617c8e24b21a",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 285,
"avg_line_length": 54.40909090909091,
"alnum_prop": 0.7364243943191312,
"repo_name": "dlna/DLNA_HTML5_Test_Tool_Installer",
"id": "22b1bf12c53fb31b03df1300facf0b4b81bcb82d",
"size": "2428",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Shell",
"bytes": "14555"
}
],
"symlink_target": ""
}
|
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null
|
{
"content_hash": "d270a8b1ca004d90b72e4ee475e1a05b",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.23076923076923,
"alnum_prop": 0.6917293233082706,
"repo_name": "mdoering/backbone",
"id": "ea8bc7e413d233af3ebc60182d33eddbfefc47a3",
"size": "185",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Liliopsida/Asparagales/Amaryllidaceae/Acis/Acis trichophylla/ Syn. Acis broteroi/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
}
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_37) on Mon Mar 25 00:16:21 EDT 2013 -->
<TITLE>
Uses of Class edu.american.student.stonewall.display.css.property.PerspectiveProperty
</TITLE>
<META NAME="date" CONTENT="2013-03-25">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class edu.american.student.stonewall.display.css.property.PerspectiveProperty";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../edu/american/student/stonewall/display/css/property/PerspectiveProperty.html" title="class in edu.american.student.stonewall.display.css.property"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../../../index.html?edu/american/student/stonewall/display/css/property//class-usePerspectiveProperty.html" target="_top"><B>FRAMES</B></A>
<A HREF="PerspectiveProperty.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<CENTER>
<H2>
<B>Uses of Class<br>edu.american.student.stonewall.display.css.property.PerspectiveProperty</B></H2>
</CENTER>
No usage of edu.american.student.stonewall.display.css.property.PerspectiveProperty
<P>
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../edu/american/student/stonewall/display/css/property/PerspectiveProperty.html" title="class in edu.american.student.stonewall.display.css.property"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../../../index.html?edu/american/student/stonewall/display/css/property//class-usePerspectiveProperty.html" target="_top"><B>FRAMES</B></A>
<A HREF="PerspectiveProperty.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>
|
{
"content_hash": "5df844ca09ec5fd3e4e4a1b2bdcfddeb",
"timestamp": "",
"source": "github",
"line_count": 144,
"max_line_length": 288,
"avg_line_length": 44.49305555555556,
"alnum_prop": 0.6154206336819104,
"repo_name": "Ccook/Stonewall",
"id": "8375918d6a9184b4ba3eccd641c545d4d61c3f30",
"size": "6407",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "javadoc/edu/american/student/stonewall/display/css/property/class-use/PerspectiveProperty.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "853867"
},
{
"name": "JavaScript",
"bytes": "217"
}
],
"symlink_target": ""
}
|
/* Package go_kafka_client provides a high-level Kafka consumer implementation and introduces different approach than Java/Scala high-level consumer.
Primary differences include workers concept enforcing at least once processing before committing offsets, improved rebalancing algorithm - closing obsolete connections and opening new connections without stopping the whole consumer,
graceful shutdown support notifying client when it is over, batch processing, static partitions configuration support allowing to start a consumer with a predefined set of partitions never caring about rebalancing. */
package go_kafka_client
import (
"fmt"
"strings"
"sync"
"time"
)
const (
// Offset with invalid value
InvalidOffset int64 = -1
// Reset the offset to the smallest offset if it is out of range
SmallestOffset = "smallest"
// Reset the offset to the largest offset if it is out of range
LargestOffset = "largest"
)
// Consumer is a high-level Kafka consumer designed to work within a consumer group.
// It subscribes to coordinator events and is able to balance load within a consumer group.
type Consumer struct {
config *ConsumerConfig
fetcher *consumerFetcherManager
shouldUnsubscribe bool
unsubscribe chan bool
closeFinished chan bool
rebalanceLock sync.Mutex
isShuttingdown bool
topicPartitionsAndBuffers map[TopicAndPartition]*messageBuffer
topicRegistry map[string]map[int32]*partitionTopicInfo
connectChannels chan bool
disconnectChannelsForPartition chan TopicAndPartition
workerManagers map[TopicAndPartition]*WorkerManager
workerManagersLock sync.Mutex
stopStreams chan bool
close chan bool
bgInProgress bool
bgInProgressLock sync.Mutex
bgInProgressCond *sync.Cond
metrics *ConsumerMetrics
lastSuccessfulRebalanceHash string
}
/* NewConsumer creates a new Consumer with a given configuration. Creating a Consumer does not start fetching immediately. */
func NewConsumer(config *ConsumerConfig) *Consumer {
if err := config.Validate(); err != nil {
panic(err)
}
Infof(config.Consumerid, "Creating new consumer with configuration: %s", config)
c := &Consumer{
config: config,
unsubscribe: make(chan bool),
closeFinished: make(chan bool),
topicPartitionsAndBuffers: make(map[TopicAndPartition]*messageBuffer),
topicRegistry: make(map[string]map[int32]*partitionTopicInfo),
connectChannels: make(chan bool),
disconnectChannelsForPartition: make(chan TopicAndPartition),
workerManagers: make(map[TopicAndPartition]*WorkerManager),
stopStreams: make(chan bool),
close: make(chan bool),
}
c.bgInProgressCond = sync.NewCond(&c.bgInProgressLock)
if err := c.config.Coordinator.Connect(); err != nil {
panic(err)
}
if err := c.config.LowLevelClient.Initialize(); err != nil {
panic(err)
}
c.metrics = newConsumerMetrics(c.String(), config.MetricsPrefix)
c.fetcher = newConsumerFetcherManager(c.config, c.disconnectChannelsForPartition, c.metrics)
go func() {
<-c.close
if !c.isShuttingdown {
c.Close()
}
}()
return c
}
func (c *Consumer) String() string {
return c.config.Consumerid
}
/* Starts consuming specified topics using a configured amount of goroutines for each topic. */
func (c *Consumer) StartStatic(topicCountMap map[string]int) {
go c.createMessageStreams(topicCountMap)
c.startStreams()
}
/* Starts consuming all topics which correspond to a given topicFilter using numStreams goroutines for each topic. */
func (c *Consumer) StartWildcard(topicFilter TopicFilter, numStreams int) {
go c.createMessageStreamsByFilterN(topicFilter, numStreams)
c.startStreams()
}
/* Starts consuming given topic-partitions using ConsumerConfig.NumConsumerFetchers goroutines for each topic. */
func (c *Consumer) StartStaticPartitions(topicPartitionMap map[string][]int32) {
topicsToNumStreamsMap := make(map[string]int)
for topic := range topicPartitionMap {
topicsToNumStreamsMap[topic] = c.config.NumConsumerFetchers
}
topicCount := &StaticTopicsToNumStreams{
ConsumerId: c.config.Consumerid,
TopicsToNumStreamsMap: topicsToNumStreamsMap,
}
c.config.Coordinator.RegisterConsumer(c.config.Consumerid, c.config.Groupid, topicCount)
allTopics, err := c.config.Coordinator.GetAllTopics()
if err != nil {
panic(err)
}
brokers, err := c.config.Coordinator.GetAllBrokers()
if err != nil {
panic(err)
}
time.Sleep(c.config.DeploymentTimeout)
assignmentContext := newStaticAssignmentContext(c.config.Groupid, c.config.Consumerid, []string{c.config.Consumerid}, allTopics, brokers, topicCount, topicPartitionMap)
partitionOwnershipDecision := newPartitionAssignor(c.config.PartitionAssignmentStrategy)(assignmentContext)
topicPartitions := make([]*TopicAndPartition, 0)
for topicPartition, _ := range partitionOwnershipDecision {
topicPartitions = append(topicPartitions, &TopicAndPartition{topicPartition.Topic, topicPartition.Partition})
}
offsets, err := c.fetchOffsets(topicPartitions)
if err != nil {
panic(fmt.Sprintf("Failed to fetch offsets during rebalance: %s", err))
}
for _, topicPartition := range topicPartitions {
offset := offsets[*topicPartition]
threadId := partitionOwnershipDecision[*topicPartition]
c.addPartitionTopicInfo(c.topicRegistry, topicPartition, offset, threadId)
}
if c.reflectPartitionOwnershipDecision(partitionOwnershipDecision) {
c.updateFetcher(c.config.NumConsumerFetchers)
c.initializeWorkerManagers()
} else {
panic("Could not reflect partition ownership")
}
go func() {
Infof(c, "Restarted streams")
c.connectChannels <- true
}()
c.startStreams()
}
func (c *Consumer) startStreams() {
stopRedirects := make(map[TopicAndPartition]chan bool)
for {
select {
case <-c.stopStreams:
{
Debug(c, "Stop streams")
c.disconnectChannels(stopRedirects)
exit := false
inLock(&c.bgInProgressLock, func() {
if c.bgInProgress {
for c.bgInProgress {
c.bgInProgressCond.Wait()
}
} else {
exit = true
}
})
if exit {
return
}
}
case tp := <-c.disconnectChannelsForPartition:
{
Debugf(c, "Disconnecting %s", tp)
stopRedirects[tp] <- true
delete(stopRedirects, tp)
Debugf(c, "Stopping worker manager for %s", tp)
timeout := time.NewTimer(5 * time.Second)
select {
case <-c.workerManagers[tp].Stop():
case <-timeout.C:
}
timeout.Stop()
delete(c.workerManagers, tp)
Debugf(c, "Stopping buffer: %s", c.topicPartitionsAndBuffers[tp])
c.topicPartitionsAndBuffers[tp].stop()
delete(c.topicPartitionsAndBuffers, tp)
}
case <-c.connectChannels:
{
Debug(c, "Restart streams")
c.pipeChannels(stopRedirects)
}
}
}
}
func (c *Consumer) pipeChannels(stopRedirects map[TopicAndPartition]chan bool) {
inLock(&c.workerManagersLock, func() {
Debugf(c, "connect channels registry: %v", c.topicRegistry)
for topic, partitions := range c.topicRegistry {
for partition, info := range partitions {
topicPartition := TopicAndPartition{topic, partition}
if _, exists := stopRedirects[topicPartition]; !exists {
to, exists := c.workerManagers[topicPartition]
if !exists {
Infof(c, "WM > Failed to pipe message buffer to workermanager on partition %s", topicPartition)
continue
}
Debugf(c, "Piping %s", topicPartition)
stopRedirects[topicPartition] = pipe(info.Buffer.OutputChannel, to.inputChannel)
}
}
}
})
}
func (c *Consumer) disconnectChannels(stopRedirects map[TopicAndPartition]chan bool) {
for tp, stopRedirect := range stopRedirects {
Debugf(c, "Disconnecting channel for %s", tp)
stopRedirect <- true
delete(stopRedirects, tp)
}
}
func (c *Consumer) createMessageStreams(topicCountMap map[string]int) {
topicCount := &StaticTopicsToNumStreams{
ConsumerId: c.config.Consumerid,
TopicsToNumStreamsMap: topicCountMap,
}
c.config.Coordinator.RegisterConsumer(c.config.Consumerid, c.config.Groupid, topicCount)
time.Sleep(c.config.DeploymentTimeout)
c.reinitializeConsumer()
}
func (c *Consumer) createMessageStreamsByFilterN(topicFilter TopicFilter, numStreams int) {
topicCount := &WildcardTopicsToNumStreams{
Coordinator: c.config.Coordinator,
ConsumerId: c.config.Consumerid,
TopicFilter: topicFilter,
NumStreams: numStreams,
ExcludeInternalTopics: c.config.ExcludeInternalTopics,
}
c.config.Coordinator.RegisterConsumer(c.config.Consumerid, c.config.Groupid, topicCount)
time.Sleep(c.config.DeploymentTimeout)
c.reinitializeConsumer()
}
func (c *Consumer) createMessageStreamsByFilter(topicFilter TopicFilter) {
c.createMessageStreamsByFilterN(topicFilter, c.config.NumConsumerFetchers)
}
func (c *Consumer) reinitializeConsumer() {
c.subscribeForChanges(c.config.Groupid)
c.rebalance()
}
func (c *Consumer) initializeWorkerManagers() {
inLock(&c.workerManagersLock, func() {
Infof(c, "Initializing worker managers from topic registry: %s", c.topicRegistry)
for topic, partitions := range c.topicRegistry {
for partition := range partitions {
topicPartition := TopicAndPartition{topic, partition}
workerManager, exists := c.workerManagers[topicPartition]
if !exists {
workerManager = NewWorkerManager(fmt.Sprintf("WM-%s-%d", topic, partition), c.config, topicPartition, c.metrics, c.close)
c.workerManagers[topicPartition] = workerManager
go workerManager.Start()
}
}
}
})
c.metrics.numWorkerManagers().Update(int64(len(c.workerManagers)))
}
// Tells the Consumer to close all existing connections and stop.
// This method is NOT blocking but returns a channel which will get a single value once the closing is finished.
func (c *Consumer) Close() <-chan bool {
Info(c, "Consumer closing started...")
c.isShuttingdown = true
go func() {
select {
case c.close <- true:
default:
}
Info(c, "Unsubscribing...")
if c.shouldUnsubscribe {
c.unsubscribeFromChanges()
}
Info(c, "Closing fetcher manager...")
<-c.fetcher.close()
Info(c, "Stopping worker manager...")
if !c.stopWorkerManagers() {
panic("Graceful shutdown failed")
}
c.stopStreams <- true
c.releasePartitionOwnership(c.topicRegistry)
Info(c, "Deregistering consumer")
c.config.Coordinator.DeregisterConsumer(c.config.Consumerid, c.config.Groupid)
Info(c, "Successfully deregistered consumer")
Info(c, "Closing low-level client")
c.config.LowLevelClient.Close()
Info(c, "Disconnecting from consumer coordinator")
c.config.Coordinator.Disconnect()
Info(c, "Disconnected from consumer coordinator")
Info(c, "Unregistering all metrics")
c.metrics.close()
Info(c, "Unregistered all metrics")
c.closeFinished <- true
Info(c, "Sent close finished")
}()
return c.closeFinished
}
func (c *Consumer) handleBlueGreenRequest(requestId string, blueGreenRequest *BlueGreenDeployment) {
var context *assignmentContext
//Waiting for everybody in group to acknowledge the request, then closing
inLock(&c.rebalanceLock, func() {
Infof(c, "Starting blue-green procedure for: %s", blueGreenRequest)
var err error
var stateHash string
barrierPassed := false
for !barrierPassed {
context, err = newAssignmentContext(c.config.Groupid, c.config.Consumerid,
c.config.ExcludeInternalTopics, c.config.Coordinator)
if err != nil {
Errorf(c, "Failed to initialize assignment context: %s", err)
panic(err)
}
barrierSize := len(context.Consumers)
stateHash = context.hash()
barrierPassed = c.config.Coordinator.AwaitOnStateBarrier(c.config.Consumerid, c.config.Groupid, stateHash,
barrierSize, fmt.Sprintf("%s/%s", BlueGreenDeploymentAPI, requestId), c.config.BarrierTimeout)
}
inLock(&c.bgInProgressLock, func() {
c.bgInProgress = true
})
<-c.Close()
err = c.config.Coordinator.Connect()
if err != nil {
panic(fmt.Sprintf("Failed to connect to Coordinator: %s", err))
}
// Waiting for target group to leave the group
amountOfConsumersInTargetGroup := -1
// If the current owner of a partition isn't BG aware it will never give up it's ownership
// gracefully. In that case try a best effort of 30 retries, but then take it over anyway.
maxRetries := 30 // Don't want to wait in this loop indefinitely.
for retries := 0; retries < maxRetries && amountOfConsumersInTargetGroup != 0; retries++ {
consumersInTargetGroup, err := c.config.Coordinator.GetConsumersInGroup(blueGreenRequest.Group)
if err != nil {
panic(fmt.Sprintf("Failed to perform blue-green procedure due to: %s", err))
}
amountOfConsumersInTargetGroup = len(consumersInTargetGroup)
for _, consumer := range consumersInTargetGroup {
for _, myGroupConsumer := range context.Consumers {
if consumer == myGroupConsumer {
amountOfConsumersInTargetGroup--
break
}
}
}
time.Sleep(5 * time.Second)
}
//Removing obsolete api calls
c.config.Coordinator.RemoveOldApiRequests(blueGreenRequest.Group)
//Generating new topicCount
var topicCount TopicsToNumStreams
switch blueGreenRequest.Pattern {
case blackListPattern:
topicCount = &WildcardTopicsToNumStreams{
Coordinator: c.config.Coordinator,
ConsumerId: c.config.Consumerid,
TopicFilter: NewBlackList(blueGreenRequest.Topics),
NumStreams: c.config.NumConsumerFetchers,
ExcludeInternalTopics: c.config.ExcludeInternalTopics,
}
case whiteListPattern:
topicCount = &WildcardTopicsToNumStreams{
Coordinator: c.config.Coordinator,
ConsumerId: c.config.Consumerid,
TopicFilter: NewWhiteList(blueGreenRequest.Topics),
NumStreams: c.config.NumConsumerFetchers,
ExcludeInternalTopics: c.config.ExcludeInternalTopics,
}
case staticPattern:
{
topicMap := make(map[string]int)
for _, topic := range strings.Split(blueGreenRequest.Topics, ",") {
topicMap[topic] = c.config.NumConsumerFetchers
}
topicCount = &StaticTopicsToNumStreams{
ConsumerId: c.config.Consumerid,
TopicsToNumStreamsMap: topicMap,
}
}
}
//Getting the partitions for specified topics
myTopicThreadIds := topicCount.GetConsumerThreadIdsPerTopic()
topics := make([]string, 0)
for topic, _ := range myTopicThreadIds {
topics = append(topics, topic)
}
topicPartitionMap, err := c.config.Coordinator.GetPartitionsForTopics(topics)
if err != nil {
panic(err)
}
//Creating assignment context with new parameters
newContext := newStaticAssignmentContext(blueGreenRequest.Group, c.config.Consumerid, context.Consumers,
context.AllTopics, context.Brokers, topicCount, topicPartitionMap)
c.config.Groupid = blueGreenRequest.Group
//Resume consuming
c.resumeAfterClose(newContext)
Infof(c, "Blue-green procedure has been successfully finished %s", blueGreenRequest)
})
}
func (c *Consumer) resumeAfterClose(context *assignmentContext) {
c.isShuttingdown = false
c.workerManagers = make(map[TopicAndPartition]*WorkerManager)
c.topicPartitionsAndBuffers = make(map[TopicAndPartition]*messageBuffer)
c.config.LowLevelClient.Initialize()
c.fetcher = newConsumerFetcherManager(c.config, c.disconnectChannelsForPartition, c.metrics)
c.metrics = newConsumerMetrics(c.String(), c.config.MetricsPrefix)
go func() {
<-c.close
if !c.isShuttingdown {
c.Close()
}
}()
inLock(&c.bgInProgressLock, func() {
c.bgInProgress = false
c.bgInProgressCond.Broadcast()
})
partitionAssignor := newPartitionAssignor(c.config.PartitionAssignmentStrategy)
partitionOwnershipDecision := partitionAssignor(context)
topicPartitions := make([]*TopicAndPartition, 0)
for topicPartition, _ := range partitionOwnershipDecision {
topicPartitions = append(topicPartitions, &TopicAndPartition{topicPartition.Topic, topicPartition.Partition})
}
offsets, err := c.fetchOffsets(topicPartitions)
if err != nil {
panic(fmt.Sprintf("Failed to fetch offsets during rebalance: %s", err))
}
currentTopicRegistry := make(map[string]map[int32]*partitionTopicInfo)
for _, topicPartition := range topicPartitions {
offset := offsets[*topicPartition]
threadId := partitionOwnershipDecision[*topicPartition]
c.addPartitionTopicInfo(currentTopicRegistry, topicPartition, offset, threadId)
}
c.config.Coordinator.RegisterConsumer(c.config.Consumerid, c.config.Groupid, context.MyTopicToNumStreams)
if c.reflectPartitionOwnershipDecision(partitionOwnershipDecision) {
c.topicRegistry = currentTopicRegistry
c.lastSuccessfulRebalanceHash = context.hash()
c.initFetchersAndWorkers(context)
} else {
panic("Failed to switch to new deployed topic")
}
c.subscribeForChanges(c.config.Groupid)
}
func (c *Consumer) stopWorkerManagers() bool {
success := false
inLock(&c.workerManagersLock, func() {
if len(c.workerManagers) > 0 {
wmsAreStopped := make(chan bool)
wmStopChannels := make([]chan bool, 0)
for _, wm := range c.workerManagers {
wmStopChannels = append(wmStopChannels, wm.Stop())
}
Debugf(c, "Worker channels length: %d", len(wmStopChannels))
notifyWhenThresholdIsReached(wmStopChannels, wmsAreStopped, len(wmStopChannels))
timeout := time.NewTimer(c.config.WorkerManagersStopTimeout)
select {
case <-wmsAreStopped:
{
Info(c, "All workers have been gracefully stopped")
c.workerManagers = make(map[TopicAndPartition]*WorkerManager)
success = true
}
case <-timeout.C:
{
Errorf(c, "Workers failed to stop whithin timeout of %s", c.config.WorkerManagersStopTimeout)
success = false
}
}
timeout.Stop()
} else {
Debug(c, "No worker managers to close")
success = true
}
})
return success
}
func (c *Consumer) updateFetcher(numStreams int) {
Infof(c, "Updating fetcher with numStreams = %d", numStreams)
allPartitionInfos := make([]*partitionTopicInfo, 0)
Infof(c, "Topic Registry = %s", c.topicRegistry)
for _, partitionAndInfo := range c.topicRegistry {
for _, partitionInfo := range partitionAndInfo {
allPartitionInfos = append(allPartitionInfos, partitionInfo)
}
}
c.fetcher.startConnections(allPartitionInfos, numStreams)
Infof(c, "Updated fetcher")
}
func (c *Consumer) subscribeForChanges(group string) {
changes, err := c.config.Coordinator.SubscribeForChanges(group)
if err != nil {
panic(err)
}
c.shouldUnsubscribe = true
go func() {
for {
select {
case eventType := <-changes:
{
if eventType == BlueGreenRequest {
blueGreenRequests, err := c.config.Coordinator.GetBlueGreenRequest(group)
if len(blueGreenRequests) > 0 {
Info(c, "Blue-green deployment procedure has been requested")
if err != nil {
panic(err)
}
for requestId, request := range blueGreenRequests {
go c.handleBlueGreenRequest(requestId, request)
break
}
}
} else {
go c.rebalance()
}
}
case <-c.unsubscribe:
{
return
}
}
}
}()
}
func (c *Consumer) unsubscribeFromChanges() {
c.unsubscribe <- true
c.config.Coordinator.Unsubscribe()
}
func (c *Consumer) rebalance() {
if !c.isShuttingdown {
inLock(&c.rebalanceLock, func() {
success := false
var stateHash string
barrierTimeout := c.config.BarrierTimeout
Infof(c, "rebalance triggered for %s\n", c.config.Consumerid)
for i := 0; i <= int(c.config.RebalanceMaxRetries) && !success; i++ {
partitionAssignor := newPartitionAssignor(c.config.PartitionAssignmentStrategy)
var context *assignmentContext
var err error
barrierPassed := false
timeLimit := time.Now().Add(3*time.Minute)
for !barrierPassed && time.Now().Before(timeLimit) {
context, err = newAssignmentContext(c.config.Groupid, c.config.Consumerid,
c.config.ExcludeInternalTopics, c.config.Coordinator)
if err != nil {
Errorf(c, "Failed to initialize assignment context: %s", err)
panic(err)
}
barrierSize := len(context.Consumers)
stateHash = context.hash()
if c.lastSuccessfulRebalanceHash == stateHash {
Info(c, "No need in rebalance this time")
return
}
c.releasePartitionOwnership(c.topicRegistry)
err = c.config.Coordinator.RemoveStateBarrier(c.config.Groupid, fmt.Sprintf("%s-ack", stateHash), string(Rebalance))
if err != nil {
Warnf(c, "Failed to remove state barrier %s due to: %s", stateHash, err.Error())
}
barrierPassed = c.config.Coordinator.AwaitOnStateBarrier(c.config.Consumerid, c.config.Groupid,
stateHash, barrierSize, string(Rebalance),
barrierTimeout)
}
if !barrierPassed {
panic("Could not reach consensus on state barrier.")
}
if tryRebalance(c, context, partitionAssignor) {
success = true
} else {
time.Sleep(c.config.RebalanceBackoff)
}
err = c.config.Coordinator.RemoveStateBarrier(c.config.Groupid, stateHash, string(Rebalance))
if err != nil {
Warnf(c, "Failed to remove state barrier %s due to: %s", stateHash, err.Error())
}
barrierTimeout += c.config.BarrierTimeout
}
if !success && !c.isShuttingdown {
panic(fmt.Sprintf("Failed to rebalance after %d retries", c.config.RebalanceMaxRetries))
} else {
c.lastSuccessfulRebalanceHash = stateHash
Info(c, "Rebalance has been successfully completed")
}
})
} else {
Infof(c, "Rebalance was triggered during consumer '%s' shutdown sequence. Ignoring...", c.config.Consumerid)
}
}
func tryRebalance(c *Consumer, context *assignmentContext, partitionAssignor assignStrategy) bool {
partitionOwnershipDecision := partitionAssignor(context)
topicPartitions := make([]*TopicAndPartition, 0)
for topicPartition, _ := range partitionOwnershipDecision {
topicPartitions = append(topicPartitions, &TopicAndPartition{topicPartition.Topic, topicPartition.Partition})
}
offsets, err := c.fetchOffsets(topicPartitions)
if err != nil {
Errorf(c, "Failed to fetch offsets during rebalance: %s", err)
return false
}
currentTopicRegistry := make(map[string]map[int32]*partitionTopicInfo)
if c.isShuttingdown {
Warnf(c, "Aborting consumer '%s' rebalancing, since shutdown sequence started.", c.config.Consumerid)
return true
} else {
for _, topicPartition := range topicPartitions {
offset := offsets[*topicPartition]
threadId := partitionOwnershipDecision[*topicPartition]
c.addPartitionTopicInfo(currentTopicRegistry, topicPartition, offset, threadId)
}
}
if c.reflectPartitionOwnershipDecision(partitionOwnershipDecision) {
Info(c, "Partition ownership has been successfully reflected")
barrierPassed := false
retriesLeft := 3
stateHash := context.hash()
barrierSize := len(context.Consumers)
for !barrierPassed && retriesLeft > 0 {
barrierPassed = c.config.Coordinator.AwaitOnStateBarrier(c.config.Consumerid, c.config.Groupid,
fmt.Sprintf("%s-ack", stateHash), barrierSize, string(Rebalance),
c.config.BarrierTimeout)
retriesLeft--
}
if !barrierPassed {
return false
}
c.topicRegistry = currentTopicRegistry
Infof(c, "Trying to reinitialize fetchers and workers")
c.initFetchersAndWorkers(context)
Infof(c, "Fetchers and workers have been successfully reinitialized")
} else {
Errorf(c, "Failed to reflect partition ownership during rebalance")
return false
}
return true
}
func (c *Consumer) initFetchersAndWorkers(assignmentContext *assignmentContext) {
switch topicCount := assignmentContext.MyTopicToNumStreams.(type) {
case *StaticTopicsToNumStreams:
{
var numStreams int
for _, v := range topicCount.GetConsumerThreadIdsPerTopic() {
numStreams = len(v)
break
}
Infof(c, "Trying to update fetcher")
c.updateFetcher(numStreams)
}
case *WildcardTopicsToNumStreams:
{
c.updateFetcher(topicCount.NumStreams)
}
}
Infof(c, "Fetcher has been updated %s", assignmentContext)
c.initializeWorkerManagers()
Infof(c, "Restarted streams")
c.connectChannels <- true
}
func (c *Consumer) fetchOffsets(topicPartitions []*TopicAndPartition) (map[TopicAndPartition]int64, error) {
offsets := make(map[TopicAndPartition]int64)
for _, topicPartition := range topicPartitions {
offset, err := c.config.OffsetStorage.GetOffset(c.config.Groupid, topicPartition.Topic, topicPartition.Partition)
if err != nil {
return nil, err
} else {
offsets[*topicPartition] = offset
}
}
return offsets, nil
}
func (c *Consumer) addPartitionTopicInfo(currenttopicRegistry map[string]map[int32]*partitionTopicInfo,
topicPartition *TopicAndPartition, offset int64,
consumerThreadId ConsumerThreadId) {
if Logger.IsAllowed(TraceLevel) {
Tracef(c, "Adding partitionTopicInfo: %v \n %s", currenttopicRegistry, topicPartition)
}
partTopicInfoMap, exists := currenttopicRegistry[topicPartition.Topic]
if !exists {
partTopicInfoMap = make(map[int32]*partitionTopicInfo)
currenttopicRegistry[topicPartition.Topic] = partTopicInfoMap
}
buffer := c.topicPartitionsAndBuffers[*topicPartition]
if buffer == nil {
buffer = newMessageBuffer(*topicPartition, make(chan []*Message, c.config.QueuedMaxMessages), c.config)
c.topicPartitionsAndBuffers[*topicPartition] = buffer
}
partTopicInfo := &partitionTopicInfo{
Topic: topicPartition.Topic,
Partition: topicPartition.Partition,
Buffer: buffer,
FetchedOffset: offset,
}
partTopicInfoMap[topicPartition.Partition] = partTopicInfo
}
func (c *Consumer) reflectPartitionOwnershipDecision(partitionOwnershipDecision map[TopicAndPartition]ConsumerThreadId) bool {
Infof(c, "Consumer is trying to reflect partition ownership decision: %v\n", partitionOwnershipDecision)
successfullyOwnedPartitions := make([]*TopicAndPartition, 0)
for topicPartition, consumerThreadId := range partitionOwnershipDecision {
success, err := c.config.Coordinator.ClaimPartitionOwnership(c.config.Groupid, topicPartition.Topic, topicPartition.Partition, consumerThreadId)
if err != nil {
panic(err)
}
if success {
Debugf(c, "Consumer successfully claimed partition %d for topic %s", topicPartition.Partition, topicPartition.Topic)
successfullyOwnedPartitions = append(successfullyOwnedPartitions, &topicPartition)
} else {
Warnf(c, "Consumer failed to claim partition %d for topic %s", topicPartition.Partition, topicPartition.Topic)
}
}
if len(partitionOwnershipDecision) > len(successfullyOwnedPartitions) {
Warnf(c, "Consumer failed to reflect all partitions %d of %d", len(successfullyOwnedPartitions), len(partitionOwnershipDecision))
for _, topicPartition := range successfullyOwnedPartitions {
c.config.Coordinator.ReleasePartitionOwnership(c.config.Groupid, topicPartition.Topic, topicPartition.Partition)
}
return false
}
return true
}
func (c *Consumer) releasePartitionOwnership(localtopicRegistry map[string]map[int32]*partitionTopicInfo) {
Info(c, "Releasing partition ownership")
for topic, partitionInfos := range localtopicRegistry {
for partition, _ := range partitionInfos {
if err := c.config.Coordinator.ReleasePartitionOwnership(c.config.Groupid, topic, partition); err != nil {
panic(err)
}
}
delete(localtopicRegistry, topic)
}
Info(c, "Successfully released partition ownership")
}
// Returns a state snapshot for this consumer. State snapshot contains a set of metrics splitted by topics and partitions.
func (c *Consumer) StateSnapshot() *StateSnapshot {
metricsMap := c.metrics.Stats()
offsetsMap := make(map[string]map[int32]int64)
for topicAndPartition, workerManager := range c.workerManagers {
if _, exists := offsetsMap[topicAndPartition.Topic]; !exists {
offsetsMap[topicAndPartition.Topic] = make(map[int32]int64)
}
offsetsMap[topicAndPartition.Topic][topicAndPartition.Partition] = workerManager.GetLargestOffset()
}
return &StateSnapshot{
Metrics: metricsMap,
Offsets: offsetsMap,
}
}
func (c *Consumer) Metrics() *ConsumerMetrics {
return c.metrics
}
func isOffsetInvalid(offset int64) bool {
return offset <= InvalidOffset
}
|
{
"content_hash": "7203a6fc51bcb39fcd79fa1d96a36e04",
"timestamp": "",
"source": "github",
"line_count": 850,
"max_line_length": 232,
"avg_line_length": 33.45294117647059,
"alnum_prop": 0.7228415684895375,
"repo_name": "sjfloat/syscol",
"id": "82cc1cd15c19c4a7e3fda056278a7fd9091b67f9",
"size": "29195",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "Godeps/_workspace/src/github.com/stealthly/go_kafka_client/consumer.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Go",
"bytes": "37884"
}
],
"symlink_target": ""
}
|
#include "kernel.h"
#include "bs_types.h"
#include "bs_tracing.h"
#include "time_machine.h"
#include "bstests.h"
#include <zephyr/types.h>
#include <stddef.h>
#include <errno.h>
#include <zephyr.h>
#include <sys/printk.h>
#include <bluetooth/bluetooth.h>
#include <bluetooth/hci.h>
#include <bluetooth/conn.h>
#include <bluetooth/uuid.h>
#include <bluetooth/gatt.h>
#include <bluetooth/services/bas.h>
#include <bluetooth/services/hrs.h>
#include <sys/byteorder.h>
static struct bt_conn *default_conn;
/*
* Basic connection test:
* We expect a central to connect to us.
*
* The thread code is mostly a copy of the peripheral_hr sample device
*/
#define WAIT_TIME 5 /*seconds*/
extern enum bst_result_t bst_result;
#define FAIL(...) \
do { \
bst_result = Failed; \
bs_trace_error_time_line(__VA_ARGS__); \
} while (0)
#define PASS(...) \
do { \
bst_result = Passed; \
bs_trace_info_time(1, __VA_ARGS__); \
} while (0)
static void test_con2_init(void)
{
bst_ticker_set_next_tick_absolute(WAIT_TIME*1e6);
bst_result = In_progress;
}
static void test_con2_tick(bs_time_t HW_device_time)
{
/*
* If in WAIT_TIME seconds the testcase did not already pass
* (and finish) we consider it failed
*/
if (bst_result != Passed) {
FAIL("test_connect2 failed (not passed after %i seconds)\n",
WAIT_TIME);
}
}
static const struct bt_data ad[] = {
BT_DATA_BYTES(BT_DATA_FLAGS, (BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR)),
BT_DATA_BYTES(BT_DATA_UUID16_ALL,
BT_UUID_16_ENCODE(BT_UUID_HRS_VAL),
BT_UUID_16_ENCODE(BT_UUID_BAS_VAL),
BT_UUID_16_ENCODE(BT_UUID_CTS_VAL)),
};
static void connected(struct bt_conn *conn, uint8_t err)
{
if (err) {
FAIL("Connection failed (err 0x%02x)\n", err);
} else {
default_conn = bt_conn_ref(conn);
printk("Connected\n");
}
}
static void disconnected(struct bt_conn *conn, uint8_t reason)
{
printk("Disconnected (reason 0x%02x)\n", reason);
if (default_conn) {
bt_conn_unref(default_conn);
default_conn = NULL;
}
}
static struct bt_conn_cb conn_callbacks = {
.connected = connected,
.disconnected = disconnected,
};
static void bt_ready(void)
{
int err;
printk("Bluetooth initialized\n");
err = bt_le_adv_start(BT_LE_ADV_CONN_NAME, ad, ARRAY_SIZE(ad), NULL, 0);
if (err) {
FAIL("Advertising failed to start (err %d)\n", err);
return;
}
printk("Advertising successfully started\n");
}
static void bas_notify(void)
{
uint8_t battery_level = bt_bas_get_battery_level();
battery_level--;
if (!battery_level) {
battery_level = 100U;
}
bt_bas_set_battery_level(battery_level);
}
static void hrs_notify(void)
{
static uint8_t heartrate = 90U;
/* Heartrate measurements simulation */
heartrate++;
if (heartrate == 160U) {
heartrate = 90U;
}
bt_hrs_notify(heartrate);
}
static void test_con2_main(void)
{
static int notify_count;
int err;
err = bt_enable(NULL);
if (err) {
FAIL("Bluetooth init failed (err %d)\n", err);
return;
}
bt_ready();
bt_conn_cb_register(&conn_callbacks);
/* Implement notification. At the moment there is no suitable way
* of starting delayed work so we do it here
*/
while (1) {
k_sleep(K_SECONDS(1));
/* Heartrate measurements simulation */
hrs_notify();
/* Battery level simulation */
bas_notify();
if (notify_count++ == 1) { /* We consider it passed */
PASS("Testcase passed\n");
}
}
}
static const struct bst_test_instance test_connect[] = {
{
.test_id = "peripheral",
.test_descr = "Basic connection test. It expects that a "
"central device can be found. The test will "
"pass if notifications can be sent without "
"crash.",
.test_post_init_f = test_con2_init,
.test_tick_f = test_con2_tick,
.test_main_f = test_con2_main
},
BSTEST_END_MARKER
};
struct bst_test_list *test_connect2_install(struct bst_test_list *tests)
{
tests = bst_add_tests(tests, test_connect);
return tests;
}
|
{
"content_hash": "7dc6560621cb292ce7c9696c6097bd3e",
"timestamp": "",
"source": "github",
"line_count": 192,
"max_line_length": 73,
"avg_line_length": 20.619791666666668,
"alnum_prop": 0.6584996211164436,
"repo_name": "Vudentz/zephyr",
"id": "c01e96e00526355f68f70e2654efed230d57fd80",
"size": "4090",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "tests/bluetooth/bsim_bt/bsim_test_app/src/test_connect2.c",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "354867"
},
{
"name": "Batchfile",
"bytes": "110"
},
{
"name": "C",
"bytes": "23782049"
},
{
"name": "C++",
"bytes": "365645"
},
{
"name": "CMake",
"bytes": "574287"
},
{
"name": "EmberScript",
"bytes": "808"
},
{
"name": "HTML",
"bytes": "1631"
},
{
"name": "Haskell",
"bytes": "542"
},
{
"name": "Makefile",
"bytes": "3313"
},
{
"name": "Objective-C",
"bytes": "19541"
},
{
"name": "Perl",
"bytes": "198126"
},
{
"name": "Python",
"bytes": "1384284"
},
{
"name": "Shell",
"bytes": "75091"
},
{
"name": "SmPL",
"bytes": "19760"
},
{
"name": "Tcl",
"bytes": "3349"
},
{
"name": "VBA",
"bytes": "607"
},
{
"name": "Verilog",
"bytes": "6394"
}
],
"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.11"/>
<title>MIPS16bits: include/mips/interpreter/encoder/format_III_encoder.hpp File Reference</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/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</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="projectalign" style="padding-left: 0.5em;">
<div id="projectname">MIPS16bits
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<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><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><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="files.html"><span>File List</span></a></li>
<li><a href="globals.html"><span>File Members</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</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 id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_6d28c15014b916f15a5c0e1a0491a650.html">mips</a></li><li class="navelem"><a class="el" href="dir_f84973366d718049185a28d2b846a3f3.html">interpreter</a></li><li class="navelem"><a class="el" href="dir_d52624eb95d0dc6e6cc2d542413b90d5.html">encoder</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> </div>
<div class="headertitle">
<div class="title">format_III_encoder.hpp File Reference</div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include <<a class="el" href="encoder_8hpp_source.html">mips/interpreter/encoder/encoder.hpp</a>></code><br />
<code>#include <vector></code><br />
</div>
<p><a href="format__III__encoder_8hpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="classMIPS_1_1FormatIIIEncoder.html">MIPS::FormatIIIEncoder</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Arquivo contendo o codificador de instruções do formato III. </p>
</div></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
|
{
"content_hash": "b424ffc431684c0e81d8e99470bd7330",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 404,
"avg_line_length": 45.61946902654867,
"alnum_prop": 0.6614936954413191,
"repo_name": "mathnogueira/mips",
"id": "2a2299061e5acf00e28bcc1017dda330077e2024",
"size": "5157",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/html/format__III__encoder_8hpp.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "8872"
},
{
"name": "C",
"bytes": "17067"
},
{
"name": "C++",
"bytes": "3231444"
},
{
"name": "CMake",
"bytes": "32594"
},
{
"name": "M4",
"bytes": "19093"
},
{
"name": "Makefile",
"bytes": "14479"
},
{
"name": "Objective-C",
"bytes": "6286"
},
{
"name": "Python",
"bytes": "254657"
},
{
"name": "Shell",
"bytes": "15224"
}
],
"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("PetStore.Importer")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("PetStore.Importer")]
[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("0f906e53-dcd2-400c-8db3-7de278c893b0")]
// 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": "1760667dc28664ff13a231e121b011a0",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 84,
"avg_line_length": 40.083333333333336,
"alnum_prop": 0.726957726957727,
"repo_name": "TelerikAcademy/Databases",
"id": "0e29638221ef133e49bc6a389e926ebf6d15a3f4",
"size": "1446",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "Sample-Exams/2015/Author/Problem 3 - Sample Data/PetStore.Importer/Properties/AssemblyInfo.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "210"
},
{
"name": "C#",
"bytes": "412947"
},
{
"name": "CSS",
"bytes": "1263"
},
{
"name": "HTML",
"bytes": "57973"
},
{
"name": "JavaScript",
"bytes": "242103"
},
{
"name": "PLSQL",
"bytes": "126150"
},
{
"name": "PLpgSQL",
"bytes": "1336296"
},
{
"name": "SQLPL",
"bytes": "8676"
},
{
"name": "XSLT",
"bytes": "1343"
}
],
"symlink_target": ""
}
|
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null
|
{
"content_hash": "50eecd52a678d7467282a506652507ec",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.23076923076923,
"alnum_prop": 0.6917293233082706,
"repo_name": "mdoering/backbone",
"id": "aa4b8ec44dc73feb7179fd5f05ecb6f9cab61149",
"size": "210",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Lamiales/Plantaginaceae/Penstemon/Penstemon glandulosus/ Syn. Penstemon glandulosus chelanensis/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
}
|
//
// ComplainDetailViewController.m
// OfficeOneMB
//
// Created by macpro on 1/4/15.
//
//
#import "ComplainDetailViewController.h"
#import "Globals.h"
#import "DTOComplainObject.h"
#import "CMPopTipView.h"
#import "TPKeyboardAvoidingScrollView.h"
#import "Util.h"
#import "EnumClass.h"
#import "ComplainModel.h"
@interface ComplainDetailViewController ()<CMPopTipViewDelegate>
{
IBOutlet UIView *mainView;
IBOutlet UIButton *btnSave;
IBOutlet UIButton *btnCancel;
DTOComplainObject *_complainOB;
IBOutlet UITextField *txtMaKhieuNai;
IBOutlet UITextField *txtNoiDungKhieuNai;
IBOutlet UITextField *txtLiDo;
IBOutlet UITextField *txtNoiDungXuLy;
IBOutlet UITextField *txtNguoiNhan;
IBOutlet UITextField *txtNgayNhan;
IBOutlet UITextField *txtNguoiXuLy;
IBOutlet UITextField *txtNgayXuLy;
IBOutlet UILabel *_titleLabel;
NSUserDefaults *defaults;
int smgSelect;
UIDatePicker *datePicker;
UIToolbar *toolBar;
NSDateFormatter *df;
}
//Header
@property (weak, nonatomic) IBOutlet UIView *headerViewBar;
@property (weak, nonatomic) IBOutlet UILabel *fullNameLB;
@property (weak, nonatomic) IBOutlet UIButton *btnHome;
- (IBAction)homeBack:(id)sender;
@property (weak, nonatomic) IBOutlet UIView *mainView;
@property (weak, nonatomic) IBOutlet UIView *headerMainView;
@property (weak,nonatomic)IBOutlet UIButton *btnDel;
-(IBAction)actionDel:(id)sender;
@property (weak, nonatomic) IBOutlet UIView *bodyMainView;
@property (weak, nonatomic) IBOutlet TPKeyboardAvoidingScrollView *viewMainBodyInfo;
@property (weak, nonatomic) IBOutlet UIButton *btnSave;
- (IBAction)actionSave:(id)sender;
@property (weak, nonatomic) IBOutlet UIButton *btnClose;
//footer
@property (nonatomic,retain) IBOutlet UILabel *barLabel;
@property (weak, nonatomic) IBOutlet UIView *footerView;
@end
@implementation ComplainDetailViewController{
Util *util;
}
- (void)viewDidLoad {
[super viewDidLoad];
defaults = [NSUserDefaults standardUserDefaults];
[defaults synchronize];
mainView.layer.cornerRadius = CORNER_RADIUS_VIEW;
mainView.layer.masksToBounds = YES;
btnSave.layer.cornerRadius = CORNER_RADIUS_BUTTON;
btnSave.layer.masksToBounds = YES;
btnCancel.layer.cornerRadius = CORNER_RADIUS_BUTTON;
btnCancel.layer.masksToBounds = YES;
smgSelect = [[[NSUserDefaults standardUserDefaults] objectForKey:INTERFACE_OPTION] intValue];
[self updateInterFaceWithOption:smgSelect];
if (_isMain) {
[self loadDataWithComplainOB:_obj];
}
util=[Util new];
df = [[NSDateFormatter alloc] init];
[df setDateFormat:FORMAT_DATE];
NSString *currentDevice = [UIDevice currentDevice].model;
if([currentDevice isEqualToString:@"iPhone"] || [currentDevice isEqualToString:@"iPhone Simulator"]){
[self setBorderTextfield:txtNoiDungKhieuNai];
[self setBorderTextfield:txtNoiDungXuLy];
[self setBorderTextfield:txtLiDo];
[self setBorderTextfield:txtMaKhieuNai];
[self setBorderTextfield:txtNgayNhan];
[self setBorderTextfield:txtNgayXuLy];
[self setBorderTextfield:txtNguoiNhan];
[self setBorderTextfield:txtNguoiXuLy];
//
//show date
datePicker = [[UIDatePicker alloc] init];
datePicker.datePickerMode = UIDatePickerModeDate;
datePicker.backgroundColor=[UIColor whiteColor];
[txtNgayXuLy setInputView:datePicker];
[txtNgayNhan setInputView:datePicker];
toolBar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 320, 30)];
toolBar.barStyle=UIBarStyleDefault;
UIBarButtonItem *doneBtn;
UIBarButtonItem *space = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
doneBtn = [[UIBarButtonItem alloc] initWithTitle:@"Done" style:UIBarButtonItemStyleBordered target:self action:@selector(setSelectedDate)];
[toolBar setItems:[NSArray arrayWithObjects:space,doneBtn, nil]];
[txtNgayNhan setInputAccessoryView:toolBar];
[txtNgayXuLy setInputAccessoryView:toolBar];
}
}
//For iPhone only
-(void) setSelectedDate{
NSDate *date = datePicker.date;
if([txtNgayNhan isFirstResponder]){
[txtNgayNhan resignFirstResponder];
txtNgayNhan.text = [NSString stringWithFormat:@"%@",
[df stringFromDate:date]];
}
else{
[txtNgayXuLy resignFirstResponder];
txtNgayXuLy.text = [NSString stringWithFormat:@"%@",
[df stringFromDate:date]];
}
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
-(void)loadDataWithComplainOB:(DTOComplainObject*)complainOB{
_complainOB = complainOB;
if (_complainOB) {
_btnDel.hidden=NO;
[_fullNameLB setText:COMPLAIN_TITLE_UPDATE_COMPLAIN];
[txtNoiDungKhieuNai setText:_complainOB.content];
[txtLiDo setText:_complainOB.reason];
[txtNoiDungXuLy setText:_complainOB.result];
[txtNguoiNhan setText:_complainOB.accountId];
[txtNgayNhan setText:_complainOB.receivedDate];
[txtNguoiXuLy setText:_complainOB.processerId];
[txtNgayXuLy setText:_complainOB.processedDate];
}else{
[_fullNameLB setText:COMPLAIN_TITLE_ADD_COMPLAIN];
}
}
-(void)setBorderTextfield:(UITextField *)txtField{
txtField.textColor = TEXT_COLOR_REPORT;
txtField.backgroundColor = BACKGROUND_NORMAL_COLOR1;
[txtField setBorderWithOption:smgSelect];
[txtField setPaddingLeft];
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
- (void) updateInterFaceWithOption : (int) option
{
_fullNameLB.text = TITLE_ADD_COMPLAIN;
_headerViewBar.backgroundColor = HEADER_VIEW_COLOR1;
_fullNameLB.textColor = TEXT_COLOR_HEADER_APP;
_footerView.backgroundColor = TOOLBAR_VIEW_COLOR;
_barLabel.text = [NSString stringWithFormat:@"%@ %@, %@",VOFFICE,[defaults objectForKey:@"versionSoftware"],COPY_OF_SOFTWARE];
_barLabel.textColor = TEXT_TOOLBAR_COLOR1;
_headerMainView.backgroundColor = HEADER_SUB_VIEW_COLOR1;
[_headerMainView setSelectiveBorderWithColor:BORDER_COLOR withBorderWith:BORDER_WITH withBorderFlag:AUISelectiveBordersFlagBottom];
for (UIView *viewSubTemp in _headerMainView.subviews)
{
if ([viewSubTemp isKindOfClass:[UILabel class]])
{
((UILabel*) viewSubTemp).textColor = TEXT_COLOR_REPORT_TITLE_1;
}
}
// [self.btnSave setStyleNormalWithOption:smgSelect];
[self.mainView setBackgroundColor:HEADER_SUB_VIEW_COLOR1];
self.bodyMainView.backgroundColor = BACKGROUND_NORMAL_COLOR1;
self.bodyMainView.layer.borderWidth = BORDER_WITH;
self.bodyMainView.layer.borderColor = [BORDER_COLOR CGColor];
_mainView.backgroundColor = HEADER_SUB_VIEW_COLOR1;
_bodyMainView.backgroundColor = BACKGROUND_NORMAL_COLOR1;
_bodyMainView.layer.borderWidth = BORDER_WITH;
_bodyMainView.layer.borderColor = [BORDER_COLOR CGColor];
for (UIView *viewTemp in _bodyMainView.subviews)
{
for (UIView *viewSubTemp in viewTemp.subviews)
{
if ([viewSubTemp isKindOfClass:[UILabel class]])
{
((UILabel*) viewSubTemp).textColor = TEXT_COLOR_REPORT_TITLE_1;
}
else if ([viewSubTemp isKindOfClass:[UITextView class]])
{
((UITextView*) viewSubTemp).textColor = TEXT_COLOR_REPORT;
((UITextView*) viewSubTemp).backgroundColor = BACKGROUND_NORMAL_COLOR1;
((UITextView*) viewSubTemp).layer.borderColor = [BORDER_COLOR CGColor];
((UITextView*) viewSubTemp).layer.borderWidth = BORDER_WITH;
}
else if ([viewSubTemp isKindOfClass:[UITextField class]])
{
((UITextField*) viewSubTemp).textColor = TEXT_COLOR_REPORT;
((UITextField*) viewSubTemp).backgroundColor = BACKGROUND_NORMAL_COLOR1;
((UITextField*) viewSubTemp).layer.borderColor = [BORDER_COLOR CGColor];
((UITextField*) viewSubTemp).layer.borderWidth = BORDER_WITH;
}
}
if ([viewTemp isKindOfClass:[UIButton class]])
{
[((UIButton*) viewTemp) setStyleNormalWithOption:smgSelect];
}
}
}
-(IBAction)btnCancelTapped:(id)sender{
[self dismissViewControllerAnimated:YES completion:nil];
}
-(IBAction)btnSaveTapped:(id)sender{
DTOComplainObject *complainOB = [[DTOComplainObject alloc] init];
if (_complainOB) {
_complainOB.content = txtNoiDungKhieuNai.text;
_complainOB.reason = txtLiDo.text;
_complainOB.result = txtNoiDungXuLy.text;
_complainOB.receiverId = txtNguoiNhan.text;
_complainOB.receivedDate = txtNgayNhan.text;
_complainOB.processerId = txtNguoiXuLy.text;
_complainOB.processedDate = txtNgayXuLy.text;
complainOB = _complainOB;
}else{
complainOB.content = txtNoiDungKhieuNai.text;
complainOB.reason = txtLiDo.text;
complainOB.result = txtNoiDungXuLy.text;
complainOB.receiverId = txtNguoiNhan.text;
complainOB.receivedDate = txtNgayNhan.text;
complainOB.processerId = txtNguoiXuLy.text;
complainOB.processedDate = txtNgayXuLy.text;
}
if (_leadId) {
complainOB.accountId = _leadId;
}
complainOB.status = @"1";
if ([self checkValid]) {
if (_delegate && [_delegate respondsToSelector:@selector(updateComplainDetailViewWithComplainOB:)]) {
[_delegate updateComplainDetailViewWithComplainOB:complainOB];
}
if (_isMain) {
ComplainModel *model =[[ComplainModel alloc] init];
[model updateComplainWithComplainOB:complainOB];
[self dismissViewControllerAnimated:YES completion:nil];
}
}
}
-(BOOL)checkValid{
if ([[StringUtil trimString:txtNoiDungKhieuNai.text] isEqualToString:@""]) {
[util showTooltip:txtNoiDungKhieuNai withText:SYS_Notification_CheckValid_NoiDungKhieuNai showview:self.view];
return NO;
}
if ([[StringUtil trimString:txtLiDo.text] isEqualToString:@""]) {
[util showTooltip:txtLiDo withText:SYS_Notification_CheckValid_LiDo showview:self.view];
return NO;
}
if ([[StringUtil trimString:txtNoiDungXuLy.text] isEqualToString:@""]) {
[util showTooltip:txtNoiDungXuLy withText:SYS_Notification_CheckValid_NoiDungXuLy showview:self.view];
return NO;
}
return YES;
}
#pragma mark tooltip
-(void) showTooltip : (UIView*) inputTooltipView withText : (NSString*) inputMessage {
[self dismissAllPopTipViews];
NSString *contentMessage = inputMessage;
//UIView *contentView = inputTooltipView;
UIColor *backgroundColor = [UIColor lightGrayColor];
UIColor *textColor = [UIColor darkTextColor];
//NSString *title = inputMessage;
CMPopTipView *popTipView;
popTipView = [[CMPopTipView alloc] initWithMessage:contentMessage];
popTipView.delegate = self;
/* Some options to try.
*/
//popTipView.disableTapToDismiss = YES;
//popTipView.preferredPointDirection = PointDirectionUp;
//popTipView.hasGradientBackground = NO;
//popTipView.cornerRadius = 2.0;
//popTipView.sidePadding = 30.0f;
//popTipView.topMargin = 20.0f;
//popTipView.pointerSize = 50.0f;
//popTipView.hasShadow = NO;
popTipView.preferredPointDirection = PointDirectionDown;
popTipView.hasShadow = NO;
if (backgroundColor && ![backgroundColor isEqual:[NSNull null]]) {
popTipView.backgroundColor = backgroundColor;
}
if (textColor && ![textColor isEqual:[NSNull null]]) {
popTipView.textColor = textColor;
}
popTipView.animation = arc4random() % 2;
popTipView.has3DStyle = (BOOL)(arc4random() % 2);
popTipView.dismissTapAnywhere = YES;
[popTipView autoDismissAnimated:YES atTimeInterval:3.0];
[popTipView presentPointingAtView:inputTooltipView inView:self.viewMainBodyInfo animated:YES];
[self.visiblePopTipViews addObject:popTipView];
self.currentPopTipViewTarget = inputTooltipView;
}
- (void)dismissAllPopTipViews
{
while ([self.visiblePopTipViews count] > 0) {
CMPopTipView *popTipView = [self.visiblePopTipViews objectAtIndex:0];
[popTipView dismissAnimated:YES];
[self.visiblePopTipViews removeObjectAtIndex:0];
}
}
#pragma mark - CMPopTipViewDelegate methods
- (void)popTipViewWasDismissedByUser:(CMPopTipView *)popTipView
{
[self.visiblePopTipViews removeObject:popTipView];
self.currentPopTipViewTarget = nil;
}
-(IBAction)actionDel:(id)sender{
DTOComplainObject *complainOB = [[DTOComplainObject alloc] init];
if (_complainOB) {
_complainOB.content = txtNoiDungKhieuNai.text;
_complainOB.reason = txtLiDo.text;
_complainOB.result = txtNoiDungXuLy.text;
_complainOB.receiverId = txtNguoiNhan.text;
_complainOB.receivedDate = txtNgayNhan.text;
_complainOB.processerId = txtNguoiXuLy.text;
_complainOB.processedDate = txtNgayXuLy.text;
complainOB = _complainOB;
}else{
complainOB.content = txtNoiDungKhieuNai.text;
complainOB.reason = txtLiDo.text;
complainOB.result = txtNoiDungXuLy.text;
complainOB.receiverId = txtNguoiNhan.text;
complainOB.receivedDate = txtNgayNhan.text;
complainOB.processerId = txtNguoiXuLy.text;
complainOB.processedDate = txtNgayXuLy.text;
}
if (_leadId) {
complainOB.accountId = _leadId;
}
complainOB.status = @"0";
if ([self checkValid]) {
if (_delegate && [_delegate respondsToSelector:@selector(updateComplainDetailViewWithComplainOB:)]) {
[_delegate updateComplainDetailViewWithComplainOB:complainOB];
}
if (_isMain) {
ComplainModel *model =[[ComplainModel alloc] init];
[model updateComplainWithComplainOB:complainOB];
[self dismissViewControllerAnimated:YES completion:nil];
}
}
}
@end
|
{
"content_hash": "4829fc63ceb62fbb4a8f1ac7ea4071dd",
"timestamp": "",
"source": "github",
"line_count": 422,
"max_line_length": 147,
"avg_line_length": 35.014218009478675,
"alnum_prop": 0.6809691391445587,
"repo_name": "tuansusu/CRMOneIpad",
"id": "422f8cd92a8b34d36978dcf68ce6a252be010964",
"size": "14776",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Classes/view/Complain/ComplainDetail/ComplainDetailViewController.m",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "72421"
},
{
"name": "CSS",
"bytes": "14460"
},
{
"name": "HTML",
"bytes": "11035"
},
{
"name": "Java",
"bytes": "82948"
},
{
"name": "JavaScript",
"bytes": "1176467"
},
{
"name": "M",
"bytes": "1380"
},
{
"name": "Mercury",
"bytes": "6219"
},
{
"name": "Objective-C",
"bytes": "5482520"
},
{
"name": "PHP",
"bytes": "3138"
},
{
"name": "Python",
"bytes": "2286"
}
],
"symlink_target": ""
}
|
<?php
namespace PHPMD\Renderer;
use PHPMD\AbstractRenderer;
use PHPMD\Report;
use PHPMD\RuleViolation;
/**
* This renderer output a command line friendly log with all found violations
* and suspect software artifacts.
*/
class AnsiRenderer extends AbstractRenderer
{
/**
* @param \PHPMD\Report $report
* @return void
*/
public function renderReport(Report $report)
{
$this->writeViolationsReport($report);
$this->writeErrorsReport($report);
$this->writeReportSummary($report);
}
/**
* @param \PHPMD\Report $report
* @return void
*/
private function writeViolationsReport(Report $report)
{
if ($report->isEmpty()) {
return;
}
$padding = $this->getMaxLineNumberLength($report);
$previousFile = null;
foreach ($report->getRuleViolations() as $violation) {
if ($violation->getFileName() !== $previousFile) {
if ($previousFile !== null) {
$this->getWriter()->write(PHP_EOL);
}
$this->writeViolationFileHeader($violation);
}
$this->writeViolationLine($violation, $padding);
$previousFile = $violation->getFileName();
}
}
/**
* @param \PHPMD\Report $report
* @return int|null
*/
private function getMaxLineNumberLength(Report $report)
{
$maxLength = null;
foreach ($report->getRuleViolations() as $violation) {
if ($maxLength === null || strlen($violation->getBeginLine()) > $maxLength) {
$maxLength = strlen($violation->getBeginLine());
}
}
return $maxLength;
}
/**
* @param \PHPMD\RuleViolation $violation
* @return void
*/
private function writeViolationFileHeader(RuleViolation $violation)
{
$fileHeader = sprintf(
'FILE: %s',
$violation->getFileName()
);
$this->getWriter()->write(
PHP_EOL . $fileHeader . PHP_EOL .
str_repeat('-', strlen($fileHeader)) . PHP_EOL
);
}
/**
* @param \PHPMD\RuleViolation $violation
* @param int $padding
* @return void
*/
private function writeViolationLine(RuleViolation $violation, $padding)
{
$this->getWriter()->write(sprintf(
" %s | \e[31mVIOLATION\e[0m | %s" . PHP_EOL,
str_pad($violation->getBeginLine(), $padding, ' '),
$violation->getDescription()
));
}
/**
* @param \PHPMD\Report $report
* @return void
*/
private function writeErrorsReport(Report $report)
{
if (!$report->hasErrors()) {
return;
}
/** @var ProcessingError $error */
foreach ($report->getErrors() as $error) {
$errorHeader = sprintf(
"\e[33mERROR\e[0m while parsing %s",
$error->getFile()
);
$this->getWriter()->write(
PHP_EOL . $errorHeader . PHP_EOL .
str_repeat('-', strlen($errorHeader) - 9) . PHP_EOL
);
$this->getWriter()->write(sprintf(
'%s' . PHP_EOL,
$error->getMessage()
));
}
}
/**
* @param \PHPMD\Report $report
* @return void
*/
private function writeReportSummary(Report $report)
{
$this->getWriter()->write(
sprintf(
PHP_EOL . 'Found %s %s and %s %s in %sms' . PHP_EOL,
count($report->getRuleViolations()),
count($report->getRuleViolations()) !== 1 ? 'violations' : 'violation',
iterator_count($report->getErrors()),
iterator_count($report->getErrors()) !== 1 ? 'errors' : 'error',
$report->getElapsedTimeInMillis()
)
);
if (count($report->getRuleViolations()) === 0 && iterator_count($report->getErrors()) === 0) {
$this->getWriter()->write(PHP_EOL . "\e[32mNo mess detected\e[0m" . PHP_EOL);
}
}
}
|
{
"content_hash": "c39bb7347e11304ec45fe26e50aec76e",
"timestamp": "",
"source": "github",
"line_count": 148,
"max_line_length": 102,
"avg_line_length": 28.04054054054054,
"alnum_prop": 0.5233734939759036,
"repo_name": "phpmd/phpmd",
"id": "3486e4ccffa2890d217e08ec951414073747b6b7",
"size": "4150",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/php/PHPMD/Renderer/AnsiRenderer.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Batchfile",
"bytes": "723"
},
{
"name": "CSS",
"bytes": "5193"
},
{
"name": "PHP",
"bytes": "1048689"
},
{
"name": "XSLT",
"bytes": "12474"
}
],
"symlink_target": ""
}
|
'use strict';
/**
* @ngdoc function
* @name nashaLeptaApp.controller:NewsUpdateCtrl
* @description
* # NewsUpdateCtrl
* Controller of the nashaLeptaApp
*/
angular.module('nashaLeptaApp')
.controller('NewsUpdateCtrl', function ($scope,$routeParams, FireObjects, SubProjectPrefixer, htmlToPlainText) {
var noveltyModelsLocation = SubProjectPrefixer('news');
$scope.noveltyModelsLocation=noveltyModelsLocation;
FireObjects.find(noveltyModelsLocation, $routeParams.id).$loaded()
.then(function(fireNovelty) {
$scope.novelty = fireNovelty;
$scope.novelty.updating = null;
$scope.novelty.date= new Date(fireNovelty.date);
}, function(error) {
$scope.errors = [error];
});
$scope.updateNovelty = function(novelty) {
$scope.novelty.updating = true;
$scope.novelty.status = null;
$scope.novelty.date=$scope.novelty.date.getTime();
$scope.novelty.$save()
.then(function(fireNovelty) {
$scope.novelty.date= new Date(fireNovelty.date);
$scope.novelty.updating = null;
$scope.novelty.status = "Saved";
}, function(error) {
$scope.novelty.date= new Date($scope.novelty.date);
$scope.novelty.updating = null;
$scope.novelty.status = "Error";
$scope.errors = [error];
});
};
$scope.removeNovelty = function() {
$scope.novelty.removing = true;
$scope.novelty.$remove()
.then(function(fireNovelty) {
$scope.novelty.removing = null;
$scope.changeRoute('#/' + noveltyModelsLocation);
}, function(error) {
$scope.novelty.removing = null;
console.log('NoveltysUpdateCtrl#removeNovelty: ' + error);
});
};
$scope.changeRoute = function(url, forceReload) {
$scope = $scope || angular.element(document).scope();
if(forceReload || $scope.$$phase) { // that's right TWO dollar signs: $$phase
window.location = url;
} else {
$location.path(url);
$scope.$apply();
}
};
$scope.createSummaryFromBody = function(){
$scope.novelty.summary = htmlToPlainText($scope.novelty.body)
}
});
|
{
"content_hash": "08f977c02421f9e0a798c7ee450b7c10",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 114,
"avg_line_length": 32.05797101449275,
"alnum_prop": 0.6184448462929476,
"repo_name": "katana-ua/nasha_lepta",
"id": "d0eb590922c19deb5f9c320d4b07d2ff36cf6417",
"size": "2212",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "public/scripts/controllers/news/update.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "24139"
},
{
"name": "CSS",
"bytes": "17961"
},
{
"name": "HTML",
"bytes": "79559"
},
{
"name": "JavaScript",
"bytes": "452543"
}
],
"symlink_target": ""
}
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!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/html; charset=UTF-8" />
<title>DB_ENV->set_lk_partitions()</title>
<link rel="stylesheet" href="apiReference.css" type="text/css" />
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
<link rel="start" href="index.html" title="Berkeley DB C API Reference" />
<link rel="up" href="lock.html" title="Chapter 6. The DB_LOCK Handle" />
<link rel="prev" href="envset_lk_max_objects.html" title="DB_ENV->set_lk_max_objects()" />
<link rel="next" href="envset_lk_priority.html" title="DB_ENV->set_lk_priority()" />
</head>
<body>
<div class="navheader">
<table width="100%" summary="Navigation header">
<tr>
<th colspan="3" align="center">DB_ENV->set_lk_partitions()</th>
</tr>
<tr>
<td width="20%" align="left"><a accesskey="p" href="envset_lk_max_objects.html">Prev</a> </td>
<th width="60%" align="center">Chapter 6.
The DB_LOCK Handle
</th>
<td width="20%" align="right"> <a accesskey="n" href="envset_lk_priority.html">Next</a></td>
</tr>
</table>
<hr />
</div>
<div class="sect1" lang="en" xml:lang="en">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a id="envset_lk_partitions"></a>DB_ENV->set_lk_partitions()</h2>
</div>
</div>
</div>
<pre class="programlisting">#include <db.h>
int
DB_ENV->set_lk_partitions(DB_ENV *dbenv, u_int32_t partitions); </pre>
<p>
Set the number of lock table partitions in the Berkeley DB
environment. The default value is 10 times the number of CPUs on the
system if there is more than one CPU. Increasing the number of
partitions can provide for greater throughput on a system with
multiple CPUs and more than one thread contending for the lock
manager. On single processor systems more than one partition may
increase the overhead of the lock manager. Systems often report
threading contexts as CPUs. If your system does this, set the number of
partitions to 1 to get optimal performance.
</p>
<p>
The database environment's number of partitions may also be configured
using the environment's <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a> file. The
syntax of the entry in that file is a single line with the string
"set_lk_partitions", one or more whitespace characters, and the number
of partitions. Because the <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a> file is
read when the database environment is opened, it will silently
overrule configuration done before that time.
</p>
<p>
The <code class="methodname">DB_ENV->set_lk_partitions()</code> method configures a database
environment, not only operations performed using the specified
<a class="link" href="env.html" title="Chapter 5. The DB_ENV Handle">DB_ENV</a> handle.
</p>
<p>
The <code class="methodname">DB_ENV->set_lk_partitions()</code> method may not be called after the
<a class="xref" href="envopen.html" title="DB_ENV->open()">DB_ENV->open()</a> method is
called. If the database environment already exists when
<a class="xref" href="envopen.html" title="DB_ENV->open()">DB_ENV->open()</a> is called, the
information specified to <code class="methodname">DB_ENV->set_lk_partitions()</code> will be ignored.
</p>
<p>
The <code class="methodname">DB_ENV->set_lk_partitions()</code> <span>
<span>
method returns a non-zero error value on failure and 0 on success.
</span>
</span>
</p>
<div class="sect2" lang="en" xml:lang="en">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a id="id3870493"></a>Parameters</h3>
</div>
</div>
</div>
<div class="sect3" lang="en" xml:lang="en">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a id="id3870697"></a>partitions</h4>
</div>
</div>
</div>
<p>
The <span class="bold"><strong>partitions</strong></span> parameter is the
number of partitions to be configured in the Berkeley DB environment.
</p>
</div>
</div>
<div class="sect2" lang="en" xml:lang="en">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a id="id3870633"></a>Errors</h3>
</div>
</div>
</div>
<p>
The <code class="methodname">DB_ENV->set_lk_partitions()</code> <span>
<span>
method may fail and return one of the following non-zero errors:
</span>
</span>
</p>
<div class="sect3" lang="en" xml:lang="en">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a id="id3870836"></a>EINVAL</h4>
</div>
</div>
</div>
<p>
If the method was called after <a class="xref" href="envopen.html" title="DB_ENV->open()">DB_ENV->open()</a>
was called; or if an invalid flag value or parameter was specified.
</p>
</div>
</div>
<div class="sect2" lang="en" xml:lang="en">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a id="id3870818"></a>Class</h3>
</div>
</div>
</div>
<p>
<a class="link" href="env.html" title="Chapter 5. The DB_ENV Handle">DB_ENV</a>,
<a class="link" href="lock.html" title="Chapter 6. The DB_LOCK Handle">DB_LOCK</a>
</p>
</div>
<div class="sect2" lang="en" xml:lang="en">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a id="id3870871"></a>See Also</h3>
</div>
</div>
</div>
<p>
<a class="xref" href="lock.html#locklist" title="Locking Subsystem and Related Methods">Locking Subsystem and Related Methods</a>
</p>
</div>
</div>
<div class="navfooter">
<hr />
<table width="100%" summary="Navigation footer">
<tr>
<td width="40%" align="left"><a accesskey="p" href="envset_lk_max_objects.html">Prev</a> </td>
<td width="20%" align="center">
<a accesskey="u" href="lock.html">Up</a>
</td>
<td width="40%" align="right"> <a accesskey="n" href="envset_lk_priority.html">Next</a></td>
</tr>
<tr>
<td width="40%" align="left" valign="top">DB_ENV->set_lk_max_objects() </td>
<td width="20%" align="center">
<a accesskey="h" href="index.html">Home</a>
</td>
<td width="40%" align="right" valign="top"> DB_ENV->set_lk_priority()</td>
</tr>
</table>
</div>
</body>
</html>
|
{
"content_hash": "efb0123056d988ddbb38f28e7833b128",
"timestamp": "",
"source": "github",
"line_count": 180,
"max_line_length": 151,
"avg_line_length": 43.26111111111111,
"alnum_prop": 0.5419288557852832,
"repo_name": "jtimberman/omnibus",
"id": "b91e5f47b637ae4cbfa423534a335638218d96e8",
"size": "7803",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "source/db-5.0.26.NC/docs/api_reference/C/envset_lk_partitions.html",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
}
|
presence_bot
============
The Loveland CreatorSpace presence bot - code and documentation
Ultimately, the presence bot will allow people to log in remotely to monitor long running print jobs, take a virtual tour of the space, or attend meetings remotely! But really, it's just for fun - because we like to make things.
Here is an illustration of the concept, and below you can meet v0.1.0 of presence bot
-----------

Meet v0.1.0:

|
{
"content_hash": "1c4bd4badf0935164212da0b7b0a85ad",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 228,
"avg_line_length": 41.588235294117645,
"alnum_prop": 0.751060820367751,
"repo_name": "lovelandcreatorspace/presence_bot",
"id": "9653baf8b57a661315fc9edab6e592a78a3a06b1",
"size": "707",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Arduino",
"bytes": "9833"
},
{
"name": "C",
"bytes": "17998"
}
],
"symlink_target": ""
}
|
<?php
namespace common\assets;
use yii\web\AssetBundle;
/**
* @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0
*/
class ShopUIUnifyAsset extends AssetBundle
{
public $sourcePath = '@themes/unify';
public $baseUrl = '@web';
public $css = [
];
public $js = [
];
public $depends = [
//'yii\web\YiiAsset',
];
}
|
{
"content_hash": "16c36d041e9b8c70b1eb098be99c7ae8",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 42,
"avg_line_length": 14.4,
"alnum_prop": 0.575,
"repo_name": "fnoorman/dev",
"id": "7a2d708b24d39217769bfdec3acc5e15ac4d6bcb",
"size": "504",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "common/assets/ShopUIUnifyAsset.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "ApacheConf",
"bytes": "866"
},
{
"name": "Batchfile",
"bytes": "1026"
},
{
"name": "CSS",
"bytes": "4794162"
},
{
"name": "CoffeeScript",
"bytes": "16723"
},
{
"name": "HTML",
"bytes": "608610"
},
{
"name": "JavaScript",
"bytes": "2798160"
},
{
"name": "PHP",
"bytes": "723422"
},
{
"name": "Python",
"bytes": "16281"
},
{
"name": "Shell",
"bytes": "1061"
}
],
"symlink_target": ""
}
|
AssetManager::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web server when you make code changes.
config.cache_classes = false
config.eager_load = false
# Show full error reports and disable caching
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
# Don't care if the mailer can't send
config.action_mailer.raise_delivery_errors = true
config.action_mailer.default_url_options = { host: "localhost:3000" }
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
address: ENV['mail_server'],
port: ENV['mail_port'],
authentication: ENV['mail_auth'],
enable_starttls_auto: true,
user_name: ENV['gmail_user'],
password: ENV['gmail_pass']
}
# Print deprecation notices to the Rails logger
config.active_support.deprecation = :log
# Only use best-standards-support built into browsers
config.action_dispatch.best_standards_support = :builtin
# Do not compress assets
config.assets.compress = false
# Expands the lines which load the assets
config.assets.debug = true
end
|
{
"content_hash": "ba99ff75e4968b2017efdc52b978b8ea",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 84,
"avg_line_length": 33.48780487804878,
"alnum_prop": 0.7363437727603788,
"repo_name": "RyanMacG/Asset-Manager",
"id": "80afa88998a27018392dfd893841a87cc00f9a6f",
"size": "1373",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "config/environments/development.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "9827"
},
{
"name": "CoffeeScript",
"bytes": "916"
},
{
"name": "JavaScript",
"bytes": "663"
},
{
"name": "Ruby",
"bytes": "76427"
},
{
"name": "Shell",
"bytes": "1354"
}
],
"symlink_target": ""
}
|
from .proxy import proxy_server
|
{
"content_hash": "8eea5af27986b546d5560620fe720bd2",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 31,
"avg_line_length": 32,
"alnum_prop": 0.8125,
"repo_name": "coryking/proximate",
"id": "9ff4d5699864797830e2bae8c047a65e58868898",
"size": "44",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "proximate/__init__.py",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
}
|
package course.examples.placebadges;
import android.app.Activity;
import android.app.ActivityOptions;
import android.content.Context;
import android.content.Intent;
import android.location.Location;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import java.util.List;
public class PlaceViewAdapter extends RecyclerView.Adapter<PlaceViewAdapter.ViewHolder> {
private final List<PlaceRecord> mPlaces;
private final int mRowLayout;
private final Context mContext;
public PlaceViewAdapter(List<PlaceRecord> places, int rowLayout, Context context) {
mPlaces = places;
mContext = context;
mRowLayout = rowLayout;
}
// Create a new ViewHolder
@Override
public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
View v = LayoutInflater.from(mContext).inflate(mRowLayout, viewGroup, false);
return new PlaceViewAdapter.ViewHolder(v);
}
// Set up displayable information
@Override
public void onBindViewHolder(ViewHolder viewHolder, int i) {
viewHolder.mPlaceRecord = mPlaces.get(i);
viewHolder.mFlagImage.setImageBitmap(viewHolder.mPlaceRecord.getFlagBitmap());
viewHolder.mPlaceName.setText(viewHolder.mPlaceRecord.getPlace() + ",");
viewHolder.mCountryName.setText(viewHolder.mPlaceRecord.getCountryName());
}
// ViewHolder for RecyclerView
public static class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
public final TextView mCountryName;
public final ImageView mFlagImage;
public final TextView mPlaceName;
private PlaceRecord mPlaceRecord;
public ViewHolder(View itemView) {
super(itemView);
mCountryName = (TextView) itemView.findViewById(course.examples.placebadges.R.id.country_name);
mFlagImage = (ImageView) itemView.findViewById(course.examples.placebadges.R.id.flag_image);
mPlaceName = (TextView) itemView.findViewById(course.examples.placebadges.R.id.place_name);
// Set an OnClickListener on the itemView
itemView.setOnClickListener(this);
}
@Override
public void onClick(View view) {
Intent intent = new Intent(view.getContext(), PlaceViewDetailActivity.class);
intent.putExtras(mPlaceRecord.packageIntent());
// Set up Transition to PlaceViewDetailActivity
ActivityOptions activityOptions = ActivityOptions.makeSceneTransitionAnimation((Activity) view.getContext(), mFlagImage, "flag_image");
// Start PlaceViewDetailActivity
view.getContext().startActivity(intent, activityOptions.toBundle());
}
}
@Override
public int getItemCount() {
return (null == mPlaces) ? 0 : mPlaces.size();
}
public boolean intersects(Location location) {
for (PlaceRecord item : mPlaces) {
if (item.intersects(location)) {
return true;
}
}
return false;
}
public void add(PlaceRecord listItem) {
mPlaces.add(listItem);
notifyDataSetChanged();
}
public void removeAllPlaceBadges() {
mPlaces.clear();
this.notifyDataSetChanged();
}
}
|
{
"content_hash": "2571d7cb41674798b02f8d629ed1746f",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 147,
"avg_line_length": 34.64646464646464,
"alnum_prop": 0.6918367346938775,
"repo_name": "deathping1994/androidui",
"id": "d1aa82c0159d95f107cc6727391f2e83979658d1",
"size": "3430",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "Examples/PlaceBadges/app/src/main/java/course/examples/placebadges/PlaceViewAdapter.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "197566"
}
],
"symlink_target": ""
}
|
namespace Gu.Roslyn.Asserts.Analyzers
{
using System.Collections.Immutable;
using System.Composition;
using System.Threading.Tasks;
using Gu.Roslyn.AnalyzerExtensions;
using Gu.Roslyn.CodeFixExtensions;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CodeActions;
using Microsoft.CodeAnalysis.CodeFixes;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
[ExportCodeFixProvider(LanguageNames.CSharp, Name = nameof(MakePublicStaticFix))]
[Shared]
internal class MakePublicStaticFix : CodeFixProvider
{
public override ImmutableArray<string> FixableDiagnosticIds { get; } = ImmutableArray.Create(
Descriptors.GURA07TestClassShouldBePublicStatic.Id);
public override FixAllProvider GetFixAllProvider() => WellKnownFixAllProviders.BatchFixer;
public override async Task RegisterCodeFixesAsync(CodeFixContext context)
{
var syntaxRoot = await context.Document.GetSyntaxRootAsync(context.CancellationToken)
.ConfigureAwait(false);
foreach (var diagnostic in context.Diagnostics)
{
if (syntaxRoot.TryFindNodeOrAncestor(diagnostic, out ClassDeclarationSyntax? classDeclaration))
{
context.RegisterCodeFix(
CodeAction.Create(
"Make public static.",
_ => Task.FromResult(context.Document.WithSyntaxRoot(
syntaxRoot.ReplaceNode(
classDeclaration,
PublicStaticRewriter.Update(classDeclaration)))),
nameof(MakePublicStaticFix)),
diagnostic);
}
}
}
private class PublicStaticRewriter : CSharpSyntaxRewriter
{
private static readonly PublicStaticRewriter Default = new PublicStaticRewriter();
public override SyntaxNode VisitFieldDeclaration(FieldDeclarationSyntax node)
{
if (IsPublicStatic(node.Modifiers))
{
return node;
}
return node.WithModifiers(Static(node.Modifiers));
}
public override SyntaxNode VisitPropertyDeclaration(PropertyDeclarationSyntax node)
{
if (IsPublicStatic(node.Modifiers))
{
return node;
}
return node.WithModifiers(Static(node.Modifiers));
}
public override SyntaxNode VisitMethodDeclaration(MethodDeclarationSyntax node)
{
if (IsPublicStatic(node.Modifiers))
{
return node;
}
return node.WithModifiers(PublicStatic(node.Modifiers));
}
internal static ClassDeclarationSyntax Update(ClassDeclarationSyntax classDeclaration)
{
classDeclaration = classDeclaration.WithModifiers(PublicStatic(classDeclaration.Modifiers));
return (ClassDeclarationSyntax)Default.Visit(classDeclaration);
}
private static SyntaxTokenList PublicStatic(SyntaxTokenList modifiers)
{
if (modifiers.TryFirst(out var first))
{
switch (first.Kind())
{
case SyntaxKind.PrivateKeyword:
case SyntaxKind.ProtectedKeyword:
case SyntaxKind.InternalKeyword:
modifiers = modifiers.Replace(
first,
SyntaxFactory.Token(SyntaxKind.PublicKeyword).WithTriviaFrom(first));
break;
case SyntaxKind.PublicKeyword:
break;
default:
modifiers = modifiers.Insert(0, SyntaxFactory.Token(SyntaxKind.PublicKeyword));
break;
}
}
else
{
modifiers = SyntaxTokenList.Create(SyntaxFactory.Token(SyntaxKind.PublicKeyword));
}
return Static(modifiers);
}
private static SyntaxTokenList Static(SyntaxTokenList modifiers)
{
if (!modifiers.Any(SyntaxKind.StaticKeyword))
{
var first = modifiers.First();
switch (first.Kind())
{
case SyntaxKind.PrivateKeyword:
case SyntaxKind.ProtectedKeyword:
case SyntaxKind.InternalKeyword:
case SyntaxKind.PublicKeyword:
return modifiers.Insert(1, SyntaxFactory.Token(SyntaxKind.StaticKeyword));
default:
return modifiers.Insert(0, SyntaxFactory.Token(SyntaxKind.StaticKeyword));
}
}
return modifiers;
}
private static bool IsPublicStatic(SyntaxTokenList modifiers) => modifiers.Any(SyntaxKind.PublicKeyword) &&
modifiers.Any(SyntaxKind.StaticKeyword);
}
}
}
|
{
"content_hash": "16cb04ee65b624d8fc14dae9295b74ef",
"timestamp": "",
"source": "github",
"line_count": 136,
"max_line_length": 119,
"avg_line_length": 40.955882352941174,
"alnum_prop": 0.5364452423698384,
"repo_name": "JohanLarsson/Gu.Roslyn.Asserts",
"id": "29b7ff144155a2d271fdd6e645f272bec245f159",
"size": "5570",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Gu.Roslyn.Asserts.Analyzers/Fixes/MakePublicStaticFix.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "590810"
}
],
"symlink_target": ""
}
|
package com.uzen.slimapk;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import java.nio.file.DirectoryStream;
import java.util.ArrayList;
import java.util.Collections;
import java.io.IOException;
import com.uzen.slimapk.struct.AndroidConstants;
public class LibraryFilter {
private final Path LIB_DIR;
private ArrayList<String> architectures;
public LibraryFilter(Path libdir) {
this.LIB_DIR = libdir;
}
public int parse(String abi) throws IOException {
if (Files.notExists(LIB_DIR))
return -1;
architectures = list(LIB_DIR);
Collections.sort(architectures);
if (abi == null)
return architectures.size();
int index = architectures.indexOf(abi);
if (index < 0) {
index = architectures.indexOf(AndroidConstants.ABI_ARM);
}
if (index >= 0) {
return index;
} else {
throw new IOException("Incorrect architecture: " + abi);
}
}
public void extractAll(Path outdir) {
int size = architectures.size();
for(int i = 0; i < size; i++){
Path dir = LIB_DIR.resolve(architectures.get(i));
copy(dir, outdir.resolve(getArch(architectures.get(i))));
}
}
public void extract(Path outdir, int index) {
Path dir = LIB_DIR.resolve(architectures.get(index));
copy(dir, outdir.resolve(getArch(architectures.get(index))));
}
public static String getArch(String abi) {
String arch = null;
switch (abi) {
case AndroidConstants.ABI_ARMv7:
arch = AndroidConstants.ARM;
break;
case AndroidConstants.ABI_ARMv8:
arch = AndroidConstants.ARM64;
break;
case AndroidConstants.ABI_X86:
arch = AndroidConstants.X86;
break;
case AndroidConstants.ABI_X86_64:
arch = AndroidConstants.X86_64;
break;
default:
arch = AndroidConstants.ARM;
}
return arch;
}
public static ArrayList<String>list(Path dir) {
ArrayList<String> list = new ArrayList<>();
try (DirectoryStream < Path > stream = Files.newDirectoryStream(dir)) {
for (Path file: stream) {
list.add(getFileName(file));
}
} catch (IOException e) {}
return list;
}
private static void copy(Path in, Path out) {
try (DirectoryStream<Path> stream = Files.newDirectoryStream(in)) {
Files.createDirectories(out);
for (Path file: stream) {
Files.copy(file, out.resolve(file.getFileName().toString()), StandardCopyOption.REPLACE_EXISTING);
}
} catch (IOException e) {}
}
private static String getFileName(Path file) {
String path = file.toString();
return path.substring(path.indexOf("/", 2)+1, path.length()-1);
}
}
|
{
"content_hash": "5b01dc19250aa76c2b3d1183e54c823c",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 102,
"avg_line_length": 25.116504854368934,
"alnum_prop": 0.690761499806726,
"repo_name": "uzen/slimapk",
"id": "dfe97685a5155aa663e741885e5dc31df4db9793",
"size": "2587",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "java/com/uzen/slimapk/LibraryFilter.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "123905"
}
],
"symlink_target": ""
}
|
using OverviewApp.ViewModels;
namespace OverviewApp.Auxiliary
{
/// <summary>
/// Used as message, to switch the view to a different one. Whatever you set
/// to catches this message will be the one changing the views.
/// </summary>
/// <remarks>
/// NOT USED IN THIS TEMPLATE. This is just the prototype to
/// show you how you can easily do it.
/// </remarks>
public class SwitchView
{
#region
public SwitchView(MyBase_ViewModel viewmodel)
{
ViewModel = viewmodel;
}
#endregion
#region Properties
public MyBase_ViewModel ViewModel { get; set; }
#endregion
}
}
|
{
"content_hash": "5869bea27f7011640493c653983906af",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 84,
"avg_line_length": 23.466666666666665,
"alnum_prop": 0.5880681818181818,
"repo_name": "salda8/Overview-Application",
"id": "03dffd40cfbd9b356ef5fb6a48158e08c1d7078f",
"size": "704",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Overview Application/Auxiliary/SwitchView.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "407400"
},
{
"name": "Smalltalk",
"bytes": "5762"
}
],
"symlink_target": ""
}
|
#ifndef s11n_util_NODE_UTIL_HPP_INCLUDED
#define s11n_util_NODE_UTIL_HPP_INCLUDED 1
#include <map>
#include <list>
#include <s11n.net/s11n/traits.hpp>
namespace s11n {
/**
The s11n::util namespace encapsulates some utility code
for client-side use alongside the s11n framework.
*/
namespace util {
/**
node_tree assist in manipulating child/parent relationships
in a tree of data nodes.
NodeT must usable via s11n::node_traits<NodeT>.
An example use for this class: the s11nbrowser app
uses it to assist in the mapping of s-nodes to
UI elements and for cutting/pasting subtrees of nodes.
*/
template <typename NodeT>
class node_tree
{
public:
typedef NodeT node_type;
typedef ::s11n::node_traits< node_type > traits_type;
/**
Ownership of node does not change, and root should
outlive this object, or at least live until
clime_tree() is called with another root.
root may be 0.
*/
explicit node_tree( node_type * root ) : m_root(root), m_count(0)
{
this->climb_tree( root );
}
node_tree() : m_root(0), m_count(0)
{}
~node_tree() {}
typedef typename traits_type::child_list_type list_type;
/**
Maps relations of parens to children in node tree,
using the given root node. Returns the cumulative
number of nodes traversed.
Ownership of node does not change, so node must
outlive this object or, if it is destroyed first,
climb_tree() must be called with another node
before any other API of this class is called.
If node == 0 then this object's data is cleared and
0 is returned.
The second parameter is for internal use: never
pass a value, or pass 0 if you must pass something.
*/
size_t climb_tree( node_type * node, size_t internal_use = 0 )
{
if( ! node )
{
this->clear();
return 0;
}
else if( 0 == internal_use ) // first iteration: clear state
{
this->clear();
this->m_root = node;
this->m_rmap[node] = 0;
}
++this->m_count;
list_type & chlist = traits_type::children(*node);
typename list_type::iterator it = chlist.begin(),
et = chlist.end();
for( ; et != it; ++it )
{
this->m_rmap[(*it)] = node;
this->climb_tree( (*it), 1 + internal_use );
}
return this->m_count;
}
/**
Returns the parent node of node, of 0 if no parent
was mapped by climb_tree().
The caller does not own the pointer: it is owned by
its own parent. If it has no parent, then "someone
else" is assumed to have ownership of it (whoever
gave it to this object, presumably).
*/
node_type * parent_of( node_type & node )
{
typename reverse_map_type::iterator it = this->m_rmap.find( &node );
if( this->m_rmap.end() == it ) return 0;
return (*it).second;
}
/**
A convenience wrapper around
traits_type::children(node).
*/
list_type & children_of( node_type & node )
{
return traits_type::children(node);
}
/**
Removes the given node from the tree. If it returns true,
the caller owns node, otherwise ownership is unchanged.
*/
bool take_node( node_type * node )
{
typename reverse_map_type::iterator rit = this->m_rmap.find( node );
if( this->m_rmap.end() == rit ) return false;
node_type * p = (*rit).second;
if( p )
{
// take node from parent's list...
typename list_type::iterator it = traits_type::children(*p).begin(),
et = traits_type::children(*p).end();
for( ; et != it; ++it )
{
if( (*it) == node )
{
traits_type::children(*p).erase( it );
break;
}
}
}
this->m_rmap.erase(rit);
if( node == this->root() )
{
this->clear();
}
return true;
}
/**
Reparents node n to parent node newp.
Both n and newp are assumed to be under root().
n may not be root() and neither n nor newp may be
0.
Returns true on success, false on error.
If this function returns false then ownership is
unchanged and there are no side effects. If it
returns true, ownership of n *typically* moves to
newp. That is, newp will delete n when newp is
destroyed. More specifically, that depends on
node_type's implementation, but s11n::data_node and
s11n::s11n_node both work that way.
*/
bool reparent( node_type * n, node_type * newp )
{
if( (!n) || (!newp) || (!this->root()) || (this->root() == n) )
{
return false;
}
if( ! this->take_child( n ) )
{
return false;
}
this->m_rmap[n] = newp;
traits_type::children(*newp).push_back( n );
return true;
}
/**
Returns this object's root node. Ownership is not
changed.
*/
node_type * root() { return this->m_root; }
/**
Clears this object's data and sets its root() node
to 0. This object does not own root() and therefor
does not delete it.
*/
void clear()
{
this->m_count = 0;
this->m_rmap.clear();
this->m_root = 0;
}
private:
typedef std::map< node_type *, node_type * > reverse_map_type; // children to parens
reverse_map_type m_rmap;
node_type * m_root;
size_t m_count;
};
} } // namespace util
#endif // s11n_util_NODE_UTIL_HPP_INCLUDED
|
{
"content_hash": "a34e0b6efc690767eefc8dd671f93f06",
"timestamp": "",
"source": "github",
"line_count": 215,
"max_line_length": 100,
"avg_line_length": 37.04651162790697,
"alnum_prop": 0.4064030131826742,
"repo_name": "hydratim/opennsl-man",
"id": "edee8950460ab07b80020dd5c3000803106fd9de",
"size": "7965",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "deps/libs11n-1.2.10/src/nodeutil/node_tree.hpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C++",
"bytes": "32689"
},
{
"name": "Makefile",
"bytes": "597"
}
],
"symlink_target": ""
}
|
Node Roles are the central unit of work in OpenCrowbar.
|
{
"content_hash": "4f9ba0a2b67503b8e87cf22744c9ef77",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 55,
"avg_line_length": 55,
"alnum_prop": 0.8181818181818182,
"repo_name": "lhrc-mikeyp/opencrowbar-docs",
"id": "b6281f585b6e9cdee34c7289b01b75b6c199139b",
"size": "75",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "doc/development-guides/model/node_role.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Python",
"bytes": "9412"
}
],
"symlink_target": ""
}
|
<?php
namespace Rimbo\Console\Commands;
use Composer\Json\JsonFile;
use Composer\Package\Archiver\PharArchiver;
use Composer\Util\Filesystem;
use Pagekit\Application\Console\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
class ArchiveCommand extends Command
{
/**
* {@inheritdoc}
*/
protected $name = 'archive';
/**
* {@inheritdoc}
*/
protected $description = 'Archives an extension or theme.';
/**
* {@inheritdoc}
*/
protected function configure()
{
$this->addArgument('name', InputArgument::REQUIRED, 'Package name');
$this->addOption('dir', false, InputOption::VALUE_OPTIONAL, 'Write the archive to this directory');
}
/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$filesystem = new Filesystem();
$packageName = $this->getPackageFilename($name = $this->argument('name'));
if (!($targetDir = $this->option('dir'))) {
$targetDir = $this->container->path();
}
$sourcePath = $this->container->get('path.packages').'/'.$name;
$filesystem->ensureDirectoryExists($targetDir);
$target = realpath($targetDir).'/'.$packageName.'.zip';
$filesystem->ensureDirectoryExists(dirname($target));
$exludes = [];
if (file_exists($composerJsonPath = $sourcePath.'/composer.json')) {
$jsonFile = new JsonFile($composerJsonPath);
$jsonData = $jsonFile->read();
if (!empty($jsonData['archive']['exclude'])) {
$exludes = ($jsonData['archive']['exclude']);
}
if (!empty($jsonData['archive']['scripts'])) {
system($jsonData['archive']['scripts'], $return);
if ($return !== 0) {
throw new \RuntimeException('Can not executes scripts.');
}
}
}
$tempTarget = sys_get_temp_dir().'/composer_archive'.uniqid().'.zip';
$filesystem->ensureDirectoryExists(dirname($tempTarget));
$archiver = new PharArchiver();
$archivePath = $archiver->archive($sourcePath, $tempTarget, 'zip', $exludes);
rename($archivePath, $target);
$filesystem->remove($tempTarget);
return $target;
}
protected function getPackageFilename($name)
{
// TODO: Make this more robust.
return preg_replace('#[^a-z0-9-_]#i', '-', $name);
}
}
|
{
"content_hash": "bab4d76a7d0421924a9b418554b4cde9",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 107,
"avg_line_length": 29.876404494382022,
"alnum_prop": 0.5957126739375705,
"repo_name": "aqnouch/rimbo",
"id": "f4f2398daa4ffdc9de7aa3cacc292731be4aac1f",
"size": "2659",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "app/console/src/Commands/ArchiveCommand.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "1845"
},
{
"name": "CSS",
"bytes": "171906"
},
{
"name": "HTML",
"bytes": "17353"
},
{
"name": "JavaScript",
"bytes": "161967"
},
{
"name": "PHP",
"bytes": "1003143"
},
{
"name": "Vue",
"bytes": "168759"
}
],
"symlink_target": ""
}
|
<?xml version="1.0" encoding="UTF-8"?>
<billStatus>
<bill>
<relatedBills />
<latestAction>
<actionDate>2017-07-20</actionDate>
<links />
<text>Sponsor introductory remarks on measure. (CR H6046)</text>
</latestAction>
<introducedDate>2017-07-19</introducedDate>
<committeeReports />
<cosponsors>
<item>
<district>21</district>
<firstName>Elise</firstName>
<identifiers>
<lisID>2263</lisID>
<bioguideId>S001196</bioguideId>
<gpoId />
</identifiers>
<isOriginalCosponsor>True</isOriginalCosponsor>
<sponsorshipDate>2017-07-19</sponsorshipDate>
<middleName>M.</middleName>
<lastName>Stefanik</lastName>
<bioguideId>S001196</bioguideId>
<fullName>Rep. Stefanik, Elise M. [R-NY-21]</fullName>
<party>R</party>
<state>NY</state>
<sponsorshipWithdrawnDate />
</item>
<item>
<district>30</district>
<firstName>EDDIE</firstName>
<identifiers>
<lisID>599</lisID>
<gpoId>8186</gpoId>
<bioguideId>J000126</bioguideId>
</identifiers>
<isOriginalCosponsor>True</isOriginalCosponsor>
<sponsorshipDate>2017-07-19</sponsorshipDate>
<middleName>BERNICE</middleName>
<lastName>JOHNSON</lastName>
<bioguideId>J000126</bioguideId>
<fullName>Rep. Johnson, Eddie Bernice [D-TX-30]</fullName>
<party>D</party>
<state>TX</state>
<sponsorshipWithdrawnDate />
</item>
<item>
<district>2</district>
<firstName>Dwight</firstName>
<identifiers>
<lisID>2298</lisID>
<bioguideId>E000296</bioguideId>
<gpoId />
</identifiers>
<isOriginalCosponsor>True</isOriginalCosponsor>
<sponsorshipDate>2017-07-19</sponsorshipDate>
<middleName />
<lastName>Evans</lastName>
<bioguideId>E000296</bioguideId>
<fullName>Rep. Evans, Dwight [D-PA-2]</fullName>
<party>D</party>
<state>PA</state>
<sponsorshipWithdrawnDate />
</item>
<item>
<district>5</district>
<firstName>GREGORY</firstName>
<identifiers>
<lisID>1506</lisID>
<gpoId>8067</gpoId>
<bioguideId>M001137</bioguideId>
</identifiers>
<isOriginalCosponsor>True</isOriginalCosponsor>
<sponsorshipDate>2017-07-19</sponsorshipDate>
<middleName>W.</middleName>
<lastName>MEEKS</lastName>
<bioguideId>M001137</bioguideId>
<fullName>Rep. Meeks, Gregory W. [D-NY-5]</fullName>
<party>D</party>
<state>NY</state>
<sponsorshipWithdrawnDate />
</item>
<item>
<district>0</district>
<firstName>ELEANOR</firstName>
<identifiers>
<gpoId>7871</gpoId>
<bioguideId>N000147</bioguideId>
<lisID>868</lisID>
</identifiers>
<isOriginalCosponsor>True</isOriginalCosponsor>
<sponsorshipDate>2017-07-19</sponsorshipDate>
<middleName>HOLMES</middleName>
<lastName>NORTON</lastName>
<bioguideId>N000147</bioguideId>
<fullName>Rep. Norton, Eleanor Holmes [D-DC-At Large]</fullName>
<party>D</party>
<state>DC</state>
<sponsorshipWithdrawnDate />
</item>
<item>
<district>20</district>
<firstName>Paul</firstName>
<identifiers>
<gpoId>8082</gpoId>
<bioguideId>T000469</bioguideId>
<lisID>1942</lisID>
</identifiers>
<isOriginalCosponsor>True</isOriginalCosponsor>
<sponsorshipDate>2017-07-19</sponsorshipDate>
<middleName />
<lastName>Tonko</lastName>
<bioguideId>T000469</bioguideId>
<fullName>Rep. Tonko, Paul [D-NY-20]</fullName>
<party>D</party>
<state>NY</state>
<sponsorshipWithdrawnDate />
</item>
<item>
<district>8</district>
<firstName>Donald</firstName>
<identifiers>
<lisID>2272</lisID>
<bioguideId>B001292</bioguideId>
<gpoId />
</identifiers>
<isOriginalCosponsor>True</isOriginalCosponsor>
<sponsorshipDate>2017-07-19</sponsorshipDate>
<middleName>S.</middleName>
<lastName>Beyer</lastName>
<bioguideId>B001292</bioguideId>
<fullName>Rep. Beyer, Donald S., Jr. [D-VA-8]</fullName>
<party>D</party>
<state>VA</state>
<sponsorshipWithdrawnDate />
</item>
<item>
<district>1</district>
<firstName>Colleen</firstName>
<identifiers>
<bioguideId>H001050</bioguideId>
<lisID>2010</lisID>
<gpoId>7912</gpoId>
</identifiers>
<isOriginalCosponsor>True</isOriginalCosponsor>
<sponsorshipDate>2017-07-19</sponsorshipDate>
<middleName />
<lastName>Hanabusa</lastName>
<bioguideId>H001050</bioguideId>
<fullName>Rep. Hanabusa, Colleen [D-HI-1]</fullName>
<party>D</party>
<state>HI</state>
<sponsorshipWithdrawnDate />
</item>
<item>
<district>13</district>
<firstName>Charlie</firstName>
<identifiers>
<lisID>2321</lisID>
<bioguideId>C001111</bioguideId>
<gpoId />
</identifiers>
<isOriginalCosponsor>True</isOriginalCosponsor>
<sponsorshipDate>2017-07-19</sponsorshipDate>
<middleName />
<lastName>Crist</lastName>
<bioguideId>C001111</bioguideId>
<fullName>Rep. Crist, Charlie [D-FL-13]</fullName>
<party>D</party>
<state>FL</state>
<sponsorshipWithdrawnDate />
</item>
<item>
<district>7</district>
<firstName>Stephanie</firstName>
<identifiers>
<bioguideId>M001202</bioguideId>
<gpoId />
<lisID>2318</lisID>
</identifiers>
<isOriginalCosponsor>True</isOriginalCosponsor>
<sponsorshipDate>2017-07-19</sponsorshipDate>
<middleName>N.</middleName>
<lastName>Murphy</lastName>
<bioguideId>M001202</bioguideId>
<fullName>Rep. Murphy, Stephanie N. [D-FL-7]</fullName>
<party>D</party>
<state>FL</state>
<sponsorshipWithdrawnDate />
</item>
<item>
<district>5</district>
<firstName>Elizabeth</firstName>
<identifiers>
<bioguideId>E000293</bioguideId>
<lisID>2114</lisID>
<gpoId />
</identifiers>
<isOriginalCosponsor>False</isOriginalCosponsor>
<sponsorshipDate>2017-07-25</sponsorshipDate>
<middleName>H.</middleName>
<lastName>Esty</lastName>
<bioguideId>E000293</bioguideId>
<fullName>Rep. Esty, Elizabeth H. [D-CT-5]</fullName>
<party>D</party>
<state>CT</state>
<sponsorshipWithdrawnDate />
</item>
<item>
<district>17</district>
<firstName>Ro</firstName>
<identifiers>
<bioguideId>K000389</bioguideId>
<gpoId />
<lisID>2308</lisID>
</identifiers>
<isOriginalCosponsor>False</isOriginalCosponsor>
<sponsorshipDate>2017-07-25</sponsorshipDate>
<middleName />
<lastName>Khanna</lastName>
<bioguideId>K000389</bioguideId>
<fullName>Rep. Khanna, Ro [D-CA-17]</fullName>
<party>D</party>
<state>CA</state>
<sponsorshipWithdrawnDate />
</item>
<item>
<district>25</district>
<firstName>LOUISE</firstName>
<identifiers>
<gpoId>8089</gpoId>
<lisID>1069</lisID>
<bioguideId>S000480</bioguideId>
</identifiers>
<isOriginalCosponsor>False</isOriginalCosponsor>
<sponsorshipDate>2017-07-25</sponsorshipDate>
<middleName>M.</middleName>
<lastName>SLAUGHTER</lastName>
<bioguideId>S000480</bioguideId>
<fullName>Rep. Slaughter, Louise McIntosh [D-NY-25]</fullName>
<party>D</party>
<state>NY</state>
<sponsorshipWithdrawnDate />
</item>
<item>
<district>9</district>
<firstName>Darren</firstName>
<identifiers>
<gpoId />
<lisID>2319</lisID>
<bioguideId>S001200</bioguideId>
</identifiers>
<isOriginalCosponsor>False</isOriginalCosponsor>
<sponsorshipDate>2017-07-27</sponsorshipDate>
<middleName />
<lastName>Soto</lastName>
<bioguideId>S001200</bioguideId>
<fullName>Rep. Soto, Darren [D-FL-9]</fullName>
<party>D</party>
<state>FL</state>
<sponsorshipWithdrawnDate />
</item>
<item>
<district>13</district>
<firstName>TIM</firstName>
<identifiers>
<gpoId>8107</gpoId>
<bioguideId>R000577</bioguideId>
<lisID>1756</lisID>
</identifiers>
<isOriginalCosponsor>False</isOriginalCosponsor>
<sponsorshipDate>2017-07-27</sponsorshipDate>
<middleName />
<lastName>RYAN</lastName>
<bioguideId>R000577</bioguideId>
<fullName>Rep. Ryan, Tim [D-OH-13]</fullName>
<party>D</party>
<state>OH</state>
<sponsorshipWithdrawnDate />
</item>
<item>
<district>0</district>
<firstName>Madeleine</firstName>
<identifiers>
<bioguideId>B001245</bioguideId>
<lisID>1723</lisID>
<gpoId>7911</gpoId>
</identifiers>
<isOriginalCosponsor>False</isOriginalCosponsor>
<sponsorshipDate>2017-07-27</sponsorshipDate>
<middleName>Z.</middleName>
<lastName>Bordallo</lastName>
<bioguideId>B001245</bioguideId>
<fullName>Rep. Bordallo, Madeleine Z. [D-GU-At Large]</fullName>
<party>D</party>
<state>GU</state>
<sponsorshipWithdrawnDate />
</item>
<item>
<district>33</district>
<firstName>Ted</firstName>
<identifiers>
<gpoId />
<lisID>2230</lisID>
<bioguideId>L000582</bioguideId>
</identifiers>
<isOriginalCosponsor>False</isOriginalCosponsor>
<sponsorshipDate>2017-08-01</sponsorshipDate>
<middleName />
<lastName>Lieu</lastName>
<bioguideId>L000582</bioguideId>
<fullName>Rep. Lieu, Ted [D-CA-33]</fullName>
<party>D</party>
<state>CA</state>
<sponsorshipWithdrawnDate />
</item>
<item>
<district>10</district>
<firstName>Barbara</firstName>
<identifiers>
<bioguideId>C001105</bioguideId>
<lisID>2273</lisID>
<gpoId />
</identifiers>
<isOriginalCosponsor>False</isOriginalCosponsor>
<sponsorshipDate>2017-08-01</sponsorshipDate>
<middleName />
<lastName>Comstock</lastName>
<bioguideId>C001105</bioguideId>
<fullName>Rep. Comstock, Barbara [R-VA-10]</fullName>
<party>R</party>
<state>VA</state>
<sponsorshipWithdrawnDate />
</item>
<item>
<district>18</district>
<firstName>SHEILA</firstName>
<identifiers>
<lisID>588</lisID>
<gpoId>8174</gpoId>
<bioguideId>J000032</bioguideId>
</identifiers>
<isOriginalCosponsor>False</isOriginalCosponsor>
<sponsorshipDate>2017-08-04</sponsorshipDate>
<middleName />
<lastName>JACKSON LEE</lastName>
<bioguideId>J000032</bioguideId>
<fullName>Rep. Jackson Lee, Sheila [D-TX-18]</fullName>
<party>D</party>
<state>TX</state>
<sponsorshipWithdrawnDate />
</item>
<item>
<district>2</district>
<firstName>RICK</firstName>
<identifiers>
<gpoId>8206</gpoId>
<lisID>1675</lisID>
<bioguideId>L000560</bioguideId>
</identifiers>
<isOriginalCosponsor>False</isOriginalCosponsor>
<sponsorshipDate>2017-08-04</sponsorshipDate>
<middleName />
<lastName>LARSEN</lastName>
<bioguideId>L000560</bioguideId>
<fullName>Rep. Larsen, Rick [D-WA-2]</fullName>
<party>D</party>
<state>WA</state>
<sponsorshipWithdrawnDate />
</item>
<item>
<district>1</district>
<firstName>David</firstName>
<identifiers>
<lisID>2055</lisID>
<gpoId>8139</gpoId>
<bioguideId>C001084</bioguideId>
</identifiers>
<isOriginalCosponsor>False</isOriginalCosponsor>
<sponsorshipDate>2017-08-04</sponsorshipDate>
<middleName>N.</middleName>
<lastName>Cicilline</lastName>
<bioguideId>C001084</bioguideId>
<fullName>Rep. Cicilline, David N. [D-RI-1]</fullName>
<party>D</party>
<state>RI</state>
<sponsorshipWithdrawnDate />
</item>
<item>
<district>6</district>
<firstName>FRANK</firstName>
<identifiers>
<bioguideId>P000034</bioguideId>
<lisID>887</lisID>
<gpoId>8048</gpoId>
</identifiers>
<isOriginalCosponsor>False</isOriginalCosponsor>
<sponsorshipDate>2017-08-04</sponsorshipDate>
<middleName />
<lastName>PALLONE</lastName>
<bioguideId>P000034</bioguideId>
<fullName>Rep. Pallone, Frank, Jr. [D-NJ-6]</fullName>
<party>D</party>
<state>NJ</state>
<sponsorshipWithdrawnDate />
</item>
<item>
<district>9</district>
<firstName>Kyrsten</firstName>
<identifiers>
<lisID>2099</lisID>
<gpoId />
<bioguideId>S001191</bioguideId>
</identifiers>
<isOriginalCosponsor>False</isOriginalCosponsor>
<sponsorshipDate>2017-08-18</sponsorshipDate>
<middleName />
<lastName>Sinema</lastName>
<bioguideId>S001191</bioguideId>
<fullName>Rep. Sinema, Kyrsten [D-AZ-9]</fullName>
<party>D</party>
<state>AZ</state>
<sponsorshipWithdrawnDate />
</item>
<item>
<district>41</district>
<firstName>Mark</firstName>
<identifiers>
<lisID>2110</lisID>
<gpoId />
<bioguideId>T000472</bioguideId>
</identifiers>
<isOriginalCosponsor>False</isOriginalCosponsor>
<sponsorshipDate>2017-09-14</sponsorshipDate>
<middleName />
<lastName>Takano</lastName>
<bioguideId>T000472</bioguideId>
<fullName>Rep. Takano, Mark [D-CA-41]</fullName>
<party>D</party>
<state>CA</state>
<sponsorshipWithdrawnDate />
</item>
<item>
<district>3</district>
<firstName>Daniel</firstName>
<identifiers>
<bioguideId>L000563</bioguideId>
<gpoId>7923</gpoId>
<lisID>1781</lisID>
</identifiers>
<isOriginalCosponsor>False</isOriginalCosponsor>
<sponsorshipDate>2017-09-14</sponsorshipDate>
<middleName>William</middleName>
<lastName>Lipinski</lastName>
<bioguideId>L000563</bioguideId>
<fullName>Rep. Lipinski, Daniel [D-IL-3]</fullName>
<party>D</party>
<state>IL</state>
<sponsorshipWithdrawnDate />
</item>
<item>
<district>5</district>
<firstName>Susan</firstName>
<identifiers>
<bioguideId>B001284</bioguideId>
<lisID>2129</lisID>
<gpoId />
</identifiers>
<isOriginalCosponsor>False</isOriginalCosponsor>
<sponsorshipDate>2017-09-14</sponsorshipDate>
<middleName>W.</middleName>
<lastName>Brooks</lastName>
<bioguideId>B001284</bioguideId>
<fullName>Rep. Brooks, Susan W. [R-IN-5]</fullName>
<party>R</party>
<state>IN</state>
<sponsorshipWithdrawnDate />
</item>
<item>
<district>15</district>
<firstName>Eric</firstName>
<identifiers>
<bioguideId>S001193</bioguideId>
<gpoId />
<lisID>2104</lisID>
</identifiers>
<isOriginalCosponsor>False</isOriginalCosponsor>
<sponsorshipDate>2017-09-18</sponsorshipDate>
<middleName />
<lastName>Swalwell</lastName>
<bioguideId>S001193</bioguideId>
<fullName>Rep. Swalwell, Eric [D-CA-15]</fullName>
<party>D</party>
<state>CA</state>
<sponsorshipWithdrawnDate />
</item>
<item>
<district>52</district>
<firstName>Scott</firstName>
<identifiers>
<lisID>2113</lisID>
<gpoId />
<bioguideId>P000608</bioguideId>
</identifiers>
<isOriginalCosponsor>False</isOriginalCosponsor>
<sponsorshipDate>2017-10-03</sponsorshipDate>
<middleName>H.</middleName>
<lastName>Peters</lastName>
<bioguideId>P000608</bioguideId>
<fullName>Rep. Peters, Scott H. [D-CA-52]</fullName>
<party>D</party>
<state>CA</state>
<sponsorshipWithdrawnDate />
</item>
</cosponsors>
<calendarNumbers />
<subjects>
<billSubjects>
<legislativeSubjects />
<policyArea>
<name>Science, Technology, Communications</name>
</policyArea>
</billSubjects>
</subjects>
<sponsors>
<item>
<firstName>Jacky</firstName>
<lastName>Rosen</lastName>
<identifiers>
<bioguideId>R000608</bioguideId>
<gpoId />
<lisID>2339</lisID>
</identifiers>
<bioguideId>R000608</bioguideId>
<middleName />
<district>3</district>
<fullName>Rep. Rosen, Jacky [D-NV-3]</fullName>
<byRequestType />
<party>D</party>
<state>NV</state>
</item>
</sponsors>
<notes />
<createDate>2017-07-20T03:11:33Z</createDate>
<recordedVotes />
<version>1.0.0</version>
<laws />
<originChamber>House</originChamber>
<summaries>
<billSummaries />
</summaries>
<titles>
<item>
<chamberCode />
<title>Code Like a Girl Act</title>
<parentTitleType />
<titleType>Short Titles as Introduced</titleType>
<chamberName />
</item>
<item>
<chamberCode />
<title>To direct the National Science Foundation to award grants to encourage young girls to participate in computer science and other STEM activities, and for other purposes.</title>
<parentTitleType />
<titleType>Official Title as Introduced</titleType>
<chamberName />
</item>
<item>
<chamberCode />
<title>Code Like a Girl Act</title>
<parentTitleType />
<titleType>Display Title</titleType>
<chamberName />
</item>
<item>
<chamberCode />
<title>Code Like a Girl Act</title>
<parentTitleType />
<titleType>(Extracted from GPO) Short Titles as Introduced</titleType>
<chamberName />
</item>
</titles>
<title>Code Like a Girl Act</title>
<actions>
<actionByCounts>
<houseOfRepresentatives>4</houseOfRepresentatives>
</actionByCounts>
<item>
<actionCode>B00100</actionCode>
<links>
<link>
<name>H6046</name>
<url>https://www.congress.gov/congressional-record/volume-163/house-section/page/H6046</url>
</link>
</links>
<sourceSystem>
<code>9</code>
<name>Library of Congress</name>
</sourceSystem>
<type>IntroReferral</type>
<actionDate>2017-07-20</actionDate>
<committee />
<text>Sponsor introductory remarks on measure. (CR H6046)</text>
</item>
<item>
<actionCode>H11100</actionCode>
<links />
<sourceSystem>
<code>2</code>
<name>House floor actions</name>
</sourceSystem>
<type>IntroReferral</type>
<actionDate>2017-07-19</actionDate>
<committee>
<name>Education and the Workforce Committee</name>
<systemCode>hsed00</systemCode>
</committee>
<text>Referred to the Committee on Science, Space, and Technology, and in addition to the Committee on Education and the Workforce, for a period to be subsequently determined by the Speaker, in each case for consideration of such provisions as fall within the jurisdiction of the committee concerned.</text>
</item>
<item>
<actionCode>H11100</actionCode>
<links />
<sourceSystem>
<code>2</code>
<name>House floor actions</name>
</sourceSystem>
<type>IntroReferral</type>
<actionDate>2017-07-19</actionDate>
<committee>
<name>Science, Space, and Technology Committee</name>
<systemCode>hssy00</systemCode>
</committee>
<text>Referred to the Committee on Science, Space, and Technology, and in addition to the Committee on Education and the Workforce, for a period to be subsequently determined by the Speaker, in each case for consideration of such provisions as fall within the jurisdiction of the committee concerned.</text>
</item>
<item>
<actionCode>Intro-H</actionCode>
<links />
<sourceSystem>
<code>9</code>
<name>Library of Congress</name>
</sourceSystem>
<type>IntroReferral</type>
<actionDate>2017-07-19</actionDate>
<committee />
<text>Introduced in House</text>
</item>
<item>
<actionCode>1000</actionCode>
<links />
<sourceSystem>
<code>9</code>
<name>Library of Congress</name>
</sourceSystem>
<type>IntroReferral</type>
<actionDate>2017-07-19</actionDate>
<committee />
<text>Introduced in House</text>
</item>
<actionTypeCounts>
<introducedInHouse>1</introducedInHouse>
<placeholderTextForB>1</placeholderTextForB>
<billReferrals>2</billReferrals>
<introducedInTheHouse>1</introducedInTheHouse>
</actionTypeCounts>
</actions>
<billType>HR</billType>
<cboCostEstimates />
<amendments />
<updateDate>2017-10-04T07:16:22Z</updateDate>
<constitutionalAuthorityStatementText><![CDATA[<pre>From the Congressional Record Online through the Government Publishing Office [<a href='http://www.gpo.gov'>www.gpo.gov</a>]By Ms. ROSEN:H.R. 3316.Congress has the power to enact this legislation pursuantto the following:Clause 8 of Section 8 of Article I of the Constitution[Page H6043]</pre>]]></constitutionalAuthorityStatementText>
<committees>
<billCommittees>
<item>
<type>Standing</type>
<chamber>House</chamber>
<systemCode>hsed00</systemCode>
<name>Education and the Workforce Committee</name>
<subcommittees />
<activities>
<item>
<name>Referred to</name>
<date>2017-07-19T14:04:50Z</date>
</item>
</activities>
</item>
<item>
<type>Standing</type>
<chamber>House</chamber>
<systemCode>hssy00</systemCode>
<name>Science, Space, and Technology Committee</name>
<subcommittees />
<activities>
<item>
<name>Referred to</name>
<date>2017-07-19T14:04:45Z</date>
</item>
</activities>
</item>
</billCommittees>
</committees>
<congress>115</congress>
<billNumber>3316</billNumber>
<policyArea>
<name>Science, Technology, Communications</name>
</policyArea>
</bill>
<dublinCore xmlns:dc="http://purl.org/dc/elements/1.1/">
<dc:format>text/xml</dc:format>
<dc:language>EN</dc:language>
<dc:rights>Pursuant to Title 17 Section 105 of the United States Code, this file is not subject to copyright protection and is in the public domain.</dc:rights>
<dc:contributor>Congressional Research Service, Library of Congress</dc:contributor>
<dc:description>This file contains bill summaries and statuses for federal legislation. A bill summary describes the most significant provisions of a piece of legislation and details the effects the legislative text may have on current law and federal programs. Bill summaries are authored by the Congressional Research Service (CRS) of the Library of Congress. As stated in Public Law 91-510 (2 USC 166 (d)(6)), one of the duties of CRS is "to prepare summaries and digests of bills and resolutions of a public general nature introduced in the Senate or House of Representatives". For more information, refer to the User Guide that accompanies this file.</dc:description>
</dublinCore>
</billStatus>
|
{
"content_hash": "3266bfdaf22e4230950683008e129164",
"timestamp": "",
"source": "github",
"line_count": 716,
"max_line_length": 676,
"avg_line_length": 35.022346368715084,
"alnum_prop": 0.5930770457808263,
"repo_name": "peter765/power-polls",
"id": "573554b3be1e7cc4c8dd8811f6d123f4a4bcbb69",
"size": "25076",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "db/bills/hr/hr3316/fdsys_billstatus.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "58567"
},
{
"name": "JavaScript",
"bytes": "7370"
},
{
"name": "Python",
"bytes": "22988"
}
],
"symlink_target": ""
}
|
package com.datalogics.pdf.samples.printing;
import static com.datalogics.pdf.samples.printing.FakePrintService.DOTS_PER_INCH;
import java.awt.Graphics2D;
import java.awt.HeadlessException;
import java.awt.image.BufferedImage;
import java.awt.print.PageFormat;
import java.awt.print.Pageable;
import java.awt.print.Paper;
import java.awt.print.Printable;
import java.awt.print.PrinterException;
import java.awt.print.PrinterIOException;
import java.awt.print.PrinterJob;
/**
* A fake printer job.
*
* <p>
* This {@link PrinterJob} pretends accept pages, and in fact draws them to buffered images, but does nothing with them.
* A subclass can override {@link FakePrinterJob#processPageImage(BufferedImage, int)} to take actions with the image.
*/
public class FakePrinterJob extends PrinterJob {
protected Printable painter;
protected PageFormat format;
static final double DOTS_PER_POINT = DOTS_PER_INCH / 72.0;
/**
* Construct a printer job.
*
* <p>
* The actual printer job should be created using the {@link PrinterJob#getPrinterJob()} method.
*/
public FakePrinterJob() {
super();
painter = null;
format = null;
}
@Override
public PageFormat defaultPage(final PageFormat page) {
return (PageFormat) page.clone();
}
@Override
public PageFormat validatePage(final PageFormat page) {
// Factor our reported DPI into the final page size
final PageFormat stretchedPageFormat = (PageFormat) page.clone();
final Paper paper = stretchedPageFormat.getPaper();
final double x = stretchedPageFormat.getImageableX();
final double y = stretchedPageFormat.getImageableY();
final double width = (stretchedPageFormat.getImageableWidth() - x) * DOTS_PER_POINT;
final double height = (stretchedPageFormat.getImageableHeight() - y) * DOTS_PER_POINT;
paper.setSize(width, height);
paper.setImageableArea(x, y, width, height);
stretchedPageFormat.setPaper(paper);
return stretchedPageFormat;
}
/*
* Print the document.
*/
@Override
public void print() throws PrinterException {
// Create a BufferedImage to render into
final int width = (int) (format.getImageableWidth() - format.getImageableX());
final int height = (int) (format.getImageableHeight() - format.getImageableY());
// NOTE: We use a TYPE_4BYTE_ABGR because it is guaranteed to use a single contiguous
// image data buffer. This lets us checksum the raw data for the entire image.
final BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_4BYTE_ABGR);
Graphics2D gfx2d = image.createGraphics();
int pageIndex = 0;
while (painter.print(gfx2d, format, pageIndex) == Printable.PAGE_EXISTS) {
processPageImage(image, pageIndex);
// painter.print() disposed of the Graphics2D, obtain a new one
gfx2d = image.createGraphics();
gfx2d.clearRect(0, 0, width, height);
pageIndex++;
}
}
/**
* Process a page image during the printing loop.
*
* <p>
* When fake-printing, a page image is created for each page, and then passed to this routine, which does nothing.
* Override this to perform actions in your test or application.
*
* @param image the {@link BufferedImage} containing the printed page
* @param pageIndex the index of the page within the print job
* @throws PrinterIOException ex
*/
public void processPageImage(final BufferedImage image, final int pageIndex) throws PrinterIOException {}
@Override
public void setPrintable(final Printable painter, final PageFormat format) {
this.painter = painter;
this.format = format;
}
@Override
public void setPrintable(final Printable painter) {}
@Override
public void setPageable(final Pageable document) throws NullPointerException {}
@Override
public boolean printDialog() throws HeadlessException {
return false;
}
@Override
public PageFormat pageDialog(final PageFormat page) throws HeadlessException {
return null;
}
@Override
public void setCopies(final int copies) {}
@Override
public int getCopies() {
return 0;
}
@Override
public String getUserName() {
return null;
}
@Override
public void setJobName(final String jobName) {}
@Override
public String getJobName() {
return null;
}
@Override
public void cancel() {}
@Override
public boolean isCancelled() {
return false;
}
}
|
{
"content_hash": "8349b36e95614a0d3aafed22175de107",
"timestamp": "",
"source": "github",
"line_count": 154,
"max_line_length": 120,
"avg_line_length": 30.72077922077922,
"alnum_prop": 0.6723737053477066,
"repo_name": "datalogics/pdf-java-toolkit-samples",
"id": "32708d7807f0ca765a4be09648ed4e03c26e8395",
"size": "4772",
"binary": false,
"copies": "2",
"ref": "refs/heads/develop",
"path": "src/test/java/com/datalogics/pdf/samples/printing/FakePrinterJob.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "311349"
},
{
"name": "Shell",
"bytes": "1473"
},
{
"name": "sed",
"bytes": "2268"
}
],
"symlink_target": ""
}
|
module Ecm
module CalendarHelper
# renders a calendar table
#
# Example with elements that span more than 1 day:
#
# = month_calendar @date, @reservations, start_date_method: :start_at, end_date_method: :end_at
#
# Example of using a lamda as display method:
#
# = month_calendar(display_method: ->(context, resource) { context.link_to(resource.booker.human, resource.booker) })
#
def month_calendar(date = Time.zone.now.to_date, elements = [], options = {})
options.reverse_merge! :date_method => :start_at, :display_method => :to_s, :link_elements => true, :start_day => :sunday, start_date_method: nil, end_date_method: nil
display_method = options.delete(:display_method)
link_elements = options.delete(:link_elements)
start_date_method = options.delete(:start_date_method)
end_date_method = options.delete(:end_date_method)
# calculate beginning and end of month
beginning_of_month = date.beginning_of_month.to_date
end_of_month = date.end_of_month.to_date
# Get localized day names
localized_day_names = I18n.t('date.abbr_day_names').dup
# Shift day names to suite start day
english_day_names = [:sunday, :monday, :tuesday, :wednesday, :thursday, :friday, :saturday]
# Raise an exception if the passed start day is not an english day name
raise ":start_day option for month_calendar must be in: #{english_day_names.join(', ')}, but you passed: #{options[:start_day].to_s} (class: #{options[:start_day].class.to_s})" unless english_day_names.include?(options[:start_day])
# Get the offset of start day
offset = english_day_names.index(options[:start_day])
last_day_of_week = Time.zone.now.end_of_week.wday
# Change calendar heading if offset is not 0 (offset 0 means sunday is the first day of the week)
offset.times do
localized_day_names.push(localized_day_names.shift)
end
days_by_week = {}
first_day = beginning_of_month.beginning_of_week
last_day = end_of_month.end_of_week
days = (first_day..last_day).each_with_object({}).with_index do |(day, memo), index|
memo[day.to_date] = elements.find_all do |e|
if start_date_method.present? && end_date_method.present?
day.to_date.between?(e.send(start_date_method), e.send(end_date_method))
else
e.send(options[:date_method]).to_date == day.to_date
end
end || {}
end
days_by_week = days.each_with_object({}) { |(k, v), m| (m[k.cweek] ||= {})[k] = v }
render partial: 'ecm/calendar_helper/month_calendar', locals: { localized_day_names: localized_day_names, days_by_week: days_by_week, display_method: display_method, link_elements: link_elements }
end
def month_calendar_pagination(date, options = {})
options.reverse_merge!(show_today_link: true, remote: false)
show_today_link = options.delete(:show_today_link)
remote = options.delete(:remote)
actual_month = Time.zone.now.beginning_of_month.to_date
previous_month = date.beginning_of_month.to_date - 1.month
next_month = date.beginning_of_month.to_date + 1.months
render partial: 'ecm/calendar_helper/month_calendar_pagination', locals: { actual_month: actual_month, previous_month: previous_month, next_month: next_month, show_today_link: show_today_link, date: date, remote: remote }
end
end
end
|
{
"content_hash": "dbe7018fc0968f3f4727d38e95f0cd88",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 237,
"avg_line_length": 45.51948051948052,
"alnum_prop": 0.6507845934379458,
"repo_name": "robotex82/ecm_calendar_helper",
"id": "90825375f02ad8e76ad1d18269e4c047658bdc73",
"size": "3505",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/helpers/ecm/calendar_helper.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1247"
},
{
"name": "CoffeeScript",
"bytes": "137"
},
{
"name": "HTML",
"bytes": "4599"
},
{
"name": "JavaScript",
"bytes": "895"
},
{
"name": "Ruby",
"bytes": "25039"
}
],
"symlink_target": ""
}
|
package androidenterprise // import "google.golang.org/api/androidenterprise/v1"
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"golang.org/x/net/context"
"golang.org/x/net/context/ctxhttp"
"google.golang.org/api/googleapi"
"google.golang.org/api/internal"
"io"
"net/http"
"net/url"
"strconv"
"strings"
)
// Always reference these packages, just in case the auto-generated code
// below doesn't.
var _ = bytes.NewBuffer
var _ = strconv.Itoa
var _ = fmt.Sprintf
var _ = json.NewDecoder
var _ = io.Copy
var _ = url.Parse
var _ = googleapi.Version
var _ = errors.New
var _ = strings.Replace
var _ = internal.MarshalJSON
const apiId = "androidenterprise:v1"
const apiName = "androidenterprise"
const apiVersion = "v1"
const basePath = "https://www.googleapis.com/androidenterprise/v1/"
// OAuth2 scopes used by this API.
const (
// Manage corporate Android devices
AndroidenterpriseScope = "https://www.googleapis.com/auth/androidenterprise"
)
func New(client *http.Client) (*Service, error) {
if client == nil {
return nil, errors.New("client is nil")
}
s := &Service{client: client, BasePath: basePath}
s.Collections = NewCollectionsService(s)
s.Collectionviewers = NewCollectionviewersService(s)
s.Devices = NewDevicesService(s)
s.Enterprises = NewEnterprisesService(s)
s.Entitlements = NewEntitlementsService(s)
s.Grouplicenses = NewGrouplicensesService(s)
s.Grouplicenseusers = NewGrouplicenseusersService(s)
s.Installs = NewInstallsService(s)
s.Permissions = NewPermissionsService(s)
s.Products = NewProductsService(s)
s.Users = NewUsersService(s)
return s, nil
}
type Service struct {
client *http.Client
BasePath string // API endpoint base URL
UserAgent string // optional additional User-Agent fragment
Collections *CollectionsService
Collectionviewers *CollectionviewersService
Devices *DevicesService
Enterprises *EnterprisesService
Entitlements *EntitlementsService
Grouplicenses *GrouplicensesService
Grouplicenseusers *GrouplicenseusersService
Installs *InstallsService
Permissions *PermissionsService
Products *ProductsService
Users *UsersService
}
func (s *Service) userAgent() string {
if s.UserAgent == "" {
return googleapi.UserAgent
}
return googleapi.UserAgent + " " + s.UserAgent
}
func NewCollectionsService(s *Service) *CollectionsService {
rs := &CollectionsService{s: s}
return rs
}
type CollectionsService struct {
s *Service
}
func NewCollectionviewersService(s *Service) *CollectionviewersService {
rs := &CollectionviewersService{s: s}
return rs
}
type CollectionviewersService struct {
s *Service
}
func NewDevicesService(s *Service) *DevicesService {
rs := &DevicesService{s: s}
return rs
}
type DevicesService struct {
s *Service
}
func NewEnterprisesService(s *Service) *EnterprisesService {
rs := &EnterprisesService{s: s}
return rs
}
type EnterprisesService struct {
s *Service
}
func NewEntitlementsService(s *Service) *EntitlementsService {
rs := &EntitlementsService{s: s}
return rs
}
type EntitlementsService struct {
s *Service
}
func NewGrouplicensesService(s *Service) *GrouplicensesService {
rs := &GrouplicensesService{s: s}
return rs
}
type GrouplicensesService struct {
s *Service
}
func NewGrouplicenseusersService(s *Service) *GrouplicenseusersService {
rs := &GrouplicenseusersService{s: s}
return rs
}
type GrouplicenseusersService struct {
s *Service
}
func NewInstallsService(s *Service) *InstallsService {
rs := &InstallsService{s: s}
return rs
}
type InstallsService struct {
s *Service
}
func NewPermissionsService(s *Service) *PermissionsService {
rs := &PermissionsService{s: s}
return rs
}
type PermissionsService struct {
s *Service
}
func NewProductsService(s *Service) *ProductsService {
rs := &ProductsService{s: s}
return rs
}
type ProductsService struct {
s *Service
}
func NewUsersService(s *Service) *UsersService {
rs := &UsersService{s: s}
return rs
}
type UsersService struct {
s *Service
}
// AppRestrictionsSchema: Represents the list of app restrictions
// available to be pre-configured for the product.
type AppRestrictionsSchema struct {
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "androidenterprise#appRestrictionsSchema".
Kind string `json:"kind,omitempty"`
// Restrictions: The set of restrictions that make up this schema.
Restrictions []*AppRestrictionsSchemaRestriction `json:"restrictions,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Kind") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *AppRestrictionsSchema) MarshalJSON() ([]byte, error) {
type noMethod AppRestrictionsSchema
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// AppRestrictionsSchemaRestriction: A restriction in the App
// Restriction Schema represents a piece of configuration that may be
// pre-applied.
type AppRestrictionsSchemaRestriction struct {
// DefaultValue: The default value of the restriction.
DefaultValue *AppRestrictionsSchemaRestrictionRestrictionValue `json:"defaultValue,omitempty"`
// Description: A longer description of the restriction, giving more
// detail of what it affects.
Description string `json:"description,omitempty"`
// Entry: For choice or multiselect restrictions, the list of possible
// entries' human-readable names.
Entry []string `json:"entry,omitempty"`
// EntryValue: For choice or multiselect restrictions, the list of
// possible entries' machine-readable values.
EntryValue []string `json:"entryValue,omitempty"`
// Key: The unique key that the product uses to identify the
// restriction, e.g. "com.google.android.gm.fieldname".
Key string `json:"key,omitempty"`
// RestrictionType: The type of the restriction.
RestrictionType string `json:"restrictionType,omitempty"`
// Title: The name of the restriction.
Title string `json:"title,omitempty"`
// ForceSendFields is a list of field names (e.g. "DefaultValue") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *AppRestrictionsSchemaRestriction) MarshalJSON() ([]byte, error) {
type noMethod AppRestrictionsSchemaRestriction
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// AppRestrictionsSchemaRestrictionRestrictionValue: A typed value for
// the restriction.
type AppRestrictionsSchemaRestrictionRestrictionValue struct {
// Type: The type of the value being provided.
Type string `json:"type,omitempty"`
// ValueBool: The boolean value - this will only be present if type is
// bool.
ValueBool bool `json:"valueBool,omitempty"`
// ValueInteger: The integer value - this will only be present if type
// is integer.
ValueInteger int64 `json:"valueInteger,omitempty"`
// ValueMultiselect: The list of string values - this will only be
// present if type is multiselect.
ValueMultiselect []string `json:"valueMultiselect,omitempty"`
// ValueString: The string value - this will be present for types
// string, choice and hidden.
ValueString string `json:"valueString,omitempty"`
// ForceSendFields is a list of field names (e.g. "Type") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *AppRestrictionsSchemaRestrictionRestrictionValue) MarshalJSON() ([]byte, error) {
type noMethod AppRestrictionsSchemaRestrictionRestrictionValue
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// AppVersion: This represents a single version of the app.
type AppVersion struct {
// VersionCode: Unique increasing identifier for the app version.
VersionCode int64 `json:"versionCode,omitempty"`
// VersionString: The string used in the Play Store by the app developer
// to identify the version. The string is not necessarily unique or
// localized (for example, the string could be "1.4").
VersionString string `json:"versionString,omitempty"`
// ForceSendFields is a list of field names (e.g. "VersionCode") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *AppVersion) MarshalJSON() ([]byte, error) {
type noMethod AppVersion
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// ApprovalUrlInfo: Information on an approval URL.
type ApprovalUrlInfo struct {
// ApprovalUrl: A URL that displays a product's permissions and that can
// also be used to approve the product with the Products.approve call.
ApprovalUrl string `json:"approvalUrl,omitempty"`
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "androidenterprise#approvalUrlInfo".
Kind string `json:"kind,omitempty"`
// ForceSendFields is a list of field names (e.g. "ApprovalUrl") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *ApprovalUrlInfo) MarshalJSON() ([]byte, error) {
type noMethod ApprovalUrlInfo
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// Collection: A collection resource defines a named set of apps that is
// visible to a set of users in the Google Play Store app running on
// those users' managed devices. Those users can then install any of
// those apps if they wish (which will trigger creation of install and
// entitlement resources). A user cannot install an app on a managed
// device unless the app is listed in at least one collection that is
// visible to that user.
//
// Note that the API can be used to directly install an app regardless
// of whether it is in any collection - so an enterprise has a choice of
// either directly pushing apps to users, or allowing users to install
// apps if they want. Which is appropriate will depend on the
// enterprise's policies and the purpose of the apps concerned.
type Collection struct {
// CollectionId: Arbitrary unique ID, allocated by the API on creation.
CollectionId string `json:"collectionId,omitempty"`
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "androidenterprise#collection".
Kind string `json:"kind,omitempty"`
// Name: A user-friendly name for the collection (should be unique),
// e.g. "Accounting apps".
Name string `json:"name,omitempty"`
// ProductId: The IDs of the products in the collection, in the order in
// which they should be displayed.
ProductId []string `json:"productId,omitempty"`
// Visibility: Whether this collection is visible to all users, or only
// to the users that have been granted access through the
// "Collectionviewers" API. With the launch of the
// "setAvailableProductSet" API, this property should always be set to
// "viewersOnly", as the "allUsers" option will bypass the
// "availableProductSet" for all users within a domain.
//
// The "allUsers" setting is deprecated, and will be removed.
Visibility string `json:"visibility,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "CollectionId") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *Collection) MarshalJSON() ([]byte, error) {
type noMethod Collection
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// CollectionViewersListResponse: The user resources for the collection.
type CollectionViewersListResponse struct {
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "androidenterprise#collectionViewersListResponse".
Kind string `json:"kind,omitempty"`
// User: A user of an enterprise.
User []*User `json:"user,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Kind") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *CollectionViewersListResponse) MarshalJSON() ([]byte, error) {
type noMethod CollectionViewersListResponse
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// CollectionsListResponse: The collection resources for the enterprise.
type CollectionsListResponse struct {
// Collection: An ordered collection of products which can be made
// visible on the Google Play Store to a selected group of users.
Collection []*Collection `json:"collection,omitempty"`
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "androidenterprise#collectionsListResponse".
Kind string `json:"kind,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Collection") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *CollectionsListResponse) MarshalJSON() ([]byte, error) {
type noMethod CollectionsListResponse
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// Device: A device resource represents a mobile device managed by the
// MDM and belonging to a specific enterprise user.
//
// This collection cannot be modified via the API; it is automatically
// populated as devices are set up to be managed.
type Device struct {
// AndroidId: The Google Play Services Android ID for the device encoded
// as a lowercase hex string, e.g. "123456789abcdef0".
AndroidId string `json:"androidId,omitempty"`
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "androidenterprise#device".
Kind string `json:"kind,omitempty"`
// ManagementType: The mechanism by which this device is managed by the
// MDM. "managedDevice" means that the MDM's app is a device owner.
// "managedProfile" means that the MDM's app is the profile owner (and
// there is a separate personal profile which is not managed).
// "containerApp" means that the MDM's app is managing the Android for
// Work container app on the device.
ManagementType string `json:"managementType,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "AndroidId") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *Device) MarshalJSON() ([]byte, error) {
type noMethod Device
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// DeviceState: The state of a user's device, as accessed by the
// getState and setState methods on device resources.
type DeviceState struct {
// AccountState: The state of the Google account on the device.
// "enabled" indicates that the Google account on the device can be used
// to access Google services (including Google Play), while "disabled"
// means that it cannot. A new device is initially in the "disabled"
// state.
AccountState string `json:"accountState,omitempty"`
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "androidenterprise#deviceState".
Kind string `json:"kind,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "AccountState") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *DeviceState) MarshalJSON() ([]byte, error) {
type noMethod DeviceState
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// DevicesListResponse: The device resources for the user.
type DevicesListResponse struct {
// Device: A managed device.
Device []*Device `json:"device,omitempty"`
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "androidenterprise#devicesListResponse".
Kind string `json:"kind,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Device") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *DevicesListResponse) MarshalJSON() ([]byte, error) {
type noMethod DevicesListResponse
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// Enterprise: An enterprise resource represents a binding between an
// organisation and their MDM.
//
// To create an enterprise, an admin of the enterprise must first go
// through a Play for Work sign-up flow. At the end of this the admin
// will be presented with a token (a short opaque alphanumeric string).
// They must then present this to the MDM, who then supplies it to the
// enroll method. Until this is done the MDM will not have any access to
// the enterprise.
//
// After calling enroll the MDM should call setAccount to specify the
// service account that will be allowed to act on behalf of the
// enterprise, which will be required for access to the enterprise's
// data through this API. Only one call of setAccount is allowed for a
// given enterprise; the only way to change the account later is to
// unenroll the enterprise and enroll it again (obtaining a new
// token).
//
// The MDM can unenroll an enterprise in order to sever the binding
// between them. Re-enrolling an enterprise is possible, but requires a
// new token to be retrieved. Enterprises.unenroll requires the MDM's
// credentials (as enroll does), not the enterprise's.
// Enterprises.unenroll can only be used for enterprises that were
// previously enrolled with the enroll call. Any enterprises that were
// enrolled using the (deprecated) Enterprises.insert call must be
// unenrolled with Enterprises.delete and can then be re-enrolled using
// the Enterprises.enroll call.
//
// The ID for an enterprise is an opaque string. It is returned by
// insert and enroll and can also be retrieved if the enterprise's
// primary domain is known using the list method.
type Enterprise struct {
// Id: The unique ID for the enterprise.
Id string `json:"id,omitempty"`
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "androidenterprise#enterprise".
Kind string `json:"kind,omitempty"`
// Name: The name of the enterprise, e.g. "Example Inc".
Name string `json:"name,omitempty"`
// PrimaryDomain: The enterprise's primary domain, e.g. "example.com".
PrimaryDomain string `json:"primaryDomain,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Id") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *Enterprise) MarshalJSON() ([]byte, error) {
type noMethod Enterprise
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// EnterpriseAccount: A service account that can be used to authenticate
// as the enterprise to API calls that require such authentication.
type EnterpriseAccount struct {
// AccountEmail: The email address of the service account.
AccountEmail string `json:"accountEmail,omitempty"`
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "androidenterprise#enterpriseAccount".
Kind string `json:"kind,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "AccountEmail") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *EnterpriseAccount) MarshalJSON() ([]byte, error) {
type noMethod EnterpriseAccount
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// EnterprisesListResponse: The matching enterprise resources.
type EnterprisesListResponse struct {
// Enterprise: An enterprise.
Enterprise []*Enterprise `json:"enterprise,omitempty"`
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "androidenterprise#enterprisesListResponse".
Kind string `json:"kind,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Enterprise") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *EnterprisesListResponse) MarshalJSON() ([]byte, error) {
type noMethod EnterprisesListResponse
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
type EnterprisesSendTestPushNotificationResponse struct {
// MessageId: The message ID of the test push notification that was
// sent.
MessageId string `json:"messageId,omitempty"`
// TopicName: The name of the Cloud Pub/Sub topic to which notifications
// for this enterprise's enrolled account will be sent.
TopicName string `json:"topicName,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "MessageId") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *EnterprisesSendTestPushNotificationResponse) MarshalJSON() ([]byte, error) {
type noMethod EnterprisesSendTestPushNotificationResponse
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// Entitlement: The existence of an entitlement resource means that a
// user has the right to use a particular app on any of their devices.
// This might be because the app is free or because they have been
// allocated a license to the app from a group license purchased by the
// enterprise.
//
// It should always be true that a user has an app installed on one of
// their devices only if they have an entitlement to it. So if an
// entitlement is deleted, the app will be uninstalled from all devices.
// Similarly if the user installs an app (and is permitted to do so), or
// the MDM triggers an install of the app, an entitlement to that app is
// automatically created. If this is impossible - e.g. the enterprise
// has not purchased sufficient licenses - then installation
// fails.
//
// Note that entitlements are always user specific, not device specific;
// a user may have an entitlement even though they have not installed
// the app anywhere. Once they have an entitlement they can install the
// app on multiple devices.
//
// The API can be used to create an entitlement. If the app is a free
// app, a group license for that app is created. If it's a paid app,
// creating the entitlement consumes one license; it remains consumed
// until the entitlement is removed. Optionally an installation of the
// app on all the user's managed devices can be triggered at the time
// the entitlement is created. An entitlement cannot be created for an
// app if the app requires permissions that the enterprise has not yet
// accepted.
//
// Entitlements for paid apps that are due to purchases by the user on a
// non-managed profile will have "userPurchase" as entitlement reason;
// those entitlements cannot be removed via the API.
type Entitlement struct {
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "androidenterprise#entitlement".
Kind string `json:"kind,omitempty"`
// ProductId: The ID of the product that the entitlement is for, e.g.
// "app:com.google.android.gm".
ProductId string `json:"productId,omitempty"`
// Reason: The reason for the entitlement, e.g. "free" for free apps.
// This is temporary, it will be replaced by the acquisition kind field
// of group licenses.
Reason string `json:"reason,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Kind") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *Entitlement) MarshalJSON() ([]byte, error) {
type noMethod Entitlement
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// EntitlementsListResponse: The entitlement resources for the user.
type EntitlementsListResponse struct {
// Entitlement: An entitlement of a user to a product (e.g. an app). For
// example, a free app that they have installed, or a paid app that they
// have been allocated a license to.
Entitlement []*Entitlement `json:"entitlement,omitempty"`
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "androidenterprise#entitlementsListResponse".
Kind string `json:"kind,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Entitlement") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *EntitlementsListResponse) MarshalJSON() ([]byte, error) {
type noMethod EntitlementsListResponse
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// GroupLicense: A group license object indicates a product that an
// enterprise admin has approved for use in the enterprise. The product
// may be free or paid. For free products, a group license object is
// created in these cases: if the enterprise admin approves a product in
// Google Play, if the product is added to a collection, or if an
// entitlement for the product is created for a user via the API. For
// paid products, a group license object is only created as part of the
// first bulk purchase of that product in Google Play by the enterprise
// admin.
//
// The API can be used to query group licenses; the available
// information includes the total number of licenses purchased (for paid
// products) and the total number of licenses that have been
// provisioned, that is, the total number of user entitlements in
// existence for the product.
//
// Group license objects are never deleted. If, for example, a free app
// is added to a collection and then removed, the group license will
// remain, allowing the enterprise admin to keep track of any remaining
// entitlements. An enterprise admin may indicate they are no longer
// interested in the group license by marking it as unapproved in Google
// Play.
type GroupLicense struct {
// AcquisitionKind: How this group license was acquired. "bulkPurchase"
// means that this group license object was created because the
// enterprise purchased licenses for this product; this is "free"
// otherwise (for free products).
AcquisitionKind string `json:"acquisitionKind,omitempty"`
// Approval: Whether the product to which this group license relates is
// currently approved by the enterprise, as either "approved" or
// "unapproved". Products are approved when a group license is first
// created, but this approval may be revoked by an enterprise admin via
// Google Play. Unapproved products will not be visible to end users in
// collections and new entitlements to them should not normally be
// created.
Approval string `json:"approval,omitempty"`
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "androidenterprise#groupLicense".
Kind string `json:"kind,omitempty"`
// NumProvisioned: The total number of provisioned licenses for this
// product. Returned by read operations, but ignored in write
// operations.
NumProvisioned int64 `json:"numProvisioned,omitempty"`
// NumPurchased: The number of purchased licenses (possibly in multiple
// purchases). If this field is omitted then there is no limit on the
// number of licenses that can be provisioned (e.g. if the acquisition
// kind is "free").
NumPurchased int64 `json:"numPurchased,omitempty"`
// ProductId: The ID of the product that the license is for, e.g.
// "app:com.google.android.gm".
ProductId string `json:"productId,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "AcquisitionKind") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *GroupLicense) MarshalJSON() ([]byte, error) {
type noMethod GroupLicense
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// GroupLicenseUsersListResponse: The user resources for the group
// license.
type GroupLicenseUsersListResponse struct {
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "androidenterprise#groupLicenseUsersListResponse".
Kind string `json:"kind,omitempty"`
// User: A user of an enterprise.
User []*User `json:"user,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Kind") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *GroupLicenseUsersListResponse) MarshalJSON() ([]byte, error) {
type noMethod GroupLicenseUsersListResponse
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// GroupLicensesListResponse: The grouplicense resources for the
// enterprise.
type GroupLicensesListResponse struct {
// GroupLicense: A group license for a product approved for use in the
// enterprise.
GroupLicense []*GroupLicense `json:"groupLicense,omitempty"`
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "androidenterprise#groupLicensesListResponse".
Kind string `json:"kind,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "GroupLicense") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *GroupLicensesListResponse) MarshalJSON() ([]byte, error) {
type noMethod GroupLicensesListResponse
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// Install: The existence of an install resource indicates that an app
// is installed on a particular device (or that an install is
// pending).
//
// The API can be used to create an install resource using the update
// method. This triggers the actual install of the app on the device. If
// the user does not already have an entitlement for the app then an
// attempt is made to create one. If this fails (e.g. because the app is
// not free and there is no available license) then the creation of the
// install fails.
//
// The API can also be used to update an installed app. If the update
// method is used on an existing install then the app will be updated to
// the latest available version.
//
// Note that it is not possible to force the installation of a specific
// version of an app; the version code is read-only.
//
// If a user installs an app themselves (as permitted by the
// enterprise), then again an install resource and possibly an
// entitlement resource are automatically created.
//
// The API can also be used to delete an install resource, which
// triggers the removal of the app from the device. Note that deleting
// an install does not automatically remove the corresponding
// entitlement, even if there are no remaining installs. The install
// resource will also be deleted if the user uninstalls the app
// themselves.
type Install struct {
// InstallState: Install state. The state "installPending" means that an
// install request has recently been made and download to the device is
// in progress. The state "installed" means that the app has been
// installed. This field is read-only.
InstallState string `json:"installState,omitempty"`
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "androidenterprise#install".
Kind string `json:"kind,omitempty"`
// ProductId: The ID of the product that the install is for, e.g.
// "app:com.google.android.gm".
ProductId string `json:"productId,omitempty"`
// VersionCode: The version of the installed product. Guaranteed to be
// set only if the install state is "installed".
VersionCode int64 `json:"versionCode,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "InstallState") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *Install) MarshalJSON() ([]byte, error) {
type noMethod Install
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// InstallsListResponse: The install resources for the device.
type InstallsListResponse struct {
// Install: An installation of an app for a user on a specific device.
// The existence of an install implies that the user must have an
// entitlement to the app.
Install []*Install `json:"install,omitempty"`
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "androidenterprise#installsListResponse".
Kind string `json:"kind,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Install") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *InstallsListResponse) MarshalJSON() ([]byte, error) {
type noMethod InstallsListResponse
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// Permission: A permission represents some extra capability, to be
// granted to an Android app, which requires explicit consent. An
// enterprise admin must consent to these permissions on behalf of their
// users before an entitlement for the app can be created.
//
// The permissions collection is read-only. The information provided for
// each permission (localized name and description) is intended to be
// used in the MDM user interface when obtaining consent from the
// enterprise.
type Permission struct {
// Description: A longer description of the permissions giving more
// details of what it affects.
Description string `json:"description,omitempty"`
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "androidenterprise#permission".
Kind string `json:"kind,omitempty"`
// Name: The name of the permission.
Name string `json:"name,omitempty"`
// PermissionId: An opaque string uniquely identifying the permission.
PermissionId string `json:"permissionId,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Description") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *Permission) MarshalJSON() ([]byte, error) {
type noMethod Permission
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// Product: A product represents an app in the Google Play Store that is
// available to at least some users in the enterprise. (Some apps are
// restricted to a single enterprise, and no information about them is
// made available outside that enterprise.)
//
// The information provided for each product (localized name, icon, link
// to the full Google Play details page) is intended to allow a basic
// representation of the product within an MDM user interface.
type Product struct {
// AppVersion: App versions currently available for this product. The
// returned list contains only public versions. Alpha and beta versions
// are not included.
AppVersion []*AppVersion `json:"appVersion,omitempty"`
// AuthorName: The name of the author of the product (e.g. the app
// developer).
AuthorName string `json:"authorName,omitempty"`
// DetailsUrl: A link to the (consumer) Google Play details page for the
// product.
DetailsUrl string `json:"detailsUrl,omitempty"`
// DistributionChannel: How and to whom the package is made available.
// The value publicGoogleHosted means that the package is available
// through the Play Store and not restricted to a specific enterprise.
// The value privateGoogleHosted means that the package is a private app
// (restricted to an enterprise) but hosted by Google. The value
// privateSelfHosted means that the package is a private app (restricted
// to an enterprise) and is privately hosted.
DistributionChannel string `json:"distributionChannel,omitempty"`
// IconUrl: A link to an image that can be used as an icon for the
// product.
IconUrl string `json:"iconUrl,omitempty"`
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "androidenterprise#product".
Kind string `json:"kind,omitempty"`
// ProductId: A string of the form app:<package name>. For example,
// app:com.google.android.gm represents the Gmail app.
ProductId string `json:"productId,omitempty"`
// RequiresContainerApp: Whether this app can only be installed on
// devices using the Android for Work container app.
RequiresContainerApp bool `json:"requiresContainerApp,omitempty"`
// Title: The name of the product.
Title string `json:"title,omitempty"`
// WorkDetailsUrl: A link to the Google Play for Work details page for
// the product, for use by an Enterprise administrator.
WorkDetailsUrl string `json:"workDetailsUrl,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "AppVersion") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *Product) MarshalJSON() ([]byte, error) {
type noMethod Product
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// ProductPermission: A product permissions resource represents the set
// of permissions required by a specific app and whether or not they
// have been accepted by an enterprise admin.
//
// The API can be used to read the set of permissions, and also to
// update the set to indicate that permissions have been accepted.
type ProductPermission struct {
// PermissionId: An opaque string uniquely identifying the permission.
PermissionId string `json:"permissionId,omitempty"`
// State: Whether the permission has been accepted or not.
State string `json:"state,omitempty"`
// ForceSendFields is a list of field names (e.g. "PermissionId") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *ProductPermission) MarshalJSON() ([]byte, error) {
type noMethod ProductPermission
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// ProductPermissions: Information about the permissions required by a
// specific app and whether they have been accepted by the enterprise.
type ProductPermissions struct {
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "androidenterprise#productPermissions".
Kind string `json:"kind,omitempty"`
// Permission: The permissions required by the app.
Permission []*ProductPermission `json:"permission,omitempty"`
// ProductId: The ID of the app that the permissions relate to, e.g.
// "app:com.google.android.gm".
ProductId string `json:"productId,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Kind") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *ProductPermissions) MarshalJSON() ([]byte, error) {
type noMethod ProductPermissions
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// ProductSet: A set of products.
type ProductSet struct {
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "androidenterprise#productSet".
Kind string `json:"kind,omitempty"`
// ProductId: The list of product IDs making up the set of products.
ProductId []string `json:"productId,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Kind") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *ProductSet) MarshalJSON() ([]byte, error) {
type noMethod ProductSet
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
type ProductsApproveRequest struct {
// ApprovalUrlInfo: The approval URL that was shown to the user. Only
// the permissions shown to the user with that URL will be accepted,
// which may not be the product's entire set of permissions. For
// example, the URL may only display new permissions from an update
// after the product was approved, or not include new permissions if the
// product was updated since the URL was generated.
ApprovalUrlInfo *ApprovalUrlInfo `json:"approvalUrlInfo,omitempty"`
// ForceSendFields is a list of field names (e.g. "ApprovalUrlInfo") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *ProductsApproveRequest) MarshalJSON() ([]byte, error) {
type noMethod ProductsApproveRequest
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
type ProductsGenerateApprovalUrlResponse struct {
// Url: A URL that can be rendered in an iframe to display the
// permissions (if any) of a product. This URL can be used to approve
// the product only once and only within 24 hours of being generated,
// using the Products.approve call. If the product is currently
// unapproved and has no permissions, this URL will point to an empty
// page. If the product is currently approved, a URL will only be
// generated if that product has added permissions since it was last
// approved, and the URL will only display those new permissions that
// have not yet been accepted.
Url string `json:"url,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Url") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *ProductsGenerateApprovalUrlResponse) MarshalJSON() ([]byte, error) {
type noMethod ProductsGenerateApprovalUrlResponse
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// User: A user resource represents an individual user within the
// enterprise's domain.
//
// Note that each user is associated with a Google account based on the
// user's corporate email address (which must be in one of the
// enterprise's domains). As part of installing an MDM app to manage a
// device the Google account must be provisioned to the device, and so
// the user resource must be created before that. This can be done using
// the Google Admin SDK Directory API.
//
// The ID for a user is an opaque string. It can be retrieved using the
// list method queried by the user's primary email address.
type User struct {
// Id: The unique ID for the user.
Id string `json:"id,omitempty"`
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "androidenterprise#user".
Kind string `json:"kind,omitempty"`
// PrimaryEmail: The user's primary email, e.g. "jsmith@example.com".
PrimaryEmail string `json:"primaryEmail,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Id") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *User) MarshalJSON() ([]byte, error) {
type noMethod User
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// UserToken: A UserToken is used by a user when setting up a managed
// device or profile with their work account on a device. When the user
// enters their email address and token (activation code) the
// appropriate MDM app can be automatically downloaded.
type UserToken struct {
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "androidenterprise#userToken".
Kind string `json:"kind,omitempty"`
// Token: The token (activation code) to be entered by the user. This
// consists of a sequence of decimal digits. Note that the leading digit
// may be 0.
Token string `json:"token,omitempty"`
// UserId: The unique ID for the user.
UserId string `json:"userId,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Kind") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *UserToken) MarshalJSON() ([]byte, error) {
type noMethod UserToken
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// UsersListResponse: The matching user resources.
type UsersListResponse struct {
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "androidenterprise#usersListResponse".
Kind string `json:"kind,omitempty"`
// User: A user of an enterprise.
User []*User `json:"user,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Kind") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *UsersListResponse) MarshalJSON() ([]byte, error) {
type noMethod UsersListResponse
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// method id "androidenterprise.collections.delete":
type CollectionsDeleteCall struct {
s *Service
enterpriseId string
collectionId string
opt_ map[string]interface{}
ctx_ context.Context
}
// Delete: Deletes a collection.
func (r *CollectionsService) Delete(enterpriseId string, collectionId string) *CollectionsDeleteCall {
c := &CollectionsDeleteCall{s: r.s, opt_: make(map[string]interface{})}
c.enterpriseId = enterpriseId
c.collectionId = collectionId
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *CollectionsDeleteCall) Fields(s ...googleapi.Field) *CollectionsDeleteCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// Context sets the context to be used in this call's Do method.
// Any pending HTTP request will be aborted if the provided context
// is canceled.
func (c *CollectionsDeleteCall) Context(ctx context.Context) *CollectionsDeleteCall {
c.ctx_ = ctx
return c
}
func (c *CollectionsDeleteCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", alt)
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/collections/{collectionId}")
urls += "?" + params.Encode()
req, _ := http.NewRequest("DELETE", urls, body)
googleapi.Expand(req.URL, map[string]string{
"enterpriseId": c.enterpriseId,
"collectionId": c.collectionId,
})
req.Header.Set("User-Agent", c.s.userAgent())
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "androidenterprise.collections.delete" call.
func (c *CollectionsDeleteCall) Do() error {
res, err := c.doRequest("json")
if err != nil {
return err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return err
}
return nil
// {
// "description": "Deletes a collection.",
// "httpMethod": "DELETE",
// "id": "androidenterprise.collections.delete",
// "parameterOrder": [
// "enterpriseId",
// "collectionId"
// ],
// "parameters": {
// "collectionId": {
// "description": "The ID of the collection.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "enterpriseId": {
// "description": "The ID of the enterprise.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "enterprises/{enterpriseId}/collections/{collectionId}",
// "scopes": [
// "https://www.googleapis.com/auth/androidenterprise"
// ]
// }
}
// method id "androidenterprise.collections.get":
type CollectionsGetCall struct {
s *Service
enterpriseId string
collectionId string
opt_ map[string]interface{}
ctx_ context.Context
}
// Get: Retrieves the details of a collection.
func (r *CollectionsService) Get(enterpriseId string, collectionId string) *CollectionsGetCall {
c := &CollectionsGetCall{s: r.s, opt_: make(map[string]interface{})}
c.enterpriseId = enterpriseId
c.collectionId = collectionId
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *CollectionsGetCall) Fields(s ...googleapi.Field) *CollectionsGetCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *CollectionsGetCall) IfNoneMatch(entityTag string) *CollectionsGetCall {
c.opt_["ifNoneMatch"] = entityTag
return c
}
// Context sets the context to be used in this call's Do method.
// Any pending HTTP request will be aborted if the provided context
// is canceled.
func (c *CollectionsGetCall) Context(ctx context.Context) *CollectionsGetCall {
c.ctx_ = ctx
return c
}
func (c *CollectionsGetCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", alt)
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/collections/{collectionId}")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
googleapi.Expand(req.URL, map[string]string{
"enterpriseId": c.enterpriseId,
"collectionId": c.collectionId,
})
req.Header.Set("User-Agent", c.s.userAgent())
if v, ok := c.opt_["ifNoneMatch"]; ok {
req.Header.Set("If-None-Match", fmt.Sprintf("%v", v))
}
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "androidenterprise.collections.get" call.
// Exactly one of *Collection or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *Collection.ServerResponse.Header or (if a response was returned at
// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
// to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *CollectionsGetCall) Do() (*Collection, error) {
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &Collection{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Retrieves the details of a collection.",
// "httpMethod": "GET",
// "id": "androidenterprise.collections.get",
// "parameterOrder": [
// "enterpriseId",
// "collectionId"
// ],
// "parameters": {
// "collectionId": {
// "description": "The ID of the collection.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "enterpriseId": {
// "description": "The ID of the enterprise.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "enterprises/{enterpriseId}/collections/{collectionId}",
// "response": {
// "$ref": "Collection"
// },
// "scopes": [
// "https://www.googleapis.com/auth/androidenterprise"
// ]
// }
}
// method id "androidenterprise.collections.insert":
type CollectionsInsertCall struct {
s *Service
enterpriseId string
collection *Collection
opt_ map[string]interface{}
ctx_ context.Context
}
// Insert: Creates a new collection.
func (r *CollectionsService) Insert(enterpriseId string, collection *Collection) *CollectionsInsertCall {
c := &CollectionsInsertCall{s: r.s, opt_: make(map[string]interface{})}
c.enterpriseId = enterpriseId
c.collection = collection
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *CollectionsInsertCall) Fields(s ...googleapi.Field) *CollectionsInsertCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// Context sets the context to be used in this call's Do method.
// Any pending HTTP request will be aborted if the provided context
// is canceled.
func (c *CollectionsInsertCall) Context(ctx context.Context) *CollectionsInsertCall {
c.ctx_ = ctx
return c
}
func (c *CollectionsInsertCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.collection)
if err != nil {
return nil, err
}
ctype := "application/json"
params := make(url.Values)
params.Set("alt", alt)
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/collections")
urls += "?" + params.Encode()
req, _ := http.NewRequest("POST", urls, body)
googleapi.Expand(req.URL, map[string]string{
"enterpriseId": c.enterpriseId,
})
req.Header.Set("Content-Type", ctype)
req.Header.Set("User-Agent", c.s.userAgent())
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "androidenterprise.collections.insert" call.
// Exactly one of *Collection or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *Collection.ServerResponse.Header or (if a response was returned at
// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
// to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *CollectionsInsertCall) Do() (*Collection, error) {
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &Collection{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Creates a new collection.",
// "httpMethod": "POST",
// "id": "androidenterprise.collections.insert",
// "parameterOrder": [
// "enterpriseId"
// ],
// "parameters": {
// "enterpriseId": {
// "description": "The ID of the enterprise.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "enterprises/{enterpriseId}/collections",
// "request": {
// "$ref": "Collection"
// },
// "response": {
// "$ref": "Collection"
// },
// "scopes": [
// "https://www.googleapis.com/auth/androidenterprise"
// ]
// }
}
// method id "androidenterprise.collections.list":
type CollectionsListCall struct {
s *Service
enterpriseId string
opt_ map[string]interface{}
ctx_ context.Context
}
// List: Retrieves the IDs of all the collections for an enterprise.
func (r *CollectionsService) List(enterpriseId string) *CollectionsListCall {
c := &CollectionsListCall{s: r.s, opt_: make(map[string]interface{})}
c.enterpriseId = enterpriseId
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *CollectionsListCall) Fields(s ...googleapi.Field) *CollectionsListCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *CollectionsListCall) IfNoneMatch(entityTag string) *CollectionsListCall {
c.opt_["ifNoneMatch"] = entityTag
return c
}
// Context sets the context to be used in this call's Do method.
// Any pending HTTP request will be aborted if the provided context
// is canceled.
func (c *CollectionsListCall) Context(ctx context.Context) *CollectionsListCall {
c.ctx_ = ctx
return c
}
func (c *CollectionsListCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", alt)
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/collections")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
googleapi.Expand(req.URL, map[string]string{
"enterpriseId": c.enterpriseId,
})
req.Header.Set("User-Agent", c.s.userAgent())
if v, ok := c.opt_["ifNoneMatch"]; ok {
req.Header.Set("If-None-Match", fmt.Sprintf("%v", v))
}
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "androidenterprise.collections.list" call.
// Exactly one of *CollectionsListResponse or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *CollectionsListResponse.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *CollectionsListCall) Do() (*CollectionsListResponse, error) {
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &CollectionsListResponse{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Retrieves the IDs of all the collections for an enterprise.",
// "httpMethod": "GET",
// "id": "androidenterprise.collections.list",
// "parameterOrder": [
// "enterpriseId"
// ],
// "parameters": {
// "enterpriseId": {
// "description": "The ID of the enterprise.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "enterprises/{enterpriseId}/collections",
// "response": {
// "$ref": "CollectionsListResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/androidenterprise"
// ]
// }
}
// method id "androidenterprise.collections.patch":
type CollectionsPatchCall struct {
s *Service
enterpriseId string
collectionId string
collection *Collection
opt_ map[string]interface{}
ctx_ context.Context
}
// Patch: Updates a collection. This method supports patch semantics.
func (r *CollectionsService) Patch(enterpriseId string, collectionId string, collection *Collection) *CollectionsPatchCall {
c := &CollectionsPatchCall{s: r.s, opt_: make(map[string]interface{})}
c.enterpriseId = enterpriseId
c.collectionId = collectionId
c.collection = collection
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *CollectionsPatchCall) Fields(s ...googleapi.Field) *CollectionsPatchCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// Context sets the context to be used in this call's Do method.
// Any pending HTTP request will be aborted if the provided context
// is canceled.
func (c *CollectionsPatchCall) Context(ctx context.Context) *CollectionsPatchCall {
c.ctx_ = ctx
return c
}
func (c *CollectionsPatchCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.collection)
if err != nil {
return nil, err
}
ctype := "application/json"
params := make(url.Values)
params.Set("alt", alt)
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/collections/{collectionId}")
urls += "?" + params.Encode()
req, _ := http.NewRequest("PATCH", urls, body)
googleapi.Expand(req.URL, map[string]string{
"enterpriseId": c.enterpriseId,
"collectionId": c.collectionId,
})
req.Header.Set("Content-Type", ctype)
req.Header.Set("User-Agent", c.s.userAgent())
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "androidenterprise.collections.patch" call.
// Exactly one of *Collection or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *Collection.ServerResponse.Header or (if a response was returned at
// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
// to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *CollectionsPatchCall) Do() (*Collection, error) {
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &Collection{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Updates a collection. This method supports patch semantics.",
// "httpMethod": "PATCH",
// "id": "androidenterprise.collections.patch",
// "parameterOrder": [
// "enterpriseId",
// "collectionId"
// ],
// "parameters": {
// "collectionId": {
// "description": "The ID of the collection.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "enterpriseId": {
// "description": "The ID of the enterprise.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "enterprises/{enterpriseId}/collections/{collectionId}",
// "request": {
// "$ref": "Collection"
// },
// "response": {
// "$ref": "Collection"
// },
// "scopes": [
// "https://www.googleapis.com/auth/androidenterprise"
// ]
// }
}
// method id "androidenterprise.collections.update":
type CollectionsUpdateCall struct {
s *Service
enterpriseId string
collectionId string
collection *Collection
opt_ map[string]interface{}
ctx_ context.Context
}
// Update: Updates a collection.
func (r *CollectionsService) Update(enterpriseId string, collectionId string, collection *Collection) *CollectionsUpdateCall {
c := &CollectionsUpdateCall{s: r.s, opt_: make(map[string]interface{})}
c.enterpriseId = enterpriseId
c.collectionId = collectionId
c.collection = collection
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *CollectionsUpdateCall) Fields(s ...googleapi.Field) *CollectionsUpdateCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// Context sets the context to be used in this call's Do method.
// Any pending HTTP request will be aborted if the provided context
// is canceled.
func (c *CollectionsUpdateCall) Context(ctx context.Context) *CollectionsUpdateCall {
c.ctx_ = ctx
return c
}
func (c *CollectionsUpdateCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.collection)
if err != nil {
return nil, err
}
ctype := "application/json"
params := make(url.Values)
params.Set("alt", alt)
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/collections/{collectionId}")
urls += "?" + params.Encode()
req, _ := http.NewRequest("PUT", urls, body)
googleapi.Expand(req.URL, map[string]string{
"enterpriseId": c.enterpriseId,
"collectionId": c.collectionId,
})
req.Header.Set("Content-Type", ctype)
req.Header.Set("User-Agent", c.s.userAgent())
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "androidenterprise.collections.update" call.
// Exactly one of *Collection or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *Collection.ServerResponse.Header or (if a response was returned at
// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
// to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *CollectionsUpdateCall) Do() (*Collection, error) {
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &Collection{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Updates a collection.",
// "httpMethod": "PUT",
// "id": "androidenterprise.collections.update",
// "parameterOrder": [
// "enterpriseId",
// "collectionId"
// ],
// "parameters": {
// "collectionId": {
// "description": "The ID of the collection.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "enterpriseId": {
// "description": "The ID of the enterprise.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "enterprises/{enterpriseId}/collections/{collectionId}",
// "request": {
// "$ref": "Collection"
// },
// "response": {
// "$ref": "Collection"
// },
// "scopes": [
// "https://www.googleapis.com/auth/androidenterprise"
// ]
// }
}
// method id "androidenterprise.collectionviewers.delete":
type CollectionviewersDeleteCall struct {
s *Service
enterpriseId string
collectionId string
userId string
opt_ map[string]interface{}
ctx_ context.Context
}
// Delete: Removes the user from the list of those specifically allowed
// to see the collection. If the collection's visibility is set to
// viewersOnly then only such users will see the collection.
func (r *CollectionviewersService) Delete(enterpriseId string, collectionId string, userId string) *CollectionviewersDeleteCall {
c := &CollectionviewersDeleteCall{s: r.s, opt_: make(map[string]interface{})}
c.enterpriseId = enterpriseId
c.collectionId = collectionId
c.userId = userId
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *CollectionviewersDeleteCall) Fields(s ...googleapi.Field) *CollectionviewersDeleteCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// Context sets the context to be used in this call's Do method.
// Any pending HTTP request will be aborted if the provided context
// is canceled.
func (c *CollectionviewersDeleteCall) Context(ctx context.Context) *CollectionviewersDeleteCall {
c.ctx_ = ctx
return c
}
func (c *CollectionviewersDeleteCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", alt)
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/collections/{collectionId}/users/{userId}")
urls += "?" + params.Encode()
req, _ := http.NewRequest("DELETE", urls, body)
googleapi.Expand(req.URL, map[string]string{
"enterpriseId": c.enterpriseId,
"collectionId": c.collectionId,
"userId": c.userId,
})
req.Header.Set("User-Agent", c.s.userAgent())
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "androidenterprise.collectionviewers.delete" call.
func (c *CollectionviewersDeleteCall) Do() error {
res, err := c.doRequest("json")
if err != nil {
return err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return err
}
return nil
// {
// "description": "Removes the user from the list of those specifically allowed to see the collection. If the collection's visibility is set to viewersOnly then only such users will see the collection.",
// "httpMethod": "DELETE",
// "id": "androidenterprise.collectionviewers.delete",
// "parameterOrder": [
// "enterpriseId",
// "collectionId",
// "userId"
// ],
// "parameters": {
// "collectionId": {
// "description": "The ID of the collection.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "enterpriseId": {
// "description": "The ID of the enterprise.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "userId": {
// "description": "The ID of the user.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "enterprises/{enterpriseId}/collections/{collectionId}/users/{userId}",
// "scopes": [
// "https://www.googleapis.com/auth/androidenterprise"
// ]
// }
}
// method id "androidenterprise.collectionviewers.get":
type CollectionviewersGetCall struct {
s *Service
enterpriseId string
collectionId string
userId string
opt_ map[string]interface{}
ctx_ context.Context
}
// Get: Retrieves the ID of the user if they have been specifically
// allowed to see the collection. If the collection's visibility is set
// to viewersOnly then only these users will see the collection.
func (r *CollectionviewersService) Get(enterpriseId string, collectionId string, userId string) *CollectionviewersGetCall {
c := &CollectionviewersGetCall{s: r.s, opt_: make(map[string]interface{})}
c.enterpriseId = enterpriseId
c.collectionId = collectionId
c.userId = userId
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *CollectionviewersGetCall) Fields(s ...googleapi.Field) *CollectionviewersGetCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *CollectionviewersGetCall) IfNoneMatch(entityTag string) *CollectionviewersGetCall {
c.opt_["ifNoneMatch"] = entityTag
return c
}
// Context sets the context to be used in this call's Do method.
// Any pending HTTP request will be aborted if the provided context
// is canceled.
func (c *CollectionviewersGetCall) Context(ctx context.Context) *CollectionviewersGetCall {
c.ctx_ = ctx
return c
}
func (c *CollectionviewersGetCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", alt)
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/collections/{collectionId}/users/{userId}")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
googleapi.Expand(req.URL, map[string]string{
"enterpriseId": c.enterpriseId,
"collectionId": c.collectionId,
"userId": c.userId,
})
req.Header.Set("User-Agent", c.s.userAgent())
if v, ok := c.opt_["ifNoneMatch"]; ok {
req.Header.Set("If-None-Match", fmt.Sprintf("%v", v))
}
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "androidenterprise.collectionviewers.get" call.
// Exactly one of *User or error will be non-nil. Any non-2xx status
// code is an error. Response headers are in either
// *User.ServerResponse.Header or (if a response was returned at all) in
// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
// whether the returned error was because http.StatusNotModified was
// returned.
func (c *CollectionviewersGetCall) Do() (*User, error) {
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &User{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Retrieves the ID of the user if they have been specifically allowed to see the collection. If the collection's visibility is set to viewersOnly then only these users will see the collection.",
// "httpMethod": "GET",
// "id": "androidenterprise.collectionviewers.get",
// "parameterOrder": [
// "enterpriseId",
// "collectionId",
// "userId"
// ],
// "parameters": {
// "collectionId": {
// "description": "The ID of the collection.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "enterpriseId": {
// "description": "The ID of the enterprise.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "userId": {
// "description": "The ID of the user.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "enterprises/{enterpriseId}/collections/{collectionId}/users/{userId}",
// "response": {
// "$ref": "User"
// },
// "scopes": [
// "https://www.googleapis.com/auth/androidenterprise"
// ]
// }
}
// method id "androidenterprise.collectionviewers.list":
type CollectionviewersListCall struct {
s *Service
enterpriseId string
collectionId string
opt_ map[string]interface{}
ctx_ context.Context
}
// List: Retrieves the IDs of the users who have been specifically
// allowed to see the collection. If the collection's visibility is set
// to viewersOnly then only these users will see the collection.
func (r *CollectionviewersService) List(enterpriseId string, collectionId string) *CollectionviewersListCall {
c := &CollectionviewersListCall{s: r.s, opt_: make(map[string]interface{})}
c.enterpriseId = enterpriseId
c.collectionId = collectionId
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *CollectionviewersListCall) Fields(s ...googleapi.Field) *CollectionviewersListCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *CollectionviewersListCall) IfNoneMatch(entityTag string) *CollectionviewersListCall {
c.opt_["ifNoneMatch"] = entityTag
return c
}
// Context sets the context to be used in this call's Do method.
// Any pending HTTP request will be aborted if the provided context
// is canceled.
func (c *CollectionviewersListCall) Context(ctx context.Context) *CollectionviewersListCall {
c.ctx_ = ctx
return c
}
func (c *CollectionviewersListCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", alt)
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/collections/{collectionId}/users")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
googleapi.Expand(req.URL, map[string]string{
"enterpriseId": c.enterpriseId,
"collectionId": c.collectionId,
})
req.Header.Set("User-Agent", c.s.userAgent())
if v, ok := c.opt_["ifNoneMatch"]; ok {
req.Header.Set("If-None-Match", fmt.Sprintf("%v", v))
}
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "androidenterprise.collectionviewers.list" call.
// Exactly one of *CollectionViewersListResponse or error will be
// non-nil. Any non-2xx status code is an error. Response headers are in
// either *CollectionViewersListResponse.ServerResponse.Header or (if a
// response was returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *CollectionviewersListCall) Do() (*CollectionViewersListResponse, error) {
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &CollectionViewersListResponse{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Retrieves the IDs of the users who have been specifically allowed to see the collection. If the collection's visibility is set to viewersOnly then only these users will see the collection.",
// "httpMethod": "GET",
// "id": "androidenterprise.collectionviewers.list",
// "parameterOrder": [
// "enterpriseId",
// "collectionId"
// ],
// "parameters": {
// "collectionId": {
// "description": "The ID of the collection.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "enterpriseId": {
// "description": "The ID of the enterprise.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "enterprises/{enterpriseId}/collections/{collectionId}/users",
// "response": {
// "$ref": "CollectionViewersListResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/androidenterprise"
// ]
// }
}
// method id "androidenterprise.collectionviewers.patch":
type CollectionviewersPatchCall struct {
s *Service
enterpriseId string
collectionId string
userId string
user *User
opt_ map[string]interface{}
ctx_ context.Context
}
// Patch: Adds the user to the list of those specifically allowed to see
// the collection. If the collection's visibility is set to viewersOnly
// then only such users will see the collection. This method supports
// patch semantics.
func (r *CollectionviewersService) Patch(enterpriseId string, collectionId string, userId string, user *User) *CollectionviewersPatchCall {
c := &CollectionviewersPatchCall{s: r.s, opt_: make(map[string]interface{})}
c.enterpriseId = enterpriseId
c.collectionId = collectionId
c.userId = userId
c.user = user
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *CollectionviewersPatchCall) Fields(s ...googleapi.Field) *CollectionviewersPatchCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// Context sets the context to be used in this call's Do method.
// Any pending HTTP request will be aborted if the provided context
// is canceled.
func (c *CollectionviewersPatchCall) Context(ctx context.Context) *CollectionviewersPatchCall {
c.ctx_ = ctx
return c
}
func (c *CollectionviewersPatchCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.user)
if err != nil {
return nil, err
}
ctype := "application/json"
params := make(url.Values)
params.Set("alt", alt)
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/collections/{collectionId}/users/{userId}")
urls += "?" + params.Encode()
req, _ := http.NewRequest("PATCH", urls, body)
googleapi.Expand(req.URL, map[string]string{
"enterpriseId": c.enterpriseId,
"collectionId": c.collectionId,
"userId": c.userId,
})
req.Header.Set("Content-Type", ctype)
req.Header.Set("User-Agent", c.s.userAgent())
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "androidenterprise.collectionviewers.patch" call.
// Exactly one of *User or error will be non-nil. Any non-2xx status
// code is an error. Response headers are in either
// *User.ServerResponse.Header or (if a response was returned at all) in
// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
// whether the returned error was because http.StatusNotModified was
// returned.
func (c *CollectionviewersPatchCall) Do() (*User, error) {
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &User{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Adds the user to the list of those specifically allowed to see the collection. If the collection's visibility is set to viewersOnly then only such users will see the collection. This method supports patch semantics.",
// "httpMethod": "PATCH",
// "id": "androidenterprise.collectionviewers.patch",
// "parameterOrder": [
// "enterpriseId",
// "collectionId",
// "userId"
// ],
// "parameters": {
// "collectionId": {
// "description": "The ID of the collection.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "enterpriseId": {
// "description": "The ID of the enterprise.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "userId": {
// "description": "The ID of the user.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "enterprises/{enterpriseId}/collections/{collectionId}/users/{userId}",
// "request": {
// "$ref": "User"
// },
// "response": {
// "$ref": "User"
// },
// "scopes": [
// "https://www.googleapis.com/auth/androidenterprise"
// ]
// }
}
// method id "androidenterprise.collectionviewers.update":
type CollectionviewersUpdateCall struct {
s *Service
enterpriseId string
collectionId string
userId string
user *User
opt_ map[string]interface{}
ctx_ context.Context
}
// Update: Adds the user to the list of those specifically allowed to
// see the collection. If the collection's visibility is set to
// viewersOnly then only such users will see the collection.
func (r *CollectionviewersService) Update(enterpriseId string, collectionId string, userId string, user *User) *CollectionviewersUpdateCall {
c := &CollectionviewersUpdateCall{s: r.s, opt_: make(map[string]interface{})}
c.enterpriseId = enterpriseId
c.collectionId = collectionId
c.userId = userId
c.user = user
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *CollectionviewersUpdateCall) Fields(s ...googleapi.Field) *CollectionviewersUpdateCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// Context sets the context to be used in this call's Do method.
// Any pending HTTP request will be aborted if the provided context
// is canceled.
func (c *CollectionviewersUpdateCall) Context(ctx context.Context) *CollectionviewersUpdateCall {
c.ctx_ = ctx
return c
}
func (c *CollectionviewersUpdateCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.user)
if err != nil {
return nil, err
}
ctype := "application/json"
params := make(url.Values)
params.Set("alt", alt)
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/collections/{collectionId}/users/{userId}")
urls += "?" + params.Encode()
req, _ := http.NewRequest("PUT", urls, body)
googleapi.Expand(req.URL, map[string]string{
"enterpriseId": c.enterpriseId,
"collectionId": c.collectionId,
"userId": c.userId,
})
req.Header.Set("Content-Type", ctype)
req.Header.Set("User-Agent", c.s.userAgent())
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "androidenterprise.collectionviewers.update" call.
// Exactly one of *User or error will be non-nil. Any non-2xx status
// code is an error. Response headers are in either
// *User.ServerResponse.Header or (if a response was returned at all) in
// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
// whether the returned error was because http.StatusNotModified was
// returned.
func (c *CollectionviewersUpdateCall) Do() (*User, error) {
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &User{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Adds the user to the list of those specifically allowed to see the collection. If the collection's visibility is set to viewersOnly then only such users will see the collection.",
// "httpMethod": "PUT",
// "id": "androidenterprise.collectionviewers.update",
// "parameterOrder": [
// "enterpriseId",
// "collectionId",
// "userId"
// ],
// "parameters": {
// "collectionId": {
// "description": "The ID of the collection.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "enterpriseId": {
// "description": "The ID of the enterprise.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "userId": {
// "description": "The ID of the user.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "enterprises/{enterpriseId}/collections/{collectionId}/users/{userId}",
// "request": {
// "$ref": "User"
// },
// "response": {
// "$ref": "User"
// },
// "scopes": [
// "https://www.googleapis.com/auth/androidenterprise"
// ]
// }
}
// method id "androidenterprise.devices.get":
type DevicesGetCall struct {
s *Service
enterpriseId string
userId string
deviceId string
opt_ map[string]interface{}
ctx_ context.Context
}
// Get: Retrieves the details of a device.
func (r *DevicesService) Get(enterpriseId string, userId string, deviceId string) *DevicesGetCall {
c := &DevicesGetCall{s: r.s, opt_: make(map[string]interface{})}
c.enterpriseId = enterpriseId
c.userId = userId
c.deviceId = deviceId
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *DevicesGetCall) Fields(s ...googleapi.Field) *DevicesGetCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *DevicesGetCall) IfNoneMatch(entityTag string) *DevicesGetCall {
c.opt_["ifNoneMatch"] = entityTag
return c
}
// Context sets the context to be used in this call's Do method.
// Any pending HTTP request will be aborted if the provided context
// is canceled.
func (c *DevicesGetCall) Context(ctx context.Context) *DevicesGetCall {
c.ctx_ = ctx
return c
}
func (c *DevicesGetCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", alt)
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
googleapi.Expand(req.URL, map[string]string{
"enterpriseId": c.enterpriseId,
"userId": c.userId,
"deviceId": c.deviceId,
})
req.Header.Set("User-Agent", c.s.userAgent())
if v, ok := c.opt_["ifNoneMatch"]; ok {
req.Header.Set("If-None-Match", fmt.Sprintf("%v", v))
}
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "androidenterprise.devices.get" call.
// Exactly one of *Device or error will be non-nil. Any non-2xx status
// code is an error. Response headers are in either
// *Device.ServerResponse.Header or (if a response was returned at all)
// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
// check whether the returned error was because http.StatusNotModified
// was returned.
func (c *DevicesGetCall) Do() (*Device, error) {
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &Device{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Retrieves the details of a device.",
// "httpMethod": "GET",
// "id": "androidenterprise.devices.get",
// "parameterOrder": [
// "enterpriseId",
// "userId",
// "deviceId"
// ],
// "parameters": {
// "deviceId": {
// "description": "The ID of the device.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "enterpriseId": {
// "description": "The ID of the enterprise.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "userId": {
// "description": "The ID of the user.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}",
// "response": {
// "$ref": "Device"
// },
// "scopes": [
// "https://www.googleapis.com/auth/androidenterprise"
// ]
// }
}
// method id "androidenterprise.devices.getState":
type DevicesGetStateCall struct {
s *Service
enterpriseId string
userId string
deviceId string
opt_ map[string]interface{}
ctx_ context.Context
}
// GetState: Retrieves whether a device is enabled or disabled for
// access by the user to Google services. The device state takes effect
// only if enforcing EMM policies on Android devices is enabled in the
// Google Admin Console. Otherwise, the device state is ignored and all
// devices are allowed access to Google services.
func (r *DevicesService) GetState(enterpriseId string, userId string, deviceId string) *DevicesGetStateCall {
c := &DevicesGetStateCall{s: r.s, opt_: make(map[string]interface{})}
c.enterpriseId = enterpriseId
c.userId = userId
c.deviceId = deviceId
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *DevicesGetStateCall) Fields(s ...googleapi.Field) *DevicesGetStateCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *DevicesGetStateCall) IfNoneMatch(entityTag string) *DevicesGetStateCall {
c.opt_["ifNoneMatch"] = entityTag
return c
}
// Context sets the context to be used in this call's Do method.
// Any pending HTTP request will be aborted if the provided context
// is canceled.
func (c *DevicesGetStateCall) Context(ctx context.Context) *DevicesGetStateCall {
c.ctx_ = ctx
return c
}
func (c *DevicesGetStateCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", alt)
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/state")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
googleapi.Expand(req.URL, map[string]string{
"enterpriseId": c.enterpriseId,
"userId": c.userId,
"deviceId": c.deviceId,
})
req.Header.Set("User-Agent", c.s.userAgent())
if v, ok := c.opt_["ifNoneMatch"]; ok {
req.Header.Set("If-None-Match", fmt.Sprintf("%v", v))
}
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "androidenterprise.devices.getState" call.
// Exactly one of *DeviceState or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *DeviceState.ServerResponse.Header or (if a response was returned at
// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
// to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *DevicesGetStateCall) Do() (*DeviceState, error) {
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &DeviceState{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Retrieves whether a device is enabled or disabled for access by the user to Google services. The device state takes effect only if enforcing EMM policies on Android devices is enabled in the Google Admin Console. Otherwise, the device state is ignored and all devices are allowed access to Google services.",
// "httpMethod": "GET",
// "id": "androidenterprise.devices.getState",
// "parameterOrder": [
// "enterpriseId",
// "userId",
// "deviceId"
// ],
// "parameters": {
// "deviceId": {
// "description": "The ID of the device.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "enterpriseId": {
// "description": "The ID of the enterprise.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "userId": {
// "description": "The ID of the user.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/state",
// "response": {
// "$ref": "DeviceState"
// },
// "scopes": [
// "https://www.googleapis.com/auth/androidenterprise"
// ]
// }
}
// method id "androidenterprise.devices.list":
type DevicesListCall struct {
s *Service
enterpriseId string
userId string
opt_ map[string]interface{}
ctx_ context.Context
}
// List: Retrieves the IDs of all of a user's devices.
func (r *DevicesService) List(enterpriseId string, userId string) *DevicesListCall {
c := &DevicesListCall{s: r.s, opt_: make(map[string]interface{})}
c.enterpriseId = enterpriseId
c.userId = userId
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *DevicesListCall) Fields(s ...googleapi.Field) *DevicesListCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *DevicesListCall) IfNoneMatch(entityTag string) *DevicesListCall {
c.opt_["ifNoneMatch"] = entityTag
return c
}
// Context sets the context to be used in this call's Do method.
// Any pending HTTP request will be aborted if the provided context
// is canceled.
func (c *DevicesListCall) Context(ctx context.Context) *DevicesListCall {
c.ctx_ = ctx
return c
}
func (c *DevicesListCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", alt)
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
googleapi.Expand(req.URL, map[string]string{
"enterpriseId": c.enterpriseId,
"userId": c.userId,
})
req.Header.Set("User-Agent", c.s.userAgent())
if v, ok := c.opt_["ifNoneMatch"]; ok {
req.Header.Set("If-None-Match", fmt.Sprintf("%v", v))
}
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "androidenterprise.devices.list" call.
// Exactly one of *DevicesListResponse or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *DevicesListResponse.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *DevicesListCall) Do() (*DevicesListResponse, error) {
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &DevicesListResponse{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Retrieves the IDs of all of a user's devices.",
// "httpMethod": "GET",
// "id": "androidenterprise.devices.list",
// "parameterOrder": [
// "enterpriseId",
// "userId"
// ],
// "parameters": {
// "enterpriseId": {
// "description": "The ID of the enterprise.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "userId": {
// "description": "The ID of the user.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "enterprises/{enterpriseId}/users/{userId}/devices",
// "response": {
// "$ref": "DevicesListResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/androidenterprise"
// ]
// }
}
// method id "androidenterprise.devices.setState":
type DevicesSetStateCall struct {
s *Service
enterpriseId string
userId string
deviceId string
devicestate *DeviceState
opt_ map[string]interface{}
ctx_ context.Context
}
// SetState: Sets whether a device is enabled or disabled for access by
// the user to Google services. The device state takes effect only if
// enforcing EMM policies on Android devices is enabled in the Google
// Admin Console. Otherwise, the device state is ignored and all devices
// are allowed access to Google services.
func (r *DevicesService) SetState(enterpriseId string, userId string, deviceId string, devicestate *DeviceState) *DevicesSetStateCall {
c := &DevicesSetStateCall{s: r.s, opt_: make(map[string]interface{})}
c.enterpriseId = enterpriseId
c.userId = userId
c.deviceId = deviceId
c.devicestate = devicestate
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *DevicesSetStateCall) Fields(s ...googleapi.Field) *DevicesSetStateCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// Context sets the context to be used in this call's Do method.
// Any pending HTTP request will be aborted if the provided context
// is canceled.
func (c *DevicesSetStateCall) Context(ctx context.Context) *DevicesSetStateCall {
c.ctx_ = ctx
return c
}
func (c *DevicesSetStateCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.devicestate)
if err != nil {
return nil, err
}
ctype := "application/json"
params := make(url.Values)
params.Set("alt", alt)
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/state")
urls += "?" + params.Encode()
req, _ := http.NewRequest("PUT", urls, body)
googleapi.Expand(req.URL, map[string]string{
"enterpriseId": c.enterpriseId,
"userId": c.userId,
"deviceId": c.deviceId,
})
req.Header.Set("Content-Type", ctype)
req.Header.Set("User-Agent", c.s.userAgent())
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "androidenterprise.devices.setState" call.
// Exactly one of *DeviceState or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *DeviceState.ServerResponse.Header or (if a response was returned at
// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
// to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *DevicesSetStateCall) Do() (*DeviceState, error) {
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &DeviceState{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Sets whether a device is enabled or disabled for access by the user to Google services. The device state takes effect only if enforcing EMM policies on Android devices is enabled in the Google Admin Console. Otherwise, the device state is ignored and all devices are allowed access to Google services.",
// "httpMethod": "PUT",
// "id": "androidenterprise.devices.setState",
// "parameterOrder": [
// "enterpriseId",
// "userId",
// "deviceId"
// ],
// "parameters": {
// "deviceId": {
// "description": "The ID of the device.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "enterpriseId": {
// "description": "The ID of the enterprise.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "userId": {
// "description": "The ID of the user.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/state",
// "request": {
// "$ref": "DeviceState"
// },
// "response": {
// "$ref": "DeviceState"
// },
// "scopes": [
// "https://www.googleapis.com/auth/androidenterprise"
// ]
// }
}
// method id "androidenterprise.enterprises.delete":
type EnterprisesDeleteCall struct {
s *Service
enterpriseId string
opt_ map[string]interface{}
ctx_ context.Context
}
// Delete: Deletes the binding between the MDM and enterprise. This is
// now deprecated; use this to unenroll customers that were previously
// enrolled with the 'insert' call, then enroll them again with the
// 'enroll' call.
func (r *EnterprisesService) Delete(enterpriseId string) *EnterprisesDeleteCall {
c := &EnterprisesDeleteCall{s: r.s, opt_: make(map[string]interface{})}
c.enterpriseId = enterpriseId
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *EnterprisesDeleteCall) Fields(s ...googleapi.Field) *EnterprisesDeleteCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// Context sets the context to be used in this call's Do method.
// Any pending HTTP request will be aborted if the provided context
// is canceled.
func (c *EnterprisesDeleteCall) Context(ctx context.Context) *EnterprisesDeleteCall {
c.ctx_ = ctx
return c
}
func (c *EnterprisesDeleteCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", alt)
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}")
urls += "?" + params.Encode()
req, _ := http.NewRequest("DELETE", urls, body)
googleapi.Expand(req.URL, map[string]string{
"enterpriseId": c.enterpriseId,
})
req.Header.Set("User-Agent", c.s.userAgent())
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "androidenterprise.enterprises.delete" call.
func (c *EnterprisesDeleteCall) Do() error {
res, err := c.doRequest("json")
if err != nil {
return err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return err
}
return nil
// {
// "description": "Deletes the binding between the MDM and enterprise. This is now deprecated; use this to unenroll customers that were previously enrolled with the 'insert' call, then enroll them again with the 'enroll' call.",
// "httpMethod": "DELETE",
// "id": "androidenterprise.enterprises.delete",
// "parameterOrder": [
// "enterpriseId"
// ],
// "parameters": {
// "enterpriseId": {
// "description": "The ID of the enterprise.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "enterprises/{enterpriseId}",
// "scopes": [
// "https://www.googleapis.com/auth/androidenterprise"
// ]
// }
}
// method id "androidenterprise.enterprises.enroll":
type EnterprisesEnrollCall struct {
s *Service
token string
enterprise *Enterprise
opt_ map[string]interface{}
ctx_ context.Context
}
// Enroll: Enrolls an enterprise with the calling MDM.
func (r *EnterprisesService) Enroll(token string, enterprise *Enterprise) *EnterprisesEnrollCall {
c := &EnterprisesEnrollCall{s: r.s, opt_: make(map[string]interface{})}
c.token = token
c.enterprise = enterprise
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *EnterprisesEnrollCall) Fields(s ...googleapi.Field) *EnterprisesEnrollCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// Context sets the context to be used in this call's Do method.
// Any pending HTTP request will be aborted if the provided context
// is canceled.
func (c *EnterprisesEnrollCall) Context(ctx context.Context) *EnterprisesEnrollCall {
c.ctx_ = ctx
return c
}
func (c *EnterprisesEnrollCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.enterprise)
if err != nil {
return nil, err
}
ctype := "application/json"
params := make(url.Values)
params.Set("alt", alt)
params.Set("token", fmt.Sprintf("%v", c.token))
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/enroll")
urls += "?" + params.Encode()
req, _ := http.NewRequest("POST", urls, body)
googleapi.SetOpaque(req.URL)
req.Header.Set("Content-Type", ctype)
req.Header.Set("User-Agent", c.s.userAgent())
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "androidenterprise.enterprises.enroll" call.
// Exactly one of *Enterprise or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *Enterprise.ServerResponse.Header or (if a response was returned at
// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
// to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *EnterprisesEnrollCall) Do() (*Enterprise, error) {
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &Enterprise{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Enrolls an enterprise with the calling MDM.",
// "httpMethod": "POST",
// "id": "androidenterprise.enterprises.enroll",
// "parameterOrder": [
// "token"
// ],
// "parameters": {
// "token": {
// "description": "The token provided by the enterprise to register the MDM.",
// "location": "query",
// "required": true,
// "type": "string"
// }
// },
// "path": "enterprises/enroll",
// "request": {
// "$ref": "Enterprise"
// },
// "response": {
// "$ref": "Enterprise"
// },
// "scopes": [
// "https://www.googleapis.com/auth/androidenterprise"
// ]
// }
}
// method id "androidenterprise.enterprises.get":
type EnterprisesGetCall struct {
s *Service
enterpriseId string
opt_ map[string]interface{}
ctx_ context.Context
}
// Get: Retrieves the name and domain of an enterprise.
func (r *EnterprisesService) Get(enterpriseId string) *EnterprisesGetCall {
c := &EnterprisesGetCall{s: r.s, opt_: make(map[string]interface{})}
c.enterpriseId = enterpriseId
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *EnterprisesGetCall) Fields(s ...googleapi.Field) *EnterprisesGetCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *EnterprisesGetCall) IfNoneMatch(entityTag string) *EnterprisesGetCall {
c.opt_["ifNoneMatch"] = entityTag
return c
}
// Context sets the context to be used in this call's Do method.
// Any pending HTTP request will be aborted if the provided context
// is canceled.
func (c *EnterprisesGetCall) Context(ctx context.Context) *EnterprisesGetCall {
c.ctx_ = ctx
return c
}
func (c *EnterprisesGetCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", alt)
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
googleapi.Expand(req.URL, map[string]string{
"enterpriseId": c.enterpriseId,
})
req.Header.Set("User-Agent", c.s.userAgent())
if v, ok := c.opt_["ifNoneMatch"]; ok {
req.Header.Set("If-None-Match", fmt.Sprintf("%v", v))
}
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "androidenterprise.enterprises.get" call.
// Exactly one of *Enterprise or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *Enterprise.ServerResponse.Header or (if a response was returned at
// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
// to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *EnterprisesGetCall) Do() (*Enterprise, error) {
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &Enterprise{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Retrieves the name and domain of an enterprise.",
// "httpMethod": "GET",
// "id": "androidenterprise.enterprises.get",
// "parameterOrder": [
// "enterpriseId"
// ],
// "parameters": {
// "enterpriseId": {
// "description": "The ID of the enterprise.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "enterprises/{enterpriseId}",
// "response": {
// "$ref": "Enterprise"
// },
// "scopes": [
// "https://www.googleapis.com/auth/androidenterprise"
// ]
// }
}
// method id "androidenterprise.enterprises.insert":
type EnterprisesInsertCall struct {
s *Service
token string
enterprise *Enterprise
opt_ map[string]interface{}
ctx_ context.Context
}
// Insert: Establishes the binding between the MDM and an enterprise.
// This is now deprecated; use enroll instead.
func (r *EnterprisesService) Insert(token string, enterprise *Enterprise) *EnterprisesInsertCall {
c := &EnterprisesInsertCall{s: r.s, opt_: make(map[string]interface{})}
c.token = token
c.enterprise = enterprise
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *EnterprisesInsertCall) Fields(s ...googleapi.Field) *EnterprisesInsertCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// Context sets the context to be used in this call's Do method.
// Any pending HTTP request will be aborted if the provided context
// is canceled.
func (c *EnterprisesInsertCall) Context(ctx context.Context) *EnterprisesInsertCall {
c.ctx_ = ctx
return c
}
func (c *EnterprisesInsertCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.enterprise)
if err != nil {
return nil, err
}
ctype := "application/json"
params := make(url.Values)
params.Set("alt", alt)
params.Set("token", fmt.Sprintf("%v", c.token))
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises")
urls += "?" + params.Encode()
req, _ := http.NewRequest("POST", urls, body)
googleapi.SetOpaque(req.URL)
req.Header.Set("Content-Type", ctype)
req.Header.Set("User-Agent", c.s.userAgent())
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "androidenterprise.enterprises.insert" call.
// Exactly one of *Enterprise or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *Enterprise.ServerResponse.Header or (if a response was returned at
// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
// to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *EnterprisesInsertCall) Do() (*Enterprise, error) {
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &Enterprise{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Establishes the binding between the MDM and an enterprise. This is now deprecated; use enroll instead.",
// "httpMethod": "POST",
// "id": "androidenterprise.enterprises.insert",
// "parameterOrder": [
// "token"
// ],
// "parameters": {
// "token": {
// "description": "The token provided by the enterprise to register the MDM.",
// "location": "query",
// "required": true,
// "type": "string"
// }
// },
// "path": "enterprises",
// "request": {
// "$ref": "Enterprise"
// },
// "response": {
// "$ref": "Enterprise"
// },
// "scopes": [
// "https://www.googleapis.com/auth/androidenterprise"
// ]
// }
}
// method id "androidenterprise.enterprises.list":
type EnterprisesListCall struct {
s *Service
domain string
opt_ map[string]interface{}
ctx_ context.Context
}
// List: Looks up an enterprise by domain name.
func (r *EnterprisesService) List(domain string) *EnterprisesListCall {
c := &EnterprisesListCall{s: r.s, opt_: make(map[string]interface{})}
c.domain = domain
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *EnterprisesListCall) Fields(s ...googleapi.Field) *EnterprisesListCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *EnterprisesListCall) IfNoneMatch(entityTag string) *EnterprisesListCall {
c.opt_["ifNoneMatch"] = entityTag
return c
}
// Context sets the context to be used in this call's Do method.
// Any pending HTTP request will be aborted if the provided context
// is canceled.
func (c *EnterprisesListCall) Context(ctx context.Context) *EnterprisesListCall {
c.ctx_ = ctx
return c
}
func (c *EnterprisesListCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", alt)
params.Set("domain", fmt.Sprintf("%v", c.domain))
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
googleapi.SetOpaque(req.URL)
req.Header.Set("User-Agent", c.s.userAgent())
if v, ok := c.opt_["ifNoneMatch"]; ok {
req.Header.Set("If-None-Match", fmt.Sprintf("%v", v))
}
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "androidenterprise.enterprises.list" call.
// Exactly one of *EnterprisesListResponse or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *EnterprisesListResponse.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *EnterprisesListCall) Do() (*EnterprisesListResponse, error) {
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &EnterprisesListResponse{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Looks up an enterprise by domain name.",
// "httpMethod": "GET",
// "id": "androidenterprise.enterprises.list",
// "parameterOrder": [
// "domain"
// ],
// "parameters": {
// "domain": {
// "description": "The exact primary domain name of the enterprise to look up.",
// "location": "query",
// "required": true,
// "type": "string"
// }
// },
// "path": "enterprises",
// "response": {
// "$ref": "EnterprisesListResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/androidenterprise"
// ]
// }
}
// method id "androidenterprise.enterprises.sendTestPushNotification":
type EnterprisesSendTestPushNotificationCall struct {
s *Service
enterpriseId string
opt_ map[string]interface{}
ctx_ context.Context
}
// SendTestPushNotification: Sends a test push notification to validate
// the MDM integration with the Google Cloud Pub/Sub service for this
// enterprise.
func (r *EnterprisesService) SendTestPushNotification(enterpriseId string) *EnterprisesSendTestPushNotificationCall {
c := &EnterprisesSendTestPushNotificationCall{s: r.s, opt_: make(map[string]interface{})}
c.enterpriseId = enterpriseId
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *EnterprisesSendTestPushNotificationCall) Fields(s ...googleapi.Field) *EnterprisesSendTestPushNotificationCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// Context sets the context to be used in this call's Do method.
// Any pending HTTP request will be aborted if the provided context
// is canceled.
func (c *EnterprisesSendTestPushNotificationCall) Context(ctx context.Context) *EnterprisesSendTestPushNotificationCall {
c.ctx_ = ctx
return c
}
func (c *EnterprisesSendTestPushNotificationCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", alt)
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/sendTestPushNotification")
urls += "?" + params.Encode()
req, _ := http.NewRequest("POST", urls, body)
googleapi.Expand(req.URL, map[string]string{
"enterpriseId": c.enterpriseId,
})
req.Header.Set("User-Agent", c.s.userAgent())
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "androidenterprise.enterprises.sendTestPushNotification" call.
// Exactly one of *EnterprisesSendTestPushNotificationResponse or error
// will be non-nil. Any non-2xx status code is an error. Response
// headers are in either
// *EnterprisesSendTestPushNotificationResponse.ServerResponse.Header or
// (if a response was returned at all) in
// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
// whether the returned error was because http.StatusNotModified was
// returned.
func (c *EnterprisesSendTestPushNotificationCall) Do() (*EnterprisesSendTestPushNotificationResponse, error) {
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &EnterprisesSendTestPushNotificationResponse{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Sends a test push notification to validate the MDM integration with the Google Cloud Pub/Sub service for this enterprise.",
// "httpMethod": "POST",
// "id": "androidenterprise.enterprises.sendTestPushNotification",
// "parameterOrder": [
// "enterpriseId"
// ],
// "parameters": {
// "enterpriseId": {
// "description": "The ID of the enterprise.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "enterprises/{enterpriseId}/sendTestPushNotification",
// "response": {
// "$ref": "EnterprisesSendTestPushNotificationResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/androidenterprise"
// ]
// }
}
// method id "androidenterprise.enterprises.setAccount":
type EnterprisesSetAccountCall struct {
s *Service
enterpriseId string
enterpriseaccount *EnterpriseAccount
opt_ map[string]interface{}
ctx_ context.Context
}
// SetAccount: Set the account that will be used to authenticate to the
// API as the enterprise.
func (r *EnterprisesService) SetAccount(enterpriseId string, enterpriseaccount *EnterpriseAccount) *EnterprisesSetAccountCall {
c := &EnterprisesSetAccountCall{s: r.s, opt_: make(map[string]interface{})}
c.enterpriseId = enterpriseId
c.enterpriseaccount = enterpriseaccount
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *EnterprisesSetAccountCall) Fields(s ...googleapi.Field) *EnterprisesSetAccountCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// Context sets the context to be used in this call's Do method.
// Any pending HTTP request will be aborted if the provided context
// is canceled.
func (c *EnterprisesSetAccountCall) Context(ctx context.Context) *EnterprisesSetAccountCall {
c.ctx_ = ctx
return c
}
func (c *EnterprisesSetAccountCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.enterpriseaccount)
if err != nil {
return nil, err
}
ctype := "application/json"
params := make(url.Values)
params.Set("alt", alt)
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/account")
urls += "?" + params.Encode()
req, _ := http.NewRequest("PUT", urls, body)
googleapi.Expand(req.URL, map[string]string{
"enterpriseId": c.enterpriseId,
})
req.Header.Set("Content-Type", ctype)
req.Header.Set("User-Agent", c.s.userAgent())
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "androidenterprise.enterprises.setAccount" call.
// Exactly one of *EnterpriseAccount or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *EnterpriseAccount.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *EnterprisesSetAccountCall) Do() (*EnterpriseAccount, error) {
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &EnterpriseAccount{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Set the account that will be used to authenticate to the API as the enterprise.",
// "httpMethod": "PUT",
// "id": "androidenterprise.enterprises.setAccount",
// "parameterOrder": [
// "enterpriseId"
// ],
// "parameters": {
// "enterpriseId": {
// "description": "The ID of the enterprise.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "enterprises/{enterpriseId}/account",
// "request": {
// "$ref": "EnterpriseAccount"
// },
// "response": {
// "$ref": "EnterpriseAccount"
// },
// "scopes": [
// "https://www.googleapis.com/auth/androidenterprise"
// ]
// }
}
// method id "androidenterprise.enterprises.unenroll":
type EnterprisesUnenrollCall struct {
s *Service
enterpriseId string
opt_ map[string]interface{}
ctx_ context.Context
}
// Unenroll: Unenrolls an enterprise from the calling MDM.
func (r *EnterprisesService) Unenroll(enterpriseId string) *EnterprisesUnenrollCall {
c := &EnterprisesUnenrollCall{s: r.s, opt_: make(map[string]interface{})}
c.enterpriseId = enterpriseId
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *EnterprisesUnenrollCall) Fields(s ...googleapi.Field) *EnterprisesUnenrollCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// Context sets the context to be used in this call's Do method.
// Any pending HTTP request will be aborted if the provided context
// is canceled.
func (c *EnterprisesUnenrollCall) Context(ctx context.Context) *EnterprisesUnenrollCall {
c.ctx_ = ctx
return c
}
func (c *EnterprisesUnenrollCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", alt)
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/unenroll")
urls += "?" + params.Encode()
req, _ := http.NewRequest("POST", urls, body)
googleapi.Expand(req.URL, map[string]string{
"enterpriseId": c.enterpriseId,
})
req.Header.Set("User-Agent", c.s.userAgent())
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "androidenterprise.enterprises.unenroll" call.
func (c *EnterprisesUnenrollCall) Do() error {
res, err := c.doRequest("json")
if err != nil {
return err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return err
}
return nil
// {
// "description": "Unenrolls an enterprise from the calling MDM.",
// "httpMethod": "POST",
// "id": "androidenterprise.enterprises.unenroll",
// "parameterOrder": [
// "enterpriseId"
// ],
// "parameters": {
// "enterpriseId": {
// "description": "The ID of the enterprise.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "enterprises/{enterpriseId}/unenroll",
// "scopes": [
// "https://www.googleapis.com/auth/androidenterprise"
// ]
// }
}
// method id "androidenterprise.entitlements.delete":
type EntitlementsDeleteCall struct {
s *Service
enterpriseId string
userId string
entitlementId string
opt_ map[string]interface{}
ctx_ context.Context
}
// Delete: Removes an entitlement to an app for a user and uninstalls
// it.
func (r *EntitlementsService) Delete(enterpriseId string, userId string, entitlementId string) *EntitlementsDeleteCall {
c := &EntitlementsDeleteCall{s: r.s, opt_: make(map[string]interface{})}
c.enterpriseId = enterpriseId
c.userId = userId
c.entitlementId = entitlementId
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *EntitlementsDeleteCall) Fields(s ...googleapi.Field) *EntitlementsDeleteCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// Context sets the context to be used in this call's Do method.
// Any pending HTTP request will be aborted if the provided context
// is canceled.
func (c *EntitlementsDeleteCall) Context(ctx context.Context) *EntitlementsDeleteCall {
c.ctx_ = ctx
return c
}
func (c *EntitlementsDeleteCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", alt)
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}")
urls += "?" + params.Encode()
req, _ := http.NewRequest("DELETE", urls, body)
googleapi.Expand(req.URL, map[string]string{
"enterpriseId": c.enterpriseId,
"userId": c.userId,
"entitlementId": c.entitlementId,
})
req.Header.Set("User-Agent", c.s.userAgent())
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "androidenterprise.entitlements.delete" call.
func (c *EntitlementsDeleteCall) Do() error {
res, err := c.doRequest("json")
if err != nil {
return err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return err
}
return nil
// {
// "description": "Removes an entitlement to an app for a user and uninstalls it.",
// "httpMethod": "DELETE",
// "id": "androidenterprise.entitlements.delete",
// "parameterOrder": [
// "enterpriseId",
// "userId",
// "entitlementId"
// ],
// "parameters": {
// "enterpriseId": {
// "description": "The ID of the enterprise.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "entitlementId": {
// "description": "The ID of the entitlement, e.g. \"app:com.google.android.gm\".",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "userId": {
// "description": "The ID of the user.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}",
// "scopes": [
// "https://www.googleapis.com/auth/androidenterprise"
// ]
// }
}
// method id "androidenterprise.entitlements.get":
type EntitlementsGetCall struct {
s *Service
enterpriseId string
userId string
entitlementId string
opt_ map[string]interface{}
ctx_ context.Context
}
// Get: Retrieves details of an entitlement.
func (r *EntitlementsService) Get(enterpriseId string, userId string, entitlementId string) *EntitlementsGetCall {
c := &EntitlementsGetCall{s: r.s, opt_: make(map[string]interface{})}
c.enterpriseId = enterpriseId
c.userId = userId
c.entitlementId = entitlementId
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *EntitlementsGetCall) Fields(s ...googleapi.Field) *EntitlementsGetCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *EntitlementsGetCall) IfNoneMatch(entityTag string) *EntitlementsGetCall {
c.opt_["ifNoneMatch"] = entityTag
return c
}
// Context sets the context to be used in this call's Do method.
// Any pending HTTP request will be aborted if the provided context
// is canceled.
func (c *EntitlementsGetCall) Context(ctx context.Context) *EntitlementsGetCall {
c.ctx_ = ctx
return c
}
func (c *EntitlementsGetCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", alt)
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
googleapi.Expand(req.URL, map[string]string{
"enterpriseId": c.enterpriseId,
"userId": c.userId,
"entitlementId": c.entitlementId,
})
req.Header.Set("User-Agent", c.s.userAgent())
if v, ok := c.opt_["ifNoneMatch"]; ok {
req.Header.Set("If-None-Match", fmt.Sprintf("%v", v))
}
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "androidenterprise.entitlements.get" call.
// Exactly one of *Entitlement or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *Entitlement.ServerResponse.Header or (if a response was returned at
// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
// to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *EntitlementsGetCall) Do() (*Entitlement, error) {
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &Entitlement{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Retrieves details of an entitlement.",
// "httpMethod": "GET",
// "id": "androidenterprise.entitlements.get",
// "parameterOrder": [
// "enterpriseId",
// "userId",
// "entitlementId"
// ],
// "parameters": {
// "enterpriseId": {
// "description": "The ID of the enterprise.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "entitlementId": {
// "description": "The ID of the entitlement, e.g. \"app:com.google.android.gm\".",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "userId": {
// "description": "The ID of the user.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}",
// "response": {
// "$ref": "Entitlement"
// },
// "scopes": [
// "https://www.googleapis.com/auth/androidenterprise"
// ]
// }
}
// method id "androidenterprise.entitlements.list":
type EntitlementsListCall struct {
s *Service
enterpriseId string
userId string
opt_ map[string]interface{}
ctx_ context.Context
}
// List: List of all entitlements for the specified user. Only the ID is
// set.
func (r *EntitlementsService) List(enterpriseId string, userId string) *EntitlementsListCall {
c := &EntitlementsListCall{s: r.s, opt_: make(map[string]interface{})}
c.enterpriseId = enterpriseId
c.userId = userId
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *EntitlementsListCall) Fields(s ...googleapi.Field) *EntitlementsListCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *EntitlementsListCall) IfNoneMatch(entityTag string) *EntitlementsListCall {
c.opt_["ifNoneMatch"] = entityTag
return c
}
// Context sets the context to be used in this call's Do method.
// Any pending HTTP request will be aborted if the provided context
// is canceled.
func (c *EntitlementsListCall) Context(ctx context.Context) *EntitlementsListCall {
c.ctx_ = ctx
return c
}
func (c *EntitlementsListCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", alt)
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/entitlements")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
googleapi.Expand(req.URL, map[string]string{
"enterpriseId": c.enterpriseId,
"userId": c.userId,
})
req.Header.Set("User-Agent", c.s.userAgent())
if v, ok := c.opt_["ifNoneMatch"]; ok {
req.Header.Set("If-None-Match", fmt.Sprintf("%v", v))
}
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "androidenterprise.entitlements.list" call.
// Exactly one of *EntitlementsListResponse or error will be non-nil.
// Any non-2xx status code is an error. Response headers are in either
// *EntitlementsListResponse.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *EntitlementsListCall) Do() (*EntitlementsListResponse, error) {
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &EntitlementsListResponse{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "List of all entitlements for the specified user. Only the ID is set.",
// "httpMethod": "GET",
// "id": "androidenterprise.entitlements.list",
// "parameterOrder": [
// "enterpriseId",
// "userId"
// ],
// "parameters": {
// "enterpriseId": {
// "description": "The ID of the enterprise.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "userId": {
// "description": "The ID of the user.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "enterprises/{enterpriseId}/users/{userId}/entitlements",
// "response": {
// "$ref": "EntitlementsListResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/androidenterprise"
// ]
// }
}
// method id "androidenterprise.entitlements.patch":
type EntitlementsPatchCall struct {
s *Service
enterpriseId string
userId string
entitlementId string
entitlement *Entitlement
opt_ map[string]interface{}
ctx_ context.Context
}
// Patch: Adds or updates an entitlement to an app for a user. This
// method supports patch semantics.
func (r *EntitlementsService) Patch(enterpriseId string, userId string, entitlementId string, entitlement *Entitlement) *EntitlementsPatchCall {
c := &EntitlementsPatchCall{s: r.s, opt_: make(map[string]interface{})}
c.enterpriseId = enterpriseId
c.userId = userId
c.entitlementId = entitlementId
c.entitlement = entitlement
return c
}
// Install sets the optional parameter "install": Set to true to also
// install the product on all the user's devices where possible. Failure
// to install on one or more devices will not prevent this operation
// from returning successfully, as long as the entitlement was
// successfully assigned to the user.
func (c *EntitlementsPatchCall) Install(install bool) *EntitlementsPatchCall {
c.opt_["install"] = install
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *EntitlementsPatchCall) Fields(s ...googleapi.Field) *EntitlementsPatchCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// Context sets the context to be used in this call's Do method.
// Any pending HTTP request will be aborted if the provided context
// is canceled.
func (c *EntitlementsPatchCall) Context(ctx context.Context) *EntitlementsPatchCall {
c.ctx_ = ctx
return c
}
func (c *EntitlementsPatchCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.entitlement)
if err != nil {
return nil, err
}
ctype := "application/json"
params := make(url.Values)
params.Set("alt", alt)
if v, ok := c.opt_["install"]; ok {
params.Set("install", fmt.Sprintf("%v", v))
}
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}")
urls += "?" + params.Encode()
req, _ := http.NewRequest("PATCH", urls, body)
googleapi.Expand(req.URL, map[string]string{
"enterpriseId": c.enterpriseId,
"userId": c.userId,
"entitlementId": c.entitlementId,
})
req.Header.Set("Content-Type", ctype)
req.Header.Set("User-Agent", c.s.userAgent())
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "androidenterprise.entitlements.patch" call.
// Exactly one of *Entitlement or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *Entitlement.ServerResponse.Header or (if a response was returned at
// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
// to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *EntitlementsPatchCall) Do() (*Entitlement, error) {
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &Entitlement{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Adds or updates an entitlement to an app for a user. This method supports patch semantics.",
// "httpMethod": "PATCH",
// "id": "androidenterprise.entitlements.patch",
// "parameterOrder": [
// "enterpriseId",
// "userId",
// "entitlementId"
// ],
// "parameters": {
// "enterpriseId": {
// "description": "The ID of the enterprise.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "entitlementId": {
// "description": "The ID of the entitlement, e.g. \"app:com.google.android.gm\".",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "install": {
// "description": "Set to true to also install the product on all the user's devices where possible. Failure to install on one or more devices will not prevent this operation from returning successfully, as long as the entitlement was successfully assigned to the user.",
// "location": "query",
// "type": "boolean"
// },
// "userId": {
// "description": "The ID of the user.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}",
// "request": {
// "$ref": "Entitlement"
// },
// "response": {
// "$ref": "Entitlement"
// },
// "scopes": [
// "https://www.googleapis.com/auth/androidenterprise"
// ]
// }
}
// method id "androidenterprise.entitlements.update":
type EntitlementsUpdateCall struct {
s *Service
enterpriseId string
userId string
entitlementId string
entitlement *Entitlement
opt_ map[string]interface{}
ctx_ context.Context
}
// Update: Adds or updates an entitlement to an app for a user.
func (r *EntitlementsService) Update(enterpriseId string, userId string, entitlementId string, entitlement *Entitlement) *EntitlementsUpdateCall {
c := &EntitlementsUpdateCall{s: r.s, opt_: make(map[string]interface{})}
c.enterpriseId = enterpriseId
c.userId = userId
c.entitlementId = entitlementId
c.entitlement = entitlement
return c
}
// Install sets the optional parameter "install": Set to true to also
// install the product on all the user's devices where possible. Failure
// to install on one or more devices will not prevent this operation
// from returning successfully, as long as the entitlement was
// successfully assigned to the user.
func (c *EntitlementsUpdateCall) Install(install bool) *EntitlementsUpdateCall {
c.opt_["install"] = install
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *EntitlementsUpdateCall) Fields(s ...googleapi.Field) *EntitlementsUpdateCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// Context sets the context to be used in this call's Do method.
// Any pending HTTP request will be aborted if the provided context
// is canceled.
func (c *EntitlementsUpdateCall) Context(ctx context.Context) *EntitlementsUpdateCall {
c.ctx_ = ctx
return c
}
func (c *EntitlementsUpdateCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.entitlement)
if err != nil {
return nil, err
}
ctype := "application/json"
params := make(url.Values)
params.Set("alt", alt)
if v, ok := c.opt_["install"]; ok {
params.Set("install", fmt.Sprintf("%v", v))
}
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}")
urls += "?" + params.Encode()
req, _ := http.NewRequest("PUT", urls, body)
googleapi.Expand(req.URL, map[string]string{
"enterpriseId": c.enterpriseId,
"userId": c.userId,
"entitlementId": c.entitlementId,
})
req.Header.Set("Content-Type", ctype)
req.Header.Set("User-Agent", c.s.userAgent())
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "androidenterprise.entitlements.update" call.
// Exactly one of *Entitlement or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *Entitlement.ServerResponse.Header or (if a response was returned at
// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
// to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *EntitlementsUpdateCall) Do() (*Entitlement, error) {
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &Entitlement{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Adds or updates an entitlement to an app for a user.",
// "httpMethod": "PUT",
// "id": "androidenterprise.entitlements.update",
// "parameterOrder": [
// "enterpriseId",
// "userId",
// "entitlementId"
// ],
// "parameters": {
// "enterpriseId": {
// "description": "The ID of the enterprise.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "entitlementId": {
// "description": "The ID of the entitlement, e.g. \"app:com.google.android.gm\".",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "install": {
// "description": "Set to true to also install the product on all the user's devices where possible. Failure to install on one or more devices will not prevent this operation from returning successfully, as long as the entitlement was successfully assigned to the user.",
// "location": "query",
// "type": "boolean"
// },
// "userId": {
// "description": "The ID of the user.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}",
// "request": {
// "$ref": "Entitlement"
// },
// "response": {
// "$ref": "Entitlement"
// },
// "scopes": [
// "https://www.googleapis.com/auth/androidenterprise"
// ]
// }
}
// method id "androidenterprise.grouplicenses.get":
type GrouplicensesGetCall struct {
s *Service
enterpriseId string
groupLicenseId string
opt_ map[string]interface{}
ctx_ context.Context
}
// Get: Retrieves details of an enterprise's group license for a
// product.
func (r *GrouplicensesService) Get(enterpriseId string, groupLicenseId string) *GrouplicensesGetCall {
c := &GrouplicensesGetCall{s: r.s, opt_: make(map[string]interface{})}
c.enterpriseId = enterpriseId
c.groupLicenseId = groupLicenseId
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *GrouplicensesGetCall) Fields(s ...googleapi.Field) *GrouplicensesGetCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *GrouplicensesGetCall) IfNoneMatch(entityTag string) *GrouplicensesGetCall {
c.opt_["ifNoneMatch"] = entityTag
return c
}
// Context sets the context to be used in this call's Do method.
// Any pending HTTP request will be aborted if the provided context
// is canceled.
func (c *GrouplicensesGetCall) Context(ctx context.Context) *GrouplicensesGetCall {
c.ctx_ = ctx
return c
}
func (c *GrouplicensesGetCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", alt)
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/groupLicenses/{groupLicenseId}")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
googleapi.Expand(req.URL, map[string]string{
"enterpriseId": c.enterpriseId,
"groupLicenseId": c.groupLicenseId,
})
req.Header.Set("User-Agent", c.s.userAgent())
if v, ok := c.opt_["ifNoneMatch"]; ok {
req.Header.Set("If-None-Match", fmt.Sprintf("%v", v))
}
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "androidenterprise.grouplicenses.get" call.
// Exactly one of *GroupLicense or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *GroupLicense.ServerResponse.Header or (if a response was returned at
// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
// to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *GrouplicensesGetCall) Do() (*GroupLicense, error) {
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &GroupLicense{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Retrieves details of an enterprise's group license for a product.",
// "httpMethod": "GET",
// "id": "androidenterprise.grouplicenses.get",
// "parameterOrder": [
// "enterpriseId",
// "groupLicenseId"
// ],
// "parameters": {
// "enterpriseId": {
// "description": "The ID of the enterprise.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "groupLicenseId": {
// "description": "The ID of the product the group license is for, e.g. \"app:com.google.android.gm\".",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "enterprises/{enterpriseId}/groupLicenses/{groupLicenseId}",
// "response": {
// "$ref": "GroupLicense"
// },
// "scopes": [
// "https://www.googleapis.com/auth/androidenterprise"
// ]
// }
}
// method id "androidenterprise.grouplicenses.list":
type GrouplicensesListCall struct {
s *Service
enterpriseId string
opt_ map[string]interface{}
ctx_ context.Context
}
// List: Retrieves IDs of all products for which the enterprise has a
// group license.
func (r *GrouplicensesService) List(enterpriseId string) *GrouplicensesListCall {
c := &GrouplicensesListCall{s: r.s, opt_: make(map[string]interface{})}
c.enterpriseId = enterpriseId
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *GrouplicensesListCall) Fields(s ...googleapi.Field) *GrouplicensesListCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *GrouplicensesListCall) IfNoneMatch(entityTag string) *GrouplicensesListCall {
c.opt_["ifNoneMatch"] = entityTag
return c
}
// Context sets the context to be used in this call's Do method.
// Any pending HTTP request will be aborted if the provided context
// is canceled.
func (c *GrouplicensesListCall) Context(ctx context.Context) *GrouplicensesListCall {
c.ctx_ = ctx
return c
}
func (c *GrouplicensesListCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", alt)
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/groupLicenses")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
googleapi.Expand(req.URL, map[string]string{
"enterpriseId": c.enterpriseId,
})
req.Header.Set("User-Agent", c.s.userAgent())
if v, ok := c.opt_["ifNoneMatch"]; ok {
req.Header.Set("If-None-Match", fmt.Sprintf("%v", v))
}
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "androidenterprise.grouplicenses.list" call.
// Exactly one of *GroupLicensesListResponse or error will be non-nil.
// Any non-2xx status code is an error. Response headers are in either
// *GroupLicensesListResponse.ServerResponse.Header or (if a response
// was returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *GrouplicensesListCall) Do() (*GroupLicensesListResponse, error) {
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &GroupLicensesListResponse{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Retrieves IDs of all products for which the enterprise has a group license.",
// "httpMethod": "GET",
// "id": "androidenterprise.grouplicenses.list",
// "parameterOrder": [
// "enterpriseId"
// ],
// "parameters": {
// "enterpriseId": {
// "description": "The ID of the enterprise.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "enterprises/{enterpriseId}/groupLicenses",
// "response": {
// "$ref": "GroupLicensesListResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/androidenterprise"
// ]
// }
}
// method id "androidenterprise.grouplicenseusers.list":
type GrouplicenseusersListCall struct {
s *Service
enterpriseId string
groupLicenseId string
opt_ map[string]interface{}
ctx_ context.Context
}
// List: Retrieves the IDs of the users who have been granted
// entitlements under the license.
func (r *GrouplicenseusersService) List(enterpriseId string, groupLicenseId string) *GrouplicenseusersListCall {
c := &GrouplicenseusersListCall{s: r.s, opt_: make(map[string]interface{})}
c.enterpriseId = enterpriseId
c.groupLicenseId = groupLicenseId
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *GrouplicenseusersListCall) Fields(s ...googleapi.Field) *GrouplicenseusersListCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *GrouplicenseusersListCall) IfNoneMatch(entityTag string) *GrouplicenseusersListCall {
c.opt_["ifNoneMatch"] = entityTag
return c
}
// Context sets the context to be used in this call's Do method.
// Any pending HTTP request will be aborted if the provided context
// is canceled.
func (c *GrouplicenseusersListCall) Context(ctx context.Context) *GrouplicenseusersListCall {
c.ctx_ = ctx
return c
}
func (c *GrouplicenseusersListCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", alt)
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/groupLicenses/{groupLicenseId}/users")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
googleapi.Expand(req.URL, map[string]string{
"enterpriseId": c.enterpriseId,
"groupLicenseId": c.groupLicenseId,
})
req.Header.Set("User-Agent", c.s.userAgent())
if v, ok := c.opt_["ifNoneMatch"]; ok {
req.Header.Set("If-None-Match", fmt.Sprintf("%v", v))
}
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "androidenterprise.grouplicenseusers.list" call.
// Exactly one of *GroupLicenseUsersListResponse or error will be
// non-nil. Any non-2xx status code is an error. Response headers are in
// either *GroupLicenseUsersListResponse.ServerResponse.Header or (if a
// response was returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *GrouplicenseusersListCall) Do() (*GroupLicenseUsersListResponse, error) {
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &GroupLicenseUsersListResponse{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Retrieves the IDs of the users who have been granted entitlements under the license.",
// "httpMethod": "GET",
// "id": "androidenterprise.grouplicenseusers.list",
// "parameterOrder": [
// "enterpriseId",
// "groupLicenseId"
// ],
// "parameters": {
// "enterpriseId": {
// "description": "The ID of the enterprise.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "groupLicenseId": {
// "description": "The ID of the product the group license is for, e.g. \"app:com.google.android.gm\".",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "enterprises/{enterpriseId}/groupLicenses/{groupLicenseId}/users",
// "response": {
// "$ref": "GroupLicenseUsersListResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/androidenterprise"
// ]
// }
}
// method id "androidenterprise.installs.delete":
type InstallsDeleteCall struct {
s *Service
enterpriseId string
userId string
deviceId string
installId string
opt_ map[string]interface{}
ctx_ context.Context
}
// Delete: Requests to remove an app from a device. A call to get or
// list will still show the app as installed on the device until it is
// actually removed.
func (r *InstallsService) Delete(enterpriseId string, userId string, deviceId string, installId string) *InstallsDeleteCall {
c := &InstallsDeleteCall{s: r.s, opt_: make(map[string]interface{})}
c.enterpriseId = enterpriseId
c.userId = userId
c.deviceId = deviceId
c.installId = installId
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *InstallsDeleteCall) Fields(s ...googleapi.Field) *InstallsDeleteCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// Context sets the context to be used in this call's Do method.
// Any pending HTTP request will be aborted if the provided context
// is canceled.
func (c *InstallsDeleteCall) Context(ctx context.Context) *InstallsDeleteCall {
c.ctx_ = ctx
return c
}
func (c *InstallsDeleteCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", alt)
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}")
urls += "?" + params.Encode()
req, _ := http.NewRequest("DELETE", urls, body)
googleapi.Expand(req.URL, map[string]string{
"enterpriseId": c.enterpriseId,
"userId": c.userId,
"deviceId": c.deviceId,
"installId": c.installId,
})
req.Header.Set("User-Agent", c.s.userAgent())
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "androidenterprise.installs.delete" call.
func (c *InstallsDeleteCall) Do() error {
res, err := c.doRequest("json")
if err != nil {
return err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return err
}
return nil
// {
// "description": "Requests to remove an app from a device. A call to get or list will still show the app as installed on the device until it is actually removed.",
// "httpMethod": "DELETE",
// "id": "androidenterprise.installs.delete",
// "parameterOrder": [
// "enterpriseId",
// "userId",
// "deviceId",
// "installId"
// ],
// "parameters": {
// "deviceId": {
// "description": "The Android ID of the device.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "enterpriseId": {
// "description": "The ID of the enterprise.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "installId": {
// "description": "The ID of the product represented by the install, e.g. \"app:com.google.android.gm\".",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "userId": {
// "description": "The ID of the user.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}",
// "scopes": [
// "https://www.googleapis.com/auth/androidenterprise"
// ]
// }
}
// method id "androidenterprise.installs.get":
type InstallsGetCall struct {
s *Service
enterpriseId string
userId string
deviceId string
installId string
opt_ map[string]interface{}
ctx_ context.Context
}
// Get: Retrieves details of an installation of an app on a device.
func (r *InstallsService) Get(enterpriseId string, userId string, deviceId string, installId string) *InstallsGetCall {
c := &InstallsGetCall{s: r.s, opt_: make(map[string]interface{})}
c.enterpriseId = enterpriseId
c.userId = userId
c.deviceId = deviceId
c.installId = installId
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *InstallsGetCall) Fields(s ...googleapi.Field) *InstallsGetCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *InstallsGetCall) IfNoneMatch(entityTag string) *InstallsGetCall {
c.opt_["ifNoneMatch"] = entityTag
return c
}
// Context sets the context to be used in this call's Do method.
// Any pending HTTP request will be aborted if the provided context
// is canceled.
func (c *InstallsGetCall) Context(ctx context.Context) *InstallsGetCall {
c.ctx_ = ctx
return c
}
func (c *InstallsGetCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", alt)
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
googleapi.Expand(req.URL, map[string]string{
"enterpriseId": c.enterpriseId,
"userId": c.userId,
"deviceId": c.deviceId,
"installId": c.installId,
})
req.Header.Set("User-Agent", c.s.userAgent())
if v, ok := c.opt_["ifNoneMatch"]; ok {
req.Header.Set("If-None-Match", fmt.Sprintf("%v", v))
}
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "androidenterprise.installs.get" call.
// Exactly one of *Install or error will be non-nil. Any non-2xx status
// code is an error. Response headers are in either
// *Install.ServerResponse.Header or (if a response was returned at all)
// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
// check whether the returned error was because http.StatusNotModified
// was returned.
func (c *InstallsGetCall) Do() (*Install, error) {
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &Install{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Retrieves details of an installation of an app on a device.",
// "httpMethod": "GET",
// "id": "androidenterprise.installs.get",
// "parameterOrder": [
// "enterpriseId",
// "userId",
// "deviceId",
// "installId"
// ],
// "parameters": {
// "deviceId": {
// "description": "The Android ID of the device.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "enterpriseId": {
// "description": "The ID of the enterprise.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "installId": {
// "description": "The ID of the product represented by the install, e.g. \"app:com.google.android.gm\".",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "userId": {
// "description": "The ID of the user.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}",
// "response": {
// "$ref": "Install"
// },
// "scopes": [
// "https://www.googleapis.com/auth/androidenterprise"
// ]
// }
}
// method id "androidenterprise.installs.list":
type InstallsListCall struct {
s *Service
enterpriseId string
userId string
deviceId string
opt_ map[string]interface{}
ctx_ context.Context
}
// List: Retrieves the details of all apps installed on the specified
// device.
func (r *InstallsService) List(enterpriseId string, userId string, deviceId string) *InstallsListCall {
c := &InstallsListCall{s: r.s, opt_: make(map[string]interface{})}
c.enterpriseId = enterpriseId
c.userId = userId
c.deviceId = deviceId
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *InstallsListCall) Fields(s ...googleapi.Field) *InstallsListCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *InstallsListCall) IfNoneMatch(entityTag string) *InstallsListCall {
c.opt_["ifNoneMatch"] = entityTag
return c
}
// Context sets the context to be used in this call's Do method.
// Any pending HTTP request will be aborted if the provided context
// is canceled.
func (c *InstallsListCall) Context(ctx context.Context) *InstallsListCall {
c.ctx_ = ctx
return c
}
func (c *InstallsListCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", alt)
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
googleapi.Expand(req.URL, map[string]string{
"enterpriseId": c.enterpriseId,
"userId": c.userId,
"deviceId": c.deviceId,
})
req.Header.Set("User-Agent", c.s.userAgent())
if v, ok := c.opt_["ifNoneMatch"]; ok {
req.Header.Set("If-None-Match", fmt.Sprintf("%v", v))
}
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "androidenterprise.installs.list" call.
// Exactly one of *InstallsListResponse or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *InstallsListResponse.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *InstallsListCall) Do() (*InstallsListResponse, error) {
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &InstallsListResponse{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Retrieves the details of all apps installed on the specified device.",
// "httpMethod": "GET",
// "id": "androidenterprise.installs.list",
// "parameterOrder": [
// "enterpriseId",
// "userId",
// "deviceId"
// ],
// "parameters": {
// "deviceId": {
// "description": "The Android ID of the device.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "enterpriseId": {
// "description": "The ID of the enterprise.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "userId": {
// "description": "The ID of the user.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs",
// "response": {
// "$ref": "InstallsListResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/androidenterprise"
// ]
// }
}
// method id "androidenterprise.installs.patch":
type InstallsPatchCall struct {
s *Service
enterpriseId string
userId string
deviceId string
installId string
install *Install
opt_ map[string]interface{}
ctx_ context.Context
}
// Patch: Requests to install the latest version of an app to a device.
// If the app is already installed then it is updated to the latest
// version if necessary. This method supports patch semantics.
func (r *InstallsService) Patch(enterpriseId string, userId string, deviceId string, installId string, install *Install) *InstallsPatchCall {
c := &InstallsPatchCall{s: r.s, opt_: make(map[string]interface{})}
c.enterpriseId = enterpriseId
c.userId = userId
c.deviceId = deviceId
c.installId = installId
c.install = install
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *InstallsPatchCall) Fields(s ...googleapi.Field) *InstallsPatchCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// Context sets the context to be used in this call's Do method.
// Any pending HTTP request will be aborted if the provided context
// is canceled.
func (c *InstallsPatchCall) Context(ctx context.Context) *InstallsPatchCall {
c.ctx_ = ctx
return c
}
func (c *InstallsPatchCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.install)
if err != nil {
return nil, err
}
ctype := "application/json"
params := make(url.Values)
params.Set("alt", alt)
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}")
urls += "?" + params.Encode()
req, _ := http.NewRequest("PATCH", urls, body)
googleapi.Expand(req.URL, map[string]string{
"enterpriseId": c.enterpriseId,
"userId": c.userId,
"deviceId": c.deviceId,
"installId": c.installId,
})
req.Header.Set("Content-Type", ctype)
req.Header.Set("User-Agent", c.s.userAgent())
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "androidenterprise.installs.patch" call.
// Exactly one of *Install or error will be non-nil. Any non-2xx status
// code is an error. Response headers are in either
// *Install.ServerResponse.Header or (if a response was returned at all)
// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
// check whether the returned error was because http.StatusNotModified
// was returned.
func (c *InstallsPatchCall) Do() (*Install, error) {
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &Install{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Requests to install the latest version of an app to a device. If the app is already installed then it is updated to the latest version if necessary. This method supports patch semantics.",
// "httpMethod": "PATCH",
// "id": "androidenterprise.installs.patch",
// "parameterOrder": [
// "enterpriseId",
// "userId",
// "deviceId",
// "installId"
// ],
// "parameters": {
// "deviceId": {
// "description": "The Android ID of the device.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "enterpriseId": {
// "description": "The ID of the enterprise.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "installId": {
// "description": "The ID of the product represented by the install, e.g. \"app:com.google.android.gm\".",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "userId": {
// "description": "The ID of the user.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}",
// "request": {
// "$ref": "Install"
// },
// "response": {
// "$ref": "Install"
// },
// "scopes": [
// "https://www.googleapis.com/auth/androidenterprise"
// ]
// }
}
// method id "androidenterprise.installs.update":
type InstallsUpdateCall struct {
s *Service
enterpriseId string
userId string
deviceId string
installId string
install *Install
opt_ map[string]interface{}
ctx_ context.Context
}
// Update: Requests to install the latest version of an app to a device.
// If the app is already installed then it is updated to the latest
// version if necessary.
func (r *InstallsService) Update(enterpriseId string, userId string, deviceId string, installId string, install *Install) *InstallsUpdateCall {
c := &InstallsUpdateCall{s: r.s, opt_: make(map[string]interface{})}
c.enterpriseId = enterpriseId
c.userId = userId
c.deviceId = deviceId
c.installId = installId
c.install = install
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *InstallsUpdateCall) Fields(s ...googleapi.Field) *InstallsUpdateCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// Context sets the context to be used in this call's Do method.
// Any pending HTTP request will be aborted if the provided context
// is canceled.
func (c *InstallsUpdateCall) Context(ctx context.Context) *InstallsUpdateCall {
c.ctx_ = ctx
return c
}
func (c *InstallsUpdateCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.install)
if err != nil {
return nil, err
}
ctype := "application/json"
params := make(url.Values)
params.Set("alt", alt)
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}")
urls += "?" + params.Encode()
req, _ := http.NewRequest("PUT", urls, body)
googleapi.Expand(req.URL, map[string]string{
"enterpriseId": c.enterpriseId,
"userId": c.userId,
"deviceId": c.deviceId,
"installId": c.installId,
})
req.Header.Set("Content-Type", ctype)
req.Header.Set("User-Agent", c.s.userAgent())
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "androidenterprise.installs.update" call.
// Exactly one of *Install or error will be non-nil. Any non-2xx status
// code is an error. Response headers are in either
// *Install.ServerResponse.Header or (if a response was returned at all)
// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
// check whether the returned error was because http.StatusNotModified
// was returned.
func (c *InstallsUpdateCall) Do() (*Install, error) {
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &Install{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Requests to install the latest version of an app to a device. If the app is already installed then it is updated to the latest version if necessary.",
// "httpMethod": "PUT",
// "id": "androidenterprise.installs.update",
// "parameterOrder": [
// "enterpriseId",
// "userId",
// "deviceId",
// "installId"
// ],
// "parameters": {
// "deviceId": {
// "description": "The Android ID of the device.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "enterpriseId": {
// "description": "The ID of the enterprise.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "installId": {
// "description": "The ID of the product represented by the install, e.g. \"app:com.google.android.gm\".",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "userId": {
// "description": "The ID of the user.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}",
// "request": {
// "$ref": "Install"
// },
// "response": {
// "$ref": "Install"
// },
// "scopes": [
// "https://www.googleapis.com/auth/androidenterprise"
// ]
// }
}
// method id "androidenterprise.permissions.get":
type PermissionsGetCall struct {
s *Service
permissionId string
opt_ map[string]interface{}
ctx_ context.Context
}
// Get: Retrieves details of an Android app permission for display to an
// enterprise admin.
func (r *PermissionsService) Get(permissionId string) *PermissionsGetCall {
c := &PermissionsGetCall{s: r.s, opt_: make(map[string]interface{})}
c.permissionId = permissionId
return c
}
// Language sets the optional parameter "language": The BCP47 tag for
// the user's preferred language (e.g. "en-US", "de")
func (c *PermissionsGetCall) Language(language string) *PermissionsGetCall {
c.opt_["language"] = language
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *PermissionsGetCall) Fields(s ...googleapi.Field) *PermissionsGetCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *PermissionsGetCall) IfNoneMatch(entityTag string) *PermissionsGetCall {
c.opt_["ifNoneMatch"] = entityTag
return c
}
// Context sets the context to be used in this call's Do method.
// Any pending HTTP request will be aborted if the provided context
// is canceled.
func (c *PermissionsGetCall) Context(ctx context.Context) *PermissionsGetCall {
c.ctx_ = ctx
return c
}
func (c *PermissionsGetCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", alt)
if v, ok := c.opt_["language"]; ok {
params.Set("language", fmt.Sprintf("%v", v))
}
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "permissions/{permissionId}")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
googleapi.Expand(req.URL, map[string]string{
"permissionId": c.permissionId,
})
req.Header.Set("User-Agent", c.s.userAgent())
if v, ok := c.opt_["ifNoneMatch"]; ok {
req.Header.Set("If-None-Match", fmt.Sprintf("%v", v))
}
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "androidenterprise.permissions.get" call.
// Exactly one of *Permission or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *Permission.ServerResponse.Header or (if a response was returned at
// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
// to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *PermissionsGetCall) Do() (*Permission, error) {
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &Permission{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Retrieves details of an Android app permission for display to an enterprise admin.",
// "httpMethod": "GET",
// "id": "androidenterprise.permissions.get",
// "parameterOrder": [
// "permissionId"
// ],
// "parameters": {
// "language": {
// "description": "The BCP47 tag for the user's preferred language (e.g. \"en-US\", \"de\")",
// "location": "query",
// "type": "string"
// },
// "permissionId": {
// "description": "The ID of the permission.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "permissions/{permissionId}",
// "response": {
// "$ref": "Permission"
// },
// "scopes": [
// "https://www.googleapis.com/auth/androidenterprise"
// ]
// }
}
// method id "androidenterprise.products.approve":
type ProductsApproveCall struct {
s *Service
enterpriseId string
productId string
productsapproverequest *ProductsApproveRequest
opt_ map[string]interface{}
ctx_ context.Context
}
// Approve: Approves the specified product (and the relevant app
// permissions, if any).
func (r *ProductsService) Approve(enterpriseId string, productId string, productsapproverequest *ProductsApproveRequest) *ProductsApproveCall {
c := &ProductsApproveCall{s: r.s, opt_: make(map[string]interface{})}
c.enterpriseId = enterpriseId
c.productId = productId
c.productsapproverequest = productsapproverequest
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *ProductsApproveCall) Fields(s ...googleapi.Field) *ProductsApproveCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// Context sets the context to be used in this call's Do method.
// Any pending HTTP request will be aborted if the provided context
// is canceled.
func (c *ProductsApproveCall) Context(ctx context.Context) *ProductsApproveCall {
c.ctx_ = ctx
return c
}
func (c *ProductsApproveCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.productsapproverequest)
if err != nil {
return nil, err
}
ctype := "application/json"
params := make(url.Values)
params.Set("alt", alt)
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/products/{productId}/approve")
urls += "?" + params.Encode()
req, _ := http.NewRequest("POST", urls, body)
googleapi.Expand(req.URL, map[string]string{
"enterpriseId": c.enterpriseId,
"productId": c.productId,
})
req.Header.Set("Content-Type", ctype)
req.Header.Set("User-Agent", c.s.userAgent())
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "androidenterprise.products.approve" call.
func (c *ProductsApproveCall) Do() error {
res, err := c.doRequest("json")
if err != nil {
return err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return err
}
return nil
// {
// "description": "Approves the specified product (and the relevant app permissions, if any).",
// "httpMethod": "POST",
// "id": "androidenterprise.products.approve",
// "parameterOrder": [
// "enterpriseId",
// "productId"
// ],
// "parameters": {
// "enterpriseId": {
// "description": "The ID of the enterprise.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "productId": {
// "description": "The ID of the product.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "enterprises/{enterpriseId}/products/{productId}/approve",
// "request": {
// "$ref": "ProductsApproveRequest"
// },
// "scopes": [
// "https://www.googleapis.com/auth/androidenterprise"
// ]
// }
}
// method id "androidenterprise.products.generateApprovalUrl":
type ProductsGenerateApprovalUrlCall struct {
s *Service
enterpriseId string
productId string
opt_ map[string]interface{}
ctx_ context.Context
}
// GenerateApprovalUrl: Generates a URL that can be rendered in an
// iframe to display the permissions (if any) of a product. An
// enterprise admin must view these permissions and accept them on
// behalf of their organization in order to approve that
// product.
//
// Admins should accept the displayed permissions by interacting with a
// separate UI element in the EMM console, which in turn should trigger
// the use of this URL as the approvalUrlInfo.approvalUrl property in a
// Products.approve call to approve the product. This URL can only be
// used to display permissions for up to 1 day.
func (r *ProductsService) GenerateApprovalUrl(enterpriseId string, productId string) *ProductsGenerateApprovalUrlCall {
c := &ProductsGenerateApprovalUrlCall{s: r.s, opt_: make(map[string]interface{})}
c.enterpriseId = enterpriseId
c.productId = productId
return c
}
// LanguageCode sets the optional parameter "languageCode": The BCP 47
// language code used for permission names and descriptions in the
// returned iframe, for instance "en-US".
func (c *ProductsGenerateApprovalUrlCall) LanguageCode(languageCode string) *ProductsGenerateApprovalUrlCall {
c.opt_["languageCode"] = languageCode
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *ProductsGenerateApprovalUrlCall) Fields(s ...googleapi.Field) *ProductsGenerateApprovalUrlCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// Context sets the context to be used in this call's Do method.
// Any pending HTTP request will be aborted if the provided context
// is canceled.
func (c *ProductsGenerateApprovalUrlCall) Context(ctx context.Context) *ProductsGenerateApprovalUrlCall {
c.ctx_ = ctx
return c
}
func (c *ProductsGenerateApprovalUrlCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", alt)
if v, ok := c.opt_["languageCode"]; ok {
params.Set("languageCode", fmt.Sprintf("%v", v))
}
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/products/{productId}/generateApprovalUrl")
urls += "?" + params.Encode()
req, _ := http.NewRequest("POST", urls, body)
googleapi.Expand(req.URL, map[string]string{
"enterpriseId": c.enterpriseId,
"productId": c.productId,
})
req.Header.Set("User-Agent", c.s.userAgent())
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "androidenterprise.products.generateApprovalUrl" call.
// Exactly one of *ProductsGenerateApprovalUrlResponse or error will be
// non-nil. Any non-2xx status code is an error. Response headers are in
// either *ProductsGenerateApprovalUrlResponse.ServerResponse.Header or
// (if a response was returned at all) in
// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
// whether the returned error was because http.StatusNotModified was
// returned.
func (c *ProductsGenerateApprovalUrlCall) Do() (*ProductsGenerateApprovalUrlResponse, error) {
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &ProductsGenerateApprovalUrlResponse{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Generates a URL that can be rendered in an iframe to display the permissions (if any) of a product. An enterprise admin must view these permissions and accept them on behalf of their organization in order to approve that product.\n\nAdmins should accept the displayed permissions by interacting with a separate UI element in the EMM console, which in turn should trigger the use of this URL as the approvalUrlInfo.approvalUrl property in a Products.approve call to approve the product. This URL can only be used to display permissions for up to 1 day.",
// "httpMethod": "POST",
// "id": "androidenterprise.products.generateApprovalUrl",
// "parameterOrder": [
// "enterpriseId",
// "productId"
// ],
// "parameters": {
// "enterpriseId": {
// "description": "The ID of the enterprise.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "languageCode": {
// "description": "The BCP 47 language code used for permission names and descriptions in the returned iframe, for instance \"en-US\".",
// "location": "query",
// "type": "string"
// },
// "productId": {
// "description": "The ID of the product.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "enterprises/{enterpriseId}/products/{productId}/generateApprovalUrl",
// "response": {
// "$ref": "ProductsGenerateApprovalUrlResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/androidenterprise"
// ]
// }
}
// method id "androidenterprise.products.get":
type ProductsGetCall struct {
s *Service
enterpriseId string
productId string
opt_ map[string]interface{}
ctx_ context.Context
}
// Get: Retrieves details of a product for display to an enterprise
// admin.
func (r *ProductsService) Get(enterpriseId string, productId string) *ProductsGetCall {
c := &ProductsGetCall{s: r.s, opt_: make(map[string]interface{})}
c.enterpriseId = enterpriseId
c.productId = productId
return c
}
// Language sets the optional parameter "language": The BCP47 tag for
// the user's preferred language (e.g. "en-US", "de").
func (c *ProductsGetCall) Language(language string) *ProductsGetCall {
c.opt_["language"] = language
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *ProductsGetCall) Fields(s ...googleapi.Field) *ProductsGetCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *ProductsGetCall) IfNoneMatch(entityTag string) *ProductsGetCall {
c.opt_["ifNoneMatch"] = entityTag
return c
}
// Context sets the context to be used in this call's Do method.
// Any pending HTTP request will be aborted if the provided context
// is canceled.
func (c *ProductsGetCall) Context(ctx context.Context) *ProductsGetCall {
c.ctx_ = ctx
return c
}
func (c *ProductsGetCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", alt)
if v, ok := c.opt_["language"]; ok {
params.Set("language", fmt.Sprintf("%v", v))
}
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/products/{productId}")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
googleapi.Expand(req.URL, map[string]string{
"enterpriseId": c.enterpriseId,
"productId": c.productId,
})
req.Header.Set("User-Agent", c.s.userAgent())
if v, ok := c.opt_["ifNoneMatch"]; ok {
req.Header.Set("If-None-Match", fmt.Sprintf("%v", v))
}
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "androidenterprise.products.get" call.
// Exactly one of *Product or error will be non-nil. Any non-2xx status
// code is an error. Response headers are in either
// *Product.ServerResponse.Header or (if a response was returned at all)
// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
// check whether the returned error was because http.StatusNotModified
// was returned.
func (c *ProductsGetCall) Do() (*Product, error) {
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &Product{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Retrieves details of a product for display to an enterprise admin.",
// "httpMethod": "GET",
// "id": "androidenterprise.products.get",
// "parameterOrder": [
// "enterpriseId",
// "productId"
// ],
// "parameters": {
// "enterpriseId": {
// "description": "The ID of the enterprise.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "language": {
// "description": "The BCP47 tag for the user's preferred language (e.g. \"en-US\", \"de\").",
// "location": "query",
// "type": "string"
// },
// "productId": {
// "description": "The ID of the product, e.g. \"app:com.google.android.gm\".",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "enterprises/{enterpriseId}/products/{productId}",
// "response": {
// "$ref": "Product"
// },
// "scopes": [
// "https://www.googleapis.com/auth/androidenterprise"
// ]
// }
}
// method id "androidenterprise.products.getAppRestrictionsSchema":
type ProductsGetAppRestrictionsSchemaCall struct {
s *Service
enterpriseId string
productId string
opt_ map[string]interface{}
ctx_ context.Context
}
// GetAppRestrictionsSchema: Retrieves the schema defining app
// restrictions configurable for this product. All products have a
// schema, but this may be empty if no app restrictions are defined.
func (r *ProductsService) GetAppRestrictionsSchema(enterpriseId string, productId string) *ProductsGetAppRestrictionsSchemaCall {
c := &ProductsGetAppRestrictionsSchemaCall{s: r.s, opt_: make(map[string]interface{})}
c.enterpriseId = enterpriseId
c.productId = productId
return c
}
// Language sets the optional parameter "language": The BCP47 tag for
// the user's preferred language (e.g. "en-US", "de").
func (c *ProductsGetAppRestrictionsSchemaCall) Language(language string) *ProductsGetAppRestrictionsSchemaCall {
c.opt_["language"] = language
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *ProductsGetAppRestrictionsSchemaCall) Fields(s ...googleapi.Field) *ProductsGetAppRestrictionsSchemaCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *ProductsGetAppRestrictionsSchemaCall) IfNoneMatch(entityTag string) *ProductsGetAppRestrictionsSchemaCall {
c.opt_["ifNoneMatch"] = entityTag
return c
}
// Context sets the context to be used in this call's Do method.
// Any pending HTTP request will be aborted if the provided context
// is canceled.
func (c *ProductsGetAppRestrictionsSchemaCall) Context(ctx context.Context) *ProductsGetAppRestrictionsSchemaCall {
c.ctx_ = ctx
return c
}
func (c *ProductsGetAppRestrictionsSchemaCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", alt)
if v, ok := c.opt_["language"]; ok {
params.Set("language", fmt.Sprintf("%v", v))
}
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/products/{productId}/appRestrictionsSchema")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
googleapi.Expand(req.URL, map[string]string{
"enterpriseId": c.enterpriseId,
"productId": c.productId,
})
req.Header.Set("User-Agent", c.s.userAgent())
if v, ok := c.opt_["ifNoneMatch"]; ok {
req.Header.Set("If-None-Match", fmt.Sprintf("%v", v))
}
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "androidenterprise.products.getAppRestrictionsSchema" call.
// Exactly one of *AppRestrictionsSchema or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *AppRestrictionsSchema.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *ProductsGetAppRestrictionsSchemaCall) Do() (*AppRestrictionsSchema, error) {
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &AppRestrictionsSchema{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Retrieves the schema defining app restrictions configurable for this product. All products have a schema, but this may be empty if no app restrictions are defined.",
// "httpMethod": "GET",
// "id": "androidenterprise.products.getAppRestrictionsSchema",
// "parameterOrder": [
// "enterpriseId",
// "productId"
// ],
// "parameters": {
// "enterpriseId": {
// "description": "The ID of the enterprise.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "language": {
// "description": "The BCP47 tag for the user's preferred language (e.g. \"en-US\", \"de\").",
// "location": "query",
// "type": "string"
// },
// "productId": {
// "description": "The ID of the product.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "enterprises/{enterpriseId}/products/{productId}/appRestrictionsSchema",
// "response": {
// "$ref": "AppRestrictionsSchema"
// },
// "scopes": [
// "https://www.googleapis.com/auth/androidenterprise"
// ]
// }
}
// method id "androidenterprise.products.getPermissions":
type ProductsGetPermissionsCall struct {
s *Service
enterpriseId string
productId string
opt_ map[string]interface{}
ctx_ context.Context
}
// GetPermissions: Retrieves the Android app permissions required by
// this app.
func (r *ProductsService) GetPermissions(enterpriseId string, productId string) *ProductsGetPermissionsCall {
c := &ProductsGetPermissionsCall{s: r.s, opt_: make(map[string]interface{})}
c.enterpriseId = enterpriseId
c.productId = productId
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *ProductsGetPermissionsCall) Fields(s ...googleapi.Field) *ProductsGetPermissionsCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *ProductsGetPermissionsCall) IfNoneMatch(entityTag string) *ProductsGetPermissionsCall {
c.opt_["ifNoneMatch"] = entityTag
return c
}
// Context sets the context to be used in this call's Do method.
// Any pending HTTP request will be aborted if the provided context
// is canceled.
func (c *ProductsGetPermissionsCall) Context(ctx context.Context) *ProductsGetPermissionsCall {
c.ctx_ = ctx
return c
}
func (c *ProductsGetPermissionsCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", alt)
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/products/{productId}/permissions")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
googleapi.Expand(req.URL, map[string]string{
"enterpriseId": c.enterpriseId,
"productId": c.productId,
})
req.Header.Set("User-Agent", c.s.userAgent())
if v, ok := c.opt_["ifNoneMatch"]; ok {
req.Header.Set("If-None-Match", fmt.Sprintf("%v", v))
}
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "androidenterprise.products.getPermissions" call.
// Exactly one of *ProductPermissions or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *ProductPermissions.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *ProductsGetPermissionsCall) Do() (*ProductPermissions, error) {
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &ProductPermissions{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Retrieves the Android app permissions required by this app.",
// "httpMethod": "GET",
// "id": "androidenterprise.products.getPermissions",
// "parameterOrder": [
// "enterpriseId",
// "productId"
// ],
// "parameters": {
// "enterpriseId": {
// "description": "The ID of the enterprise.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "productId": {
// "description": "The ID of the product.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "enterprises/{enterpriseId}/products/{productId}/permissions",
// "response": {
// "$ref": "ProductPermissions"
// },
// "scopes": [
// "https://www.googleapis.com/auth/androidenterprise"
// ]
// }
}
// method id "androidenterprise.products.updatePermissions":
type ProductsUpdatePermissionsCall struct {
s *Service
enterpriseId string
productId string
productpermissions *ProductPermissions
opt_ map[string]interface{}
ctx_ context.Context
}
// UpdatePermissions: Updates the set of Android app permissions for
// this app that have been accepted by the enterprise.
func (r *ProductsService) UpdatePermissions(enterpriseId string, productId string, productpermissions *ProductPermissions) *ProductsUpdatePermissionsCall {
c := &ProductsUpdatePermissionsCall{s: r.s, opt_: make(map[string]interface{})}
c.enterpriseId = enterpriseId
c.productId = productId
c.productpermissions = productpermissions
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *ProductsUpdatePermissionsCall) Fields(s ...googleapi.Field) *ProductsUpdatePermissionsCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// Context sets the context to be used in this call's Do method.
// Any pending HTTP request will be aborted if the provided context
// is canceled.
func (c *ProductsUpdatePermissionsCall) Context(ctx context.Context) *ProductsUpdatePermissionsCall {
c.ctx_ = ctx
return c
}
func (c *ProductsUpdatePermissionsCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.productpermissions)
if err != nil {
return nil, err
}
ctype := "application/json"
params := make(url.Values)
params.Set("alt", alt)
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/products/{productId}/permissions")
urls += "?" + params.Encode()
req, _ := http.NewRequest("PUT", urls, body)
googleapi.Expand(req.URL, map[string]string{
"enterpriseId": c.enterpriseId,
"productId": c.productId,
})
req.Header.Set("Content-Type", ctype)
req.Header.Set("User-Agent", c.s.userAgent())
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "androidenterprise.products.updatePermissions" call.
// Exactly one of *ProductPermissions or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *ProductPermissions.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *ProductsUpdatePermissionsCall) Do() (*ProductPermissions, error) {
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &ProductPermissions{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Updates the set of Android app permissions for this app that have been accepted by the enterprise.",
// "httpMethod": "PUT",
// "id": "androidenterprise.products.updatePermissions",
// "parameterOrder": [
// "enterpriseId",
// "productId"
// ],
// "parameters": {
// "enterpriseId": {
// "description": "The ID of the enterprise.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "productId": {
// "description": "The ID of the product.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "enterprises/{enterpriseId}/products/{productId}/permissions",
// "request": {
// "$ref": "ProductPermissions"
// },
// "response": {
// "$ref": "ProductPermissions"
// },
// "scopes": [
// "https://www.googleapis.com/auth/androidenterprise"
// ]
// }
}
// method id "androidenterprise.users.generateToken":
type UsersGenerateTokenCall struct {
s *Service
enterpriseId string
userId string
opt_ map[string]interface{}
ctx_ context.Context
}
// GenerateToken: Generates a token (activation code) to allow this user
// to configure their work account in the Android Setup Wizard. Revokes
// any previously generated token.
func (r *UsersService) GenerateToken(enterpriseId string, userId string) *UsersGenerateTokenCall {
c := &UsersGenerateTokenCall{s: r.s, opt_: make(map[string]interface{})}
c.enterpriseId = enterpriseId
c.userId = userId
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *UsersGenerateTokenCall) Fields(s ...googleapi.Field) *UsersGenerateTokenCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// Context sets the context to be used in this call's Do method.
// Any pending HTTP request will be aborted if the provided context
// is canceled.
func (c *UsersGenerateTokenCall) Context(ctx context.Context) *UsersGenerateTokenCall {
c.ctx_ = ctx
return c
}
func (c *UsersGenerateTokenCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", alt)
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/token")
urls += "?" + params.Encode()
req, _ := http.NewRequest("POST", urls, body)
googleapi.Expand(req.URL, map[string]string{
"enterpriseId": c.enterpriseId,
"userId": c.userId,
})
req.Header.Set("User-Agent", c.s.userAgent())
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "androidenterprise.users.generateToken" call.
// Exactly one of *UserToken or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *UserToken.ServerResponse.Header or (if a response was returned at
// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
// to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *UsersGenerateTokenCall) Do() (*UserToken, error) {
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &UserToken{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Generates a token (activation code) to allow this user to configure their work account in the Android Setup Wizard. Revokes any previously generated token.",
// "httpMethod": "POST",
// "id": "androidenterprise.users.generateToken",
// "parameterOrder": [
// "enterpriseId",
// "userId"
// ],
// "parameters": {
// "enterpriseId": {
// "description": "The ID of the enterprise.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "userId": {
// "description": "The ID of the user.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "enterprises/{enterpriseId}/users/{userId}/token",
// "response": {
// "$ref": "UserToken"
// },
// "scopes": [
// "https://www.googleapis.com/auth/androidenterprise"
// ]
// }
}
// method id "androidenterprise.users.get":
type UsersGetCall struct {
s *Service
enterpriseId string
userId string
opt_ map[string]interface{}
ctx_ context.Context
}
// Get: Retrieves a user's details.
func (r *UsersService) Get(enterpriseId string, userId string) *UsersGetCall {
c := &UsersGetCall{s: r.s, opt_: make(map[string]interface{})}
c.enterpriseId = enterpriseId
c.userId = userId
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *UsersGetCall) Fields(s ...googleapi.Field) *UsersGetCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *UsersGetCall) IfNoneMatch(entityTag string) *UsersGetCall {
c.opt_["ifNoneMatch"] = entityTag
return c
}
// Context sets the context to be used in this call's Do method.
// Any pending HTTP request will be aborted if the provided context
// is canceled.
func (c *UsersGetCall) Context(ctx context.Context) *UsersGetCall {
c.ctx_ = ctx
return c
}
func (c *UsersGetCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", alt)
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
googleapi.Expand(req.URL, map[string]string{
"enterpriseId": c.enterpriseId,
"userId": c.userId,
})
req.Header.Set("User-Agent", c.s.userAgent())
if v, ok := c.opt_["ifNoneMatch"]; ok {
req.Header.Set("If-None-Match", fmt.Sprintf("%v", v))
}
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "androidenterprise.users.get" call.
// Exactly one of *User or error will be non-nil. Any non-2xx status
// code is an error. Response headers are in either
// *User.ServerResponse.Header or (if a response was returned at all) in
// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
// whether the returned error was because http.StatusNotModified was
// returned.
func (c *UsersGetCall) Do() (*User, error) {
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &User{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Retrieves a user's details.",
// "httpMethod": "GET",
// "id": "androidenterprise.users.get",
// "parameterOrder": [
// "enterpriseId",
// "userId"
// ],
// "parameters": {
// "enterpriseId": {
// "description": "The ID of the enterprise.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "userId": {
// "description": "The ID of the user.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "enterprises/{enterpriseId}/users/{userId}",
// "response": {
// "$ref": "User"
// },
// "scopes": [
// "https://www.googleapis.com/auth/androidenterprise"
// ]
// }
}
// method id "androidenterprise.users.getAvailableProductSet":
type UsersGetAvailableProductSetCall struct {
s *Service
enterpriseId string
userId string
opt_ map[string]interface{}
ctx_ context.Context
}
// GetAvailableProductSet: Retrieves the set of products a user is
// entitled to access.
func (r *UsersService) GetAvailableProductSet(enterpriseId string, userId string) *UsersGetAvailableProductSetCall {
c := &UsersGetAvailableProductSetCall{s: r.s, opt_: make(map[string]interface{})}
c.enterpriseId = enterpriseId
c.userId = userId
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *UsersGetAvailableProductSetCall) Fields(s ...googleapi.Field) *UsersGetAvailableProductSetCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *UsersGetAvailableProductSetCall) IfNoneMatch(entityTag string) *UsersGetAvailableProductSetCall {
c.opt_["ifNoneMatch"] = entityTag
return c
}
// Context sets the context to be used in this call's Do method.
// Any pending HTTP request will be aborted if the provided context
// is canceled.
func (c *UsersGetAvailableProductSetCall) Context(ctx context.Context) *UsersGetAvailableProductSetCall {
c.ctx_ = ctx
return c
}
func (c *UsersGetAvailableProductSetCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", alt)
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/availableProductSet")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
googleapi.Expand(req.URL, map[string]string{
"enterpriseId": c.enterpriseId,
"userId": c.userId,
})
req.Header.Set("User-Agent", c.s.userAgent())
if v, ok := c.opt_["ifNoneMatch"]; ok {
req.Header.Set("If-None-Match", fmt.Sprintf("%v", v))
}
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "androidenterprise.users.getAvailableProductSet" call.
// Exactly one of *ProductSet or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *ProductSet.ServerResponse.Header or (if a response was returned at
// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
// to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *UsersGetAvailableProductSetCall) Do() (*ProductSet, error) {
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &ProductSet{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Retrieves the set of products a user is entitled to access.",
// "httpMethod": "GET",
// "id": "androidenterprise.users.getAvailableProductSet",
// "parameterOrder": [
// "enterpriseId",
// "userId"
// ],
// "parameters": {
// "enterpriseId": {
// "description": "The ID of the enterprise.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "userId": {
// "description": "The ID of the user.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "enterprises/{enterpriseId}/users/{userId}/availableProductSet",
// "response": {
// "$ref": "ProductSet"
// },
// "scopes": [
// "https://www.googleapis.com/auth/androidenterprise"
// ]
// }
}
// method id "androidenterprise.users.list":
type UsersListCall struct {
s *Service
enterpriseId string
email string
opt_ map[string]interface{}
ctx_ context.Context
}
// List: Looks up a user by email address.
func (r *UsersService) List(enterpriseId string, email string) *UsersListCall {
c := &UsersListCall{s: r.s, opt_: make(map[string]interface{})}
c.enterpriseId = enterpriseId
c.email = email
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *UsersListCall) Fields(s ...googleapi.Field) *UsersListCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *UsersListCall) IfNoneMatch(entityTag string) *UsersListCall {
c.opt_["ifNoneMatch"] = entityTag
return c
}
// Context sets the context to be used in this call's Do method.
// Any pending HTTP request will be aborted if the provided context
// is canceled.
func (c *UsersListCall) Context(ctx context.Context) *UsersListCall {
c.ctx_ = ctx
return c
}
func (c *UsersListCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", alt)
params.Set("email", fmt.Sprintf("%v", c.email))
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
googleapi.Expand(req.URL, map[string]string{
"enterpriseId": c.enterpriseId,
})
req.Header.Set("User-Agent", c.s.userAgent())
if v, ok := c.opt_["ifNoneMatch"]; ok {
req.Header.Set("If-None-Match", fmt.Sprintf("%v", v))
}
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "androidenterprise.users.list" call.
// Exactly one of *UsersListResponse or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *UsersListResponse.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *UsersListCall) Do() (*UsersListResponse, error) {
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &UsersListResponse{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Looks up a user by email address.",
// "httpMethod": "GET",
// "id": "androidenterprise.users.list",
// "parameterOrder": [
// "enterpriseId",
// "email"
// ],
// "parameters": {
// "email": {
// "description": "The exact primary email address of the user to look up.",
// "location": "query",
// "required": true,
// "type": "string"
// },
// "enterpriseId": {
// "description": "The ID of the enterprise.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "enterprises/{enterpriseId}/users",
// "response": {
// "$ref": "UsersListResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/androidenterprise"
// ]
// }
}
// method id "androidenterprise.users.revokeToken":
type UsersRevokeTokenCall struct {
s *Service
enterpriseId string
userId string
opt_ map[string]interface{}
ctx_ context.Context
}
// RevokeToken: Revokes a previously generated token (activation code)
// for the user.
func (r *UsersService) RevokeToken(enterpriseId string, userId string) *UsersRevokeTokenCall {
c := &UsersRevokeTokenCall{s: r.s, opt_: make(map[string]interface{})}
c.enterpriseId = enterpriseId
c.userId = userId
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *UsersRevokeTokenCall) Fields(s ...googleapi.Field) *UsersRevokeTokenCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// Context sets the context to be used in this call's Do method.
// Any pending HTTP request will be aborted if the provided context
// is canceled.
func (c *UsersRevokeTokenCall) Context(ctx context.Context) *UsersRevokeTokenCall {
c.ctx_ = ctx
return c
}
func (c *UsersRevokeTokenCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", alt)
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/token")
urls += "?" + params.Encode()
req, _ := http.NewRequest("DELETE", urls, body)
googleapi.Expand(req.URL, map[string]string{
"enterpriseId": c.enterpriseId,
"userId": c.userId,
})
req.Header.Set("User-Agent", c.s.userAgent())
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "androidenterprise.users.revokeToken" call.
func (c *UsersRevokeTokenCall) Do() error {
res, err := c.doRequest("json")
if err != nil {
return err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return err
}
return nil
// {
// "description": "Revokes a previously generated token (activation code) for the user.",
// "httpMethod": "DELETE",
// "id": "androidenterprise.users.revokeToken",
// "parameterOrder": [
// "enterpriseId",
// "userId"
// ],
// "parameters": {
// "enterpriseId": {
// "description": "The ID of the enterprise.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "userId": {
// "description": "The ID of the user.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "enterprises/{enterpriseId}/users/{userId}/token",
// "scopes": [
// "https://www.googleapis.com/auth/androidenterprise"
// ]
// }
}
// method id "androidenterprise.users.setAvailableProductSet":
type UsersSetAvailableProductSetCall struct {
s *Service
enterpriseId string
userId string
productset *ProductSet
opt_ map[string]interface{}
ctx_ context.Context
}
// SetAvailableProductSet: Modifies the set of products a user is
// entitled to access.
func (r *UsersService) SetAvailableProductSet(enterpriseId string, userId string, productset *ProductSet) *UsersSetAvailableProductSetCall {
c := &UsersSetAvailableProductSetCall{s: r.s, opt_: make(map[string]interface{})}
c.enterpriseId = enterpriseId
c.userId = userId
c.productset = productset
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *UsersSetAvailableProductSetCall) Fields(s ...googleapi.Field) *UsersSetAvailableProductSetCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// Context sets the context to be used in this call's Do method.
// Any pending HTTP request will be aborted if the provided context
// is canceled.
func (c *UsersSetAvailableProductSetCall) Context(ctx context.Context) *UsersSetAvailableProductSetCall {
c.ctx_ = ctx
return c
}
func (c *UsersSetAvailableProductSetCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.productset)
if err != nil {
return nil, err
}
ctype := "application/json"
params := make(url.Values)
params.Set("alt", alt)
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/availableProductSet")
urls += "?" + params.Encode()
req, _ := http.NewRequest("PUT", urls, body)
googleapi.Expand(req.URL, map[string]string{
"enterpriseId": c.enterpriseId,
"userId": c.userId,
})
req.Header.Set("Content-Type", ctype)
req.Header.Set("User-Agent", c.s.userAgent())
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "androidenterprise.users.setAvailableProductSet" call.
// Exactly one of *ProductSet or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *ProductSet.ServerResponse.Header or (if a response was returned at
// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
// to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *UsersSetAvailableProductSetCall) Do() (*ProductSet, error) {
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &ProductSet{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Modifies the set of products a user is entitled to access.",
// "httpMethod": "PUT",
// "id": "androidenterprise.users.setAvailableProductSet",
// "parameterOrder": [
// "enterpriseId",
// "userId"
// ],
// "parameters": {
// "enterpriseId": {
// "description": "The ID of the enterprise.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "userId": {
// "description": "The ID of the user.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "enterprises/{enterpriseId}/users/{userId}/availableProductSet",
// "request": {
// "$ref": "ProductSet"
// },
// "response": {
// "$ref": "ProductSet"
// },
// "scopes": [
// "https://www.googleapis.com/auth/androidenterprise"
// ]
// }
}
|
{
"content_hash": "57162e5e338303f8599b3d632dc978f8",
"timestamp": "",
"source": "github",
"line_count": 7936,
"max_line_length": 575,
"avg_line_length": 33.091859879032256,
"alnum_prop": 0.6836000715871402,
"repo_name": "upworthy/oauth2-proxy-buildpack",
"id": "78cea11b3a6dcc013d131af2dc3aa23417754f4a",
"size": "262913",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "vendor/src/google.golang.org/api/androidenterprise/v1/androidenterprise-gen.go",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Go",
"bytes": "126320"
},
{
"name": "Shell",
"bytes": "5164"
}
],
"symlink_target": ""
}
|
/*
* Qc API
*
* Qc API
*
* API version: 3.0.0
* Contact: cloudsupport@telestream.net
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
package qc
type ReferenceLevelsTest struct {
BlackRef int32 `json:"black_ref,omitempty"`
WhiteRef int32 `json:"white_ref,omitempty"`
RejectOnError bool `json:"reject_on_error,omitempty"`
Checked bool `json:"checked,omitempty"`
}
|
{
"content_hash": "575f71da335f1333f81f3ec2ff1ad36e",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 67,
"avg_line_length": 22.11111111111111,
"alnum_prop": 0.7211055276381909,
"repo_name": "Telestream/telestream-cloud-go-sdk",
"id": "34921b423834ec9299c4f7691793f0fecede23ba",
"size": "398",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "qc/model_reference_levels_test_.go",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Go",
"bytes": "600904"
},
{
"name": "Shell",
"bytes": "1664"
}
],
"symlink_target": ""
}
|
module.exports = () => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
}
|
{
"content_hash": "07e1c4048be06a566f91e28b48ecb00f",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 59,
"avg_line_length": 33,
"alnum_prop": 0.6666666666666666,
"repo_name": "mydearxym/mastani",
"id": "5042af60a35fc3a0188411d0c228d64d234dc908",
"size": "672",
"binary": false,
"copies": "1",
"ref": "refs/heads/dev",
"path": "cypress/plugins/index.js",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "5475"
},
{
"name": "JavaScript",
"bytes": "449787"
}
],
"symlink_target": ""
}
|
CKEDITOR.plugins.setLang( 'smiley', 'mk', {
options: 'Smiley Options', // MISSING
title: 'Insert a Smiley', // MISSING
toolbar: 'Smiley' // MISSING
});
|
{
"content_hash": "deb57b420ca75d802a06e4f50d2a4765",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 43,
"avg_line_length": 27.166666666666668,
"alnum_prop": 0.6257668711656442,
"repo_name": "webmasterETSI/web",
"id": "d323926eabf27aee1f06d31fc769df6fc7f6255f",
"size": "312",
"binary": false,
"copies": "7",
"ref": "refs/heads/master",
"path": "web/ckeditor/plugins/smiley/lang/mk.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "4357402"
},
{
"name": "PHP",
"bytes": "185061"
},
{
"name": "Perl",
"bytes": "26"
},
{
"name": "Shell",
"bytes": "213"
}
],
"symlink_target": ""
}
|
using System;
using System.ComponentModel.Composition;
using System.IO;
using Slot.Core.ComponentModel;
using Slot.Core.Settings;
using Slot.Core.ViewModel;
namespace Slot.Core.Workspaces
{
[Export(typeof(IWorkspaceController))]
[ComponentData(Name)]
public sealed class WorkspaceController : IWorkspaceController
{
public const string Name = "workspaces.default";
private const string FOLDER = ".slot";
public bool OpenWorkspace(IView view, DirectoryInfo dir)
{
if (IsChildFolder(view.Workspace, dir))
return false;
var baseDir = dir;
do
{
var ws = Path.Combine(dir.FullName, FOLDER);
if (Directory.Exists(ws))
return DirectOpenWorkspace(view, dir);
dir = dir.Parent;
}
while (dir != null);
return DirectOpenWorkspace(view, baseDir);
}
private bool IsChildFolder(DirectoryInfo ws, DirectoryInfo dir)
{
if (Directory.Exists(Path.Combine(dir.FullName, ".slot")))
return false;
if (ws == null)
return false;
do
{
if (string.Equals(ws.FullName, dir.FullName, StringComparison.OrdinalIgnoreCase))
return true;
dir = dir.Parent;
}
while (dir != null);
return false;
}
private bool DirectOpenWorkspace(IView view, DirectoryInfo dir)
{
if (!string.Equals(view.Workspace?.FullName, dir.FullName, StringComparison.OrdinalIgnoreCase))
{
FileUtil.EnsurePath(dir);
Directory.SetCurrentDirectory(dir.FullName);
view.Workspace = dir;
view.Settings.ReloadSettings(SettingsScope.Workspace);
return true;
}
return false;
}
}
}
|
{
"content_hash": "0612800968d2ffcd3ca24c4c78fa3525",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 107,
"avg_line_length": 27.73611111111111,
"alnum_prop": 0.5503254882323485,
"repo_name": "vorov2/slot",
"id": "1bc73fcabc707be739edd8081b74da12ff08dd8d",
"size": "1999",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Slot.Core/Workspaces/WorkspaceController.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "682176"
},
{
"name": "HTML",
"bytes": "6600"
},
{
"name": "SCSS",
"bytes": "1203"
}
],
"symlink_target": ""
}
|
from ..dispatch import LOG_INFO, LOG_TRACE, LOG_DEBUG
from data import LinkState, ProtocolVersion
from .address import Address
class NodeTracker(object):
"""
This module is responsible for tracking the set of router nodes that are known to this
router. It tracks whether they are neighbor or remote and whether they are reachable.
This module is also responsible for assigning a unique mask bit value to each router.
The mask bit is used in the main router to represent sets of valid destinations for addresses.
"""
def __init__(self, container, max_routers):
self.container = container
self.my_id = container.id
self.max_routers = max_routers
self.link_state = LinkState(None, self.my_id, 0, {})
self.link_state_changed = False
self.recompute_topology = False
self.last_topology_change = 0
self.flux_mode = False
self.nodes = {} # id => RouterNode
self.nodes_by_link_id = {} # link-id => node-id
self.maskbits = []
self.next_maskbit = 1 # Reserve bit '0' to represent this router
for i in range(max_routers):
self.maskbits.append(None)
self.maskbits[0] = True
self.neighbor_max_age = self.container.config.helloMaxAge
self.ls_max_age = self.container.config.remoteLsMaxAge
self.flux_interval = self.container.config.raIntervalFlux * 2
self.container.router_adapter.get_agent().add_implementation(self, "router.node")
def refresh_entity(self, attributes):
"""Refresh management attributes"""
attributes.update({
"id": self.my_id,
"protocolVersion": ProtocolVersion,
"instance": self.container.instance, # Boot number, integer
"linkState": [ls for ls in self.link_state.peers], # List of neighbour nodes
"nextHop": "(self)",
"validOrigins": [],
"address": Address.topological(self.my_id, area=self.container.area),
"lastTopoChange" : self.last_topology_change
})
def _do_expirations(self, now):
"""
Run through the list of routers and check for expired conditions
"""
for node_id, node in self.nodes.items():
##
## If the node is a neighbor, check the neighbor refresh time to see
## if we've waited too long for a refresh. If so, disconnect the link
## and remove the node from the local link state.
##
if node.is_neighbor():
if now - node.neighbor_refresh_time > self.neighbor_max_age:
node.remove_link()
if self.link_state.del_peer(node_id):
self.link_state_changed = True
##
## Check the age of the node's link state. If it's too old, clear it out.
##
if now - node.link_state.last_seen > self.ls_max_age:
if node.link_state.has_peers():
node.link_state.del_all_peers()
self.recompute_topology = True
##
## If the node has empty link state, check to see if it appears in any other
## node's link state. If it does not, then delete the node.
##
if not node.link_state.has_peers() and not node.is_neighbor():
delete_node = True
for _id, _n in self.nodes.items():
if _id != node_id:
if _n.link_state.is_peer(node_id):
delete_node = False
break
if delete_node:
##
## The keep_alive_count is set to zero when a new node is first
## discovered. Since we can learn about a node before we receive
## its link state, the keep_alive_count is used to prevent the
## node from being deleted before we can learn more about it.
##
node.keep_alive_count += 1
if node.keep_alive_count > 2:
node.delete()
self.nodes.pop(node_id)
def tick(self, now):
send_ra = False
##
## Expire neighbors and link state
##
self._do_expirations(now)
##
## Enter flux mode if things are changing
##
if self.link_state_changed or self.recompute_topology:
self.last_topology_change = int(round(now))
if not self.flux_mode:
self.flux_mode = True
self.container.log(LOG_TRACE, "Entered Router Flux Mode")
##
## Handle local link state changes
##
if self.link_state_changed:
self.link_state_changed = False
self.link_state.bump_sequence()
self.recompute_topology = True
send_ra = True
self.container.log_ls(LOG_TRACE, "Local Link State: %r" % self.link_state)
##
## Recompute the topology
##
if self.recompute_topology:
self.recompute_topology = False
collection = {self.my_id : self.link_state}
for node_id, node in self.nodes.items():
collection[node_id] = node.link_state
next_hops, costs, valid_origins = self.container.path_engine.calculate_routes(collection)
self.container.log_ls(LOG_TRACE, "Computed next hops: %r" % next_hops)
self.container.log_ls(LOG_TRACE, "Computed costs: %r" % costs)
self.container.log_ls(LOG_TRACE, "Computed valid origins: %r" % valid_origins)
##
## Update the next hops and valid origins for each node
##
for node_id, next_hop_id in next_hops.items():
node = self.nodes[node_id]
next_hop = self.nodes[next_hop_id]
vo = valid_origins[node_id]
cost = costs[node_id]
node.set_next_hop(next_hop)
node.set_valid_origins(vo)
node.set_cost(cost)
##
## Send link-state requests and mobile-address requests to the nodes
## that have pending requests and are reachable
##
for node_id, node in self.nodes.items():
if node.link_state_requested():
self.container.link_state_engine.send_lsr(node_id)
if node.mobile_address_requested():
self.container.mobile_address_engine.send_mar(node_id, node.mobile_address_sequence)
##
## If local changes have been made to the list of mobile addresses, send
## an unsolicited mobile-address-update to all routers.
##
mobile_seq = self.container.mobile_address_engine.tick(now)
self.container.link_state_engine.set_mobile_seq(mobile_seq)
##
## Send an immediate RA if our link state changed
##
if send_ra:
self.container.link_state_engine.send_ra(now)
def neighbor_refresh(self, node_id, version, instance, link_id, cost, now):
"""
Invoked when the hello protocol has received positive confirmation
of continued bi-directional connectivity with a neighbor router.
"""
##
## If the node id is not known, create a new RouterNode to track it.
##
if node_id not in self.nodes:
self.nodes[node_id] = RouterNode(self, node_id, version, instance)
node = self.nodes[node_id]
##
## Add the version if we haven't already done so.
##
if node.version == None:
node.version = version
##
## Set the link_id to indicate this is a neighbor router. If the link_id
## changed, update the index and add the neighbor to the local link state.
##
if node.set_link_id(link_id):
self.nodes_by_link_id[link_id] = node
node.request_link_state()
if self.link_state.add_peer(node_id, cost):
self.link_state_changed = True
##
## Update the refresh time for later expiration checks
##
node.neighbor_refresh_time = now
##
## If the instance was updated (i.e. the neighbor restarted suddenly),
## schedule a topology recompute and a link-state-request to that router.
##
if node.update_instance(instance, version):
self.recompute_topology = True
node.request_link_state()
def link_lost(self, link_id):
"""
Invoked when an inter-router link is dropped.
"""
self.container.log_ls(LOG_INFO, "Link to Neighbor Router Lost - link_tag=%d" % link_id)
node_id = self.link_id_to_node_id(link_id)
if node_id:
self.nodes_by_link_id.pop(link_id)
node = self.nodes[node_id]
node.remove_link()
if self.link_state.del_peer(node_id):
self.link_state_changed = True
def in_flux_mode(self, now):
result = (now - self.last_topology_change) <= self.flux_interval
if not result and self.flux_mode:
self.flux_mode = False
self.container.log(LOG_TRACE, "Exited Router Flux Mode")
return result
def ra_received(self, node_id, version, ls_seq, mobile_seq, instance, now):
"""
Invoked when a router advertisement is received from another router.
"""
##
## If the node id is not known, create a new RouterNode to track it.
##
if node_id not in self.nodes:
self.nodes[node_id] = RouterNode(self, node_id, version, instance)
node = self.nodes[node_id]
##
## Add the version if we haven't already done so.
##
if node.version == None:
node.version = version
##
## If the instance was updated (i.e. the router restarted suddenly),
## schedule a topology recompute and a link-state-request to that router.
##
if node.update_instance(instance, version):
self.recompute_topology = True
node.request_link_state()
##
## Update the last seen time to now to control expiration of the link state.
##
node.link_state.last_seen = now
##
## Check the link state sequence. Send a link state request if our records are
## not up to date.
##
if node.link_state.ls_seq < ls_seq:
self.container.link_state_engine.send_lsr(node_id)
##
## Check the mobile sequence. Send a mobile-address-request if we are
## behind the advertized sequence.
##
if node.mobile_address_sequence < mobile_seq:
node.mobile_address_request()
def router_learned(self, node_id, version):
"""
Invoked when we learn about another router by any means
"""
if node_id not in self.nodes and node_id != self.my_id:
self.nodes[node_id] = RouterNode(self, node_id, version, None)
def link_state_received(self, node_id, version, link_state, instance, now):
"""
Invoked when a link state update is received from another router.
"""
##
## If the node id is not known, create a new RouterNode to track it.
##
if node_id not in self.nodes:
self.nodes[node_id] = RouterNode(self, node_id, version, instance)
node = self.nodes[node_id]
##
## Add the version if we haven't already done so.
##
if node.version == None:
node.version = version
##
## If the new link state is more up-to-date than the stored link state,
## update it and schedule a topology recompute.
##
if link_state.ls_seq > node.link_state.ls_seq:
node.link_state = link_state
node.link_state.last_seen = now
self.recompute_topology = True
##
## Look through the new link state for references to nodes that we don't
## know about. Schedule link state requests for those nodes to be sent
## after we next recompute the topology.
##
for peer in node.link_state.peers:
if peer not in self.nodes:
self.router_learned(peer, None)
def router_node(self, node_id):
return self.nodes[node_id]
def link_id_to_node_id(self, link_id):
if link_id in self.nodes_by_link_id:
return self.nodes_by_link_id[link_id].id
return None
def _allocate_maskbit(self):
if self.next_maskbit == None:
raise Exception("Exceeded Maximum Router Count")
result = self.next_maskbit
self.next_maskbit = None
self.maskbits[result] = True
for n in range(result + 1, self.max_routers):
if self.maskbits[n] == None:
self.next_maskbit = n
break
return result
def _free_maskbit(self, i):
self.maskbits[i] = None
if self.next_maskbit == None or i < self.next_maskbit:
self.next_maskbit = i
class RouterNode(object):
"""
RouterNode is used to track remote routers in the router network.
"""
def __init__(self, parent, node_id, version, instance):
self.parent = parent
self.adapter = parent.container.router_adapter
self.log = parent.container.log
self.id = node_id
self.version = version
self.instance = instance
self.maskbit = self.parent._allocate_maskbit()
self.neighbor_refresh_time = 0.0
self.peer_link_id = None
self.link_state = LinkState(None, self.id, 0, {})
self.next_hop_router = None
self.cost = None
self.valid_origins = None
self.mobile_addresses = []
self.mobile_address_sequence = 0
self.need_ls_request = True
self.need_mobile_request = False
self.keep_alive_count = 0
self.adapter.add_router("amqp:/_topo/0/%s/qdrouter" % self.id, self.maskbit)
self.log(LOG_TRACE, "Node %s created: maskbit=%d" % (self.id, self.maskbit))
self.adapter.get_agent().add_implementation(self, "router.node")
def refresh_entity(self, attributes):
"""Refresh management attributes"""
attributes.update({
"id": self.id,
"protocolVersion": self.version,
"instance": self.instance, # Boot number, integer
"linkState": [ls for ls in self.link_state.peers], # List of neighbour nodes
"nextHop": self.next_hop_router and self.next_hop_router.id,
"validOrigins": self.valid_origins,
"address": Address.topological(self.id, area=self.parent.container.area),
"routerLink": self.peer_link_id,
"cost": self.cost
})
def _logify(self, addr):
cls = addr[0]
phase = None
if cls == 'M':
phase = addr[1]
return "%s;class=%c;phase=%c" % (addr[2:], cls, phase)
return "%s;class=%c" % (addr[1:], cls)
def set_link_id(self, link_id):
if self.peer_link_id == link_id:
return False
self.peer_link_id = link_id
self.next_hop_router = None
self.adapter.set_link(self.maskbit, link_id)
self.adapter.remove_next_hop(self.maskbit)
self.log(LOG_TRACE, "Node %s link set: link_id=%r" % (self.id, link_id))
return True
def remove_link(self):
if self.peer_link_id != None:
self.peer_link_id = None
self.adapter.remove_link(self.maskbit)
self.log(LOG_TRACE, "Node %s link removed" % self.id)
def delete(self):
self.adapter.get_agent().remove_implementation(self)
self.unmap_all_addresses()
self.adapter.del_router(self.maskbit)
self.parent._free_maskbit(self.maskbit)
self.log(LOG_TRACE, "Node %s deleted" % self.id)
def set_next_hop(self, next_hop):
if self.id == next_hop.id:
return
if self.next_hop_router and self.next_hop_router.id == next_hop.id:
return
self.next_hop_router = next_hop
self.adapter.set_next_hop(self.maskbit, next_hop.maskbit)
self.log(LOG_TRACE, "Node %s next hop set: %s" % (self.id, next_hop.id))
def set_valid_origins(self, valid_origins):
if self.valid_origins == valid_origins:
return
self.valid_origins = valid_origins
vo_mb = [self.parent.nodes[N].maskbit for N in valid_origins]
self.adapter.set_valid_origins(self.maskbit, vo_mb)
self.log(LOG_TRACE, "Node %s valid origins: %r" % (self.id, valid_origins))
def set_cost(self, cost):
if self.cost == cost:
return
self.cost = cost
self.adapter.set_cost(self.maskbit, cost)
self.log(LOG_TRACE, "Node %s cost: %d" % (self.id, cost))
def remove_next_hop(self):
if self.next_hop_router:
self.next_hop_router = None
self.adapter.remove_next_hop(self.maskbit)
self.log(LOG_TRACE, "Node %s next hop removed" % self.id)
def is_neighbor(self):
return self.peer_link_id != None
def request_link_state(self):
"""
Set the link-state-requested flag so we can send this node a link-state
request at the most opportune time.
"""
self.need_ls_request = True
def link_state_requested(self):
"""
Return True iff we need to request this node's link state AND the node is
reachable. There's no point in sending it a request if we don't know how to
reach it.
"""
if self.need_ls_request and (self.peer_link_id != None or self.next_hop_router != None):
self.need_ls_request = False
return True
return False
def mobile_address_request(self):
self.need_mobile_request = True
def mobile_address_requested(self):
if self.need_mobile_request and (self.peer_link_id != None or self.next_hop_router != None):
self.need_mobile_request = False
return True
return False
def map_address(self, addr):
self.mobile_addresses.append(addr)
self.adapter.map_destination(addr, self.maskbit)
self.log(LOG_DEBUG, "Remote destination %s mapped to router %s" % (self._logify(addr), self.id))
def unmap_address(self, addr):
self.mobile_addresses.remove(addr)
self.adapter.unmap_destination(addr, self.maskbit)
self.log(LOG_DEBUG, "Remote destination %s unmapped from router %s" % (self._logify(addr), self.id))
def unmap_all_addresses(self):
self.mobile_address_sequence = 0
for addr in self.mobile_addresses:
self.unmap_address(addr)
def overwrite_addresses(self, addrs):
added = []
deleted = []
for a in addrs:
if a not in self.mobile_addresses:
added.append(a)
for a in self.mobile_addresses:
if a not in addrs:
deleted.append(a)
for a in added:
self.map_address(a)
for a in deleted:
self.unmap_address(a)
def update_instance(self, instance, version):
if instance == None:
return False
if self.instance == None:
self.instance = instance
return False
if self.instance == instance:
return False
self.instance = instance
self.version = version
self.link_state.del_all_peers()
self.unmap_all_addresses()
self.log(LOG_INFO, "Detected Restart of Router Node %s" % self.id)
return True
|
{
"content_hash": "1346072767d1c4a07b7b0adb99d80756",
"timestamp": "",
"source": "github",
"line_count": 551,
"max_line_length": 108,
"avg_line_length": 36.91470054446461,
"alnum_prop": 0.5621927236971485,
"repo_name": "adel-boutros/qpid-dispatch",
"id": "a9af3c68d18b7c35a39bf7fd34ccae1c234e05a1",
"size": "21130",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "python/qpid_dispatch_internal/router/node.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "1115393"
},
{
"name": "C++",
"bytes": "30402"
},
{
"name": "CMake",
"bytes": "24640"
},
{
"name": "CSS",
"bytes": "143203"
},
{
"name": "HTML",
"bytes": "72162"
},
{
"name": "Java",
"bytes": "1940"
},
{
"name": "JavaScript",
"bytes": "1769068"
},
{
"name": "Objective-C",
"bytes": "5351"
},
{
"name": "Python",
"bytes": "772975"
},
{
"name": "Shell",
"bytes": "19636"
}
],
"symlink_target": ""
}
|
'use strict';
var path = require('path');
var conf = require('./gulp/conf');
var _ = require('lodash');
var wiredep = require('wiredep');
var pathSrcHtml = [
path.join(conf.paths.src, '/**/*.html')
];
function listFiles() {
var wiredepOptions = _.extend({}, conf.wiredep, {
dependencies: true,
devDependencies: true
});
var patterns = wiredep(wiredepOptions).js
.concat([
path.join(conf.paths.src, '/app/**/*.module.js'),
path.join(conf.paths.src, '/app/**/*.js'),
path.join(conf.paths.src, '/**/*.spec.js'),
path.join(conf.paths.src, '/**/*.mock.js'),
])
.concat(pathSrcHtml);
var files = patterns.map(function (pattern) {
return {
pattern: pattern
};
});
files.push({
pattern: path.join(conf.paths.src, '/assets/**/*'),
included: false,
served: true,
watched: false
});
return files;
}
module.exports = function (config) {
var configuration = {
files: listFiles(),
singleRun: true,
autoWatch: true,
ngHtml2JsPreprocessor: {
stripPrefix: conf.paths.src + '/',
moduleName: 'lobilistAngular'
},
logLevel: 'WARN',
frameworks: ['phantomjs-shim', 'jasmine', 'jasmine-matchers', 'angular-filesort'],
angularFilesort: {
whitelist: [path.join(conf.paths.src, '/**/!(*.html|*.spec|*.mock).js')]
},
browsers: ['PhantomJS'],
plugins: [
'karma-phantomjs-launcher',
'karma-angular-filesort',
'karma-phantomjs-shim',
'karma-coverage',
'karma-jasmine',
'karma-jasmine-matchers',
'karma-ng-html2js-preprocessor'
],
coverageReporter: {
type: 'html',
dir: 'coverage/'
},
reporters: ['progress'],
proxies: {
'/assets/': path.join('/base/', conf.paths.src, '/assets/')
}
};
// This is the default preprocessors configuration for a usage with Karma cli
// The coverage preprocessor is added in gulp/unit-test.js only for single tests
// It was not possible to do it there because karma doesn't let us now if we are
// running a single test or not
configuration.preprocessors = {};
pathSrcHtml.forEach(function (path) {
configuration.preprocessors[path] = ['ng-html2js'];
});
// This block is needed to execute Chrome on Travis
// If you ever plan to use Chrome and Travis, you can keep it
// If not, you can safely remove it
// https://github.com/karma-runner/karma/issues/1144#issuecomment-53633076
if (configuration.browsers[0] === 'Chrome' && process.env.TRAVIS) {
configuration.customLaunchers = {
'chrome-travis-ci': {
base: 'Chrome',
flags: ['--no-sandbox']
}
};
configuration.browsers = ['chrome-travis-ci'];
}
config.set(configuration);
};
|
{
"content_hash": "4f71f56decc61c3ddac7d74f36a51b84",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 90,
"avg_line_length": 27.482142857142858,
"alnum_prop": 0.5510071474983755,
"repo_name": "arboshiki/lobilist-angular",
"id": "14f4d7dbb1369fc2c76c190b1de2003d18e137a4",
"size": "3078",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "karma.conf.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "10248"
},
{
"name": "HTML",
"bytes": "13474"
},
{
"name": "JavaScript",
"bytes": "47300"
}
],
"symlink_target": ""
}
|
{-# LANGUAGE ParallelListComp #-}
module Math.GeometricAlgebra
( GA
, mkSig
, GASig
, gaBasis
, gaVector
, gaNorm
, gaZero
, gaAdd
, gaReversion
, gaMult
, gaScalar
, gaScalarMult
, gaPart
, gaGrades
, gaOuterProd
, gaLeftContraction
, gaPseudoscalar
, gaPseudoinverse
, gaDual
, gaScalarPart
) where
import Data.Bits
import Data.Foldable
import Data.Maybe
import Data.IntMap.Strict (IntMap)
import qualified Data.IntMap.Strict as IntMap
import Data.IntSet (IntSet)
import qualified Data.IntSet as IntSet
newtype GASig a =
GASig
{ sigElements :: ([a])
}
instance Show a => Show (GASig a) where
show = show . sigElements
instance Ord a => Ord (GASig a) where
compare x y = compare (sigElements x) (sigElements y)
instance Eq a => Eq (GASig a) where
x == y = sigElements x == sigElements y
data GA a
= GAScalar a
| GA { gaSig :: {-# UNPACK #-} !(GASig a)
, gaMap :: IntMap a
}
deriving ( Show )
instance (Eq a) => Eq (GA a) where
GAScalar x == GAScalar y = x == y
GAScalar x == GA{ gaMap = m } = m == IntMap.singleton 0 x
GA{ gaMap = m } == GAScalar y = m == IntMap.singleton 0 y
x@GA{} == y@GA{} = gaSig x == gaSig y && gaMap x == gaMap y
instance (Ord a) => Ord (GA a) where
compare (GAScalar x) (GAScalar y) = compare x y
compare (GAScalar x) y@GA{ gaMap = m } = compare (IntMap.singleton 0 x) m
compare x@GA{ gaMap = m } (GAScalar y) = compare m (IntMap.singleton 0 y)
compare x@GA{} y@GA{} =
case compare (gaSig x) (gaSig y) of
LT -> LT
GT -> GT
EQ -> compare (gaMap x) (gaMap y)
instance (Show a, Eq a, Num a) => Num (GA a) where
x + y = gaAdd x y
x * y = gaMult x y
negate x = gaScalarMult (-1) x
fromInteger = GAScalar . fromInteger
abs _ = error "Geometric Algebra does not support absolute value"
signum _ = error "Geometric Algebra does not support signum"
instance (Show a, Eq a, Fractional a) => Fractional (GA a) where
fromRational = GAScalar . fromRational
recip (GAScalar x) = GAScalar (recip x)
recip x
| gaGrades x == IntSet.singleton 0 =
case IntMap.lookup 0 (gaMap x) of
Just a | a /= 0 -> GAScalar $ recip a
Nothing -> error "Geometric Algebra: cannot recip the 0 scalar"
| otherwise = error "Geometric Algebra does not support recip except for scalars"
okSig :: GASig a -> b -> b
okSig sig x
| length (sigElements sig) <= finiteBitSize (0::Int) = x
| otherwise = error $ unwords ["GA signature too large"]
sameSig :: (Show a, Eq a) => GA a -> GA a -> b -> b
sameSig m n x
| gaSig m == gaSig n = x
| otherwise = error $ unwords ["incompatible signatures:"
, show (gaSig m), show (gaSig n)
]
gaScalarPart :: Num a => GA a -> a
gaScalarPart (GAScalar x) = x
gaScalarPart GA{ gaMap = m } = fromMaybe 0 (IntMap.lookup 0 m)
gaPart :: Num a => Int -> GA a -> GA a
gaPart 0 x@(GAScalar _) = x
gaPart 0 x = GAScalar $ fromMaybe 0 $ IntMap.lookup 0 (gaMap x)
gaPart k (GAScalar _) = gaZero
gaPart k x =
x{ gaMap = IntMap.filterWithKey (\i _ -> popCount i == k) (gaMap x) }
gaGrades :: (Eq a, Num a) => GA a -> IntSet
gaGrades (GAScalar c)
| c /= 0 = IntSet.singleton 1
| otherwise = IntSet.empty
gaGrades x@GA{} = IntSet.fromList
[ popCount i
| (i,c) <- IntMap.toList (gaMap x)
, c /= 0
]
gaZero :: Num a => GA a
gaZero = GAScalar 0
gaNorm :: Num a => GA a -> a
gaNorm (GAScalar x) = x*x
gaNorm GA{ gaMap = m }= sum $ fmap (\x -> x*x) $ m
gaScalar :: a -> GA a
gaScalar = GAScalar
gaScalarMult :: Num a => a -> GA a -> GA a
gaScalarMult x (GAScalar y) = GAScalar (x*y)
gaScalarMult x mv@GA{ gaMap = m } = mv{ gaMap = fmap (x*) m }
maybeAdd :: Num a => a -> Maybe a -> Maybe a
maybeAdd x Nothing = Just x
maybeAdd x (Just y) = Just (x+y)
gaAdd :: (Show a, Eq a, Num a) => GA a -> GA a -> GA a
gaAdd (GAScalar x) (GAScalar y) = GAScalar (x+y)
gaAdd (GAScalar x) y@GA{ gaMap = m } = y{ gaMap = IntMap.alter (maybeAdd x) 0 m }
gaAdd x@GA{ gaMap = m } (GAScalar y) = x{ gaMap = IntMap.alter (maybeAdd y) 0 m }
gaAdd x@GA{} y@GA{} = sameSig x y $
x{ gaMap = IntMap.unionWith (+) (gaMap x) (gaMap y) }
basisVec :: Num a => Int -> IntMap a
basisVec i = IntMap.singleton (shiftL (1::Int) i) 1
gaBasis :: Num a => GASig a -> [GA a]
gaBasis sig = okSig sig $
[ GA sig (basisVec i) | i <- [0 .. length (sigElements sig)-1] ]
gaVector :: (Num a, Show a) => GASig a -> [a] -> GA a
gaVector sig xs
| length (sigElements sig) == length xs = okSig sig $ GA sig $
IntMap.fromList
[ (shiftL (1::Int) i, x)
| i <- [0 .. length (sigElements sig)-1]
| x <- xs
]
| otherwise = error $ unwords
[ "gaVecotr: incorrect vector length"
, show (sigElements sig), show xs
]
gaPseudoscalar :: Num a => GASig a -> GA a
gaPseudoscalar sig = okSig sig $ GA sig $ IntMap.singleton k 1
where k = 2^n - 1
n = length (sigElements sig)
gaPseudoinverse :: Num a => GASig a -> GA a
gaPseudoinverse sig = okSig sig $ GA sig $ IntMap.singleton k x
where k = 2^n - 1
n = length (sigElements sig)
x = swapSign ((n * (n-1)) `div` 2) 1
gaReversion :: Num a => GA a -> GA a
gaReversion (GAScalar x) = GAScalar x
gaReversion ga@GA{ gaMap = m} = ga{ gaMap = IntMap.mapWithKey f m }
where f k x = swapSign ((n * (n-1)) `div` 2) $ x
where n = popCount k
gaParityConjugation :: Num a => GA a -> GA a
gaParityConjugation (GAScalar x) = GAScalar x
gaParityConjugation ga@GA{ gaMap = m } = ga{ gaMap = IntMap.mapWithKey f m }
where f k x = swapSign n $ x
where n = popCount k
gaDual :: (Show a, Eq a, Num a) => GA a -> GA a
gaDual x = gaMult x (gaPseudoinverse (gaSig x))
gaLeftContraction :: (Show a, Eq a, Num a) => GA a -> GA a -> GA a
gaLeftContraction x y = sameSig x y $
foldr gaAdd gaZero
[ gaPart (j-i) $ gaMult (gaPart i x) (gaPart j y)
| i <- [0 .. n]
, j <- [0 .. n]
, i <= j
]
where n = length (sigElements (gaSig x))
gaOuterProd :: (Show a, Eq a, Num a) => GA a -> GA a -> GA a
gaOuterProd x y = sameSig x y $
foldr gaAdd gaZero
[ gaPart (i+j) $ gaMult (gaPart i x) (gaPart j y)
| i <- [0 .. n]
, j <- [0 .. n]
, i+j <= n
]
where n = length (sigElements (gaSig x))
gaMult :: (Show a, Eq a, Num a) => GA a -> GA a -> GA a
gaMult (GAScalar x) (GAScalar y) = GAScalar (x*y)
gaMult (GAScalar x) y@GA{} = gaScalarMult x y
gaMult x@GA{} (GAScalar y) = gaScalarMult y x
gaMult x y = sameSig x y $
x{ gaMap = IntMap.unionsWith (+) xs }
where xs = [ gaMultOne (gaSig x) i j a b
| (i,a) <- IntMap.toList (gaMap x)
, (j,b) <- IntMap.toList (gaMap y)
]
gaMultOne :: Num a => GASig a -> Int -> Int -> a -> a -> IntMap a
gaMultOne sig i j a b = IntMap.singleton k c
where k = xor i j
c = convConstant (sigElements sig) i j * a * b
-- c = conversionMemoMap sig i j * a * b
mkSig :: Num a => [a] -> GASig a
mkSig sigElts = GASig sigElts
convConstant :: Num a => [a] -> Int -> Int -> a
convConstant = go 0 1
where go _ ans [] _ _ = ans
go bit ans (x:xs) i j
| testBit i bit && testBit j bit = go (bit+1)
(x * swapSign (popCount i') ans)
xs i' j'
| testBit j bit = go (bit+1)
(swapSign (popCount i') ans)
xs i' j'
| otherwise = go (bit+1)
ans
xs i' j'
where i' = clearBit i bit
j' = clearBit j bit
{-# INLINE swapSign #-}
swapSign :: Num a => Int -> a -> a
swapSign i x
| even i = x
| otherwise = negate x
|
{
"content_hash": "ed8ef924febf608652787e1c9450b5cb",
"timestamp": "",
"source": "github",
"line_count": 260,
"max_line_length": 86,
"avg_line_length": 30.3,
"alnum_prop": 0.5653719218075653,
"repo_name": "robdockins/geometric-algebra",
"id": "b9590be6e78fb3d0eff1402109e79c7fecfb821a",
"size": "7878",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Math/GeometricAlgebra.hs",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Haskell",
"bytes": "32950"
}
],
"symlink_target": ""
}
|
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<title>PHPXRef 0.7.1 : Unnamed Project : Function Reference: _is_conn()</title>
<link rel="stylesheet" href="../sample.css" type="text/css">
<link rel="stylesheet" href="../sample-print.css" type="text/css" media="print">
<style id="hilight" type="text/css"></style>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
</head>
<body bgcolor="#ffffff" text="#000000" link="#801800" vlink="#300540" alink="#ffffff">
<table class="pagetitle" width="100%">
<tr>
<td valign="top" class="pagetitle">
[ <a href="../index.html">Index</a> ]
</td>
<td align="right" class="pagetitle">
<h2 style="margin-bottom: 0px">PHP Cross Reference of Unnamed Project</h2>
</td>
</tr>
</table>
<!-- Generated by PHPXref 0.7.1 at Thu Oct 23 18:57:41 2014 -->
<!-- PHPXref (c) 2000-2010 Gareth Watts - gareth@omnipotent.net -->
<!-- http://phpxref.sourceforge.net/ -->
<script src="../phpxref.js" type="text/javascript"></script>
<script language="JavaScript" type="text/javascript">
<!--
ext='.html';
relbase='../';
subdir='_functions';
filename='index.html';
cookiekey='phpxref';
handleNavFrame(relbase, subdir, filename);
logFunction('_is_conn');
// -->
</script>
<script language="JavaScript" type="text/javascript">
if (gwGetCookie('xrefnav')=='off')
document.write('<p class="navlinks">[ <a href="javascript:navOn()">Show Explorer<\/a> ]<\/p>');
else
document.write('<p class="navlinks">[ <a href="javascript:navOff()">Hide Explorer<\/a> ]<\/p>');
</script>
<noscript>
<p class="navlinks">
[ <a href="../nav.html" target="_top">Show Explorer</a> ]
[ <a href="index.html" target="_top">Hide Navbar</a> ]
</p>
</noscript>
[<a href="../index.html">Top level directory</a>]<br>
<script language="JavaScript" type="text/javascript">
<!--
document.writeln('<table align="right" class="searchbox-link"><tr><td><a class="searchbox-link" href="javascript:void(0)" onMouseOver="showSearchBox()">Search</a><br>');
document.writeln('<table border="0" cellspacing="0" cellpadding="0" class="searchbox" id="searchbox">');
document.writeln('<tr><td class="searchbox-title">');
document.writeln('<a class="searchbox-title" href="javascript:showSearchPopup()">Search History +</a>');
document.writeln('<\/td><\/tr>');
document.writeln('<tr><td class="searchbox-body" id="searchbox-body">');
document.writeln('<form name="search" style="margin:0px; padding:0px" onSubmit=\'return jump()\'>');
document.writeln('<a class="searchbox-body" href="../_classes/index.html">Class<\/a>: ');
document.writeln('<input type="text" size=10 value="" name="classname"><br>');
document.writeln('<a id="funcsearchlink" class="searchbox-body" href="../_functions/index.html">Function<\/a>: ');
document.writeln('<input type="text" size=10 value="" name="funcname"><br>');
document.writeln('<a class="searchbox-body" href="../_variables/index.html">Variable<\/a>: ');
document.writeln('<input type="text" size=10 value="" name="varname"><br>');
document.writeln('<a class="searchbox-body" href="../_constants/index.html">Constant<\/a>: ');
document.writeln('<input type="text" size=10 value="" name="constname"><br>');
document.writeln('<a class="searchbox-body" href="../_tables/index.html">Table<\/a>: ');
document.writeln('<input type="text" size=10 value="" name="tablename"><br>');
document.writeln('<input type="submit" class="searchbox-button" value="Search">');
document.writeln('<\/form>');
document.writeln('<\/td><\/tr><\/table>');
document.writeln('<\/td><\/tr><\/table>');
// -->
</script>
<div id="search-popup" class="searchpopup"><p id="searchpopup-title" class="searchpopup-title">title</p><div id="searchpopup-body" class="searchpopup-body">Body</div><p class="searchpopup-close"><a href="javascript:gwCloseActive()">[close]</a></p></div>
<h3>Function and Method Cross Reference</h3>
<h2><a href="index.html#_is_conn">_is_conn()</a></h2>
<b>Defined at:</b><ul>
<li><a href="../bonfire/codeigniter/libraries/Ftp.php.html#_is_conn">/bonfire/codeigniter/libraries/Ftp.php</a> -> <a onClick="logFunction('_is_conn', '/bonfire/codeigniter/libraries/Ftp.php.source.html#l134')" href="../bonfire/codeigniter/libraries/Ftp.php.source.html#l134"> line 134</a></li>
</ul>
<b>Referenced 11 times:</b><ul>
<li><a href="../bonfire/codeigniter/libraries/Ftp.php.html">/bonfire/codeigniter/libraries/Ftp.php</a> -> <a href="../bonfire/codeigniter/libraries/Ftp.php.source.html#l172"> line 172</a></li>
<li><a href="../bonfire/codeigniter/libraries/Ftp.php.html">/bonfire/codeigniter/libraries/Ftp.php</a> -> <a href="../bonfire/codeigniter/libraries/Ftp.php.source.html#l202"> line 202</a></li>
<li><a href="../bonfire/codeigniter/libraries/Ftp.php.html">/bonfire/codeigniter/libraries/Ftp.php</a> -> <a href="../bonfire/codeigniter/libraries/Ftp.php.source.html#l240"> line 240</a></li>
<li><a href="../bonfire/codeigniter/libraries/Ftp.php.html">/bonfire/codeigniter/libraries/Ftp.php</a> -> <a href="../bonfire/codeigniter/libraries/Ftp.php.source.html#l294"> line 294</a></li>
<li><a href="../bonfire/codeigniter/libraries/Ftp.php.html">/bonfire/codeigniter/libraries/Ftp.php</a> -> <a href="../bonfire/codeigniter/libraries/Ftp.php.source.html#l336"> line 336</a></li>
<li><a href="../bonfire/codeigniter/libraries/Ftp.php.html">/bonfire/codeigniter/libraries/Ftp.php</a> -> <a href="../bonfire/codeigniter/libraries/Ftp.php.source.html#l383"> line 383</a></li>
<li><a href="../bonfire/codeigniter/libraries/Ftp.php.html">/bonfire/codeigniter/libraries/Ftp.php</a> -> <a href="../bonfire/codeigniter/libraries/Ftp.php.source.html#l414"> line 414</a></li>
<li><a href="../bonfire/codeigniter/libraries/Ftp.php.html">/bonfire/codeigniter/libraries/Ftp.php</a> -> <a href="../bonfire/codeigniter/libraries/Ftp.php.source.html#l463"> line 463</a></li>
<li><a href="../bonfire/codeigniter/libraries/Ftp.php.html">/bonfire/codeigniter/libraries/Ftp.php</a> -> <a href="../bonfire/codeigniter/libraries/Ftp.php.source.html#l502"> line 502</a></li>
<li><a href="../bonfire/codeigniter/libraries/Ftp.php.html">/bonfire/codeigniter/libraries/Ftp.php</a> -> <a href="../bonfire/codeigniter/libraries/Ftp.php.source.html#l526"> line 526</a></li>
<li><a href="../bonfire/codeigniter/libraries/Ftp.php.html">/bonfire/codeigniter/libraries/Ftp.php</a> -> <a href="../bonfire/codeigniter/libraries/Ftp.php.source.html#l631"> line 631</a></li>
</ul>
<!-- A link to the phpxref site in your customized footer file is appreciated ;-) -->
<br><hr>
<table width="100%">
<tr><td>Generated: Thu Oct 23 18:57:41 2014</td>
<td align="right"><i>Cross-referenced by <a href="http://phpxref.sourceforge.net/">PHPXref 0.7.1</a></i></td>
</tr>
</table>
</body></html>
|
{
"content_hash": "869a1757a77553b64b5fa60d15c293ba",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 295,
"avg_line_length": 64.4245283018868,
"alnum_prop": 0.6842875970127398,
"repo_name": "inputx/code-ref-doc",
"id": "73efde1c86dfdce0532a0b9a25b38316b46002c8",
"size": "6829",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "bonfire/_functions/_is_conn.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "17952"
},
{
"name": "JavaScript",
"bytes": "255489"
}
],
"symlink_target": ""
}
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="rustdoc">
<meta name="description" content="API documentation for the Rust `XKB_KEY_braille_dots_12478` constant in crate `wayland_kbd`.">
<meta name="keywords" content="rust, rustlang, rust-lang, XKB_KEY_braille_dots_12478">
<title>wayland_kbd::keysyms::XKB_KEY_braille_dots_12478 - Rust</title>
<link rel="stylesheet" type="text/css" href="../../main.css">
</head>
<body class="rustdoc">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<section class="sidebar">
<p class='location'><a href='../index.html'>wayland_kbd</a>::<wbr><a href='index.html'>keysyms</a></p><script>window.sidebarCurrent = {name: 'XKB_KEY_braille_dots_12478', ty: 'constant', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</section>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press 'S' to search, '?' for more options..."
type="search">
</div>
</form>
</nav>
<section id='main' class="content constant">
<h1 class='fqn'><span class='in-band'><a href='../index.html'>wayland_kbd</a>::<wbr><a href='index.html'>keysyms</a>::<wbr><a class='constant' href=''>XKB_KEY_braille_dots_12478</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>−</span>]
</a>
</span><a id='src-5918' class='srclink' href='../../src/wayland_kbd/ffi/keysyms.rs.html#2309' title='goto source code'>[src]</a></span></h1>
<pre class='rust const'>pub const XKB_KEY_braille_dots_12478: <a href='http://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a><code> = </code><code>0x10028cb</code></pre></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<div id="help" class="hidden">
<div class="shortcuts">
<h1>Keyboard shortcuts</h1>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>⇤</dt>
<dd>Move up in search results</dd>
<dt>⇥</dt>
<dd>Move down in search results</dd>
<dt>⏎</dt>
<dd>Go to active search result</dd>
</dl>
</div>
<div class="infos">
<h1>Search tricks</h1>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>typedef</code> (or
<code>tdef</code>).
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code>)
</p>
</div>
</div>
<script>
window.rootPath = "../../";
window.currentCrate = "wayland_kbd";
window.playgroundUrl = "";
</script>
<script src="../../jquery.js"></script>
<script src="../../main.js"></script>
<script async src="../../search-index.js"></script>
</body>
</html>
|
{
"content_hash": "7b941edbb09485e5b37b66f1818d0116",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 263,
"avg_line_length": 38.53465346534654,
"alnum_prop": 0.5354573484069887,
"repo_name": "mcanders/bevy",
"id": "f105f0662d2af92d8453a97e0311ce4fb25d55be",
"size": "3892",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "doc/wayland_kbd/keysyms/constant.XKB_KEY_braille_dots_12478.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Rust",
"bytes": "316751"
}
],
"symlink_target": ""
}
|
class Job::Sns::LogsController < ApplicationController
include ::Sns::BaseFilter
include ::Sns::CrudFilter
include Job::LogsFilter
navi_view "job/sns/main/navi"
private
def set_crumbs
@crumbs << [t("job.task_manager"), action: :index]
@crumbs << [t("job.log"), action: :index]
end
def filter_permission
end
def log_criteria
criteria = @model.where(user_id: @cur_user.id)
criteria = criteria.search_ymd(ymd: @ymd, term: '1.day') if @ymd.present?
criteria
end
end
|
{
"content_hash": "326b4349b76516966df14515e766c68a",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 77,
"avg_line_length": 22.130434782608695,
"alnum_prop": 0.6679764243614931,
"repo_name": "sunny4381/shirasagi",
"id": "1c43754dd5f45805ade3882b04034304d116a287",
"size": "509",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "app/controllers/job/sns/logs_controller.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "82226"
},
{
"name": "HTML",
"bytes": "3233606"
},
{
"name": "JavaScript",
"bytes": "11964854"
},
{
"name": "Ruby",
"bytes": "12347543"
},
{
"name": "SCSS",
"bytes": "525875"
},
{
"name": "Shell",
"bytes": "20130"
}
],
"symlink_target": ""
}
|
<?php
/*
* This file is part of the MilioooFriendsBundle package.
*
* (c) Michiel boeckaert <boeckaert@gmail.com>
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Miliooo\FriendsBundle\Controller;
use Miliooo\Friends\Provider\UserRelationshipsProviderInterface;
use Miliooo\Friends\User\UserIdentifierInterface;
use Miliooo\Friends\User\UserRelationshipTransformerInterface;
use Symfony\Bundle\FrameworkBundle\Templating\EngineInterface;
/**
* Class ShowFriendsController
*
* @author Michiel Boeckaert <boeckaert@gmail.com>
*/
class ShowFriendsController
{
/**
* An user relationship transformer instance.
*
* @var UserRelationshipTransformerInterface
*/
protected $transformer;
/**
* An user relationship provider instance.
*
* @varUserRelationshipsProviderInterface
*/
protected $userRelationshipsProvider;
/**
* A templating instance.
*
* @var EngineInterface
*/
protected $templating;
/**
* Constructor.
*
* @param UserRelationshipTransformerInterface $transformer
* @param UserRelationshipsProviderInterface $userRelationshipsProvider
* @param EngineInterface $templating
*/
public function __construct(
UserRelationshipTransformerInterface $transformer,
UserRelationshipsProviderInterface $userRelationshipsProvider,
EngineInterface $templating
) {
$this->transformer = $transformer;
$this->userRelationshipsProvider = $userRelationshipsProvider;
$this->templating = $templating;
}
/**
* Shows an overview for the relationships for a given user.
*
* @param string $userRelationshipId
*
* @return \Symfony\Component\HttpFoundation\Response
*/
public function showAction($userRelationshipId)
{
$user = $this->getUser($userRelationshipId);
$userRelationships = $this->userRelationshipsProvider->getUserRelationships($user);
return $this->templating->renderResponse('MilioooFriendsBundle:Friends:user_relationship_overview.html.twig', ['userRelationships' => $userRelationships]);
}
/**
* Gets the user.
*
* @param string $userRelationshipId
*
* @return UserIdentifierInterface
*/
protected function getUser($userRelationshipId)
{
return $this->transformer->transformToObject($userRelationshipId);
}
}
|
{
"content_hash": "d7bc176685ff8b61fb91b6f5eaffea13",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 163,
"avg_line_length": 27.988888888888887,
"alnum_prop": 0.6927352123858674,
"repo_name": "Miliooo/MilioooFriendsBundle",
"id": "40cba3028531755108b98ecd4be22b27b985c219",
"size": "2519",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "FriendsBundle/Controller/ShowFriendsController.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "116761"
}
],
"symlink_target": ""
}
|
require 'spec_helper_acceptance'
describe 'replacement of' do
context 'file' do
context 'should not succeed' do
before(:all) do
shell('mkdir -p /tmp/concat')
shell('echo "file exists" > /tmp/concat/file')
end
after(:all) do
shell('rm -rf /tmp/concat /var/lib/puppet/concat')
end
pp = <<-EOS
include concat::setup
concat { '/tmp/concat/file':
replace => false,
}
concat::fragment { '1':
target => '/tmp/concat/file',
content => '1',
}
concat::fragment { '2':
target => '/tmp/concat/file',
content => '2',
}
EOS
it 'applies the manifest twice with no stderr' do
expect(apply_manifest(pp, :catch_failures => true).stderr).to eq("")
expect(apply_manifest(pp, :catch_changes => true).stderr).to eq("")
end
describe file('/tmp/concat/file') do
it { should be_file }
it { should contain 'file exists' }
it { should_not contain '1' }
it { should_not contain '2' }
end
end
context 'should succeed' do
before(:all) do
shell('mkdir -p /tmp/concat')
shell('echo "file exists" > /tmp/concat/file')
end
after(:all) do
shell('rm -rf /tmp/concat /var/lib/puppet/concat')
end
pp = <<-EOS
include concat::setup
concat { '/tmp/concat/file':
replace => true,
}
concat::fragment { '1':
target => '/tmp/concat/file',
content => '1',
}
concat::fragment { '2':
target => '/tmp/concat/file',
content => '2',
}
EOS
it 'applies the manifest twice with no stderr' do
expect(apply_manifest(pp, :catch_failures => true).stderr).to eq("")
expect(apply_manifest(pp, :catch_changes => true).stderr).to eq("")
end
describe file('/tmp/concat/file') do
it { should be_file }
it { should_not contain 'file exists' }
it { should contain '1' }
it { should contain '2' }
end
end
end # file
context 'symlink' do
context 'should not succeed' do
# XXX the core puppet file type will replace a symlink with a plain file
# when using ensure => present and source => ... but it will not when using
# ensure => present and content => ...; this is somewhat confusing behavior
before(:all) do
shell('mkdir -p /tmp/concat')
shell('ln -s /tmp/concat/dangling /tmp/concat/file')
end
after(:all) do
shell('rm -rf /tmp/concat /var/lib/puppet/concat')
end
pp = <<-EOS
include concat::setup
concat { '/tmp/concat/file':
replace => false,
}
concat::fragment { '1':
target => '/tmp/concat/file',
content => '1',
}
concat::fragment { '2':
target => '/tmp/concat/file',
content => '2',
}
EOS
it 'applies the manifest twice with no stderr' do
expect(apply_manifest(pp, :catch_failures => true).stderr).to eq("")
expect(apply_manifest(pp, :catch_changes => true).stderr).to eq("")
end
describe file('/tmp/concat/file') do
it { should be_linked_to '/tmp/concat/dangling' }
end
describe file('/tmp/concat/dangling') do
# XXX serverspec does not have a matcher for 'exists'
it { should_not be_file }
it { should_not be_directory }
end
end
context 'should succeed' do
# XXX the core puppet file type will replace a symlink with a plain file
# when using ensure => present and source => ... but it will not when using
# ensure => present and content => ...; this is somewhat confusing behavior
before(:all) do
shell('mkdir -p /tmp/concat')
shell('ln -s /tmp/concat/dangling /tmp/concat/file')
end
after(:all) do
shell('rm -rf /tmp/concat /var/lib/puppet/concat')
end
pp = <<-EOS
include concat::setup
concat { '/tmp/concat/file':
replace => true,
}
concat::fragment { '1':
target => '/tmp/concat/file',
content => '1',
}
concat::fragment { '2':
target => '/tmp/concat/file',
content => '2',
}
EOS
it 'applies the manifest twice with no stderr' do
expect(apply_manifest(pp, :catch_failures => true).stderr).to eq("")
expect(apply_manifest(pp, :catch_changes => true).stderr).to eq("")
end
describe file('/tmp/concat/file') do
it { should be_file }
it { should contain '1' }
it { should contain '2' }
end
end
end # symlink
context 'directory' do
context 'should not succeed' do
before(:all) do
shell('mkdir -p /tmp/concat/file')
end
after(:all) do
shell('rm -rf /tmp/concat /var/lib/puppet/concat')
end
pp = <<-EOS
include concat::setup
concat { '/tmp/concat/file': }
concat::fragment { '1':
target => '/tmp/concat/file',
content => '1',
}
concat::fragment { '2':
target => '/tmp/concat/file',
content => '2',
}
EOS
it 'applies the manifest twice with stderr for changing to file' do
expect(apply_manifest(pp, :expect_failures => true).stderr).to match(/change from directory to file failed/)
expect(apply_manifest(pp, :expect_failures => true).stderr).to match(/change from directory to file failed/)
end
describe file('/tmp/concat/file') do
it { should be_directory }
end
end
# XXX concat's force param currently enables the creation of empty files
# when there are no fragments, and the replace param will only replace
# files and symlinks, not directories. The semantics either need to be
# changed, extended, or a new param introduced to control directory
# replacement.
context 'should succeed', :pending => 'not yet implemented' do
before(:all) do
shell('mkdir -p /tmp/concat/file')
end
after(:all) do
shell('rm -rf /tmp/concat /var/lib/puppet/concat')
end
pp = <<-EOS
include concat::setup
concat { '/tmp/concat/file':
force => true,
}
concat::fragment { '1':
target => '/tmp/concat/file',
content => '1',
}
concat::fragment { '2':
target => '/tmp/concat/file',
content => '2',
}
EOS
it 'applies the manifest twice with no stderr' do
expect(apply_manifest(pp, :catch_failures => true).stderr).to eq("")
expect(apply_manifest(pp, :catch_changes => true).stderr).to eq("")
end
describe file('/tmp/concat/file') do
it { should be_file }
it { should contain '1' }
end
end
end # directory
end
|
{
"content_hash": "54a28a3c37a9a8c3ffb630f0f5677089",
"timestamp": "",
"source": "github",
"line_count": 247,
"max_line_length": 116,
"avg_line_length": 28.546558704453442,
"alnum_prop": 0.5434690114877322,
"repo_name": "jerrymaloney/BulletinScanner",
"id": "4a305e11b49d28c3e47f21e620ed5f897fb0bef1",
"size": "7051",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "puppet/modules/concat/spec/acceptance/replace_spec.rb",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Erlang",
"bytes": "3347"
},
{
"name": "JavaScript",
"bytes": "202"
},
{
"name": "Perl",
"bytes": "11873"
},
{
"name": "Puppet",
"bytes": "157236"
},
{
"name": "Ruby",
"bytes": "582120"
},
{
"name": "Shell",
"bytes": "6984"
}
],
"symlink_target": ""
}
|
module MonitoringProtocols
@@parsers = {}
@@builders = {}
def self.register_parser(name, parser_class)
@@parsers[name] = parser_class
end
def self.register_builder(name, builder_class)
@@builders[name] = builder_class
end
def self.get_parser(protocol)
klass = @@parsers[protocol.to_sym]
klass ? klass.new : nil
end
def self.get_builder(protocol)
klass = @@builders[protocol.to_sym]
klass ? klass.new : nil
end
end
|
{
"content_hash": "dfa34a71a87a8e3a55e96bde5baf6936",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 48,
"avg_line_length": 20.608695652173914,
"alnum_prop": 0.6476793248945147,
"repo_name": "schmurfy/monitoring_protocols",
"id": "6b9205039ff870a48443cb409ca9c9323cc42dd6",
"size": "474",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "lib/monitoring_protocols/core.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "58495"
}
],
"symlink_target": ""
}
|
"use strict";
let datafire = require('datafire');
let openapi = require('./openapi.json');
module.exports = datafire.Integration.fromOpenAPI(openapi, "azure_policyinsights_policyevents");
|
{
"content_hash": "4ec8cf2dde5a7213e22bbdf2b572cf1d",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 96,
"avg_line_length": 46.75,
"alnum_prop": 0.7700534759358288,
"repo_name": "DataFire/Integrations",
"id": "a879c487d45b137c4f9036ae2ede426e3e562378",
"size": "187",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "integrations/generated/azure_policyinsights_policyevents/index.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "18"
},
{
"name": "HTML",
"bytes": "3356"
},
{
"name": "JavaScript",
"bytes": "1174493"
},
{
"name": "Shell",
"bytes": "1753"
}
],
"symlink_target": ""
}
|
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web server when you make code changes.
config.cache_classes = false
config.chace_store=:memory_store, { expires_in: 1.hour}
# Do not eager load code on boot.
config.eager_load = false
# Show full error reports and disable caching.
config.consider_all_requests_local = true
config.action_controller.perform_caching = true
# Don't care if the mailer can't send.
config.action_mailer.raise_delivery_errors = false
# Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log
# Raise an error on page load if there are pending migrations.
config.active_record.migration_error = :page_load
# Debug mode disables concatenation and preprocessing of assets.
# This option may cause significant delays in view rendering with a large
# number of complex assets.
config.assets.debug = true
# Asset digests allow you to set far-future HTTP expiration dates on all assets,
# yet still be able to expire them through the digest params.
config.assets.digest = true
# Adds additional error checking when serving assets at runtime.
# Checks for improperly declared sprockets dependencies.
# Raises helpful error messages.
config.assets.raise_runtime_errors = true
# Raises error for missing translations
# config.action_view.raise_on_missing_translations = true
end
|
{
"content_hash": "1776f22b26f2b6834d4c3e9ec2817558",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 85,
"avg_line_length": 40.390243902439025,
"alnum_prop": 0.7602657004830918,
"repo_name": "IshidaHIRO/SDD3",
"id": "c8d8ed61d2d5df379870e76bf61ba288a597dc64",
"size": "1656",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "config/environments/development.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "7795"
},
{
"name": "CoffeeScript",
"bytes": "633"
},
{
"name": "HTML",
"bytes": "14869"
},
{
"name": "JavaScript",
"bytes": "85702"
},
{
"name": "Ruby",
"bytes": "45646"
}
],
"symlink_target": ""
}
|
FROM webratio/gvm
# Defines environment variables
ENV GROOVY_VERSION 2.4.2
# Installs Groovy
RUN /bin/bash -c "source /root/.gvm/bin/gvm-init.sh && gvm install groovy ${GROOVY_VERSION}"
ENV GROOVY_HOME /root/.gvm/groovy/current
ENV PATH $GROOVY_HOME/bin:$PATH
WORKDIR /source
ENTRYPOINT ["groovy", "-Dgrape.root=/graperoot"]
|
{
"content_hash": "912a8cb0881e7fdb86a92ee38819758a",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 92,
"avg_line_length": 27.333333333333332,
"alnum_prop": 0.7469512195121951,
"repo_name": "derdela/docker",
"id": "aca568c49b143d9aca7591878ebdf987565eb39b",
"size": "328",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "groovy/2.4.2/Dockerfile",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
}
|
package io.quarkus.vertx.http.runtime.filters;
import io.vertx.core.Handler;
import io.vertx.ext.web.Route;
import io.vertx.ext.web.RoutingContext;
/**
* Represents a Filter, i.e. a route called on every HTTP request or failure (depending on {@link #isFailureHandler()}).
* The priority attribute allows sorting the filters. Highest priority are called first.
*/
public interface Filter {
/**
* The handler called on HTTP request or failure.
* It's important that the handler call {@link RoutingContext#next()} to invoke the next filter or the user routes.
*
* @return the handler
*/
Handler<RoutingContext> getHandler();
/**
* @return the priority of the filter.
*/
int getPriority();
/**
* Whether to add {@link #getHandler()} as HTTP request handler (via {@link Route#handler(Handler)}) or
* as failure handler (via {@link Route#failureHandler(Handler)}).
*
* @return true if filter should be applied on failures rather than HTTP requests
*/
default boolean isFailureHandler() {
return false;
}
}
|
{
"content_hash": "e862107aa27a215d0f7298e6be877b82",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 120,
"avg_line_length": 30.694444444444443,
"alnum_prop": 0.6751131221719457,
"repo_name": "quarkusio/quarkus",
"id": "0a26bff30cfb0e23e3487fd643822700601e704d",
"size": "1105",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/filters/Filter.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "23342"
},
{
"name": "Batchfile",
"bytes": "13096"
},
{
"name": "CSS",
"bytes": "6685"
},
{
"name": "Dockerfile",
"bytes": "459"
},
{
"name": "FreeMarker",
"bytes": "8106"
},
{
"name": "Groovy",
"bytes": "16133"
},
{
"name": "HTML",
"bytes": "1418749"
},
{
"name": "Java",
"bytes": "38584810"
},
{
"name": "JavaScript",
"bytes": "90960"
},
{
"name": "Kotlin",
"bytes": "704351"
},
{
"name": "Mustache",
"bytes": "13191"
},
{
"name": "Scala",
"bytes": "9756"
},
{
"name": "Shell",
"bytes": "71729"
}
],
"symlink_target": ""
}
|
'use strict';
/* Services */
// Demonstrate how to register services
var appService = angular.module('app.services', []);
appService.factory("dataService", [
"$http", "$q", function($http, $q) {
var _landLords = [];
var _isInit = false;
var _isReady = function() {
return _isInit;
}
var _getLandLords = function() {
var deferred = $q.defer();
$http.get("/api/v1/landlords/")
.then(function(result) {
angular.copy(result.data, _landLords);
_isInit = true;
deferred.resolve();
},
function() {
deferred.reject();
}
);
return deferred.promise;
};
var _addLandlord = function(newLandlord) {
var deferred = $q.defer();
$http.post("/api/v1/landlords", newLandlord)
.then(function(result) {
//success
var newlyCreatedLandlord = result.data;
_landLords.splice(0, 0, newlyCreatedLandlord);
deferred.resolve(newLandlord);
},
function() {
deferred.reject();
});
return deferred.promise;
};
return {
landlord: _landLords,
getLandlords: _getLandLords,
addLandlord: _addLandlord,
isReady: _isReady,
}
}]);
|
{
"content_hash": "5ad205d9372a69ca4639a2e7fa968c12",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 70,
"avg_line_length": 26.37704918032787,
"alnum_prop": 0.4319453076444997,
"repo_name": "dpdesi/TopmoveApp",
"id": "020e709f7877c7d69fd4c81a294b2ccb89dc7e4b",
"size": "1609",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "TopMove/Web/js/services.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "188"
},
{
"name": "ActionScript",
"bytes": "15982"
},
{
"name": "C#",
"bytes": "115765"
},
{
"name": "CSS",
"bytes": "2465233"
},
{
"name": "JavaScript",
"bytes": "2119775"
},
{
"name": "PowerShell",
"bytes": "185686"
},
{
"name": "Puppet",
"bytes": "13529"
}
],
"symlink_target": ""
}
|
package org.fujion.sandbox;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.fujion.ancillary.ComponentRegistry;
import org.fujion.ancillary.IAutoWired;
import org.fujion.annotation.ComponentDefinition;
import org.fujion.annotation.EventHandler;
import org.fujion.annotation.WiredComponent;
import org.fujion.codemirror.CodeMirrorXML;
import org.fujion.codemirror.CodeMirrorXML.SchemaInfo;
import org.fujion.codemirror.CodeMirrorXML.Tag;
import org.fujion.common.MiscUtil;
import org.fujion.component.*;
import org.fujion.component.Window.Mode;
import org.fujion.event.EventUtil;
import org.fujion.model.IComponentRenderer;
import org.fujion.model.ListModel;
import org.fujion.page.PageUtil;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.core.io.Resource;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Method;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Map;
import java.util.Map.Entry;
/**
* Plugin to facilitate testing of Fujion layouts.
*/
public class MainController implements IAutoWired, ApplicationContextAware {
private static final Mode[] REPLACE_MODES = { Mode.MODAL, Mode.POPUP };
private static final Comparator<Resource> resourceComparator = (r1, r2) -> r1.getFilename().compareToIgnoreCase(r2.getFilename());
private static final IComponentRenderer<Comboitem, Resource> fujionRenderer = new IComponentRenderer<Comboitem, Resource>() {
@Override
public Comboitem render(Resource resource) {
Comboitem item = new Comboitem();
item.setData(resource);
item.setLabel(resource.getFilename());
item.setHint(getPath(resource));
return item;
}
private String getPath(Resource resource) {
try {
String[] pcs = resource.getURL().toString().split("!", 2);
if (pcs.length == 1) {
return pcs[0];
}
int i = pcs[0].lastIndexOf('/') + 1;
return pcs[0].substring(i) + ":\n\n" + pcs[1];
} catch (Exception e) {
throw MiscUtil.toUnchecked(e);
}
}
};
private static final SchemaInfo schemaInfo = new SchemaInfo();
static {
// Initializes schema info for the component tree.
Tag rootTag = schemaInfo.addTag(null);
rootTag.addChildren("fsp");
ComponentRegistry.getInstance().forEach(comp -> {
String parentTag = comp.getTag();
if (parentTag.startsWith("#")) {
return;
}
Tag tag = schemaInfo.addTag(parentTag);
rootTag.addChildren(parentTag);
for (String childTag : comp.getChildTags().keySet()) {
for (ComponentDefinition childDef : ComponentRegistry.getInstance().getMatching(childTag)) {
String cTag = childDef.getTag();
if (!cTag.startsWith("#") && childDef.isParentTag(parentTag)) {
tag.addChildren(cTag);
}
}
}
addAttributes(comp.getSetters(), tag);
addAttributes(comp.getFactoryParameters(), tag);
});
}
private static void addAttributes(Map<String, Method> methods, Tag tag) {
for (Entry<String, Method> entry : methods.entrySet()) {
Method method = entry.getValue();
int p = method == null ? -1 : method.getParameterCount();
Class<?> type = p != 1 ? null : method.getParameterTypes()[0];
String name = entry.getKey();
if (type == null || name.startsWith("#")) {
continue;
} else if (type == boolean.class || type == Boolean.class) {
tag.addAttribute(name, "true", "false");
} else if (type.isEnum()) {
Object[] members = type.getEnumConstants();
String[] values = new String[members.length];
for (int i = 0; i < members.length; i++) {
values[i] = members[i].toString().toLowerCase();
}
tag.addAttribute(name, values);
} else {
tag.addAttribute(name);
}
}
}
// Start of auto-wired section
@WiredComponent
private CodeMirrorXML editor;
@WiredComponent
private Combobox cboFujion;
@WiredComponent
private BaseComponent contentParent;
// End of auto-wired section
private Namespace contentBase;
private BaseComponent root;
private String content;
private final ListModel<Resource> model = new ListModel<>();
/**
* Find the content base component. We can't assign it an id because of potential id collisions.
*/
@Override
public void afterInitialized(BaseComponent comp) {
this.root = comp;
cboFujion.setRenderer(fujionRenderer);
cboFujion.setModel(model);
cboFujion.setVisible(model.size() > 0);
contentBase = contentParent.getFirstChild(Namespace.class);
editor.setSchemaInfo(schemaInfo);
}
/**
* Refreshes the view based on the current contents.
*/
@EventHandler("refresh")
public void refresh() {
contentBase.destroyChildren();
if (content != null && !content.isEmpty()) {
try {
EventUtil.post("modeCheck", this.root, null);
PageUtil.createPageFromContent(content, contentBase);
} catch (Exception e) {
contentBase.destroyChildren();
Label label = new Label(ExceptionUtils.getStackTrace(e));
contentBase.addChild(label);
}
}
}
/**
* Sets the focus to the editor window.
*/
@EventHandler("activate")
public void focus() {
editor.focus();
}
/**
* Check for unsupported window modes. This is done asynchronously to allow modal windows to
* also be checked.
*/
@EventHandler(value = "modeCheck", target = "^")
private void onModeCheck() {
modeCheck(contentBase);
}
/**
* Check for any window components with mode settings that need to be changed.
*
* @param comp Current component in search.
*/
private void modeCheck(BaseComponent comp) {
if (comp instanceof Window) {
Window win = (Window) comp;
if (win.isVisible() && ArrayUtils.contains(REPLACE_MODES, win.getMode())) {
win.setMode(Mode.INLINE);
}
}
for (BaseComponent child : comp.getChildren()) {
modeCheck(child);
}
}
/**
* Renders the updated fujion content in the view pane.
*/
@EventHandler(value = "click", target = "btnRenderContent")
private void onClick$btnRenderContent() {
content = editor.getValue();
refresh();
focus();
}
/**
* Clears combo box selection when content is cleared.
*/
@EventHandler(value = "click", target = "btnClearContent")
private void onClick$btnClearContent() {
editor.clear();
cboFujion.setSelectedItem(null);
cboFujion.setHint(null);
}
/**
* Clears the view pane.
*/
@EventHandler(value = "click", target = "btnClearView")
private void onClick$btnClearView() {
contentBase.destroyChildren();
focus();
}
/**
* Re-renders content in the view pane.
*/
@EventHandler(value = "click", target = "btnRefreshView")
private void onClick$btnRefreshView() {
refresh();
}
@EventHandler(value = "click", target = "btnFormatContent")
private void onClick$btnFormatContent() {
editor.format();
}
/**
* Load contents of newly selected fujion document.
*
* @throws IOException Exception on reading fujion document.
*/
@EventHandler(value = "change", target = "@cboFujion")
private void onChange$cboFujion() throws IOException {
Comboitem item = cboFujion.getSelectedItem();
cboFujion.setHint(null);
Resource resource = item == null ? null : item.getData(Resource.class);
if (resource != null) {
try (InputStream is = resource.getInputStream()) {
content = IOUtils.toString(is, StandardCharsets.UTF_8);
cboFujion.setHint(item.getHint());
editor.setValue(content);
focus();
}
}
}
/**
* Populate combo box model with all fujion documents on class path.
*/
@Override
public void setApplicationContext(ApplicationContext applicationContext) {
findResources(applicationContext, "classpath*:**/*.fsp");
findResources(applicationContext, "**/*.fsp");
model.sort(resourceComparator, true);
}
private void findResources(ApplicationContext applicationContext, String pattern) {
try {
model.addAll(Arrays.asList(applicationContext.getResources(pattern)));
} catch (IOException e) {
throw MiscUtil.toUnchecked(e);
}
}
}
|
{
"content_hash": "8dd6ae02d10fbb15dcda8ee9032ec28a",
"timestamp": "",
"source": "github",
"line_count": 300,
"max_line_length": 134,
"avg_line_length": 31.513333333333332,
"alnum_prop": 0.6065157605246456,
"repo_name": "fujion/fujion-framework",
"id": "e00e3274f736fa3e910aed1d2cf32d58a4e8ab3f",
"size": "10094",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "fujion-sandbox/src/main/java/org/fujion/sandbox/MainController.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "22117"
},
{
"name": "Groovy",
"bytes": "38"
},
{
"name": "HTML",
"bytes": "1136"
},
{
"name": "Java",
"bytes": "2838298"
},
{
"name": "JavaScript",
"bytes": "246823"
},
{
"name": "Shell",
"bytes": "520"
},
{
"name": "TypeScript",
"bytes": "6153"
}
],
"symlink_target": ""
}
|
{% extends 'base.html' %}
{% load bootstrap3 %}
{% load static from staticfiles %}
{% load django_bootstrap_breadcrumbs %}
{% load i18n %}
{% block head_title %} CFP submission is closed | {{ block.super }} {% endblock %}
{% block breadcrumbs %}
{{ block.super }}
{% breadcrumb conference.name "conference-detail" conference.slug %}
{% breadcrumb "Proposals" "proposals-list" conference.slug %}
{% breadcrumb "New" "" %}
{% endblock %}
{% block content %}
<div class="row">
<div class="col-lg-4 col-lg-offset-4 col-sm-6 col-sm-offset-3 col-xs-12 col-xs-offset-0 push-3">
<div class="form-container space-2-bottom">
<h2 class="fill-blue text-center">{% trans "CFP submission is closed" %}</h2>
<div class="pad-2 push-1-top push-2-bottom text-center">
<p>{% trans "We are no longer accepting proposals. You can prepare a session for open spaces or flash talks." %}</p>
</div>
</div>
</div>
</div>
{% endblock %}
|
{
"content_hash": "92ff6a6628f0afe945d7ff613c6bf134",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 136,
"avg_line_length": 38.55555555555556,
"alnum_prop": 0.5898174831892411,
"repo_name": "pythonindia/junction",
"id": "d01ee49ba9b5778b52fc1d0e2e05f8ab18349588",
"size": "1041",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "junction/templates/proposals/closed.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "190844"
},
{
"name": "HTML",
"bytes": "161794"
},
{
"name": "JavaScript",
"bytes": "49000"
},
{
"name": "Python",
"bytes": "379163"
},
{
"name": "Shell",
"bytes": "595"
}
],
"symlink_target": ""
}
|
"""
An interface to the excellent spglib library by Atsushi Togo
(http://spglib.sourceforge.net/) for pymatgen.
v1.0 - Now works with both ordered and disordered structure.
v2.0 - Updated for spglib 1.6.
v3.0 - pymatgen no longer ships with spglib. Instead, spglib (the python
version) is now a dependency and the SpacegroupAnalyzer merely serves
as an interface to spglib for pymatgen Structures.
"""
import copy
import itertools
import logging
import math
from collections import defaultdict
from fractions import Fraction
from math import cos, sin
import numpy as np
import spglib
from pymatgen.core.lattice import Lattice
from pymatgen.core.operations import SymmOp
from pymatgen.core.structure import Molecule, PeriodicSite, Structure
from pymatgen.symmetry.structure import SymmetrizedStructure
from pymatgen.util.coord import find_in_coord_list, pbc_diff
logger = logging.getLogger(__name__)
class SpacegroupAnalyzer:
"""
Takes a pymatgen.core.structure.Structure object and a symprec.
Uses spglib to perform various symmetry finding operations.
"""
def __init__(self, structure, symprec=0.01, angle_tolerance=5.0):
"""
Args:
structure (Structure/IStructure): Structure to find symmetry
symprec (float): Tolerance for symmetry finding. Defaults to 0.01,
which is fairly strict and works well for properly refined
structures with atoms in the proper symmetry coordinates. For
structures with slight deviations from their proper atomic
positions (e.g., structures relaxed with electronic structure
codes), a looser tolerance of 0.1 (the value used in Materials
Project) is often needed.
angle_tolerance (float): Angle tolerance for symmetry finding.
"""
self._symprec = symprec
self._angle_tol = angle_tolerance
self._structure = structure
latt = structure.lattice.matrix
positions = structure.frac_coords
unique_species = []
zs = []
magmoms = []
for species, g in itertools.groupby(structure, key=lambda s: s.species):
if species in unique_species:
ind = unique_species.index(species)
zs.extend([ind + 1] * len(tuple(g)))
else:
unique_species.append(species)
zs.extend([len(unique_species)] * len(tuple(g)))
for site in structure:
if hasattr(site, "magmom"):
magmoms.append(site.magmom)
elif site.is_ordered and hasattr(site.specie, "spin"):
magmoms.append(site.specie.spin)
else:
magmoms.append(0)
self._unique_species = unique_species
self._numbers = zs
# For now, we are setting magmom to zero.
self._cell = latt, positions, zs, magmoms
self._space_group_data = spglib.get_symmetry_dataset(
self._cell, symprec=self._symprec, angle_tolerance=angle_tolerance
)
def get_space_group_symbol(self):
"""
Get the spacegroup symbol (e.g., Pnma) for structure.
Returns:
(str): Spacegroup symbol for structure.
"""
return self._space_group_data["international"]
def get_space_group_number(self):
"""
Get the international spacegroup number (e.g., 62) for structure.
Returns:
(int): International spacegroup number for structure.
"""
return int(self._space_group_data["number"])
def get_space_group_operations(self):
"""
Get the SpacegroupOperations for the Structure.
Returns:
SpacgroupOperations object.
"""
return SpacegroupOperations(
self.get_space_group_symbol(),
self.get_space_group_number(),
self.get_symmetry_operations(),
)
def get_hall(self):
"""
Returns Hall symbol for structure.
Returns:
(str): Hall symbol
"""
return self._space_group_data["hall"]
def get_point_group_symbol(self):
"""
Get the point group associated with the structure.
Returns:
(Pointgroup): Point group for structure.
"""
rotations = self._space_group_data["rotations"]
# passing a 0-length rotations list to spglib can segfault
if len(rotations) == 0:
return "1"
return spglib.get_pointgroup(rotations)[0].strip()
def get_crystal_system(self):
"""
Get the crystal system for the structure, e.g., (triclinic,
orthorhombic, cubic, etc.).
Returns:
(str): Crystal system for structure or None if system cannot be detected.
"""
n = self._space_group_data["number"]
if 0 < n < 3:
return "triclinic"
if n < 16:
return "monoclinic"
if n < 75:
return "orthorhombic"
if n < 143:
return "tetragonal"
if n < 168:
return "trigonal"
if n < 195:
return "hexagonal"
if n < 231:
return "cubic"
raise ValueError("Invalid space group")
def get_lattice_type(self):
"""
Get the lattice for the structure, e.g., (triclinic,
orthorhombic, cubic, etc.).This is the same than the
crystal system with the exception of the hexagonal/rhombohedral
lattice
Returns:
(str): Lattice type for structure or None if type cannot be detected.
"""
n = self._space_group_data["number"]
system = self.get_crystal_system()
if n in [146, 148, 155, 160, 161, 166, 167]:
return "rhombohedral"
if system == "trigonal":
return "hexagonal"
return system
def get_symmetry_dataset(self):
"""
Returns the symmetry dataset as a dict.
Returns:
(dict): With the following properties:
number: International space group number
international: International symbol
hall: Hall symbol
transformation_matrix: Transformation matrix from lattice of
input cell to Bravais lattice L^bravais = L^original * Tmat
origin shift: Origin shift in the setting of "Bravais lattice"
rotations, translations: Rotation matrices and translation
vectors. Space group operations are obtained by
[(r,t) for r, t in zip(rotations, translations)]
wyckoffs: Wyckoff letters
"""
return self._space_group_data
def _get_symmetry(self):
"""
Get the symmetry operations associated with the structure.
Returns:
Symmetry operations as a tuple of two equal length sequences.
(rotations, translations). "rotations" is the numpy integer array
of the rotation matrices for scaled positions
"translations" gives the numpy float64 array of the translation
vectors in scaled positions.
"""
d = spglib.get_symmetry(self._cell, symprec=self._symprec, angle_tolerance=self._angle_tol)
# Sometimes spglib returns small translation vectors, e.g.
# [1e-4, 2e-4, 1e-4]
# (these are in fractional coordinates, so should be small denominator
# fractions)
trans = []
for t in d["translations"]:
trans.append([float(Fraction.from_float(c).limit_denominator(1000)) for c in t])
trans = np.array(trans)
# fractional translations of 1 are more simply 0
trans[np.abs(trans) == 1] = 0
return d["rotations"], trans
def get_symmetry_operations(self, cartesian=False):
"""
Return symmetry operations as a list of SymmOp objects.
By default returns fractional coord symmops.
But cartesian can be returned too.
Returns:
([SymmOp]): List of symmetry operations.
"""
rotation, translation = self._get_symmetry()
symmops = []
mat = self._structure.lattice.matrix.T
invmat = np.linalg.inv(mat)
for rot, trans in zip(rotation, translation):
if cartesian:
rot = np.dot(mat, np.dot(rot, invmat))
trans = np.dot(trans, self._structure.lattice.matrix)
op = SymmOp.from_rotation_and_translation(rot, trans)
symmops.append(op)
return symmops
def get_point_group_operations(self, cartesian=False):
"""
Return symmetry operations as a list of SymmOp objects.
By default returns fractional coord symmops.
But cartesian can be returned too.
Args:
cartesian (bool): Whether to return SymmOps as cartesian or
direct coordinate operations.
Returns:
([SymmOp]): List of point group symmetry operations.
"""
rotation, translation = self._get_symmetry()
symmops = []
mat = self._structure.lattice.matrix.T
invmat = np.linalg.inv(mat)
for rot in rotation:
if cartesian:
rot = np.dot(mat, np.dot(rot, invmat))
op = SymmOp.from_rotation_and_translation(rot, np.array([0, 0, 0]))
symmops.append(op)
return symmops
def get_symmetrized_structure(self):
"""
Get a symmetrized structure. A symmetrized structure is one where the
sites have been grouped into symmetrically equivalent groups.
Returns:
:class:`pymatgen.symmetry.structure.SymmetrizedStructure` object.
"""
ds = self.get_symmetry_dataset()
sg = SpacegroupOperations(
self.get_space_group_symbol(),
self.get_space_group_number(),
self.get_symmetry_operations(),
)
return SymmetrizedStructure(self._structure, sg, ds["equivalent_atoms"], ds["wyckoffs"])
def get_refined_structure(self):
"""
Get the refined structure based on detected symmetry. The refined
structure is a *conventional* cell setting with atoms moved to the
expected symmetry positions.
Returns:
Refined structure.
"""
# Atomic positions have to be specified by scaled positions for spglib.
lattice, scaled_positions, numbers = spglib.refine_cell(self._cell, self._symprec, self._angle_tol)
species = [self._unique_species[i - 1] for i in numbers]
s = Structure(lattice, species, scaled_positions)
return s.get_sorted_structure()
def find_primitive(self):
"""
Find a primitive version of the unit cell.
Returns:
A primitive cell in the input cell is searched and returned
as an Structure object. If no primitive cell is found, None is
returned.
"""
lattice, scaled_positions, numbers = spglib.find_primitive(self._cell, symprec=self._symprec)
species = [self._unique_species[i - 1] for i in numbers]
return Structure(lattice, species, scaled_positions, to_unit_cell=True).get_reduced_structure()
def get_ir_reciprocal_mesh(self, mesh=(10, 10, 10), is_shift=(0, 0, 0)):
"""
k-point mesh of the Brillouin zone generated taken into account
symmetry.The method returns the irreducible kpoints of the mesh
and their weights
Args:
mesh (3x1 array): The number of kpoint for the mesh needed in
each direction
is_shift (3x1 array): Whether to shift the kpoint grid. (1, 1,
1) means all points are shifted by 0.5, 0.5, 0.5.
Returns:
A list of irreducible kpoints and their weights as a list of
tuples [(ir_kpoint, weight)], with ir_kpoint given
in fractional coordinates
"""
shift = np.array([1 if i else 0 for i in is_shift])
mapping, grid = spglib.get_ir_reciprocal_mesh(np.array(mesh), self._cell, is_shift=shift, symprec=self._symprec)
results = []
for i, count in zip(*np.unique(mapping, return_counts=True)):
results.append(((grid[i] + shift * (0.5, 0.5, 0.5)) / mesh, count))
return results
def get_conventional_to_primitive_transformation_matrix(self, international_monoclinic=True):
"""
Gives the transformation matrix to transform a conventional
unit cell to a primitive cell according to certain standards
the standards are defined in Setyawan, W., & Curtarolo, S. (2010).
High-throughput electronic band structure calculations:
Challenges and tools. Computational Materials Science,
49(2), 299-312. doi:10.1016/j.commatsci.2010.05.010
Returns:
Transformation matrix to go from conventional to primitive cell
"""
conv = self.get_conventional_standard_structure(international_monoclinic=international_monoclinic)
lattice = self.get_lattice_type()
if "P" in self.get_space_group_symbol() or lattice == "hexagonal":
return np.eye(3)
if lattice == "rhombohedral":
# check if the conventional representation is hexagonal or
# rhombohedral
lengths = conv.lattice.lengths
if abs(lengths[0] - lengths[2]) < 0.0001:
transf = np.eye
else:
transf = np.array([[-1, 1, 1], [2, 1, 1], [-1, -2, 1]], dtype=np.float_) / 3
elif "I" in self.get_space_group_symbol():
transf = np.array([[-1, 1, 1], [1, -1, 1], [1, 1, -1]], dtype=np.float_) / 2
elif "F" in self.get_space_group_symbol():
transf = np.array([[0, 1, 1], [1, 0, 1], [1, 1, 0]], dtype=np.float_) / 2
elif "C" in self.get_space_group_symbol() or "A" in self.get_space_group_symbol():
if self.get_crystal_system() == "monoclinic":
transf = np.array([[1, 1, 0], [-1, 1, 0], [0, 0, 2]], dtype=np.float_) / 2
else:
transf = np.array([[1, -1, 0], [1, 1, 0], [0, 0, 2]], dtype=np.float_) / 2
else:
transf = np.eye(3)
return transf
def get_primitive_standard_structure(self, international_monoclinic=True):
"""
Gives a structure with a primitive cell according to certain standards
the standards are defined in Setyawan, W., & Curtarolo, S. (2010).
High-throughput electronic band structure calculations:
Challenges and tools. Computational Materials Science,
49(2), 299-312. doi:10.1016/j.commatsci.2010.05.010
Returns:
The structure in a primitive standardized cell
"""
conv = self.get_conventional_standard_structure(international_monoclinic=international_monoclinic)
lattice = self.get_lattice_type()
if "P" in self.get_space_group_symbol() or lattice == "hexagonal":
return conv
transf = self.get_conventional_to_primitive_transformation_matrix(
international_monoclinic=international_monoclinic
)
new_sites = []
latt = Lattice(np.dot(transf, conv.lattice.matrix))
for s in conv:
new_s = PeriodicSite(
s.specie,
s.coords,
latt,
to_unit_cell=True,
coords_are_cartesian=True,
properties=s.properties,
)
if not any(map(new_s.is_periodic_image, new_sites)):
new_sites.append(new_s)
if lattice == "rhombohedral":
prim = Structure.from_sites(new_sites)
lengths = prim.lattice.lengths
angles = prim.lattice.angles
a = lengths[0]
alpha = math.pi * angles[0] / 180
new_matrix = [
[a * cos(alpha / 2), -a * sin(alpha / 2), 0],
[a * cos(alpha / 2), a * sin(alpha / 2), 0],
[
a * cos(alpha) / cos(alpha / 2),
0,
a * math.sqrt(1 - (cos(alpha) ** 2 / (cos(alpha / 2) ** 2))),
],
]
new_sites = []
latt = Lattice(new_matrix)
for s in prim:
new_s = PeriodicSite(
s.specie,
s.frac_coords,
latt,
to_unit_cell=True,
properties=s.properties,
)
if not any(map(new_s.is_periodic_image, new_sites)):
new_sites.append(new_s)
return Structure.from_sites(new_sites)
return Structure.from_sites(new_sites)
def get_conventional_standard_structure(self, international_monoclinic=True):
"""
Gives a structure with a conventional cell according to certain
standards. The standards are defined in Setyawan, W., & Curtarolo,
S. (2010). High-throughput electronic band structure calculations:
Challenges and tools. Computational Materials Science,
49(2), 299-312. doi:10.1016/j.commatsci.2010.05.010
They basically enforce as much as possible
norm(a1)<norm(a2)<norm(a3). NB This is not necessarily the same as the
standard settings within the International Tables of Crystallography,
for which get_refined_structure should be used instead.
Returns:
The structure in a conventional standardized cell
"""
tol = 1e-5
struct = self.get_refined_structure()
latt = struct.lattice
latt_type = self.get_lattice_type()
sorted_lengths = sorted(latt.abc)
sorted_dic = sorted(
[{"vec": latt.matrix[i], "length": latt.abc[i], "orig_index": i} for i in [0, 1, 2]],
key=lambda k: k["length"],
)
if latt_type in ("orthorhombic", "cubic"):
# you want to keep the c axis where it is
# to keep the C- settings
transf = np.zeros(shape=(3, 3))
if self.get_space_group_symbol().startswith("C"):
transf[2] = [0, 0, 1]
a, b = sorted(latt.abc[:2])
sorted_dic = sorted(
[{"vec": latt.matrix[i], "length": latt.abc[i], "orig_index": i} for i in [0, 1]],
key=lambda k: k["length"],
)
for i in range(2):
transf[i][sorted_dic[i]["orig_index"]] = 1
c = latt.abc[2]
elif self.get_space_group_symbol().startswith(
"A"
): # change to C-centering to match Setyawan/Curtarolo convention
transf[2] = [1, 0, 0]
a, b = sorted(latt.abc[1:])
sorted_dic = sorted(
[{"vec": latt.matrix[i], "length": latt.abc[i], "orig_index": i} for i in [1, 2]],
key=lambda k: k["length"],
)
for i in range(2):
transf[i][sorted_dic[i]["orig_index"]] = 1
c = latt.abc[0]
else:
for i, d in enumerate(sorted_dic):
transf[i][d["orig_index"]] = 1
a, b, c = sorted_lengths
latt = Lattice.orthorhombic(a, b, c)
elif latt_type == "tetragonal":
# find the "a" vectors
# it is basically the vector repeated two times
transf = np.zeros(shape=(3, 3))
a, b, c = sorted_lengths
for i, d in enumerate(sorted_dic):
transf[i][d["orig_index"]] = 1
if abs(b - c) < tol < abs(a - c):
a, c = c, a
transf = np.dot([[0, 0, 1], [0, 1, 0], [1, 0, 0]], transf)
latt = Lattice.tetragonal(a, c)
elif latt_type in ("hexagonal", "rhombohedral"):
# for the conventional cell representation,
# we allways show the rhombohedral lattices as hexagonal
# check first if we have the refined structure shows a rhombohedral
# cell
# if so, make a supercell
a, b, c = latt.abc
if np.all(np.abs([a - b, c - b, a - c]) < 0.001):
struct.make_supercell(((1, -1, 0), (0, 1, -1), (1, 1, 1)))
a, b, c = sorted(struct.lattice.abc)
if abs(b - c) < 0.001:
a, c = c, a
new_matrix = [
[a / 2, -a * math.sqrt(3) / 2, 0],
[a / 2, a * math.sqrt(3) / 2, 0],
[0, 0, c],
]
latt = Lattice(new_matrix)
transf = np.eye(3, 3)
elif latt_type == "monoclinic":
# You want to keep the c axis where it is to keep the C- settings
if self.get_space_group_operations().int_symbol.startswith("C"):
transf = np.zeros(shape=(3, 3))
transf[2] = [0, 0, 1]
sorted_dic = sorted(
[{"vec": latt.matrix[i], "length": latt.abc[i], "orig_index": i} for i in [0, 1]],
key=lambda k: k["length"],
)
a = sorted_dic[0]["length"]
b = sorted_dic[1]["length"]
c = latt.abc[2]
new_matrix = None
for t in itertools.permutations(list(range(2)), 2):
m = latt.matrix
latt2 = Lattice([m[t[0]], m[t[1]], m[2]])
lengths = latt2.lengths
angles = latt2.angles
if angles[0] > 90:
# if the angle is > 90 we invert a and b to get
# an angle < 90
a, b, c, alpha, beta, gamma = Lattice([-m[t[0]], -m[t[1]], m[2]]).parameters
transf = np.zeros(shape=(3, 3))
transf[0][t[0]] = -1
transf[1][t[1]] = -1
transf[2][2] = 1
alpha = math.pi * alpha / 180
new_matrix = [
[a, 0, 0],
[0, b, 0],
[0, c * cos(alpha), c * sin(alpha)],
]
continue
if angles[0] < 90:
transf = np.zeros(shape=(3, 3))
transf[0][t[0]] = 1
transf[1][t[1]] = 1
transf[2][2] = 1
a, b, c = lengths
alpha = math.pi * angles[0] / 180
new_matrix = [
[a, 0, 0],
[0, b, 0],
[0, c * cos(alpha), c * sin(alpha)],
]
if new_matrix is None:
# this if is to treat the case
# where alpha==90 (but we still have a monoclinic sg
new_matrix = [[a, 0, 0], [0, b, 0], [0, 0, c]]
transf = np.zeros(shape=(3, 3))
transf[2] = [0, 0, 1] # see issue #1929
for i, d in enumerate(sorted_dic):
transf[i][d["orig_index"]] = 1
# if not C-setting
else:
# try all permutations of the axis
# keep the ones with the non-90 angle=alpha
# and b<c
new_matrix = None
for t in itertools.permutations(list(range(3)), 3):
m = latt.matrix
a, b, c, alpha, beta, gamma = Lattice([m[t[0]], m[t[1]], m[t[2]]]).parameters
if alpha > 90 and b < c:
a, b, c, alpha, beta, gamma = Lattice([-m[t[0]], -m[t[1]], m[t[2]]]).parameters
transf = np.zeros(shape=(3, 3))
transf[0][t[0]] = -1
transf[1][t[1]] = -1
transf[2][t[2]] = 1
alpha = math.pi * alpha / 180
new_matrix = [
[a, 0, 0],
[0, b, 0],
[0, c * cos(alpha), c * sin(alpha)],
]
continue
if alpha < 90 and b < c:
transf = np.zeros(shape=(3, 3))
transf[0][t[0]] = 1
transf[1][t[1]] = 1
transf[2][t[2]] = 1
alpha = math.pi * alpha / 180
new_matrix = [
[a, 0, 0],
[0, b, 0],
[0, c * cos(alpha), c * sin(alpha)],
]
if new_matrix is None:
# this if is to treat the case
# where alpha==90 (but we still have a monoclinic sg
new_matrix = [
[sorted_lengths[0], 0, 0],
[0, sorted_lengths[1], 0],
[0, 0, sorted_lengths[2]],
]
transf = np.zeros(shape=(3, 3))
for i, d in enumerate(sorted_dic):
transf[i][d["orig_index"]] = 1
if international_monoclinic:
# The above code makes alpha the non-right angle.
# The following will convert to proper international convention
# that beta is the non-right angle.
op = [[0, 1, 0], [1, 0, 0], [0, 0, -1]]
transf = np.dot(op, transf)
new_matrix = np.dot(op, new_matrix)
beta = Lattice(new_matrix).beta
if beta < 90:
op = [[-1, 0, 0], [0, -1, 0], [0, 0, 1]]
transf = np.dot(op, transf)
new_matrix = np.dot(op, new_matrix)
latt = Lattice(new_matrix)
elif latt_type == "triclinic":
# we use a LLL Minkowski-like reduction for the triclinic cells
struct = struct.get_reduced_structure("LLL")
latt = struct.lattice
a, b, c = latt.lengths
alpha, beta, gamma = [math.pi * i / 180 for i in latt.angles]
new_matrix = None
test_matrix = [
[a, 0, 0],
[b * cos(gamma), b * sin(gamma), 0.0],
[
c * cos(beta),
c * (cos(alpha) - cos(beta) * cos(gamma)) / sin(gamma),
c
* math.sqrt(
sin(gamma) ** 2 - cos(alpha) ** 2 - cos(beta) ** 2 + 2 * cos(alpha) * cos(beta) * cos(gamma)
)
/ sin(gamma),
],
]
def is_all_acute_or_obtuse(m):
recp_angles = np.array(Lattice(m).reciprocal_lattice.angles)
return np.all(recp_angles <= 90) or np.all(recp_angles > 90)
if is_all_acute_or_obtuse(test_matrix):
transf = np.eye(3)
new_matrix = test_matrix
test_matrix = [
[-a, 0, 0],
[b * cos(gamma), b * sin(gamma), 0.0],
[
-c * cos(beta),
-c * (cos(alpha) - cos(beta) * cos(gamma)) / sin(gamma),
-c
* math.sqrt(
sin(gamma) ** 2 - cos(alpha) ** 2 - cos(beta) ** 2 + 2 * cos(alpha) * cos(beta) * cos(gamma)
)
/ sin(gamma),
],
]
if is_all_acute_or_obtuse(test_matrix):
transf = [[-1, 0, 0], [0, 1, 0], [0, 0, -1]]
new_matrix = test_matrix
test_matrix = [
[-a, 0, 0],
[-b * cos(gamma), -b * sin(gamma), 0.0],
[
c * cos(beta),
c * (cos(alpha) - cos(beta) * cos(gamma)) / sin(gamma),
c
* math.sqrt(
sin(gamma) ** 2 - cos(alpha) ** 2 - cos(beta) ** 2 + 2 * cos(alpha) * cos(beta) * cos(gamma)
)
/ sin(gamma),
],
]
if is_all_acute_or_obtuse(test_matrix):
transf = [[-1, 0, 0], [0, -1, 0], [0, 0, 1]]
new_matrix = test_matrix
test_matrix = [
[a, 0, 0],
[-b * cos(gamma), -b * sin(gamma), 0.0],
[
-c * cos(beta),
-c * (cos(alpha) - cos(beta) * cos(gamma)) / sin(gamma),
-c
* math.sqrt(
sin(gamma) ** 2 - cos(alpha) ** 2 - cos(beta) ** 2 + 2 * cos(alpha) * cos(beta) * cos(gamma)
)
/ sin(gamma),
],
]
if is_all_acute_or_obtuse(test_matrix):
transf = [[1, 0, 0], [0, -1, 0], [0, 0, -1]]
new_matrix = test_matrix
latt = Lattice(new_matrix)
new_coords = np.dot(transf, np.transpose(struct.frac_coords)).T
new_struct = Structure(
latt,
struct.species_and_occu,
new_coords,
site_properties=struct.site_properties,
to_unit_cell=True,
)
return new_struct.get_sorted_structure()
def get_kpoint_weights(self, kpoints, atol=1e-5):
"""
Calculate the weights for a list of kpoints.
Args:
kpoints (Sequence): Sequence of kpoints. np.arrays is fine. Note
that the code does not check that the list of kpoints
provided does not contain duplicates.
atol (float): Tolerance for fractional coordinates comparisons.
Returns:
List of weights, in the SAME order as kpoints.
"""
kpts = np.array(kpoints)
shift = []
mesh = []
for i in range(3):
nonzero = [i for i in kpts[:, i] if abs(i) > 1e-5]
if len(nonzero) != len(kpts):
# gamma centered
if not nonzero:
mesh.append(1)
else:
m = np.abs(np.round(1 / np.array(nonzero)))
mesh.append(int(max(m)))
shift.append(0)
else:
# Monk
m = np.abs(np.round(0.5 / np.array(nonzero)))
mesh.append(int(max(m)))
shift.append(1)
mapping, grid = spglib.get_ir_reciprocal_mesh(np.array(mesh), self._cell, is_shift=shift, symprec=self._symprec)
mapping = list(mapping)
grid = (np.array(grid) + np.array(shift) * (0.5, 0.5, 0.5)) / mesh
weights = []
mapped = defaultdict(int)
for k in kpoints:
for i, g in enumerate(grid):
if np.allclose(pbc_diff(k, g), (0, 0, 0), atol=atol):
mapped[tuple(g)] += 1
weights.append(mapping.count(mapping[i]))
break
if (len(mapped) != len(set(mapping))) or (not all(v == 1 for v in mapped.values())):
raise ValueError("Unable to find 1:1 corresponding between input " "kpoints and irreducible grid!")
return [w / sum(weights) for w in weights]
def is_laue(self):
"""
Check if the point group of the structure
has Laue symmetry (centrosymmetry)
"""
laue = [
"-1",
"2/m",
"mmm",
"4/m",
"4/mmm",
"-3",
"-3m",
"6/m",
"6/mmm",
"m-3",
"m-3m",
]
return str(self.get_point_group_symbol()) in laue
class PointGroupAnalyzer:
"""
A class to analyze the point group of a molecule. The general outline of
the algorithm is as follows:
1. Center the molecule around its center of mass.
2. Compute the inertia tensor and the eigenvalues and eigenvectors.
3. Handle the symmetry detection based on eigenvalues.
a. Linear molecules have one zero eigenvalue. Possible symmetry
operations are C*v or D*v
b. Asymetric top molecules have all different eigenvalues. The
maximum rotational symmetry in such molecules is 2
c. Symmetric top molecules have 1 unique eigenvalue, which gives a
unique rotation axis. All axial point groups are possible
except the cubic groups (T & O) and I.
d. Spherical top molecules have all three eigenvalues equal. They
have the rare T, O or I point groups.
.. attribute:: sch_symbol
Schoenflies symbol of the detected point group.
"""
inversion_op = SymmOp.inversion()
def __init__(self, mol, tolerance=0.3, eigen_tolerance=0.01, matrix_tol=0.1):
"""
The default settings are usually sufficient.
Args:
mol (Molecule): Molecule to determine point group for.
tolerance (float): Distance tolerance to consider sites as
symmetrically equivalent. Defaults to 0.3 Angstrom.
eigen_tolerance (float): Tolerance to compare eigen values of
the inertia tensor. Defaults to 0.01.
matrix_tol (float): Tolerance used to generate the full set of
symmetry operations of the point group.
"""
self.mol = mol
self.centered_mol = mol.get_centered_molecule()
self.tol = tolerance
self.eig_tol = eigen_tolerance
self.mat_tol = matrix_tol
self._analyze()
if self.sch_symbol in ["C1v", "C1h"]:
self.sch_symbol = "Cs"
def _analyze(self):
if len(self.centered_mol) == 1:
self.sch_symbol = "Kh"
else:
inertia_tensor = np.zeros((3, 3))
total_inertia = 0
for site in self.centered_mol:
c = site.coords
wt = site.species.weight
for i in range(3):
inertia_tensor[i, i] += wt * (c[(i + 1) % 3] ** 2 + c[(i + 2) % 3] ** 2)
for i, j in [(0, 1), (1, 2), (0, 2)]:
inertia_tensor[i, j] += -wt * c[i] * c[j]
inertia_tensor[j, i] += -wt * c[j] * c[i]
total_inertia += wt * np.dot(c, c)
# Normalize the inertia tensor so that it does not scale with size
# of the system. This mitigates the problem of choosing a proper
# comparison tolerance for the eigenvalues.
inertia_tensor /= total_inertia
eigvals, eigvecs = np.linalg.eig(inertia_tensor)
self.principal_axes = eigvecs.T
self.eigvals = eigvals
v1, v2, v3 = eigvals
eig_zero = abs(v1 * v2 * v3) < self.eig_tol
eig_all_same = abs(v1 - v2) < self.eig_tol and abs(v1 - v3) < self.eig_tol
eig_all_diff = abs(v1 - v2) > self.eig_tol and abs(v1 - v3) > self.eig_tol and abs(v2 - v3) > self.eig_tol
self.rot_sym = []
self.symmops = [SymmOp(np.eye(4))]
if eig_zero:
logger.debug("Linear molecule detected")
self._proc_linear()
elif eig_all_same:
logger.debug("Spherical top molecule detected")
self._proc_sph_top()
elif eig_all_diff:
logger.debug("Asymmetric top molecule detected")
self._proc_asym_top()
else:
logger.debug("Symmetric top molecule detected")
self._proc_sym_top()
def _proc_linear(self):
if self.is_valid_op(PointGroupAnalyzer.inversion_op):
self.sch_symbol = "D*h"
self.symmops.append(PointGroupAnalyzer.inversion_op)
else:
self.sch_symbol = "C*v"
def _proc_asym_top(self):
"""
Handles assymetric top molecules, which cannot contain rotational
symmetry larger than 2.
"""
self._check_R2_axes_asym()
if len(self.rot_sym) == 0:
logger.debug("No rotation symmetries detected.")
self._proc_no_rot_sym()
elif len(self.rot_sym) == 3:
logger.debug("Dihedral group detected.")
self._proc_dihedral()
else:
logger.debug("Cyclic group detected.")
self._proc_cyclic()
def _proc_sym_top(self):
"""
Handles symetric top molecules which has one unique eigenvalue whose
corresponding principal axis is a unique rotational axis. More complex
handling required to look for R2 axes perpendicular to this unique
axis.
"""
if abs(self.eigvals[0] - self.eigvals[1]) < self.eig_tol:
ind = 2
elif abs(self.eigvals[1] - self.eigvals[2]) < self.eig_tol:
ind = 0
else:
ind = 1
logger.debug("Eigenvalues = %s." % self.eigvals)
unique_axis = self.principal_axes[ind]
self._check_rot_sym(unique_axis)
logger.debug("Rotation symmetries = %s" % self.rot_sym)
if len(self.rot_sym) > 0:
self._check_perpendicular_r2_axis(unique_axis)
if len(self.rot_sym) >= 2:
self._proc_dihedral()
elif len(self.rot_sym) == 1:
self._proc_cyclic()
else:
self._proc_no_rot_sym()
def _proc_no_rot_sym(self):
"""
Handles molecules with no rotational symmetry. Only possible point
groups are C1, Cs and Ci.
"""
self.sch_symbol = "C1"
if self.is_valid_op(PointGroupAnalyzer.inversion_op):
self.sch_symbol = "Ci"
self.symmops.append(PointGroupAnalyzer.inversion_op)
else:
for v in self.principal_axes:
mirror_type = self._find_mirror(v)
if not mirror_type == "":
self.sch_symbol = "Cs"
break
def _proc_cyclic(self):
"""
Handles cyclic group molecules.
"""
main_axis, rot = max(self.rot_sym, key=lambda v: v[1])
self.sch_symbol = "C{}".format(rot)
mirror_type = self._find_mirror(main_axis)
if mirror_type == "h":
self.sch_symbol += "h"
elif mirror_type == "v":
self.sch_symbol += "v"
elif mirror_type == "":
if self.is_valid_op(SymmOp.rotoreflection(main_axis, angle=180 / rot)):
self.sch_symbol = "S{}".format(2 * rot)
def _proc_dihedral(self):
"""
Handles dihedral group molecules, i.e those with intersecting R2 axes
and a main axis.
"""
main_axis, rot = max(self.rot_sym, key=lambda v: v[1])
self.sch_symbol = "D{}".format(rot)
mirror_type = self._find_mirror(main_axis)
if mirror_type == "h":
self.sch_symbol += "h"
elif not mirror_type == "":
self.sch_symbol += "d"
def _check_R2_axes_asym(self):
"""
Test for 2-fold rotation along the principal axes. Used to handle
asymetric top molecules.
"""
for v in self.principal_axes:
op = SymmOp.from_axis_angle_and_translation(v, 180)
if self.is_valid_op(op):
self.symmops.append(op)
self.rot_sym.append((v, 2))
def _find_mirror(self, axis):
"""
Looks for mirror symmetry of specified type about axis. Possible
types are "h" or "vd". Horizontal (h) mirrors are perpendicular to
the axis while vertical (v) or diagonal (d) mirrors are parallel. v
mirrors has atoms lying on the mirror plane while d mirrors do
not.
"""
mirror_type = ""
# First test whether the axis itself is the normal to a mirror plane.
if self.is_valid_op(SymmOp.reflection(axis)):
self.symmops.append(SymmOp.reflection(axis))
mirror_type = "h"
else:
# Iterate through all pairs of atoms to find mirror
for s1, s2 in itertools.combinations(self.centered_mol, 2):
if s1.species == s2.species:
normal = s1.coords - s2.coords
if np.dot(normal, axis) < self.tol:
op = SymmOp.reflection(normal)
if self.is_valid_op(op):
self.symmops.append(op)
if len(self.rot_sym) > 1:
mirror_type = "d"
for v, r in self.rot_sym:
if np.linalg.norm(v - axis) >= self.tol:
if np.dot(v, normal) < self.tol:
mirror_type = "v"
break
else:
mirror_type = "v"
break
return mirror_type
def _get_smallest_set_not_on_axis(self, axis):
"""
Returns the smallest list of atoms with the same species and
distance from origin AND does not lie on the specified axis. This
maximal set limits the possible rotational symmetry operations,
since atoms lying on a test axis is irrelevant in testing rotational
symmetryOperations.
"""
def not_on_axis(site):
v = np.cross(site.coords, axis)
return np.linalg.norm(v) > self.tol
valid_sets = []
origin_site, dist_el_sites = cluster_sites(self.centered_mol, self.tol)
for test_set in dist_el_sites.values():
valid_set = list(filter(not_on_axis, test_set))
if len(valid_set) > 0:
valid_sets.append(valid_set)
return min(valid_sets, key=lambda s: len(s))
def _check_rot_sym(self, axis):
"""
Determines the rotational symmetry about supplied axis. Used only for
symmetric top molecules which has possible rotational symmetry
operations > 2.
"""
min_set = self._get_smallest_set_not_on_axis(axis)
max_sym = len(min_set)
for i in range(max_sym, 0, -1):
if max_sym % i != 0:
continue
op = SymmOp.from_axis_angle_and_translation(axis, 360 / i)
rotvalid = self.is_valid_op(op)
if rotvalid:
self.symmops.append(op)
self.rot_sym.append((axis, i))
return i
return 1
def _check_perpendicular_r2_axis(self, axis):
"""
Checks for R2 axes perpendicular to unique axis. For handling
symmetric top molecules.
"""
min_set = self._get_smallest_set_not_on_axis(axis)
for s1, s2 in itertools.combinations(min_set, 2):
test_axis = np.cross(s1.coords - s2.coords, axis)
if np.linalg.norm(test_axis) > self.tol:
op = SymmOp.from_axis_angle_and_translation(test_axis, 180)
r2present = self.is_valid_op(op)
if r2present:
self.symmops.append(op)
self.rot_sym.append((test_axis, 2))
return True
return None
def _proc_sph_top(self):
"""
Handles Sperhical Top Molecules, which belongs to the T, O or I point
groups.
"""
self._find_spherical_axes()
if len(self.rot_sym) == 0:
logger.debug("Accidental speherical top!")
self._proc_sym_top()
main_axis, rot = max(self.rot_sym, key=lambda v: v[1])
if rot < 3:
logger.debug("Accidental speherical top!")
self._proc_sym_top()
elif rot == 3:
mirror_type = self._find_mirror(main_axis)
if mirror_type != "":
if self.is_valid_op(PointGroupAnalyzer.inversion_op):
self.symmops.append(PointGroupAnalyzer.inversion_op)
self.sch_symbol = "Th"
else:
self.sch_symbol = "Td"
else:
self.sch_symbol = "T"
elif rot == 4:
if self.is_valid_op(PointGroupAnalyzer.inversion_op):
self.symmops.append(PointGroupAnalyzer.inversion_op)
self.sch_symbol = "Oh"
else:
self.sch_symbol = "O"
elif rot == 5:
if self.is_valid_op(PointGroupAnalyzer.inversion_op):
self.symmops.append(PointGroupAnalyzer.inversion_op)
self.sch_symbol = "Ih"
else:
self.sch_symbol = "I"
def _find_spherical_axes(self):
"""
Looks for R5, R4, R3 and R2 axes in spherical top molecules. Point
group T molecules have only one unique 3-fold and one unique 2-fold
axis. O molecules have one unique 4, 3 and 2-fold axes. I molecules
have a unique 5-fold axis.
"""
rot_present = defaultdict(bool)
origin_site, dist_el_sites = cluster_sites(self.centered_mol, self.tol)
test_set = min(dist_el_sites.values(), key=lambda s: len(s))
coords = [s.coords for s in test_set]
for c1, c2, c3 in itertools.combinations(coords, 3):
for cc1, cc2 in itertools.combinations([c1, c2, c3], 2):
if not rot_present[2]:
test_axis = cc1 + cc2
if np.linalg.norm(test_axis) > self.tol:
op = SymmOp.from_axis_angle_and_translation(test_axis, 180)
rot_present[2] = self.is_valid_op(op)
if rot_present[2]:
self.symmops.append(op)
self.rot_sym.append((test_axis, 2))
test_axis = np.cross(c2 - c1, c3 - c1)
if np.linalg.norm(test_axis) > self.tol:
for r in (3, 4, 5):
if not rot_present[r]:
op = SymmOp.from_axis_angle_and_translation(test_axis, 360 / r)
rot_present[r] = self.is_valid_op(op)
if rot_present[r]:
self.symmops.append(op)
self.rot_sym.append((test_axis, r))
break
if rot_present[2] and rot_present[3] and (rot_present[4] or rot_present[5]):
break
def get_pointgroup(self):
"""
Returns a PointGroup object for the molecule.
"""
return PointGroupOperations(self.sch_symbol, self.symmops, self.mat_tol)
def get_symmetry_operations(self):
"""
Return symmetry operations as a list of SymmOp objects.
Returns Cartesian coord symmops.
Returns:
([SymmOp]): List of symmetry operations.
"""
return generate_full_symmops(self.symmops, self.tol)
def is_valid_op(self, symmop):
"""
Check if a particular symmetry operation is a valid symmetry operation
for a molecule, i.e., the operation maps all atoms to another
equivalent atom.
Args:
symmop (SymmOp): Symmetry operation to test.
Returns:
(bool): Whether SymmOp is valid for Molecule.
"""
coords = self.centered_mol.cart_coords
for site in self.centered_mol:
coord = symmop.operate(site.coords)
ind = find_in_coord_list(coords, coord, self.tol)
if not (len(ind) == 1 and self.centered_mol[ind[0]].species == site.species):
return False
return True
def _get_eq_sets(self):
"""
Calculates the dictionary for mapping equivalent atoms onto each other.
Args:
None
Returns:
dict: The returned dictionary has two possible keys:
``eq_sets``:
A dictionary of indices mapping to sets of indices,
each key maps to indices of all equivalent atoms.
The keys are guaranteed to be not equivalent.
``sym_ops``:
Twofold nested dictionary.
``operations[i][j]`` gives the symmetry operation
that maps atom ``i`` unto ``j``.
"""
UNIT = np.eye(3)
eq_sets, operations = defaultdict(set), defaultdict(dict)
symm_ops = [op.rotation_matrix for op in generate_full_symmops(self.symmops, self.tol)]
def get_clustered_indices():
indices = cluster_sites(self.centered_mol, self.tol, give_only_index=True)
out = list(indices[1].values())
if indices[0] is not None:
out.append([indices[0]])
return out
for index in get_clustered_indices():
sites = self.centered_mol.cart_coords[index]
for i, reference in zip(index, sites):
for op in symm_ops:
rotated = np.dot(op, sites.T).T
matched_indices = find_in_coord_list(rotated, reference, self.tol)
matched_indices = {dict(enumerate(index))[i] for i in matched_indices}
eq_sets[i] |= matched_indices
if i not in operations:
operations[i] = {j: op.T if j != i else UNIT for j in matched_indices}
else:
for j in matched_indices:
if j not in operations[i]:
operations[i][j] = op.T if j != i else UNIT
for j in matched_indices:
if j not in operations:
operations[j] = {i: op if j != i else UNIT}
elif i not in operations[j]:
operations[j][i] = op if j != i else UNIT
return {"eq_sets": eq_sets, "sym_ops": operations}
@staticmethod
def _combine_eq_sets(eq_sets, operations):
"""Combines the dicts of _get_equivalent_atom_dicts into one
Args:
eq_sets (dict)
operations (dict)
Returns:
dict: The returned dictionary has two possible keys:
``eq_sets``:
A dictionary of indices mapping to sets of indices,
each key maps to indices of all equivalent atoms.
The keys are guaranteed to be not equivalent.
``sym_ops``:
Twofold nested dictionary.
``operations[i][j]`` gives the symmetry operation
that maps atom ``i`` unto ``j``.
"""
UNIT = np.eye(3)
def all_equivalent_atoms_of_i(i, eq_sets, ops):
"""WORKS INPLACE on operations"""
visited = set([i])
tmp_eq_sets = {j: (eq_sets[j] - visited) for j in eq_sets[i]}
while tmp_eq_sets:
new_tmp_eq_sets = {}
for j in tmp_eq_sets:
if j in visited:
continue
visited.add(j)
for k in tmp_eq_sets[j]:
new_tmp_eq_sets[k] = eq_sets[k] - visited
if i not in ops[k]:
ops[k][i] = np.dot(ops[j][i], ops[k][j]) if k != i else UNIT
ops[i][k] = ops[k][i].T
tmp_eq_sets = new_tmp_eq_sets
return visited, ops
eq_sets = copy.deepcopy(eq_sets)
ops = copy.deepcopy(operations)
to_be_deleted = set()
for i in eq_sets:
if i in to_be_deleted:
continue
visited, ops = all_equivalent_atoms_of_i(i, eq_sets, ops)
to_be_deleted |= visited - {i}
for k in to_be_deleted:
eq_sets.pop(k, None)
return {"eq_sets": eq_sets, "sym_ops": ops}
def get_equivalent_atoms(self):
"""Returns sets of equivalent atoms with symmetry operations
Args:
None
Returns:
dict: The returned dictionary has two possible keys:
``eq_sets``:
A dictionary of indices mapping to sets of indices,
each key maps to indices of all equivalent atoms.
The keys are guaranteed to be not equivalent.
``sym_ops``:
Twofold nested dictionary.
``operations[i][j]`` gives the symmetry operation
that maps atom ``i`` unto ``j``.
"""
eq = self._get_eq_sets()
return self._combine_eq_sets(eq["eq_sets"], eq["sym_ops"])
def symmetrize_molecule(self):
"""Returns a symmetrized molecule
The equivalent atoms obtained via
:meth:`~pymatgen.symmetry.analyzer.PointGroupAnalyzer.get_equivalent_atoms`
are rotated, mirrored... unto one position.
Then the average position is calculated.
The average position is rotated, mirrored... back with the inverse
of the previous symmetry operations, which gives the
symmetrized molecule
Args:
None
Returns:
dict: The returned dictionary has three possible keys:
``sym_mol``:
A symmetrized molecule instance.
``eq_sets``:
A dictionary of indices mapping to sets of indices,
each key maps to indices of all equivalent atoms.
The keys are guaranteed to be not equivalent.
``sym_ops``:
Twofold nested dictionary.
``operations[i][j]`` gives the symmetry operation
that maps atom ``i`` unto ``j``.
"""
eq = self.get_equivalent_atoms()
eq_sets, ops = eq["eq_sets"], eq["sym_ops"]
coords = self.centered_mol.cart_coords.copy()
for i, eq_indices in eq_sets.items():
for j in eq_indices:
coords[j] = np.dot(ops[j][i], coords[j])
coords[i] = np.mean(coords[list(eq_indices)], axis=0)
for j in eq_indices:
if j == i:
continue
coords[j] = np.dot(ops[i][j], coords[i])
coords[j] = np.dot(ops[i][j], coords[i])
molecule = Molecule(species=self.centered_mol.species_and_occu, coords=coords)
return {"sym_mol": molecule, "eq_sets": eq_sets, "sym_ops": ops}
def iterative_symmetrize(mol, max_n=10, tolerance=0.3, epsilon=1e-2):
"""Returns a symmetrized molecule
The equivalent atoms obtained via
:meth:`~pymatgen.symmetry.analyzer.PointGroupAnalyzer.get_equivalent_atoms`
are rotated, mirrored... unto one position.
Then the average position is calculated.
The average position is rotated, mirrored... back with the inverse
of the previous symmetry operations, which gives the
symmetrized molecule
Args:
mol (Molecule): A pymatgen Molecule instance.
max_n (int): Maximum number of iterations.
tolerance (float): Tolerance for detecting symmetry.
Gets passed as Argument into
:class:`~pymatgen.analyzer.symmetry.PointGroupAnalyzer`.
epsilon (float): If the elementwise absolute difference of two
subsequently symmetrized structures is smaller epsilon,
the iteration stops before ``max_n`` is reached.
Returns:
dict: The returned dictionary has three possible keys:
``sym_mol``:
A symmetrized molecule instance.
``eq_sets``:
A dictionary of indices mapping to sets of indices,
each key maps to indices of all equivalent atoms.
The keys are guaranteed to be not equivalent.
``sym_ops``:
Twofold nested dictionary.
``operations[i][j]`` gives the symmetry operation
that maps atom ``i`` unto ``j``.
"""
new = mol
n = 0
finished = False
while not finished and n <= max_n:
previous = new
PA = PointGroupAnalyzer(previous, tolerance=tolerance)
eq = PA.symmetrize_molecule()
new = eq["sym_mol"]
finished = np.allclose(new.cart_coords, previous.cart_coords, atol=epsilon)
n += 1
return eq
def cluster_sites(mol, tol, give_only_index=False):
"""
Cluster sites based on distance and species type.
Args:
mol (Molecule): Molecule **with origin at center of mass**.
tol (float): Tolerance to use.
Returns:
(origin_site, clustered_sites): origin_site is a site at the center
of mass (None if there are no origin atoms). clustered_sites is a
dict of {(avg_dist, species_and_occu): [list of sites]}
"""
# Cluster works for dim > 2 data. We just add a dummy 0 for second
# coordinate.
dists = [[np.linalg.norm(site.coords), 0] for site in mol]
import scipy.cluster as spcluster
f = spcluster.hierarchy.fclusterdata(dists, tol, criterion="distance")
clustered_dists = defaultdict(list)
for i, site in enumerate(mol):
clustered_dists[f[i]].append(dists[i])
avg_dist = {label: np.mean(val) for label, val in clustered_dists.items()}
clustered_sites = defaultdict(list)
origin_site = None
for i, site in enumerate(mol):
if avg_dist[f[i]] < tol:
if give_only_index:
origin_site = i
else:
origin_site = site
else:
if give_only_index:
clustered_sites[(avg_dist[f[i]], site.species)].append(i)
else:
clustered_sites[(avg_dist[f[i]], site.species)].append(site)
return origin_site, clustered_sites
def generate_full_symmops(symmops, tol):
"""
Recursive algorithm to permute through all possible combinations of the
initially supplied symmetry operations to arrive at a complete set of
operations mapping a single atom to all other equivalent atoms in the
point group. This assumes that the initial number already uniquely
identifies all operations.
Args:
symmops ([SymmOp]): Initial set of symmetry operations.
Returns:
Full set of symmetry operations.
"""
# Uses an algorithm described in:
# Gregory Butler. Fundamental Algorithms for Permutation Groups.
# Lecture Notes in Computer Science (Book 559). Springer, 1991. page 15
UNIT = np.eye(4)
generators = [op.affine_matrix for op in symmops if not np.allclose(op.affine_matrix, UNIT)]
if not generators:
# C1 symmetry breaks assumptions in the algorithm afterwards
return symmops
full = list(generators)
for g in full:
for s in generators:
op = np.dot(g, s)
d = np.abs(full - op) < tol
if not np.any(np.all(np.all(d, axis=2), axis=1)):
full.append(op)
d = np.abs(full - UNIT) < tol
if not np.any(np.all(np.all(d, axis=2), axis=1)):
full.append(UNIT)
return [SymmOp(op) for op in full]
class SpacegroupOperations(list):
"""
Represents a space group, which is a collection of symmetry operations.
"""
def __init__(self, int_symbol, int_number, symmops):
"""
Args:
int_symbol (str): International symbol of the spacegroup.
int_number (int): International number of the spacegroup.
symmops ([SymmOp]): Symmetry operations associated with the
spacegroup.
"""
self.int_symbol = int_symbol
self.int_number = int_number
super().__init__(symmops)
def are_symmetrically_equivalent(self, sites1, sites2, symm_prec=1e-3):
"""
Given two sets of PeriodicSites, test if they are actually
symmetrically equivalent under this space group. Useful, for example,
if you want to test if selecting atoms 1 and 2 out of a set of 4 atoms
are symmetrically the same as selecting atoms 3 and 4, etc.
One use is in PartialRemoveSpecie transformation to return only
symmetrically distinct arrangements of atoms.
Args:
sites1 ([PeriodicSite]): 1st set of sites
sites2 ([PeriodicSite]): 2nd set of sites
symm_prec (float): Tolerance in atomic distance to test if atoms
are symmetrically similar.
Returns:
(bool): Whether the two sets of sites are symmetrically
equivalent.
"""
def in_sites(site):
for test_site in sites1:
if test_site.is_periodic_image(site, symm_prec, False):
return True
return False
for op in self:
newsites2 = [PeriodicSite(site.species, op.operate(site.frac_coords), site.lattice) for site in sites2]
for site in newsites2:
if not in_sites(site):
break
else:
return True
return False
def __str__(self):
return "{} ({}) spacegroup".format(self.int_symbol, self.int_number)
class PointGroupOperations(list):
"""
Defines a point group, which is essentially a sequence of symmetry
operations.
.. attribute:: sch_symbol
Schoenflies symbol of the point group.
"""
def __init__(self, sch_symbol, operations, tol=0.1):
"""
Args:
sch_symbol (str): Schoenflies symbol of the point group.
operations ([SymmOp]): Initial set of symmetry operations. It is
sufficient to provide only just enough operations to generate
the full set of symmetries.
tol (float): Tolerance to generate the full set of symmetry
operations.
"""
self.sch_symbol = sch_symbol
super().__init__(generate_full_symmops(operations, tol))
def __str__(self):
return self.sch_symbol
def __repr__(self):
return self.__str__()
|
{
"content_hash": "b892df37af704ef9e306275d9a8341d9",
"timestamp": "",
"source": "github",
"line_count": 1609,
"max_line_length": 120,
"avg_line_length": 38.688626476072095,
"alnum_prop": 0.5269076305220883,
"repo_name": "gmatteo/pymatgen",
"id": "5c64f3f41e0fad19e433bdc06cc8d06e769660d9",
"size": "62360",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "pymatgen/symmetry/analyzer.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Dockerfile",
"bytes": "277"
},
{
"name": "Python",
"bytes": "7840569"
},
{
"name": "Shell",
"bytes": "711"
}
],
"symlink_target": ""
}
|
package org.i3xx.util.rna.core;
public interface IRole {
/* positive Rechte */
public static final int RIGHT_ALL = 0x0000FFFF; /* Vollzugriff */
public static final int RIGHT_READ = 0x1; /* Lesen */
public static final int RIGHT_WRITE = 0x2; /* Schreiben */
public static final int RIGHT_CREATE = 0x4; /* Erstellen */
public static final int RIGHT_DELETE = 0x8; /* L�schen */
public static final int RIGHT_LIST = 0x10; /* Kindelemente lesen */
public static final int RIGHT_ADD = 0x20; /* Kindelement hinzuf�gen */
public static final int RIGHT_REMOVE = 0x40; /* Kindelement entfernen */
public static final int RIGHT_READFIELD = 0x80; /* Feld lesen */
public static final int RIGHT_WRITEFIELD = 0x100; /* Feld schreiben */
public static final int RIGHT_EXPORT = 0x200; /* Weitergeben (E-Mail) */
public static final int RIGHT_SEARCH = 0x400; /* Suchen */
public static final int RIGHT_QUERY = 0x800; /* Listen abfragen (Cursor) */
public static final int RIGHT_READRIGHT = 0x1000; /* Berechtigung lesen */
public static final int RIGHT_CHANGERIGHT = 0x2000; /* Berechtigung �ndern */
public static final int RIGHT_TAKEOVER = 0x4000; /* Besitzrechte �bernehmen */
public static final int RIGHT_RECURSION = 0x8000; /* Rechte an Nachfahren �bertragen */
/* negative Rechte */
public static final int iRIGHT_ALL = 0xFFFF0000; /* Kein Zugriff */
public static final int iRIGHT_READ = 0x10000; /* Lesen */
public static final int iRIGHT_WRITE = 0x20000; /* Schreiben */
public static final int iRIGHT_CREATE = 0x40000; /* Erstellen */
public static final int iRIGHT_DELETE = 0x80000; /* L�schen */
public static final int iRIGHT_LIST = 0x100000; /* Kindelemente lesen */
public static final int iRIGHT_ADD = 0x200000; /* Kindelement hinzuf�gen */
public static final int iRIGHT_REMOVE = 0x400000; /* Kindelement entfernen */
public static final int iRIGHT_READFIELD = 0x800000; /* Feld lesen */
public static final int iRIGHT_WRITEFIELD = 0x1000000; /* Feld schreiben */
public static final int iRIGHT_EXPORT = 0x2000000; /* Weitergeben (E-Mail) */
public static final int iRIGHT_SEARCH = 0x4000000; /* Suchen */
public static final int iRIGHT_QUERY = 0x8000000; /* Listen abfragen (Cursor) */
public static final int iRIGHT_READRIGHT = 0x10000000; /* Berechtigung lesen */
public static final int iRIGHT_CHANGERIGHT = 0x20000000; /* Berechtigung �ndern */
public static final int iRIGHT_TAKEOVER = 0x40000000; /* Besitzrechte �bernehmen */
public static final int iRIGHT_RECURSION = 0x80000000; /* Rechte an Nachfahren �bertragen */
public static final int NOT_FOUND = 0;
public static final int ALLOWED = -1;
public static final int FORBIDDEN = 1;
}
|
{
"content_hash": "a63ee071359bda479ee61188519d3ab1",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 93,
"avg_line_length": 59.54347826086956,
"alnum_prop": 0.7159547280029208,
"repo_name": "nordapp/rest",
"id": "ba88656e216724cdd45150c558b055476b8167a0",
"size": "2759",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "org.i3xx.util.rna/src/main/java/org/i3xx/util/rna/core/IRole.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "1991"
},
{
"name": "Java",
"bytes": "873609"
}
],
"symlink_target": ""
}
|
using namespace Lag;
Light::Light(const Color &color, bool castShadow) :
color(color),
castShadow(castShadow) {
}
|
{
"content_hash": "90af9fca39c41088d03eb8fe1ca03616",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 51,
"avg_line_length": 19.571428571428573,
"alnum_prop": 0.6277372262773723,
"repo_name": "MadEqua/LagEngine",
"id": "2e1381e04bf5c83c2810647db987260523965495",
"size": "157",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "LagEngine/src/scene/Light.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "4754"
},
{
"name": "C++",
"bytes": "449607"
},
{
"name": "CMake",
"bytes": "17051"
},
{
"name": "GLSL",
"bytes": "11953"
}
],
"symlink_target": ""
}
|
@interface ViewController : UIViewController
@end
|
{
"content_hash": "a74b3021189d1f8b603fce625205943e",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 44,
"avg_line_length": 10.6,
"alnum_prop": 0.7924528301886793,
"repo_name": "csning/GitRepositoryForCsning",
"id": "e8cedb690cce5f60955af0c7c5fc0d1621492e45",
"size": "220",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Demo_Audio_1/Demo_Audio_1/ViewController.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Objective-C",
"bytes": "14222"
}
],
"symlink_target": ""
}
|
ACCEPTED
#### According to
Paleobiology Database
#### Published in
null
#### Original name
null
### Remarks
null
|
{
"content_hash": "424c3a5491021c7a6ce450efa93068a7",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 21,
"avg_line_length": 8.923076923076923,
"alnum_prop": 0.6982758620689655,
"repo_name": "mdoering/backbone",
"id": "bcdbc8116dc857664eec3e69eb8823d332764d10",
"size": "160",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Chromista/Radiozoa/Spumellaria/Saturnalidae/Acanthocircus/Acanthocircus spelae/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
}
|
package com.github.uryyyyyyy.bizCalendarUtil.impl;
import java.time.Month;
import java.time.Year;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.List;
import org.junit.Test;
import com.github.uryyyyyyy.bizCalendarUtil.spec.BusinessHourUtil;
import com.github.uryyyyyyy.bizCalendarUtil.util.ZonedDateTimeRange;
import com.github.uryyyyyyy.bizCalendarUtil.util.JavaTimeConverter;
import com.google.common.collect.ImmutableSet;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.Matchers.contains;
import static org.junit.Assert.assertThat;
public class BusinessHourUtilImplTest {
private static final BusinessHourUtil businessHourUtil = new BusinessHourUtilImpl();
@Test
public void testCalcNearestTimeAfter() throws Exception {
ZonedDateTimeRange h1 = new ZonedDateTimeRange(
JavaTimeConverter.toZonedDateTime("2015-01-01T18:00:00", "Japan"),
JavaTimeConverter.toZonedDateTime("2015-01-01T20:00:00", "Japan"));
ZonedDateTimeRange h2 = new ZonedDateTimeRange(
JavaTimeConverter.toZonedDateTime("2015-01-02T18:00:00", "Japan"),
JavaTimeConverter.toZonedDateTime("2015-01-02T20:00:00", "Japan"));
ZonedDateTimeRange h3 = new ZonedDateTimeRange(
JavaTimeConverter.toZonedDateTime("2015-01-03T18:00:00", "Japan"),
JavaTimeConverter.toZonedDateTime("2015-01-03T20:00:00", "Japan"));
ZonedDateTime target = JavaTimeConverter.toZonedDateTime("2015-01-01T17:00:00", "Japan");
ZonedDateTimeRange res = businessHourUtil.calcNearestTimeAfter(ImmutableSet.of(h1, h2, h3), target);
ZonedDateTimeRange ans = new ZonedDateTimeRange(
JavaTimeConverter.toZonedDateTime("2015-01-01T18:00:00", "Japan"),
JavaTimeConverter.toZonedDateTime("2015-01-01T20:00:00", "Japan")
);
assertThat(res, is(ans));
ZonedDateTime target2 = JavaTimeConverter.toZonedDateTime("2015-01-01T19:00:00", "Japan");
ZonedDateTimeRange res2 = businessHourUtil.calcNearestTimeAfter(ImmutableSet.of(h1, h2, h3), target2);
ZonedDateTimeRange ans2 = new ZonedDateTimeRange(
JavaTimeConverter.toZonedDateTime("2015-01-01T18:00:00", "Japan"),
JavaTimeConverter.toZonedDateTime("2015-01-01T20:00:00", "Japan")
);
assertThat(res2, is(ans2));
ZonedDateTime target3 = JavaTimeConverter.toZonedDateTime("2015-01-02T22:00:00", "Japan");
ZonedDateTimeRange res3 = businessHourUtil.calcNearestTimeAfter(ImmutableSet.of(h1, h2, h3), target3);
ZonedDateTimeRange ans3 = new ZonedDateTimeRange(
JavaTimeConverter.toZonedDateTime("2015-01-03T18:00:00", "Japan"),
JavaTimeConverter.toZonedDateTime("2015-01-03T20:00:00", "Japan")
);
assertThat(res3, is(ans3));
ZonedDateTime target4 = JavaTimeConverter.toZonedDateTime("2015-01-02T22:00:00", "Europe/London");
ZonedDateTimeRange res4 = businessHourUtil.calcNearestTimeAfter(ImmutableSet.of(h1, h2, h3), target4);
ZonedDateTimeRange ans4 = new ZonedDateTimeRange(
JavaTimeConverter.toZonedDateTime("2015-01-03T18:00:00", "Japan"),
JavaTimeConverter.toZonedDateTime("2015-01-03T20:00:00", "Japan")
);
assertThat(res4, is(ans4));
}
@Test
public void testCalcNearestTimeBefore() throws Exception {
ZonedDateTimeRange h1 = new ZonedDateTimeRange(
JavaTimeConverter.toZonedDateTime("2015-01-01T18:00:00", "Japan"),
JavaTimeConverter.toZonedDateTime("2015-01-01T20:00:00", "Japan"));
ZonedDateTimeRange h2 = new ZonedDateTimeRange(
JavaTimeConverter.toZonedDateTime("2015-01-02T18:00:00", "Japan"),
JavaTimeConverter.toZonedDateTime("2015-01-02T20:00:00", "Japan"));
ZonedDateTimeRange h3 = new ZonedDateTimeRange(
JavaTimeConverter.toZonedDateTime("2015-01-03T18:00:00", "Japan"),
JavaTimeConverter.toZonedDateTime("2015-01-03T20:00:00", "Japan"));
ZonedDateTime target = JavaTimeConverter.toZonedDateTime("2015-01-03T17:00:00", "Japan");
ZonedDateTimeRange res = businessHourUtil.calcNearestTimeBefore(ImmutableSet.of(h1, h2, h3), target);
ZonedDateTimeRange ans = new ZonedDateTimeRange(
JavaTimeConverter.toZonedDateTime("2015-01-02T18:00:00", "Japan"),
JavaTimeConverter.toZonedDateTime("2015-01-02T20:00:00", "Japan")
);
assertThat(res, is(ans));
ZonedDateTime target2 = JavaTimeConverter.toZonedDateTime("2015-01-01T19:00:00", "Japan");
ZonedDateTimeRange res2 = businessHourUtil.calcNearestTimeBefore(ImmutableSet.of(h1, h2, h3), target2);
ZonedDateTimeRange ans2 = new ZonedDateTimeRange(
JavaTimeConverter.toZonedDateTime("2015-01-01T18:00:00", "Japan"),
JavaTimeConverter.toZonedDateTime("2015-01-01T20:00:00", "Japan")
);
assertThat(res2, is(ans2));
ZonedDateTime target3 = JavaTimeConverter.toZonedDateTime("2015-01-02T22:00:00", "Japan");
ZonedDateTimeRange res3 = businessHourUtil.calcNearestTimeBefore(ImmutableSet.of(h1, h2, h3), target3);
ZonedDateTimeRange ans3 = new ZonedDateTimeRange(
JavaTimeConverter.toZonedDateTime("2015-01-02T18:00:00", "Japan"),
JavaTimeConverter.toZonedDateTime("2015-01-02T20:00:00", "Japan")
);
assertThat(res3, is(ans3));
ZonedDateTime target4 = JavaTimeConverter.toZonedDateTime("2015-01-02T22:00:00", "Europe/London");
ZonedDateTimeRange res4 = businessHourUtil.calcNearestTimeBefore(ImmutableSet.of(h1, h2, h3), target4);
ZonedDateTimeRange ans4 = new ZonedDateTimeRange(
JavaTimeConverter.toZonedDateTime("2015-01-02T18:00:00", "Japan"),
JavaTimeConverter.toZonedDateTime("2015-01-02T20:00:00", "Japan")
);
assertThat(res4, is(ans4));
}
@Test
public void testCalcLastTimesOfMonth() throws Exception {
ZonedDateTimeRange h1 = new ZonedDateTimeRange(
JavaTimeConverter.toZonedDateTime("2015-01-01T18:00:00", "Japan"),
JavaTimeConverter.toZonedDateTime("2015-01-01T20:00:00", "Japan"));
ZonedDateTimeRange h2 = new ZonedDateTimeRange(
JavaTimeConverter.toZonedDateTime("2015-01-02T18:00:00", "Japan"),
JavaTimeConverter.toZonedDateTime("2015-01-02T20:00:00", "Japan"));
ZonedDateTimeRange h3 = new ZonedDateTimeRange(
JavaTimeConverter.toZonedDateTime("2015-01-03T18:00:00", "Japan"),
JavaTimeConverter.toZonedDateTime("2015-01-03T20:00:00", "Japan"));
ZonedDateTimeRange h4 = new ZonedDateTimeRange(
JavaTimeConverter.toZonedDateTime("2015-02-01T18:00:00", "Japan"),
JavaTimeConverter.toZonedDateTime("2015-02-01T20:00:00", "Japan"));
ZonedDateTimeRange h5 = new ZonedDateTimeRange(
JavaTimeConverter.toZonedDateTime("2015-02-22T19:00:00", "Japan"),
JavaTimeConverter.toZonedDateTime("2015-02-22T21:00:00", "Japan"));
List<ZonedDateTimeRange> res = businessHourUtil.calcLastTimesOfMonth(ImmutableSet.of(h1, h2, h3, h4, h5),
ImmutableSet.of(Year.of(2015)),
ImmutableSet.of(Month.JANUARY, Month.FEBRUARY),
ZoneId.of("Japan")
);
ZonedDateTimeRange ans1 = new ZonedDateTimeRange(
JavaTimeConverter.toZonedDateTime("2015-01-03T18:00:00", "Japan"),
JavaTimeConverter.toZonedDateTime("2015-01-03T20:00:00", "Japan")
);
ZonedDateTimeRange ans2 = new ZonedDateTimeRange(
JavaTimeConverter.toZonedDateTime("2015-02-22T19:00:00", "Japan"),
JavaTimeConverter.toZonedDateTime("2015-02-22T21:00:00", "Japan")
);
assertThat(res, contains(ans1, ans2));
}
@Test
public void testCalcFirstTimesOfMonth() throws Exception {
ZonedDateTimeRange h1 = new ZonedDateTimeRange(
JavaTimeConverter.toZonedDateTime("2015-01-01T18:00:00", "Japan"),
JavaTimeConverter.toZonedDateTime("2015-01-01T20:00:00", "Japan"));
ZonedDateTimeRange h2 = new ZonedDateTimeRange(
JavaTimeConverter.toZonedDateTime("2015-01-02T18:00:00", "Japan"),
JavaTimeConverter.toZonedDateTime("2015-01-02T20:00:00", "Japan"));
ZonedDateTimeRange h3 = new ZonedDateTimeRange(
JavaTimeConverter.toZonedDateTime("2015-01-03T18:00:00", "Japan"),
JavaTimeConverter.toZonedDateTime("2015-01-03T20:00:00", "Japan"));
ZonedDateTimeRange h4 = new ZonedDateTimeRange(
JavaTimeConverter.toZonedDateTime("2015-02-01T18:00:00", "Japan"),
JavaTimeConverter.toZonedDateTime("2015-02-01T20:00:00", "Japan"));
ZonedDateTimeRange h5 = new ZonedDateTimeRange(
JavaTimeConverter.toZonedDateTime("2015-02-22T19:00:00", "Japan"),
JavaTimeConverter.toZonedDateTime("2015-02-22T21:00:00", "Japan"));
List<ZonedDateTimeRange> res = businessHourUtil.calcFirstTimesOfMonth(ImmutableSet.of(h1, h2, h3, h4, h5),
ImmutableSet.of(Year.of(2015)),
ImmutableSet.of(Month.JANUARY, Month.FEBRUARY),
ZoneId.of("Japan")
);
ZonedDateTimeRange ans1 = new ZonedDateTimeRange(
JavaTimeConverter.toZonedDateTime("2015-01-01T18:00:00", "Japan"),
JavaTimeConverter.toZonedDateTime("2015-01-01T20:00:00", "Japan")
);
ZonedDateTimeRange ans2 = new ZonedDateTimeRange(
JavaTimeConverter.toZonedDateTime("2015-02-01T18:00:00", "Japan"),
JavaTimeConverter.toZonedDateTime("2015-02-01T20:00:00", "Japan")
);
assertThat(res, contains(ans1, ans2));
}
@Test
public void testCalcFirstTimesOfMonth2() throws Exception {
ZonedDateTimeRange h1 = new ZonedDateTimeRange(
JavaTimeConverter.toZonedDateTime("2015-01-01T01:00:00", "Japan"),
JavaTimeConverter.toZonedDateTime("2015-01-01T05:00:00", "Japan"));
ZonedDateTimeRange h2 = new ZonedDateTimeRange(
JavaTimeConverter.toZonedDateTime("2015-01-02T18:00:00", "Japan"),
JavaTimeConverter.toZonedDateTime("2015-01-02T20:00:00", "Japan"));
ZonedDateTimeRange h3 = new ZonedDateTimeRange(
JavaTimeConverter.toZonedDateTime("2015-01-03T18:00:00", "Japan"),
JavaTimeConverter.toZonedDateTime("2015-01-03T20:00:00", "Japan"));
ZonedDateTimeRange h4 = new ZonedDateTimeRange(
JavaTimeConverter.toZonedDateTime("2015-02-01T18:00:00", "Japan"),
JavaTimeConverter.toZonedDateTime("2015-02-01T20:00:00", "Japan"));
ZonedDateTimeRange h5 = new ZonedDateTimeRange(
JavaTimeConverter.toZonedDateTime("2015-02-22T19:00:00", "Japan"),
JavaTimeConverter.toZonedDateTime("2015-02-22T21:00:00", "Japan"));
List<ZonedDateTimeRange> res = businessHourUtil.calcFirstTimesOfMonth(ImmutableSet.of(h1, h2, h3, h4, h5),
ImmutableSet.of(Year.of(2015)),
ImmutableSet.of(Month.JANUARY, Month.FEBRUARY),
ZoneId.of("Europe/London")
);
ZonedDateTimeRange ans1 = new ZonedDateTimeRange(
JavaTimeConverter.toZonedDateTime("2015-01-02T18:00:00", "Japan"),
JavaTimeConverter.toZonedDateTime("2015-01-02T20:00:00", "Japan")
);
ZonedDateTimeRange ans2 = new ZonedDateTimeRange(
JavaTimeConverter.toZonedDateTime("2015-02-01T18:00:00", "Japan"),
JavaTimeConverter.toZonedDateTime("2015-02-01T20:00:00", "Japan")
);
assertThat(res, contains(ans1, ans2));
}
@Test
public void testCreateAllDatesByCronPatternBefore() throws Exception {
ZonedDateTimeRange h1 = new ZonedDateTimeRange(
JavaTimeConverter.toZonedDateTime("2015-01-01T18:00:00", "Japan"),
JavaTimeConverter.toZonedDateTime("2015-01-01T20:00:00", "Japan"));
ZonedDateTimeRange h2 = new ZonedDateTimeRange(
JavaTimeConverter.toZonedDateTime("2015-01-02T18:00:00", "Japan"),
JavaTimeConverter.toZonedDateTime("2015-01-02T20:00:00", "Japan"));
ZonedDateTimeRange h3 = new ZonedDateTimeRange(
JavaTimeConverter.toZonedDateTime("2015-01-03T18:00:00", "Japan"),
JavaTimeConverter.toZonedDateTime("2015-01-03T20:00:00", "Japan"));
ZonedDateTimeRange h4 = new ZonedDateTimeRange(
JavaTimeConverter.toZonedDateTime("2015-02-01T18:00:00", "Japan"),
JavaTimeConverter.toZonedDateTime("2015-02-01T20:00:00", "Japan"));
ZonedDateTimeRange h5 = new ZonedDateTimeRange(
JavaTimeConverter.toZonedDateTime("2015-02-22T19:00:00", "Japan"),
JavaTimeConverter.toZonedDateTime("2015-02-22T21:00:00", "Japan"));
List<ZonedDateTimeRange> res = businessHourUtil.calcNearestDatesByCronPatternBefore(ImmutableSet.of(h1, h2, h3, h4, h5),
"0 0 22 1 1,2 ?", ZoneId.of("Japan"));
ZonedDateTimeRange ans1 = new ZonedDateTimeRange(
JavaTimeConverter.toZonedDateTime("2015-01-01T18:00:00", "Japan"),
JavaTimeConverter.toZonedDateTime("2015-01-01T20:00:00", "Japan")
);
ZonedDateTimeRange ans2 = new ZonedDateTimeRange(
JavaTimeConverter.toZonedDateTime("2015-02-01T18:00:00", "Japan"),
JavaTimeConverter.toZonedDateTime("2015-02-01T20:00:00", "Japan")
);
assertThat(res, contains(ans1, ans2));
}
@Test
public void testCreateAllDatesByCronPatternAfter() throws Exception {
ZonedDateTimeRange h1 = new ZonedDateTimeRange(
JavaTimeConverter.toZonedDateTime("2015-01-01T18:00:00", "Japan"),
JavaTimeConverter.toZonedDateTime("2015-01-01T20:00:00", "Japan"));
ZonedDateTimeRange h2 = new ZonedDateTimeRange(
JavaTimeConverter.toZonedDateTime("2015-01-02T18:00:00", "Japan"),
JavaTimeConverter.toZonedDateTime("2015-01-02T20:00:00", "Japan"));
ZonedDateTimeRange h3 = new ZonedDateTimeRange(
JavaTimeConverter.toZonedDateTime("2015-01-03T18:00:00", "Japan"),
JavaTimeConverter.toZonedDateTime("2015-01-03T20:00:00", "Japan"));
ZonedDateTimeRange h4 = new ZonedDateTimeRange(
JavaTimeConverter.toZonedDateTime("2015-02-01T18:00:00", "Japan"),
JavaTimeConverter.toZonedDateTime("2015-02-01T20:00:00", "Japan"));
ZonedDateTimeRange h5 = new ZonedDateTimeRange(
JavaTimeConverter.toZonedDateTime("2015-02-22T19:00:00", "Japan"),
JavaTimeConverter.toZonedDateTime("2015-02-22T21:00:00", "Japan"));
List<ZonedDateTimeRange> res = businessHourUtil.calcNearestDatesByCronPatternAfter(ImmutableSet.of(h1, h2, h3, h4, h5),
"0 0 22 1 1,2 ?", ZoneId.of("Japan"));
ZonedDateTimeRange ans1 = new ZonedDateTimeRange(
JavaTimeConverter.toZonedDateTime("2015-01-02T18:00:00", "Japan"),
JavaTimeConverter.toZonedDateTime("2015-01-02T20:00:00", "Japan")
);
ZonedDateTimeRange ans2 = new ZonedDateTimeRange(
JavaTimeConverter.toZonedDateTime("2015-02-22T19:00:00", "Japan"),
JavaTimeConverter.toZonedDateTime("2015-02-22T21:00:00", "Japan")
);
assertThat(res, contains(ans1, ans2));
}
}
|
{
"content_hash": "4e85ef1a3dc3a2ad1ebd9b61d3685a4a",
"timestamp": "",
"source": "github",
"line_count": 288,
"max_line_length": 128,
"avg_line_length": 55.05555555555556,
"alnum_prop": 0.6586150353178607,
"repo_name": "uryyyyyyy/bizCalendarUtil",
"id": "5cb63b5c08497b9346e38dc9ef1a92dd2ce55123",
"size": "15856",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/test/java/com/github/uryyyyyyy/bizCalendarUtil/impl/BusinessHourUtilImplTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "51880"
}
],
"symlink_target": ""
}
|
module RuboCop
module Cop
module Layout
# Checks for missing space between a token and a comment on the
# same line.
#
# @example
# # bad
# 1 + 1# this operation does ...
#
# # good
# 1 + 1 # this operation does ...
class SpaceBeforeComment < Base
extend AutoCorrector
MSG = 'Put a space before an end-of-line comment.'
def on_new_investigation
processed_source.sorted_tokens.each_cons(2) do |token1, token2|
next unless token2.comment?
next unless same_line?(token1, token2)
next unless token1.pos.end == token2.pos.begin
range = token2.pos
add_offense(range) { |corrector| corrector.insert_before(range, ' ') }
end
end
end
end
end
end
|
{
"content_hash": "ce6d614f6ce2e6ffa1269c2f3fc28ed5",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 82,
"avg_line_length": 26.21875,
"alnum_prop": 0.5578069129916567,
"repo_name": "tejasbubane/rubocop",
"id": "629b3f12d2be7bf9062475e08d5ab56ede45bd37",
"size": "870",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "lib/rubocop/cop/layout/space_before_comment.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Emacs Lisp",
"bytes": "480"
},
{
"name": "HTML",
"bytes": "7106"
},
{
"name": "Ruby",
"bytes": "6854715"
},
{
"name": "Shell",
"bytes": "75"
}
],
"symlink_target": ""
}
|
<ion-view view-title="福利图片">
<ion-nav-buttons side="left">
<button menu-toggle="left" class="button button-icon icon ion-navicon"></button>
</ion-nav-buttons>
<ion-content class="">
<ion-refresher pulling-text="下拉刷新" on-refresh="doRefresh()"></ion-refresher>
<div class="list card animated fadeIn" ng-repeat="item in items">
<div class="item item-body" >
<!-- <img class="full-image" src={{item.url}} ng-click="showImages($index)"> -->
<div class="imgFuli" ng-click="showImages($index)" style="background-image: url('{{item.url}}');">
</div>
<div style="margin-top:8px;">
<span style="color:#727272;font-size:13px;"><i class="ion-person" style="display:inline-block;width:20px;"></i>{{item.who}}</span>
<span style="display:inline-block;float:right;color:#727272;font-size:13px;"><i class="ion-clock"style="display:inline-block;width:20px;"></i>{{(item.publishedAt).split('T')[0]}}</span>
</div>
</div>
</div>
<ion-infinite-scroll on-infinite="loadMore()">
<ion-spinner icon="dots" class="spinner-dark spinner spinner-dots"></ion-spinner>
</ion-infinite-scroll>
</ion-content>
</ion-view>
|
{
"content_hash": "91d6faebd6ba8be4e45195a63069d166",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 195,
"avg_line_length": 48.08,
"alnum_prop": 0.6314475873544093,
"repo_name": "VictorYuan666/gank-ionic-app",
"id": "a3301c932f702036e5c2910b614d62af3203a4f4",
"size": "1218",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "www/templates/fuli.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "911629"
},
{
"name": "HTML",
"bytes": "21174"
},
{
"name": "JavaScript",
"bytes": "3672600"
}
],
"symlink_target": ""
}
|
using Microsoft.VisualStudio.Text.Tagging;
namespace Pharmatechnik.Nav.Language.Extension.Underlining;
public class UnderlineTag: ITag {
}
|
{
"content_hash": "9acb866a8df88e59fc303f8b8be4f660",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 60,
"avg_line_length": 20.428571428571427,
"alnum_prop": 0.8181818181818182,
"repo_name": "IInspectable/Nav.Language.Extensions",
"id": "f8ecb366ea170f3ce46ea7d2c1b2f39283cfbe04",
"size": "145",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Nav.Language.ExtensionShared/Underlining/UnderlineTag.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ANTLR",
"bytes": "9305"
},
{
"name": "Batchfile",
"bytes": "1433"
},
{
"name": "C#",
"bytes": "1874397"
},
{
"name": "PowerShell",
"bytes": "5905"
},
{
"name": "Smalltalk",
"bytes": "3"
}
],
"symlink_target": ""
}
|
package gr.iti.mklab.methods;
import gr.iti.mklab.util.EasyBufferedReader;
import gr.iti.mklab.util.EasyBufferedWriter;
import org.apache.log4j.Logger;
/**
* The implementation of the Internal Grid technique
* @author gkordo
*
*/
public class MultipleGrid {
static Logger logger = Logger.getLogger("gr.iti.mklab.method.InternalGrid");
/**
* Method that perform the Multiple Grid technique and generates
* the arguments for the similarity search Class contractor
* @param dir : directory of the project
* @param resultFile : name of the output file
* @param resultCorserGrid : file with the estimated cells of the coarser grid
* @param resultFinerGrid : file with the estimated cells of the finer grid
*/
public static void determinCellIDsForSS(String dir, String resultFile,
String resultCorserGrid, String resultFinerGrid){
logger.info("Process: Multiple Grid Technique\t|\t"
+ "Status: INITIALIZE");
// Initialize parameters
EasyBufferedReader resultLMGCReader = new EasyBufferedReader(dir + resultCorserGrid);
EasyBufferedReader resultLMGFReader = new EasyBufferedReader(dir + resultFinerGrid);
EasyBufferedWriter writer = new EasyBufferedWriter(dir + resultFile);
String corseMLC;
String fineMLC;
logger.info("Process: Multiple Grid Technique\t|\t"
+ "Status: STARTED");
while ((corseMLC=resultLMGCReader.readLine())!=null
&& (fineMLC=resultLMGFReader.readLine())!=null){
if(!corseMLC.split("\t")[1].equals("N/A")){
String mlc = deterimBoarders(corseMLC.split("\t")[1], fineMLC.split("\t")[1]);
if(!mlc.isEmpty()){
writer.write(corseMLC.split("\t")[0] + "\t" + corseMLC.split("\t")[1]
+ ":" + mlc); // selected cell ID and the sell of the coarser granularity
}else{
writer.write(corseMLC.split("\t")[0] + "\t" + corseMLC.split("\t")[1]
+ ":" + corseMLC.split("\t")[1]);
}
writer.newLine();
} else{
writer.write(corseMLC.split("\t")[0] + "\tN/A");
}
}
logger.info("Process: Multiple Grid Technique\t|\t"
+ "Status: COMPLETED");
writer.close();
resultLMGCReader.close();
resultLMGFReader.close();
}
/**
* Method that determines the borders of the cell that similarity search will take place
* @param corseMLC : estimated cell of the coarser grid
* @param fineMLC : estimated cell of the finer grid
*/
private static String deterimBoarders(String corseMLC, String fineMLC){
String mlc = corseMLC;
if (!corseMLC.equals("N/A")){
Double[] corseLatLon = {Double.parseDouble(corseMLC.split("_")[0]),
Double.parseDouble(corseMLC.split("_")[1])};
if(!fineMLC.equals("N/A")){
Double[] fineLatLon = {Double.parseDouble(fineMLC.split("_")[0]),
Double.parseDouble(fineMLC.split("_")[1])};
// check whether the estimated cell of the finer grid laying
// inside the borders of the estimated cell of the coarser grid
if(fineLatLon[0]>=(corseLatLon[0]-0.005)
&& fineLatLon[0]<=(corseLatLon[0]+0.005)
&& fineLatLon[1]>=(corseLatLon[1]-0.005)
&& fineLatLon[1]<=(corseLatLon[1]+0.005)){
mlc = fineMLC;
}
}
}
return mlc;
}
}
|
{
"content_hash": "ca79d9d6706900ad40e19244e9be4ec2",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 89,
"avg_line_length": 32.06122448979592,
"alnum_prop": 0.6801400381922342,
"repo_name": "socialsensor/multimedia-geotagging",
"id": "0318821f6b23dce9d68c96233ccc43da7b39b4ee",
"size": "3142",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/gr/iti/mklab/methods/MultipleGrid.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "71624"
}
],
"symlink_target": ""
}
|
<<<<<<< HEAD
<!DOCTYPE html>
<!--
Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
-->
<html>
<head>
<meta charset="utf-8">
<title>CKEditor Samples</title>
<link rel="stylesheet" href="sample.css">
</head>
<body>
<h1 class="samples">
CKEditor Samples
</h1>
<div class="warning deprecated">
These samples are not maintained anymore. Check out the <a href="http://sdk.ckeditor.com/">brand new samples in CKEditor SDK</a>.
</div>
<div class="twoColumns">
<div class="twoColumnsLeft">
<h2 class="samples">
Basic Samples
</h2>
<dl class="samples">
<dt><a class="samples" href="replacebyclass.html">Replace textarea elements by class name</a></dt>
<dd>Automatic replacement of all textarea elements of a given class with a CKEditor instance.</dd>
<dt><a class="samples" href="replacebycode.html">Replace textarea elements by code</a></dt>
<dd>Replacement of textarea elements with CKEditor instances by using a JavaScript call.</dd>
<dt><a class="samples" href="jquery.html">Create editors with jQuery</a></dt>
<dd>Creating standard and inline CKEditor instances with jQuery adapter.</dd>
</dl>
<h2 class="samples">
Basic Customization
</h2>
<dl class="samples">
<dt><a class="samples" href="uicolor.html">User Interface color</a></dt>
<dd>Changing CKEditor User Interface color and adding a toolbar button that lets the user set the UI color.</dd>
<dt><a class="samples" href="uilanguages.html">User Interface languages</a></dt>
<dd>Changing CKEditor User Interface language and adding a drop-down list that lets the user choose the UI language.</dd>
</dl>
=======
<!DOCTYPE html>
<!--
Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
-->
<html>
<head>
<meta charset="utf-8">
<title>CKEditor Samples</title>
<link rel="stylesheet" href="sample.css">
</head>
<body>
<h1 class="samples">
CKEditor Samples
</h1>
<div class="warning deprecated">
These samples are not maintained anymore. Check out the <a href="http://sdk.ckeditor.com/">brand new samples in CKEditor SDK</a>.
</div>
<div class="twoColumns">
<div class="twoColumnsLeft">
<h2 class="samples">
Basic Samples
</h2>
<dl class="samples">
<dt><a class="samples" href="replacebyclass.html">Replace textarea elements by class name</a></dt>
<dd>Automatic replacement of all textarea elements of a given class with a CKEditor instance.</dd>
<dt><a class="samples" href="replacebycode.html">Replace textarea elements by code</a></dt>
<dd>Replacement of textarea elements with CKEditor instances by using a JavaScript call.</dd>
<dt><a class="samples" href="jquery.html">Create editors with jQuery</a></dt>
<dd>Creating standard and inline CKEditor instances with jQuery adapter.</dd>
</dl>
<h2 class="samples">
Basic Customization
</h2>
<dl class="samples">
<dt><a class="samples" href="uicolor.html">User Interface color</a></dt>
<dd>Changing CKEditor User Interface color and adding a toolbar button that lets the user set the UI color.</dd>
<dt><a class="samples" href="uilanguages.html">User Interface languages</a></dt>
<dd>Changing CKEditor User Interface language and adding a drop-down list that lets the user choose the UI language.</dd>
</dl>
>>>>>>> 89f18ea844cbfe9edad50226c35b554e1553a86f
<h2 class="samples">Plugins</h2>
<dl class="samples">
<dt><a class="samples" href="magicline/magicline.html">Magicline plugin</a></dt>
<dd>Using the Magicline plugin to access difficult focus spaces.</dd>
<dt><a class="samples" href="wysiwygarea/fullpage.html">Full page support</a></dt>
<dd>CKEditor inserted with a JavaScript call and used to edit the whole page from <html> to </html>.</dd>
<<<<<<< HEAD
</dl>
</div>
<div class="twoColumnsRight">
<h2 class="samples">
Inline Editing
</h2>
<dl class="samples">
<dt><a class="samples" href="inlineall.html">Massive inline editor creation</a></dt>
<dd>Turn all elements with <code>contentEditable = true</code> attribute into inline editors.</dd>
<dt><a class="samples" href="inlinebycode.html">Convert element into an inline editor by code</a></dt>
<dd>Conversion of DOM elements into inline CKEditor instances by using a JavaScript call.</dd>
<dt><a class="samples" href="inlinetextarea.html">Replace textarea with inline editor</a> <span class="new">New!</span></dt>
<dd>A form with a textarea that is replaced by an inline editor at runtime.</dd>
</dl>
<h2 class="samples">
Advanced Samples
</h2>
<dl class="samples">
<dt><a class="samples" href="datafiltering.html">Data filtering and features activation</a> <span class="new">New!</span></dt>
<dd>Data filtering and automatic features activation basing on configuration.</dd>
<dt><a class="samples" href="divreplace.html">Replace DIV elements on the fly</a></dt>
<dd>Transforming a <code>div</code> element into an instance of CKEditor with a mouse click.</dd>
<dt><a class="samples" href="appendto.html">Append editor instances</a></dt>
<dd>Appending editor instances to existing DOM elements.</dd>
<dt><a class="samples" href="ajax.html">Create and destroy editor instances for Ajax applications</a></dt>
<dd>Creating and destroying CKEditor instances on the fly and saving the contents entered into the editor window.</dd>
<dt><a class="samples" href="api.html">Basic usage of the API</a></dt>
<dd>Using the CKEditor JavaScript API to interact with the editor at runtime.</dd>
<dt><a class="samples" href="xhtmlstyle.html">XHTML-compliant style</a></dt>
<dd>Configuring CKEditor to produce XHTML 1.1 compliant attributes and styles.</dd>
<dt><a class="samples" href="readonly.html">Read-only mode</a></dt>
<dd>Using the readOnly API to block introducing changes to the editor contents.</dd>
<dt><a class="samples" href="tabindex.html">"Tab" key-based navigation</a></dt>
<dd>Navigating among editor instances with tab key.</dd>
=======
</dl>
</div>
<div class="twoColumnsRight">
<h2 class="samples">
Inline Editing
</h2>
<dl class="samples">
<dt><a class="samples" href="inlineall.html">Massive inline editor creation</a></dt>
<dd>Turn all elements with <code>contentEditable = true</code> attribute into inline editors.</dd>
<dt><a class="samples" href="inlinebycode.html">Convert element into an inline editor by code</a></dt>
<dd>Conversion of DOM elements into inline CKEditor instances by using a JavaScript call.</dd>
<dt><a class="samples" href="inlinetextarea.html">Replace textarea with inline editor</a> <span class="new">New!</span></dt>
<dd>A form with a textarea that is replaced by an inline editor at runtime.</dd>
</dl>
<h2 class="samples">
Advanced Samples
</h2>
<dl class="samples">
<dt><a class="samples" href="datafiltering.html">Data filtering and features activation</a> <span class="new">New!</span></dt>
<dd>Data filtering and automatic features activation basing on configuration.</dd>
<dt><a class="samples" href="divreplace.html">Replace DIV elements on the fly</a></dt>
<dd>Transforming a <code>div</code> element into an instance of CKEditor with a mouse click.</dd>
<dt><a class="samples" href="appendto.html">Append editor instances</a></dt>
<dd>Appending editor instances to existing DOM elements.</dd>
<dt><a class="samples" href="ajax.html">Create and destroy editor instances for Ajax applications</a></dt>
<dd>Creating and destroying CKEditor instances on the fly and saving the contents entered into the editor window.</dd>
<dt><a class="samples" href="api.html">Basic usage of the API</a></dt>
<dd>Using the CKEditor JavaScript API to interact with the editor at runtime.</dd>
<dt><a class="samples" href="xhtmlstyle.html">XHTML-compliant style</a></dt>
<dd>Configuring CKEditor to produce XHTML 1.1 compliant attributes and styles.</dd>
<dt><a class="samples" href="readonly.html">Read-only mode</a></dt>
<dd>Using the readOnly API to block introducing changes to the editor contents.</dd>
<dt><a class="samples" href="tabindex.html">"Tab" key-based navigation</a></dt>
<dd>Navigating among editor instances with tab key.</dd>
>>>>>>> 89f18ea844cbfe9edad50226c35b554e1553a86f
<dt><a class="samples" href="dialog/dialog.html">Using the JavaScript API to customize dialog windows</a></dt>
<dd>Using the dialog windows API to customize dialog windows without changing the original editor code.</dd>
<dt><a class="samples" href="enterkey/enterkey.html">Using the "Enter" key in CKEditor</a></dt>
<dd>Configuring the behavior of <em>Enter</em> and <em>Shift+Enter</em> keys.</dd>
<dt><a class="samples" href="htmlwriter/outputforflash.html">Output for Flash</a></dt>
<dd>Configuring CKEditor to produce HTML code that can be used with Adobe Flash.</dd>
<dt><a class="samples" href="htmlwriter/outputhtml.html">Output HTML</a></dt>
<dd>Configuring CKEditor to produce legacy HTML 4 code.</dd>
<dt><a class="samples" href="toolbar/toolbar.html">Toolbar Configurations</a></dt>
<dd>Configuring CKEditor to display full or custom toolbar layout.</dd>
<<<<<<< HEAD
</dl>
</div>
</div>
<div id="footer">
<hr>
<p>
CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
</p>
<p id="copy">
Copyright © 2003-2016, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico Knabben. All rights reserved.
</p>
</div>
</body>
</html>
=======
</dl>
</div>
</div>
<div id="footer">
<hr>
<p>
CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
</p>
<p id="copy">
Copyright © 2003-2016, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico Knabben. All rights reserved.
</p>
</div>
</body>
</html>
>>>>>>> 89f18ea844cbfe9edad50226c35b554e1553a86f
|
{
"content_hash": "429c9ac37ee798e42a139f0d76fa3f44",
"timestamp": "",
"source": "github",
"line_count": 249,
"max_line_length": 132,
"avg_line_length": 41.01606425702811,
"alnum_prop": 0.6951924018407911,
"repo_name": "ghifar/halonesia",
"id": "7b4d912af144c55ef4998fa617729b410ad9ef34",
"size": "10213",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "assets/plugins/ckeditor/samples/old/index.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "420"
},
{
"name": "CSS",
"bytes": "485859"
},
{
"name": "HTML",
"bytes": "10384246"
},
{
"name": "JavaScript",
"bytes": "2913032"
},
{
"name": "PHP",
"bytes": "2031784"
}
],
"symlink_target": ""
}
|
import childProcess from 'child_process';
import os from 'os';
import { StrykerOptions } from '@stryker-mutator/api/core';
import { PluginContext } from '@stryker-mutator/api/plugin';
import { isErrnoException, Task, ExpirableTask } from '@stryker-mutator/util';
import { getLogger } from 'log4js';
import { Disposable, InjectableClass, InjectionToken } from 'typed-inject';
import { LoggingClientContext } from '../logging';
import { kill } from '../utils/object-utils';
import { StringBuilder } from '../utils/string-builder';
import { deserialize, padLeft, serialize } from '../utils/string-utils';
import { ChildProcessCrashedError } from './child-process-crashed-error';
import { autoStart, ParentMessage, ParentMessageKind, WorkerMessage, WorkerMessageKind } from './message-protocol';
import { OutOfMemoryError } from './out-of-memory-error';
type Func<TS extends any[], R> = (...args: TS) => R;
type PromisifiedFunc<TS extends any[], R> = (...args: TS) => Promise<R>;
export type Promisified<T> = {
[K in keyof T]: T[K] extends PromisifiedFunc<any, any> ? T[K] : T[K] extends Func<infer TS, infer R> ? PromisifiedFunc<TS, R> : () => Promise<T[K]>;
};
const BROKEN_PIPE_ERROR_CODE = 'EPIPE';
const IPC_CHANNEL_CLOSED_ERROR_CODE = 'ERR_IPC_CHANNEL_CLOSED';
const TIMEOUT_FOR_DISPOSE = 2000;
export class ChildProcessProxy<T> implements Disposable {
public readonly proxy: Promisified<T>;
private readonly worker: childProcess.ChildProcess;
private readonly initTask: Task;
private disposeTask: ExpirableTask | undefined;
private currentError: ChildProcessCrashedError | undefined;
private readonly workerTasks: Task[] = [];
private readonly log = getLogger(ChildProcessProxy.name);
private readonly stdoutBuilder = new StringBuilder();
private readonly stderrBuilder = new StringBuilder();
private isDisposed = false;
private constructor(
requirePath: string,
requireName: string,
loggingContext: LoggingClientContext,
options: StrykerOptions,
additionalInjectableValues: unknown,
workingDirectory: string,
execArgv: string[]
) {
this.worker = childProcess.fork(require.resolve('./child-process-proxy-worker'), [autoStart], { silent: true, execArgv });
this.initTask = new Task();
this.log.debug('Started %s in child process %s%s', requireName, this.worker.pid, execArgv.length ? ` (using args ${execArgv.join(' ')})` : '');
this.send({
additionalInjectableValues,
kind: WorkerMessageKind.Init,
loggingContext,
options,
requireName,
requirePath,
workingDirectory,
});
this.listenForMessages();
this.listenToStdoutAndStderr();
// Listen to `close`, not `exit`, see https://github.com/stryker-mutator/stryker-js/issues/1634
this.worker.on('close', this.handleUnexpectedExit);
this.worker.on('error', this.handleError);
this.proxy = this.initProxy();
}
/**
* @description Creates a proxy where each function of the object created using the constructorFunction arg is ran inside of a child process
*/
public static create<TAdditionalContext, R, Tokens extends Array<InjectionToken<PluginContext & TAdditionalContext>>>(
requirePath: string,
loggingContext: LoggingClientContext,
options: StrykerOptions,
additionalInjectableValues: TAdditionalContext,
workingDirectory: string,
injectableClass: InjectableClass<PluginContext & TAdditionalContext, R, Tokens>,
execArgv: string[]
): ChildProcessProxy<R> {
return new ChildProcessProxy(requirePath, injectableClass.name, loggingContext, options, additionalInjectableValues, workingDirectory, execArgv);
}
private send(message: WorkerMessage) {
this.worker.send(serialize(message));
}
private initProxy(): Promisified<T> {
// This proxy is a genuine javascript `Proxy` class
// More info: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy
const self = this;
return new Proxy({} as Promisified<T>, {
get(_, propertyKey) {
if (typeof propertyKey === 'string') {
return self.forward(propertyKey);
} else {
return undefined;
}
},
});
}
private forward(methodName: string) {
return async (...args: any[]) => {
if (this.currentError) {
return Promise.reject(this.currentError);
} else {
const workerTask = new Task<void>();
const correlationId = this.workerTasks.push(workerTask) - 1;
this.initTask.promise.then(() => {
this.send({
args,
correlationId,
kind: WorkerMessageKind.Call,
methodName,
});
});
return workerTask.promise;
}
};
}
private listenForMessages() {
this.worker.on('message', (serializedMessage: string) => {
const message = deserialize<ParentMessage>(serializedMessage);
switch (message.kind) {
case ParentMessageKind.Initialized:
this.initTask.resolve(undefined);
break;
case ParentMessageKind.Result:
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
this.workerTasks[message.correlationId].resolve(message.result);
delete this.workerTasks[message.correlationId];
break;
case ParentMessageKind.Rejection:
this.workerTasks[message.correlationId].reject(new Error(message.error));
delete this.workerTasks[message.correlationId];
break;
case ParentMessageKind.DisposeCompleted:
if (this.disposeTask) {
this.disposeTask.resolve(undefined);
}
break;
default:
this.logUnidentifiedMessage(message);
break;
}
});
}
private listenToStdoutAndStderr() {
const handleData = (builder: StringBuilder) => (data: Buffer | string) => {
const output = data.toString();
builder.append(output);
if (this.log.isTraceEnabled()) {
this.log.trace(output);
}
};
if (this.worker.stdout) {
this.worker.stdout.on('data', handleData(this.stdoutBuilder));
}
if (this.worker.stderr) {
this.worker.stderr.on('data', handleData(this.stderrBuilder));
}
}
public get stdout(): string {
return this.stdoutBuilder.toString();
}
public get stderr(): string {
return this.stderrBuilder.toString();
}
private reportError(error: Error) {
this.workerTasks.filter((task) => !task.isCompleted).forEach((task) => task.reject(error));
}
private readonly handleUnexpectedExit = (code: number, signal: string) => {
this.isDisposed = true;
const output = StringBuilder.concat(this.stderrBuilder, this.stdoutBuilder);
if (processOutOfMemory()) {
this.currentError = new OutOfMemoryError(this.worker.pid, code);
this.log.warn(`Child process [pid ${this.currentError.pid}] ran out of memory. Stdout and stderr are logged on debug level.`);
this.log.debug(stdoutAndStderr());
} else {
this.currentError = new ChildProcessCrashedError(
this.worker.pid,
`Child process [pid ${this.worker.pid}] exited unexpectedly with exit code ${code} (${signal || 'without signal'}). ${stdoutAndStderr()}`,
code,
signal
);
this.log.warn(this.currentError.message, this.currentError);
}
this.reportError(this.currentError);
function processOutOfMemory() {
return output.includes('JavaScript heap out of memory') || output.includes('FatalProcessOutOfMemory');
}
function stdoutAndStderr() {
if (output.length) {
return `Last part of stdout and stderr was:${os.EOL}${padLeft(output)}`;
} else {
return 'Stdout and stderr were empty.';
}
}
};
private readonly handleError = (error: Error) => {
if (this.innerProcessIsCrashed(error)) {
this.log.warn(`Child process [pid ${this.worker.pid}] has crashed. See other warning messages for more info.`, error);
this.reportError(
new ChildProcessCrashedError(this.worker.pid, `Child process [pid ${this.worker.pid}] has crashed`, undefined, undefined, error)
);
} else {
this.reportError(error);
}
};
private innerProcessIsCrashed(error: Error) {
return isErrnoException(error) && (error.code === BROKEN_PIPE_ERROR_CODE || error.code === IPC_CHANNEL_CLOSED_ERROR_CODE);
}
public async dispose(): Promise<void> {
if (!this.isDisposed) {
this.worker.removeListener('close', this.handleUnexpectedExit);
this.isDisposed = true;
this.log.debug('Disposing of worker process %s', this.worker.pid);
this.disposeTask = new ExpirableTask(TIMEOUT_FOR_DISPOSE);
this.send({ kind: WorkerMessageKind.Dispose });
try {
await this.disposeTask.promise;
} finally {
this.log.debug('Kill %s', this.worker.pid);
await kill(this.worker.pid);
}
}
}
private logUnidentifiedMessage(message: never) {
this.log.error(`Received unidentified message ${message}`);
}
}
|
{
"content_hash": "5ac30b22ca2f1901ca4258c5d81d0dfe",
"timestamp": "",
"source": "github",
"line_count": 252,
"max_line_length": 150,
"avg_line_length": 36.08730158730159,
"alnum_prop": 0.6693424235759842,
"repo_name": "stryker-mutator/stryker",
"id": "a27a5481eb68b5040d4a57b7bf8ee683bea3e9d0",
"size": "9094",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "packages/core/src/child-proxy/child-process-proxy.ts",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "5215"
},
{
"name": "HTML",
"bytes": "24047"
},
{
"name": "JavaScript",
"bytes": "110027"
},
{
"name": "TypeScript",
"bytes": "1127023"
},
{
"name": "Vue",
"bytes": "2239"
}
],
"symlink_target": ""
}
|
package org.apache.coyote.http2;
import java.nio.ByteBuffer;
import org.junit.Assert;
import org.junit.Test;
/**
* Unit tests for Section 5.§ of
* <a href="https://tools.ietf.org/html/rfc7540">RFC 7540</a>.
* <br>
* The order of tests in this class is aligned with the order of the
* requirements in the RFC.
*/
public class TestHttp2Section_5_1 extends Http2TestBase {
@Test
public void testIdleStateInvalidFrame01() throws Exception {
http2Connect();
sendWindowUpdate(3, 200);
parser.readFrame(true);
Assert.assertTrue(output.getTrace(), output.getTrace().startsWith(
"0-Goaway-[1]-[" + Http2Error.PROTOCOL_ERROR.getCode() + "]-["));
}
@Test
public void testIdleStateInvalidFrame02() throws Exception {
http2Connect();
sendData(3, new byte[] {});
parser.readFrame(true);
Assert.assertTrue(output.getTrace(), output.getTrace().startsWith(
"0-Goaway-[1]-[" + Http2Error.PROTOCOL_ERROR.getCode() + "]-["));
}
// TODO: reserved local
// TODO: reserved remote
@Test
public void halfClosedRemoteInvalidFrame() throws Exception {
http2Connect();
// This half-closes the stream since it includes the end of stream flag
sendSimpleGetRequest(3);
readSimpleGetResponse();
Assert.assertEquals(getSimpleResponseTrace(3), output.getTrace());
output.clearTrace();
// This should trigger a stream error
sendData(3, new byte[] {});
parser.readFrame(true);
Assert.assertTrue(output.getTrace(), output.getTrace().startsWith(
"0-Goaway-[3]-[" + Http2Error.STREAM_CLOSED.getCode() + "]-["));
}
@Test
public void testClosedInvalidFrame01() throws Exception {
// HTTP2 upgrade
http2Connect();
// Build the simple request
byte[] frameHeader = new byte[9];
ByteBuffer headersPayload = ByteBuffer.allocate(128);
buildSimpleGetRequest(frameHeader, headersPayload, null, 3);
// Remove the end of stream and end of headers flags
frameHeader[4] = 0;
// Process the request
writeFrame(frameHeader, headersPayload);
// Send a rst
sendRst(3, Http2Error.INTERNAL_ERROR.getCode());
// Then try sending some data (which should fail)
sendData(3, new byte[] {});
parser.readFrame(true);
Assert.assertTrue(output.getTrace(),
output.getTrace().startsWith("3-RST-[" + Http2Error.STREAM_CLOSED.getCode() + "]"));
}
@Test
public void testClosedInvalidFrame02() throws Exception {
http2Connect();
// Stream 1 is closed. This should trigger a stream error
sendData(1, new byte[] {});
parser.readFrame(true);
Assert.assertTrue(output.getTrace(), output.getTrace().startsWith(
"0-Goaway-[1]-[" + Http2Error.STREAM_CLOSED.getCode() + "]-["));
}
// TODO: Invalid frames for each of the remaining states
// Section 5.1.1
@Test
public void testClientSendEvenStream() throws Exception {
// HTTP2 upgrade
http2Connect();
// Part 1
byte[] frameHeader = new byte[9];
ByteBuffer headersPayload = ByteBuffer.allocate(128);
buildSimpleGetRequestPart1(frameHeader, headersPayload, 4);
writeFrame(frameHeader, headersPayload);
// headers
parser.readFrame(true);
Assert.assertTrue(output.getTrace(), output.getTrace().startsWith(
"0-Goaway-[1]-[" + Http2Error.PROTOCOL_ERROR.getCode() + "]-["));
}
@Test
public void testClientSendOldStream() throws Exception {
http2Connect();
sendSimpleGetRequest(5);
readSimpleGetResponse();
Assert.assertEquals(getSimpleResponseTrace(5), output.getTrace());
output.clearTrace();
// Build the simple request on an old stream
byte[] frameHeader = new byte[9];
ByteBuffer headersPayload = ByteBuffer.allocate(128);
buildSimpleGetRequest(frameHeader, headersPayload, null, 3);
os.write(frameHeader);
os.flush();
// headers
parser.readFrame(true);
Assert.assertTrue(output.getTrace(), output.getTrace().startsWith(
"0-Goaway-[5]-[" + Http2Error.PROTOCOL_ERROR.getCode() + "]-["));
}
@Test
public void testImplicitClose() throws Exception {
http2Connect();
sendPriority(3, 0, 16);
sendPriority(5, 0, 16);
sendSimpleGetRequest(5);
readSimpleGetResponse();
Assert.assertEquals(getSimpleResponseTrace(5), output.getTrace());
output.clearTrace();
// Should trigger an error since stream 3 should have been implicitly
// closed.
sendSimpleGetRequest(3);
parser.readFrame(true);
Assert.assertTrue(output.getTrace(), output.getTrace().startsWith(
"0-Goaway-[5]-[" + Http2Error.PROTOCOL_ERROR.getCode() + "]-["));
}
@Test
public void testExceedMaxActiveStreams() throws Exception {
// http2Connect() - modified
enableHttp2(1);
configureAndStartWebApplication();
openClientConnection();
doHttpUpgrade();
sendClientPreface();
// validateHttp2InitialResponse() - modified
parser.readFrame(true);
parser.readFrame(true);
parser.readFrame(true);
parser.readFrame(true);
parser.readFrame(true);
Assert.assertEquals("0-Settings-[3]-[1]\n" +
"0-Settings-End\n" +
"0-Settings-Ack\n" +
"0-Ping-[0,0,0,0,0,0,0,1]\n" +
getSimpleResponseTrace(1)
, output.getTrace());
output.clearTrace();
sendLargeGetRequest(3);
sendSimpleGetRequest(5);
// Default connection window size is 64k-1.
// Initial request will have used 8k leaving 56k-1.
// Stream window will be 64k-1.
// Expecting
// 1 * headers
// 56k-1 of body (7 * ~8k)
// 1 * error (could be in any order)
for (int i = 0; i < 8; i++) {
parser.readFrame(true);
}
parser.readFrame(true);
Assert.assertTrue(output.getTrace(),
output.getTrace().contains("5-RST-[" +
Http2Error.REFUSED_STREAM.getCode() + "]"));
output.clearTrace();
// Connection window is zero.
// Stream window is 8k
// Release the remaining body
sendWindowUpdate(0, (1 << 31) - 2);
// Allow for the 8k still in the stream window
sendWindowUpdate(3, (1 << 31) - 8193);
// 192k of body (24 * 8k)
// 1 * error (could be in any order)
for (int i = 0; i < 24; i++) {
parser.readFrame(true);
}
}
@Test
public void testErrorOnWaitingStream() throws Exception {
// http2Connect() - modified
enableHttp2(1);
configureAndStartWebApplication();
openClientConnection();
doHttpUpgrade();
sendClientPreface();
// validateHttp2InitialResponse() - modified
parser.readFrame(true);
parser.readFrame(true);
parser.readFrame(true);
parser.readFrame(true);
parser.readFrame(true);
Assert.assertEquals("0-Settings-[3]-[1]\n" +
"0-Settings-End\n" +
"0-Settings-Ack\n" +
"0-Ping-[0,0,0,0,0,0,0,1]\n" +
getSimpleResponseTrace(1)
, output.getTrace());
output.clearTrace();
sendLargeGetRequest(3);
sendSimpleGetRequest(5);
// Default connection window size is 64k-1.
// Initial request will have used 8k leaving 56k-1.
// Stream window will be 64k-1.
// Expecting
// 1 * headers
// 56k-1 of body (7 * ~8k)
// 1 * error (could be in any order)
for (int i = 0; i < 8; i++) {
parser.readFrame(true);
}
parser.readFrame(true);
Assert.assertTrue(output.getTrace(),
output.getTrace().contains("5-RST-[" +
Http2Error.REFUSED_STREAM.getCode() + "]"));
output.clearTrace();
// Connection window is zero.
// Stream window is 8k
// Expand the stream window too much to trigger an error
// Allow for the 8k still in the stream window
sendWindowUpdate(3, (1 << 31) - 1);
parser.readFrame(true);
}
}
|
{
"content_hash": "fdb8bdd752d80122b7920be2a1f85e16",
"timestamp": "",
"source": "github",
"line_count": 294,
"max_line_length": 100,
"avg_line_length": 29.333333333333332,
"alnum_prop": 0.5824443413729128,
"repo_name": "Nickname0806/Test_Q4",
"id": "a03fdf8a5c2b8caf30d62ee5eaa07708667fc672",
"size": "9438",
"binary": false,
"copies": "1",
"ref": "refs/heads/trunk",
"path": "test/org/apache/coyote/http2/TestHttp2Section_5_1.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "37067"
},
{
"name": "CSS",
"bytes": "13304"
},
{
"name": "HTML",
"bytes": "324818"
},
{
"name": "Java",
"bytes": "18705370"
},
{
"name": "NSIS",
"bytes": "40764"
},
{
"name": "Perl",
"bytes": "13860"
},
{
"name": "Shell",
"bytes": "47014"
},
{
"name": "XSLT",
"bytes": "31592"
}
],
"symlink_target": ""
}
|
'use strict';
describe('ddah.promises module category', function(){
beforeEach(module('ddah.promises'));
it('can be instanciated', function(){
var category = new Category('this is a promise');
expect(category.name).toEqual('this is a promise')
expect(category.slug).toEqual('this-is-a-promise')
expect(category.promises instanceof Array).toBe(true)
})
it('can add a promise to a category', function(){
var category = new Category('this is a promise');
var promise = new Prom();
promise.name = 'this is a promise'
promise.description = "this is a description"
promise.fulfillment = 10
promise.ponderator = 0.1
promise.quality = 70
category.add_promise(promise)
expect(category.promises.length).toEqual(1)
var p = category.promises[0]
expect(p.category).toEqual(category)
})
it('has a summary', function(){
var category = new Category('this is a promise');
var promise = new Prom();
promise.name = 'this is a promise'
promise.description = "this is a description"
promise.fulfillment = 10
promise.ponderator = 0.1
promise.quality = 70
category.add_promise(promise)
expect(category.summary().in_progress).toEqual(1)
});
})
|
{
"content_hash": "f1294bcb0bd0bb5835e7d46fb791e12c",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 61,
"avg_line_length": 32.095238095238095,
"alnum_prop": 0.6194362017804155,
"repo_name": "lfalvarez/angular-promises",
"id": "cf47af306c6b4266c734791e769cb70ff36cdd5e",
"size": "1348",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/components/promises/category_test.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "366"
},
{
"name": "HTML",
"bytes": "5741"
},
{
"name": "JavaScript",
"bytes": "15426"
}
],
"symlink_target": ""
}
|
#import <UIKit/UIKit.h>
#import "ZXBarcodeFormat.h"
@class ZXBitMatrix, ZXEncodeHints;
/**
* The base class for all objects which encode/generate a barcode image.
*/
@protocol ZXWriter <NSObject>
/**
* Encode a barcode using the default settings.
*
* @param contents The contents to encode in the barcode
* @param format The barcode format to generate
* @param width The preferred width in pixels
* @param height The preferred height in pixels
*/
- (ZXBitMatrix *)encode:(NSString *)contents format:(ZXBarcodeFormat)format width:(int)width height:(int)height error:(NSError **)error;
/**
*
* @param contents The contents to encode in the barcode
* @param format The barcode format to generate
* @param width The preferred width in pixels
* @param height The preferred height in pixels
* @param hints Additional parameters to supply to the encoder
*/
- (ZXBitMatrix *)encode:(NSString *)contents format:(ZXBarcodeFormat)format width:(int)width height:(int)height hints:(ZXEncodeHints *)hints error:(NSError **)error;
@end
|
{
"content_hash": "287a8dcc61b7c70dc20a299b6768ef36",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 165,
"avg_line_length": 31.636363636363637,
"alnum_prop": 0.7452107279693486,
"repo_name": "MahmoudAmin/iOSProjectG4",
"id": "a71d831924689cca2540d151efe6a0fd0d4187b9",
"size": "1641",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "MDW/libs/ZXingObjC/core/ZXWriter.h",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "5880"
},
{
"name": "Objective-C",
"bytes": "2379602"
}
],
"symlink_target": ""
}
|
#ifndef HW_DEVICE_H
#define HW_DEVICE_H
/* declared in sim-basics.h, this object is used everywhere */
/* typedef struct _device device; */
/* Introduction:
As explained in earlier sections, the device, device instance,
property and ports lie at the heart of PSIM's device model.
In the below a synopsis of the device object and the operations it
supports are given.
*/
/* Creation:
The devices are created using a sequence of steps. In particular:
o A tree framework is created.
At this point, properties can be modified and extra
devices inserted (or removed?).
#if LATER
Any properties that have a run-time value (eg ihandle
or device instance pointer properties) are entered
into the device tree using a named reference to the
corresponding runtime object that is to be created.
#endif
o Real devices are created for all the dummy devices.
A device can assume that all of its parents have been
initialized.
A device can assume that all non run-time properties
have been initialized.
As part of being created, the device normally attaches
itself to its parent bus.
#if LATER
Device instance data is initialized.
#endif
#if LATER
o Any run-time properties are created.
#endif
#if MUCH_MUCH_LATER
o Some devices, as part of their initialization
might want to refer to ihandle properties
in the device tree.
#endif
NOTES:
o It is important to separate the creation
of an actual device from the creation
of the tree. The alternative creating
the device in two stages: As a separate
entity and then as a part of the tree.
#if LATER
o Run-time properties can not be created
until after the devices in the tree
have been created. Hence an extra pass
for handling them.
#endif
*/
/* Relationships:
A device is able to determine its relationship to other devices
within the tree. Operations include querying for a devices parent,
sibling, child, name, and path (from the root).
*/
#define hw_parent(hw) ((hw)->parent_of_hw + 0)
#define hw_sibling(hw) ((hw)->sibling_of_hw + 0)
#define hw_child(hw) ((hw)->child_of_hw + 0)
/* Herritage:
*/
#define hw_family(hw) ((hw)->family_of_hw + 0)
#define hw_name(hw) ((hw)->name_of_hw + 0)
#define hw_args(hw) ((hw)->args_of_hw + 0)
#define hw_path(hw) ((hw)->path_of_hw + 0)
/* Short cut to the root node of the tree */
#define hw_root(hw) ((hw)->root_of_hw + 0)
/* Short cut back to the simulator object */
#define hw_system(hw) ((hw)->system_of_hw)
/* For requests initiated by a CPU the cpu that initiated the request */
struct _sim_cpu *hw_system_cpu (struct hw *hw);
/* Device private data */
#define hw_data(hw) ((hw)->data_of_hw)
#define set_hw_data(hw, value) \
((hw)->data_of_hw = (value))
/* Perform a soft reset of the device */
typedef unsigned (hw_reset_method)
(struct hw *me);
#define hw_reset(hw) ((hw)->to_reset (hw))
#define set_hw_reset(hw, method) \
((hw)->to_reset = method)
/* Hardware operations:
Connecting a parent to its children is a common bus. The parent
node is described as the bus owner and is responisble for
co-ordinating bus operations. On the bus, a SPACE:ADDR pair is used
to specify an address. A device that is both a bus owner (parent)
and bus client (child) are referred to as a bridging device.
A child performing a data (DMA) transfer will pass its request to
the bus owner (the devices parent). The bus owner will then either
reflect the request to one of the other devices attached to the bus
(a child of the bus owner) or bridge the request up the tree to the
next bus. */
/* Children attached to a bus can register (attach) themselves to
specific addresses on their attached bus.
(A device may also be implicitly attached to certain bus
addresses).
The SPACE:ADDR pair specify an address on the common bus that
connects the parent and child devices. */
typedef void (hw_attach_address_method)
(struct hw *me,
int level,
int space,
address_word addr,
address_word nr_bytes,
struct hw *client); /*callback/default*/
#define hw_attach_address(me, level, space, addr, nr_bytes, client) \
((me)->to_attach_address (me, level, space, addr, nr_bytes, client))
#define set_hw_attach_address(hw, method) \
((hw)->to_attach_address = (method))
typedef void (hw_detach_address_method)
(struct hw *me,
int level,
int space,
address_word addr,
address_word nr_bytes,
struct hw *client); /*callback/default*/
#define hw_detach_address(me, level, space, addr, nr_bytes, client) \
((me)->to_detach_address (me, level, space, addr, nr_bytes, client))
#define set_hw_detach_address(hw, method) \
((hw)->to_detach_address = (method))
/* An IO operation from a parent to a child via the conecting bus.
The SPACE:ADDR pair specify an address on the bus shared between
the parent and child devices. */
typedef unsigned (hw_io_read_buffer_method)
(struct hw *me,
void *dest,
int space,
unsigned_word addr,
unsigned nr_bytes);
#define hw_io_read_buffer(hw, dest, space, addr, nr_bytes) \
((hw)->to_io_read_buffer (hw, dest, space, addr, nr_bytes))
#define set_hw_io_read_buffer(hw, method) \
((hw)->to_io_read_buffer = (method))
typedef unsigned (hw_io_write_buffer_method)
(struct hw *me,
const void *source,
int space,
unsigned_word addr,
unsigned nr_bytes);
#define hw_io_write_buffer(hw, src, space, addr, nr_bytes) \
((hw)->to_io_write_buffer (hw, src, space, addr, nr_bytes))
#define set_hw_io_write_buffer(hw, method) \
((hw)->to_io_write_buffer = (method))
/* Conversly, the device pci1000,1@1 may need to perform a dma transfer
into the cpu/memory core. Just as I/O moves towards the leaves,
dma transfers move towards the core via the initiating devices
parent nodes. The root device (special) converts the DMA transfer
into reads/writes to memory.
The SPACE:ADDR pair specify an address on the common bus connecting
the parent and child devices. */
typedef unsigned (hw_dma_read_buffer_method)
(struct hw *bus,
void *dest,
int space,
unsigned_word addr,
unsigned nr_bytes);
#define hw_dma_read_buffer(bus, dest, space, addr, nr_bytes) \
((bus)->to_dma_read_buffer (bus, dest, space, addr, nr_bytes))
#define set_hw_dma_read_buffer(me, method) \
((me)->to_dma_read_buffer = (method))
typedef unsigned (hw_dma_write_buffer_method)
(struct hw *bus,
const void *source,
int space,
unsigned_word addr,
unsigned nr_bytes,
int violate_read_only_section);
#define hw_dma_write_buffer(bus, src, space, addr, nr_bytes, violate_ro) \
((bus)->to_dma_write_buffer (bus, src, space, addr, nr_bytes, violate_ro))
#define set_hw_dma_write_buffer(me, method) \
((me)->to_dma_write_buffer = (method))
/* Address/size specs for devices are encoded following a convention
similar to that used by OpenFirmware. In particular, an
address/size is packed into a sequence of up to four cell words.
The number of words determined by the number of {address,size}
cells attributes of the device. */
typedef struct _hw_unit
{
int nr_cells;
unsigned_cell cells[4]; /* unused cells are zero */
} hw_unit;
/* For the given bus, the number of address and size cells used in a
hw_unit. */
#define hw_unit_nr_address_cells(bus) ((bus)->nr_address_cells_of_hw_unit + 0)
#define hw_unit_nr_size_cells(bus) ((bus)->nr_size_cells_of_hw_unit + 0)
/* For the given device, its identifying hw_unit address.
Each device has an identifying hw_unit address. That address is
used when identifying one of a number of identical devices on a
common controller bus. ex fd0&fd1. */
const hw_unit *hw_unit_address
(struct hw *me);
/* Convert between a textual and the internal representation of a
hw_unit address/size.
NOTE: A device asks its parent to translate between a hw_unit and
textual representation. This is because the textual address of a
device is specified using the parent busses notation. */
typedef int (hw_unit_decode_method)
(struct hw *bus,
const char *encoded,
hw_unit *unit);
#define hw_unit_decode(bus, encoded, unit) \
((bus)->to_unit_decode (bus, encoded, unit))
#define set_hw_unit_decode(hw, method) \
((hw)->to_unit_decode = (method))
typedef int (hw_unit_encode_method)
(struct hw *bus,
const hw_unit *unit,
char *encoded,
int sizeof_buf);
#define hw_unit_encode(bus, unit, encoded, sizeof_encoded) \
((bus)->to_unit_encode (bus, unit, encoded, sizeof_encoded))
#define set_hw_unit_encode(hw, method) \
((hw)->to_unit_encode = (method))
/* As the bus that the device is attached too, to translate a devices
hw_unit address/size into a form suitable for an attach address
call.
Return a zero result if the address should be ignored when looking
for attach addresses. */
typedef int (hw_unit_address_to_attach_address_method)
(struct hw *bus,
const hw_unit *unit_addr,
int *attach_space,
unsigned_word *attach_addr,
struct hw *client);
#define hw_unit_address_to_attach_address(bus, unit_addr, attach_space, attach_addr, client) \
((bus)->to_unit_address_to_attach_address (bus, unit_addr, attach_space, attach_addr, client))
#define set_hw_unit_address_to_attach_address(hw, method) \
((hw)->to_unit_address_to_attach_address = (method))
typedef int (hw_unit_size_to_attach_size_method)
(struct hw *bus,
const hw_unit *unit_size,
unsigned *attach_size,
struct hw *client);
#define hw_unit_size_to_attach_size(bus, unit_size, attach_size, client) \
((bus)->to_unit_size_to_attach_size (bus, unit_size, attach_size, client))
#define set_hw_unit_size_to_attach_size(hw, method) \
((hw)->to_unit_size_to_attach_size = (method))
extern char *hw_strdup (struct hw *me, const char *str);
/* Utilities:
*/
/* IOCTL::
Often devices require `out of band' operations to be performed.
For instance a pal device may need to notify a PCI bridge device
that an interrupt ack cycle needs to be performed on the PCI bus.
Within PSIM such operations are performed by using the generic
ioctl call <<hw_ioctl()>>.
*/
typedef enum
{
hw_ioctl_break, /* unsigned_word requested_break */
hw_ioctl_set_trace, /* void */
hw_ioctl_create_stack, /* unsigned_word *sp, char **argv, char **envp */
hw_ioctl_change_media, /* const char *new_image (possibly NULL) */
nr_hw_ioctl_requests,
} hw_ioctl_request;
typedef int (hw_ioctl_method)
(struct hw *me,
hw_ioctl_request request,
va_list ap);
int hw_ioctl
(struct hw *me,
hw_ioctl_request request,
...);
/* Error reporting::
So that errors originating from devices appear in a consistent
format, the <<hw_abort()>> function can be used. Formats and
outputs the error message before aborting the simulation
Devices should use this function to abort the simulation except
when the abort reason leaves the simulation in a hazardous
condition (for instance a failed malloc).
*/
void hw_abort
(struct hw *me,
const char *fmt,
...) __attribute__ ((format (printf, 2, 3), noreturn));
void hw_vabort
(struct hw *me,
const char *fmt,
va_list ap) __attribute__ ((noreturn));
void hw_halt
(struct hw *me,
int reason,
int status) __attribute__ ((noreturn));
#define hw_trace_p(hw) ((hw)->trace_of_hw_p + 0)
void hw_trace
(struct hw *me,
const char *fmt,
...) __attribute__ ((format (printf, 2, 3)));
#define HW_TRACE(ARGS) \
do { \
if (hw_trace_p (me)) \
{ \
hw_trace ARGS; \
} \
} while (0)
/* Some of the related functions require specific types */
struct hw_property_data;
struct hw_port_data;
struct hw_base_data;
struct hw_alloc_data;
struct hw_event_data;
struct hw_handle_data;
struct hw_instance_data;
/* Finally the hardware device - keep your grubby little mits off of
these internals! :-) */
struct hw
{
/* our relatives */
struct hw *parent_of_hw;
struct hw *sibling_of_hw;
struct hw *child_of_hw;
/* our identity */
const char *name_of_hw;
const char *family_of_hw;
const char *args_of_hw;
const char *path_of_hw;
/* our data */
void *data_of_hw;
/* hot links */
struct hw *root_of_hw;
struct sim_state *system_of_hw;
/* identifying data */
hw_unit unit_address_of_hw;
int nr_address_cells_of_hw_unit;
int nr_size_cells_of_hw_unit;
/* Soft reset */
hw_reset_method *to_reset;
/* Basic callbacks */
hw_io_read_buffer_method *to_io_read_buffer;
hw_io_write_buffer_method *to_io_write_buffer;
hw_dma_read_buffer_method *to_dma_read_buffer;
hw_dma_write_buffer_method *to_dma_write_buffer;
hw_attach_address_method *to_attach_address;
hw_detach_address_method *to_detach_address;
/* More complicated callbacks */
hw_ioctl_method *to_ioctl;
int trace_of_hw_p;
/* address callbacks */
hw_unit_decode_method *to_unit_decode;
hw_unit_encode_method *to_unit_encode;
hw_unit_address_to_attach_address_method *to_unit_address_to_attach_address;
hw_unit_size_to_attach_size_method *to_unit_size_to_attach_size;
/* related data */
struct hw_property_data *properties_of_hw;
struct hw_port_data *ports_of_hw;
struct hw_base_data *base_of_hw;
struct hw_alloc_data *alloc_of_hw;
struct hw_event_data *events_of_hw;
struct hw_handle_data *handles_of_hw;
struct hw_instance_data *instances_of_hw;
};
#endif
|
{
"content_hash": "20b41cb31b5c6bb64fae3793ede9ee21",
"timestamp": "",
"source": "github",
"line_count": 525,
"max_line_length": 94,
"avg_line_length": 25.746666666666666,
"alnum_prop": 0.6860989864614929,
"repo_name": "execunix/vinos",
"id": "59265e8c9238c0b61085c3cb8022f2f1fd3ef98f",
"size": "14355",
"binary": false,
"copies": "41",
"ref": "refs/heads/master",
"path": "external/gpl3/gdb/dist/sim/common/hw-device.h",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"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_11) on Fri Mar 29 12:36:16 EDT 2013 -->
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>Uses of Class edu.msu.nscl.olog.Attribute (Olog Directory Service 2.2.3-SNAPSHOT API)</title>
<meta name="date" content="2013-03-29">
<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 edu.msu.nscl.olog.Attribute (Olog Directory Service 2.2.3-SNAPSHOT API)";
}
//-->
</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="../../../../../edu/msu/nscl/olog/package-summary.html">Package</a></li>
<li><a href="../../../../../edu/msu/nscl/olog/Attribute.html" title="class in edu.msu.nscl.olog">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-all.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?edu/msu/nscl/olog/class-use/Attribute.html" target="_top">Frames</a></li>
<li><a href="Attribute.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 edu.msu.nscl.olog.Attribute" class="title">Uses of Class<br>edu.msu.nscl.olog.Attribute</h2>
</div>
<div class="classUseContainer">
<ul class="blockList">
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="edu.msu.nscl.olog">
<!-- -->
</a>
<h3>Uses of <a href="../../../../../edu/msu/nscl/olog/Attribute.html" title="class in edu.msu.nscl.olog">Attribute</a> in <a href="../../../../../edu/msu/nscl/olog/package-summary.html">edu.msu.nscl.olog</a></h3>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing fields, and an explanation">
<caption><span>Fields in <a href="../../../../../edu/msu/nscl/olog/package-summary.html">edu.msu.nscl.olog</a> with type parameters of type <a href="../../../../../edu/msu/nscl/olog/Attribute.html" title="class in edu.msu.nscl.olog">Attribute</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>static javax.persistence.metamodel.SingularAttribute<<a href="../../../../../edu/msu/nscl/olog/LogAttribute.html" title="class in edu.msu.nscl.olog">LogAttribute</a>,<a href="../../../../../edu/msu/nscl/olog/Attribute.html" title="class in edu.msu.nscl.olog">Attribute</a>></code></td>
<td class="colLast"><span class="strong">LogAttribute_.</span><code><strong><a href="../../../../../edu/msu/nscl/olog/LogAttribute_.html#attribute">attribute</a></strong></code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static javax.persistence.metamodel.SetAttribute<<a href="../../../../../edu/msu/nscl/olog/Property.html" title="class in edu.msu.nscl.olog">Property</a>,<a href="../../../../../edu/msu/nscl/olog/Attribute.html" title="class in edu.msu.nscl.olog">Attribute</a>></code></td>
<td class="colLast"><span class="strong">Property_.</span><code><strong><a href="../../../../../edu/msu/nscl/olog/Property_.html#attributes">attributes</a></strong></code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static javax.persistence.metamodel.SingularAttribute<<a href="../../../../../edu/msu/nscl/olog/Attribute.html" title="class in edu.msu.nscl.olog">Attribute</a>,<a href="http://java.sun.com/javase/6/docs/api/java/lang/Long.html?is-external=true" title="class or interface in java.lang">Long</a>></code></td>
<td class="colLast"><span class="strong">Attribute_.</span><code><strong><a href="../../../../../edu/msu/nscl/olog/Attribute_.html#id">id</a></strong></code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static javax.persistence.metamodel.SingularAttribute<<a href="../../../../../edu/msu/nscl/olog/Attribute.html" title="class in edu.msu.nscl.olog">Attribute</a>,<a href="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>></code></td>
<td class="colLast"><span class="strong">Attribute_.</span><code><strong><a href="../../../../../edu/msu/nscl/olog/Attribute_.html#name">name</a></strong></code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static javax.persistence.metamodel.SingularAttribute<<a href="../../../../../edu/msu/nscl/olog/Attribute.html" title="class in edu.msu.nscl.olog">Attribute</a>,<a href="../../../../../edu/msu/nscl/olog/Property.html" title="class in edu.msu.nscl.olog">Property</a>></code></td>
<td class="colLast"><span class="strong">Attribute_.</span><code><strong><a href="../../../../../edu/msu/nscl/olog/Attribute_.html#property">property</a></strong></code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static javax.persistence.metamodel.SingularAttribute<<a href="../../../../../edu/msu/nscl/olog/Attribute.html" title="class in edu.msu.nscl.olog">Attribute</a>,<a href="../../../../../edu/msu/nscl/olog/State.html" title="enum in edu.msu.nscl.olog">State</a>></code></td>
<td class="colLast"><span class="strong">Attribute_.</span><code><strong><a href="../../../../../edu/msu/nscl/olog/Attribute_.html#state">state</a></strong></code> </td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../edu/msu/nscl/olog/package-summary.html">edu.msu.nscl.olog</a> that return <a href="../../../../../edu/msu/nscl/olog/Attribute.html" title="class in edu.msu.nscl.olog">Attribute</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="../../../../../edu/msu/nscl/olog/Attribute.html" title="class in edu.msu.nscl.olog">Attribute</a></code></td>
<td class="colLast"><span class="strong">AttributeManager.</span><code><strong><a href="../../../../../edu/msu/nscl/olog/AttributeManager.html#findAttribute(edu.msu.nscl.olog.Property, java.lang.String)">findAttribute</a></strong>(<a href="../../../../../edu/msu/nscl/olog/Property.html" title="class in edu.msu.nscl.olog">Property</a> property,
<a href="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> attributeName)</code>
<div class="block">Finds a tag in the database by name.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../edu/msu/nscl/olog/Attribute.html" title="class in edu.msu.nscl.olog">Attribute</a></code></td>
<td class="colLast"><span class="strong">LogAttribute.</span><code><strong><a href="../../../../../edu/msu/nscl/olog/LogAttribute.html#getAttribute()">getAttribute</a></strong>()</code> </td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../edu/msu/nscl/olog/package-summary.html">edu.msu.nscl.olog</a> that return types with arguments of type <a href="../../../../../edu/msu/nscl/olog/Attribute.html" title="class in edu.msu.nscl.olog">Attribute</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="http://java.sun.com/javase/6/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</a><<a href="../../../../../edu/msu/nscl/olog/Attribute.html" title="class in edu.msu.nscl.olog">Attribute</a>></code></td>
<td class="colLast"><span class="strong">AttributeManager.</span><code><strong><a href="../../../../../edu/msu/nscl/olog/AttributeManager.html#findAll(edu.msu.nscl.olog.Property)">findAll</a></strong>(<a href="../../../../../edu/msu/nscl/olog/Property.html" title="class in edu.msu.nscl.olog">Property</a> property)</code>
<div class="block">Returns the list of set attribute in the database.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="http://java.sun.com/javase/6/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</a><<a href="../../../../../edu/msu/nscl/olog/Attribute.html" title="class in edu.msu.nscl.olog">Attribute</a>></code></td>
<td class="colLast"><span class="strong">Property.</span><code><strong><a href="../../../../../edu/msu/nscl/olog/Property.html#getAttributes()">getAttributes</a></strong>()</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="http://java.sun.com/javase/6/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</a><<a href="../../../../../edu/msu/nscl/olog/Attribute.html" title="class in edu.msu.nscl.olog">Attribute</a>></code></td>
<td class="colLast"><span class="strong">Property.</span><code><strong><a href="../../../../../edu/msu/nscl/olog/Property.html#getAttributeSet()">getAttributeSet</a></strong>()</code> </td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../edu/msu/nscl/olog/package-summary.html">edu.msu.nscl.olog</a> with parameters of type <a href="../../../../../edu/msu/nscl/olog/Attribute.html" title="class in edu.msu.nscl.olog">Attribute</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>void</code></td>
<td class="colLast"><span class="strong">Property.</span><code><strong><a href="../../../../../edu/msu/nscl/olog/Property.html#addAttribute(edu.msu.nscl.olog.Attribute)">addAttribute</a></strong>(<a href="../../../../../edu/msu/nscl/olog/Attribute.html" title="class in edu.msu.nscl.olog">Attribute</a> attribute)</code>
<div class="block">Adds a attribute to the collection.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="strong">LogAttribute.</span><code><strong><a href="../../../../../edu/msu/nscl/olog/LogAttribute.html#setAttribute(edu.msu.nscl.olog.Attribute)">setAttribute</a></strong>(<a href="../../../../../edu/msu/nscl/olog/Attribute.html" title="class in edu.msu.nscl.olog">Attribute</a> attribute)</code> </td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Method parameters in <a href="../../../../../edu/msu/nscl/olog/package-summary.html">edu.msu.nscl.olog</a> with type arguments of type <a href="../../../../../edu/msu/nscl/olog/Attribute.html" title="class in edu.msu.nscl.olog">Attribute</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>void</code></td>
<td class="colLast"><span class="strong">Property.</span><code><strong><a href="../../../../../edu/msu/nscl/olog/Property.html#setAttributes(java.util.Set)">setAttributes</a></strong>(<a href="http://java.sun.com/javase/6/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</a><<a href="../../../../../edu/msu/nscl/olog/Attribute.html" title="class in edu.msu.nscl.olog">Attribute</a>> attributes)</code> </td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing constructors, and an explanation">
<caption><span>Constructor parameters in <a href="../../../../../edu/msu/nscl/olog/package-summary.html">edu.msu.nscl.olog</a> with type arguments of type <a href="../../../../../edu/msu/nscl/olog/Attribute.html" title="class in edu.msu.nscl.olog">Attribute</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colLast"><code><strong><a href="../../../../../edu/msu/nscl/olog/Property.html#Property(java.lang.String, java.util.Set)">Property</a></strong>(<a href="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name,
<a href="http://java.sun.com/javase/6/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</a><<a href="../../../../../edu/msu/nscl/olog/Attribute.html" title="class in edu.msu.nscl.olog">Attribute</a>> attributes)</code> </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="../../../../../edu/msu/nscl/olog/package-summary.html">Package</a></li>
<li><a href="../../../../../edu/msu/nscl/olog/Attribute.html" title="class in edu.msu.nscl.olog">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-all.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?edu/msu/nscl/olog/class-use/Attribute.html" target="_top">Frames</a></li>
<li><a href="Attribute.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 ======= -->
<p class="legalCopy"><small>Copyright © 2010-2013 Michigan State University. All Rights Reserved.</small></p>
</body>
</html>
|
{
"content_hash": "ac9bcd09ca076371c2365bbc60a66a67",
"timestamp": "",
"source": "github",
"line_count": 247,
"max_line_length": 464,
"avg_line_length": 65.64372469635627,
"alnum_prop": 0.6469717528062169,
"repo_name": "Olog/olog.github.com",
"id": "ae85ef9766d4e5a385697274af85c9bcfd9f4441",
"size": "16214",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "2.2.3-SNAPSHOT/modules/olog-service/olog-service/apidocs/edu/msu/nscl/olog/class-use/Attribute.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "270881"
},
{
"name": "JavaScript",
"bytes": "102991"
},
{
"name": "Shell",
"bytes": "618"
},
{
"name": "TeX",
"bytes": "58947"
}
],
"symlink_target": ""
}
|
<?php defined('BASEPATH') or exit('No direct script access allowed');
/**
* Event Library
*/
class Event {
/**
* @var array An array of listeners
*/
protected static $_listeners = array();
protected static $_event_log = FALSE;
protected static $ci;
/**
* Constructor
*/
public function __construct()
{
self::$ci =& get_instance();
self::$ci->load->config('events');
self::$_event_log = config_item('event_log');
self::_load_modules_events();
}
// ------------------------------------------------------------------------
/**
* Load Modules Events
*
*/
private static function _load_modules_events()
{
$modules = array();
require(APPPATH.'config/modules.php');
if ( empty($modules))
return FALSE;
// Add the module path to the Finder
$module_paths = glob(MODPATH.'*');
if ( ! empty($module_paths))
{
foreach ($module_paths as $module_path)
{
$folder = basename($module_path);
if (in_array($folder, $modules))
{
if ( ! $details_class = self::_start_events_class($module_path))
continue;
}
}
}
return TRUE;
}
/**
* Start Events Class
*
* @param string $path Path to the module
* @access private
* @return array
*
*/
private static function _start_events_class($path)
{
$class_file = $path . '/libraries/events'.EXT;
if ( ! is_file($class_file))
return FALSE;
include_once $class_file;
// Now call the details class
$class = ucfirst(strtolower(basename($path))).'_Events';
// Now we need to talk to it
return class_exists($class) ? new $class : FALSE;
}
/**
* Register
*
* Registers a Callback for a given event
*
* @access public
* @param string The name of the event
* @param array The callback for the Event
* @return void
*/
public static function register($event, array $callback)
{
$class = is_object($callback[0]) ? get_class($callback[0]) : $callback[0];
$key = $class.'::'.$callback[1];
self::$_listeners[$event][$key] = $callback;
// log_message('error', 'Event::register() - Registered "'.$key.' with event "'.$event.'"');
}
/**
* Fire
*
* Fires an event and returns the results. The results can be returned
* in the following formats:
*
* 'array'
* 'json'
* 'serialized'
* 'string'
*
* @access public
* @param string The name of the event
* @param mixed Any data that is to be passed to the listener
* @param string The return type
* @return mixed The return of the listeners, in the return type
*/
public static function fire($event, $data = '', $return_type = NULL)
{
log_message('debug', 'Event::fire() : ' . $event );
$calls = array();
if (self::has_listeners($event))
{
foreach (self::$_listeners[$event] as $listener)
{
if (is_callable($listener))
{
$class = is_object($listener[0]) ? get_class($listener[0]) : $listener[0];
// log_message('error', 'Event:: Call ' . $class . '->' . $listener[1] . '()' );
$calls[] = call_user_func($listener, $data);
}
}
}
return self::_format_return($calls, $return_type);
}
/**
* Format Return
*
* Formats the return in the given type
*
* @access protected
* @param array The array of returns
* @param string The return type
* @return mixed The formatted return
*/
protected static function _format_return(array $calls, $return_type = NULL)
{
// log_message('debug', 'Event::_format_return() - Formating calls in type "'.$return_type.'"');
switch ($return_type)
{
case 'array':
return $calls;
break;
case 'json':
return json_encode($calls);
break;
case 'serialized':
return serialize($calls);
break;
case 'string':
$str = '';
foreach ($calls as $call)
{
$str .= $call;
}
return $str;
break;
default:
return $calls;
}
}
/**
* Has Listeners
*
* Checks if the event has listeners
*
* @access public
* @param $event string Name of the event
* @return bool Whether the event has listeners
*/
public static function has_listeners($event)
{
// log_message('debug', 'Event::has_listeners() - Checking if event "'.$event.'" has listeners.');
if (isset(self::$_listeners[$event]) AND count(self::$_listeners[$event]) > 0)
{
return TRUE;
}
return FALSE;
}
public static function log_success($message='')
{
return self::log_message('success', $message);
}
public static function log_error($message='')
{
return self::log_message('error', $message);
}
private static function log_message($status = 'error', $message='')
{
if (self::$_event_log == TRUE)
{
if ( ! isset(self::$ci->event_model))
self::$ci->load->model('event_model', '', TRUE);
$user = User()->get_user();
$data = array(
'status' => $status,
'message' => $message,
'id_user' => $user['id_user'],
'email' => $user['email'],
'date_log' => date('Y-m-d H:i:s'),
'ip_address' => self::$ci->input->ip_address(),
);
return self::$ci->event_model->insert($data);
}
return FALSE;
}
}
|
{
"content_hash": "b7be1048a3dbb9f48804b08e14ec1cd6",
"timestamp": "",
"source": "github",
"line_count": 245,
"max_line_length": 100,
"avg_line_length": 21.66122448979592,
"alnum_prop": 0.5630299604296213,
"repo_name": "GWRon/ionize",
"id": "63e850850c0687043a31377774817425b23a19f2",
"size": "5618",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "application/libraries/Event.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "2129775"
},
{
"name": "PHP",
"bytes": "4994457"
},
{
"name": "Perl",
"bytes": "26"
},
{
"name": "Shell",
"bytes": "1857"
}
],
"symlink_target": ""
}
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>src/custom/ID12RFIDReader.js - Breakout</title>
<link rel="stylesheet" href="http://yui.yahooapis.com/3.9.1/build/cssgrids/cssgrids-min.css">
<link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
<link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
<link rel="shortcut icon" type="image/png" href="../assets/favicon.png">
<script src="http://yui.yahooapis.com/combo?3.9.1/build/yui/yui-min.js"></script>
</head>
<body class="yui3-skin-sam">
<div id="doc">
<div id="header">
<a href="http://breakoutjs.com"><img id="logo" src="http://breakoutjs.com/wp-content/uploads/2012/02/header_logo.png"></a>
<div id="links">
<a class="header_links" href="http://breakoutjs.com/getting-started/">Getting Started</a>
<a class="header_links" href="http://breakoutjs.com/guides/">Guides</a>
<a class="header_links" href="http://breakoutjs.com/forum/breakout-forum/">Forum</a>
<a class="header_links" href="http://breakoutjs.com/download/">Download</a>
</div>
</div>
<div id="bd" class="yui3-g">
<div class="yui3-u-1-4">
<div id="docs-sidebar" class="sidebar apidocs">
<div id="api-list">
<h2 class="off-left">v0.3.1 APIs</h2>
<div id="api-tabview" class="tabview">
<ul class="tabs">
<li><a href="#api-classes">Classes</a></li>
<li><a href="#api-modules">Modules</a></li>
</ul>
<div id="api-tabview-filter">
<input type="search" id="api-filter" placeholder="Type to filter APIs">
</div>
<div id="api-tabview-panel">
<ul id="api-classes" class="apis classes">
<li><a href="../classes/BO.custom.ID12RFIDReader.html">BO.custom.ID12RFIDReader</a></li>
<li><a href="../classes/BO.custom.RFIDEvent.html">BO.custom.RFIDEvent</a></li>
<li><a href="../classes/BO.filters.Convolution.html">BO.filters.Convolution</a></li>
<li><a href="../classes/BO.filters.FilterBase.html">BO.filters.FilterBase</a></li>
<li><a href="../classes/BO.filters.Scaler.html">BO.filters.Scaler</a></li>
<li><a href="../classes/BO.filters.TriggerPoint.html">BO.filters.TriggerPoint</a></li>
<li><a href="../classes/BO.generators.GeneratorBase.html">BO.generators.GeneratorBase</a></li>
<li><a href="../classes/BO.generators.GeneratorEvent.html">BO.generators.GeneratorEvent</a></li>
<li><a href="../classes/BO.generators.Oscillator.html">BO.generators.Oscillator</a></li>
<li><a href="../classes/BO.I2CBase.html">BO.I2CBase</a></li>
<li><a href="../classes/BO.io.AccelerometerADXL345.html">BO.io.AccelerometerADXL345</a></li>
<li><a href="../classes/BO.io.AccelerometerEvent.html">BO.io.AccelerometerEvent</a></li>
<li><a href="../classes/BO.io.AnalogAccelerometer.html">BO.io.AnalogAccelerometer</a></li>
<li><a href="../classes/BO.io.BiColorLED.html">BO.io.BiColorLED</a></li>
<li><a href="../classes/BO.io.BlinkM.html">BO.io.BlinkM</a></li>
<li><a href="../classes/BO.io.Button.html">BO.io.Button</a></li>
<li><a href="../classes/BO.io.ButtonEvent.html">BO.io.ButtonEvent</a></li>
<li><a href="../classes/BO.io.CompassEvent.html">BO.io.CompassEvent</a></li>
<li><a href="../classes/BO.io.CompassHMC6352.html">BO.io.CompassHMC6352</a></li>
<li><a href="../classes/BO.io.DCMotor.html">BO.io.DCMotor</a></li>
<li><a href="../classes/BO.io.GyroEvent.html">BO.io.GyroEvent</a></li>
<li><a href="../classes/BO.io.GyroITG3200.html">BO.io.GyroITG3200</a></li>
<li><a href="../classes/BO.io.LED.html">BO.io.LED</a></li>
<li><a href="../classes/BO.io.MagnetometerEvent.html">BO.io.MagnetometerEvent</a></li>
<li><a href="../classes/BO.io.MagnetometerHMC5883.html">BO.io.MagnetometerHMC5883</a></li>
<li><a href="../classes/BO.io.Potentiometer.html">BO.io.Potentiometer</a></li>
<li><a href="../classes/BO.io.PotEvent.html">BO.io.PotEvent</a></li>
<li><a href="../classes/BO.io.RGBLED.html">BO.io.RGBLED</a></li>
<li><a href="../classes/BO.io.Servo.html">BO.io.Servo</a></li>
<li><a href="../classes/BO.io.SoftPot.html">BO.io.SoftPot</a></li>
<li><a href="../classes/BO.io.SoftPotEvent.html">BO.io.SoftPotEvent</a></li>
<li><a href="../classes/BO.io.Stepper.html">BO.io.Stepper</a></li>
<li><a href="../classes/BO.IOBoard.html">BO.IOBoard</a></li>
<li><a href="../classes/BO.IOBoardEvent.html">BO.IOBoardEvent</a></li>
<li><a href="../classes/BO.PhysicalInputBase.html">BO.PhysicalInputBase</a></li>
<li><a href="../classes/BO.Pin.html">BO.Pin</a></li>
<li><a href="../classes/BO.PinEvent.html">BO.PinEvent</a></li>
<li><a href="../classes/BO.WSocketEvent.html">BO.WSocketEvent</a></li>
<li><a href="../classes/BO.WSocketWrapper.html">BO.WSocketWrapper</a></li>
<li><a href="../classes/JSUTILS.Event.html">JSUTILS.Event</a></li>
<li><a href="../classes/JSUTILS.EventDispatcher.html">JSUTILS.EventDispatcher</a></li>
<li><a href="../classes/JSUTILS.SignalScope.html">JSUTILS.SignalScope</a></li>
<li><a href="../classes/JSUTILS.Timer.html">JSUTILS.Timer</a></li>
<li><a href="../classes/JSUTILS.TimerEvent.html">JSUTILS.TimerEvent</a></li>
</ul>
<ul id="api-modules" class="apis modules">
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="yui3-u-3-4">
<div id="api-options">
Show:
<label for="api-show-inherited">
<input type="checkbox" id="api-show-inherited" checked>
Inherited
</label>
<label for="api-show-protected">
<input type="checkbox" id="api-show-protected">
Protected
</label>
<label for="api-show-private">
<input type="checkbox" id="api-show-private">
Private
</label>
<label for="api-show-deprecated">
<input type="checkbox" id="api-show-deprecated">
Deprecated
</label>
</div>
<div class="apidocs">
<div id="docs-main">
<div class="content">
<h1 class="file-heading">File: src/custom/ID12RFIDReader.js</h1>
<div class="file">
<pre class="code prettyprint linenums">
JSUTILS.namespace('BO.custom.ID12RFIDReader');
/**
* @namespace BO.custom
*/
BO.custom.ID12RFIDReader = (function () {
var ID12RFIDReader;
// private static constants:
var ID12_READER = 13,
READ_EVENT = 1,
REMOVE_EVENT = 2;
// dependencies
var EventDispatcher = JSUTILS.EventDispatcher,
IOBoardEvent = BO.IOBoardEvent,
RFIDEvent = BO.custom.RFIDEvent;
/**
* Creates an interface to an ID-12 RFID Reader. Other Innovations
* RFID readers will likely work but have not been tested. This object
* requires firmware other than StandardFirmata to be uploaded to the I/O board.
* See [Breakout/custom\_examples/rfid_example1.html](https://github.com/soundanalogous/Breakout/blob/master/custom_examples/rfid_example1.html)
* and [rfid\_example2.html](https://github.com/soundanalogous/Breakout/blob/master/custom_examples/rfid_example2.html) for
* example applications.
*
* <p>To use this object with standard io objects in Breakout,
* RFIDFirmata must be uploaded to the IOBoard rather than StandardFirmata.
* See custom_examples/readme.txt for insturctions.</p>
*
* <p>Is is also possible to create a custom application for your
* IOBoard that includes the RFID reader. See IDx_Reader_Firmata_Example
* in the IDxRFIDReader library example files.</p>
*
* @class ID12RFIDReader
* @constructor
* @uses JSUTILS.EventDispatcher
* @param {IOBoard} board A reference to the IOBoard instance
* @param {Number} readerId The ID assigned to the reader in the firmware
* running on the IOBoard (default = 13)
*/
ID12RFIDReader = function (board, readerId) {
"use strict";
this.name = "ID12RFIDReader";
this._readerId = readerId || ID12_READER;
this._board = board;
this._evtDispatcher = new EventDispatcher(this);
board.addEventListener(IOBoardEvent.SYSEX_MESSAGE, this.onSysExMessage.bind(this));
};
ID12RFIDReader.prototype = {
constructor: ID12RFIDReader,
// private methods:
/**
* @private
* @method onSysExMessage
*/
onSysExMessage: function (event) {
var message = event.message;
if (message[0] != this._readerId) {
return;
} else {
this.processRFIDData(message);
}
},
// this is nice! found it here:
// http://stackoverflow.com/questions/57803/how-to-convert-decimal-to-hex-in-javascript
/**
* @private
* @method dec2hex
*/
dec2hex: function (i) {
return (i + 0x100).toString(16).substr(-2).toUpperCase();
},
/**
* @private
* @method processRFIDData
*/
processRFIDData: function (data) {
var tagEvent = this._board.getValueFromTwo7bitBytes(data[1], data[2]);
var tagEventType = "";
var tag = "";
for (var i = 3, len = data.length; i < len; i += 2) {
tag += this.dec2hex(this._board.getValueFromTwo7bitBytes(data[i], data[i + 1]));
}
// change this to dispatch a single event and handle add or remove in object parameter?
if (tagEvent == READ_EVENT) {
this.dispatch(new RFIDEvent(RFIDEvent.ADD_TAG, tag));
} else if (tagEvent == REMOVE_EVENT) {
this.dispatch(new RFIDEvent(RFIDEvent.REMOVE_TAG, tag));
} else {
// got something else
return;
}
},
/**
* @private
* @method dispatch
*/
dispatch: function (event) {
this.dispatchEvent(event);
},
// public methods:
/* implement EventDispatcher */
/**
* @param {String} type The event type
* @param {Function} listener The function to be called when the event is fired
*/
addEventListener: function (type, listener) {
this._evtDispatcher.addEventListener(type, listener);
},
/**
* @param {String} type The event type
* @param {Function} listener The function to be called when the event is fired
*/
removeEventListener: function (type, listener) {
this._evtDispatcher.removeEventListener(type, listener);
},
/**
* @param {String} type The event type
* return {boolean} True is listener exists for this type, false if not.
*/
hasEventListener: function (type) {
return this._evtDispatcher.hasEventListener(type);
},
/**
* @param {Event} type The Event object
* @param {Object} optionalParams Optional parameters to assign to the event object.
* return {boolean} True if dispatch is successful, false if not.
*/
dispatchEvent: function (event, optionalParams) {
return this._evtDispatcher.dispatchEvent(event, optionalParams);
}
};
// document events
/**
* The addTag event is dispatched when a new tag is read.
* @type BO.custom.RFIDEvent.ADD_TAG
* @event addTag
* @param {BO.custom.ID12RFIDReader} target A reference to the ID12RFIDReader object.
* @param {String} tag The RFID tag value.
*/
/**
* The removeTag event is dispatched when a tag is removed from the reader.
* @type BO.custom.RFIDEvent.REMOVE_TAG
* @event removeTag
* @param {BO.custom.ID12RFIDReader} target A reference to the ID12RFIDReader object.
* @param {String} tag The RFID tag value.
*/
return ID12RFIDReader;
}());
</pre>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="../assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="../assets/js/yui-prettify.js"></script>
<script src="../assets/../api.js"></script>
<script src="../assets/js/api-filter.js"></script>
<script src="../assets/js/api-list.js"></script>
<script src="../assets/js/api-search.js"></script>
<script src="../assets/js/apidocs.js"></script>
</body>
</html>
|
{
"content_hash": "c1b07deac90b9adbeb49d169e17cd93d",
"timestamp": "",
"source": "github",
"line_count": 374,
"max_line_length": 149,
"avg_line_length": 37.53475935828877,
"alnum_prop": 0.5467303034620317,
"repo_name": "darrownet/gowanus-makers-and-hackers",
"id": "d0f8add36f64e73c7f44d4cfc9c78da4e653c8f7",
"size": "14181",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Breakout/docs/files/src_custom_ID12RFIDReader.js.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Arduino",
"bytes": "52423"
},
{
"name": "C++",
"bytes": "33468"
},
{
"name": "CSS",
"bytes": "20052"
},
{
"name": "JavaScript",
"bytes": "1059957"
}
],
"symlink_target": ""
}
|
<form name="form" class="form-horizontal">
<div class="modal-header">
<h4 class="modal-title"><i class="fa fa-exclamation-circle"></i>新增展期申请</h4>
</div>
<div class="modal-body" style="height: 700px;overflow-y: auto">
<div ng-include="'module_extendperiod/tpl/form-extendperiod-apply.html'"/>
</div>
<div class="modal-footer">
<button class="btn btn-success" type="button" ng-disabled="form.$invalid" ng-click="ok()">提交申请</button>
<button class="btn btn-default" type="button" ng-click="cancel()">关闭</button>
</div>
</form>
|
{
"content_hash": "12d70672a281bf3d6b65cf9d49d17424",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 111,
"avg_line_length": 48.25,
"alnum_prop": 0.6355785837651122,
"repo_name": "dedp1984/gps_client",
"id": "9a8c24f2c5283852b117946f9477543b7075296d",
"size": "603",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "app/module_extendperiod/tpl/dialog-extendperiod-add.tpl.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "263914"
},
{
"name": "HTML",
"bytes": "1426496"
},
{
"name": "JavaScript",
"bytes": "772540"
}
],
"symlink_target": ""
}
|
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout_root"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="20dip">
<LinearLayout android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<CheckBox android:id="@+id/push_enabled"
android:layout_height="wrap_content"
android:checked="true"
android:contentDescription="push_enabled_checkbox"
android:layout_width="wrap_content"/>
<TextView android:text="Push Enabled"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:textSize="16dip"/>
</LinearLayout>
<LinearLayout android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<CheckBox android:id="@+id/sound_enabled"
android:layout_height="wrap_content"
android:checked="true"
android:layout_width="wrap_content"/>
<TextView android:text="Sound Enabled"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:textSize="16dip"/>
</LinearLayout>
<LinearLayout android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<CheckBox android:id="@+id/vibrate_enabled"
android:layout_height="wrap_content"
android:checked="true"
android:layout_width="wrap_content"/>
<TextView android:text="Vibrate Enabled"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:textSize="16dip"/>
</LinearLayout>
<LinearLayout android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<CheckBox android:id="@+id/quiet_time_enabled"
android:layout_height="wrap_content"
android:checked="true"
android:layout_width="wrap_content"/>
<TextView android:text="Quiet Time Enabled"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:textSize="16dip"/>
</LinearLayout>
<TextView
android:text="Start Time"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:textSize="16dip"/>
<TimePicker
android:enabled="false"
android:id="@+id/start_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:paddingTop="10dip"
android:text="End Time"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:textSize="16dip"/>
<TimePicker
android:id="@+id/end_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<LinearLayout android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<CheckBox android:id="@+id/location_enabled"
android:layout_height="wrap_content"
android:checked="true"
android:layout_width="wrap_content"/>
<TextView android:id="@+id/location_enabled_label"
android:text="Location Enabled"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:textSize="16dip"/>
</LinearLayout>
<LinearLayout android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<CheckBox android:id="@+id/background_location_enabled"
android:layout_height="wrap_content"
android:checked="true"
android:layout_width="wrap_content"/>
<TextView android:id="@+id/background_location_enabled_label"
android:text="Background Location Enabled"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:textSize="16dip"/>
</LinearLayout>
<LinearLayout android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<CheckBox android:id="@+id/foreground_location_enabled"
android:layout_height="wrap_content"
android:checked="true"
android:layout_width="wrap_content"/>
<TextView android:id="@+id/foreground_location_enabled_label"
android:text="Foreground Location Enabled"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:textSize="16dip"/>
</LinearLayout>
</LinearLayout>
</ScrollView>
|
{
"content_hash": "a8a0e24f0d465cee6a5db62767803522",
"timestamp": "",
"source": "github",
"line_count": 149,
"max_line_length": 70,
"avg_line_length": 35.369127516778526,
"alnum_prop": 0.6096774193548387,
"repo_name": "andypikul/UA-Sample-App",
"id": "3871d1c0bf225d645213bd6c756b2bb6a099551e",
"size": "5270",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "samples/PushSample/res/layout/push_preferences_dialog.xml",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "CSS",
"bytes": "35134"
},
{
"name": "HTML",
"bytes": "5770594"
},
{
"name": "JavaScript",
"bytes": "39008"
}
],
"symlink_target": ""
}
|
export default from './form-field';
|
{
"content_hash": "cc329198cbe8f797860484490440076c",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 35,
"avg_line_length": 36,
"alnum_prop": 0.7222222222222222,
"repo_name": "Genert/telement",
"id": "9a950d0e3b4c5653dc1394be7a8c545721326a49",
"size": "36",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "source/javascript/renderer/components/form-field/index.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "45342"
},
{
"name": "HTML",
"bytes": "427"
},
{
"name": "JavaScript",
"bytes": "76887"
},
{
"name": "Shell",
"bytes": "335"
}
],
"symlink_target": ""
}
|
---
layout: doc-page
title: "Open Classes"
---
An `open` modifier on a class signals that the class is planned for extensions. Example:
```scala
// File Writer.scala
package p
open class Writer[T] {
/** Sends to stdout, can be overridden */
def send(x: T) = println(x)
/** Sends all arguments using `send` */
def sendAll(xs: T*) = xs.foreach(send)
}
// File EncryptedWriter.scala
package p
class EncryptedWriter[T: Encryptable] extends Writer[T] {
override def send(x: T) = super.send(encrypt(x))
}
```
An open class typically comes with some documentation that describes
the internal calling patterns between methods of the class as well as hooks that can be overridden. We call this the _extension contract_ of the class. It is different from the _external contract_ between a class and its users.
Classes that are not open can still be extended, but only if at least one of two alternative conditions is met:
- The extending class is in the same source file as the extended class. In this case, the extension is usually an internal implementation matter.
- The language feature `adhocExtensions` is enabled for the extending class. This is typically enabled by an import statement in the source file of the extension:
```scala
import scala.language.adhocExtensions
```
Alternatively, the feature can be enabled by the command line option `-language:adhocExtensions`.
If the feature is not enabled, the compiler will issue a "feature" warning. For instance, if the `open` modifier on class `Writer` is dropped, compiling `EncryptedWriter` would produce a warning:
```
-- Feature Warning: EncryptedWriter.scala:6:14 ----
|class EncryptedWriter[T: Encryptable] extends Writer[T]
| ^
|Unless class Writer is declared 'open', its extension in a separate file should be enabled
|by adding the import clause 'import scala.language.adhocExtensions'
|or by setting the compiler option -language:adhocExtensions.
```
### Motivation
When writing a class, there are three possible expectations of extensibility:
1. The class is intended to allow extensions. This means one should expect
a carefully worked out and documented extension contract for the class.
2. Extensions of the class are forbidden, for instance to make correctness or security guarantees.
3. There is no firm decision either way. The class is not _a priori_ intended for extensions, but if others find it useful to extend on an _ad-hoc_ basis, let them go ahead. However, they are on their own in this case. There is no documented extension contract, and future versions of the class might break the extensions (by rearranging internal call patterns, for instance).
The three cases are clearly distinguished by using `open` for (1), `final` for (2) and no modifier for (3).
It is good practice to avoid _ad-hoc_ extensions in a code base, since they tend to lead to fragile systems that are hard to evolve. But there
are still some situations where these extensions are useful: for instance,
to mock classes in tests, or to apply temporary patches that add features or fix bugs in library classes. That's why _ad-hoc_ extensions are permitted, but only if there is an explicit opt-in via a language feature import.
### Details
- `open` is a soft modifier. It is treated as a normal identifier
unless it is in modifier position.
- An `open` class cannot be `final` or `sealed`.
- Traits or `abstract` classes are always `open`, so `open` is redundant for them.
### Relationship with `sealed`
A class that is neither `abstract` nor `open` is similar to a `sealed` class: it can still be extended, but only in the same compilation unit. The difference is what happens if an extension of the class is attempted in another compilation unit. For a `sealed` class, this is an error, whereas for a simple non-open class, this is still permitted provided the `adhocExtensions` feature is enabled, and it gives a warning otherwise.
### Migration
`open` is a new modifier in Scala 3. To allow cross compilation between Scala 2.13 and Scala 3.0 without warnings, the feature warning for ad-hoc extensions is produced only under `-strict`. It will be produced by default from Scala 3.1 on.
|
{
"content_hash": "b2a667ada005697655b398df5dbac0dd",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 430,
"avg_line_length": 54.063291139240505,
"alnum_prop": 0.7483025052680871,
"repo_name": "som-snytt/dotty",
"id": "38d95d6c415895c6437a6adec8a618960bfee3b1",
"size": "4271",
"binary": false,
"copies": "1",
"ref": "refs/heads/issue/update-commandlineparser",
"path": "docs/docs/reference/other-new-features/open-classes.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "10592"
},
{
"name": "HTML",
"bytes": "26510"
},
{
"name": "Java",
"bytes": "251194"
},
{
"name": "JavaScript",
"bytes": "3691"
},
{
"name": "Scala",
"bytes": "13665316"
},
{
"name": "Shell",
"bytes": "12008"
},
{
"name": "TypeScript",
"bytes": "63197"
}
],
"symlink_target": ""
}
|
namespace Microsoft.Azure.Management.ContainerService
{
using Microsoft.Rest;
using Microsoft.Rest.Azure;
using Models;
using System.Collections;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
/// <summary>
/// Extension methods for Operations.
/// </summary>
public static partial class OperationsExtensions
{
/// <summary>
/// Gets a list of operations.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
public static IEnumerable<OperationValue> List(this IOperations operations)
{
return operations.ListAsync().GetAwaiter().GetResult();
}
/// <summary>
/// Gets a list of operations.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<IEnumerable<OperationValue>> ListAsync(this IOperations operations, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
}
}
|
{
"content_hash": "d7eff9dbf3b34cc463adbb10af23e38a",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 170,
"avg_line_length": 34.91111111111111,
"alnum_prop": 0.5671546785486951,
"repo_name": "Azure/azure-sdk-for-net",
"id": "96f13e6718f615afaeb0449c87d4e316fb5318fb",
"size": "1924",
"binary": false,
"copies": "3",
"ref": "refs/heads/main",
"path": "sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/OperationsExtensions.cs",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
}
|
<resources>
<string name="app_name">OkHttpTest</string>
</resources>
|
{
"content_hash": "01cd009bf97f0c3e405aecb3be5a6558",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 47,
"avg_line_length": 24.333333333333332,
"alnum_prop": 0.6986301369863014,
"repo_name": "hi-guy/StudyAndroid",
"id": "23ea2648920a3ff8d44276774fff137994b1154f",
"size": "73",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "OkHttpTest/app/src/main/res/values/strings.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "148301"
}
],
"symlink_target": ""
}
|
IMAGE_NAME="boynux/squid-exporter"
IMAGE_TAG=${TRAVIS_TAG:-latest}
docker --version
docker build -t $IMAGE_NAME:$IMAGE_TAG .
docker tag $IMAGE_NAME:$IMAGE_TAG $IMAGE_NAME:latest
echo $DOCKER_API_KEY | docker login -u boynux --password-stdin
docker push $IMAGE_NAME:$IMAGE_TAG
docker push $IMAGE_NAME:latest
|
{
"content_hash": "9831b03aba4c2478077ee94027c45299",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 62,
"avg_line_length": 34.22222222222222,
"alnum_prop": 0.7564935064935064,
"repo_name": "boynux/squid-exporter",
"id": "dcb28879576df335d9a4297476ad039854f819e9",
"size": "351",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "deploy.sh",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Dockerfile",
"bytes": "486"
},
{
"name": "Go",
"bytes": "28255"
},
{
"name": "Makefile",
"bytes": "728"
},
{
"name": "Shell",
"bytes": "351"
}
],
"symlink_target": ""
}
|
@interface ViewController : UIViewController
@end
|
{
"content_hash": "e0f40201cb3f986a2ee5f454f33f380a",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 44,
"avg_line_length": 17,
"alnum_prop": 0.8235294117647058,
"repo_name": "loganjones/LJCollectionViewTableLayout",
"id": "c8ee614a12cf472caefac577f8c6208989be0032",
"size": "215",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Example/Example/ViewController.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Objective-C",
"bytes": "84545"
},
{
"name": "Ruby",
"bytes": "582"
}
],
"symlink_target": ""
}
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<?mso-application progid="Word.Document"?>
<pkg:package xmlns:pkg="http://schemas.microsoft.com/office/2006/xmlPackage">
<pkg:part pkg:name="/_rels/.rels" pkg:contentType="application/vnd.openxmlformats-package.relationships+xml" pkg:padding="512">
<pkg:xmlData>
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
<Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml"/>
<Relationship Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/>
<Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="word/document.xml"/>
</Relationships>
</pkg:xmlData>
</pkg:part>
<pkg:part pkg:name="/word/_rels/document.xml.rels" pkg:contentType="application/vnd.openxmlformats-package.relationships+xml" pkg:padding="256">
<pkg:xmlData>
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
<Relationship Id="rId8" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable" Target="fontTable.xml"/>
<Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml" Target="../customXml/item3.xml"/>
<Relationship Id="rId7" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings" Target="webSettings.xml"/>
<Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml" Target="../customXml/item2.xml"/>
<Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml" Target="../customXml/item1.xml"/>
<Relationship Id="rId6" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings" Target="settings.xml"/>
<Relationship Id="rId5" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/>
<Relationship Id="rId10" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme" Target="theme/theme1.xml"/>
<Relationship Id="rId4" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml" Target="../customXml/item4.xml"/>
<Relationship Id="rId9" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/glossaryDocument" Target="glossary/document.xml"/>
</Relationships>
</pkg:xmlData>
</pkg:part>
<pkg:part pkg:name="/word/document.xml" pkg:contentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml">
<pkg:xmlData>
<w:document xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml">
<w:body>
<w:p>
<w:pPr>
<w:pStyle w:val="Title"/>
</w:pPr>
<w:r>
<w:t>OpenDoPE XHTML binding</w:t>
</w:r>
</w:p>
<w:p>
<w:pPr>
<w:pStyle w:val="Heading1"/>
</w:pPr>
<w:r>
<w:t>HTML element</w:t>
</w:r>
</w:p>
<w:sdt>
<w:sdtPr>
<w:tag w:val="od:xpath=case1&od:ContentType=application/xhtml+xml"/>
<w:id w:val="780013794"/>
<w:placeholder>
<w:docPart w:val="DefaultPlaceholder_22675703"/>
</w:placeholder>
<w:dataBinding w:xpath="/yourxml/case1" w:storeItemID="{20B8AAA6-2C95-41E0-AB0F-D96D3E3AA22F}"/>
<w:text/>
</w:sdtPr>
<w:sdtContent>
<w:p>
<w:r>
<w:t xml:space="preserve"> <html><body> <p>hello </p> </body></html> </w:t>
</w:r>
</w:p>
</w:sdtContent>
</w:sdt>
<w:p>
<w:pPr>
<w:pStyle w:val="Heading1"/>
</w:pPr>
<w:r>
<w:t>body element</w:t>
</w:r>
</w:p>
<w:sdt>
<w:sdtPr>
<w:tag w:val="od:xpath=case2&od:ContentType=application/xhtml+xml"/>
<w:id w:val="780013795"/>
<w:placeholder>
<w:docPart w:val="DefaultPlaceholder_22675703"/>
</w:placeholder>
<w:dataBinding w:xpath="/yourxml/case2" w:storeItemID="{20B8AAA6-2C95-41E0-AB0F-D96D3E3AA22F}"/>
<w:text/>
</w:sdtPr>
<w:sdtContent>
<w:p>
<w:r>
<w:t xml:space="preserve"> <body> <p>hello </p> </body> </w:t>
</w:r>
</w:p>
</w:sdtContent>
</w:sdt>
<w:p>
<w:pPr>
<w:pStyle w:val="Heading1"/>
</w:pPr>
<w:r>
<w:t>p element</w:t>
</w:r>
</w:p>
<w:sdt>
<w:sdtPr>
<w:tag w:val="od:xpath=case3&od:ContentType=application/xhtml+xml"/>
<w:id w:val="780013796"/>
<w:placeholder>
<w:docPart w:val="DefaultPlaceholder_22675703"/>
</w:placeholder>
<w:dataBinding w:xpath="/yourxml/case3" w:storeItemID="{20B8AAA6-2C95-41E0-AB0F-D96D3E3AA22F}"/>
<w:text/>
</w:sdtPr>
<w:sdtContent>
<w:p>
<w:r>
<w:t xml:space="preserve"> <p>hello </p> </w:t>
</w:r>
</w:p>
</w:sdtContent>
</w:sdt>
<w:p>
<w:pPr>
<w:pStyle w:val="Heading1"/>
</w:pPr>
<w:r>
<w:t>multiple p in body</w:t>
</w:r>
</w:p>
<w:sdt>
<w:sdtPr>
<w:tag w:val="od:xpath=case4&od:ContentType=application/xhtml+xml"/>
<w:id w:val="780013797"/>
<w:placeholder>
<w:docPart w:val="DefaultPlaceholder_22675703"/>
</w:placeholder>
<w:dataBinding w:xpath="/yourxml/case4" w:storeItemID="{20B8AAA6-2C95-41E0-AB0F-D96D3E3AA22F}"/>
<w:text/>
</w:sdtPr>
<w:sdtContent>
<w:p>
<w:r>
<w:t xml:space="preserve"> <div> <p>hello 1</p> <p>hello 2</p> </div> </w:t>
</w:r>
</w:p>
</w:sdtContent>
</w:sdt>
<w:p>
<w:pPr>
<w:pStyle w:val="Heading1"/>
</w:pPr>
<w:r>
<w:t>multiple p in div</w:t>
</w:r>
</w:p>
<w:sdt>
<w:sdtPr>
<w:tag w:val="od:xpath=case4B&od:ContentType=application/xhtml+xml"/>
<w:id w:val="7800137800"/>
<w:placeholder>
<w:docPart w:val="DefaultPlaceholder_22675703"/>
</w:placeholder>
<w:dataBinding w:xpath="/yourxml/case4B" w:storeItemID="{20B8AAA6-2C95-41E0-AB0F-D96D3E3AA22F}"/>
<w:text/>
</w:sdtPr>
<w:sdtContent>
<w:p>
<w:r>
<w:t xml:space="preserve"> <div> <p>hello 1</p> <p>hello 2</p> </div> </w:t>
</w:r>
</w:p>
</w:sdtContent>
</w:sdt>
<w:p>
<w:pPr>
<w:pStyle w:val="Heading1"/>
</w:pPr>
<w:r>
<w:t>run level</w:t>
</w:r>
</w:p>
<w:p>
<w:sdt>
<w:sdtPr>
<w:tag w:val="od:xpath=case5&od:ContentType=application/xhtml+xml"/>
<w:id w:val="780013798"/>
<w:placeholder>
<w:docPart w:val="DefaultPlaceholder_22675703"/>
</w:placeholder>
<w:dataBinding w:xpath="/yourxml/case5" w:storeItemID="{20B8AAA6-2C95-41E0-AB0F-D96D3E3AA22F}"/>
<w:text/>
</w:sdtPr>
<w:sdtContent>
<w:r>
<w:t xml:space="preserve"> <span>Please <a href="mailto:foo@bar">click to email</a> </span> now!</w:t>
</w:r>
</w:sdtContent>
</w:sdt>
</w:p>
<w:sectPr>
<w:pgSz w:w="11906" w:h="16838"/>
<w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="708" w:footer="708" w:gutter="0"/>
<w:cols w:space="708"/>
<w:docGrid w:linePitch="360"/>
</w:sectPr>
</w:body>
</w:document>
</pkg:xmlData>
</pkg:part>
<pkg:part pkg:name="/word/theme/theme1.xml" pkg:contentType="application/vnd.openxmlformats-officedocument.theme+xml">
<pkg:xmlData>
<a:theme name="Office Theme" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main">
<a:themeElements>
<a:clrScheme name="Office">
<a:dk1>
<a:sysClr val="windowText" lastClr="000000"/>
</a:dk1>
<a:lt1>
<a:sysClr val="window" lastClr="FFFFFF"/>
</a:lt1>
<a:dk2>
<a:srgbClr val="1F497D"/>
</a:dk2>
<a:lt2>
<a:srgbClr val="EEECE1"/>
</a:lt2>
<a:accent1>
<a:srgbClr val="4F81BD"/>
</a:accent1>
<a:accent2>
<a:srgbClr val="C0504D"/>
</a:accent2>
<a:accent3>
<a:srgbClr val="9BBB59"/>
</a:accent3>
<a:accent4>
<a:srgbClr val="8064A2"/>
</a:accent4>
<a:accent5>
<a:srgbClr val="4BACC6"/>
</a:accent5>
<a:accent6>
<a:srgbClr val="F79646"/>
</a:accent6>
<a:hlink>
<a:srgbClr val="0000FF"/>
</a:hlink>
<a:folHlink>
<a:srgbClr val="800080"/>
</a:folHlink>
</a:clrScheme>
<a:fontScheme name="Office">
<a:majorFont>
<a:latin typeface="Cambria"/>
<a:ea typeface=""/>
<a:cs typeface=""/>
<a:font script="Jpan" typeface="MS ゴシック"/>
<a:font script="Hang" typeface="맑은 고딕"/>
<a:font script="Hans" typeface="宋体"/>
<a:font script="Hant" typeface="新細明體"/>
<a:font script="Arab" typeface="Times New Roman"/>
<a:font script="Hebr" typeface="Times New Roman"/>
<a:font script="Thai" typeface="Angsana New"/>
<a:font script="Ethi" typeface="Nyala"/>
<a:font script="Beng" typeface="Vrinda"/>
<a:font script="Gujr" typeface="Shruti"/>
<a:font script="Khmr" typeface="MoolBoran"/>
<a:font script="Knda" typeface="Tunga"/>
<a:font script="Guru" typeface="Raavi"/>
<a:font script="Cans" typeface="Euphemia"/>
<a:font script="Cher" typeface="Plantagenet Cherokee"/>
<a:font script="Yiii" typeface="Microsoft Yi Baiti"/>
<a:font script="Tibt" typeface="Microsoft Himalaya"/>
<a:font script="Thaa" typeface="MV Boli"/>
<a:font script="Deva" typeface="Mangal"/>
<a:font script="Telu" typeface="Gautami"/>
<a:font script="Taml" typeface="Latha"/>
<a:font script="Syrc" typeface="Estrangelo Edessa"/>
<a:font script="Orya" typeface="Kalinga"/>
<a:font script="Mlym" typeface="Kartika"/>
<a:font script="Laoo" typeface="DokChampa"/>
<a:font script="Sinh" typeface="Iskoola Pota"/>
<a:font script="Mong" typeface="Mongolian Baiti"/>
<a:font script="Viet" typeface="Times New Roman"/>
<a:font script="Uigh" typeface="Microsoft Uighur"/>
</a:majorFont>
<a:minorFont>
<a:latin typeface="Calibri"/>
<a:ea typeface=""/>
<a:cs typeface=""/>
<a:font script="Jpan" typeface="MS 明朝"/>
<a:font script="Hang" typeface="맑은 고딕"/>
<a:font script="Hans" typeface="宋体"/>
<a:font script="Hant" typeface="新細明體"/>
<a:font script="Arab" typeface="Arial"/>
<a:font script="Hebr" typeface="Arial"/>
<a:font script="Thai" typeface="Cordia New"/>
<a:font script="Ethi" typeface="Nyala"/>
<a:font script="Beng" typeface="Vrinda"/>
<a:font script="Gujr" typeface="Shruti"/>
<a:font script="Khmr" typeface="DaunPenh"/>
<a:font script="Knda" typeface="Tunga"/>
<a:font script="Guru" typeface="Raavi"/>
<a:font script="Cans" typeface="Euphemia"/>
<a:font script="Cher" typeface="Plantagenet Cherokee"/>
<a:font script="Yiii" typeface="Microsoft Yi Baiti"/>
<a:font script="Tibt" typeface="Microsoft Himalaya"/>
<a:font script="Thaa" typeface="MV Boli"/>
<a:font script="Deva" typeface="Mangal"/>
<a:font script="Telu" typeface="Gautami"/>
<a:font script="Taml" typeface="Latha"/>
<a:font script="Syrc" typeface="Estrangelo Edessa"/>
<a:font script="Orya" typeface="Kalinga"/>
<a:font script="Mlym" typeface="Kartika"/>
<a:font script="Laoo" typeface="DokChampa"/>
<a:font script="Sinh" typeface="Iskoola Pota"/>
<a:font script="Mong" typeface="Mongolian Baiti"/>
<a:font script="Viet" typeface="Arial"/>
<a:font script="Uigh" typeface="Microsoft Uighur"/>
</a:minorFont>
</a:fontScheme>
<a:fmtScheme name="Office">
<a:fillStyleLst>
<a:solidFill>
<a:schemeClr val="phClr"/>
</a:solidFill>
<a:gradFill rotWithShape="1">
<a:gsLst>
<a:gs pos="0">
<a:schemeClr val="phClr">
<a:tint val="50000"/>
<a:satMod val="300000"/>
</a:schemeClr>
</a:gs>
<a:gs pos="35000">
<a:schemeClr val="phClr">
<a:tint val="37000"/>
<a:satMod val="300000"/>
</a:schemeClr>
</a:gs>
<a:gs pos="100000">
<a:schemeClr val="phClr">
<a:tint val="15000"/>
<a:satMod val="350000"/>
</a:schemeClr>
</a:gs>
</a:gsLst>
<a:lin ang="16200000" scaled="1"/>
</a:gradFill>
<a:gradFill rotWithShape="1">
<a:gsLst>
<a:gs pos="0">
<a:schemeClr val="phClr">
<a:shade val="51000"/>
<a:satMod val="130000"/>
</a:schemeClr>
</a:gs>
<a:gs pos="80000">
<a:schemeClr val="phClr">
<a:shade val="93000"/>
<a:satMod val="130000"/>
</a:schemeClr>
</a:gs>
<a:gs pos="100000">
<a:schemeClr val="phClr">
<a:shade val="94000"/>
<a:satMod val="135000"/>
</a:schemeClr>
</a:gs>
</a:gsLst>
<a:lin ang="16200000" scaled="0"/>
</a:gradFill>
</a:fillStyleLst>
<a:lnStyleLst>
<a:ln w="9525" cap="flat" cmpd="sng" algn="ctr">
<a:solidFill>
<a:schemeClr val="phClr">
<a:shade val="95000"/>
<a:satMod val="105000"/>
</a:schemeClr>
</a:solidFill>
<a:prstDash val="solid"/>
</a:ln>
<a:ln w="25400" cap="flat" cmpd="sng" algn="ctr">
<a:solidFill>
<a:schemeClr val="phClr"/>
</a:solidFill>
<a:prstDash val="solid"/>
</a:ln>
<a:ln w="38100" cap="flat" cmpd="sng" algn="ctr">
<a:solidFill>
<a:schemeClr val="phClr"/>
</a:solidFill>
<a:prstDash val="solid"/>
</a:ln>
</a:lnStyleLst>
<a:effectStyleLst>
<a:effectStyle>
<a:effectLst>
<a:outerShdw blurRad="40000" dist="20000" dir="5400000" rotWithShape="0">
<a:srgbClr val="000000">
<a:alpha val="38000"/>
</a:srgbClr>
</a:outerShdw>
</a:effectLst>
</a:effectStyle>
<a:effectStyle>
<a:effectLst>
<a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0">
<a:srgbClr val="000000">
<a:alpha val="35000"/>
</a:srgbClr>
</a:outerShdw>
</a:effectLst>
</a:effectStyle>
<a:effectStyle>
<a:effectLst>
<a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0">
<a:srgbClr val="000000">
<a:alpha val="35000"/>
</a:srgbClr>
</a:outerShdw>
</a:effectLst>
<a:scene3d>
<a:camera prst="orthographicFront">
<a:rot lat="0" lon="0" rev="0"/>
</a:camera>
<a:lightRig rig="threePt" dir="t">
<a:rot lat="0" lon="0" rev="1200000"/>
</a:lightRig>
</a:scene3d>
<a:sp3d>
<a:bevelT w="63500" h="25400"/>
</a:sp3d>
</a:effectStyle>
</a:effectStyleLst>
<a:bgFillStyleLst>
<a:solidFill>
<a:schemeClr val="phClr"/>
</a:solidFill>
<a:gradFill rotWithShape="1">
<a:gsLst>
<a:gs pos="0">
<a:schemeClr val="phClr">
<a:tint val="40000"/>
<a:satMod val="350000"/>
</a:schemeClr>
</a:gs>
<a:gs pos="40000">
<a:schemeClr val="phClr">
<a:tint val="45000"/>
<a:shade val="99000"/>
<a:satMod val="350000"/>
</a:schemeClr>
</a:gs>
<a:gs pos="100000">
<a:schemeClr val="phClr">
<a:shade val="20000"/>
<a:satMod val="255000"/>
</a:schemeClr>
</a:gs>
</a:gsLst>
<a:path path="circle">
<a:fillToRect l="50000" t="-80000" r="50000" b="180000"/>
</a:path>
</a:gradFill>
<a:gradFill rotWithShape="1">
<a:gsLst>
<a:gs pos="0">
<a:schemeClr val="phClr">
<a:tint val="80000"/>
<a:satMod val="300000"/>
</a:schemeClr>
</a:gs>
<a:gs pos="100000">
<a:schemeClr val="phClr">
<a:shade val="30000"/>
<a:satMod val="200000"/>
</a:schemeClr>
</a:gs>
</a:gsLst>
<a:path path="circle">
<a:fillToRect l="50000" t="50000" r="50000" b="50000"/>
</a:path>
</a:gradFill>
</a:bgFillStyleLst>
</a:fmtScheme>
</a:themeElements>
<a:objectDefaults/>
<a:extraClrSchemeLst/>
</a:theme>
</pkg:xmlData>
</pkg:part>
<pkg:part pkg:name="/word/glossary/settings.xml" pkg:contentType="application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml">
<pkg:xmlData>
<w:settings xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:sl="http://schemas.openxmlformats.org/schemaLibrary/2006/main">
<w:view w:val="normal"/>
<w:defaultTabStop w:val="720"/>
<w:characterSpacingControl w:val="doNotCompress"/>
<w:compat>
<w:useFELayout/>
</w:compat>
<m:mathPr>
<m:mathFont m:val="Cambria Math"/>
<m:brkBin m:val="before"/>
<m:brkBinSub m:val="--"/>
<m:smallFrac m:val="off"/>
<m:dispDef/>
<m:lMargin m:val="0"/>
<m:rMargin m:val="0"/>
<m:defJc m:val="centerGroup"/>
<m:wrapIndent m:val="1440"/>
<m:intLim m:val="subSup"/>
<m:naryLim m:val="undOvr"/>
</m:mathPr>
<w:themeFontLang w:val="en-AU"/>
<w:clrSchemeMapping w:bg1="light1" w:t1="dark1" w:bg2="light2" w:t2="dark2" w:accent1="accent1" w:accent2="accent2" w:accent3="accent3" w:accent4="accent4" w:accent5="accent5" w:accent6="accent6" w:hyperlink="hyperlink" w:followedHyperlink="followedHyperlink"/>
<w:decimalSymbol w:val="."/>
<w:listSeparator w:val=","/>
</w:settings>
</pkg:xmlData>
</pkg:part>
<pkg:part pkg:name="/word/glossary/document.xml" pkg:contentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml">
<pkg:xmlData>
<w:glossaryDocument xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml">
<w:docParts>
<w:docPart>
<w:docPartPr>
<w:name w:val="DefaultPlaceholder_22675703"/>
<w:category>
<w:name w:val="General"/>
<w:gallery w:val="placeholder"/>
</w:category>
<w:types>
<w:type w:val="bbPlcHdr"/>
</w:types>
<w:behaviors>
<w:behavior w:val="content"/>
</w:behaviors>
<w:guid w:val="{ADEE79FD-4160-48E0-BEAE-34594894CBAA}"/>
</w:docPartPr>
<w:docPartBody>
<w:p>
<w:r>
<w:rPr>
<w:rStyle w:val="PlaceholderText"/>
</w:rPr>
<w:t>Click here to enter text.</w:t>
</w:r>
</w:p>
</w:docPartBody>
</w:docPart>
</w:docParts>
</w:glossaryDocument>
</pkg:xmlData>
</pkg:part>
<pkg:part pkg:name="/word/settings.xml" pkg:contentType="application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml">
<pkg:xmlData>
<w:settings xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:sl="http://schemas.openxmlformats.org/schemaLibrary/2006/main">
<w:zoom w:percent="100"/>
<w:defaultTabStop w:val="720"/>
<w:characterSpacingControl w:val="doNotCompress"/>
<w:compat/>
<m:mathPr>
<m:mathFont m:val="Cambria Math"/>
<m:brkBin m:val="before"/>
<m:brkBinSub m:val="--"/>
<m:smallFrac m:val="off"/>
<m:dispDef/>
<m:lMargin m:val="0"/>
<m:rMargin m:val="0"/>
<m:defJc m:val="centerGroup"/>
<m:wrapIndent m:val="1440"/>
<m:intLim m:val="subSup"/>
<m:naryLim m:val="undOvr"/>
</m:mathPr>
<w:themeFontLang w:val="en-AU"/>
<w:clrSchemeMapping w:bg1="light1" w:t1="dark1" w:bg2="light2" w:t2="dark2" w:accent1="accent1" w:accent2="accent2" w:accent3="accent3" w:accent4="accent4" w:accent5="accent5" w:accent6="accent6" w:hyperlink="hyperlink" w:followedHyperlink="followedHyperlink"/>
<w:shapeDefaults>
<o:shapedefaults v:ext="edit" spidmax="3074"/>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1"/>
</o:shapelayout>
</w:shapeDefaults>
<w:decimalSymbol w:val="."/>
<w:listSeparator w:val=","/>
</w:settings>
</pkg:xmlData>
</pkg:part>
<pkg:part pkg:name="/word/glossary/_rels/document.xml.rels" pkg:contentType="application/vnd.openxmlformats-package.relationships+xml">
<pkg:xmlData>
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
<Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings" Target="webSettings.xml"/>
<Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings" Target="settings.xml"/>
<Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/>
<Relationship Id="rId4" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable" Target="fontTable.xml"/>
</Relationships>
</pkg:xmlData>
</pkg:part>
<pkg:part pkg:name="/customXml/_rels/item2.xml.rels" pkg:contentType="application/vnd.openxmlformats-package.relationships+xml" pkg:padding="256">
<pkg:xmlData>
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
<Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps" Target="itemProps2.xml"/>
</Relationships>
</pkg:xmlData>
</pkg:part>
<pkg:part pkg:name="/docProps/core.xml" pkg:contentType="application/vnd.openxmlformats-package.core-properties+xml" pkg:padding="256">
<pkg:xmlData>
<cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dcmitype="http://purl.org/dc/dcmitype/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<dc:creator>jharrop2</dc:creator>
<cp:lastModifiedBy>jharrop2</cp:lastModifiedBy>
<cp:revision>2</cp:revision>
<dcterms:created xsi:type="dcterms:W3CDTF">2011-11-06T11:39:00Z</dcterms:created>
<dcterms:modified xsi:type="dcterms:W3CDTF">2011-11-12T04:10:00Z</dcterms:modified>
</cp:coreProperties>
</pkg:xmlData>
</pkg:part>
<pkg:part pkg:name="/customXml/itemProps2.xml" pkg:contentType="application/vnd.openxmlformats-officedocument.customXmlProperties+xml" pkg:padding="32">
<pkg:xmlData pkg:originalXmlStandalone="no">
<ds:datastoreItem ds:itemID="{8051C9E8-7B30-4153-AE96-34410652FAFA}" xmlns:ds="http://schemas.openxmlformats.org/officeDocument/2006/customXml">
<ds:schemaRefs>
<ds:schemaRef ds:uri="http://www.w3.org/2001/XMLSchema"/>
<ds:schemaRef ds:uri="http://opendope.org/conditions"/>
</ds:schemaRefs>
</ds:datastoreItem>
</pkg:xmlData>
</pkg:part>
<pkg:part pkg:name="/docProps/app.xml" pkg:contentType="application/vnd.openxmlformats-officedocument.extended-properties+xml" pkg:padding="256">
<pkg:xmlData>
<Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties" xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes">
<Template>Normal.dotm</Template>
<TotalTime>9</TotalTime>
<Pages>1</Pages>
<Words>51</Words>
<Characters>293</Characters>
<Application>Microsoft Office Word</Application>
<DocSecurity>0</DocSecurity>
<Lines>36</Lines>
<Paragraphs>24</Paragraphs>
<ScaleCrop>false</ScaleCrop>
<Company>Hewlett-Packard</Company>
<LinksUpToDate>false</LinksUpToDate>
<CharactersWithSpaces>320</CharactersWithSpaces>
<SharedDoc>false</SharedDoc>
<HyperlinksChanged>false</HyperlinksChanged>
<AppVersion>12.0000</AppVersion>
</Properties>
</pkg:xmlData>
</pkg:part>
<pkg:part pkg:name="/customXml/item2.xml" pkg:contentType="application/xml" pkg:padding="32">
<pkg:xmlData>
<conditions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://opendope.org/conditions"/>
</pkg:xmlData>
</pkg:part>
<pkg:part pkg:name="/customXml/itemProps1.xml" pkg:contentType="application/vnd.openxmlformats-officedocument.customXmlProperties+xml" pkg:padding="32">
<pkg:xmlData pkg:originalXmlStandalone="no">
<ds:datastoreItem ds:itemID="{5D229D20-9D73-4FBC-BCE7-5E03520AE8D3}" xmlns:ds="http://schemas.openxmlformats.org/officeDocument/2006/customXml">
<ds:schemaRefs>
<ds:schemaRef ds:uri="http://www.w3.org/2001/XMLSchema"/>
<ds:schemaRef ds:uri="http://opendope.org/components"/>
</ds:schemaRefs>
</ds:datastoreItem>
</pkg:xmlData>
</pkg:part>
<pkg:part pkg:name="/customXml/_rels/item4.xml.rels" pkg:contentType="application/vnd.openxmlformats-package.relationships+xml" pkg:padding="256">
<pkg:xmlData>
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
<Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps" Target="itemProps4.xml"/>
</Relationships>
</pkg:xmlData>
</pkg:part>
<pkg:part pkg:name="/customXml/_rels/item1.xml.rels" pkg:contentType="application/vnd.openxmlformats-package.relationships+xml" pkg:padding="256">
<pkg:xmlData>
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
<Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps" Target="itemProps1.xml"/>
</Relationships>
</pkg:xmlData>
</pkg:part>
<pkg:part pkg:name="/customXml/_rels/item3.xml.rels" pkg:contentType="application/vnd.openxmlformats-package.relationships+xml" pkg:padding="256">
<pkg:xmlData>
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
<Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps" Target="itemProps3.xml"/>
</Relationships>
</pkg:xmlData>
</pkg:part>
<pkg:part pkg:name="/word/glossary/webSettings.xml" pkg:contentType="application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml">
<pkg:xmlData>
<w:webSettings xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">
<w:optimizeForBrowser/>
<w:allowPNG/>
<w:pixelsPerInch w:val="120"/>
</w:webSettings>
</pkg:xmlData>
</pkg:part>
<pkg:part pkg:name="/customXml/item1.xml" pkg:contentType="application/xml" pkg:padding="32">
<pkg:xmlData>
<components xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://opendope.org/components"/>
</pkg:xmlData>
</pkg:part>
<pkg:part pkg:name="/customXml/item3.xml" pkg:contentType="application/xml" pkg:padding="32">
<pkg:xmlData>
<yourxml>
<case1> <html><body> <p>hello </p> </body></html> </case1>
<case2> <body> <p>hello </p> </body> </case2>
<case3> <p>hello </p> </case3>
<case4>
<body>
<p>hello 1</p>
<p>hello 2</p>
</body>
</case4>
<case4B>
<div>
<p>hello 1</p>
<p>hello 2</p>
</div>
</case4B>
<case5> <span>Please <a href="mailto:foo@bar">click to email</a> <b>now!</b> </span></case5>
</yourxml>
</pkg:xmlData>
</pkg:part>
<pkg:part pkg:name="/customXml/itemProps3.xml" pkg:contentType="application/vnd.openxmlformats-officedocument.customXmlProperties+xml" pkg:padding="32">
<pkg:xmlData pkg:originalXmlStandalone="no">
<ds:datastoreItem ds:itemID="{20B8AAA6-2C95-41E0-AB0F-D96D3E3AA22F}" xmlns:ds="http://schemas.openxmlformats.org/officeDocument/2006/customXml">
<ds:schemaRefs/>
</ds:datastoreItem>
</pkg:xmlData>
</pkg:part>
<pkg:part pkg:name="/customXml/item4.xml" pkg:contentType="application/xml" pkg:padding="32">
<pkg:xmlData>
<xpaths xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://opendope.org/xpaths">
<xpath id="case1">
<dataBinding xpath="/yourxml/case1" storeItemID="{20B8AAA6-2C95-41E0-AB0F-D96D3E3AA22F}"/>
</xpath>
<xpath id="case2">
<dataBinding xpath="/yourxml/case2" storeItemID="{20B8AAA6-2C95-41E0-AB0F-D96D3E3AA22F}"/>
</xpath>
</xpaths>
</pkg:xmlData>
</pkg:part>
<pkg:part pkg:name="/customXml/itemProps4.xml" pkg:contentType="application/vnd.openxmlformats-officedocument.customXmlProperties+xml" pkg:padding="32">
<pkg:xmlData pkg:originalXmlStandalone="no">
<ds:datastoreItem ds:itemID="{C8E07CE9-CFBF-4B7F-8EB1-094B247CF6C6}" xmlns:ds="http://schemas.openxmlformats.org/officeDocument/2006/customXml">
<ds:schemaRefs>
<ds:schemaRef ds:uri="http://www.w3.org/2001/XMLSchema"/>
<ds:schemaRef ds:uri="http://opendope.org/xpaths"/>
</ds:schemaRefs>
</ds:datastoreItem>
</pkg:xmlData>
</pkg:part>
<pkg:part pkg:name="/word/styles.xml" pkg:contentType="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml">
<pkg:xmlData>
<w:styles xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">
<w:docDefaults>
<w:rPrDefault>
<w:rPr>
<w:rFonts w:asciiTheme="minorHAnsi" w:eastAsiaTheme="minorHAnsi" w:hAnsiTheme="minorHAnsi" w:cstheme="minorBidi"/>
<w:sz w:val="22"/>
<w:szCs w:val="22"/>
<w:lang w:val="en-AU" w:eastAsia="en-US" w:bidi="ar-SA"/>
</w:rPr>
</w:rPrDefault>
<w:pPrDefault>
<w:pPr>
<w:spacing w:after="200" w:line="276" w:lineRule="auto"/>
</w:pPr>
</w:pPrDefault>
</w:docDefaults>
<w:latentStyles w:defLockedState="0" w:defUIPriority="99" w:defSemiHidden="1" w:defUnhideWhenUsed="1" w:defQFormat="0" w:count="267">
<w:lsdException w:name="Normal" w:semiHidden="0" w:uiPriority="0" w:unhideWhenUsed="0" w:qFormat="1"/>
<w:lsdException w:name="heading 1" w:semiHidden="0" w:uiPriority="9" w:unhideWhenUsed="0" w:qFormat="1"/>
<w:lsdException w:name="heading 2" w:uiPriority="9" w:qFormat="1"/>
<w:lsdException w:name="heading 3" w:uiPriority="9" w:qFormat="1"/>
<w:lsdException w:name="heading 4" w:uiPriority="9" w:qFormat="1"/>
<w:lsdException w:name="heading 5" w:uiPriority="9" w:qFormat="1"/>
<w:lsdException w:name="heading 6" w:uiPriority="9" w:qFormat="1"/>
<w:lsdException w:name="heading 7" w:uiPriority="9" w:qFormat="1"/>
<w:lsdException w:name="heading 8" w:uiPriority="9" w:qFormat="1"/>
<w:lsdException w:name="heading 9" w:uiPriority="9" w:qFormat="1"/>
<w:lsdException w:name="toc 1" w:uiPriority="39"/>
<w:lsdException w:name="toc 2" w:uiPriority="39"/>
<w:lsdException w:name="toc 3" w:uiPriority="39"/>
<w:lsdException w:name="toc 4" w:uiPriority="39"/>
<w:lsdException w:name="toc 5" w:uiPriority="39"/>
<w:lsdException w:name="toc 6" w:uiPriority="39"/>
<w:lsdException w:name="toc 7" w:uiPriority="39"/>
<w:lsdException w:name="toc 8" w:uiPriority="39"/>
<w:lsdException w:name="toc 9" w:uiPriority="39"/>
<w:lsdException w:name="caption" w:uiPriority="35" w:qFormat="1"/>
<w:lsdException w:name="Title" w:semiHidden="0" w:uiPriority="10" w:unhideWhenUsed="0" w:qFormat="1"/>
<w:lsdException w:name="Default Paragraph Font" w:uiPriority="1"/>
<w:lsdException w:name="Subtitle" w:semiHidden="0" w:uiPriority="11" w:unhideWhenUsed="0" w:qFormat="1"/>
<w:lsdException w:name="Strong" w:semiHidden="0" w:uiPriority="22" w:unhideWhenUsed="0" w:qFormat="1"/>
<w:lsdException w:name="Emphasis" w:semiHidden="0" w:uiPriority="20" w:unhideWhenUsed="0" w:qFormat="1"/>
<w:lsdException w:name="Table Grid" w:semiHidden="0" w:uiPriority="59" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Placeholder Text" w:unhideWhenUsed="0"/>
<w:lsdException w:name="No Spacing" w:semiHidden="0" w:uiPriority="1" w:unhideWhenUsed="0" w:qFormat="1"/>
<w:lsdException w:name="Light Shading" w:semiHidden="0" w:uiPriority="60" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Light List" w:semiHidden="0" w:uiPriority="61" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Light Grid" w:semiHidden="0" w:uiPriority="62" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Shading 1" w:semiHidden="0" w:uiPriority="63" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Shading 2" w:semiHidden="0" w:uiPriority="64" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium List 1" w:semiHidden="0" w:uiPriority="65" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium List 2" w:semiHidden="0" w:uiPriority="66" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Grid 1" w:semiHidden="0" w:uiPriority="67" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Grid 2" w:semiHidden="0" w:uiPriority="68" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Grid 3" w:semiHidden="0" w:uiPriority="69" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Dark List" w:semiHidden="0" w:uiPriority="70" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Colorful Shading" w:semiHidden="0" w:uiPriority="71" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Colorful List" w:semiHidden="0" w:uiPriority="72" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Colorful Grid" w:semiHidden="0" w:uiPriority="73" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Light Shading Accent 1" w:semiHidden="0" w:uiPriority="60" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Light List Accent 1" w:semiHidden="0" w:uiPriority="61" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Light Grid Accent 1" w:semiHidden="0" w:uiPriority="62" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Shading 1 Accent 1" w:semiHidden="0" w:uiPriority="63" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Shading 2 Accent 1" w:semiHidden="0" w:uiPriority="64" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium List 1 Accent 1" w:semiHidden="0" w:uiPriority="65" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Revision" w:unhideWhenUsed="0"/>
<w:lsdException w:name="List Paragraph" w:semiHidden="0" w:uiPriority="34" w:unhideWhenUsed="0" w:qFormat="1"/>
<w:lsdException w:name="Quote" w:semiHidden="0" w:uiPriority="29" w:unhideWhenUsed="0" w:qFormat="1"/>
<w:lsdException w:name="Intense Quote" w:semiHidden="0" w:uiPriority="30" w:unhideWhenUsed="0" w:qFormat="1"/>
<w:lsdException w:name="Medium List 2 Accent 1" w:semiHidden="0" w:uiPriority="66" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Grid 1 Accent 1" w:semiHidden="0" w:uiPriority="67" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Grid 2 Accent 1" w:semiHidden="0" w:uiPriority="68" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Grid 3 Accent 1" w:semiHidden="0" w:uiPriority="69" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Dark List Accent 1" w:semiHidden="0" w:uiPriority="70" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Colorful Shading Accent 1" w:semiHidden="0" w:uiPriority="71" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Colorful List Accent 1" w:semiHidden="0" w:uiPriority="72" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Colorful Grid Accent 1" w:semiHidden="0" w:uiPriority="73" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Light Shading Accent 2" w:semiHidden="0" w:uiPriority="60" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Light List Accent 2" w:semiHidden="0" w:uiPriority="61" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Light Grid Accent 2" w:semiHidden="0" w:uiPriority="62" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Shading 1 Accent 2" w:semiHidden="0" w:uiPriority="63" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Shading 2 Accent 2" w:semiHidden="0" w:uiPriority="64" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium List 1 Accent 2" w:semiHidden="0" w:uiPriority="65" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium List 2 Accent 2" w:semiHidden="0" w:uiPriority="66" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Grid 1 Accent 2" w:semiHidden="0" w:uiPriority="67" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Grid 2 Accent 2" w:semiHidden="0" w:uiPriority="68" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Grid 3 Accent 2" w:semiHidden="0" w:uiPriority="69" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Dark List Accent 2" w:semiHidden="0" w:uiPriority="70" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Colorful Shading Accent 2" w:semiHidden="0" w:uiPriority="71" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Colorful List Accent 2" w:semiHidden="0" w:uiPriority="72" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Colorful Grid Accent 2" w:semiHidden="0" w:uiPriority="73" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Light Shading Accent 3" w:semiHidden="0" w:uiPriority="60" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Light List Accent 3" w:semiHidden="0" w:uiPriority="61" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Light Grid Accent 3" w:semiHidden="0" w:uiPriority="62" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Shading 1 Accent 3" w:semiHidden="0" w:uiPriority="63" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Shading 2 Accent 3" w:semiHidden="0" w:uiPriority="64" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium List 1 Accent 3" w:semiHidden="0" w:uiPriority="65" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium List 2 Accent 3" w:semiHidden="0" w:uiPriority="66" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Grid 1 Accent 3" w:semiHidden="0" w:uiPriority="67" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Grid 2 Accent 3" w:semiHidden="0" w:uiPriority="68" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Grid 3 Accent 3" w:semiHidden="0" w:uiPriority="69" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Dark List Accent 3" w:semiHidden="0" w:uiPriority="70" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Colorful Shading Accent 3" w:semiHidden="0" w:uiPriority="71" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Colorful List Accent 3" w:semiHidden="0" w:uiPriority="72" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Colorful Grid Accent 3" w:semiHidden="0" w:uiPriority="73" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Light Shading Accent 4" w:semiHidden="0" w:uiPriority="60" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Light List Accent 4" w:semiHidden="0" w:uiPriority="61" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Light Grid Accent 4" w:semiHidden="0" w:uiPriority="62" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Shading 1 Accent 4" w:semiHidden="0" w:uiPriority="63" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Shading 2 Accent 4" w:semiHidden="0" w:uiPriority="64" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium List 1 Accent 4" w:semiHidden="0" w:uiPriority="65" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium List 2 Accent 4" w:semiHidden="0" w:uiPriority="66" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Grid 1 Accent 4" w:semiHidden="0" w:uiPriority="67" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Grid 2 Accent 4" w:semiHidden="0" w:uiPriority="68" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Grid 3 Accent 4" w:semiHidden="0" w:uiPriority="69" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Dark List Accent 4" w:semiHidden="0" w:uiPriority="70" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Colorful Shading Accent 4" w:semiHidden="0" w:uiPriority="71" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Colorful List Accent 4" w:semiHidden="0" w:uiPriority="72" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Colorful Grid Accent 4" w:semiHidden="0" w:uiPriority="73" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Light Shading Accent 5" w:semiHidden="0" w:uiPriority="60" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Light List Accent 5" w:semiHidden="0" w:uiPriority="61" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Light Grid Accent 5" w:semiHidden="0" w:uiPriority="62" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Shading 1 Accent 5" w:semiHidden="0" w:uiPriority="63" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Shading 2 Accent 5" w:semiHidden="0" w:uiPriority="64" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium List 1 Accent 5" w:semiHidden="0" w:uiPriority="65" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium List 2 Accent 5" w:semiHidden="0" w:uiPriority="66" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Grid 1 Accent 5" w:semiHidden="0" w:uiPriority="67" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Grid 2 Accent 5" w:semiHidden="0" w:uiPriority="68" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Grid 3 Accent 5" w:semiHidden="0" w:uiPriority="69" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Dark List Accent 5" w:semiHidden="0" w:uiPriority="70" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Colorful Shading Accent 5" w:semiHidden="0" w:uiPriority="71" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Colorful List Accent 5" w:semiHidden="0" w:uiPriority="72" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Colorful Grid Accent 5" w:semiHidden="0" w:uiPriority="73" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Light Shading Accent 6" w:semiHidden="0" w:uiPriority="60" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Light List Accent 6" w:semiHidden="0" w:uiPriority="61" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Light Grid Accent 6" w:semiHidden="0" w:uiPriority="62" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Shading 1 Accent 6" w:semiHidden="0" w:uiPriority="63" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Shading 2 Accent 6" w:semiHidden="0" w:uiPriority="64" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium List 1 Accent 6" w:semiHidden="0" w:uiPriority="65" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium List 2 Accent 6" w:semiHidden="0" w:uiPriority="66" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Grid 1 Accent 6" w:semiHidden="0" w:uiPriority="67" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Grid 2 Accent 6" w:semiHidden="0" w:uiPriority="68" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Grid 3 Accent 6" w:semiHidden="0" w:uiPriority="69" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Dark List Accent 6" w:semiHidden="0" w:uiPriority="70" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Colorful Shading Accent 6" w:semiHidden="0" w:uiPriority="71" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Colorful List Accent 6" w:semiHidden="0" w:uiPriority="72" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Colorful Grid Accent 6" w:semiHidden="0" w:uiPriority="73" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Subtle Emphasis" w:semiHidden="0" w:uiPriority="19" w:unhideWhenUsed="0" w:qFormat="1"/>
<w:lsdException w:name="Intense Emphasis" w:semiHidden="0" w:uiPriority="21" w:unhideWhenUsed="0" w:qFormat="1"/>
<w:lsdException w:name="Subtle Reference" w:semiHidden="0" w:uiPriority="31" w:unhideWhenUsed="0" w:qFormat="1"/>
<w:lsdException w:name="Intense Reference" w:semiHidden="0" w:uiPriority="32" w:unhideWhenUsed="0" w:qFormat="1"/>
<w:lsdException w:name="Book Title" w:semiHidden="0" w:uiPriority="33" w:unhideWhenUsed="0" w:qFormat="1"/>
<w:lsdException w:name="Bibliography" w:uiPriority="37"/>
<w:lsdException w:name="TOC Heading" w:uiPriority="39" w:qFormat="1"/>
</w:latentStyles>
<w:style w:type="paragraph" w:default="1" w:styleId="Normal">
<w:name w:val="Normal"/>
<w:qFormat/>
</w:style>
<w:style w:type="paragraph" w:styleId="Heading1">
<w:name w:val="heading 1"/>
<w:basedOn w:val="Normal"/>
<w:next w:val="Normal"/>
<w:link w:val="Heading1Char"/>
<w:uiPriority w:val="9"/>
<w:qFormat/>
<w:pPr>
<w:keepNext/>
<w:keepLines/>
<w:spacing w:before="480" w:after="0"/>
<w:outlineLvl w:val="0"/>
</w:pPr>
<w:rPr>
<w:rFonts w:asciiTheme="majorHAnsi" w:eastAsiaTheme="majorEastAsia" w:hAnsiTheme="majorHAnsi" w:cstheme="majorBidi"/>
<w:b/>
<w:bCs/>
<w:color w:val="365F91" w:themeColor="accent1" w:themeShade="BF"/>
<w:sz w:val="28"/>
<w:szCs w:val="28"/>
</w:rPr>
</w:style>
<w:style w:type="character" w:default="1" w:styleId="DefaultParagraphFont">
<w:name w:val="Default Paragraph Font"/>
<w:uiPriority w:val="1"/>
<w:semiHidden/>
<w:unhideWhenUsed/>
</w:style>
<w:style w:type="table" w:default="1" w:styleId="TableNormal">
<w:name w:val="Normal Table"/>
<w:uiPriority w:val="99"/>
<w:semiHidden/>
<w:unhideWhenUsed/>
<w:qFormat/>
<w:tblPr>
<w:tblInd w:w="0" w:type="dxa"/>
<w:tblCellMar>
<w:top w:w="0" w:type="dxa"/>
<w:left w:w="108" w:type="dxa"/>
<w:bottom w:w="0" w:type="dxa"/>
<w:right w:w="108" w:type="dxa"/>
</w:tblCellMar>
</w:tblPr>
</w:style>
<w:style w:type="numbering" w:default="1" w:styleId="NoList">
<w:name w:val="No List"/>
<w:uiPriority w:val="99"/>
<w:semiHidden/>
<w:unhideWhenUsed/>
</w:style>
<w:style w:type="character" w:styleId="PlaceholderText">
<w:name w:val="Placeholder Text"/>
<w:basedOn w:val="DefaultParagraphFont"/>
<w:uiPriority w:val="99"/>
<w:semiHidden/>
<w:rPr>
<w:color w:val="808080"/>
</w:rPr>
</w:style>
<w:style w:type="paragraph" w:styleId="BalloonText">
<w:name w:val="Balloon Text"/>
<w:basedOn w:val="Normal"/>
<w:link w:val="BalloonTextChar"/>
<w:uiPriority w:val="99"/>
<w:semiHidden/>
<w:unhideWhenUsed/>
<w:pPr>
<w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
</w:pPr>
<w:rPr>
<w:rFonts w:ascii="Tahoma" w:hAnsi="Tahoma" w:cs="Tahoma"/>
<w:sz w:val="16"/>
<w:szCs w:val="16"/>
</w:rPr>
</w:style>
<w:style w:type="character" w:customStyle="1" w:styleId="BalloonTextChar">
<w:name w:val="Balloon Text Char"/>
<w:basedOn w:val="DefaultParagraphFont"/>
<w:link w:val="BalloonText"/>
<w:uiPriority w:val="99"/>
<w:semiHidden/>
<w:rPr>
<w:rFonts w:ascii="Tahoma" w:hAnsi="Tahoma" w:cs="Tahoma"/>
<w:sz w:val="16"/>
<w:szCs w:val="16"/>
</w:rPr>
</w:style>
<w:style w:type="paragraph" w:styleId="Title">
<w:name w:val="Title"/>
<w:basedOn w:val="Normal"/>
<w:next w:val="Normal"/>
<w:link w:val="TitleChar"/>
<w:uiPriority w:val="10"/>
<w:qFormat/>
<w:pPr>
<w:pBdr>
<w:bottom w:val="single" w:sz="8" w:space="4" w:color="4F81BD" w:themeColor="accent1"/>
</w:pBdr>
<w:spacing w:after="300" w:line="240" w:lineRule="auto"/>
<w:contextualSpacing/>
</w:pPr>
<w:rPr>
<w:rFonts w:asciiTheme="majorHAnsi" w:eastAsiaTheme="majorEastAsia" w:hAnsiTheme="majorHAnsi" w:cstheme="majorBidi"/>
<w:color w:val="17365D" w:themeColor="text2" w:themeShade="BF"/>
<w:spacing w:val="5"/>
<w:kern w:val="28"/>
<w:sz w:val="52"/>
<w:szCs w:val="52"/>
</w:rPr>
</w:style>
<w:style w:type="character" w:customStyle="1" w:styleId="TitleChar">
<w:name w:val="Title Char"/>
<w:basedOn w:val="DefaultParagraphFont"/>
<w:link w:val="Title"/>
<w:uiPriority w:val="10"/>
<w:rPr>
<w:rFonts w:asciiTheme="majorHAnsi" w:eastAsiaTheme="majorEastAsia" w:hAnsiTheme="majorHAnsi" w:cstheme="majorBidi"/>
<w:color w:val="17365D" w:themeColor="text2" w:themeShade="BF"/>
<w:spacing w:val="5"/>
<w:kern w:val="28"/>
<w:sz w:val="52"/>
<w:szCs w:val="52"/>
</w:rPr>
</w:style>
<w:style w:type="character" w:customStyle="1" w:styleId="Heading1Char">
<w:name w:val="Heading 1 Char"/>
<w:basedOn w:val="DefaultParagraphFont"/>
<w:link w:val="Heading1"/>
<w:uiPriority w:val="9"/>
<w:rPr>
<w:rFonts w:asciiTheme="majorHAnsi" w:eastAsiaTheme="majorEastAsia" w:hAnsiTheme="majorHAnsi" w:cstheme="majorBidi"/>
<w:b/>
<w:bCs/>
<w:color w:val="365F91" w:themeColor="accent1" w:themeShade="BF"/>
<w:sz w:val="28"/>
<w:szCs w:val="28"/>
</w:rPr>
</w:style>
</w:styles>
</pkg:xmlData>
</pkg:part>
<pkg:part pkg:name="/word/webSettings.xml" pkg:contentType="application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml">
<pkg:xmlData>
<w:webSettings xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">
<w:optimizeForBrowser/>
<w:allowPNG/>
<w:pixelsPerInch w:val="120"/>
</w:webSettings>
</pkg:xmlData>
</pkg:part>
<pkg:part pkg:name="/word/fontTable.xml" pkg:contentType="application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml">
<pkg:xmlData>
<w:fonts xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">
<w:font w:name="Calibri">
<w:panose1 w:val="020F0502020204030204"/>
<w:charset w:val="00"/>
<w:family w:val="swiss"/>
<w:pitch w:val="variable"/>
<w:sig w:usb0="E10002FF" w:usb1="4000ACFF" w:usb2="00000009" w:usb3="00000000" w:csb0="0000019F" w:csb1="00000000"/>
</w:font>
<w:font w:name="Times New Roman">
<w:panose1 w:val="02020603050405020304"/>
<w:charset w:val="00"/>
<w:family w:val="roman"/>
<w:pitch w:val="variable"/>
<w:sig w:usb0="E0002AFF" w:usb1="C0007841" w:usb2="00000009" w:usb3="00000000" w:csb0="000001FF" w:csb1="00000000"/>
</w:font>
<w:font w:name="Cambria">
<w:panose1 w:val="02040503050406030204"/>
<w:charset w:val="00"/>
<w:family w:val="roman"/>
<w:pitch w:val="variable"/>
<w:sig w:usb0="E00002FF" w:usb1="400004FF" w:usb2="00000000" w:usb3="00000000" w:csb0="0000019F" w:csb1="00000000"/>
</w:font>
<w:font w:name="Tahoma">
<w:panose1 w:val="020B0604030504040204"/>
<w:charset w:val="00"/>
<w:family w:val="swiss"/>
<w:pitch w:val="variable"/>
<w:sig w:usb0="E1002EFF" w:usb1="C000605B" w:usb2="00000029" w:usb3="00000000" w:csb0="000101FF" w:csb1="00000000"/>
</w:font>
</w:fonts>
</pkg:xmlData>
</pkg:part>
<pkg:part pkg:name="/word/glossary/styles.xml" pkg:contentType="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml">
<pkg:xmlData>
<w:styles xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">
<w:docDefaults>
<w:rPrDefault>
<w:rPr>
<w:rFonts w:asciiTheme="minorHAnsi" w:eastAsiaTheme="minorEastAsia" w:hAnsiTheme="minorHAnsi" w:cstheme="minorBidi"/>
<w:sz w:val="22"/>
<w:szCs w:val="22"/>
<w:lang w:val="en-AU" w:eastAsia="en-AU" w:bidi="ar-SA"/>
</w:rPr>
</w:rPrDefault>
<w:pPrDefault>
<w:pPr>
<w:spacing w:after="200" w:line="276" w:lineRule="auto"/>
</w:pPr>
</w:pPrDefault>
</w:docDefaults>
<w:latentStyles w:defLockedState="0" w:defUIPriority="99" w:defSemiHidden="1" w:defUnhideWhenUsed="1" w:defQFormat="0" w:count="267">
<w:lsdException w:name="Normal" w:semiHidden="0" w:uiPriority="0" w:unhideWhenUsed="0" w:qFormat="1"/>
<w:lsdException w:name="heading 1" w:semiHidden="0" w:uiPriority="9" w:unhideWhenUsed="0" w:qFormat="1"/>
<w:lsdException w:name="heading 2" w:uiPriority="9" w:qFormat="1"/>
<w:lsdException w:name="heading 3" w:uiPriority="9" w:qFormat="1"/>
<w:lsdException w:name="heading 4" w:uiPriority="9" w:qFormat="1"/>
<w:lsdException w:name="heading 5" w:uiPriority="9" w:qFormat="1"/>
<w:lsdException w:name="heading 6" w:uiPriority="9" w:qFormat="1"/>
<w:lsdException w:name="heading 7" w:uiPriority="9" w:qFormat="1"/>
<w:lsdException w:name="heading 8" w:uiPriority="9" w:qFormat="1"/>
<w:lsdException w:name="heading 9" w:uiPriority="9" w:qFormat="1"/>
<w:lsdException w:name="toc 1" w:uiPriority="39"/>
<w:lsdException w:name="toc 2" w:uiPriority="39"/>
<w:lsdException w:name="toc 3" w:uiPriority="39"/>
<w:lsdException w:name="toc 4" w:uiPriority="39"/>
<w:lsdException w:name="toc 5" w:uiPriority="39"/>
<w:lsdException w:name="toc 6" w:uiPriority="39"/>
<w:lsdException w:name="toc 7" w:uiPriority="39"/>
<w:lsdException w:name="toc 8" w:uiPriority="39"/>
<w:lsdException w:name="toc 9" w:uiPriority="39"/>
<w:lsdException w:name="caption" w:uiPriority="35" w:qFormat="1"/>
<w:lsdException w:name="Title" w:semiHidden="0" w:uiPriority="10" w:unhideWhenUsed="0" w:qFormat="1"/>
<w:lsdException w:name="Default Paragraph Font" w:uiPriority="1"/>
<w:lsdException w:name="Subtitle" w:semiHidden="0" w:uiPriority="11" w:unhideWhenUsed="0" w:qFormat="1"/>
<w:lsdException w:name="Strong" w:semiHidden="0" w:uiPriority="22" w:unhideWhenUsed="0" w:qFormat="1"/>
<w:lsdException w:name="Emphasis" w:semiHidden="0" w:uiPriority="20" w:unhideWhenUsed="0" w:qFormat="1"/>
<w:lsdException w:name="Table Grid" w:semiHidden="0" w:uiPriority="59" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Placeholder Text" w:unhideWhenUsed="0"/>
<w:lsdException w:name="No Spacing" w:semiHidden="0" w:uiPriority="1" w:unhideWhenUsed="0" w:qFormat="1"/>
<w:lsdException w:name="Light Shading" w:semiHidden="0" w:uiPriority="60" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Light List" w:semiHidden="0" w:uiPriority="61" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Light Grid" w:semiHidden="0" w:uiPriority="62" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Shading 1" w:semiHidden="0" w:uiPriority="63" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Shading 2" w:semiHidden="0" w:uiPriority="64" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium List 1" w:semiHidden="0" w:uiPriority="65" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium List 2" w:semiHidden="0" w:uiPriority="66" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Grid 1" w:semiHidden="0" w:uiPriority="67" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Grid 2" w:semiHidden="0" w:uiPriority="68" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Grid 3" w:semiHidden="0" w:uiPriority="69" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Dark List" w:semiHidden="0" w:uiPriority="70" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Colorful Shading" w:semiHidden="0" w:uiPriority="71" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Colorful List" w:semiHidden="0" w:uiPriority="72" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Colorful Grid" w:semiHidden="0" w:uiPriority="73" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Light Shading Accent 1" w:semiHidden="0" w:uiPriority="60" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Light List Accent 1" w:semiHidden="0" w:uiPriority="61" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Light Grid Accent 1" w:semiHidden="0" w:uiPriority="62" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Shading 1 Accent 1" w:semiHidden="0" w:uiPriority="63" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Shading 2 Accent 1" w:semiHidden="0" w:uiPriority="64" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium List 1 Accent 1" w:semiHidden="0" w:uiPriority="65" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Revision" w:unhideWhenUsed="0"/>
<w:lsdException w:name="List Paragraph" w:semiHidden="0" w:uiPriority="34" w:unhideWhenUsed="0" w:qFormat="1"/>
<w:lsdException w:name="Quote" w:semiHidden="0" w:uiPriority="29" w:unhideWhenUsed="0" w:qFormat="1"/>
<w:lsdException w:name="Intense Quote" w:semiHidden="0" w:uiPriority="30" w:unhideWhenUsed="0" w:qFormat="1"/>
<w:lsdException w:name="Medium List 2 Accent 1" w:semiHidden="0" w:uiPriority="66" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Grid 1 Accent 1" w:semiHidden="0" w:uiPriority="67" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Grid 2 Accent 1" w:semiHidden="0" w:uiPriority="68" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Grid 3 Accent 1" w:semiHidden="0" w:uiPriority="69" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Dark List Accent 1" w:semiHidden="0" w:uiPriority="70" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Colorful Shading Accent 1" w:semiHidden="0" w:uiPriority="71" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Colorful List Accent 1" w:semiHidden="0" w:uiPriority="72" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Colorful Grid Accent 1" w:semiHidden="0" w:uiPriority="73" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Light Shading Accent 2" w:semiHidden="0" w:uiPriority="60" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Light List Accent 2" w:semiHidden="0" w:uiPriority="61" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Light Grid Accent 2" w:semiHidden="0" w:uiPriority="62" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Shading 1 Accent 2" w:semiHidden="0" w:uiPriority="63" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Shading 2 Accent 2" w:semiHidden="0" w:uiPriority="64" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium List 1 Accent 2" w:semiHidden="0" w:uiPriority="65" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium List 2 Accent 2" w:semiHidden="0" w:uiPriority="66" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Grid 1 Accent 2" w:semiHidden="0" w:uiPriority="67" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Grid 2 Accent 2" w:semiHidden="0" w:uiPriority="68" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Grid 3 Accent 2" w:semiHidden="0" w:uiPriority="69" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Dark List Accent 2" w:semiHidden="0" w:uiPriority="70" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Colorful Shading Accent 2" w:semiHidden="0" w:uiPriority="71" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Colorful List Accent 2" w:semiHidden="0" w:uiPriority="72" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Colorful Grid Accent 2" w:semiHidden="0" w:uiPriority="73" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Light Shading Accent 3" w:semiHidden="0" w:uiPriority="60" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Light List Accent 3" w:semiHidden="0" w:uiPriority="61" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Light Grid Accent 3" w:semiHidden="0" w:uiPriority="62" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Shading 1 Accent 3" w:semiHidden="0" w:uiPriority="63" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Shading 2 Accent 3" w:semiHidden="0" w:uiPriority="64" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium List 1 Accent 3" w:semiHidden="0" w:uiPriority="65" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium List 2 Accent 3" w:semiHidden="0" w:uiPriority="66" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Grid 1 Accent 3" w:semiHidden="0" w:uiPriority="67" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Grid 2 Accent 3" w:semiHidden="0" w:uiPriority="68" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Grid 3 Accent 3" w:semiHidden="0" w:uiPriority="69" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Dark List Accent 3" w:semiHidden="0" w:uiPriority="70" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Colorful Shading Accent 3" w:semiHidden="0" w:uiPriority="71" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Colorful List Accent 3" w:semiHidden="0" w:uiPriority="72" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Colorful Grid Accent 3" w:semiHidden="0" w:uiPriority="73" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Light Shading Accent 4" w:semiHidden="0" w:uiPriority="60" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Light List Accent 4" w:semiHidden="0" w:uiPriority="61" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Light Grid Accent 4" w:semiHidden="0" w:uiPriority="62" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Shading 1 Accent 4" w:semiHidden="0" w:uiPriority="63" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Shading 2 Accent 4" w:semiHidden="0" w:uiPriority="64" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium List 1 Accent 4" w:semiHidden="0" w:uiPriority="65" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium List 2 Accent 4" w:semiHidden="0" w:uiPriority="66" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Grid 1 Accent 4" w:semiHidden="0" w:uiPriority="67" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Grid 2 Accent 4" w:semiHidden="0" w:uiPriority="68" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Grid 3 Accent 4" w:semiHidden="0" w:uiPriority="69" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Dark List Accent 4" w:semiHidden="0" w:uiPriority="70" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Colorful Shading Accent 4" w:semiHidden="0" w:uiPriority="71" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Colorful List Accent 4" w:semiHidden="0" w:uiPriority="72" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Colorful Grid Accent 4" w:semiHidden="0" w:uiPriority="73" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Light Shading Accent 5" w:semiHidden="0" w:uiPriority="60" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Light List Accent 5" w:semiHidden="0" w:uiPriority="61" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Light Grid Accent 5" w:semiHidden="0" w:uiPriority="62" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Shading 1 Accent 5" w:semiHidden="0" w:uiPriority="63" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Shading 2 Accent 5" w:semiHidden="0" w:uiPriority="64" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium List 1 Accent 5" w:semiHidden="0" w:uiPriority="65" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium List 2 Accent 5" w:semiHidden="0" w:uiPriority="66" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Grid 1 Accent 5" w:semiHidden="0" w:uiPriority="67" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Grid 2 Accent 5" w:semiHidden="0" w:uiPriority="68" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Grid 3 Accent 5" w:semiHidden="0" w:uiPriority="69" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Dark List Accent 5" w:semiHidden="0" w:uiPriority="70" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Colorful Shading Accent 5" w:semiHidden="0" w:uiPriority="71" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Colorful List Accent 5" w:semiHidden="0" w:uiPriority="72" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Colorful Grid Accent 5" w:semiHidden="0" w:uiPriority="73" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Light Shading Accent 6" w:semiHidden="0" w:uiPriority="60" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Light List Accent 6" w:semiHidden="0" w:uiPriority="61" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Light Grid Accent 6" w:semiHidden="0" w:uiPriority="62" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Shading 1 Accent 6" w:semiHidden="0" w:uiPriority="63" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Shading 2 Accent 6" w:semiHidden="0" w:uiPriority="64" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium List 1 Accent 6" w:semiHidden="0" w:uiPriority="65" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium List 2 Accent 6" w:semiHidden="0" w:uiPriority="66" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Grid 1 Accent 6" w:semiHidden="0" w:uiPriority="67" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Grid 2 Accent 6" w:semiHidden="0" w:uiPriority="68" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Medium Grid 3 Accent 6" w:semiHidden="0" w:uiPriority="69" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Dark List Accent 6" w:semiHidden="0" w:uiPriority="70" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Colorful Shading Accent 6" w:semiHidden="0" w:uiPriority="71" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Colorful List Accent 6" w:semiHidden="0" w:uiPriority="72" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Colorful Grid Accent 6" w:semiHidden="0" w:uiPriority="73" w:unhideWhenUsed="0"/>
<w:lsdException w:name="Subtle Emphasis" w:semiHidden="0" w:uiPriority="19" w:unhideWhenUsed="0" w:qFormat="1"/>
<w:lsdException w:name="Intense Emphasis" w:semiHidden="0" w:uiPriority="21" w:unhideWhenUsed="0" w:qFormat="1"/>
<w:lsdException w:name="Subtle Reference" w:semiHidden="0" w:uiPriority="31" w:unhideWhenUsed="0" w:qFormat="1"/>
<w:lsdException w:name="Intense Reference" w:semiHidden="0" w:uiPriority="32" w:unhideWhenUsed="0" w:qFormat="1"/>
<w:lsdException w:name="Book Title" w:semiHidden="0" w:uiPriority="33" w:unhideWhenUsed="0" w:qFormat="1"/>
<w:lsdException w:name="Bibliography" w:uiPriority="37"/>
<w:lsdException w:name="TOC Heading" w:uiPriority="39" w:qFormat="1"/>
</w:latentStyles>
<w:style w:type="paragraph" w:default="1" w:styleId="Normal">
<w:name w:val="Normal"/>
<w:qFormat/>
</w:style>
<w:style w:type="character" w:default="1" w:styleId="DefaultParagraphFont">
<w:name w:val="Default Paragraph Font"/>
<w:uiPriority w:val="1"/>
<w:semiHidden/>
<w:unhideWhenUsed/>
</w:style>
<w:style w:type="table" w:default="1" w:styleId="TableNormal">
<w:name w:val="Normal Table"/>
<w:uiPriority w:val="99"/>
<w:semiHidden/>
<w:unhideWhenUsed/>
<w:qFormat/>
<w:tblPr>
<w:tblInd w:w="0" w:type="dxa"/>
<w:tblCellMar>
<w:top w:w="0" w:type="dxa"/>
<w:left w:w="108" w:type="dxa"/>
<w:bottom w:w="0" w:type="dxa"/>
<w:right w:w="108" w:type="dxa"/>
</w:tblCellMar>
</w:tblPr>
</w:style>
<w:style w:type="numbering" w:default="1" w:styleId="NoList">
<w:name w:val="No List"/>
<w:uiPriority w:val="99"/>
<w:semiHidden/>
<w:unhideWhenUsed/>
</w:style>
<w:style w:type="character" w:styleId="PlaceholderText">
<w:name w:val="Placeholder Text"/>
<w:basedOn w:val="DefaultParagraphFont"/>
<w:uiPriority w:val="99"/>
<w:semiHidden/>
<w:rPr>
<w:color w:val="808080"/>
</w:rPr>
</w:style>
</w:styles>
</pkg:xmlData>
</pkg:part>
<pkg:part pkg:name="/word/glossary/fontTable.xml" pkg:contentType="application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml">
<pkg:xmlData>
<w:fonts xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">
<w:font w:name="Calibri">
<w:panose1 w:val="020F0502020204030204"/>
<w:charset w:val="00"/>
<w:family w:val="swiss"/>
<w:pitch w:val="variable"/>
<w:sig w:usb0="E10002FF" w:usb1="4000ACFF" w:usb2="00000009" w:usb3="00000000" w:csb0="0000019F" w:csb1="00000000"/>
</w:font>
<w:font w:name="Times New Roman">
<w:panose1 w:val="02020603050405020304"/>
<w:charset w:val="00"/>
<w:family w:val="roman"/>
<w:pitch w:val="variable"/>
<w:sig w:usb0="E0002AFF" w:usb1="C0007841" w:usb2="00000009" w:usb3="00000000" w:csb0="000001FF" w:csb1="00000000"/>
</w:font>
<w:font w:name="Cambria">
<w:panose1 w:val="02040503050406030204"/>
<w:charset w:val="00"/>
<w:family w:val="roman"/>
<w:pitch w:val="variable"/>
<w:sig w:usb0="E00002FF" w:usb1="400004FF" w:usb2="00000000" w:usb3="00000000" w:csb0="0000019F" w:csb1="00000000"/>
</w:font>
<w:font w:name="Tahoma">
<w:panose1 w:val="020B0604030504040204"/>
<w:charset w:val="00"/>
<w:family w:val="swiss"/>
<w:pitch w:val="variable"/>
<w:sig w:usb0="E1002EFF" w:usb1="C000605B" w:usb2="00000029" w:usb3="00000000" w:csb0="000101FF" w:csb1="00000000"/>
</w:font>
</w:fonts>
</pkg:xmlData>
</pkg:part>
</pkg:package>
|
{
"content_hash": "7b73e71136053620c3e0eb426775fe4d",
"timestamp": "",
"source": "github",
"line_count": 1328,
"max_line_length": 602,
"avg_line_length": 60.359939759036145,
"alnum_prop": 0.5761620798922129,
"repo_name": "dlconner/autodoc",
"id": "5ca97011a55d864ea56eb32f706a5287455605c4",
"size": "80218",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "bin/OpenDoPE/escaped-xhtml.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "4311"
},
{
"name": "Java",
"bytes": "59744"
},
{
"name": "Shell",
"bytes": "317"
},
{
"name": "XSLT",
"bytes": "216506"
}
],
"symlink_target": ""
}
|
これはRiak 1.4.x系のバグフィックスのリリースです。
## Issues / PR's Resolved
### BitcaskのNIFモードへの変更
BitcaskをNIFモードを使用するように変更(ファイルIO操作では、Erlangの代わりにネイティブコードを使用する)した場合に、バックエンドにおいて新しいファイルが生成されないことがある。
### AAEツリーの再生成による2i AAE無効化の修正
一度、AAEがツリーの再生成をおこなうと、2iデータの修復機能が失われます。デフォルトでツリーは一週間後に再生成されるので、修復コマンドはある期間で機能するものの、あるとき突然動かなくなります。
### アクティブアンチエントロピーのexchangeおよびrepairのスロットリング
クラスタ全体の`riak_kv_vnodeq_max`という値を用いたスロットリングがriak_kv/754で追加されました。
稀にAAEのexchange, repair操作によってvnodeが過負荷に陥ることがあり、これを避けることが目的です。
* exchangeとrepairのスロットリングはデフォルトで有効です。
スロットリングを完全に無効化するには、`app.config`の`riak_kv`セクションに
`{aae_throttle_kill, true}`を定義してください。
* Riakコンソールで以下を実行すると非永続的に無効化/有効化をそれぞれ実行できます。
`riak_kv_entropy_manager:set_aae_throttle_kill(true | false).`,
* スロットリングのデフォルト設定(`aae_throttle_sleep_time`: `app.config`内の`riak_kv`セクション)は
検証環境での試験において非常に効果が見られました。
* Riakコンソールはクエリの実行や下記を利用した非永続的な設定変更に利用されます。
`riak_kv_entropy_manager:get_aae_throttle_limits()` や
`riak_kv_entropy_manager:set_aae_throttle_limits(LimitDefinition)`.
* デフォルト設定が効果的でない場合はBashoのサポートへコンタクトしてください。
* このスロットリング設定の構文は、Riak 2.0のCuttlefishスタイルの構文へ変換されます。
そのスロットリング実装は1.4.7リリースのものと同じです。
### Issues Closed
* bitcask/129: [Fix nif-mode and eunit_nif tests](https://github.com/basho/bitcask/pull/129)
* riak_kv/754: [Add timer:sleep()-based throttle to riak_kv_exchange_fsm:read_repair_keydiff()](https://github.com/basho/riak_kv/pull/754)
* riak_kv/775: [Make memory backend obey 2i return terms properly](https://github.com/basho/riak_kv/pull/775)
* riak_kv/780: [Fix lost 2i AAE tree on rebuild](https://github.com/basho/riak_kv/pull/780)
* riak_kv/789: [Fix logging call](https://github.com/basho/riak_kv/pull/789)
# Riak 1.4.6 リリースノート
これはRiak 1.4.x系のバグフィックスのリリースです。
## セカンダリインデックスの改善
### ローリングアップグレード中における2iクエリの失敗
* [riak_kv/766](https://github.com/basho/riak_kv/pull/766)
クラスタ内の一部のノードが古いバージョンのRiakで動いている場合、
2iクエリが失敗する可能性があります。(例: 1.3.x と 1.4.2 の混在環境)
### AAEツリーの生成がセカンダリインデックスデータのハッシュ生成に失敗
* [riak_kv/767](https://github.com/basho/riak_kv/pull/767)
AAEツリーの生成が2iデータのハッシュ生成に失敗します。
ログはエラーメッセージで埋もれ、最終的に何もしないような
無駄なリペア処理が多く発行されているかもしれません。
### レンジクエリにおける正規表現フィルター
新しい `term_regex` パラメータは、正規表現にマッチしたtermだけを返すように
セカンダリインデックスのレンジクエリ結果をフィルタします。例えば次のクエリが:
`http://localhost:10018/buckets/b/index/f1_bin/a/z?return_terms=true`
次のterm/keysのペアを返すとします:
`[("baa", "key1"),("aab", "key2"),("bba", "key3")]`
これを正規表現にかけます:
`http://localhost:10018/buckets/b/index/f1_bin/a/z?return_terms=true&term_regex=^.a`
するとtermの2つ目の文字が 'a' となるものだけを返します。
`[("baa", "key1"),("aab", "key2")]`
**注意: この機能は文字エンコーディングを認識しません。
可能であればASCII文字への正規化を推奨します。**
### leveldbのセカンダリインデックスデータの内部変換を高速化
現在、セカンダリインデックスとオブジェクトのKeyデータの読み書きに、sextコーデックのC言語版を使用しています。
これは大量のデータをleveldbから読み込む、走査系クエリの高速化に寄与するでしょう。
### ページネーションパフォーマンスの修正
これまでは小さなページあたりの件数を使う場合でも、
vnodeはそれより多い件数の結果を返すことができましたが(いずれにせよクライアントへは送信されません)
これが修正されています。
### 非ページネーションクエリにおけるソート
ページネートされたセカンダリインデックスクエリはterm、そしてkeyによってソートされます。
これらが導入されたため、この内部ソートはページネーションを伴わない標準のセカンダリインデックスクエリに対しても
デフォルト操作となっていました。これはいくつかのケースにおいて、パフォーマンスの低下を招きました。
非ページネーションクエリ(max_resultやcontinuationパラメータを含まない)に対するデフォルトの挙動は、
ソートされないものへ戻されています。`pagination_sort` パラメータでリクエスト毎にこのソートを再度、有効化できます。
また、設定ファイル `app.config` の `riak_kv` セクションにて `secondary_index_sort_default` を `true`
へすることでノード毎にこの挙動を戻すこともできます。これはアプリケーションがソート順序に依存しており、
コードの変更が難しい場合に便利でしょう。
### セカンダリインデックスデータのアンチエントロピー
新しい `riak-admin repair-2i` コマンドは、クエリに使用されるセカンダリインデックスデータと、
Riakオブジェクト内に保存されるセカンダリインデックスデータとの、あらゆる差異をスキャンし修正します。
これはノード上のすべてのパーティション、もしくはそのサブセット上で動作します。
修復の進捗確認には `riak-admin repair-2i status` コマンドを使用します。
また、`riak-admin repair-2i kill` は修復を停止させます。
この操作はディスク読み込みによる、すべてのセカンダリインデックスデータのスキャンを伴い、その後ハッシュツリーを生成します。
ハッシュツリーは、ディスクから読み込まれ修復されるRiakオブジェクト数を最小化します。
**修復はピーク時間帯を避けてスケジューリングすることを推奨します。**
### Stats
プロセスの大きな遅延や詰まりがstatの更新を妨げないように、statの集計処理にタイムアウトを追加。
[**riak_core 467**](https://github.com/basho/riak_core/pull/467)
## Issues / PR's Resolved
* bitcask/122: [Bound merge queue to number of partitions](https://github.com/basho/bitcask/pull/122)
* node_package/101: [Add extra options to debuild template](https://github.com/basho/node_package/pull/101)
* node_package/93: [Incorrect package format in SmartOS causes segfault on pkg_info](https://github.com/basho/node_package/issues/93)
* riak_core/429: [Handoff fix is to enable handoff to complete in mixed pre-1.4 clusters](https://github.com/basho/riak_core/pull/429)
* riak_core/467: [Bound the time that stats calculation can take](https://github.com/basho/riak_core/pull/467)
* riak_core/470: [Provide a synchronous registration and unregistration of services.](https://github.com/basho/riak_core/pull/470)
* riak_core/476: [Remove connection manager and service manager.](https://github.com/basho/riak_core/pull/476)
* riak_kv/715: [2i term regex filter 1.4](https://github.com/basho/riak_kv/pull/715)
* riak_kv/743: [Fix vnode sending > max_results items for 2i query](https://github.com/basho/riak_kv/pull/743)
* riak_kv/766: [Fix error when hashing index data in tree builds](https://github.com/basho/riak_kv/pull/766)
* riak_kv/767: [Fixed 2i queries in mixed clusters](https://github.com/basho/riak_kv/pull/767)
* riak_kv/772: [Fix broken return terms handling](https://github.com/basho/riak_kv/pull/772)
* riak_kv/774: [Enable bloom filters for AAE LevelDB instances](https://github.com/basho/riak_kv/pull/774)
* leveldb/110 [Add option for changing fadvise() handling when physical memory exceeds database size](https://github.com/basho/leveldb/pull/110)
* leveldb/112: [Create asynchronous close path to resolve race between write threads](https://github.com/basho/leveldb/pull/112)
## 既知の問題 (Known Issues)
* AAEツリーの期限切れ、リビルドの際に2iの新しいAAE機能が停止します。
次のリリースにこの修正を含めるよう、既に対応を開始しています。
* 1.4のノードとそれ以前のノードが混在しているmemoryバックエンド環境で、
ローリングアップグレード中に2iクエリの発行が失敗します。
# Riak 1.4.3, 1.4.4, 1.4.5
これらのバージョンのRiakはリリースされていません。
# Riak 1.4.2 リリースノート
これはRiak 1.4.x系のバグフィックスのリリースです。
* stats 関連の問題を解決
* 1.4.1 からの不要なログを削除(Not foundのエラーなど)
* 2iクエリのタイムアウト関連の問題を解決
* バックエンドの壊れたデータに対する追加の安全策を導入
* Riak Controlでの、ノードが非互換に見える不正なネゴシエーションを修正
## 解決された問題
* leveldb/89: [スループット制御の小さな調整](https://github.com/basho/leveldb/wiki/mv-level-work4)
* node_package/77: [FreeBSD で lib と etc ディレクトリにファイルを追加](https://github.com/basho/node_package/issues/77)
* node_package/82: [Debのpostinstスクリプトが/etcディレクトリをchmodしようとする](https://github.com/basho/node_package/issues/82)
* node_package/83: [FreeBSD パッケージが .tbz ではなく .tgz としてパッケージされてしまう](https://github.com/basho/node_package/issues/83)
* riak_control/132: [1.4でネゴシエーション順序が不正](https://github.com/basho/riak_control/pull/132)
* riak_control/133: [拡張レコードマクロを使用](https://github.com/basho/riak_control/pull/133)
* riak_control/135: [非互換は比較的深刻ではない](https://github.com/basho/riak_control/pull/135)
* riak_kv/644: [webmachine の 2i タイムアウトを修正](https://github.com/basho/riak_kv/pull/644)
* riak_kv/639: [HTTP MapReduce のエラーレポート表示を修正](https://github.com/basho/riak_kv/commit/01190f23099bf7febbb69d74f6b4922a91d045e3)
* riak_kv/636: [riak_kv_stat クラッシュによるプロセスリークを修正](https://github.com/basho/riak_kv/pull/636)
* riak_kv/638: [デシリアライズとCRCエラーをnot_foundとみなす](https://github.com/basho/riak_kv/pull/638)
* riak_kv/641: [1.4のLevelDBのfoldを改善](https://github.com/basho/riak_kv/pull/641)
* riak_kv/635: [2i タイムアウトのレスポンスを改善](https://github.com/basho/riak_kv/pull/635)
* riak_kv/632: [riak_kv_stat のタイムアウトを修正](https://github.com/basho/riak_kv/pull/632)
* riak_core/356: [folsom の stat エラーのハンドリングを追加](https://github.com/basho/riak_core/pull/356)
* riak_core/359: [handoff中のデータ破壊を検出](https://github.com/basho/riak_core/pull/359)
* webmachine/137: [Webmachine の単体テスト、結合テストのカバレッジ改善](https://github.com/basho/webmachine/pull/137)
* webmachine/164: [Webmachineの組み込みのログハンドラをエラーログで使用](https://github.com/basho/webmachine/pull/164)
* webmachine/161: [Webmachine APIでソケットを取得できるように変更](https://github.com/basho/webmachine/pull/161)
* webmachine/160: [R15B01以降のErlangとの互換性を再追加](https://github.com/basho/webmachine/pull/160)
* webmachine/158: [localtime から universaltime への変換を回避](https://github.com/basho/webmachine/pull/158)
* webmachine/156: [Erlang R15 互換性を追加](https://github.com/basho/webmachine/pull/156)
# Riak 1.4.1 リリースノート
これはバグフィックスのリリースです。主にセカンダリーインデックス、Riak Control、LevelDB に関する修正が含まれています。
* [riak_kv/615](https://github.com/basho/riak_kv/pull/615) で、完全一致のクエリに対するページネーションの問題が修正されました。
* [riak_kv/616](https://github.com/basho/riak_kv/pull/616) 2iクエリでもタイムアウトを設定できるようになりました。
* [riak_kv/618](https://github.com/basho/riak_kv/pull/618) 2iをMapReduceの入力として渡せなかった問題が解決しました。
* [riak_control/120](https://github.com/basho/riak_control/pull/120) 1.3系で動作するクラスタに1.4.0のノードを追加すると Riak Control がRiakノードをクラッシュさせる問題を解決しました。
* [leveldb/88](https://github.com/basho/leveldb/pull/88) Basho 版の LevelDB の fadvise サポートが改善され、書き込み時の競合がいくつか解決されました。
## Issues / PR's Resolved
* riak_core/351: [Fix catch pattern to match all errors](https://github.com/basho/riak_core/pull/351)
* riak_core/352: [Fix TCP mon to correctly spot nodes coming up](https://github.com/basho/riak_core/pull/352)
* riak_kv/615: [Do not set the start_term to the last seen key for eq (2i)](https://github.com/basho/riak_kv/pull/615)
* riak_kv/616: [Add millisecond timeout parameter to API 2i endpoints](https://github.com/basho/riak_kv/pull/616)
* riak_kv/618: [Strip index term from result before passing to MR (2i)](https://github.com/basho/riak_kv/pull/618)
* riak-erlang-client/108: [Add timeouts to 2i queries](https://github.com/basho/riak-erlang-client/pull/108)
* riak_pb/50: [Add timeout field to 2i messages](https://github.com/basho/riak_pb/pull/50)
* riak_control/120: [Handle incompatible records between the 1.3 and 1.4 release](https://github.com/basho/riak_control/pull/120)
* leveldb/88: [More effective fadvise calls + fix write race conditions](https://github.com/basho/leveldb/pull/88)
* node_package/75: [In RPMs: Do not error on post install script if usermod fails](https://github.com/basho/node_package/pull/75)
* node_package/76: [Fix `riak version` for RPM packages](https://github.com/basho/node_package/pull/76)
# Riak 1.4.0 リリースノート
## 主な新機能/改善点
### バイナリフォーマットの改善 (Improved Binary Format)
Riakに保存されるデータのフォーマットがさらにコンパクトになりました。
新しいフォーマットはデータ保存時のオーバーヘッドを減らしています。
特に小さいオブジェクトや大きなバケット名、キー名、メタデータに対して効果を発揮します。
Riak1.4で新規に作ったRiakクラスターはデフォルトで新しいフォーマットが有効になっています。
Riak1.4へアップグレードする際は、アップグレードをおこなうと新しいフォーマットが有効になります。
新旧のフォーマットは双方共にサポートされますので、アップグレードに伴う追加のオペレーションは必要ありません。
どのフォーマットが用いられるかは `app.config` の `riak_kv` セクションで、`object_format` を設定します。
設定値は `v0`、`v1` のどちらかであり、新しいフォーマットは`v1`です。
この新しいフォーマットはクラスターがサポートすればhandoff でも使用されます。
Riak1.4へアップグレードして新しいフォーマットを有効にしたユーザーが前バージョンへのダウングレードするには、
新しいフォーマットになっているデータを書きかえる必要があります(以前のバージョンのRiakは新しいフォーマットを読み込めません)。
`riak-admin` ではこのユーティリティが用意されています:
```
riak-admin downgrade-objects <kill-handoffs> [<concurrency>]
```
このユーティリティはダウングレードするにあたって、ノードごとに実行します。
`<kill-handoffs>`は `true` か `false` のどちらかの値をとります。`false`の場合、
再フォーマットの前に実行中のhandoffを待ちます。`true`であればノードが受信もしくは
送信している実行中のhandoffは全てkillされます。
再フォーマット中やその後はtransfer-limitが0に設定されます。
`<concurrency>`オプションは1以上の整数値を取ります。これはそのノード上で、
いくつのパーティションが並列で再フォーマットされるかを指定するものです。
デフォルトは2になっています。そしてクラスタ全体がダウングレードされることを見越して、
`downgrade-objects`は推奨フォーマットを `v0` に設定します。`downgrade-objects`はエラーや、
ノードがクラッシュした場合に複数回実行できます。
### `riak attach`の挙動を変更 (Changed behavior of `riak attach`)
`riak attach`にすでに慣れているユーザーは1.4での変更は注目に値します。
`riak attach`は稼働中のerlangノードと通信するためにerlangに提供されている
named pipeを使用していました。この機能は素晴らしいのですが、偶然にも Ctrl-C を押してしまうと
アタッチしたセッションと共に動作中のノードも終了させてしまいます。この振る舞いを今回、
`-remsh` (remote shell)を使ったノード通信に変更しました。これはCtrl-Cが稼働中のノードをkillしないので、より安全です。
分散erlangの問題にぶつかったり、-remsh が望ましくない場合は、以前の`riak attach`と同じ振る舞いする新しいコマンドの
`riak attach-direct` を使ってください。
### `riak-admin transfers` 改善 (`riak-admin transfers` Improvements)
`riak-admin transfers` でトランスファーごとの進捗を見られるようになりました。
また長いノード名の表示も改善しています。
進捗が表示されるかどうか、またどのように計算されるかはクラスターのバックエンドに依存します。
進捗は `riak_kv_bitcask_backend` と `riak_kv_eleveldb_backend` 、`riak_kv_memory_backend` で有効です。
`riak_kv_multi_backend` を使うクラスタは進捗の表示が有効になりません。
`riak_kv_bitcask_backend` と `riak_kv_memory_backend` ではキーの総数と送信済み数により進捗が決まります。
バリューサイズが大きく変わる場合には進捗が素直に出ないことがあります。 `riak_kv_eleveldb_backend` では、
進捗は保存されたバイトで測られます。総使用バイトは時に過大評価となるため、表示される進捗は、
実際の進捗を正しく表していることもありますが、最悪の場合には表示よりも先に進んでいる可能性があります。
### Lager アップグレード 1.2.2 to 2.0.0 (Lager Upgrade 1.2.2 to 2.0.0)
Lager は Riak 1.3.x 系で用いられていた 1.2.2 から 2.0.0 へアップデートされました。 Lager 自体の新しい機能は https://github.com/basho/lager をご覧ください。
### クエリ (Querying)
#### 2i ページネーション (Pagination Support in 2i)
セカンダリーインデックス (2i) を拡張し、ページネーションを可能にしました。 `max_results` オプションを指定することで、プロトコルバッファーと HTTP の両方で利用できます。完全な詳細は [こちら](https://github.com/basho/riak_kv/pull/540) をご覧ください。
### クライアント API (Client APIs)
#### クライアント指定のタイムアウト (Client-specified timeouts)
クライアントタイムアウト値をミリ秒で指定できるようになりました。これはオブジェクトの取得、保存、削除に対するデフォルトの内部的なタイムアウトを上書きします。
#### プロトコルバッファーでのバケットプロパティー(Protocol Buffers bucket properties)
プロトコルバッファーは既知のすべてのバケットプロパティーをサポートします。またリセットも可能になりました。
#### バケットリストのストリーミング (List-buckets streaming)
キーリストと同様に、バケットリストもストリーミング可能になりました。
Riak が各ノードからの応答をすべて集めてからクライアントに応答するのではなく、各ノードからの応答に応じてクライアントに送信します。
#### プロトコルバッファーの複数インターフェースサポート (Protocol buffers binds to multiple interfaces)
HTTP と同様に、プロトコルバッファーも複数のインターフェースにバインド出来るようになりました。設定は `pb_port` と `pb_ip` から変更され、単一の `pb` となりました。そこでは IP とポートのリストを指定できます。
### データタイプ (Data Types)
#### PN-カウンター (PN-Counters)
Riak 1.4 では、Riak で初めてとなる分散データ型である PN-カウンターを追加しました。PN-カウンターはインクリメント(P)とデクリメント(N)の両方が可能です。完全な詳細は [こちら](https://github.com/basho/riak_kv/pull/536) をご覧ください。私達は Riak の将来のデータ型を説明するため [CRDT Cookbook](https://github.com/lenary/riak_crdt_cookbook) にも取り組んでいます。
### Riak Control
Riak Control はクラスタとスタンドアローンノードの管理を改善し、変更のステージングとコミットをサポートします。
### 新しいコマンド: riak-debug (New command: riak-debug)
コマンド `riak-debug` はトラブルシューティングのための情報収集自動化の
助けとなるシェルスクリプトです。OS コマンド、Riak コマンド、Riak 設定ファイル、
Riak ログファイルの情報を集めます。スクリプトの使い方やワークフローへの組み込み方は
`riak-debug -h` や `man riak-debug` を参照してください。
### パッケージ/ランタイムの変更 (Packaging / Runtime changes)
Riak 1.4 は [node_package](http://github.com/basho/node_package) を
用いてパッケージ化されるようになりました。Riak CS は初めてのリリースから
このツールを用いています。
この共通化により、一貫性のある機能を提供し、またパッケージング品質を向上させています。
このリリースに対するパッケージングのバグフィックスは "Issues" セクションの
node\_package の項目をご覧ください。
##### 追加、削除されたプラットフォーム (Platforms Added / Removed)
Debian Wheezy と SmartOS 13.1 が 1.4 でサポートされます。
予定通り、 32 bit パッケージは削除されました。
##### パッケージとランタイムの主要な変更点 (Major changes in packages and runtime)
* Deb と RPM システム向けの init.d スクリプトが、これらのディストリビューションの
標準に合わせて書き換えられました。
特に、 init スクリプトは失敗するとノンゼロの終了コードを返します。
これは他のツールとシームレスに動作するために大きな問題となっていました。
* start, stop, status コマンドは stdout を読まなくても、戻り値を
返すようになりました。
これは私達がずっと抱えていた主要な "技術的負債" で、ようやく修正されました。
* `riak start/stop` コマンドから `riak.pid` ファイルが作成、削除
されるようになりました。他のツールは、riak スクリプトや nodetool を知らなくても
.pid ファイルを活用できます。
* `riak attach` と `riak attach-direct` はユーザに q() と CTRL-C の意味について
警告するようになりました。
* `riak` スクリプトはどのコマンドが riak ユーザ(または root ユーザ)で
実行されるべきかを明確にしました。
`getpid` や `ping` のステータスコマンドはどのユーザでも実行できますが、
`start`, `stop` のようなデーモンコマンドは riak ユーザにより実行されていない
場合にはエラーとなります。
## Issues / PR's Resolved
* bear/1: [Remove native flag and add kernel,stdlib to app deps](https://github.com/basho/bear/pull/1)
* bitcask/89: [add dialyzer targets](https://github.com/basho/bitcask/issues/89)
* bitcask/92: [Fix merge logging bug introduced by bs-merge-expiration-change branch](https://github.com/basho/bitcask/issues/92)
* folsom/2: [Improve performance of slide histogram](https://github.com/basho/folsom/issues/2)
* leveldb/73: [level work1](https://github.com/basho/leveldb/issues/73)
* leveldb/74: [Add status query for total bytes used by a LevelDB instance](https://github.com/basho/leveldb/issues/74)
* leveldb/75: [Merge of Google 1.6, 1.7, 1.8, and 1.9 releases](https://github.com/basho/leveldb/issues/75)
* leveldb/78: [Repair updated for edge case created with new directory structure.](https://github.com/basho/leveldb/issues/78)
* leveldb/79: [filecache tuning2](https://github.com/basho/leveldb/issues/79)
* leveldb/81: [bloom size limit](https://github.com/basho/leveldb/issues/81)
* leveldb/84: [level work3, change from 3 overlapped levels to 2](https://github.com/basho/leveldb/issues/84)
* merge_index/30: [Remove delayed_write option](https://github.com/basho/merge_index/pull/30)
* mochiweb/7: [Range header fix](https://github.com/basho/mochiweb/issues/7)
* mochiweb/8: [Remove parameterized modules.](https://github.com/basho/mochiweb/issues/8)
* node_package/40: [init script returns success even if riak does not start](https://github.com/basho/node_package/issues/40)
* node_package/43: [Add SRPMS and make RPM version field fully compatible](https://github.com/basho/node_package/issues/43)
* node_package/44: [Convert RPM init script to fall in line with Redhat style](https://github.com/basho/node_package/issues/44)
* node_package/47: [Add app_epath.sh, a POSIX app.config parsing utility.](https://github.com/basho/node_package/issues/47)
* node_package/49: [Create .pid files for package builds](https://github.com/basho/node_package/issues/49)
* node_package/50: [RPM %files changes behavior on Fedora 18](https://github.com/basho/node_package/issues/50)
* node_package/51: [Return nonzero exit codes on init function failure](https://github.com/basho/node_package/issues/51)
* node_package/54: [Fix %files section to not claim ownership of bindir and mandir](https://github.com/basho/node_package/issues/54)
* node_package/55: [Investigate shipping configuration to increase open files ulimit](https://github.com/basho/node_package/issues/55)
* node_package/56: [Name SunOS packages based on erlang architecture rather than uname](https://github.com/basho/node_package/issues/56)
* node_package/57: [Base architecture naming on erlc arch](https://github.com/basho/node_package/issues/57)
* node_package/60: [Add support for SmartOS 13.1](https://github.com/basho/node_package/issues/60)
* node_package/61: [add simple warnings on attach/attach-direct](https://github.com/basho/node_package/issues/61)
* node_package/63: [remove contract specification from SMF manifests (solaris)](https://github.com/basho/node_package/issues/63)
* node_package/65: [Create patches for SmartOS packages to handle differing behavior](https://github.com/basho/node_package/issues/65)
* erlang_protobuffs/41: [Fix some README example problems, callout deep lists change.](https://github.com/basho/erlang_protobuffs/issues/41)
* erlang_protobuffs/42: [Cleanup warnings](https://github.com/basho/erlang_protobuffs/issues/42)
* erlang_protobuffs/45: [Be more firewall-friendly :-)](https://github.com/basho/erlang_protobuffs/issues/45)
* erlang_protobuffs/46: [Fix parsing hex values](https://github.com/basho/erlang_protobuffs/issues/46)
* erlang_protobuffs/47: [fix compiler warnings about shadowed variables](https://github.com/basho/erlang_protobuffs/issues/47)
* erlang_protobuffs/49: [Fix enums when using packages](https://github.com/basho/erlang_protobuffs/issues/49)
* erlang_protobuffs/51: [Remove O(N^2) algorithm from repeated field extraction.](https://github.com/basho/erlang_protobuffs/issues/51)
* riak/254: [Changed `riak attach` to use a remsh](https://github.com/basho/riak/issues/254)
* riak/268: [Switch riak to use node_package for packaging](https://github.com/basho/riak/issues/268)
* riak/272: [Add new rebar binary and erlydtl opts info toplevel rebar.config for solving dialyzer glitches](https://github.com/basho/riak/issues/272)
* riak/283: [We insist on a minimum of 5 nodes in a cluster, adjust devrel](https://github.com/basho/riak/issues/283)
* riak/286: [move and clarify ulimit check](https://github.com/basho/riak/issues/286)
* riak/288: [remove embedded option ](https://github.com/basho/riak/issues/288)
* riak/290: [Support multiple PB listeners](https://github.com/basho/riak/issues/290)
* riak/294: [Add missing rm -rf dev/$@/lib/riaknostic on dev target](https://github.com/basho/riak/issues/294)
* riak/303: [update riak-admin transfers](https://github.com/basho/riak/issues/303)
* riak/310: [Remove incorrect `-embedded` flag from riak startup command](https://github.com/basho/riak/issues/310)
* riak/311: [add "cluster resize-ring <new-size>" to riak-admin](https://github.com/basho/riak/issues/311)
* riak/322: [Add riak-debug, a command for automating the collection of information for diagnosing problems.](https://github.com/basho/riak/issues/322)
* riak/329: [Riaknostic no longer escript. Alter build process accordingly.](https://github.com/basho/riak/issues/329)
* riak/331: [Lower net_ticktime to check for aliveness more often](https://github.com/basho/riak/issues/331)
* riak/339: [update vm.args for moving to OTP team scheduler patch](https://github.com/basho/riak/issues/339)
* riak/341: [update app.config to activate v1 object format on new installs](https://github.com/basho/riak/issues/341)
* riak/345: [Unable to build Riak from source tarball while offline](https://github.com/basho/riak/issues/345)
* riak_api/21: [Move setting/fetching bucket properties out of riak_kv](https://github.com/basho/riak_api/issues/21)
* riak_api/22: [Use init:script_id() for the server version.](https://github.com/basho/riak_api/issues/22)
* riak_api/23: [Enable multiple PB listeners.](https://github.com/basho/riak_api/issues/23)
* riak_api/24: [Add support for resetting bucket properties. Requires basho/riak_pb#35.](https://github.com/basho/riak_api/issues/24)
* riak_api/25: [Remove lager dependency because it is specified by riak_core.](https://github.com/basho/riak_api/issues/25)
* riak_api/28: [No PB listeners leads to repeated log messages concerning a failed stat calculation](https://github.com/basho/riak_api/issues/28)
* riak_control/54: [Fixes to get dialyzer working.](https://github.com/basho/riak_control/issues/54)
* riak_control/59: [Series of dialyzer and formatting changes.](https://github.com/basho/riak_control/issues/59)
* riak_control/71: [Add cluster management.](https://github.com/basho/riak_control/issues/71)
* riak_control/80: [Add ability to stop and down nodes.](https://github.com/basho/riak_control/issues/80)
* riak_control/81: [Normalize resource names.](https://github.com/basho/riak_control/issues/81)
* riak_control/83: [Make join node more explicit.](https://github.com/basho/riak_control/issues/83)
* riak_control/88: [Provide a default selection.](https://github.com/basho/riak_control/issues/88)
* riak_control/111: [Prevent badarith when memory is unavailable.](https://github.com/basho/riak_control/pull/111)
* riak_core/185: [inbound handoffs never cleanup](https://github.com/basho/riak_core/issues/185)
* riak_core/241: [potential fix for #185](https://github.com/basho/riak_core/issues/241)
* riak_core/270: [Dialyzer Fixes](https://github.com/basho/riak_core/issues/270)
* riak_core/274: [Allow parallel vnode initialization](https://github.com/basho/riak_core/issues/274)
* riak_core/282: [Extract out and export pending claim function.](https://github.com/basho/riak_core/issues/282)
* riak_core/284: [initial add of the Riak Core Connection Manager](https://github.com/basho/riak_core/issues/284)
* riak_core/290: [Add support for tracking progress of individual handoffs](https://github.com/basho/riak_core/issues/290)
* riak_core/291: [SSL support](https://github.com/basho/riak_core/issues/291)
* riak_core/297: [don't use hardcoded app names in SSL utils](https://github.com/basho/riak_core/issues/297)
* riak_core/298: [Race in vnode worker pool](https://github.com/basho/riak_core/issues/298)
* riak_core/299: [Vnode nonblocking reply, First draft (3rd edition), ready for some review](https://github.com/basho/riak_core/issues/299)
* riak_core/300: [Fix worker pool races](https://github.com/basho/riak_core/issues/300)
* riak_core/301: [Ring Resizing](https://github.com/basho/riak_core/issues/301)
* riak_core/302: [rework coverage fsm timeouts.](https://github.com/basho/riak_core/issues/302)
* riak_core/305: [Support for `plan/2` and `process_results/3` funs for coverage fsm](https://github.com/basho/riak_core/issues/305)
* riak_core/312: [Enhance transfer display + wrapping nodenames.](https://github.com/basho/riak_core/issues/312)
* riak_core/313: [format _stat_ts in connection manager](https://github.com/basho/riak_core/issues/313)
* riak_core/316: [handoff batching](https://github.com/basho/riak_core/issues/316)
* riak_core/319: [Optimize to better handle large rings/nodes](https://github.com/basho/riak_core/issues/319)
* riak_core/321: [proper return value for riak_core_console:transfers/1](https://github.com/basho/riak_core/issues/321)
* riak_core/322: [Handle node up/down in tcp_mon](https://github.com/basho/riak_core/issues/322)
* riak_core/323: [Permanently disable legacy gossip](https://github.com/basho/riak_core/issues/323)
* riak_core/325: [Fix a typo in tcp_mon init](https://github.com/basho/riak_core/issues/325)
* riak_core/328: [Fix overload test time outs](https://github.com/basho/riak_core/issues/328)
* riak_core/330: [dont start coverage timeout timer if timeout is infinite](https://github.com/basho/riak_core/issues/330)
* riak_core/331: [fix forced_ownership_handoff during resize](https://github.com/basho/riak_core/issues/331)
* riak_core/332: [update bad value protection for timer value](https://github.com/basho/riak_core/issues/332)
* riak_core/334: [Reporting 'normal' events is spammy, don't do it](https://github.com/basho/riak_core/issues/334)
* riak_core/336: [Fix crashing stat mod never getting rescheduled](https://github.com/basho/riak_core/issues/336)
* riak_core/339: [Fix repair handoff crash, missing not sent fun](https://github.com/basho/riak_core/issues/339)
* riak_core/340: [only silently drop DOWN-normal messages in deleted modstate](https://github.com/basho/riak_core/issues/340)
* riak_kv/30: [Bz982 - js_reload not working](https://github.com/basho/riak_kv/issues/30)
* riak_kv/31: [Key count reduce function](https://github.com/basho/riak_kv/issues/31)
* riak_kv/334: [Every read triggers a read-repair when Last-write-wins=true](https://github.com/basho/riak_kv/issues/334)
* riak_kv/385: [Objects cannot be updated if a bad CRC is encountered by Bitcask](https://github.com/basho/riak_kv/issues/385)
* riak_kv/462: [Expose FSM timeouts via the HTTP API](https://github.com/basho/riak_kv/issues/462)
* riak_kv/467: [add stats for coverage query starts](https://github.com/basho/riak_kv/issues/467)
* riak_kv/479: [More Compact Riak Object Binary Format](https://github.com/basho/riak_kv/issues/479)
* riak_kv/487: [provide a Location header for the same api version on POST](https://github.com/basho/riak_kv/issues/487)
* riak_kv/488: [Move setting/fetching bucket properties to riak_api](https://github.com/basho/riak_kv/issues/488)
* riak_kv/489: [Migrate mapred_test to riak_test](https://github.com/basho/riak_kv/issues/489)
* riak_kv/491: [Remove Link headers from bucket and key lists](https://github.com/basho/riak_kv/issues/491)
* riak_kv/492: [Make hashtree_eqc close trees before destroy.](https://github.com/basho/riak_kv/issues/492)
* riak_kv/495: [Add encoding capability for handoff.](https://github.com/basho/riak_kv/issues/495)
* riak_kv/496: [Standardize KV backend responses and handling](https://github.com/basho/riak_kv/issues/496)
* riak_kv/498: [Document the environment in the logs; advise on bad settings.](https://github.com/basho/riak_kv/issues/498)
* riak_kv/500: [vclock capability](https://github.com/basho/riak_kv/issues/500)
* riak_kv/510: [Remove merge_index dependency and unused erl_first_file.](https://github.com/basho/riak_kv/issues/510)
* riak_kv/512: [Protocol Buffers interface allows the creation of records with an empty key](https://github.com/basho/riak_kv/issues/512)
* riak_kv/520: [Adds X-Riak-Deleted where missing](https://github.com/basho/riak_kv/issues/520)
* riak_kv/521: [Changes needed to expose FSM timeouts to clients](https://github.com/basho/riak_kv/issues/521)
* riak_kv/526: [Expose Backend Size to Handoff for Progress Tracking](https://github.com/basho/riak_kv/issues/526)
* riak_kv/527: [List buckets timeout & streaming](https://github.com/basho/riak_kv/issues/527)
* riak_kv/529: [Count async MR results against the sink buffer size cap](https://github.com/basho/riak_kv/issues/529)
* riak_kv/530: [Ring Resizing Support](https://github.com/basho/riak_kv/issues/530)
* riak_kv/532: [kv_wm_utils expects ?MD_DELETED to be "true" not 'true'](https://github.com/basho/riak_kv/issues/532)
* riak_kv/536: [A simple way to store a PN-Counter in a riak_object](https://github.com/basho/riak_kv/issues/536)
* riak_kv/542: [add license header to riak_kv reformat](https://github.com/basho/riak_kv/issues/542)
* riak_kv/546: [Expose the put_fsm 'asis' option to clients](https://github.com/basho/riak_kv/issues/546)
* riak_kv/552: [Add new backend capability for Riak r_object use](https://github.com/basho/riak_kv/issues/552)
* riak_kv/554: [Optimize to better handle large rings/nodes](https://github.com/basho/riak_kv/issues/554)
* riak_kv/555: [Add init/final to AAE remote interface](https://github.com/basho/riak_kv/issues/555)
* riak_kv/559: [Alter env recommendations for 1.4](https://github.com/basho/riak_kv/issues/559)
* riak_kv/560: [Fix regression in 2i reformat status flag & add extra status function](https://github.com/basho/riak_kv/issues/560)
* riak_kv/562: [use old object format by default on upgrade](https://github.com/basho/riak_kv/issues/562)
* riak_kv/563: [Add binary format for counters](https://github.com/basho/riak_kv/issues/563)
* riak_kv/569: [Make sure client supplied N <= bucket N](https://github.com/basho/riak_kv/issues/569)
* riak_kv/576: [Add a capability for counters](https://github.com/basho/riak_kv/issues/576)
* riak_kv/579: [Skip start {val, key} pair if start_inclusive is false](https://github.com/basho/riak_kv/issues/579)
* riak_kv/581: [Wire up sidejob stats to /stats endpoint](https://github.com/basho/riak_kv/issues/581)
* riak_kv/585: [minor improvements to riak_object downgrade support](https://github.com/basho/riak_kv/issues/585)
* riak_kv/586: [Stop fold when a vnode reaches page size](https://github.com/basho/riak_kv/issues/586)
* riak_kv/587: [Fix incorrect arg in call to get_primary_apl/3 by put FSM](https://github.com/basho/riak_kv/issues/587)
* riak_kv/588: [Multi backend was missing data_size function](https://github.com/basho/riak_kv/issues/588)
* riak_pb/30: [Add remaining bucket properties to PBC](https://github.com/basho/riak_pb/issues/30)
* riak_pb/31: [Fix errors with repl bucket property.](https://github.com/basho/riak_pb/issues/31)
* riak_pb/32: [precommit/postcommit empty does not clear](https://github.com/basho/riak_pb/issues/32)
* riak_pb/33: [Fix commit hooks and symbolic properties as binaries](https://github.com/basho/riak_pb/issues/33)
* riak_pb/35: [Support reset bucket properties feature.](https://github.com/basho/riak_pb/issues/35)
* riak_pb/36: [Protoc dependency free version for Python Package Index](https://github.com/basho/riak_pb/issues/36)
* riak_pb/38: [Add timeouts to get, put, and delete](https://github.com/basho/riak_pb/issues/38)
* riak_pb/41: [Add messages for exporter tool & list timeouts](https://github.com/basho/riak_pb/issues/41)
* riak_pb/42: [Remove need to have protoc available in Python source package. Closes #36](https://github.com/basho/riak_pb/issues/42)
* riak_pb/43: [2i pagination support](https://github.com/basho/riak_pb/issues/43)
* riak_pb/44: [Add asis flag for RpbPutReq.](https://github.com/basho/riak_pb/issues/44)
* riak_pipe/50: [fitting was done before startup](https://github.com/basho/riak_pipe/issues/50)
* riak_pipe/62: [Move eunit system tests to riak_test](https://github.com/basho/riak_pipe/issues/62)
* riak_pipe/68: [assume handoff if vnode exits 'normal' during queue requeuest](https://github.com/basho/riak_pipe/issues/68)
* riak_pipe/71: [Fix opaque type warnings on R16B.](https://github.com/basho/riak_pipe/issues/71)
* riak_pipe/73: [PULSE test & fix riak_pipe_fitting](https://github.com/basho/riak_pipe/issues/73)
* riak_pipe/75: [lower "fitting was gone" log to debug level](https://github.com/basho/riak_pipe/issues/75)
* riak_pipe/76: [limited support for ring resizing](https://github.com/basho/riak_pipe/issues/76)
* riak_search/140: [remove guard on riak_search_vnode:start_vnode/1](https://github.com/basho/riak_search/issues/140)
* riaknostic/55: [Remove misplaced parathesis (sysctl check)](https://github.com/basho/riaknostic/issues/55)
* riaknostic/56: [Add OpenBSD bits](https://github.com/basho/riaknostic/issues/56)
* riaknostic/66: [Un-escriptize riaknostic and modify for lager 2.0 compatability](https://github.com/basho/riaknostic/issues/66)
* riaknostic/67: [Add an extra log line for clarity when running non-existent checks](https://github.com/basho/riaknostic/issues/67)
* webmachine/76: [Add logging for when webmachine crashes and body exists.](https://github.com/basho/webmachine/issues/76)
* webmachine/115: [Fix arguments to call to webmachine_request:recv_stream_body/2](https://github.com/basho/webmachine/issues/115)
* webmachine/117: [Decode Content-MD5 with base64, not hex](https://github.com/basho/webmachine/issues/117)
* webmachine/124: [Refine range header treatment](https://github.com/basho/webmachine/issues/124)
* webmachine/125: [Guess text/css MIME type for .less files](https://github.com/basho/webmachine/issues/125)
* webmachine/128: [Bugfix for multiple routers under Riak](https://github.com/basho/webmachine/issues/128)
* webmachine/134: [collapse 4 separate send calls into 1 in send_chunk](https://github.com/basho/webmachine/issues/134)
* webmachine/141: [Custom reason phrase](https://github.com/basho/webmachine/issues/141)
* webmachine/142: [Read body when DELETE to keep alive connection](https://github.com/basho/webmachine/issues/142)
* webmachine/143: [webmachine_dispatcher crashes on malformed Host header](https://github.com/basho/webmachine/issues/143)
* webmachine/144: [Allow responses for all HTTP errors to be customized](https://github.com/basho/webmachine/issues/144)
* webmachine/151: [Removing io:format/2 calls from log file processing](https://github.com/basho/webmachine/issues/151)
## 既知の問題 (Known Issues)
### leveldb 1.3 から 1.4への変換 (leveldb 1.3 to 1.4 conversion)
leveldb 1.3.x、1.2.xのデータを使ってleveldb 1.4.0を初めて起動すると、データの自動変換が始まります。これは、各ノードの起動を3分から7分停止する可能性があります。”level #1”内のleveldbのデータは”level #1”がソートされたデータレベルの代わりに、重複したデータレベルとしての役割を果たすよう、調整されてゆきます。この変換は”level #1”から”level #2”への通常のコンパクションを通じて、単に”level #1”内のファイル数を8より小さくするものです。これは一度だけ実行されます。
## 廃止予定 (Deprecation Warnings)
### Ubuntu 11.04 (Natty) EOL
Ubuntu 11.04 Natty Narwhal は2012年10月でend-of-lifeになり、apt update、securityの公開リポジトリは削除されています。
これによりRiakは今後11.04に対してビルドされません。私たちは次のRiakのメジャーバージョンリリースのタイミングで、
最新のnon-LTSリリースに対するサポートを検討する予定です。
UbuntuのLTSリリース(10.04、12.04)は引き続きサポートされますので影響はありません。
|
{
"content_hash": "5360aea48ab9a25222297bb7f0855e4e",
"timestamp": "",
"source": "github",
"line_count": 548,
"max_line_length": 273,
"avg_line_length": 63.41423357664234,
"alnum_prop": 0.7728122931714195,
"repo_name": "Radardisc/riak",
"id": "396e972c4ba5a4ee8d53bfbd0f6e36e13c14b324",
"size": "46291",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "RELEASE-NOTES.ja.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "10415"
},
{
"name": "Emacs Lisp",
"bytes": "1254"
},
{
"name": "Erlang",
"bytes": "4104"
},
{
"name": "Shell",
"bytes": "36771"
}
],
"symlink_target": ""
}
|
namespace blink {
void ReferenceClipPathOperation::AddClient(SVGResourceClient& client) {
if (resource_)
resource_->AddClient(client);
}
void ReferenceClipPathOperation::RemoveClient(SVGResourceClient& client) {
if (resource_)
resource_->RemoveClient(client);
}
SVGResource* ReferenceClipPathOperation::Resource() const {
return resource_;
}
bool ReferenceClipPathOperation::operator==(const ClipPathOperation& o) const {
if (!IsSameType(o))
return false;
const ReferenceClipPathOperation& other = To<ReferenceClipPathOperation>(o);
return resource_ == other.resource_ && url_ == other.url_;
}
} // namespace blink
|
{
"content_hash": "4c2152f628fb12b22eb3341823daeada",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 79,
"avg_line_length": 26.875,
"alnum_prop": 0.7457364341085271,
"repo_name": "chromium/chromium",
"id": "e73cc0f7ee5eea5beae2b8666ddcfe30bcde865f",
"size": "871",
"binary": false,
"copies": "6",
"ref": "refs/heads/main",
"path": "third_party/blink/renderer/core/style/reference_clip_path_operation.cc",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
}
|
// Copyright 2011-2016 Google LLC
//
// 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.
package com.google.security.zynamics.binnavi.Gui.GraphWindows;
import java.awt.Color;
import java.awt.Component;
import java.util.LinkedHashMap;
import javax.swing.JTabbedPane;
import com.google.common.base.Preconditions;
import com.google.common.base.Predicates;
import com.google.common.collect.Iterables;
import com.google.security.zynamics.binnavi.Gui.CNameShortener;
import com.google.security.zynamics.binnavi.Gui.GraphWindows.ButtonTab.ButtonTabComponent;
import com.google.security.zynamics.binnavi.Gui.GraphWindows.ButtonTab.IButtonTabListener;
/**
* The tab component that is used to display graph panels in graph windows.
*/
public final class JGraphTab extends JTabbedPane {
/**
* Used for serialization.
*/
private static final long serialVersionUID = 6366240643759928623L;
/**
* Listens on clicks on the X in tabs
*/
private final InternalTabClickListener m_listener = new InternalTabClickListener();
/**
* Parent window of the tab component
*/
private final CGraphWindow m_parent;
/**
*
*/
private final LinkedHashMap<Integer, Integer> moduleIdCount =
new LinkedHashMap<Integer, Integer>();
/**
* Creates a new graph tab component.
*
* @param parent Parent window of the tab component.
*/
public JGraphTab(final CGraphWindow parent) {
super(JTabbedPane.TOP, JTabbedPane.SCROLL_TAB_LAYOUT);
m_parent = Preconditions.checkNotNull(parent, "IE01638: Parent argument can not be null");
}
@Override
public synchronized void addTab(final String title, final Component component) {
Preconditions.checkNotNull(title, "IE01639: Title argument can not be null");
Preconditions.checkNotNull(component, "IE01640: Component argument can not be null");
super.addTab(title, component);
setSelectedComponent(component);
final int moduleId =
((IGraphPanel) component).getModel().getViewContainer().getModules().get(0)
.getConfiguration().getId();
if (!moduleIdCount.containsKey(moduleId)) {
moduleIdCount.put(moduleId, 1);
} else {
moduleIdCount.put(moduleId, moduleIdCount.get(moduleId) + 1);
}
final ButtonTabComponent buttonTab = new ButtonTabComponent(this);
buttonTab.addListener(m_listener);
setTabComponentAt(getSelectedIndex(), buttonTab);
}
@Override
public Color getBackgroundAt(final int index) {
final IGraphPanel panel = ((IGraphPanel) this.getComponentAt(index));
if (moduleIdCount.size() > 1) {
return selectTabBackGroundColor(panel.getModel().getViewContainer().getModules().get(0)
.getConfiguration().getId());
} else {
return super.getBackgroundAt(index);
}
}
/**
* Updates the register headers if the name of a view changed.
*/
public void updateRegisterHeaders() {
for (int i = 0; i < getTabCount(); i++) {
final IGraphPanel component = (IGraphPanel) getComponentAt(i);
setTitleAt(i, CNameShortener.shorten(component.getModel().getGraph().getRawView()));
}
}
/**
* Listener responsible for handling clicks on the X button in tabs.
*/
private class InternalTabClickListener implements IButtonTabListener {
@Override
public boolean closing(final ButtonTabComponent btc) {
final int openWindows = getTabCount();
for (int i = 0; i < openWindows; i++) {
if (btc == getTabComponentAt(i)) {
final IGraphPanel panel = (IGraphPanel) getComponentAt(i);
if (CPanelCloser.closeTab(m_parent, panel)) {
btc.removeListener(m_listener);
final int moduleId =
panel.getModel().getViewContainer().getModules().get(0).getConfiguration().getId();
if (moduleIdCount.get(moduleId) == 1) {
moduleIdCount.remove(moduleId);
} else {
moduleIdCount.put(moduleId, moduleIdCount.get(moduleId) - 1);
}
return true;
} else {
return false;
}
}
}
return true;
}
}
private Color selectTabBackGroundColor(final int seed) {
final int insertionPosition =
Iterables.indexOf(moduleIdCount.keySet(), Predicates.equalTo(seed));
switch (insertionPosition) {
case 0:
return Color.getHSBColor((float) 0.55, (float) 0.2, (float) 0.8);
case 1:
return Color.getHSBColor((float) 0.6, (float) 0.2, (float) 0.8);
case 2:
return Color.getHSBColor((float) 0.65, (float) 0.2, (float) 0.8);
case 3:
return Color.getHSBColor((float) 0.7, (float) 0.2, (float) 0.8);
case 4:
return Color.getHSBColor((float) 0.75, (float) 0.2, (float) 0.8);
case 5:
return Color.getHSBColor((float) 0.8, (float) 0.2, (float) 0.8);
case 6:
return Color.getHSBColor((float) 0.85, (float) 0.2, (float) 0.8);
case 7:
return Color.getHSBColor((float) 0.9, (float) 0.2, (float) 0.8);
case 8:
return Color.getHSBColor((float) 0.95, (float) 0.2, (float) 0.8);
case 9:
return Color.getHSBColor(1, (float) 0.2, (float) 0.8);
case 10:
return Color.getHSBColor((float) 0.05, (float) 0.2, (float) 0.8);
case 11:
return Color.getHSBColor((float) 0.1, (float) 0.2, (float) 0.8);
case 12:
return Color.getHSBColor((float) 0.15, (float) 0.2, (float) 0.8);
case 13:
return Color.getHSBColor((float) 0.2, (float) 0.2, (float) 0.8);
case 14:
return Color.getHSBColor((float) 0.25, (float) 0.2, (float) 0.8);
case 15:
return Color.getHSBColor((float) 0.3, (float) 0.2, (float) 0.8);
case 16:
return Color.getHSBColor((float) 0.35, (float) 0.2, (float) 0.8);
case 17:
return Color.getHSBColor((float) 0.4, (float) 0.2, (float) 0.8);
case 18:
return Color.getHSBColor((float) 0.45, (float) 0.2, (float) 0.8);
case 19:
return Color.getHSBColor((float) 0.5, (float) 0.2, (float) 0.8);
default:
return Color.WHITE;
}
}
}
|
{
"content_hash": "fecd540960ffa9b82fd99ada62581f63",
"timestamp": "",
"source": "github",
"line_count": 190,
"max_line_length": 99,
"avg_line_length": 34.9,
"alnum_prop": 0.6555572311868496,
"repo_name": "google/binnavi",
"id": "ad2711ad6ddcf2085d4aa488f61491bed4fdcc49",
"size": "6631",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/main/java/com/google/security/zynamics/binnavi/Gui/GraphWindows/JGraphTab.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "1489"
},
{
"name": "C",
"bytes": "8997"
},
{
"name": "C++",
"bytes": "982064"
},
{
"name": "CMake",
"bytes": "1953"
},
{
"name": "CSS",
"bytes": "12843"
},
{
"name": "GAP",
"bytes": "3637"
},
{
"name": "HTML",
"bytes": "437459"
},
{
"name": "Java",
"bytes": "21714625"
},
{
"name": "Makefile",
"bytes": "3498"
},
{
"name": "PLpgSQL",
"bytes": "180849"
},
{
"name": "Python",
"bytes": "23981"
},
{
"name": "Shell",
"bytes": "713"
}
],
"symlink_target": ""
}
|
#include "float2.h"
#include "tools.h"
#include <boost/concept_check.hpp>
using namespace mia;
using namespace std;
Float2 Float2 :: middle( const Float2 & A, const Float2 & B )
{
return (A+B)*0.5f;
}
Float2 Float2 :: mean( const std::list<Float2> & lFloat2 )
{
Float2 mean;
int size(0);
for( std::list<Float2>::const_iterator it= lFloat2.begin() ; it != lFloat2.end(); ++it ){
mean+= *it;
++size;
}
return mean / (float)size;
}
std::array<Float2, 2> Float2::simpleLinearRegression( const std::list<Float2> & point )
{
int size(0);
Float2 mean(0.f, 0.f), origin(0.f, 0.f);
for( std::list<Float2>::const_iterator it(point.begin()), itEnd(point.end()) ; it != itEnd ; ++it )
{
mean+= Float2(it->x, it->y);
++size;
}
mean/= (float)size;
float slopeNum(0.f), yxSlopeDenum(0.f), xySlopeDenum(0.f);
for( std::list<Float2>::const_iterator it(point.begin()), itEnd(point.end()) ; it != itEnd ; ++it )
{
float dx= (it->x-mean.x);
float dy= (it->y-mean.y);
slopeNum+= dx*dy;
yxSlopeDenum+= dx*dx;
xySlopeDenum+= dy*dy;
++size;
}
if( yxSlopeDenum == 0 && xySlopeDenum == 0 )
{
origin.x= mean.x;
origin.y= 0.f;
}
else if( yxSlopeDenum*yxSlopeDenum > xySlopeDenum*xySlopeDenum )
{
float slope= slopeNum / yxSlopeDenum;
origin.x= 0;
origin.y= mean.y - slope * mean.x;
}
else
{
float slope= slopeNum / xySlopeDenum;
origin.y= 0;
origin.x= mean.x - slope * mean.y;
}
std::array<Float2, 2> descriptor= {mean, Float2(origin, mean)};
descriptor[1].normalize();
return descriptor;
}
std::array<Float2, 2> Float2::projectionSegment( const std::list<Float2> & point, const Float2 &mean, const Float2 &normDir )
{
list<float> projection;
for( list<Float2>::const_iterator it(point.begin()), itEnd(point.end()) ; it!=itEnd ; ++it )
projection.push_back( dotProduct( (*it) - mean, normDir ) );
projection.sort();
array<Float2, 2> segment= { normDir * *(projection.begin()) + mean, normDir * *(projection.rbegin()) + mean };
return segment;
}
bool Float2::validSegmentRegression( const std::list<Float2> & lFloat2, const std::array<Float2, 2> & normSegment, float treshold )
{
Float2 normDir= normSegment[1].orthogonal();
bool valid(true);
for( list<Float2>::const_iterator it(lFloat2.begin()), itEnd(lFloat2.end()) ; valid && it!=itEnd ; ++it )
valid= dotProduct( (*it) - normSegment[0], normDir ) < treshold;
return valid;
}
list<Float2> Float2 :: polarSort(const list<Float2> & lFloat2)
{
list< valued<Float2> > toSort;
for(list<Float2>::const_iterator it = lFloat2.begin(); it != lFloat2.end() ; ++it )
toSort.push_back( valued<Float2>( *it, it->angle() ) );
toSort.sort();
list<Float2> ret;
for(list<valued<Float2>>::const_iterator it = toSort.begin(); it != toSort.end() ; ++it )
ret.push_back( it->item );
return ret;
}
Transform Transform::from_match ( std::list<std::pair<Float2, Float2>>::const_iterator itBegin,
std::list<std::pair<Float2, Float2>>::const_iterator itEnd )
{ // Which translation / rotation to transfom second to first ?
Transform t;
t.translation= Float2(0.f, 0.f);
t.center= Float2(0.f, 0.f);
t.rotation= 0.f;
int size(0);
for( std::list<std::pair<Float2, Float2>>::const_iterator it= itBegin ; it != itEnd ; ++it )
{// Get center :
t.center+= it->first;
t.translation+= it->second;
++size;
}
t.center/= (float)size; // Center first
t.translation/= (float)size; // Center second
t.translation= t.center - t.translation; // translation from second to first.
// Rotation :
for( std::list<std::pair<Float2, Float2>>::const_iterator it= itBegin ; it != itEnd ; ++it )
{
t.rotation+= angle( it->second + t.translation, t.center, it->first );
}
t.rotation= reduceRadian( t.rotation/(float)size );
return t;
}
|
{
"content_hash": "9e353415ff7ba20d91ca98b1524d248d",
"timestamp": "",
"source": "github",
"line_count": 142,
"max_line_length": 131,
"avg_line_length": 29.514084507042252,
"alnum_prop": 0.5829157718921498,
"repo_name": "CARMinesDouai/MultiRobotExplorationPackages",
"id": "160418347887579fc36f90d1dc0adf98dc90ee07",
"size": "4992",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "torob/src/float2.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "1440885"
},
{
"name": "C++",
"bytes": "2195179"
},
{
"name": "CMake",
"bytes": "260237"
},
{
"name": "CSS",
"bytes": "68542"
},
{
"name": "HTML",
"bytes": "5472"
},
{
"name": "JavaScript",
"bytes": "100246"
},
{
"name": "Lua",
"bytes": "10817"
},
{
"name": "Makefile",
"bytes": "224554"
},
{
"name": "Python",
"bytes": "65909"
},
{
"name": "Shell",
"bytes": "10706"
},
{
"name": "Smarty",
"bytes": "2883"
},
{
"name": "SourcePawn",
"bytes": "415"
}
],
"symlink_target": ""
}
|
<?php
if (! defined ( 'sugarEntry' ) || ! sugarEntry)
die ( 'Not A Valid Entry Point' ) ;
require_once ('modules/DynamicFields/DynamicField.php') ;
class StandardField extends DynamicField
{
var $custom_def = array();
var $base_def = array();
var $baseField;
function __construct($module = '') {
parent::DynamicField($module);
}
protected function loadCustomDef($field){
global $beanList;
if (!empty($beanList[$this->module]) && is_file("custom/Extension/modules/{$this->module}/Ext/Vardefs/sugarfield_$field.php"))
{
$bean_name = get_valid_bean_name($this->module);
$dictionary = array($bean_name => array("fields" => array($field => array())));
include("$this->base_path/sugarfield_$field.php");
if (!empty($dictionary[$bean_name]) && isset($dictionary[$bean_name]["fields"][$field]))
$this->custom_def = $dictionary[$bean_name]["fields"][$field];
}
}
protected function loadBaseDef($field){
global $beanList;
if (!empty($beanList[$this->module]) && is_file("modules/{$this->module}/vardefs.php"))
{
$dictionary = array();
include("modules/{$this->module}/vardefs.php");
if (!empty($dictionary[$beanList[$this->module]]) && isset($dictionary[$beanList[$this->module]]["fields"][$field]))
$this->base_def = $dictionary[$beanList[$this->module]]["fields"][$field];
}
}
/**
* Adds a custom field using a field object
*
* @param Field Object $field
* @return boolean
*/
function addFieldObject(&$field){
global $dictionary, $beanList;
if (empty($beanList[$this->module]))
return false;
$bean_name = get_valid_bean_name($this->module);
if (empty($dictionary[$bean_name]) || empty($dictionary[$bean_name]["fields"][$field->name]))
return false;
$currdef = $dictionary[$bean_name]["fields"][$field->name];
// set $field->unified_search=true if field supports unified search
// regarding #51427
if($field->supports_unified_search)
{
if(isset($dictionary[$bean_name]['unified_search_default_enabled']) && isset($dictionary[$bean_name]['unified_search'])
&& $dictionary[$bean_name]['unified_search_default_enabled'] && $dictionary[$bean_name]['unified_search'])
{
$currdef['unified_search'] = $field->unified_search = isset($currdef['unified_search'])
? $currdef['unified_search']
: true;
}
}
// end #51427
$this->loadCustomDef($field->name);
$this->loadBaseDef($field->name);
$newDef = $field->get_field_def();
require_once ('modules/DynamicFields/FieldCases.php') ;
$this->baseField = get_widget ( $field->type) ;
foreach ($field->vardef_map as $property => $fmd_col){
if ($property == "action" || $property == "label_value" || $property == "label"
|| ((substr($property, 0,3) == 'ext' && strlen($property) == 4))
)
continue;
// Bug 37043 - Avoid writing out vardef defintions that are the default value.
if (isset($newDef[$property]) &&
((!isset($currdef[$property]) && !$this->isDefaultValue($property,$newDef[$property], $this->baseField))
|| (isset($currdef[$property]) && $currdef[$property] != $newDef[$property])
)
){
$this->custom_def[$property] =
is_string($newDef[$property]) ? htmlspecialchars_decode($newDef[$property], ENT_QUOTES) : $newDef[$property];
}
//Remove any orphaned entries
if (isset($this->custom_def[$property]) && !isset($newDef[$property]))
unset($this->custom_def[$property]);
//Handle overrides of out of the box definitions with empty
if (!empty($this->base_def[$property]) && !isset($newDef[$property]))
{
//Switch on type of the property to find what the correct 'empty' is.
if(is_string($this->base_def[$property]))
$this->custom_def[$property] = "";
else if(is_array($this->base_def[$property]))
$this->custom_def[$property] = array();
else if(is_bool($this->base_def[$property]))
$this->custom_def[$property] = false;
else
$this->custom_def[$property] = null;
}
}
if (isset($this->custom_def["duplicate_merge_dom_value"]) && !isset($this->custom_def["duplicate_merge"]))
unset($this->custom_def["duplicate_merge_dom_value"]);
$this->writeVardefExtension($bean_name, $field, $this->custom_def);
}
}
?>
|
{
"content_hash": "5f6335c6b6ac8aeaab4be7c09ed69ea6",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 131,
"avg_line_length": 39.0390625,
"alnum_prop": 0.5417250350210127,
"repo_name": "vcatalasan/suitecrm-docker",
"id": "17bcdb9b0f644abb6f0ad912a87b8c8dab4a759e",
"size": "7212",
"binary": false,
"copies": "28",
"ref": "refs/heads/master",
"path": "SuiteCRM/modules/ModuleBuilder/parsers/StandardField.php",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "1373"
},
{
"name": "CSS",
"bytes": "1471044"
},
{
"name": "HTML",
"bytes": "829912"
},
{
"name": "JavaScript",
"bytes": "3629011"
},
{
"name": "PHP",
"bytes": "35976721"
},
{
"name": "Perl",
"bytes": "38886"
},
{
"name": "Shell",
"bytes": "5"
},
{
"name": "Smarty",
"bytes": "2440555"
}
],
"symlink_target": ""
}
|
#region Apache License, Version 2.0
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you 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.
#endregion
using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Data;
using System.Globalization;
using SaveAndPlay.Resources;
namespace SaveAndPlay.Converters
{
public class TransferRateConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
string result = string.Empty;
if (value != null && typeof(double) == value.GetType())
{
double? rate = (double?)value;
if (rate.HasValue)
{
if (rate.Value < 1024)
{
result = rate.Value.ToString("0.00") + " " + Main.BytesPerSecond;
}
else if (rate < 1048576)
{
result = (rate.Value / 1024).ToString("0.00") + " " + Main.KiloBytesPerSecond;
}
else
{
result = (rate.Value / 1048576).ToString("0.00") + " " + Main.MegaBytesPerSecond;
}
}
}
return result;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return null;
}
}
}
|
{
"content_hash": "9d985351c7e31f52db76a4c5e458d36d",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 105,
"avg_line_length": 34.371428571428574,
"alnum_prop": 0.6113881961762261,
"repo_name": "rlecole/SaveAndPlay",
"id": "a30358571b7cf6490fc7234814580240b5c2f2e8",
"size": "2408",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "SaveAndPlay/Converters/TransferRateConverter.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "509461"
}
],
"symlink_target": ""
}
|
/* this file has been autogenerated by vtkNodeJsWrap */
/* editing this might proof futile */
#define VTK_WRAPPING_CXX
#define VTK_STREAMS_FWD_ONLY
#include <nan.h>
#include "vtkTableAlgorithmWrap.h"
#include "vtkStatisticsAlgorithmWrap.h"
#include "vtkObjectWrap.h"
#include "vtkAlgorithmOutputWrap.h"
#include "vtkDataObjectWrap.h"
#include "vtkStringArrayWrap.h"
#include "../../plus/plus.h"
using namespace v8;
extern Nan::Persistent<v8::Object> vtkNodeJsNoWrap;
Nan::Persistent<v8::FunctionTemplate> VtkStatisticsAlgorithmWrap::ptpl;
VtkStatisticsAlgorithmWrap::VtkStatisticsAlgorithmWrap()
{ }
VtkStatisticsAlgorithmWrap::VtkStatisticsAlgorithmWrap(vtkSmartPointer<vtkStatisticsAlgorithm> _native)
{ native = _native; }
VtkStatisticsAlgorithmWrap::~VtkStatisticsAlgorithmWrap()
{ }
void VtkStatisticsAlgorithmWrap::Init(v8::Local<v8::Object> exports)
{
Nan::SetAccessor(exports, Nan::New("vtkStatisticsAlgorithm").ToLocalChecked(), ConstructorGetter);
Nan::SetAccessor(exports, Nan::New("StatisticsAlgorithm").ToLocalChecked(), ConstructorGetter);
}
void VtkStatisticsAlgorithmWrap::ConstructorGetter(
v8::Local<v8::String> property,
const Nan::PropertyCallbackInfo<v8::Value>& info)
{
InitPtpl();
info.GetReturnValue().Set(Nan::New(ptpl)->GetFunction());
}
void VtkStatisticsAlgorithmWrap::InitPtpl()
{
if (!ptpl.IsEmpty()) return;
v8::Local<v8::FunctionTemplate> tpl = Nan::New<v8::FunctionTemplate>(New);
VtkTableAlgorithmWrap::InitPtpl( );
tpl->Inherit(Nan::New<FunctionTemplate>(VtkTableAlgorithmWrap::ptpl));
tpl->SetClassName(Nan::New("VtkStatisticsAlgorithmWrap").ToLocalChecked());
tpl->InstanceTemplate()->SetInternalFieldCount(1);
Nan::SetPrototypeMethod(tpl, "AddColumn", AddColumn);
Nan::SetPrototypeMethod(tpl, "addColumn", AddColumn);
Nan::SetPrototypeMethod(tpl, "AddColumnPair", AddColumnPair);
Nan::SetPrototypeMethod(tpl, "addColumnPair", AddColumnPair);
Nan::SetPrototypeMethod(tpl, "GetAssessNames", GetAssessNames);
Nan::SetPrototypeMethod(tpl, "getAssessNames", GetAssessNames);
Nan::SetPrototypeMethod(tpl, "GetAssessOption", GetAssessOption);
Nan::SetPrototypeMethod(tpl, "getAssessOption", GetAssessOption);
Nan::SetPrototypeMethod(tpl, "GetClassName", GetClassName);
Nan::SetPrototypeMethod(tpl, "getClassName", GetClassName);
Nan::SetPrototypeMethod(tpl, "GetDeriveOption", GetDeriveOption);
Nan::SetPrototypeMethod(tpl, "getDeriveOption", GetDeriveOption);
Nan::SetPrototypeMethod(tpl, "GetLearnOption", GetLearnOption);
Nan::SetPrototypeMethod(tpl, "getLearnOption", GetLearnOption);
Nan::SetPrototypeMethod(tpl, "GetTestOption", GetTestOption);
Nan::SetPrototypeMethod(tpl, "getTestOption", GetTestOption);
Nan::SetPrototypeMethod(tpl, "IsA", IsA);
Nan::SetPrototypeMethod(tpl, "isA", IsA);
Nan::SetPrototypeMethod(tpl, "NewInstance", NewInstance);
Nan::SetPrototypeMethod(tpl, "newInstance", NewInstance);
Nan::SetPrototypeMethod(tpl, "RequestSelectedColumns", RequestSelectedColumns);
Nan::SetPrototypeMethod(tpl, "requestSelectedColumns", RequestSelectedColumns);
Nan::SetPrototypeMethod(tpl, "ResetAllColumnStates", ResetAllColumnStates);
Nan::SetPrototypeMethod(tpl, "resetAllColumnStates", ResetAllColumnStates);
Nan::SetPrototypeMethod(tpl, "ResetRequests", ResetRequests);
Nan::SetPrototypeMethod(tpl, "resetRequests", ResetRequests);
Nan::SetPrototypeMethod(tpl, "SafeDownCast", SafeDownCast);
Nan::SetPrototypeMethod(tpl, "safeDownCast", SafeDownCast);
Nan::SetPrototypeMethod(tpl, "SetAssessNames", SetAssessNames);
Nan::SetPrototypeMethod(tpl, "setAssessNames", SetAssessNames);
Nan::SetPrototypeMethod(tpl, "SetAssessOption", SetAssessOption);
Nan::SetPrototypeMethod(tpl, "setAssessOption", SetAssessOption);
Nan::SetPrototypeMethod(tpl, "SetColumnStatus", SetColumnStatus);
Nan::SetPrototypeMethod(tpl, "setColumnStatus", SetColumnStatus);
Nan::SetPrototypeMethod(tpl, "SetDeriveOption", SetDeriveOption);
Nan::SetPrototypeMethod(tpl, "setDeriveOption", SetDeriveOption);
Nan::SetPrototypeMethod(tpl, "SetInputModel", SetInputModel);
Nan::SetPrototypeMethod(tpl, "setInputModel", SetInputModel);
Nan::SetPrototypeMethod(tpl, "SetInputModelConnection", SetInputModelConnection);
Nan::SetPrototypeMethod(tpl, "setInputModelConnection", SetInputModelConnection);
Nan::SetPrototypeMethod(tpl, "SetLearnOption", SetLearnOption);
Nan::SetPrototypeMethod(tpl, "setLearnOption", SetLearnOption);
Nan::SetPrototypeMethod(tpl, "SetLearnOptionParameterConnection", SetLearnOptionParameterConnection);
Nan::SetPrototypeMethod(tpl, "setLearnOptionParameterConnection", SetLearnOptionParameterConnection);
Nan::SetPrototypeMethod(tpl, "SetLearnOptionParameters", SetLearnOptionParameters);
Nan::SetPrototypeMethod(tpl, "setLearnOptionParameters", SetLearnOptionParameters);
Nan::SetPrototypeMethod(tpl, "SetTestOption", SetTestOption);
Nan::SetPrototypeMethod(tpl, "setTestOption", SetTestOption);
#ifdef VTK_NODE_PLUS_VTKSTATISTICSALGORITHMWRAP_INITPTPL
VTK_NODE_PLUS_VTKSTATISTICSALGORITHMWRAP_INITPTPL
#endif
ptpl.Reset( tpl );
}
void VtkStatisticsAlgorithmWrap::New(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
if(!info.IsConstructCall())
{
Nan::ThrowError("Constructor not called in a construct call.");
return;
}
if(info.Length() == 0)
{
Nan::ThrowError("Cannot create instance of abstract class.");
return;
}
else
{
if(info[0]->ToObject() != vtkNodeJsNoWrap )
{
Nan::ThrowError("Parameter Error");
return;
}
}
info.GetReturnValue().Set(info.This());
}
void VtkStatisticsAlgorithmWrap::AddColumn(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
VtkStatisticsAlgorithmWrap *wrapper = ObjectWrap::Unwrap<VtkStatisticsAlgorithmWrap>(info.Holder());
vtkStatisticsAlgorithm *native = (vtkStatisticsAlgorithm *)wrapper->native.GetPointer();
if(info.Length() > 0 && info[0]->IsString())
{
Nan::Utf8String a0(info[0]);
if(info.Length() != 1)
{
Nan::ThrowError("Too many parameters.");
return;
}
native->AddColumn(
*a0
);
return;
}
Nan::ThrowError("Parameter mismatch");
}
void VtkStatisticsAlgorithmWrap::AddColumnPair(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
VtkStatisticsAlgorithmWrap *wrapper = ObjectWrap::Unwrap<VtkStatisticsAlgorithmWrap>(info.Holder());
vtkStatisticsAlgorithm *native = (vtkStatisticsAlgorithm *)wrapper->native.GetPointer();
if(info.Length() > 0 && info[0]->IsString())
{
Nan::Utf8String a0(info[0]);
if(info.Length() > 1 && info[1]->IsString())
{
Nan::Utf8String a1(info[1]);
if(info.Length() != 2)
{
Nan::ThrowError("Too many parameters.");
return;
}
native->AddColumnPair(
*a0,
*a1
);
return;
}
}
Nan::ThrowError("Parameter mismatch");
}
void VtkStatisticsAlgorithmWrap::GetAssessNames(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
VtkStatisticsAlgorithmWrap *wrapper = ObjectWrap::Unwrap<VtkStatisticsAlgorithmWrap>(info.Holder());
vtkStatisticsAlgorithm *native = (vtkStatisticsAlgorithm *)wrapper->native.GetPointer();
vtkStringArray * r;
if(info.Length() != 0)
{
Nan::ThrowError("Too many parameters.");
return;
}
r = native->GetAssessNames();
VtkStringArrayWrap::InitPtpl();
v8::Local<v8::Value> argv[1] =
{ Nan::New(vtkNodeJsNoWrap) };
v8::Local<v8::Function> cons =
Nan::New<v8::FunctionTemplate>(VtkStringArrayWrap::ptpl)->GetFunction();
v8::Local<v8::Object> wo = cons->NewInstance(1, argv);
VtkStringArrayWrap *w = new VtkStringArrayWrap();
w->native = r;
w->Wrap(wo);
info.GetReturnValue().Set(wo);
}
void VtkStatisticsAlgorithmWrap::GetAssessOption(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
VtkStatisticsAlgorithmWrap *wrapper = ObjectWrap::Unwrap<VtkStatisticsAlgorithmWrap>(info.Holder());
vtkStatisticsAlgorithm *native = (vtkStatisticsAlgorithm *)wrapper->native.GetPointer();
bool r;
if(info.Length() != 0)
{
Nan::ThrowError("Too many parameters.");
return;
}
r = native->GetAssessOption();
info.GetReturnValue().Set(Nan::New(r));
}
void VtkStatisticsAlgorithmWrap::GetClassName(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
VtkStatisticsAlgorithmWrap *wrapper = ObjectWrap::Unwrap<VtkStatisticsAlgorithmWrap>(info.Holder());
vtkStatisticsAlgorithm *native = (vtkStatisticsAlgorithm *)wrapper->native.GetPointer();
char const * r;
if(info.Length() != 0)
{
Nan::ThrowError("Too many parameters.");
return;
}
r = native->GetClassName();
info.GetReturnValue().Set(Nan::New(r).ToLocalChecked());
}
void VtkStatisticsAlgorithmWrap::GetDeriveOption(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
VtkStatisticsAlgorithmWrap *wrapper = ObjectWrap::Unwrap<VtkStatisticsAlgorithmWrap>(info.Holder());
vtkStatisticsAlgorithm *native = (vtkStatisticsAlgorithm *)wrapper->native.GetPointer();
bool r;
if(info.Length() != 0)
{
Nan::ThrowError("Too many parameters.");
return;
}
r = native->GetDeriveOption();
info.GetReturnValue().Set(Nan::New(r));
}
void VtkStatisticsAlgorithmWrap::GetLearnOption(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
VtkStatisticsAlgorithmWrap *wrapper = ObjectWrap::Unwrap<VtkStatisticsAlgorithmWrap>(info.Holder());
vtkStatisticsAlgorithm *native = (vtkStatisticsAlgorithm *)wrapper->native.GetPointer();
bool r;
if(info.Length() != 0)
{
Nan::ThrowError("Too many parameters.");
return;
}
r = native->GetLearnOption();
info.GetReturnValue().Set(Nan::New(r));
}
void VtkStatisticsAlgorithmWrap::GetTestOption(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
VtkStatisticsAlgorithmWrap *wrapper = ObjectWrap::Unwrap<VtkStatisticsAlgorithmWrap>(info.Holder());
vtkStatisticsAlgorithm *native = (vtkStatisticsAlgorithm *)wrapper->native.GetPointer();
bool r;
if(info.Length() != 0)
{
Nan::ThrowError("Too many parameters.");
return;
}
r = native->GetTestOption();
info.GetReturnValue().Set(Nan::New(r));
}
void VtkStatisticsAlgorithmWrap::IsA(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
VtkStatisticsAlgorithmWrap *wrapper = ObjectWrap::Unwrap<VtkStatisticsAlgorithmWrap>(info.Holder());
vtkStatisticsAlgorithm *native = (vtkStatisticsAlgorithm *)wrapper->native.GetPointer();
if(info.Length() > 0 && info[0]->IsString())
{
Nan::Utf8String a0(info[0]);
int r;
if(info.Length() != 1)
{
Nan::ThrowError("Too many parameters.");
return;
}
r = native->IsA(
*a0
);
info.GetReturnValue().Set(Nan::New(r));
return;
}
Nan::ThrowError("Parameter mismatch");
}
void VtkStatisticsAlgorithmWrap::NewInstance(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
VtkStatisticsAlgorithmWrap *wrapper = ObjectWrap::Unwrap<VtkStatisticsAlgorithmWrap>(info.Holder());
vtkStatisticsAlgorithm *native = (vtkStatisticsAlgorithm *)wrapper->native.GetPointer();
vtkStatisticsAlgorithm * r;
if(info.Length() != 0)
{
Nan::ThrowError("Too many parameters.");
return;
}
r = native->NewInstance();
VtkStatisticsAlgorithmWrap::InitPtpl();
v8::Local<v8::Value> argv[1] =
{ Nan::New(vtkNodeJsNoWrap) };
v8::Local<v8::Function> cons =
Nan::New<v8::FunctionTemplate>(VtkStatisticsAlgorithmWrap::ptpl)->GetFunction();
v8::Local<v8::Object> wo = cons->NewInstance(1, argv);
VtkStatisticsAlgorithmWrap *w = new VtkStatisticsAlgorithmWrap();
w->native = r;
w->Wrap(wo);
info.GetReturnValue().Set(wo);
}
void VtkStatisticsAlgorithmWrap::RequestSelectedColumns(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
VtkStatisticsAlgorithmWrap *wrapper = ObjectWrap::Unwrap<VtkStatisticsAlgorithmWrap>(info.Holder());
vtkStatisticsAlgorithm *native = (vtkStatisticsAlgorithm *)wrapper->native.GetPointer();
int r;
if(info.Length() != 0)
{
Nan::ThrowError("Too many parameters.");
return;
}
r = native->RequestSelectedColumns();
info.GetReturnValue().Set(Nan::New(r));
}
void VtkStatisticsAlgorithmWrap::ResetAllColumnStates(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
VtkStatisticsAlgorithmWrap *wrapper = ObjectWrap::Unwrap<VtkStatisticsAlgorithmWrap>(info.Holder());
vtkStatisticsAlgorithm *native = (vtkStatisticsAlgorithm *)wrapper->native.GetPointer();
if(info.Length() != 0)
{
Nan::ThrowError("Too many parameters.");
return;
}
native->ResetAllColumnStates();
}
void VtkStatisticsAlgorithmWrap::ResetRequests(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
VtkStatisticsAlgorithmWrap *wrapper = ObjectWrap::Unwrap<VtkStatisticsAlgorithmWrap>(info.Holder());
vtkStatisticsAlgorithm *native = (vtkStatisticsAlgorithm *)wrapper->native.GetPointer();
if(info.Length() != 0)
{
Nan::ThrowError("Too many parameters.");
return;
}
native->ResetRequests();
}
void VtkStatisticsAlgorithmWrap::SafeDownCast(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
VtkStatisticsAlgorithmWrap *wrapper = ObjectWrap::Unwrap<VtkStatisticsAlgorithmWrap>(info.Holder());
vtkStatisticsAlgorithm *native = (vtkStatisticsAlgorithm *)wrapper->native.GetPointer();
if(info.Length() > 0 && info[0]->IsObject() && (Nan::New(VtkObjectWrap::ptpl))->HasInstance(info[0]))
{
VtkObjectWrap *a0 = ObjectWrap::Unwrap<VtkObjectWrap>(info[0]->ToObject());
vtkStatisticsAlgorithm * r;
if(info.Length() != 1)
{
Nan::ThrowError("Too many parameters.");
return;
}
r = native->SafeDownCast(
(vtkObject *) a0->native.GetPointer()
);
VtkStatisticsAlgorithmWrap::InitPtpl();
v8::Local<v8::Value> argv[1] =
{ Nan::New(vtkNodeJsNoWrap) };
v8::Local<v8::Function> cons =
Nan::New<v8::FunctionTemplate>(VtkStatisticsAlgorithmWrap::ptpl)->GetFunction();
v8::Local<v8::Object> wo = cons->NewInstance(1, argv);
VtkStatisticsAlgorithmWrap *w = new VtkStatisticsAlgorithmWrap();
w->native = r;
w->Wrap(wo);
info.GetReturnValue().Set(wo);
return;
}
Nan::ThrowError("Parameter mismatch");
}
void VtkStatisticsAlgorithmWrap::SetAssessNames(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
VtkStatisticsAlgorithmWrap *wrapper = ObjectWrap::Unwrap<VtkStatisticsAlgorithmWrap>(info.Holder());
vtkStatisticsAlgorithm *native = (vtkStatisticsAlgorithm *)wrapper->native.GetPointer();
if(info.Length() > 0 && info[0]->IsObject() && (Nan::New(VtkStringArrayWrap::ptpl))->HasInstance(info[0]))
{
VtkStringArrayWrap *a0 = ObjectWrap::Unwrap<VtkStringArrayWrap>(info[0]->ToObject());
if(info.Length() != 1)
{
Nan::ThrowError("Too many parameters.");
return;
}
native->SetAssessNames(
(vtkStringArray *) a0->native.GetPointer()
);
return;
}
Nan::ThrowError("Parameter mismatch");
}
void VtkStatisticsAlgorithmWrap::SetAssessOption(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
VtkStatisticsAlgorithmWrap *wrapper = ObjectWrap::Unwrap<VtkStatisticsAlgorithmWrap>(info.Holder());
vtkStatisticsAlgorithm *native = (vtkStatisticsAlgorithm *)wrapper->native.GetPointer();
if(info.Length() > 0 && info[0]->IsBoolean())
{
if(info.Length() != 1)
{
Nan::ThrowError("Too many parameters.");
return;
}
native->SetAssessOption(
info[0]->BooleanValue()
);
return;
}
Nan::ThrowError("Parameter mismatch");
}
void VtkStatisticsAlgorithmWrap::SetColumnStatus(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
VtkStatisticsAlgorithmWrap *wrapper = ObjectWrap::Unwrap<VtkStatisticsAlgorithmWrap>(info.Holder());
vtkStatisticsAlgorithm *native = (vtkStatisticsAlgorithm *)wrapper->native.GetPointer();
if(info.Length() > 0 && info[0]->IsString())
{
Nan::Utf8String a0(info[0]);
if(info.Length() > 1 && info[1]->IsInt32())
{
if(info.Length() != 2)
{
Nan::ThrowError("Too many parameters.");
return;
}
native->SetColumnStatus(
*a0,
info[1]->Int32Value()
);
return;
}
}
Nan::ThrowError("Parameter mismatch");
}
void VtkStatisticsAlgorithmWrap::SetDeriveOption(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
VtkStatisticsAlgorithmWrap *wrapper = ObjectWrap::Unwrap<VtkStatisticsAlgorithmWrap>(info.Holder());
vtkStatisticsAlgorithm *native = (vtkStatisticsAlgorithm *)wrapper->native.GetPointer();
if(info.Length() > 0 && info[0]->IsBoolean())
{
if(info.Length() != 1)
{
Nan::ThrowError("Too many parameters.");
return;
}
native->SetDeriveOption(
info[0]->BooleanValue()
);
return;
}
Nan::ThrowError("Parameter mismatch");
}
void VtkStatisticsAlgorithmWrap::SetInputModel(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
VtkStatisticsAlgorithmWrap *wrapper = ObjectWrap::Unwrap<VtkStatisticsAlgorithmWrap>(info.Holder());
vtkStatisticsAlgorithm *native = (vtkStatisticsAlgorithm *)wrapper->native.GetPointer();
if(info.Length() > 0 && info[0]->IsObject() && (Nan::New(VtkDataObjectWrap::ptpl))->HasInstance(info[0]))
{
VtkDataObjectWrap *a0 = ObjectWrap::Unwrap<VtkDataObjectWrap>(info[0]->ToObject());
if(info.Length() != 1)
{
Nan::ThrowError("Too many parameters.");
return;
}
native->SetInputModel(
(vtkDataObject *) a0->native.GetPointer()
);
return;
}
Nan::ThrowError("Parameter mismatch");
}
void VtkStatisticsAlgorithmWrap::SetInputModelConnection(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
VtkStatisticsAlgorithmWrap *wrapper = ObjectWrap::Unwrap<VtkStatisticsAlgorithmWrap>(info.Holder());
vtkStatisticsAlgorithm *native = (vtkStatisticsAlgorithm *)wrapper->native.GetPointer();
if(info.Length() > 0 && info[0]->IsObject() && (Nan::New(VtkAlgorithmOutputWrap::ptpl))->HasInstance(info[0]))
{
VtkAlgorithmOutputWrap *a0 = ObjectWrap::Unwrap<VtkAlgorithmOutputWrap>(info[0]->ToObject());
if(info.Length() != 1)
{
Nan::ThrowError("Too many parameters.");
return;
}
native->SetInputModelConnection(
(vtkAlgorithmOutput *) a0->native.GetPointer()
);
return;
}
Nan::ThrowError("Parameter mismatch");
}
void VtkStatisticsAlgorithmWrap::SetLearnOption(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
VtkStatisticsAlgorithmWrap *wrapper = ObjectWrap::Unwrap<VtkStatisticsAlgorithmWrap>(info.Holder());
vtkStatisticsAlgorithm *native = (vtkStatisticsAlgorithm *)wrapper->native.GetPointer();
if(info.Length() > 0 && info[0]->IsBoolean())
{
if(info.Length() != 1)
{
Nan::ThrowError("Too many parameters.");
return;
}
native->SetLearnOption(
info[0]->BooleanValue()
);
return;
}
Nan::ThrowError("Parameter mismatch");
}
void VtkStatisticsAlgorithmWrap::SetLearnOptionParameterConnection(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
VtkStatisticsAlgorithmWrap *wrapper = ObjectWrap::Unwrap<VtkStatisticsAlgorithmWrap>(info.Holder());
vtkStatisticsAlgorithm *native = (vtkStatisticsAlgorithm *)wrapper->native.GetPointer();
if(info.Length() > 0 && info[0]->IsObject() && (Nan::New(VtkAlgorithmOutputWrap::ptpl))->HasInstance(info[0]))
{
VtkAlgorithmOutputWrap *a0 = ObjectWrap::Unwrap<VtkAlgorithmOutputWrap>(info[0]->ToObject());
if(info.Length() != 1)
{
Nan::ThrowError("Too many parameters.");
return;
}
native->SetLearnOptionParameterConnection(
(vtkAlgorithmOutput *) a0->native.GetPointer()
);
return;
}
Nan::ThrowError("Parameter mismatch");
}
void VtkStatisticsAlgorithmWrap::SetLearnOptionParameters(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
VtkStatisticsAlgorithmWrap *wrapper = ObjectWrap::Unwrap<VtkStatisticsAlgorithmWrap>(info.Holder());
vtkStatisticsAlgorithm *native = (vtkStatisticsAlgorithm *)wrapper->native.GetPointer();
if(info.Length() > 0 && info[0]->IsObject() && (Nan::New(VtkDataObjectWrap::ptpl))->HasInstance(info[0]))
{
VtkDataObjectWrap *a0 = ObjectWrap::Unwrap<VtkDataObjectWrap>(info[0]->ToObject());
if(info.Length() != 1)
{
Nan::ThrowError("Too many parameters.");
return;
}
native->SetLearnOptionParameters(
(vtkDataObject *) a0->native.GetPointer()
);
return;
}
Nan::ThrowError("Parameter mismatch");
}
void VtkStatisticsAlgorithmWrap::SetTestOption(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
VtkStatisticsAlgorithmWrap *wrapper = ObjectWrap::Unwrap<VtkStatisticsAlgorithmWrap>(info.Holder());
vtkStatisticsAlgorithm *native = (vtkStatisticsAlgorithm *)wrapper->native.GetPointer();
if(info.Length() > 0 && info[0]->IsBoolean())
{
if(info.Length() != 1)
{
Nan::ThrowError("Too many parameters.");
return;
}
native->SetTestOption(
info[0]->BooleanValue()
);
return;
}
Nan::ThrowError("Parameter mismatch");
}
|
{
"content_hash": "4b35750888ec096a4b96832a4ec80f9d",
"timestamp": "",
"source": "github",
"line_count": 607,
"max_line_length": 116,
"avg_line_length": 33.319604612850085,
"alnum_prop": 0.7405686032138442,
"repo_name": "axkibe/node-vtk",
"id": "58065c91b1c9bf4847dcd764b780303e898a1b2c",
"size": "20225",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "wrappers/7.0.0/vtkStatisticsAlgorithmWrap.cc",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C++",
"bytes": "75388342"
},
{
"name": "CMake",
"bytes": "915"
},
{
"name": "JavaScript",
"bytes": "70"
},
{
"name": "Roff",
"bytes": "145455"
}
],
"symlink_target": ""
}
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Gulp!</title>
<link rel="stylesheet" href="dist/css/assets/assets.css">
<link rel="stylesheet" href="dist/css/main.css">
</head>
<body>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nostrum eveniet amet ipsam repellendus maiores obcaecati labore, nemo blanditiis quisquam fugiat, quae minus numquam distinctio perspiciatis officiis, fugit impedit earum eius.</p>
</div>
</body>
</html>
|
{
"content_hash": "7095f0669709ce04a8ddaf545436beeb",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 241,
"avg_line_length": 36.46153846153846,
"alnum_prop": 0.7426160337552743,
"repo_name": "veksen/veksen-scaffold",
"id": "a9cba113f923a8d12a82805508e9875478421186",
"size": "474",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "index.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "30942"
},
{
"name": "HTML",
"bytes": "474"
},
{
"name": "JavaScript",
"bytes": "1693"
}
],
"symlink_target": ""
}
|
#ifndef COLOR_H
#define COLOR_H
/**
* 4D Vector implementation based on Valve's
* (I know, don't reinvent the well, we have QVector*D...)
*/
class Color {
public:
// Public access to properties
float r, g, b, a;
// Constructors
Color();
Color(int r, int g, int b, float a = 1.0);
// Copy
Color(const Color &other);
Color& operator=(const Color &other);
void toArray(float *dst);
// Access
float& operator[](int index);
const float& operator[](int index) const;
};
#endif // COLOR_H
|
{
"content_hash": "bcc2fe8acbb906196e19f886c4042308",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 58,
"avg_line_length": 19.037037037037038,
"alnum_prop": 0.6381322957198443,
"repo_name": "JulioC/Particles",
"id": "f2ab385e661d5f8e36cb1f6857f1648cb525c305",
"size": "514",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "color.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C++",
"bytes": "56261"
},
{
"name": "GLSL",
"bytes": "291"
},
{
"name": "QMake",
"bytes": "1718"
},
{
"name": "Shell",
"bytes": "56"
}
],
"symlink_target": ""
}
|
# By Justin Walgran
# Copyright (c) 2012 Azavea, Inc.
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without
# restriction, including without limitation the rights to use,
# copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following
# conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
import unittest
import tempfile
from blend import Resource, Paths
import shutil
import os
import helpers
class TestResource(unittest.TestCase):
"""Asserts that the properties and methods of the Resource class behave correctly."""
def setUp(self):
self.test_env_dir = tempfile.mkdtemp()
def tearDown(self):
shutil.rmtree(self.test_env_dir)
helpers.clean_output()
def test_resource_must_be_created_with_path_to_file(self):
self.assertRaises(Exception, Resource)
def test_resource_must_be_created_with_a_non_none_path_to_file(self):
self.assertRaises(Exception, Resource, None)
def test_resource_must_be_created_with_a_string_argument(self):
self.assertRaises(Exception, Resource, 1)
def test_resource_has_path_to_file_property_set_on_instantiation(self):
test_file_name = 'some/file/name.txt'
resource = Resource(test_file_name)
self.assertEqual(test_file_name, resource.path_to_file)
def test_resource_has_a_file_type_property_with_a_default_value_of_unknown(self):
test_file_name = 'someFile'
resource = Resource(test_file_name)
self.assertEqual('unknown', resource.file_type)
def test_resource_has_a_size_property(self):
test_env_dir = tempfile.mkdtemp()
test_file_path = os.path.join(test_env_dir, 'test_file.js')
helpers.create_file_with_content(test_file_path, '//some\ttext\non two lines')
resource = Resource(test_file_path)
self.assertEqual(24, resource.size)
shutil.rmtree(test_env_dir)
def test_resource_has_an_extension_property(self):
test_file_names_and_expected_extensions = [
('/var/someFile.js', 'js'),
('someFile.JS', 'js'),
('noExtension', ''),
('someFile.SomECraZytype', 'somecrazytype')]
for test_file_path, expected_extension in test_file_names_and_expected_extensions:
resource = Resource(test_file_path)
self.assertEqual(expected_extension, resource.extension, 'Expected the extension of "' +
test_file_path + '" to be "' + expected_extension + '"')
def test_resource_detects_file_type_by_extension(self):
test_file_paths_and_expected_file_types = [
('file.someCrazyThing', 'unknown'),
('c:\\file.js', 'javascript'),
('file.Js', 'javascript'),
('file.JS', 'javascript'),
('file.awesome.js', 'javascript'),
('file.JavaScript', 'javascript'),
('file.css', 'css'),
('FILE.CSS', 'css')]
for test_file_path, expected_file_type in test_file_paths_and_expected_file_types:
resource = Resource(test_file_path)
self.assertEqual(expected_file_type, resource.file_type, 'Expected "' + test_file_path +
'" to be detected as "' + expected_file_type + '"')
def test_resource_has_a_base_name_property(self):
test_file_paths_and_expected_base_names = [
('/usr/local/file.js', 'file'),
('FILE.JS', 'file'),
('some-Plugin-2.3.2-min.js', 'some-plugin'),
('some-dashed-file-name.js', 'some-dashed-file-name'),
('jQuery-1.2.3.js', 'jquery')]
for test_file_path, expected_base_name in test_file_paths_and_expected_base_names:
resource = Resource(test_file_path)
self.assertEqual(expected_base_name, resource.base_name, 'Expected the base_name of "' +
test_file_path + '" to be "' + expected_base_name + '" and not "' + resource.base_name + '"')
def test_find_all_javascript_resources_in_the_paths(self):
paths_to_test_files = [os.path.join(self.test_env_dir, 'test.js'), os.path.join(self.test_env_dir, 'test.css'),
os.path.join(self.test_env_dir, 'test.html')]
helpers.create_files(paths_to_test_files)
resources = Resource.find_all_of_type_in_paths('javascript', Paths(self.test_env_dir, include_cwd=False))
helpers.clean_up_files(paths_to_test_files)
self.assertEquals(1, len(resources), 'One and only one javascript file should be found')
def test_find_all_javascript_resources_in_paths(self):
paths_to_test_files = [os.path.join(self.test_env_dir, 'subdir', 'test.js'),
os.path.join(self.test_env_dir, 'test.css'), os.path.join(self.test_env_dir, 'test.html')]
test_env = Paths(self.test_env_dir, include_cwd=False)
helpers.create_files(paths_to_test_files)
resources = Resource.find_all_of_type_in_paths('javascript', test_env)
helpers.clean_up_files(paths_to_test_files)
self.assertEquals(1, len(resources), 'One and only one javascript file should be found')
self.assertEqual(os.path.join(self.test_env_dir, 'subdir', 'test.js'),
resources[0].path_to_file)
def test_search_for_javascript_resources_in_paths_without_any_search_paths_returns_none(self):
test_env = Paths(self.test_env_dir, include_cwd=False)
path_to_test_file = os.path.join(self.test_env_dir, 'test.css')
helpers.create_files(path_to_test_file)
resources = Resource.find_all_of_type_in_paths('javascript', test_env)
self.assertEquals(None, resources)
def test_exists_property(self):
path_to_test_file = os.path.join(self.test_env_dir, 'test.js')
helpers.clean_up_files(path_to_test_file)
resource = Resource(path_to_test_file)
# file does not exist yet
self.assertFalse(resource.exists)
helpers.create_files(path_to_test_file)
self.assertTrue(resource.exists)
helpers.clean_up_files(path_to_test_file)
def test_content_property(self):
path_to_test_file = os.path.join(self.test_env_dir, 'test.js')
content = 'var foo = {};'
helpers.create_file_with_content(path_to_test_file, content)
resource = Resource(path_to_test_file)
self.assertEquals(content, resource.content)
helpers.clean_up_files(path_to_test_file)
def test_requirements_property_for_resource_without_content_is_none(self):
resource = Resource('some file')
self.assertTrue(resource.content is None)
self.assertEqual(None, resource.requirements)
def test_requirements_property_for_resource_with_plain_content_is_none(self):
path_to_test_file = os.path.join(self.test_env_dir, 'test.js')
helpers.clean_up_files(path_to_test_file)
content = 'var foo = {};'
helpers.create_file_with_content(path_to_test_file, content)
resource = Resource(path_to_test_file)
self.assertTrue(resource.content == content)
self.assertEqual(None, resource.requirements)
helpers.clean_up_files(path_to_test_file)
def test_javascript_requirements_are_found(self):
path_to_test_file = os.path.join(self.test_env_dir, 'test.js')
helpers.clean_up_files(path_to_test_file)
content = '//= require jquery\nvar foo = {};//= require openlayers\n var s = some other thing\n'
helpers.create_file_with_content(path_to_test_file, content)
resource = Resource(path_to_test_file)
self.assertTrue(resource.content == content)
self.assertEqual(2, len(resource.requirements))
self.assertEqual('jquery', resource.requirements[0].name)
self.assertEqual((0, 19), resource.requirements[0].insert_location)
self.assertEqual('openlayers', resource.requirements[1].name)
self.assertEqual((32, 55), resource.requirements[1].insert_location)
helpers.clean_up_files(path_to_test_file)
def test_css_import_statements_found_as_requirements(self):
path_to_test_file = os.path.join(self.test_env_dir, 'test.css')
helpers.clean_up_files(path_to_test_file)
content = 'h1 {background:red;}\n @import url("something.css")'
helpers.create_file_with_content(path_to_test_file, content)
resource = Resource(path_to_test_file)
self.assertTrue(resource.content == content)
self.assertEqual(1, len(resource.requirements))
self.assertEqual('something', resource.requirements[0].name)
self.assertEqual((22, 50), resource.requirements[0].insert_location)
def test_css_require_comments_found_as_requirements(self):
path_to_test_file = os.path.join(self.test_env_dir, 'test.css')
helpers.clean_up_files(path_to_test_file)
content = 'h1 {background:red;}\n /*= require something */'
helpers.create_file_with_content(path_to_test_file, content)
resource = Resource(path_to_test_file)
self.assertTrue(resource.content == content)
self.assertEqual(1, len(resource.requirements))
self.assertEqual('something', resource.requirements[0].name)
self.assertEqual((21, 47), resource.requirements[0].insert_location)
def test_merge_requirements_in_global_path(self):
paths_to_test_files = [
os.path.join(self.test_env_dir, 'dir1', 'file1.js'),
os.path.join(self.test_env_dir, 'dir2', 'file2.js')]
helpers.clean_up_files(paths_to_test_files)
helpers.create_file_with_content(paths_to_test_files[0], '// This is file 1\n//= require FILE2')
helpers.create_file_with_content(paths_to_test_files[1], '// This is file 2')
file1_resource = Resource(paths_to_test_files[0])
actual_merged_content = file1_resource.merge_requirements_from_paths(Paths(self.test_env_dir,
include_cwd=False), previously_merged=[])
self.assertEqual('// This is file 1\n// This is file 2', actual_merged_content)
helpers.clean_up_files(paths_to_test_files)
def test_merge_js_requirements_in_local_path(self):
paths_to_test_files = [
os.path.join(self.test_env_dir, 'dir1', 'file1.js'),
os.path.join(self.test_env_dir, 'dir1', 'file2.js'),
os.path.join(self.test_env_dir, 'dir2', 'file2.js')]
helpers.clean_up_files(paths_to_test_files)
helpers.create_file_with_content(paths_to_test_files[0], '// This is file 1\n//= require FILE2')
helpers.create_file_with_content(paths_to_test_files[1], '// This is LOCAL file 2')
helpers.create_file_with_content(paths_to_test_files[2], '// This is GLOBAL file 2')
file1_resource = Resource(paths_to_test_files[0])
actual_merged_content = file1_resource.merge_requirements_from_paths(Paths(self.test_env_dir,
include_cwd=False), previously_merged=[])
self.assertEqual('// This is file 1\n// This is LOCAL file 2', actual_merged_content)
helpers.clean_up_files(paths_to_test_files)
def test_merge_js_requirements_favors_closer_files(self):
paths_to_test_files = [
os.path.join(self.test_env_dir, 'dir1', 'file1.js'),
os.path.join(self.test_env_dir, 'dir1', 'file2.js'),
os.path.join(self.test_env_dir, 'dir1', 'dir2', 'file2.js')]
helpers.clean_up_files(paths_to_test_files)
helpers.create_file_with_content(paths_to_test_files[0], '// This is file 1\n//= require FILE2')
helpers.create_file_with_content(paths_to_test_files[1], '// This is NEARBY file 2')
helpers.create_file_with_content(paths_to_test_files[2], '// This is FAR AWAY file 2')
file1_resource = Resource(paths_to_test_files[0])
actual_merged_content = file1_resource.merge_requirements_from_paths(Paths(self.test_env_dir,
include_cwd=False), previously_merged=[])
self.assertEqual('// This is file 1\n// This is NEARBY file 2', actual_merged_content)
def test_merge_js_requirements_favors_downward_matches(self):
paths_to_test_files = [
os.path.join(self.test_env_dir, 'dir1', 'dir2', 'file1.js'),
os.path.join(self.test_env_dir, 'dir1', 'file2.js'),
os.path.join(self.test_env_dir, 'dir1', 'dir2', 'dir3', 'file2.js')]
helpers.clean_up_files(paths_to_test_files)
helpers.create_file_with_content(paths_to_test_files[0], '// This is file 1\n//= require FILE2')
helpers.create_file_with_content(paths_to_test_files[1], '// This is UPWARD file 2')
helpers.create_file_with_content(paths_to_test_files[2], '// This is DOWNWARD file 2')
file1_resource = Resource(paths_to_test_files[0])
actual_merged_content = file1_resource.merge_requirements_from_paths(Paths(self.test_env_dir,
include_cwd=False), previously_merged=[])
self.assertEqual('// This is file 1\n// This is DOWNWARD file 2', actual_merged_content)
def test_merge_js_requirements_favors_shallow_downward_matches(self):
paths_to_test_files = [
os.path.join(self.test_env_dir, 'dir1', 'file1.js'),
os.path.join(self.test_env_dir, 'dir1', 'dir2', 'file2.js'),
os.path.join(self.test_env_dir, 'dir1', 'dir2', 'dir3', 'file2.js')]
helpers.clean_up_files(paths_to_test_files)
helpers.create_file_with_content(paths_to_test_files[0], '// This is file 1\n//= require FILE2')
helpers.create_file_with_content(paths_to_test_files[1], '// This is SHALLOW file 2')
helpers.create_file_with_content(paths_to_test_files[2], '// This is DEEP file 2')
file1_resource = Resource(paths_to_test_files[0])
actual_merged_content = file1_resource.merge_requirements_from_paths(Paths(self.test_env_dir,
include_cwd=False), previously_merged=[])
self.assertEqual('// This is file 1\n// This is SHALLOW file 2', actual_merged_content)
def test_merge_js_requirements_favors_shallow_upward_matches(self):
paths_to_test_files = [
os.path.join(self.test_env_dir, 'dir1', 'dir2', 'dir3', 'file1.js'),
os.path.join(self.test_env_dir, 'dir1', 'dir2', 'file2.js'),
os.path.join(self.test_env_dir, 'dir1', 'file2.js')]
helpers.clean_up_files(paths_to_test_files)
helpers.create_file_with_content(paths_to_test_files[0], '// This is file 1\n//= require FILE2')
helpers.create_file_with_content(paths_to_test_files[1], '// This is NEAR file 2')
helpers.create_file_with_content(paths_to_test_files[2], '// This is FAR file 2')
file1_resource = Resource(paths_to_test_files[0])
actual_merged_content = file1_resource.merge_requirements_from_paths(Paths(self.test_env_dir,
include_cwd=False), previously_merged=[])
self.assertEqual('// This is file 1\n// This is NEAR file 2', actual_merged_content)
def test_merge_css_requirements_in_local_path(self):
paths_to_test_files = [
os.path.join(self.test_env_dir, 'dir1', 'file1.css'),
os.path.join(self.test_env_dir, 'dir1', 'file2.css'),
os.path.join(self.test_env_dir, 'dir2', 'file2.css')]
helpers.clean_up_files(paths_to_test_files)
helpers.create_file_with_content(paths_to_test_files[0], '/* This is file 1 */\n@import url("FiLe2.css")')
helpers.create_file_with_content(paths_to_test_files[1], '/* This is LOCAL file 2 */')
helpers.create_file_with_content(paths_to_test_files[2], '/* This is GLOBAL file 2 */')
file1_resource = Resource(paths_to_test_files[0])
actual_merged_content = file1_resource.merge_requirements_from_paths(Paths(self.test_env_dir,
include_cwd=False), previously_merged=[])
self.assertEqual('/* This is file 1 */\n/* This is LOCAL file 2 */', actual_merged_content)
helpers.clean_up_files(paths_to_test_files)
def test_merge_recursive_requirements_in_global_path(self):
paths_to_test_files = [
os.path.join(self.test_env_dir, 'dir1', 'file1.js'),
os.path.join(self.test_env_dir, 'dir2', 'file2.js'),
os.path.join(self.test_env_dir, 'dir3', 'file3.js')]
helpers.clean_up_files(paths_to_test_files)
helpers.create_file_with_content(paths_to_test_files[0], '// This is file 1\n//= require FILE2')
helpers.create_file_with_content(paths_to_test_files[1], '// This is file 2\n//= require file3')
helpers.create_file_with_content(paths_to_test_files[2], '// This is file 3')
file1_resource = Resource(paths_to_test_files[0])
actual_merged_content = file1_resource.merge_requirements_from_paths(Paths(self.test_env_dir, include_cwd=False), previously_merged=[])
self.assertEqual('// This is file 1\n// This is file 2\n// This is file 3', actual_merged_content)
helpers.clean_up_files(paths_to_test_files)
def test_merge_from_global_path_does_not_add_requirements_twice(self):
paths_to_test_files = [
os.path.join(self.test_env_dir, 'dir11', 'file1.js'),
os.path.join(self.test_env_dir, 'dir21', 'file2.js'),
os.path.join(self.test_env_dir, 'dir31', 'file3.js'),
os.path.join(self.test_env_dir, 'dir41', 'file4.js')]
helpers.clean_up_files(paths_to_test_files)
helpers.create_file_with_content(paths_to_test_files[0], '// This is file 1\n//= require file2\n//= require file3')
helpers.create_file_with_content(paths_to_test_files[1], '// This is file 2\n//= require file4')
helpers.create_file_with_content(paths_to_test_files[2], '// This is file 3\n//= require file4')
helpers.create_file_with_content(paths_to_test_files[3], '// This is file 4\n')
file1_resource = Resource(paths_to_test_files[0])
actual_merged_content = file1_resource.merge_requirements_from_paths(Paths(self.test_env_dir, include_cwd=False), previously_merged=[])
self.assertEqual('// This is file 1\n// This is file 2\n// This is file 4\n// This is file 3\n', actual_merged_content)
helpers.clean_up_files(paths_to_test_files)
def test_merge_library_required_at_the_top_of_multiple_files(self):
paths_to_test_files = [
os.path.join(self.test_env_dir, 'dir11', 'file1.js'),
os.path.join(self.test_env_dir, 'dir21', 'file2.js'),
os.path.join(self.test_env_dir, 'dir31', 'file3.js'),
os.path.join(self.test_env_dir, 'dir41', 'file4.js')]
helpers.clean_up_files(paths_to_test_files)
helpers.create_file_with_content(paths_to_test_files[0], '//= require file2\n//= require file3\n// This is file 1\n')
helpers.create_file_with_content(paths_to_test_files[1], '//= require file4\n// This is file 2\n')
helpers.create_file_with_content(paths_to_test_files[2], '//= require file4\n// This is file 3\n')
helpers.create_file_with_content(paths_to_test_files[3], '// This is file 4\n')
file1_resource = Resource(paths_to_test_files[0])
actual_merged_content = file1_resource.merge_requirements_from_paths(Paths(self.test_env_dir, include_cwd=False), previously_merged=[])
self.assertEqual('// This is file 4\n// This is file 2\n// This is file 3\n// This is file 1\n', actual_merged_content)
helpers.clean_up_files(paths_to_test_files)
def test_find_all_in_paths(self):
paths_to_processable_test_files = [
os.path.join(self.test_env_dir, 'dir1', 'file1.js'),
os.path.join(self.test_env_dir, 'dir2', 'file2.css')]
paths_to_unprocessable_test_files = [
os.path.join(self.test_env_dir, 'dir1', 'movie.avi'),
os.path.join(self.test_env_dir, 'some.other.thing')]
helpers.create_files(paths_to_processable_test_files)
helpers.create_files(paths_to_unprocessable_test_files)
resources = Resource.find_all_in_paths(Paths(self.test_env_dir, include_cwd=False))
self.assertEquals(2, len(resources))
self.assertEqual(paths_to_processable_test_files[0], resources[0].path_to_file)
self.assertEqual(paths_to_processable_test_files[1], resources[1].path_to_file)
def test_detects_minification_from_file_name(self):
test_file_paths = [
os.path.join(self.test_env_dir, 'dir1', 'file1.js'),
os.path.join(self.test_env_dir, 'dir2', 'file1.min.js'),
os.path.join(self.test_env_dir, 'dir2', 'file1-min.js')]
helpers.create_files(test_file_paths)
unminified_resource = Resource(test_file_paths[0])
minified_resource_with_dot = Resource(test_file_paths[1])
minified_resource_with_dash = Resource(test_file_paths[2])
self.assertFalse(unminified_resource.minified)
self.assertTrue(minified_resource_with_dot.minified)
self.assertTrue(minified_resource_with_dash.minified)
|
{
"content_hash": "07e9a0674195a0d8171a0cf94eb5681f",
"timestamp": "",
"source": "github",
"line_count": 392,
"max_line_length": 143,
"avg_line_length": 56.183673469387756,
"alnum_prop": 0.6433890301489285,
"repo_name": "azavea/blend",
"id": "671ab2c247eac54680b25bd6cfa18de2b21df285",
"size": "22024",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "blend/test/TestResource.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "252395"
},
{
"name": "Python",
"bytes": "136122"
}
],
"symlink_target": ""
}
|
@implementation UIButtonEx
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self)
{
}
return self;
}
- (void)drawRect:(CGRect)rect
{
}
@end
|
{
"content_hash": "29ba3b80187430c134b20d1edabfdd32",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 39,
"avg_line_length": 11.11111111111111,
"alnum_prop": 0.59,
"repo_name": "healerkx/kxui-iOS",
"id": "0e5eec48d235c73f7cbcd9f0700621dccc3ccfed",
"size": "355",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "KxUI-iOS/KxUITest/MyViewsAndCells/UIButtonEx.m",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "224"
},
{
"name": "C++",
"bytes": "141347"
},
{
"name": "HTML",
"bytes": "113099"
},
{
"name": "Objective-C",
"bytes": "147476"
},
{
"name": "Objective-C++",
"bytes": "3486"
}
],
"symlink_target": ""
}
|
"""Geocode Contact objects."""
import sys
import time
from optparse import make_option
from geopy import geocoders
from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
from django.contrib.gis import geos
from portal import models
class Command(BaseCommand):
"""Set lat/long fields on contacts with a street address,
currently just using Google's geocoder."""
option_list = BaseCommand.option_list + (
make_option('--geocoder',
dest='geocoder',
default="yahoo",
choices=["yahoo", "google"],
help='Geocoder to use'),
)
def handle(self, *args, **options):
"""Run geocode."""
appid = getattr(settings, "YAHOO_APP_ID", None)
if not "google" in options["geocoder"] and appid is not None:
self.geocoder = geocoders.Yahoo(appid)
sys.stderr.write("Geocoding with Yahoo world...\n")
else:
self.geocoder = geocoders.Google()
sys.stderr.write("Geocoding with Google maps...\n")
for repo in models.Repository.objects.all():
self.geocode_contact(repo)
def geocode_contact(self, resource):
"""Set lat/long fields on contact objects."""
contact = resource.primary_contact
if resource.place_set.count() == 0 and contact and contact.street_address:
sys.stderr.write("Geocoding: %s: %s\n" % (contact.repository.name, contact.format()))
try:
formaddr, (lat, lon) = self.geocoder.geocode(contact.format().encode("utf8"))
except ValueError:
sys.stderr.write(" - More than one value found!\n")
except geocoders.google.GTooManyQueriesError:
raise CommandError("Too many queries for Google Geocode.")
except geocoders.google.GQueryError:
sys.stderr.write(" - Unable to get latlong for address\n")
else:
point = models.Place(point=geos.Point(lat, lon),
resource=resource)
point.save()
sys.stderr.write("Set lat/lon: %s, %s\n\n" % (lat, lon))
# delay to keep Google rate limit happy (hopefully)
time.sleep(0.05)
|
{
"content_hash": "a141dd32c318ae3c98ba6010849f9b38",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 97,
"avg_line_length": 35.96875,
"alnum_prop": 0.5977410947002606,
"repo_name": "mikesname/ehri-collections",
"id": "4757426786b8a57bbb055c7903ff99446d3bb07e",
"size": "2302",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ehriportal/portal/management/commands/geocode_addresses.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CoffeeScript",
"bytes": "3957"
},
{
"name": "JavaScript",
"bytes": "26562"
},
{
"name": "Python",
"bytes": "460117"
},
{
"name": "Shell",
"bytes": "204"
}
],
"symlink_target": ""
}
|
<?xml version="1.0" ?>
<!--
Copyright 2014-2017 Red Hat, Inc. and/or its affiliates
and other contributors as indicated by the @author tags.
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.
-->
<module xmlns="urn:jboss:module:1.1" name="org.hawkular.commons.cassandra-driver">
<dependencies>
<module name="com.google.guava" />
<module name="org.slf4j" />
<module name="io.netty"/>
<module name="sun.jdk" />
<module name="javax.api" />
</dependencies>
<resources>
<artifact name="${com.datastax.cassandra:cassandra-driver-core}"/>
<artifact name="${io.dropwizard.metrics:metrics-core}"/>
</resources>
</module>
|
{
"content_hash": "19bc866efa00182fee7fa62a6d168982",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 82,
"avg_line_length": 36.46875,
"alnum_prop": 0.699228791773779,
"repo_name": "lucasponce/hawkular-commons",
"id": "8da0b3fad17c97c31db0cff4cc9d52ff000b3247",
"size": "1167",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "hawkular-nest/hawkular-nest-feature-pack/src/main/resources/modules/system/layers/hawkular/org/hawkular/commons/cassandra-driver/main/module.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "5271"
},
{
"name": "CSS",
"bytes": "82307"
},
{
"name": "Groovy",
"bytes": "21695"
},
{
"name": "HTML",
"bytes": "15553"
},
{
"name": "Java",
"bytes": "707464"
},
{
"name": "JavaScript",
"bytes": "38501"
},
{
"name": "Shell",
"bytes": "9005"
},
{
"name": "XSLT",
"bytes": "11069"
}
],
"symlink_target": ""
}
|
<!DOCTYPE html>
<!--[if IE]><![endif]-->
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Class iOSPollingWlanProbe
| Sensus Documentation </title>
<meta name="viewport" content="width=device-width">
<meta name="title" content="Class iOSPollingWlanProbe
| Sensus Documentation ">
<meta name="generator" content="docfx 2.38.1.0">
<link rel="shortcut icon" href="../images/favicon.ico">
<link rel="stylesheet" href="../styles/docfx.vendor.css">
<link rel="stylesheet" href="../styles/docfx.css">
<link rel="stylesheet" href="../styles/main.css">
<meta property="docfx:navrel" content="../toc.html">
<meta property="docfx:tocrel" content="toc.html">
<meta property="docfx:rel" content="../">
</head>
<body data-spy="scroll" data-target="#affix" data-offset="120">
<div id="wrapper">
<header>
<nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
<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">
<img id="logo" class="svg" src="../images/group-of-members-users-icon.png" alt="">
</a>
</div>
<div class="collapse navbar-collapse" id="navbar">
<form class="navbar-form navbar-right" role="search" id="search">
<div class="form-group">
<input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
</div>
</form>
</div>
</div>
</nav>
<div class="subnav navbar navbar-default">
<div class="container hide-when-search" id="breadcrumb">
<ul class="breadcrumb">
<li></li>
</ul>
</div>
</div>
</header>
<div class="container body-content">
<div id="search-results">
<div class="search-list"></div>
<div class="sr-items">
<p><i class="glyphicon glyphicon-refresh index-loading"></i></p>
</div>
<ul id="pagination"></ul>
</div>
</div>
<div role="main" class="container body-content hide-when-search">
<div class="sidenav hide-when-search">
<a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
<div class="sidetoggle collapse" id="sidetoggle">
<div id="sidetoc"></div>
</div>
</div>
<div class="article row grid-right">
<div class="col-md-10">
<article class="content wrap" id="_content" data-uid="Sensus.iOS.Network.Probes.iOSPollingWlanProbe">
<h1 id="Sensus_iOS_Network_Probes_iOSPollingWlanProbe" data-uid="Sensus.iOS.Network.Probes.iOSPollingWlanProbe" class="text-break">Class iOSPollingWlanProbe
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>
<div class="inheritance">
<h5>Inheritance</h5>
<div class="level0"><span class="xref">System.Object</span></div>
<div class="level1"><a class="xref" href="Sensus.Probes.Probe.html">Probe</a></div>
<div class="level2"><a class="xref" href="Sensus.Probes.PollingProbe.html">PollingProbe</a></div>
<div class="level3"><a class="xref" href="Sensus.Probes.Network.PollingWlanProbe.html">PollingWlanProbe</a></div>
<div class="level4"><span class="xref">iOSPollingWlanProbe</span></div>
</div>
<div classs="implements">
<h5>Implements</h5>
<div><span class="xref">System.ComponentModel.INotifyPropertyChanged</span></div>
<div><a class="xref" href="Sensus.Probes.IPollingProbe.html">IPollingProbe</a></div>
<div><a class="xref" href="Sensus.Probes.IProbe.html">IProbe</a></div>
</div>
<div class="inheritedMembers">
<h5>Inherited Members</h5>
<div>
<a class="xref" href="Sensus.Probes.Network.PollingWlanProbe.html#Sensus_Probes_Network_PollingWlanProbe_GetChartSeries">PollingWlanProbe.GetChartSeries()</a>
</div>
<div>
<a class="xref" href="Sensus.Probes.Network.PollingWlanProbe.html#Sensus_Probes_Network_PollingWlanProbe_GetChartDataPointFromDatum_Sensus_Datum_">PollingWlanProbe.GetChartDataPointFromDatum(Datum)</a>
</div>
<div>
<a class="xref" href="Sensus.Probes.Network.PollingWlanProbe.html#Sensus_Probes_Network_PollingWlanProbe_GetChartPrimaryAxis">PollingWlanProbe.GetChartPrimaryAxis()</a>
</div>
<div>
<a class="xref" href="Sensus.Probes.Network.PollingWlanProbe.html#Sensus_Probes_Network_PollingWlanProbe_GetChartSecondaryAxis">PollingWlanProbe.GetChartSecondaryAxis()</a>
</div>
<div>
<a class="xref" href="Sensus.Probes.Network.PollingWlanProbe.html#Sensus_Probes_Network_PollingWlanProbe_DisplayName">PollingWlanProbe.DisplayName</a>
</div>
<div>
<a class="xref" href="Sensus.Probes.Network.PollingWlanProbe.html#Sensus_Probes_Network_PollingWlanProbe_DatumType">PollingWlanProbe.DatumType</a>
</div>
<div>
<a class="xref" href="Sensus.Probes.Network.PollingWlanProbe.html#Sensus_Probes_Network_PollingWlanProbe_DefaultPollingSleepDurationMS">PollingWlanProbe.DefaultPollingSleepDurationMS</a>
</div>
<div>
<a class="xref" href="Sensus.Probes.PollingProbe.html#Sensus_Probes_PollingProbe_ProtectedStartAsync">PollingProbe.ProtectedStartAsync()</a>
</div>
<div>
<a class="xref" href="Sensus.Probes.PollingProbe.html#Sensus_Probes_PollingProbe_ProtectedStopAsync">PollingProbe.ProtectedStopAsync()</a>
</div>
<div>
<a class="xref" href="Sensus.Probes.PollingProbe.html#Sensus_Probes_PollingProbe_TestHealthAsync_System_Collections_Generic_List_Sensus_AnalyticsTrackedEvent__">PollingProbe.TestHealthAsync(List<AnalyticsTrackedEvent>)</a>
</div>
<div>
<a class="xref" href="Sensus.Probes.PollingProbe.html#Sensus_Probes_PollingProbe_ResetAsync">PollingProbe.ResetAsync()</a>
</div>
<div>
<a class="xref" href="Sensus.Probes.PollingProbe.html#Sensus_Probes_PollingProbe_PollingSleepDurationMS">PollingProbe.PollingSleepDurationMS</a>
</div>
<div>
<a class="xref" href="Sensus.Probes.PollingProbe.html#Sensus_Probes_PollingProbe_PollingTimeoutMinutes">PollingProbe.PollingTimeoutMinutes</a>
</div>
<div>
<a class="xref" href="Sensus.Probes.PollingProbe.html#Sensus_Probes_PollingProbe_RawParticipation">PollingProbe.RawParticipation</a>
</div>
<div>
<a class="xref" href="Sensus.Probes.PollingProbe.html#Sensus_Probes_PollingProbe_DataRateSampleSize">PollingProbe.DataRateSampleSize</a>
</div>
<div>
<a class="xref" href="Sensus.Probes.PollingProbe.html#Sensus_Probes_PollingProbe_MaxDataStoresPerSecond">PollingProbe.MaxDataStoresPerSecond</a>
</div>
<div>
<a class="xref" href="Sensus.Probes.PollingProbe.html#Sensus_Probes_PollingProbe_PollTimes">PollingProbe.PollTimes</a>
</div>
<div>
<a class="xref" href="Sensus.Probes.PollingProbe.html#Sensus_Probes_PollingProbe_AcPowerConnectPoll">PollingProbe.AcPowerConnectPoll</a>
</div>
<div>
<a class="xref" href="Sensus.Probes.PollingProbe.html#Sensus_Probes_PollingProbe_AcPowerConnectPollOverridesScheduledPolls">PollingProbe.AcPowerConnectPollOverridesScheduledPolls</a>
</div>
<div>
<a class="xref" href="Sensus.Probes.PollingProbe.html#Sensus_Probes_PollingProbe_SignificantChangePoll">PollingProbe.SignificantChangePoll</a>
</div>
<div>
<a class="xref" href="Sensus.Probes.PollingProbe.html#Sensus_Probes_PollingProbe_SignificantChangePollOverridesScheduledPolls">PollingProbe.SignificantChangePollOverridesScheduledPolls</a>
</div>
<div>
<a class="xref" href="Sensus.Probes.PollingProbe.html#Sensus_Probes_PollingProbe_AlertUserWhenBackgrounded">PollingProbe.AlertUserWhenBackgrounded</a>
</div>
<div>
<a class="xref" href="Sensus.Probes.PollingProbe.html#Sensus_Probes_PollingProbe_DelayToleranceBeforeMS">PollingProbe.DelayToleranceBeforeMS</a>
</div>
<div>
<a class="xref" href="Sensus.Probes.PollingProbe.html#Sensus_Probes_PollingProbe_DelayToleranceAfterMS">PollingProbe.DelayToleranceAfterMS</a>
</div>
<div>
<a class="xref" href="Sensus.Probes.PollingProbe.html#Sensus_Probes_PollingProbe_CollectionDescription">PollingProbe.CollectionDescription</a>
</div>
<div>
<a class="xref" href="Sensus.Probes.Probe.html#Sensus_Probes_Probe_GetAll">Probe.GetAll()</a>
</div>
<div>
<a class="xref" href="Sensus.Probes.Probe.html#Sensus_Probes_Probe_add_MostRecentDatumChanged_Sensus_Probes_Probe_MostRecentDatumChangedDelegateAsync_">Probe.add_MostRecentDatumChanged(Probe.MostRecentDatumChangedDelegateAsync)</a>
</div>
<div>
<a class="xref" href="Sensus.Probes.Probe.html#Sensus_Probes_Probe_remove_MostRecentDatumChanged_Sensus_Probes_Probe_MostRecentDatumChangedDelegateAsync_">Probe.remove_MostRecentDatumChanged(Probe.MostRecentDatumChangedDelegateAsync)</a>
</div>
<div>
<a class="xref" href="Sensus.Probes.Probe.html#Sensus_Probes_Probe_InitializeAsync">Probe.InitializeAsync()</a>
</div>
<div>
<a class="xref" href="Sensus.Probes.Probe.html#Sensus_Probes_Probe_StartAsync">Probe.StartAsync()</a>
</div>
<div>
<a class="xref" href="Sensus.Probes.Probe.html#Sensus_Probes_Probe_StoreDatumAsync_Sensus_Datum_System_Nullable_System_Threading_CancellationToken__">Probe.StoreDatumAsync(Datum, Nullable<CancellationToken>)</a>
</div>
<div>
<a class="xref" href="Sensus.Probes.Probe.html#Sensus_Probes_Probe_ProcessDataAsync_System_Threading_CancellationToken_">Probe.ProcessDataAsync(CancellationToken)</a>
</div>
<div>
<a class="xref" href="Sensus.Probes.Probe.html#Sensus_Probes_Probe_GetParticipation">Probe.GetParticipation()</a>
</div>
<div>
<a class="xref" href="Sensus.Probes.Probe.html#Sensus_Probes_Probe_StopAsync">Probe.StopAsync()</a>
</div>
<div>
<a class="xref" href="Sensus.Probes.Probe.html#Sensus_Probes_Probe_RestartAsync">Probe.RestartAsync()</a>
</div>
<div>
<a class="xref" href="Sensus.Probes.Probe.html#Sensus_Probes_Probe_GetChart">Probe.GetChart()</a>
</div>
<div>
<a class="xref" href="Sensus.Probes.Probe.html#Sensus_Probes_Probe_Enabled">Probe.Enabled</a>
</div>
<div>
<a class="xref" href="Sensus.Probes.Probe.html#Sensus_Probes_Probe_OriginallyEnabled">Probe.OriginallyEnabled</a>
</div>
<div>
<a class="xref" href="Sensus.Probes.Probe.html#Sensus_Probes_Probe_State">Probe.State</a>
</div>
<div>
<a class="xref" href="Sensus.Probes.Probe.html#Sensus_Probes_Probe_MostRecentStoreTimestamp">Probe.MostRecentStoreTimestamp</a>
</div>
<div>
<a class="xref" href="Sensus.Probes.Probe.html#Sensus_Probes_Probe_Protocol">Probe.Protocol</a>
</div>
<div>
<a class="xref" href="Sensus.Probes.Probe.html#Sensus_Probes_Probe_StoreData">Probe.StoreData</a>
</div>
<div>
<a class="xref" href="Sensus.Probes.Probe.html#Sensus_Probes_Probe_AllowDisableOnStartUp">Probe.AllowDisableOnStartUp</a>
</div>
<div>
<a class="xref" href="Sensus.Probes.Probe.html#Sensus_Probes_Probe_StartStopTimes">Probe.StartStopTimes</a>
</div>
<div>
<a class="xref" href="Sensus.Probes.Probe.html#Sensus_Probes_Probe_SuccessfulHealthTestTimes">Probe.SuccessfulHealthTestTimes</a>
</div>
<div>
<a class="xref" href="Sensus.Probes.Probe.html#Sensus_Probes_Probe_MaxChartDataCount">Probe.MaxChartDataCount</a>
</div>
<div>
<a class="xref" href="Sensus.Probes.Probe.html#Sensus_Probes_Probe_Caption">Probe.Caption</a>
</div>
<div>
<a class="xref" href="Sensus.Probes.Probe.html#Sensus_Probes_Probe_SubCaption">Probe.SubCaption</a>
</div>
<div>
<a class="xref" href="Sensus.Probes.Probe.html#Sensus_Probes_Probe_MostRecentDatumChanged">Probe.MostRecentDatumChanged</a>
</div>
<div>
<a class="xref" href="Sensus.Probes.Probe.html#Sensus_Probes_Probe_PropertyChanged">Probe.PropertyChanged</a>
</div>
</div>
<h6><strong>Namespace</strong>: <a class="xref" href="Sensus.iOS.Network.Probes.html">Sensus.iOS.Network.Probes</a></h6>
<h6><strong>Assembly</strong>: SensusiOS.dll</h6>
<h5 id="Sensus_iOS_Network_Probes_iOSPollingWlanProbe_syntax">Syntax</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public class iOSPollingWlanProbe : PollingWlanProbe, INotifyPropertyChanged, IPollingProbe, IProbe</code></pre>
</div>
<h3 id="constructors">Constructors
</h3>
<a id="Sensus_iOS_Network_Probes_iOSPollingWlanProbe__ctor_" data-uid="Sensus.iOS.Network.Probes.iOSPollingWlanProbe.#ctor*"></a>
<h4 id="Sensus_iOS_Network_Probes_iOSPollingWlanProbe__ctor" data-uid="Sensus.iOS.Network.Probes.iOSPollingWlanProbe.#ctor">iOSPollingWlanProbe()</h4>
<div class="markdown level1 summary"></div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public iOSPollingWlanProbe()</code></pre>
</div>
<h3 id="methods">Methods
</h3>
<a id="Sensus_iOS_Network_Probes_iOSPollingWlanProbe_PollAsync_" data-uid="Sensus.iOS.Network.Probes.iOSPollingWlanProbe.PollAsync*"></a>
<h4 id="Sensus_iOS_Network_Probes_iOSPollingWlanProbe_PollAsync_System_Threading_CancellationToken_" data-uid="Sensus.iOS.Network.Probes.iOSPollingWlanProbe.PollAsync(System.Threading.CancellationToken)">PollAsync(CancellationToken)</h4>
<div class="markdown level1 summary"></div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">protected override Task<List<Datum>> PollAsync(CancellationToken cancellationToken)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Threading.CancellationToken</span></td>
<td><span class="parametername">cancellationToken</span></td>
<td></td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Threading.Tasks.Task</span><<span class="xref">System.Collections.Generic.List</span><<a class="xref" href="Sensus.Datum.html">Datum</a>>></td>
<td></td>
</tr>
</tbody>
</table>
<h5 class="overrides">Overrides</h5>
<div><a class="xref" href="Sensus.Probes.PollingProbe.html#Sensus_Probes_PollingProbe_PollAsync_System_Threading_CancellationToken_">PollingProbe.PollAsync(CancellationToken)</a></div>
<h3 id="implements">Implements</h3>
<div>
<span class="xref">System.ComponentModel.INotifyPropertyChanged</span>
</div>
<div>
<a class="xref" href="Sensus.Probes.IPollingProbe.html">IPollingProbe</a>
</div>
<div>
<a class="xref" href="Sensus.Probes.IProbe.html">IProbe</a>
</div>
</article>
</div>
<div class="hidden-sm col-md-2" role="complementary">
<div class="sideaffix">
<div class="contribution">
<ul class="nav">
</ul>
</div>
<nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
<!-- <p><a class="back-to-top" href="#top">Back to top</a><p> -->
</nav>
</div>
</div>
</div>
</div>
<footer>
<div class="grad-bottom"></div>
<div class="footer">
<div class="container">
<span class="pull-right">
<a href="#top">Back to top</a>
</span>
Copyright © 2014-2018 University of Virginia<br>Generated by <strong>DocFX</strong>
</div>
</div>
</footer>
</div>
<script type="text/javascript" src="../styles/docfx.vendor.js"></script>
<script type="text/javascript" src="../styles/docfx.js"></script>
<script type="text/javascript" src="../styles/main.js"></script>
</body>
</html>
|
{
"content_hash": "fcae227963ff04e184d88983f446c986",
"timestamp": "",
"source": "github",
"line_count": 364,
"max_line_length": 243,
"avg_line_length": 48.08791208791209,
"alnum_prop": 0.6540790676416819,
"repo_name": "predictive-technology-laboratory/sensus",
"id": "c837d9e00404ac4619bb2fe2ab76842139843316",
"size": "17507",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "docs/api/Sensus.iOS.Network.Probes.iOSPollingWlanProbe.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "2340482"
},
{
"name": "HTML",
"bytes": "109896"
},
{
"name": "JavaScript",
"bytes": "1068"
},
{
"name": "Python",
"bytes": "13651"
},
{
"name": "R",
"bytes": "30597"
},
{
"name": "Shell",
"bytes": "42994"
}
],
"symlink_target": ""
}
|
<?php
/**
* Product
*
* PHP version 5
*
* @category Class
* @package BrightpearlApiClient
* @author http://github.com/swagger-api/swagger-codegen
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
* @link https://github.com/swagger-api/swagger-codegen
*/
/**
* Copyright 2016 SmartBear Software
*
* 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.
*/
/**
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen
* Do not edit the class manually.
*/
namespace BrightpearlApiClient\Model;
use \ArrayAccess;
/**
* Product Class Doc Comment
*
* @category Class
* @description
* @package BrightpearlApiClient
* @author http://github.com/swagger-api/swagger-codegen
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
* @link https://github.com/swagger-api/swagger-codegen
*/
class Product implements ArrayAccess
{
/**
* Array of property to type mappings. Used for (de)serialization
* @var string[]
*/
static $swaggerTypes = array(
'id' => 'int',
'brand_id' => 'int',
'product_type_id' => 'int',
'nominal_code_stock' => 'string',
'nominal_code_purchases' => 'string',
'nominal_code_sales' => 'string',
'season_ids' => 'int[]',
'identity' => '\BrightpearlApiClient\Model\ProductIdentity',
'stock' => '\BrightpearlApiClient\Model\ProductStock',
'financial_details' => '\BrightpearlApiClient\Model\ProductFinancialDetails',
'sales_channels' => '\BrightpearlApiClient\Model\SalesChannel[]',
'variations' => '\BrightpearlApiClient\Model\ProductVariations[]',
'composition' => '\BrightpearlApiClient\Model\ProductComposition',
'custom_fields' => '\BrightpearlApiClient\Model\ProductCustomFields',
'null_custom_fields' => 'string[]',
'warehouses' => 'Object',
'created_on' => 'string',
'updated_on' => 'string',
'reporting' => '\BrightpearlApiClient\Model\ProductReporting',
'status' => 'string'
);
/**
* Array of attributes where the key is the local name, and the value is the original name
* @var string[]
*/
static $attributeMap = array(
'id' => 'id',
'brand_id' => 'brandId',
'product_type_id' => 'productTypeId',
'nominal_code_stock' => 'nominalCodeStock',
'nominal_code_purchases' => 'nominalCodePurchases',
'nominal_code_sales' => 'nominalCodeSales',
'season_ids' => 'seasonIds',
'identity' => 'identity',
'stock' => 'stock',
'financial_details' => 'financialDetails',
'sales_channels' => 'salesChannels',
'variations' => 'variations',
'composition' => 'composition',
'custom_fields' => 'customFields',
'null_custom_fields' => 'nullCustomFields',
'warehouses' => 'warehouses',
'created_on' => 'createdOn',
'updated_on' => 'updatedOn',
'reporting' => 'reporting',
'status' => 'status'
);
/**
* Array of attributes to setter functions (for deserialization of responses)
* @var string[]
*/
static $setters = array(
'id' => 'setId',
'brand_id' => 'setBrandId',
'product_type_id' => 'setProductTypeId',
'nominal_code_stock' => 'setNominalCodeStock',
'nominal_code_purchases' => 'setNominalCodePurchases',
'nominal_code_sales' => 'setNominalCodeSales',
'season_ids' => 'setSeasonIds',
'identity' => 'setIdentity',
'stock' => 'setStock',
'financial_details' => 'setFinancialDetails',
'sales_channels' => 'setSalesChannels',
'variations' => 'setVariations',
'composition' => 'setComposition',
'custom_fields' => 'setCustomFields',
'null_custom_fields' => 'setNullCustomFields',
'warehouses' => 'setWarehouses',
'created_on' => 'setCreatedOn',
'updated_on' => 'setUpdatedOn',
'reporting' => 'setReporting',
'status' => 'setStatus'
);
/**
* Array of attributes to getter functions (for serialization of requests)
* @var string[]
*/
static $getters = array(
'id' => 'getId',
'brand_id' => 'getBrandId',
'product_type_id' => 'getProductTypeId',
'nominal_code_stock' => 'getNominalCodeStock',
'nominal_code_purchases' => 'getNominalCodePurchases',
'nominal_code_sales' => 'getNominalCodeSales',
'season_ids' => 'getSeasonIds',
'identity' => 'getIdentity',
'stock' => 'getStock',
'financial_details' => 'getFinancialDetails',
'sales_channels' => 'getSalesChannels',
'variations' => 'getVariations',
'composition' => 'getComposition',
'custom_fields' => 'getCustomFields',
'null_custom_fields' => 'getNullCustomFields',
'warehouses' => 'getWarehouses',
'created_on' => 'getCreatedOn',
'updated_on' => 'getUpdatedOn',
'reporting' => 'getReporting',
'status' => 'getStatus'
);
/**
* $id
* @var int
*/
protected $id;
/**
* $brand_id
* @var int
*/
protected $brand_id;
/**
* $product_type_id
* @var int
*/
protected $product_type_id;
/**
* $nominal_code_stock
* @var string
*/
protected $nominal_code_stock;
/**
* $nominal_code_purchases
* @var string
*/
protected $nominal_code_purchases;
/**
* $nominal_code_sales
* @var string
*/
protected $nominal_code_sales;
/**
* $season_ids
* @var int[]
*/
protected $season_ids;
/**
* $identity
* @var \BrightpearlApiClient\Model\ProductIdentity
*/
protected $identity;
/**
* $stock
* @var \BrightpearlApiClient\Model\ProductStock
*/
protected $stock;
/**
* $financial_details
* @var \BrightpearlApiClient\Model\ProductFinancialDetails
*/
protected $financial_details;
/**
* $sales_channels
* @var \BrightpearlApiClient\Model\SalesChannel[]
*/
protected $sales_channels;
/**
* $variations
* @var \BrightpearlApiClient\Model\ProductVariations[]
*/
protected $variations;
/**
* $composition
* @var \BrightpearlApiClient\Model\ProductComposition
*/
protected $composition;
/**
* $custom_fields
* @var \BrightpearlApiClient\Model\ProductCustomFields
*/
protected $custom_fields;
/**
* $null_custom_fields
* @var string[]
*/
protected $null_custom_fields;
/**
* $warehouses
* @var \BrightpearlApiClient\Model\ProductWarehouses
*/
protected $warehouses;
/**
* $created_on
* @var string
*/
protected $created_on;
/**
* $updated_on
* @var string
*/
protected $updated_on;
/**
* $reporting
* @var \BrightpearlApiClient\Model\ProductReporting
*/
protected $reporting;
/**
* $status
* @var string
*/
protected $status;
/**
* Constructor
* @param mixed[] $data Associated array of property value initalizing the model
*/
public function __construct(array $data = null)
{
if ($data != null) {
$this->id = $data["id"];
$this->brand_id = $data["brand_id"];
$this->product_type_id = $data["product_type_id"];
$this->nominal_code_stock = $data["nominal_code_stock"];
$this->nominal_code_purchases = $data["nominal_code_purchases"];
$this->nominal_code_sales = $data["nominal_code_sales"];
$this->season_ids = $data["season_ids"];
$this->identity = $data["identity"];
$this->stock = $data["stock"];
$this->financial_details = $data["financial_details"];
$this->sales_channels = $data["sales_channels"];
$this->variations = $data["variations"];
$this->composition = $data["composition"];
$this->custom_fields = $data["custom_fields"];
$this->null_custom_fields = $data["null_custom_fields"];
$this->warehouses = $data["warehouses"];
$this->created_on = $data["created_on"];
$this->updated_on = $data["updated_on"];
$this->reporting = $data["reporting"];
$this->status = $data["status"];
}
}
/**
* Gets id
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Sets id
* @param int $id
* @return $this
*/
public function setId($id)
{
$this->id = $id;
return $this;
}
/**
* Gets brand_id
* @return int
*/
public function getBrandId()
{
return $this->brand_id;
}
/**
* Sets brand_id
* @param int $brand_id
* @return $this
*/
public function setBrandId($brand_id)
{
$this->brand_id = $brand_id;
return $this;
}
/**
* Gets product_type_id
* @return int
*/
public function getProductTypeId()
{
return $this->product_type_id;
}
/**
* Sets product_type_id
* @param int $product_type_id
* @return $this
*/
public function setProductTypeId($product_type_id)
{
$this->product_type_id = $product_type_id;
return $this;
}
/**
* Gets nominal_code_stock
* @return string
*/
public function getNominalCodeStock()
{
return $this->nominal_code_stock;
}
/**
* Sets nominal_code_stock
* @param string $nominal_code_stock
* @return $this
*/
public function setNominalCodeStock($nominal_code_stock)
{
$this->nominal_code_stock = $nominal_code_stock;
return $this;
}
/**
* Gets nominal_code_purchases
* @return string
*/
public function getNominalCodePurchases()
{
return $this->nominal_code_purchases;
}
/**
* Sets nominal_code_purchases
* @param string $nominal_code_purchases
* @return $this
*/
public function setNominalCodePurchases($nominal_code_purchases)
{
$this->nominal_code_purchases = $nominal_code_purchases;
return $this;
}
/**
* Gets nominal_code_sales
* @return string
*/
public function getNominalCodeSales()
{
return $this->nominal_code_sales;
}
/**
* Sets nominal_code_sales
* @param string $nominal_code_sales
* @return $this
*/
public function setNominalCodeSales($nominal_code_sales)
{
$this->nominal_code_sales = $nominal_code_sales;
return $this;
}
/**
* Gets season_ids
* @return int[]
*/
public function getSeasonIds()
{
return $this->season_ids;
}
/**
* Sets season_ids
* @param int[] $season_ids
* @return $this
*/
public function setSeasonIds($season_ids)
{
$this->season_ids = $season_ids;
return $this;
}
/**
* Gets identity
* @return \BrightpearlApiClient\Model\ProductIdentity
*/
public function getIdentity()
{
return $this->identity;
}
/**
* Sets identity
* @param \BrightpearlApiClient\Model\ProductIdentity $identity
* @return $this
*/
public function setIdentity($identity)
{
$this->identity = $identity;
return $this;
}
/**
* Gets stock
* @return \BrightpearlApiClient\Model\ProductStock
*/
public function getStock()
{
return $this->stock;
}
/**
* Sets stock
* @param \BrightpearlApiClient\Model\ProductStock $stock
* @return $this
*/
public function setStock($stock)
{
$this->stock = $stock;
return $this;
}
/**
* Gets financial_details
* @return \BrightpearlApiClient\Model\ProductFinancialDetails
*/
public function getFinancialDetails()
{
return $this->financial_details;
}
/**
* Sets financial_details
* @param \BrightpearlApiClient\Model\ProductFinancialDetails $financial_details
* @return $this
*/
public function setFinancialDetails($financial_details)
{
$this->financial_details = $financial_details;
return $this;
}
/**
* Gets sales_channels
* @return \BrightpearlApiClient\Model\SalesChannel[]
*/
public function getSalesChannels()
{
return $this->sales_channels;
}
/**
* Sets sales_channels
* @param \BrightpearlApiClient\Model\SalesChannel[] $sales_channels
* @return $this
*/
public function setSalesChannels($sales_channels)
{
$this->sales_channels = $sales_channels;
return $this;
}
/**
* Gets variations
* @return \BrightpearlApiClient\Model\ProductVariations[]
*/
public function getVariations()
{
return $this->variations;
}
/**
* Sets variations
* @param \BrightpearlApiClient\Model\ProductVariations[] $variations
* @return $this
*/
public function setVariations($variations)
{
$this->variations = $variations;
return $this;
}
/**
* Gets composition
* @return \BrightpearlApiClient\Model\ProductComposition
*/
public function getComposition()
{
return $this->composition;
}
/**
* Sets composition
* @param \BrightpearlApiClient\Model\ProductComposition $composition
* @return $this
*/
public function setComposition($composition)
{
$this->composition = $composition;
return $this;
}
/**
* Gets custom_fields
* @return \BrightpearlApiClient\Model\ProductCustomFields
*/
public function getCustomFields()
{
return $this->custom_fields;
}
/**
* Sets custom_fields
* @param \BrightpearlApiClient\Model\ProductCustomFields $custom_fields
* @return $this
*/
public function setCustomFields($custom_fields)
{
$this->custom_fields = $custom_fields;
return $this;
}
/**
* Gets null_custom_fields
* @return string[]
*/
public function getNullCustomFields()
{
return $this->null_custom_fields;
}
/**
* Sets null_custom_fields
* @param string[] $null_custom_fields
* @return $this
*/
public function setNullCustomFields($null_custom_fields)
{
$this->null_custom_fields = $null_custom_fields;
return $this;
}
/**
* Gets warehouses
* @return \BrightpearlApiClient\Model\ProductWarehouses
*/
public function getWarehouses()
{
return $this->warehouses;
}
/**
* Sets warehouses
* @param \BrightpearlApiClient\Model\ProductWarehouses $warehouses
* @return $this
*/
public function setWarehouses($warehouses)
{
$this->warehouses = $warehouses;
return $this;
}
/**
* Gets created_on
* @return string
*/
public function getCreatedOn()
{
return $this->created_on;
}
/**
* Sets created_on
* @param string $created_on
* @return $this
*/
public function setCreatedOn($created_on)
{
$this->created_on = $created_on;
return $this;
}
/**
* Gets updated_on
* @return string
*/
public function getUpdatedOn()
{
return $this->updated_on;
}
/**
* Sets updated_on
* @param string $updated_on
* @return $this
*/
public function setUpdatedOn($updated_on)
{
$this->updated_on = $updated_on;
return $this;
}
/**
* Gets reporting
* @return \BrightpearlApiClient\Model\ProductReporting
*/
public function getReporting()
{
return $this->reporting;
}
/**
* Sets reporting
* @param \BrightpearlApiClient\Model\ProductReporting $reporting
* @return $this
*/
public function setReporting($reporting)
{
$this->reporting = $reporting;
return $this;
}
/**
* Gets status
* @return string
*/
public function getStatus()
{
return $this->status;
}
/**
* Sets status
* @param string $status
* @return $this
*/
public function setStatus($status)
{
$this->status = $status;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
* @param integer $offset Offset
* @return boolean
*/
public function offsetExists($offset)
{
return isset($this->$offset);
}
/**
* Gets offset.
* @param integer $offset Offset
* @return mixed
*/
public function offsetGet($offset)
{
return $this->$offset;
}
/**
* Sets value based on offset.
* @param integer $offset Offset
* @param mixed $value Value to be set
* @return void
*/
public function offsetSet($offset, $value)
{
$this->$offset = $value;
}
/**
* Unsets offset.
* @param integer $offset Offset
* @return void
*/
public function offsetUnset($offset)
{
unset($this->$offset);
}
/**
* Gets the string presentation of the object
* @return string
*/
public function __toString()
{
if (defined('JSON_PRETTY_PRINT')) {
return json_encode(\BrightpearlApiClient\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
} else {
return json_encode(\BrightpearlApiClient\ObjectSerializer::sanitizeForSerialization($this));
}
}
}
|
{
"content_hash": "985a2e1083389562a0f95a5e99230666",
"timestamp": "",
"source": "github",
"line_count": 782,
"max_line_length": 123,
"avg_line_length": 24.34143222506394,
"alnum_prop": 0.5535066981875493,
"repo_name": "annex-apps/tenant-bundle",
"id": "fdcb05f93f35d7398b31ebab08fe7eadf2f0ee31",
"size": "19035",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "BrightpearlApiClient/lib/Model/Product.php",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "26289"
},
{
"name": "HTML",
"bytes": "53422"
},
{
"name": "JavaScript",
"bytes": "232783"
},
{
"name": "PHP",
"bytes": "2334814"
}
],
"symlink_target": ""
}
|
using Daytona;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace TestHelpers
{
public class Serializer : ISerializer
{
Encoding encoding;
public Serializer(Encoding encoding)
{
this.encoding = encoding;
}
public byte[] GetBuffer<T>(T message)
{
return encoding.GetBytes(this.Serialize<T>(message));
}
private string Serialize<T>(T message)
{
return JsonConvert.SerializeObject(message, Formatting.None);
}
public T Deserializer<T>(byte[] input)
{
return JsonConvert.DeserializeObject<T>(this.encoding.GetString(input));
}
public object Deserializer(byte[] input, Type type)
{
return JsonConvert.DeserializeObject(this.encoding.GetString(input), type);
}
public string GetString(byte[] buffer)
{
return encoding.GetString(buffer);
}
public string GetString<T>(T message)
{
return this.Serialize(message);
}
public T Deserializer<T>(string input)
{
return JsonConvert.DeserializeObject<T>(input);
}
//public bool TryDeserializer<T>(byte[] inputBuffer, out T result)
//{
// try
// {
// result = Deserializer<T>(inputBuffer);
// }
// catch
// {
// result = default(T);
// return false;
// }
// return false;
//}
public Encoding Encoding
{
get { return this.encoding; }
}
public object Deserializer(string input, Type type)
{
throw new NotImplementedException();
}
}
}
|
{
"content_hash": "1d1069cfbedeab73b04fc4d8e9ddd12a",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 87,
"avg_line_length": 23.70886075949367,
"alnum_prop": 0.5339028296849974,
"repo_name": "yonglehou/Daytona",
"id": "3042bc57b84b127cbfb25020b6631cec3dcce007",
"size": "1875",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/TestHelpers/Serializer.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "394462"
},
{
"name": "F#",
"bytes": "187"
}
],
"symlink_target": ""
}
|
<!DOCTYPE html>
<head>
<meta chartset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Scott Mebberson">
<title>scottmebberson.com</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link href="http://fonts.googleapis.com/css?family=Snippet" rel="stylesheet" type="text/css">
<link href="http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="/css/styles-flexbox.css?v=4" type="text/css" media="screen">
<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script>try{Typekit.load();}catch(e){}</script>
<script>
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-33401748-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body>
<header>
<div class="row">
<h1>scottmebberson.com</h1>
<nav>
<ul>
<li><a href="/">Home</a></li>
<li><a href="/posts/">Posts</a></li>
<li><a href="/examples/">Examples</a></li>
<li><a href="/resume/">Resume</a></li>
</ul>
</nav>
</div>
</header>
<div class="page">
<header>
<div class="row">
<h1>HTML parser written in PEG.</h1>
</div>
</header>
<div class="content">
<article><p>I've been introducing myself and experimenting with the concept of creating my own programming language. Not a real one of course, but something more like CoffeeScript or SASS which compiles down to another language.</p>
<p>Rather than using <a href="http://zaach.github.com/jison/">Jison</a> (which <a href="http://coffeescript.org/">CoffeeScript</a> was built using) I've decided to settle for something called <a href="http://canopy.jcoglan.com/">Canopy</a>. <a href="http://canopy.jcoglan.com/">Canopy</a> is a JavaScript <a href="http://en.wikipedia.org/wiki/Parsing_expression_grammar">PEG</a> parser compiler and differs from <a href="http://zaach.github.com/jison/">Jison</a> in that it doesn't actually handle the processing of a resulting tree, it just spits out the tree. I really like the concept of separating the expressions from the types.</p>
<p>I threw together a quick example to demonstrate how to write a nested expression using PEG. I settled on a really basic HTML parser, <a href="https://github.com/smebberson/peg-html-parser">which you can check out on GitHub</a>. I've only taken it as far as the tree, I haven't written any JavaScript to manipulate the resulting tree as yet.</p>
<p>Here is the PEG grammar, which Canopy takes and turns into a JavaScript file which you can run in Node (or Rhino) or the browser.</p>
<pre><code>grammar HTML
document <span class="tag"><<span class="title">-</span> (<span class="attribute">doctype</span> / <span class="attribute">text</span> / <span class="attribute">tag</span>)*
<span class="attribute">tag</span> <<span class="attribute">-</span> <span class="attribute">open_tag</span> (<span class="attribute">text</span> / <span class="attribute">tag</span>)* <span class="attribute">close_tag</span>
<span class="attribute">open_tag</span> <<span class="attribute">-</span> "<" [<span class="attribute">0-9a-zA-Z</span> \"'=<span class="value">-]+</span> "></span>"
close_tag <span class="tag"><<span class="title">-</span> "</" [<span class="attribute">0-9a-zA-Z</span>]+ "></span>"
doctype <span class="tag"><<span class="title">-</span> "<!<span class="attribute">DOCTYPE</span> " [<span class="attribute">0-9a-zA-Z</span>]+ "></span>"
text <span class="tag"><<span class="title">-</span> [^<]+</code></pre>
</article>
</div>
</div>
<footer></footer>
</body></html>
|
{
"content_hash": "80131e49452298f7854f0cd0490b1b13",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 645,
"avg_line_length": 69.83870967741936,
"alnum_prop": 0.6478060046189377,
"repo_name": "codeyash/plugins",
"id": "43759cc3ab22772a71cddf33dbd37d9d50314988",
"size": "4330",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "PyPlugins/PhpParser/py/test/css.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "450"
},
{
"name": "C",
"bytes": "62857"
},
{
"name": "C++",
"bytes": "42596272"
},
{
"name": "CSS",
"bytes": "21695"
},
{
"name": "HTML",
"bytes": "120339"
},
{
"name": "Makefile",
"bytes": "51465"
},
{
"name": "PHP",
"bytes": "28439"
},
{
"name": "Prolog",
"bytes": "682"
},
{
"name": "Python",
"bytes": "71650"
},
{
"name": "QMake",
"bytes": "31355"
},
{
"name": "Shell",
"bytes": "3618"
},
{
"name": "XSLT",
"bytes": "2553"
}
],
"symlink_target": ""
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.