text
stringlengths 2
1.04M
| meta
dict |
---|---|
package com.thinkgem.jeesite.modules.sys.web;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.shiro.authz.UnauthorizedException;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.web.util.WebUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import com.google.common.collect.Maps;
import com.thinkgem.jeesite.common.config.Global;
import com.thinkgem.jeesite.common.security.shiro.session.SessionDAO;
import com.thinkgem.jeesite.common.servlet.ValidateCodeServlet;
import com.thinkgem.jeesite.common.utils.CacheUtils;
import com.thinkgem.jeesite.common.utils.CookieUtils;
import com.thinkgem.jeesite.common.utils.IdGen;
import com.thinkgem.jeesite.common.utils.StringUtils;
import com.thinkgem.jeesite.common.web.BaseController;
import com.thinkgem.jeesite.modules.sys.security.FormAuthenticationFilter;
import com.thinkgem.jeesite.modules.sys.security.SystemAuthorizingRealm.Principal;
import com.thinkgem.jeesite.modules.sys.utils.UserUtils;
/**
* 登录Controller
* @author ThinkGem
* @version 2013-5-31
*/
@Controller
public class LoginController extends BaseController{
@Autowired
private SessionDAO sessionDAO;
/**
* 管理登录
*/
@RequestMapping(value = "${adminPath}/login", method = RequestMethod.GET)
public String login(HttpServletRequest request, HttpServletResponse response, Model model) {
Principal principal = UserUtils.getPrincipal();
// // 默认页签模式
// String tabmode = CookieUtils.getCookie(request, "tabmode");
// if (tabmode == null){
// CookieUtils.setCookie(response, "tabmode", "1");
// }
if (logger.isDebugEnabled()){
logger.debug("login, active session size: {}", sessionDAO.getActiveSessions(false).size());
}
// 如果已登录,再次访问主页,则退出原账号。
if (Global.TRUE.equals(Global.getConfig("notAllowRefreshIndex"))){
CookieUtils.setCookie(response, "LOGINED", "false");
}
// 如果已经登录,则跳转到管理首页
if(principal != null && !principal.isMobileLogin()){
return "redirect:" + adminPath;
}
// String view;
// view = "/WEB-INF/views/modules/sys/sysLogin.jsp";
// view = "classpath:";
// view += "jar:file:/D:/GitHub/jeesite/src/main/webapp/WEB-INF/lib/jeesite.jar!";
// view += "/"+getClass().getName().replaceAll("\\.", "/").replace(getClass().getSimpleName(), "")+"view/sysLogin";
// view += ".jsp";
return "modules/sys/sysLogin";
}
/**
* 登录失败,真正登录的POST请求由Filter完成
*/
@RequestMapping(value = "${adminPath}/login", method = RequestMethod.POST)
public String loginFail(HttpServletRequest request, HttpServletResponse response, Model model) {
Principal principal = UserUtils.getPrincipal();
// 如果已经登录,则跳转到管理首页
if(principal != null){
return "redirect:" + adminPath;
}
String username = WebUtils.getCleanParam(request, FormAuthenticationFilter.DEFAULT_USERNAME_PARAM);
boolean rememberMe = WebUtils.isTrue(request, FormAuthenticationFilter.DEFAULT_REMEMBER_ME_PARAM);
boolean mobile = WebUtils.isTrue(request, FormAuthenticationFilter.DEFAULT_MOBILE_PARAM);
String exception = (String)request.getAttribute(FormAuthenticationFilter.DEFAULT_ERROR_KEY_ATTRIBUTE_NAME);
String message = (String)request.getAttribute(FormAuthenticationFilter.DEFAULT_MESSAGE_PARAM);
if (StringUtils.isBlank(message) || StringUtils.equals(message, "null")){
message = "用户或密码错误, 请重试.";
}
model.addAttribute(FormAuthenticationFilter.DEFAULT_USERNAME_PARAM, username);
model.addAttribute(FormAuthenticationFilter.DEFAULT_REMEMBER_ME_PARAM, rememberMe);
model.addAttribute(FormAuthenticationFilter.DEFAULT_MOBILE_PARAM, mobile);
model.addAttribute(FormAuthenticationFilter.DEFAULT_ERROR_KEY_ATTRIBUTE_NAME, exception);
model.addAttribute(FormAuthenticationFilter.DEFAULT_MESSAGE_PARAM, message);
if (logger.isDebugEnabled()){
logger.debug("login fail, active session size: {}, message: {}, exception: {}",
sessionDAO.getActiveSessions(false).size(), message, exception);
}
// 非授权异常,登录失败,验证码加1。
if (!UnauthorizedException.class.getName().equals(exception)){
model.addAttribute("isValidateCodeLogin", isValidateCodeLogin(username, true, false));
}
// 验证失败清空验证码
request.getSession().setAttribute(ValidateCodeServlet.VALIDATE_CODE, IdGen.uuid());
// 如果是手机登录,则返回JSON字符串
if (mobile){
return renderString(response, model);
}
return "modules/sys/sysLogin";
}
/**
* 登录成功,进入管理首页
*/
@RequiresPermissions("user")
@RequestMapping(value = "${adminPath}")
public String index(HttpServletRequest request, HttpServletResponse response) {
Principal principal = UserUtils.getPrincipal();
System.out.println("index==="+adminPath);
// 登录成功后,验证码计算器清零
isValidateCodeLogin(principal.getLoginName(), false, true);
if (logger.isDebugEnabled()){
logger.debug("show index, active session size: {}", sessionDAO.getActiveSessions(false).size());
}
// 如果已登录,再次访问主页,则退出原账号。
if (Global.TRUE.equals(Global.getConfig("notAllowRefreshIndex"))){
String logined = CookieUtils.getCookie(request, "LOGINED");
if (StringUtils.isBlank(logined) || "false".equals(logined)){
CookieUtils.setCookie(response, "LOGINED", "true");
}else if (StringUtils.equals(logined, "true")){
UserUtils.getSubject().logout();
return "redirect:" + adminPath + "/login";
}
}
// 如果是手机登录,则返回JSON字符串
if (principal.isMobileLogin()){
return renderString(response, principal);
}
// // 登录成功后,获取上次登录的当前站点ID
// UserUtils.putCache("siteId", StringUtils.toLong(CookieUtils.getCookie(request, "siteId")));
// System.out.println("==========================a");
// try {
// byte[] bytes = com.thinkgem.jeesite.common.utils.FileUtils.readFileToByteArray(
// com.thinkgem.jeesite.common.utils.FileUtils.getFile("c:\\sxt.dmp"));
// UserUtils.getSession().setAttribute("kkk", bytes);
// UserUtils.getSession().setAttribute("kkk2", bytes);
// } catch (Exception e) {
// e.printStackTrace();
// }
//// for (int i=0; i<1000000; i++){
//// //UserUtils.getSession().setAttribute("a", "a");
//// request.getSession().setAttribute("aaa", "aa");
//// }
// System.out.println("==========================b");
return "modules/sys/sysIndex";
}
/**
* 获取主题方案
*/
@RequestMapping(value = "/theme/{theme}")
public String getThemeInCookie(@PathVariable String theme, HttpServletRequest request, HttpServletResponse response){
if (StringUtils.isNotBlank(theme)){
CookieUtils.setCookie(response, "theme", theme);
}else{
theme = CookieUtils.getCookie(request, "theme");
}
return "redirect:"+request.getParameter("url");
}
/**
* 是否是验证码登录
* @param useruame 用户名
* @param isFail 计数加1
* @param clean 计数清零
* @return
*/
@SuppressWarnings("unchecked")
public static boolean isValidateCodeLogin(String useruame, boolean isFail, boolean clean){
Map<String, Integer> loginFailMap = (Map<String, Integer>)CacheUtils.get("loginFailMap");
if (loginFailMap==null){
loginFailMap = Maps.newHashMap();
CacheUtils.put("loginFailMap", loginFailMap);
}
Integer loginFailNum = loginFailMap.get(useruame);
if (loginFailNum==null){
loginFailNum = 0;
}
if (isFail){
loginFailNum++;
loginFailMap.put(useruame, loginFailNum);
}
if (clean){
loginFailMap.remove(useruame);
}
return loginFailNum >= 3;
}
}
| {
"content_hash": "b3422773ea43da6611d7e009c2fcc176",
"timestamp": "",
"source": "github",
"line_count": 216,
"max_line_length": 118,
"avg_line_length": 35.236111111111114,
"alnum_prop": 0.7280252266456445,
"repo_name": "micklai/site",
"id": "c4a2eb398f82b078f602833463bf51d8a36d2fe8",
"size": "8179",
"binary": false,
"copies": "1",
"ref": "refs/heads/mydev",
"path": "src/main/java/com/thinkgem/jeesite/modules/sys/web/LoginController.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ASP",
"bytes": "3753"
},
{
"name": "ApacheConf",
"bytes": "768"
},
{
"name": "Batchfile",
"bytes": "6843"
},
{
"name": "CSS",
"bytes": "1301094"
},
{
"name": "HTML",
"bytes": "2865420"
},
{
"name": "Java",
"bytes": "1703642"
},
{
"name": "JavaScript",
"bytes": "9662532"
},
{
"name": "PHP",
"bytes": "8060"
},
{
"name": "PLSQL",
"bytes": "73251"
},
{
"name": "PLpgSQL",
"bytes": "4280"
}
],
"symlink_target": ""
} |
#ifndef COIN_SOSHADOWDIRECTIONALLIGHT_H
#define COIN_SOSHADOWDIRECTIONALLIGHT_H
#include <Inventor/nodes/SoSubNode.h>
#include <Inventor/nodes/SoDirectionalLight.h>
#include <Inventor/fields/SoSFNode.h>
#include <Inventor/fields/SoSFFloat.h>
#include <Inventor/fields/SoSFVec3f.h>
class COIN_DLL_API SoShadowDirectionalLight : public SoDirectionalLight {
typedef SoDirectionalLight inherited;
SO_NODE_HEADER(SoShadowDirectionalLight);
public:
static void initClass(void);
SoShadowDirectionalLight(void);
virtual void GLRender(SoGLRenderAction * action);
SoSFNode shadowMapScene;
SoSFFloat maxShadowDistance;
SoSFVec3f bboxCenter;
SoSFVec3f bboxSize;
protected:
virtual ~SoShadowDirectionalLight();
};
#endif // !COIN_SOSHADOWDIRECTIONALLIGHT_H
| {
"content_hash": "45429185a60a331b2b07da403bb82fb4",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 73,
"avg_line_length": 24.1875,
"alnum_prop": 0.8010335917312662,
"repo_name": "Alexpux/Coin3D",
"id": "237707578a0605135d1e678614e40a15caad1d2e",
"size": "2505",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "include/Inventor/annex/FXViz/nodes/SoShadowDirectionalLight.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "AppleScript",
"bytes": "3195"
},
{
"name": "C",
"bytes": "1249438"
},
{
"name": "C++",
"bytes": "15341217"
},
{
"name": "CSS",
"bytes": "9092"
},
{
"name": "Emacs Lisp",
"bytes": "15072"
},
{
"name": "Erlang",
"bytes": "1208"
},
{
"name": "Objective-C",
"bytes": "75987"
},
{
"name": "Perl",
"bytes": "118021"
},
{
"name": "Scheme",
"bytes": "65633"
},
{
"name": "Shell",
"bytes": "493506"
}
],
"symlink_target": ""
} |
package com.amazonaws.services.inspector.model.transform;
import javax.annotation.Generated;
import com.amazonaws.SdkClientException;
import com.amazonaws.Request;
import com.amazonaws.http.HttpMethodName;
import com.amazonaws.services.inspector.model.*;
import com.amazonaws.transform.Marshaller;
import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;
/**
* GetTelemetryMetadataRequest Marshaller
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class GetTelemetryMetadataRequestProtocolMarshaller implements Marshaller<Request<GetTelemetryMetadataRequest>, GetTelemetryMetadataRequest> {
private static final OperationInfo SDK_OPERATION_BINDING = OperationInfo.builder().protocol(Protocol.AWS_JSON).requestUri("/")
.httpMethodName(HttpMethodName.POST).hasExplicitPayloadMember(false).hasPayloadMembers(true)
.operationIdentifier("InspectorService.GetTelemetryMetadata").serviceName("AmazonInspector").build();
private final com.amazonaws.protocol.json.SdkJsonProtocolFactory protocolFactory;
public GetTelemetryMetadataRequestProtocolMarshaller(com.amazonaws.protocol.json.SdkJsonProtocolFactory protocolFactory) {
this.protocolFactory = protocolFactory;
}
public Request<GetTelemetryMetadataRequest> marshall(GetTelemetryMetadataRequest getTelemetryMetadataRequest) {
if (getTelemetryMetadataRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
final ProtocolRequestMarshaller<GetTelemetryMetadataRequest> protocolMarshaller = protocolFactory.createProtocolMarshaller(SDK_OPERATION_BINDING,
getTelemetryMetadataRequest);
protocolMarshaller.startMarshalling();
GetTelemetryMetadataRequestMarshaller.getInstance().marshall(getTelemetryMetadataRequest, protocolMarshaller);
return protocolMarshaller.finishMarshalling();
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
}
}
| {
"content_hash": "02266dfedbd75ca30ec3a6735c05a3ca",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 157,
"avg_line_length": 42.19607843137255,
"alnum_prop": 0.7699814126394052,
"repo_name": "dagnir/aws-sdk-java",
"id": "a8fec0669aa1ae53cffc4279e9add80873a16058",
"size": "2732",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "aws-java-sdk-inspector/src/main/java/com/amazonaws/services/inspector/model/transform/GetTelemetryMetadataRequestProtocolMarshaller.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "FreeMarker",
"bytes": "157317"
},
{
"name": "Gherkin",
"bytes": "25556"
},
{
"name": "Java",
"bytes": "165755153"
},
{
"name": "Scilab",
"bytes": "3561"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">大胆天气</string>
<string name="hello_world">Hello world!</string>
<string name="action_settings">Settings</string>
</resources>
| {
"content_hash": "321a604a568442ff6917e813e8b622ae",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 52,
"avg_line_length": 26.75,
"alnum_prop": 0.6682242990654206,
"repo_name": "seujzhang/coolweather",
"id": "ad6a7e3f9034d475169ec76b5778a9159308c7b0",
"size": "222",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "res/values/strings.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "28222"
}
],
"symlink_target": ""
} |
/* *****************************************************************************
* SystemProp.java
* ****************************************************************************/
/* J_LZ_COPYRIGHT_BEGIN *******************************************************
* Copyright 2001-2004 Laszlo Systems, Inc. All Rights Reserved. *
* Use is subject to license terms. *
* J_LZ_COPYRIGHT_END *********************************************************/
import java.util.Map;
public class SystemProp
{
public static Map getProperties() {
return System.getProperties();
}
}
| {
"content_hash": "4eafaa064306b4025e2ed756b964046f",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 80,
"avg_line_length": 35.5,
"alnum_prop": 0.3333333333333333,
"repo_name": "pkang/leftplayer",
"id": "35d807f959c1830ffc060352e2cdeff9cb80475c",
"size": "639",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/lps-4.9.0/Server/lps-4.9.0/WEB-INF/classes/SystemProp.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ActionScript",
"bytes": "808616"
},
{
"name": "Emacs Lisp",
"bytes": "2939"
},
{
"name": "Java",
"bytes": "53157"
},
{
"name": "JavaScript",
"bytes": "5758911"
},
{
"name": "Perl",
"bytes": "39882"
},
{
"name": "Shell",
"bytes": "365"
},
{
"name": "VimL",
"bytes": "5773"
}
],
"symlink_target": ""
} |
<?php
namespace App\Test\Fixture;
use Cake\TestSuite\Fixture\TestFixture;
/**
* ReceivedMessagesFixture
*
*/
class ReceivedMessagesFixture extends TestFixture
{
/**
* Fields
*
* @var array
*/
// @codingStandardsIgnoreStart
public $fields = [
'id' => ['type' => 'integer', 'length' => null, 'unsigned' => false, 'null' => false, 'default' => null, 'autoIncrement' => true, 'precision' => null, 'comment' => null],
'phonenumber' => ['type' => 'string', 'length' => 25, 'null' => true, 'default' => null, 'precision' => null, 'comment' => null, 'fixed' => null],
'message' => ['type' => 'string', 'length' => 160, 'null' => true, 'default' => null, 'precision' => null, 'comment' => null, 'fixed' => null],
'status' => ['type' => 'string', 'length' => 255, 'null' => true, 'default' => null, 'precision' => null, 'comment' => null, 'fixed' => null],
'datereceived' => ['type' => 'datetime', 'length' => null, 'null' => true, 'default' => null, 'precision' => null, 'comment' => null],
'_constraints' => [
'primary' => ['type' => 'primary', 'columns' => ['id'], 'length' => []],
],
];
// @codingStandardsIgnoreEnd
/**
* Records
*
* @var array
*/
public $records = [
[
'id' => 1,
'phonenumber' => 'Lorem ipsum dolor sit a',
'message' => 'Lorem ipsum dolor sit amet',
'status' => 'Lorem ipsum dolor sit amet',
'datereceived' => '2015-11-24 19:51:59'
],
];
}
| {
"content_hash": "5b06fb4bb7e375ffa62177fd9851ddb6",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 178,
"avg_line_length": 35,
"alnum_prop": 0.5098412698412699,
"repo_name": "ashleyhindle/mysmsisonfire",
"id": "6782f6404a28767a29a6e25fba9508e60170d6d9",
"size": "1575",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tests/Fixture/ReceivedMessagesFixture.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "130"
},
{
"name": "Batchfile",
"bytes": "967"
},
{
"name": "PHP",
"bytes": "93287"
},
{
"name": "Shell",
"bytes": "1354"
}
],
"symlink_target": ""
} |
<bill session="110" type="h" number="3940" updated="2009-01-09T01:05:55-05:00">
<status><introduced date="1193112000" datetime="2007-10-23"/></status>
<introduced date="1193112000" datetime="2007-10-23"/>
<titles>
<title type="official" as="introduced">To amend the Deficit Reduction Act of 2005.</title>
</titles>
<sponsor id="412215"/>
<cosponsors>
<cosponsor id="412214" joined="2007-10-23"/>
<cosponsor id="400316" joined="2007-10-23"/>
<cosponsor id="400259" joined="2007-10-23"/>
<cosponsor id="400299" joined="2007-10-23"/>
</cosponsors>
<actions>
<action date="1193112000" datetime="2007-10-23"><text>Referred to the House Committee on Energy and Commerce.</text></action>
<action date="1193198400" datetime="2007-10-24"><text>Referred to the Subcommittee on Health.</text></action>
</actions>
<committees>
</committees>
<relatedbills>
</relatedbills>
<subjects>
</subjects>
<amendments>
</amendments>
<summary>
10/23/2007--Introduced.<br/>Amends the Deficit Reduction Act of 2005 to require the Secretary of Health and Human Services to promulgate final regulations revising case management and targeted case management under title XIX (Medicaid) of the Social Security Act. (Currently, such regulations may be effective and final immediately on an interim basis as of their publication date.)<br/>Requires such regulations to be consistent with: (1) federal rule making notice and comment requirements, except that the period of public comment on them shall be at least 80 days; and (2) congressional review requirements.<br/>Makes the regulations effective at least 90 days after publication in the Federal Register or presentation to each chamber or the Comptroller General, whichever occurs later.<br/>Repeals the Secretary's authority to change or revise such regulations after completion of the comment period.<br/>
</summary>
</bill>
| {
"content_hash": "9e98426dea86fc7426f5e8fed78210ae",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 911,
"avg_line_length": 55.55882352941177,
"alnum_prop": 0.7527792482795129,
"repo_name": "hashrocket/localpolitics.in",
"id": "7f82cbf2cb99977aabe5c5475eafabc3c99c7c4f",
"size": "1889",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "public/govtrack/110_bills/h3940.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "155887"
},
{
"name": "Ruby",
"bytes": "147059"
}
],
"symlink_target": ""
} |
var _ = require('lodash'),
config = require('../../config'),
nodeEnv = process.env.NODE_ENV || 'development',
dbEnv,
Bookshelf;
dbEnv = config.get(nodeEnv).database;
var knex = require('knex')(dbEnv);
Bookshelf = require('bookshelf')(knex);
// Load the bookshelf registry plugin, which helps us avoid circular dependencies
Bookshelf.plugin('registry');
// base Model 不能携带函数 只能这样
module.exports = Bookshelf;
| {
"content_hash": "f6bb46562482abc4c51db2c116b1212e",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 81,
"avg_line_length": 25.88235294117647,
"alnum_prop": 0.6727272727272727,
"repo_name": "qimuyunduan/blogme",
"id": "1a97f06abde97af8efbc6f61631f4c20176b83ec",
"size": "477",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "core/server/models/base/index.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "58096"
},
{
"name": "HTML",
"bytes": "248975"
},
{
"name": "JavaScript",
"bytes": "514044"
}
],
"symlink_target": ""
} |
/* 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 org.flowable.rest.service.api.management;
import org.flowable.engine.ManagementService;
import org.flowable.engine.common.api.FlowableObjectNotFoundException;
import org.flowable.engine.common.api.management.TableMetaData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import io.swagger.annotations.Authorization;
/**
* @author Frederik Heremans
*/
@RestController
@Api(tags = { "Database tables" }, description = "Manage Database tables", authorizations = { @Authorization(value = "basicAuth") })
public class TableColumnsResource {
@Autowired
protected ManagementService managementService;
@ApiOperation(value = "Get column info for a single table", tags = { "Database tables" })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "Indicates the table exists and the table column info is returned."),
@ApiResponse(code = 404, message = "Indicates the requested table does not exist.")
})
@GetMapping(value = "/management/tables/{tableName}/columns", produces = "application/json")
public TableMetaData getTableMetaData(@ApiParam(name = "tableName") @PathVariable String tableName) {
TableMetaData response = managementService.getTableMetaData(tableName);
if (response == null) {
throw new FlowableObjectNotFoundException("Could not find a table with name '" + tableName + "'.", String.class);
}
return response;
}
}
| {
"content_hash": "8787ab32ae14c285d3e2d202171751b6",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 132,
"avg_line_length": 43.836363636363636,
"alnum_prop": 0.7498963085856492,
"repo_name": "gro-mar/flowable-engine",
"id": "030047ff150d986df39a52d103717fdeab626dbb",
"size": "2411",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "modules/flowable-rest/src/main/java/org/flowable/rest/service/api/management/TableColumnsResource.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ApacheConf",
"bytes": "96556"
},
{
"name": "Batchfile",
"bytes": "166"
},
{
"name": "CSS",
"bytes": "657911"
},
{
"name": "HTML",
"bytes": "864813"
},
{
"name": "Java",
"bytes": "21964973"
},
{
"name": "JavaScript",
"bytes": "12440227"
},
{
"name": "Shell",
"bytes": "9556"
}
],
"symlink_target": ""
} |
<?php
namespace MainBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* WebsiteRapport
*
* @ORM\Table(name="websiteRapport", uniqueConstraints={@ORM\UniqueConstraint(name="type_rapport", columns={"type_rapport"})})
* @ORM\Entity
*/
class WebsiteRapport
{
/**
* @var integer
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="titre", type="string", length=60, nullable=false)
*/
private $titre;
/**
* @var \DateTime
*
* @ORM\Column(name="date_publication", type="datetime", nullable=false)
*/
private $datePublication;
/**
* @var string
*
* @ORM\Column(name="auteur", type="string", length=80, nullable=false)
*/
private $auteur;
/**
* @var \MainBundle\Entity\WebsiteTypeRapport
*
* @ORM\ManyToOne(targetEntity="MainBundle\Entity\WebsiteTypeRapport")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="type_rapport", referencedColumnName="id")
* })
*/
private $typeRapport;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set titre
*
* @param string $titre
*
* @return WebsiteRapport
*/
public function setTitre($titre)
{
$this->titre = $titre;
return $this;
}
/**
* Get titre
*
* @return string
*/
public function getTitre()
{
return $this->titre;
}
/**
* Set datePublication
*
* @param \DateTime $datePublication
*
* @return WebsiteRapport
*/
public function setDatePublication($datePublication)
{
$this->datePublication = $datePublication;
return $this;
}
/**
* Get datePublication
*
* @return \DateTime
*/
public function getDatePublication()
{
return $this->datePublication;
}
/**
* Set auteur
*
* @param string $auteur
*
* @return WebsiteRapport
*/
public function setAuteur($auteur)
{
$this->auteur = $auteur;
return $this;
}
/**
* Get auteur
*
* @return string
*/
public function getAuteur()
{
return $this->auteur;
}
/**
* Set typeRapport
*
* @param \MainBundle\Entity\WebsiteTypeRapport $typeRapport
*
* @return WebsiteRapport
*/
public function setTypeRapport(\MainBundle\Entity\WebsiteTypeRapport $typeRapport = null)
{
$this->typeRapport = $typeRapport;
return $this;
}
/**
* Get typeRapport
*
* @return \MainBundle\Entity\WebsiteTypeRapport
*/
public function getTypeRapport()
{
return $this->typeRapport;
}
}
| {
"content_hash": "d7e8b563ccd563a3cd08c52f7a96fc3b",
"timestamp": "",
"source": "github",
"line_count": 162,
"max_line_length": 126,
"avg_line_length": 18.037037037037038,
"alnum_prop": 0.5431211498973306,
"repo_name": "mounissa/RembWebSite",
"id": "192fb3aa0e0d9ac4effbf6ba5732cbb6ccd6bb3c",
"size": "2922",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/MainBundle/Entity/WebsiteRapport.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "3605"
},
{
"name": "CSS",
"bytes": "552182"
},
{
"name": "HTML",
"bytes": "7085060"
},
{
"name": "JavaScript",
"bytes": "1427239"
},
{
"name": "PHP",
"bytes": "508688"
}
],
"symlink_target": ""
} |
package org.robolectric.internal.dependency;
import static java.nio.charset.StandardCharsets.UTF_8;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.net.URL;
import java.util.Date;
import java.util.zip.CRC32;
public class CachedDependencyResolver implements DependencyResolver {
private final static String CACHE_PREFIX = "localArtifactUrl";
private final DependencyResolver dependencyResolver;
private final CacheNamingStrategy cacheNamingStrategy;
private final CacheValidationStrategy cacheValidationStrategy;
private final Cache cache;
public CachedDependencyResolver(DependencyResolver dependencyResolver, File cacheDir, long cacheValidTime) {
this(dependencyResolver, new FileCache(cacheDir, cacheValidTime), new DefaultCacheNamingStrategy(), new DefaultCacheValidationStrategy());
}
public CachedDependencyResolver(DependencyResolver dependencyResolver, Cache cache, CacheNamingStrategy cacheNamingStrategy, CacheValidationStrategy cacheValidationStrategy) {
this.dependencyResolver = dependencyResolver;
this.cache = cache;
this.cacheNamingStrategy = cacheNamingStrategy;
this.cacheValidationStrategy = cacheValidationStrategy;
}
@Override
public URL getLocalArtifactUrl(DependencyJar dependency) {
final String cacheName = cacheNamingStrategy.getName(CACHE_PREFIX, dependency);
final URL urlFromCache = cache.load(cacheName, URL.class);
if (urlFromCache != null && cacheValidationStrategy.isValid(urlFromCache)) {
return urlFromCache;
}
final URL url = dependencyResolver.getLocalArtifactUrl(dependency);
cache.write(cacheName, url);
return url;
}
interface CacheNamingStrategy {
String getName(String prefix, DependencyJar... dependencies);
}
interface CacheValidationStrategy {
boolean isValid(URL url);
boolean isValid(URL[] urls);
}
static class DefaultCacheValidationStrategy implements CacheValidationStrategy {
@Override
public boolean isValid(URL url) {
return new File(url.getPath()).exists();
}
@Override
public boolean isValid(URL[] urls) {
for (URL url : urls) {
if (!isValid(url)) {
return false;
}
}
return true;
}
}
static class DefaultCacheNamingStrategy implements CacheNamingStrategy {
@Override public String getName(String prefix, DependencyJar... dependencies) {
StringBuilder sb = new StringBuilder();
sb.append(prefix)
.append("#");
for (DependencyJar dependency : dependencies) {
sb.append(dependency.getGroupId())
.append(":")
.append(dependency.getArtifactId())
.append(":")
.append(dependency.getVersion())
.append(",");
}
CRC32 crc = new CRC32();
crc.update(sb.toString().getBytes(UTF_8));
return crc.getValue() + "";
}
}
interface Cache {
<T extends Serializable> T load(String id, Class<T> type);
<T extends Serializable> boolean write(String id, T object);
}
static class FileCache implements Cache {
private final File dir;
private final long validTime;
FileCache(File dir, long validTime) {
this.dir = dir;
this.validTime = validTime;
}
@Override
public <T extends Serializable> T load(String id, Class<T> type) {
try {
File file = new File(dir, id);
if (!file.exists() || validTime > 0 && file.lastModified() < new Date().getTime() - validTime) {
return null;
}
try (ObjectInputStream in = new ObjectInputStream(new FileInputStream(file))) {
Object o = in.readObject();
return o.getClass() == type ? (T) o : null;
}
} catch (IOException | ClassNotFoundException e) {
return null;
}
}
@Override
public <T extends Serializable> boolean write(String id, T object) {
try {
try (ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(new File(dir, id)))) {
out.writeObject(object);
return true;
}
} catch (IOException e) {
return false;
}
}
}
}
| {
"content_hash": "45233917a035afdf4092325255e2e91e",
"timestamp": "",
"source": "github",
"line_count": 141,
"max_line_length": 177,
"avg_line_length": 30.70921985815603,
"alnum_prop": 0.6863741339491917,
"repo_name": "ocadotechnology/robolectric",
"id": "4a846c5e570fed323e45885f3827eba572404e27",
"size": "4330",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "robolectric/src/main/java/org/robolectric/internal/dependency/CachedDependencyResolver.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Groovy",
"bytes": "27193"
},
{
"name": "Java",
"bytes": "3979172"
},
{
"name": "Ruby",
"bytes": "9110"
},
{
"name": "Shell",
"bytes": "11175"
}
],
"symlink_target": ""
} |
using System.Collections.Generic;
namespace StockportContentApi.Config
{
public class RedirectBusinessIds
{
public List<string> BusinessIds { get; }
public RedirectBusinessIds(List<string> businessIds)
{
BusinessIds = businessIds;
}
}
}
| {
"content_hash": "3ade380774c6b5e4a8941ab2d90ca71f",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 60,
"avg_line_length": 21.142857142857142,
"alnum_prop": 0.6452702702702703,
"repo_name": "smbc-digital/iag-contentapi",
"id": "fabc0af07811379349c70268ea988f5eed87bd34",
"size": "298",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/StockportContentApi/Config/RedirectBusinessIds.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "1037882"
},
{
"name": "Makefile",
"bytes": "627"
}
],
"symlink_target": ""
} |
class Sereth::Templates < ApplicationController
# Run user-configured access controls to check the template is accessible from this context
before_filter do
@templates = params['templates']
@templates = [templates] if !templates.is_a?(Array)
return if !TemplateManager.access?
return TemplateManager.check_access(@templates, params['action'])
end
# Render the requested templates
def show
render :text => TemplateManager.get(@templates), :content_type => 'application/javascript'
end
end | {
"content_hash": "2b7b00e6ece906e6cb511b0f7af148e9",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 94,
"avg_line_length": 37.142857142857146,
"alnum_prop": 0.7423076923076923,
"repo_name": "TikiTDO/sereth_rtm",
"id": "fb517bd81563b21a3a89be3c967ac23217104601",
"size": "603",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/controllers/templates_controller.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CoffeeScript",
"bytes": "11436"
},
{
"name": "JavaScript",
"bytes": "246"
},
{
"name": "Ruby",
"bytes": "55846"
}
],
"symlink_target": ""
} |
package com.adaptris.core;
import static com.adaptris.core.util.LoggingHelper.friendlyName;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* <p>
* Default implementation of <code>ComponentState</code>. Each default method
* implementation does nothing other than request the same operation on any
* <code>StateManagedComponent</code>s which are sub-components of
* <code>comp</code>. This is required if for example an Adapter is started and
* one of its Channels is stopped. <code>requestStart</code> has nothing to do
* at the Adapter level but must still be propogated to the stopped Channel
* which does require manipulation.
* </p>
*/
public abstract class ComponentStateImp implements ComponentState {
private static final long serialVersionUID = 2012022101L;
protected transient Logger log = LoggerFactory.getLogger(this.getClass().getName());
/**
* @see ComponentState#requestInit (com.adaptris.core.StateManagedComponent)
*/
@Override
public void requestInit(StateManagedComponent comp) throws CoreException {
if (comp instanceof StateManagedComponentContainer) {
((StateManagedComponentContainer) comp).requestChildInit();
}
}
/**
* @see ComponentState#requestStart (com.adaptris.core.StateManagedComponent)
*/
@Override
public void requestStart(StateManagedComponent comp) throws CoreException {
if (comp instanceof StateManagedComponentContainer) {
((StateManagedComponentContainer) comp).requestChildStart();
}
}
/**
* @see ComponentState#requestStop (com.adaptris.core.StateManagedComponent)
*/
@Override
public void requestStop(StateManagedComponent comp) {
if (comp instanceof StateManagedComponentContainer) {
((StateManagedComponentContainer) comp).requestChildStop();
}
}
/**
* @see ComponentState#requestClose (com.adaptris.core.StateManagedComponent)
*/
@Override
public void requestClose(StateManagedComponent comp) {
if (comp instanceof StateManagedComponentContainer) {
((StateManagedComponentContainer) comp).requestChildClose();
}
}
/** @see java.lang.Object#toString() */
@Override
public String toString() {
return this.getClass().getSimpleName();
}
/**
* @see ComponentState#requestRestart(com.adaptris.core.StateManagedComponent)
*/
@Override
public void requestRestart(StateManagedComponent comp) throws CoreException {
synchronized (comp) {
requestClose(comp);
comp.retrieveComponentState().requestStart(comp);
}
}
void logActivity(String action, StateManagedComponent comp) {
log.trace("{} [{}]", action, friendlyName(comp));
}
boolean continueRequest(StateManagedComponent comp, ComponentState state) {
boolean result = false;
if (comp.retrieveComponentState().equals(state)) {
result = true;
}
else {
log.trace("State Change detected; [{}] now [{}], not [{}]", friendlyName(comp), comp.retrieveComponentState(), state);
}
return result;
}
}
| {
"content_hash": "0d4b0fdf9be9e04050a9b5243eed1eb1",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 124,
"avg_line_length": 31.489583333333332,
"alnum_prop": 0.727423089646047,
"repo_name": "adaptris/interlok",
"id": "65aa16dbf2c99587fa2b3fb18b7b505066564080",
"size": "3621",
"binary": false,
"copies": "2",
"ref": "refs/heads/develop",
"path": "interlok-core/src/main/java/com/adaptris/core/ComponentStateImp.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "10170655"
},
{
"name": "TSQL",
"bytes": "12790"
},
{
"name": "XSLT",
"bytes": "98810"
}
],
"symlink_target": ""
} |
package edu.uib.info310.model.factory;
import org.springframework.stereotype.Controller;
import edu.uib.info310.model.Artist;
import edu.uib.info310.model.Event;
import edu.uib.info310.model.Record;
import edu.uib.info310.model.Track;
import edu.uib.info310.model.imp.ArtistImpl;
import edu.uib.info310.model.imp.EventImpl;
import edu.uib.info310.model.imp.RecordImp;
import edu.uib.info310.model.imp.TrackImp;
@Controller
public class ModelFactoryImpl implements ModelFactory {
public ModelFactoryImpl(){
}
public Artist createArtist() {
return new ArtistImpl();
}
public Record createRecord() {
return new RecordImp();
}
public Track createTrack() {
return new TrackImp();
}
public Event createEvent() {
return new EventImpl();
}
}
| {
"content_hash": "e84e68df523f6cfc90ff623d00e6e178",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 55,
"avg_line_length": 20.675675675675677,
"alnum_prop": 0.7620915032679738,
"repo_name": "EivindEE/SemFM",
"id": "b2ecfdcb93cd510976e278601734f8751ee83fd0",
"size": "765",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/edu/uib/info310/model/factory/ModelFactoryImpl.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "204278"
},
{
"name": "JavaScript",
"bytes": "4511"
},
{
"name": "XML",
"bytes": "15752"
}
],
"symlink_target": ""
} |
// nodejs base
var os = require("os");
var fs = require("fs");
var util = require('util');
var path = require('path');
var url = require("url");
// requires npm install
var express = require('express');
var uuid = require('node-uuid');
var bodyParser = require('body-parser');
exports.start = function (port, dbManager) {
var app = express();
app.listen(port, function () {
console.log("ldb running at http://localhost:" + port + "/\n");
});
app.use(bodyParser.json()); // for parsing application/json
app.use(bodyParser.urlencoded({ extended: true })); // for parsing application/x-www-form-urlencoded
app.use(function (req, res, next) {
// cross origin
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, x-timeout-in-sec");
res.header("Access-Control-Allow-Methods", "GET,PUT,POST,DELETE");
// no cache
res.header('Cache-Control', 'private, no-cache, no-store, must-revalidate');
res.header('Expires', '-1');
res.header('Pragma', 'no-cache');
// response manager
req.responder = require('./responder.js').responder(res);
next();
});
app.use('/', function (req, res, next) {
if (req.method == "OPTIONS") { // deals with firefox
res.json('verb not supported')
return; /* breaks the chain: do not call next() */
}
next();
});
app.use('/', function (req, res, next) {
// for data paths
var isSchemaPath = req.url.startsWith('/schema');
if (!isSchemaPath) {
var decodedUri = url.parse(decodeURI(req.originalUrl));
if (decodedUri.query) {
console.log('query:', decodedUri.query)
var queryArgs = decodedUri.query.split('&');
console.log('queryArgs:', queryArgs);
req.cmd = queryArgs[0];
}
}
next();
});
/// ********************** SCHEMA
app.use('/schema/:dbName', function (req, res, next) {
req.dbName = req.params.dbName;
next();
});
app.use('/schema/:dbName/:tableName', function (req, res, next) {
req.tableName = req.params.tableName;
next();
});
app.get('/schema', function (req) {
dbManager.databaseList(req.responder);
});
app.put('/schema/:dbName', function (req) {
dbManager.databaseCreate(req.responder, req.dbName, req.body);
});
app.delete('/schema/:dbName', function (req) {
dbManager.databaseDrop(req.responder, req.dbName);
});
app.get('/schema/:dbName', function (req) {
dbManager.databaseInfo(req.responder, req.dbName);
});
app.put('/schema/:dbName/:tableName', function (req) {
dbManager.tableCreate(req.responder, req.dbName, req.tableName, req.body);
});
app.delete('/schema/:dbName/:tableName', function (req) {
dbManager.tableDrop(req.responder, req.dbName, req.tableName);
});
app.put('/', function (req) {
if (req.cmd === 'clearCache')
dbManager.clearCache(req.responder);
else
req.responder.error({ status: 405, message: 'invalid database command: ' + req.cmd });
});
/// ********************** DATA
app.get('/:dbName/:tableName', function (req) {
var dbName = req.params.dbName;
var tableName = req.params.tableName;
dbManager.getData(req.responder, dbName, tableName);
});
// LAST FUNCTIONS - global error handler ( else would not be invoked )
app.use('*', function (req, res) {
res.status(404).json('bad route: ' + req.originalUrl);
res.end();
});
app.use(function (err, req, res, next) {
req.responder.error(err);
});
function handleRequestError(req, code, message) {
console.log("[" + code + "]", message, "\n");
var res = shared.pendingRequests[req.socketData.requestId];
res.status(code).json(message);
delete shared.pendingRequests[req.socketData.requestId];
}
function rmdirSync(dir, file) {
var p = file ? path.join(dir, file) : dir;
if (fs.lstatSync(p).isDirectory()) {
fs.readdirSync(p).forEach(rmdirSync.bind(null, p));
fs.rmdirSync(p);
}
else fs.unlinkSync(p);
}
function dumpObjectToDisk(obj, filename) {
var toString = util.inspect(obj, false, null);
fs.writeFile(filename, toString, function (err) {
if (err) {
return console.log(err);
}
console.log("dumpObjectToDisk to '" + filename + "' completed");
});
}
}; | {
"content_hash": "1b7475e3740ad799ce0131bff5a977a9",
"timestamp": "",
"source": "github",
"line_count": 151,
"max_line_length": 119,
"avg_line_length": 31.602649006622517,
"alnum_prop": 0.5666387259010897,
"repo_name": "osslidou/ldb",
"id": "f547d0f3e66187d8495ba2da5e908f4b4b0e0044",
"size": "4772",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "server-rest.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "22425"
}
],
"symlink_target": ""
} |
package com.dinglian.server.chuqulang.dao;
import java.util.List;
import com.dinglian.server.chuqulang.model.Tag;
public interface TagDao extends GenericDao<Tag> {
List<Tag> getTagListByTypeName(String typeName);
} | {
"content_hash": "e5c3d4a194be0a466f04109789633f5d",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 49,
"avg_line_length": 21,
"alnum_prop": 0.7619047619047619,
"repo_name": "fyunxu/chuqulang",
"id": "81a7789817c775059fee57d6c1290ddc8f6d1efb",
"size": "231",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/com/dinglian/server/chuqulang/dao/TagDao.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "204056"
}
],
"symlink_target": ""
} |
init sync | {
"content_hash": "3ef27c11d9257e771b8f23162fbfba78",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 9,
"avg_line_length": 9,
"alnum_prop": 0.8888888888888888,
"repo_name": "tinganho/l10ns",
"id": "c0e8e6f6debbacac97fa5067c725c26800283650",
"size": "9",
"binary": false,
"copies": "1",
"ref": "refs/heads/c++",
"path": "src/Tests/Cases/Projects/Commands_SeveralCommandsError/Command.cmd",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "69"
},
{
"name": "C++",
"bytes": "40049"
},
{
"name": "CMake",
"bytes": "1692"
},
{
"name": "JavaScript",
"bytes": "10"
},
{
"name": "TypeScript",
"bytes": "29322"
}
],
"symlink_target": ""
} |
// Copyright (c) 2012, Event Store LLP
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// Neither the name of the Event Store LLP nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
using System;
using EventStore.Core.Data;
using EventStore.Core.Services.Storage.ReaderIndex;
using NUnit.Framework;
using ReadStreamResult = EventStore.Core.Services.Storage.ReaderIndex.ReadStreamResult;
namespace EventStore.Core.Tests.Services.Storage.MaxAgeMaxCount
{
[TestFixture, Ignore("Metadata must be valid.")]
public class with_invalid_max_count_and_normal_max_age: ReadIndexTestScenario
{
private EventRecord _r1;
private EventRecord _r2;
private EventRecord _r3;
private EventRecord _r4;
private EventRecord _r5;
private EventRecord _r6;
protected override void WriteTestScenario()
{
var now = DateTime.UtcNow;
const string metadata = @"{""$maxAge"":21,""$maxCount"":2.1}";
_r1 = WriteStreamMetadata("ES", 0, metadata);
_r2 = WriteSingleEvent("ES", 0, "bla1", now.AddSeconds(-50));
_r3 = WriteSingleEvent("ES", 1, "bla1", now.AddSeconds(-20));
_r4 = WriteSingleEvent("ES", 2, "bla1", now.AddSeconds(-11));
_r5 = WriteSingleEvent("ES", 3, "bla1", now.AddSeconds(-5));
_r6 = WriteSingleEvent("ES", 4, "bla1", now.AddSeconds(-1));
}
[Test]
public void on_single_event_read_invalid_value_is_ignored()
{
var result = ReadIndex.ReadEvent("ES", 0);
Assert.AreEqual(ReadEventResult.NotFound, result.Result);
Assert.IsNull(result.Record);
result = ReadIndex.ReadEvent("ES", 1);
Assert.AreEqual(ReadEventResult.Success, result.Result);
Assert.AreEqual(_r3, result.Record);
result = ReadIndex.ReadEvent("ES", 2);
Assert.AreEqual(ReadEventResult.Success, result.Result);
Assert.AreEqual(_r4, result.Record);
result = ReadIndex.ReadEvent("ES", 3);
Assert.AreEqual(ReadEventResult.Success, result.Result);
Assert.AreEqual(_r5, result.Record);
result = ReadIndex.ReadEvent("ES", 4);
Assert.AreEqual(ReadEventResult.Success, result.Result);
Assert.AreEqual(_r6, result.Record);
}
[Test]
public void on_forward_range_read_invalid_value_is_ignored()
{
var result = ReadIndex.ReadStreamEventsForward("ES", 0, 100);
Assert.AreEqual(ReadStreamResult.Success, result.Result);
Assert.AreEqual(4, result.Records.Length);
Assert.AreEqual(_r3, result.Records[0]);
Assert.AreEqual(_r4, result.Records[1]);
Assert.AreEqual(_r5, result.Records[2]);
Assert.AreEqual(_r6, result.Records[3]);
}
[Test]
public void on_backward_range_read_invalid_value_is_ignored()
{
var result = ReadIndex.ReadStreamEventsBackward("ES", -1, 100);
Assert.AreEqual(ReadStreamResult.Success, result.Result);
Assert.AreEqual(4, result.Records.Length);
Assert.AreEqual(_r6, result.Records[0]);
Assert.AreEqual(_r5, result.Records[1]);
Assert.AreEqual(_r4, result.Records[2]);
Assert.AreEqual(_r3, result.Records[3]);
}
[Test]
public void on_read_all_forward_both_values_are_ignored()
{
var records = ReadIndex.ReadAllEventsForward(new TFPos(0, 0), 100).Records;
Assert.AreEqual(6, records.Count);
Assert.AreEqual(_r1, records[0].Event);
Assert.AreEqual(_r2, records[1].Event);
Assert.AreEqual(_r3, records[2].Event);
Assert.AreEqual(_r4, records[3].Event);
Assert.AreEqual(_r5, records[4].Event);
Assert.AreEqual(_r6, records[5].Event);
}
[Test]
public void on_read_all_backward_both_values_are_ignored()
{
var records = ReadIndex.ReadAllEventsBackward(GetBackwardReadPos(), 100).Records;
Assert.AreEqual(6, records.Count);
Assert.AreEqual(_r6, records[0].Event);
Assert.AreEqual(_r5, records[1].Event);
Assert.AreEqual(_r4, records[2].Event);
Assert.AreEqual(_r3, records[3].Event);
Assert.AreEqual(_r2, records[4].Event);
Assert.AreEqual(_r1, records[5].Event);
}
}
}
| {
"content_hash": "7c5dc1809fefbae676356b2b5a8f1784",
"timestamp": "",
"source": "github",
"line_count": 134,
"max_line_length": 93,
"avg_line_length": 43.90298507462686,
"alnum_prop": 0.6447390787013428,
"repo_name": "msbahrul/EventStore",
"id": "6d50a4cc225c56e7eaaa8b21f67b9d0d00bf2fcb",
"size": "5885",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/EventStore/EventStore.Core.Tests/Services/Storage/MaxAgeMaxCount/with_invalid_max_count_and_normal_max_age.cs",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Batchfile",
"bytes": "4483"
},
{
"name": "C",
"bytes": "3503"
},
{
"name": "C#",
"bytes": "8749942"
},
{
"name": "C++",
"bytes": "34319"
},
{
"name": "CSS",
"bytes": "7878"
},
{
"name": "HTML",
"bytes": "150447"
},
{
"name": "JavaScript",
"bytes": "4908689"
},
{
"name": "PowerShell",
"bytes": "9755"
},
{
"name": "Protocol Buffer",
"bytes": "5491"
},
{
"name": "Shell",
"bytes": "29478"
}
],
"symlink_target": ""
} |
function setCookie(obj, days)
{
var date=new Date();
var exdays = days*24*60*60*1000;
date.setDate(date.getDate() + exdays);
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
var value = obj[key];
var c_value=escape(value) + ((days==null) ? "" : "; expires="+date.toUTCString());
document.cookie=key + "=" + c_value;
}
}
} // setCookie >setCookie({foo:"bar"}, 4);
function getCookie(c_name)
{
if(arguments.length==0) {
return document.cookie;
}
var i,x,y,ARRcookies=document.cookie.split(';');
for (i=0; i < ARRcookies.length;i++)
{
x=ARRcookies[i].substr(0,ARRcookies[i].indexOf('='));
y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
x=x.replace(/^\s+|\s+$/g,"");
if (x==c_name)
{
return unescape(y);
}
}
return null;
} // getCookie >getCookie("foo"); >getCookie(); [return value or null]
function eraseCookie(c_name) {
document.cookie = c_name + '=; Max-Age=0'
} // eraseCookie >eraseCookie("foo");
function getAllCookies() {
return document.cookie;
} | {
"content_hash": "6d286940629089893a13a953b972fe5c",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 96,
"avg_line_length": 30.238095238095237,
"alnum_prop": 0.5015748031496063,
"repo_name": "Siphon880gh/rapid-tools-suite",
"id": "8b4994df5880c5e62e19049edd7a086f3443385d",
"size": "1270",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "boilerplates/cookies.js",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "Hack",
"bytes": "1752"
},
{
"name": "JavaScript",
"bytes": "144438"
},
{
"name": "PHP",
"bytes": "36754"
}
],
"symlink_target": ""
} |
require 'spec_helper'
require 'erb'
# This feature spec is intended to be a comprehensive exercising of all of
# GitLab's non-standard Markdown parsing and the integration thereof.
#
# These tests should be very high-level. Anything low-level belongs in the specs
# for the corresponding HTML::Pipeline filter or helper method.
#
# The idea is to pass a Markdown document through our entire processing stack.
#
# The process looks like this:
#
# Raw Markdown
# -> `markdown` helper
# -> Redcarpet::Render::GitlabHTML converts Markdown to HTML
# -> Post-process HTML
# -> `gfm_with_options` helper
# -> HTML::Pipeline
# -> Sanitize
# -> RelativeLink
# -> Emoji
# -> Table of Contents
# -> Autolinks
# -> Rinku (http, https, ftp)
# -> Other schemes
# -> ExternalLink
# -> References
# -> TaskList
# -> `html_safe`
# -> Template
#
# See the MarkdownFeature class for setup details.
describe 'GitLab Markdown' do
include ActionView::Helpers::TagHelper
include ActionView::Helpers::UrlHelper
include Capybara::Node::Matchers
include GitlabMarkdownHelper
# `markdown` calls these two methods
def current_user
@feat.user
end
def user_color_scheme_class
:white
end
# Let's only parse this thing once
before(:all) do
@feat = MarkdownFeature.new
# `markdown` expects a `@project` variable
@project = @feat.project
@md = markdown(@feat.raw_markdown)
@doc = Nokogiri::HTML::DocumentFragment.parse(@md)
end
after(:all) do
@feat.teardown
end
# Given a header ID, goes to that element's parent (the header itself), then
# its next sibling element (the body).
def get_section(id)
@doc.at_css("##{id}").parent.next_element
end
# Sometimes it can be useful to see the parsed output of the Markdown document
# for debugging. Uncomment this block to write the output to
# tmp/capybara/markdown_spec.html.
#
# it 'writes to a file' do
# File.open(Rails.root.join('tmp/capybara/markdown_spec.html'), 'w') do |file|
# file.puts @md
# end
# end
describe 'Markdown' do
describe 'No Intra Emphasis' do
it 'does not parse emphasis inside of words' do
body = get_section('no-intra-emphasis')
expect(body.to_html).not_to match('foo<em>bar</em>baz')
end
end
describe 'Tables' do
it 'parses table Markdown' do
body = get_section('tables')
expect(body).to have_selector('th:contains("Header")')
expect(body).to have_selector('th:contains("Row")')
expect(body).to have_selector('th:contains("Example")')
end
it 'allows Markdown in tables' do
expect(@doc.at_css('td:contains("Baz")').children.to_html).
to eq '<strong>Baz</strong>'
end
end
describe 'Fenced Code Blocks' do
it 'parses fenced code blocks' do
expect(@doc).to have_selector('pre.code.highlight.white.c')
expect(@doc).to have_selector('pre.code.highlight.white.python')
end
end
describe 'Strikethrough' do
it 'parses strikethroughs' do
expect(@doc).to have_selector(%{del:contains("and this text doesn't")})
end
end
describe 'Superscript' do
it 'parses superscript' do
body = get_section('superscript')
expect(body.to_html).to match('1<sup>st</sup>')
expect(body.to_html).to match('2<sup>nd</sup>')
end
end
end
describe 'HTML::Pipeline' do
describe 'SanitizationFilter' do
it 'uses a permissive whitelist' do
expect(@doc).to have_selector('b:contains("b tag")')
expect(@doc).to have_selector('em:contains("em tag")')
expect(@doc).to have_selector('code:contains("code tag")')
expect(@doc).to have_selector('kbd:contains("s")')
expect(@doc).to have_selector('strike:contains(Emoji)')
expect(@doc).to have_selector('img[src*="smile.png"]')
expect(@doc).to have_selector('br')
expect(@doc).to have_selector('hr')
end
it 'permits span elements' do
expect(@doc).to have_selector('span:contains("span tag")')
end
it 'permits table alignment' do
expect(@doc.at_css('th:contains("Header")')['style']).to eq 'text-align: center'
expect(@doc.at_css('th:contains("Row")')['style']).to eq 'text-align: right'
expect(@doc.at_css('th:contains("Example")')['style']).to eq 'text-align: left'
expect(@doc.at_css('td:contains("Foo")')['style']).to eq 'text-align: center'
expect(@doc.at_css('td:contains("Bar")')['style']).to eq 'text-align: right'
expect(@doc.at_css('td:contains("Baz")')['style']).to eq 'text-align: left'
end
it 'removes `rel` attribute from links' do
body = get_section('sanitizationfilter')
expect(body).not_to have_selector('a[rel="bookmark"]')
end
it "removes `href` from `a` elements if it's fishy" do
expect(@doc).not_to have_selector('a[href*="javascript"]')
end
end
describe 'Escaping' do
let(:table) { @doc.css('table').last.at_css('tbody') }
it 'escapes non-tag angle brackets' do
expect(table.at_xpath('.//tr[1]/td[3]').inner_html).to eq '1 < 3 & 5'
end
end
describe 'Edge Cases' do
it 'allows markup inside link elements' do
expect(@doc.at_css('a[href="#link-emphasis"]').to_html).
to eq %{<a href="#link-emphasis"><em>text</em></a>}
expect(@doc.at_css('a[href="#link-strong"]').to_html).
to eq %{<a href="#link-strong"><strong>text</strong></a>}
expect(@doc.at_css('a[href="#link-code"]').to_html).
to eq %{<a href="#link-code"><code>text</code></a>}
end
end
describe 'EmojiFilter' do
it 'parses Emoji' do
expect(@doc).to have_selector('img.emoji', count: 10)
end
end
describe 'TableOfContentsFilter' do
it 'creates anchors inside header elements' do
expect(@doc).to have_selector('h1 a#gitlab-markdown')
expect(@doc).to have_selector('h2 a#markdown')
expect(@doc).to have_selector('h3 a#autolinkfilter')
end
end
describe 'AutolinkFilter' do
let(:list) { get_section('autolinkfilter').next_element }
def item(index)
list.at_css("li:nth-child(#{index})")
end
it 'autolinks http://' do
expect(item(1).children.first.name).to eq 'a'
expect(item(1).children.first['href']).to eq 'http://about.gitlab.com/'
end
it 'autolinks https://' do
expect(item(2).children.first.name).to eq 'a'
expect(item(2).children.first['href']).to eq 'https://google.com/'
end
it 'autolinks ftp://' do
expect(item(3).children.first.name).to eq 'a'
expect(item(3).children.first['href']).to eq 'ftp://ftp.us.debian.org/debian/'
end
it 'autolinks smb://' do
expect(item(4).children.first.name).to eq 'a'
expect(item(4).children.first['href']).to eq 'smb://foo/bar/baz'
end
it 'autolinks irc://' do
expect(item(5).children.first.name).to eq 'a'
expect(item(5).children.first['href']).to eq 'irc://irc.freenode.net/git'
end
it 'autolinks short, invalid URLs' do
expect(item(6).children.first.name).to eq 'a'
expect(item(6).children.first['href']).to eq 'http://localhost:3000'
end
%w(code a kbd).each do |elem|
it "ignores links inside '#{elem}' element" do
body = get_section('autolinkfilter')
expect(body).not_to have_selector("#{elem} a")
end
end
end
describe 'ExternalLinkFilter' do
let(:links) { get_section('externallinkfilter').next_element }
it 'adds nofollow to external link' do
expect(links.css('a').first.to_html).to match 'nofollow'
end
it 'ignores internal link' do
expect(links.css('a').last.to_html).not_to match 'nofollow'
end
end
describe 'ReferenceFilter' do
it 'handles references in headers' do
header = @doc.at_css('#reference-filters-eg-1').parent
expect(header.css('a').size).to eq 2
end
it "handles references in Markdown" do
body = get_section('reference-filters-eg-1')
expect(body).to have_selector('em a.gfm-merge_request', count: 1)
end
it 'parses user references' do
body = get_section('userreferencefilter')
expect(body).to have_selector('a.gfm.gfm-project_member', count: 3)
end
it 'parses issue references' do
body = get_section('issuereferencefilter')
expect(body).to have_selector('a.gfm.gfm-issue', count: 2)
end
it 'parses merge request references' do
body = get_section('mergerequestreferencefilter')
expect(body).to have_selector('a.gfm.gfm-merge_request', count: 2)
end
it 'parses snippet references' do
body = get_section('snippetreferencefilter')
expect(body).to have_selector('a.gfm.gfm-snippet', count: 2)
end
it 'parses commit range references' do
body = get_section('commitrangereferencefilter')
expect(body).to have_selector('a.gfm.gfm-commit_range', count: 2)
end
it 'parses commit references' do
body = get_section('commitreferencefilter')
expect(body).to have_selector('a.gfm.gfm-commit', count: 2)
end
it 'parses label references' do
body = get_section('labelreferencefilter')
expect(body).to have_selector('a.gfm.gfm-label', count: 3)
end
end
describe 'Task Lists' do
it 'generates task lists' do
body = get_section('task-lists')
expect(body).to have_selector('ul.task-list', count: 2)
expect(body).to have_selector('li.task-list-item', count: 7)
expect(body).to have_selector('input[checked]', count: 3)
end
end
end
end
# This is a helper class used by the GitLab Markdown feature spec
#
# Because the feature spec only cares about the output of the Markdown, and the
# test setup and teardown and parsing is fairly expensive, we only want to do it
# once. Unfortunately RSpec will not let you access `let`s in a `before(:all)`
# block, so we fake it by encapsulating all the shared setup in this class.
#
# The class renders `spec/fixtures/markdown.md.erb` using ERB, allowing for
# reference to the factory-created objects.
class MarkdownFeature
include FactoryGirl::Syntax::Methods
def initialize
DatabaseCleaner.start
end
def teardown
DatabaseCleaner.clean
end
def user
@user ||= create(:user)
end
def group
unless @group
@group = create(:group)
@group.add_user(user, Gitlab::Access::DEVELOPER)
end
@group
end
# Direct references ----------------------------------------------------------
def project
@project ||= create(:project)
end
def issue
@issue ||= create(:issue, project: project)
end
def merge_request
@merge_request ||= create(:merge_request, :simple, source_project: project)
end
def snippet
@snippet ||= create(:project_snippet, project: project)
end
def commit
@commit ||= project.commit
end
def commit_range
unless @commit_range
commit2 = project.commit('HEAD~3')
@commit_range = CommitRange.new("#{commit.id}...#{commit2.id}", project)
end
@commit_range
end
def simple_label
@simple_label ||= create(:label, name: 'gfm', project: project)
end
def label
@label ||= create(:label, name: 'awaiting feedback', project: project)
end
# Cross-references -----------------------------------------------------------
def xproject
unless @xproject
namespace = create(:namespace, name: 'cross-reference')
@xproject = create(:project, namespace: namespace)
@xproject.team << [user, :developer]
end
@xproject
end
def xissue
@xissue ||= create(:issue, project: xproject)
end
def xmerge_request
@xmerge_request ||= create(:merge_request, :simple, source_project: xproject)
end
def xsnippet
@xsnippet ||= create(:project_snippet, project: xproject)
end
def xcommit
@xcommit ||= xproject.commit
end
def xcommit_range
unless @xcommit_range
xcommit2 = xproject.commit('HEAD~2')
@xcommit_range = CommitRange.new("#{xcommit.id}...#{xcommit2.id}", xproject)
end
@xcommit_range
end
def raw_markdown
fixture = Rails.root.join('spec/fixtures/markdown.md.erb')
ERB.new(File.read(fixture)).result(binding)
end
end
| {
"content_hash": "45c906a302df332f1fb34f2b8320b22e",
"timestamp": "",
"source": "github",
"line_count": 426,
"max_line_length": 88,
"avg_line_length": 29.859154929577464,
"alnum_prop": 0.6175314465408805,
"repo_name": "ayufan/gitlabhq",
"id": "902968cebcb6924bec6ced442c707f7840281942",
"size": "12720",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "spec/features/markdown_spec.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "113464"
},
{
"name": "CoffeeScript",
"bytes": "137544"
},
{
"name": "Cucumber",
"bytes": "117453"
},
{
"name": "HTML",
"bytes": "443277"
},
{
"name": "JavaScript",
"bytes": "29805"
},
{
"name": "Ruby",
"bytes": "2356936"
},
{
"name": "Shell",
"bytes": "14534"
}
],
"symlink_target": ""
} |
package fixtures.http;
import com.microsoft.rest.ServiceCall;
import com.microsoft.rest.ServiceCallback;
import com.microsoft.rest.ServiceException;
import com.microsoft.rest.ServiceResponse;
import fixtures.http.models.A;
import fixtures.http.models.ErrorException;
import fixtures.http.models.MyException;
import java.io.IOException;
import rx.Observable;
/**
* An instance of this class provides access to all the operations defined
* in MultipleResponses.
*/
public interface MultipleResponses {
/**
* Send a 200 response with valid payload: {'statusCode': '200'}.
*
* @throws ErrorException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @return the A object wrapped in {@link ServiceResponse} if successful.
*/
ServiceResponse<A> get200Model204NoModelDefaultError200Valid() throws ErrorException, IOException;
/**
* Send a 200 response with valid payload: {'statusCode': '200'}.
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @return the {@link ServiceCall} object
*/
ServiceCall<A> get200Model204NoModelDefaultError200ValidAsync(final ServiceCallback<A> serviceCallback);
/**
* Send a 200 response with valid payload: {'statusCode': '200'}.
*
* @return the observable to the A object
*/
Observable<ServiceResponse<A>> get200Model204NoModelDefaultError200ValidAsync();
/**
* Send a 204 response with no payload.
*
* @throws ErrorException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @return the A object wrapped in {@link ServiceResponse} if successful.
*/
ServiceResponse<A> get200Model204NoModelDefaultError204Valid() throws ErrorException, IOException;
/**
* Send a 204 response with no payload.
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @return the {@link ServiceCall} object
*/
ServiceCall<A> get200Model204NoModelDefaultError204ValidAsync(final ServiceCallback<A> serviceCallback);
/**
* Send a 204 response with no payload.
*
* @return the observable to the A object
*/
Observable<ServiceResponse<A>> get200Model204NoModelDefaultError204ValidAsync();
/**
* Send a 201 response with valid payload: {'statusCode': '201'}.
*
* @throws ErrorException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @return the A object wrapped in {@link ServiceResponse} if successful.
*/
ServiceResponse<A> get200Model204NoModelDefaultError201Invalid() throws ErrorException, IOException;
/**
* Send a 201 response with valid payload: {'statusCode': '201'}.
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @return the {@link ServiceCall} object
*/
ServiceCall<A> get200Model204NoModelDefaultError201InvalidAsync(final ServiceCallback<A> serviceCallback);
/**
* Send a 201 response with valid payload: {'statusCode': '201'}.
*
* @return the observable to the A object
*/
Observable<ServiceResponse<A>> get200Model204NoModelDefaultError201InvalidAsync();
/**
* Send a 202 response with no payload:.
*
* @throws ErrorException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @return the A object wrapped in {@link ServiceResponse} if successful.
*/
ServiceResponse<A> get200Model204NoModelDefaultError202None() throws ErrorException, IOException;
/**
* Send a 202 response with no payload:.
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @return the {@link ServiceCall} object
*/
ServiceCall<A> get200Model204NoModelDefaultError202NoneAsync(final ServiceCallback<A> serviceCallback);
/**
* Send a 202 response with no payload:.
*
* @return the observable to the A object
*/
Observable<ServiceResponse<A>> get200Model204NoModelDefaultError202NoneAsync();
/**
* Send a 400 response with valid error payload: {'status': 400, 'message': 'client error'}.
*
* @throws ErrorException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @return the A object wrapped in {@link ServiceResponse} if successful.
*/
ServiceResponse<A> get200Model204NoModelDefaultError400Valid() throws ErrorException, IOException;
/**
* Send a 400 response with valid error payload: {'status': 400, 'message': 'client error'}.
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @return the {@link ServiceCall} object
*/
ServiceCall<A> get200Model204NoModelDefaultError400ValidAsync(final ServiceCallback<A> serviceCallback);
/**
* Send a 400 response with valid error payload: {'status': 400, 'message': 'client error'}.
*
* @return the observable to the A object
*/
Observable<ServiceResponse<A>> get200Model204NoModelDefaultError400ValidAsync();
/**
* Send a 200 response with valid payload: {'statusCode': '200'}.
*
* @throws ErrorException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @return the A object wrapped in {@link ServiceResponse} if successful.
*/
ServiceResponse<A> get200Model201ModelDefaultError200Valid() throws ErrorException, IOException;
/**
* Send a 200 response with valid payload: {'statusCode': '200'}.
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @return the {@link ServiceCall} object
*/
ServiceCall<A> get200Model201ModelDefaultError200ValidAsync(final ServiceCallback<A> serviceCallback);
/**
* Send a 200 response with valid payload: {'statusCode': '200'}.
*
* @return the observable to the A object
*/
Observable<ServiceResponse<A>> get200Model201ModelDefaultError200ValidAsync();
/**
* Send a 201 response with valid payload: {'statusCode': '201', 'textStatusCode': 'Created'}.
*
* @throws ErrorException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @return the A object wrapped in {@link ServiceResponse} if successful.
*/
ServiceResponse<A> get200Model201ModelDefaultError201Valid() throws ErrorException, IOException;
/**
* Send a 201 response with valid payload: {'statusCode': '201', 'textStatusCode': 'Created'}.
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @return the {@link ServiceCall} object
*/
ServiceCall<A> get200Model201ModelDefaultError201ValidAsync(final ServiceCallback<A> serviceCallback);
/**
* Send a 201 response with valid payload: {'statusCode': '201', 'textStatusCode': 'Created'}.
*
* @return the observable to the A object
*/
Observable<ServiceResponse<A>> get200Model201ModelDefaultError201ValidAsync();
/**
* Send a 400 response with valid payload: {'code': '400', 'message': 'client error'}.
*
* @throws ErrorException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @return the A object wrapped in {@link ServiceResponse} if successful.
*/
ServiceResponse<A> get200Model201ModelDefaultError400Valid() throws ErrorException, IOException;
/**
* Send a 400 response with valid payload: {'code': '400', 'message': 'client error'}.
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @return the {@link ServiceCall} object
*/
ServiceCall<A> get200Model201ModelDefaultError400ValidAsync(final ServiceCallback<A> serviceCallback);
/**
* Send a 400 response with valid payload: {'code': '400', 'message': 'client error'}.
*
* @return the observable to the A object
*/
Observable<ServiceResponse<A>> get200Model201ModelDefaultError400ValidAsync();
/**
* Send a 200 response with valid payload: {'statusCode': '200'}.
*
* @throws ErrorException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @return the Object object wrapped in {@link ServiceResponse} if successful.
*/
ServiceResponse<Object> get200ModelA201ModelC404ModelDDefaultError200Valid() throws ErrorException, IOException;
/**
* Send a 200 response with valid payload: {'statusCode': '200'}.
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @return the {@link ServiceCall} object
*/
ServiceCall<Object> get200ModelA201ModelC404ModelDDefaultError200ValidAsync(final ServiceCallback<Object> serviceCallback);
/**
* Send a 200 response with valid payload: {'statusCode': '200'}.
*
* @return the observable to the Object object
*/
Observable<ServiceResponse<Object>> get200ModelA201ModelC404ModelDDefaultError200ValidAsync();
/**
* Send a 200 response with valid payload: {'httpCode': '201'}.
*
* @throws ErrorException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @return the Object object wrapped in {@link ServiceResponse} if successful.
*/
ServiceResponse<Object> get200ModelA201ModelC404ModelDDefaultError201Valid() throws ErrorException, IOException;
/**
* Send a 200 response with valid payload: {'httpCode': '201'}.
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @return the {@link ServiceCall} object
*/
ServiceCall<Object> get200ModelA201ModelC404ModelDDefaultError201ValidAsync(final ServiceCallback<Object> serviceCallback);
/**
* Send a 200 response with valid payload: {'httpCode': '201'}.
*
* @return the observable to the Object object
*/
Observable<ServiceResponse<Object>> get200ModelA201ModelC404ModelDDefaultError201ValidAsync();
/**
* Send a 200 response with valid payload: {'httpStatusCode': '404'}.
*
* @throws ErrorException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @return the Object object wrapped in {@link ServiceResponse} if successful.
*/
ServiceResponse<Object> get200ModelA201ModelC404ModelDDefaultError404Valid() throws ErrorException, IOException;
/**
* Send a 200 response with valid payload: {'httpStatusCode': '404'}.
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @return the {@link ServiceCall} object
*/
ServiceCall<Object> get200ModelA201ModelC404ModelDDefaultError404ValidAsync(final ServiceCallback<Object> serviceCallback);
/**
* Send a 200 response with valid payload: {'httpStatusCode': '404'}.
*
* @return the observable to the Object object
*/
Observable<ServiceResponse<Object>> get200ModelA201ModelC404ModelDDefaultError404ValidAsync();
/**
* Send a 400 response with valid payload: {'code': '400', 'message': 'client error'}.
*
* @throws ErrorException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @return the Object object wrapped in {@link ServiceResponse} if successful.
*/
ServiceResponse<Object> get200ModelA201ModelC404ModelDDefaultError400Valid() throws ErrorException, IOException;
/**
* Send a 400 response with valid payload: {'code': '400', 'message': 'client error'}.
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @return the {@link ServiceCall} object
*/
ServiceCall<Object> get200ModelA201ModelC404ModelDDefaultError400ValidAsync(final ServiceCallback<Object> serviceCallback);
/**
* Send a 400 response with valid payload: {'code': '400', 'message': 'client error'}.
*
* @return the observable to the Object object
*/
Observable<ServiceResponse<Object>> get200ModelA201ModelC404ModelDDefaultError400ValidAsync();
/**
* Send a 202 response with no payload.
*
* @throws ErrorException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @return the {@link ServiceResponse} object if successful.
*/
ServiceResponse<Void> get202None204NoneDefaultError202None() throws ErrorException, IOException;
/**
* Send a 202 response with no payload.
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @return the {@link ServiceCall} object
*/
ServiceCall<Void> get202None204NoneDefaultError202NoneAsync(final ServiceCallback<Void> serviceCallback);
/**
* Send a 202 response with no payload.
*
* @return the {@link ServiceResponse} object if successful.
*/
Observable<ServiceResponse<Void>> get202None204NoneDefaultError202NoneAsync();
/**
* Send a 204 response with no payload.
*
* @throws ErrorException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @return the {@link ServiceResponse} object if successful.
*/
ServiceResponse<Void> get202None204NoneDefaultError204None() throws ErrorException, IOException;
/**
* Send a 204 response with no payload.
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @return the {@link ServiceCall} object
*/
ServiceCall<Void> get202None204NoneDefaultError204NoneAsync(final ServiceCallback<Void> serviceCallback);
/**
* Send a 204 response with no payload.
*
* @return the {@link ServiceResponse} object if successful.
*/
Observable<ServiceResponse<Void>> get202None204NoneDefaultError204NoneAsync();
/**
* Send a 400 response with valid payload: {'code': '400', 'message': 'client error'}.
*
* @throws ErrorException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @return the {@link ServiceResponse} object if successful.
*/
ServiceResponse<Void> get202None204NoneDefaultError400Valid() throws ErrorException, IOException;
/**
* Send a 400 response with valid payload: {'code': '400', 'message': 'client error'}.
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @return the {@link ServiceCall} object
*/
ServiceCall<Void> get202None204NoneDefaultError400ValidAsync(final ServiceCallback<Void> serviceCallback);
/**
* Send a 400 response with valid payload: {'code': '400', 'message': 'client error'}.
*
* @return the {@link ServiceResponse} object if successful.
*/
Observable<ServiceResponse<Void>> get202None204NoneDefaultError400ValidAsync();
/**
* Send a 202 response with an unexpected payload {'property': 'value'}.
*
* @throws ServiceException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @return the {@link ServiceResponse} object if successful.
*/
ServiceResponse<Void> get202None204NoneDefaultNone202Invalid() throws ServiceException, IOException;
/**
* Send a 202 response with an unexpected payload {'property': 'value'}.
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @return the {@link ServiceCall} object
*/
ServiceCall<Void> get202None204NoneDefaultNone202InvalidAsync(final ServiceCallback<Void> serviceCallback);
/**
* Send a 202 response with an unexpected payload {'property': 'value'}.
*
* @return the {@link ServiceResponse} object if successful.
*/
Observable<ServiceResponse<Void>> get202None204NoneDefaultNone202InvalidAsync();
/**
* Send a 204 response with no payload.
*
* @throws ServiceException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @return the {@link ServiceResponse} object if successful.
*/
ServiceResponse<Void> get202None204NoneDefaultNone204None() throws ServiceException, IOException;
/**
* Send a 204 response with no payload.
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @return the {@link ServiceCall} object
*/
ServiceCall<Void> get202None204NoneDefaultNone204NoneAsync(final ServiceCallback<Void> serviceCallback);
/**
* Send a 204 response with no payload.
*
* @return the {@link ServiceResponse} object if successful.
*/
Observable<ServiceResponse<Void>> get202None204NoneDefaultNone204NoneAsync();
/**
* Send a 400 response with no payload.
*
* @throws ServiceException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @return the {@link ServiceResponse} object if successful.
*/
ServiceResponse<Void> get202None204NoneDefaultNone400None() throws ServiceException, IOException;
/**
* Send a 400 response with no payload.
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @return the {@link ServiceCall} object
*/
ServiceCall<Void> get202None204NoneDefaultNone400NoneAsync(final ServiceCallback<Void> serviceCallback);
/**
* Send a 400 response with no payload.
*
* @return the {@link ServiceResponse} object if successful.
*/
Observable<ServiceResponse<Void>> get202None204NoneDefaultNone400NoneAsync();
/**
* Send a 400 response with an unexpected payload {'property': 'value'}.
*
* @throws ServiceException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @return the {@link ServiceResponse} object if successful.
*/
ServiceResponse<Void> get202None204NoneDefaultNone400Invalid() throws ServiceException, IOException;
/**
* Send a 400 response with an unexpected payload {'property': 'value'}.
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @return the {@link ServiceCall} object
*/
ServiceCall<Void> get202None204NoneDefaultNone400InvalidAsync(final ServiceCallback<Void> serviceCallback);
/**
* Send a 400 response with an unexpected payload {'property': 'value'}.
*
* @return the {@link ServiceResponse} object if successful.
*/
Observable<ServiceResponse<Void>> get202None204NoneDefaultNone400InvalidAsync();
/**
* Send a 200 response with valid payload: {'statusCode': '200'}.
*
* @throws MyException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @return the A object wrapped in {@link ServiceResponse} if successful.
*/
ServiceResponse<A> getDefaultModelA200Valid() throws MyException, IOException;
/**
* Send a 200 response with valid payload: {'statusCode': '200'}.
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @return the {@link ServiceCall} object
*/
ServiceCall<A> getDefaultModelA200ValidAsync(final ServiceCallback<A> serviceCallback);
/**
* Send a 200 response with valid payload: {'statusCode': '200'}.
*
* @return the observable to the A object
*/
Observable<ServiceResponse<A>> getDefaultModelA200ValidAsync();
/**
* Send a 200 response with no payload.
*
* @throws MyException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @return the A object wrapped in {@link ServiceResponse} if successful.
*/
ServiceResponse<A> getDefaultModelA200None() throws MyException, IOException;
/**
* Send a 200 response with no payload.
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @return the {@link ServiceCall} object
*/
ServiceCall<A> getDefaultModelA200NoneAsync(final ServiceCallback<A> serviceCallback);
/**
* Send a 200 response with no payload.
*
* @return the observable to the A object
*/
Observable<ServiceResponse<A>> getDefaultModelA200NoneAsync();
/**
* Send a 400 response with valid payload: {'statusCode': '400'}.
*
* @throws MyException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @return the A object wrapped in {@link ServiceResponse} if successful.
*/
ServiceResponse<A> getDefaultModelA400Valid() throws MyException, IOException;
/**
* Send a 400 response with valid payload: {'statusCode': '400'}.
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @return the {@link ServiceCall} object
*/
ServiceCall<A> getDefaultModelA400ValidAsync(final ServiceCallback<A> serviceCallback);
/**
* Send a 400 response with valid payload: {'statusCode': '400'}.
*
* @return the observable to the A object
*/
Observable<ServiceResponse<A>> getDefaultModelA400ValidAsync();
/**
* Send a 400 response with no payload.
*
* @throws MyException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @return the A object wrapped in {@link ServiceResponse} if successful.
*/
ServiceResponse<A> getDefaultModelA400None() throws MyException, IOException;
/**
* Send a 400 response with no payload.
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @return the {@link ServiceCall} object
*/
ServiceCall<A> getDefaultModelA400NoneAsync(final ServiceCallback<A> serviceCallback);
/**
* Send a 400 response with no payload.
*
* @return the observable to the A object
*/
Observable<ServiceResponse<A>> getDefaultModelA400NoneAsync();
/**
* Send a 200 response with invalid payload: {'statusCode': '200'}.
*
* @throws ServiceException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @return the {@link ServiceResponse} object if successful.
*/
ServiceResponse<Void> getDefaultNone200Invalid() throws ServiceException, IOException;
/**
* Send a 200 response with invalid payload: {'statusCode': '200'}.
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @return the {@link ServiceCall} object
*/
ServiceCall<Void> getDefaultNone200InvalidAsync(final ServiceCallback<Void> serviceCallback);
/**
* Send a 200 response with invalid payload: {'statusCode': '200'}.
*
* @return the {@link ServiceResponse} object if successful.
*/
Observable<ServiceResponse<Void>> getDefaultNone200InvalidAsync();
/**
* Send a 200 response with no payload.
*
* @throws ServiceException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @return the {@link ServiceResponse} object if successful.
*/
ServiceResponse<Void> getDefaultNone200None() throws ServiceException, IOException;
/**
* Send a 200 response with no payload.
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @return the {@link ServiceCall} object
*/
ServiceCall<Void> getDefaultNone200NoneAsync(final ServiceCallback<Void> serviceCallback);
/**
* Send a 200 response with no payload.
*
* @return the {@link ServiceResponse} object if successful.
*/
Observable<ServiceResponse<Void>> getDefaultNone200NoneAsync();
/**
* Send a 400 response with valid payload: {'statusCode': '400'}.
*
* @throws ServiceException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @return the {@link ServiceResponse} object if successful.
*/
ServiceResponse<Void> getDefaultNone400Invalid() throws ServiceException, IOException;
/**
* Send a 400 response with valid payload: {'statusCode': '400'}.
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @return the {@link ServiceCall} object
*/
ServiceCall<Void> getDefaultNone400InvalidAsync(final ServiceCallback<Void> serviceCallback);
/**
* Send a 400 response with valid payload: {'statusCode': '400'}.
*
* @return the {@link ServiceResponse} object if successful.
*/
Observable<ServiceResponse<Void>> getDefaultNone400InvalidAsync();
/**
* Send a 400 response with no payload.
*
* @throws ServiceException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @return the {@link ServiceResponse} object if successful.
*/
ServiceResponse<Void> getDefaultNone400None() throws ServiceException, IOException;
/**
* Send a 400 response with no payload.
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @return the {@link ServiceCall} object
*/
ServiceCall<Void> getDefaultNone400NoneAsync(final ServiceCallback<Void> serviceCallback);
/**
* Send a 400 response with no payload.
*
* @return the {@link ServiceResponse} object if successful.
*/
Observable<ServiceResponse<Void>> getDefaultNone400NoneAsync();
/**
* Send a 200 response with no payload, when a payload is expected - client should return a null object of thde type for model A.
*
* @throws ServiceException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @return the A object wrapped in {@link ServiceResponse} if successful.
*/
ServiceResponse<A> get200ModelA200None() throws ServiceException, IOException;
/**
* Send a 200 response with no payload, when a payload is expected - client should return a null object of thde type for model A.
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @return the {@link ServiceCall} object
*/
ServiceCall<A> get200ModelA200NoneAsync(final ServiceCallback<A> serviceCallback);
/**
* Send a 200 response with no payload, when a payload is expected - client should return a null object of thde type for model A.
*
* @return the observable to the A object
*/
Observable<ServiceResponse<A>> get200ModelA200NoneAsync();
/**
* Send a 200 response with payload {'statusCode': '200'}.
*
* @throws ServiceException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @return the A object wrapped in {@link ServiceResponse} if successful.
*/
ServiceResponse<A> get200ModelA200Valid() throws ServiceException, IOException;
/**
* Send a 200 response with payload {'statusCode': '200'}.
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @return the {@link ServiceCall} object
*/
ServiceCall<A> get200ModelA200ValidAsync(final ServiceCallback<A> serviceCallback);
/**
* Send a 200 response with payload {'statusCode': '200'}.
*
* @return the observable to the A object
*/
Observable<ServiceResponse<A>> get200ModelA200ValidAsync();
/**
* Send a 200 response with invalid payload {'statusCodeInvalid': '200'}.
*
* @throws ServiceException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @return the A object wrapped in {@link ServiceResponse} if successful.
*/
ServiceResponse<A> get200ModelA200Invalid() throws ServiceException, IOException;
/**
* Send a 200 response with invalid payload {'statusCodeInvalid': '200'}.
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @return the {@link ServiceCall} object
*/
ServiceCall<A> get200ModelA200InvalidAsync(final ServiceCallback<A> serviceCallback);
/**
* Send a 200 response with invalid payload {'statusCodeInvalid': '200'}.
*
* @return the observable to the A object
*/
Observable<ServiceResponse<A>> get200ModelA200InvalidAsync();
/**
* Send a 400 response with no payload client should treat as an http error with no error model.
*
* @throws ServiceException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @return the A object wrapped in {@link ServiceResponse} if successful.
*/
ServiceResponse<A> get200ModelA400None() throws ServiceException, IOException;
/**
* Send a 400 response with no payload client should treat as an http error with no error model.
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @return the {@link ServiceCall} object
*/
ServiceCall<A> get200ModelA400NoneAsync(final ServiceCallback<A> serviceCallback);
/**
* Send a 400 response with no payload client should treat as an http error with no error model.
*
* @return the observable to the A object
*/
Observable<ServiceResponse<A>> get200ModelA400NoneAsync();
/**
* Send a 200 response with payload {'statusCode': '400'}.
*
* @throws ServiceException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @return the A object wrapped in {@link ServiceResponse} if successful.
*/
ServiceResponse<A> get200ModelA400Valid() throws ServiceException, IOException;
/**
* Send a 200 response with payload {'statusCode': '400'}.
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @return the {@link ServiceCall} object
*/
ServiceCall<A> get200ModelA400ValidAsync(final ServiceCallback<A> serviceCallback);
/**
* Send a 200 response with payload {'statusCode': '400'}.
*
* @return the observable to the A object
*/
Observable<ServiceResponse<A>> get200ModelA400ValidAsync();
/**
* Send a 200 response with invalid payload {'statusCodeInvalid': '400'}.
*
* @throws ServiceException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @return the A object wrapped in {@link ServiceResponse} if successful.
*/
ServiceResponse<A> get200ModelA400Invalid() throws ServiceException, IOException;
/**
* Send a 200 response with invalid payload {'statusCodeInvalid': '400'}.
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @return the {@link ServiceCall} object
*/
ServiceCall<A> get200ModelA400InvalidAsync(final ServiceCallback<A> serviceCallback);
/**
* Send a 200 response with invalid payload {'statusCodeInvalid': '400'}.
*
* @return the observable to the A object
*/
Observable<ServiceResponse<A>> get200ModelA400InvalidAsync();
/**
* Send a 202 response with payload {'statusCode': '202'}.
*
* @throws ServiceException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @return the A object wrapped in {@link ServiceResponse} if successful.
*/
ServiceResponse<A> get200ModelA202Valid() throws ServiceException, IOException;
/**
* Send a 202 response with payload {'statusCode': '202'}.
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @return the {@link ServiceCall} object
*/
ServiceCall<A> get200ModelA202ValidAsync(final ServiceCallback<A> serviceCallback);
/**
* Send a 202 response with payload {'statusCode': '202'}.
*
* @return the observable to the A object
*/
Observable<ServiceResponse<A>> get200ModelA202ValidAsync();
}
| {
"content_hash": "f74f4f77963308dfb15f7ee44c6eb63d",
"timestamp": "",
"source": "github",
"line_count": 836,
"max_line_length": 133,
"avg_line_length": 40.09928229665072,
"alnum_prop": 0.7044118963099961,
"repo_name": "haocs/autorest",
"id": "5ca705a2987e9f5d15ad26c79468b23840c5a0a6",
"size": "33841",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/generator/AutoRest.Java.Tests/src/main/java/fixtures/http/MultipleResponses.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "12942"
},
{
"name": "C#",
"bytes": "12768592"
},
{
"name": "CSS",
"bytes": "110"
},
{
"name": "Go",
"bytes": "142004"
},
{
"name": "HTML",
"bytes": "274"
},
{
"name": "Java",
"bytes": "6303425"
},
{
"name": "JavaScript",
"bytes": "4746656"
},
{
"name": "PowerShell",
"bytes": "44986"
},
{
"name": "Python",
"bytes": "2283819"
},
{
"name": "Ruby",
"bytes": "301935"
},
{
"name": "Shell",
"bytes": "423"
},
{
"name": "TypeScript",
"bytes": "179578"
}
],
"symlink_target": ""
} |
layout: bidder
title: Nasmedia Admixer
description: Prebid Nasmedia Admixer Bidder Adapter
pbjs: true
biddercode: nasmediaAdmixer
enable_download: false
pbjs_version_notes: not ported to 5.x
---
### Note:
The Nasmedia Admixer Bidder Adapter requires setup and approval from the Nasmedia Admixer team.
Please reach out to <[email protected]> for more information.
### Bid Params
{: .table .table-bordered .table-striped }
| Name | Scope | Description | Example | Type |
|-------------|----------|--------------------------------------------|--------------|----------|
| `media_key` | required | Publisher Key provided by Nasmedia Admixer | `'19038695'` | `string` |
| `adunit_id` | required | Adunit Id provided by Nasmedia Admixer | `'24190632'` | `string` |
| {
"content_hash": "04621e03602b6304b327f9cea7d536f7",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 97,
"avg_line_length": 37.36363636363637,
"alnum_prop": 0.6021897810218978,
"repo_name": "prebid/prebid.github.io",
"id": "a9910a1a0a6d3286e880539a7c456dc354018619",
"size": "826",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "dev-docs/bidders/nasmediaAdmixer.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "37173"
},
{
"name": "HTML",
"bytes": "292883"
},
{
"name": "JavaScript",
"bytes": "211916"
},
{
"name": "Ruby",
"bytes": "83"
},
{
"name": "SCSS",
"bytes": "29620"
}
],
"symlink_target": ""
} |
<?php
class Onxshop_Controller_Bo_Component_Ecommerce_Product_List extends Onxshop_Controller {
/**
* main action
*/
public function mainAction() {
/**
* Get input variables
*/
if ($_POST['product-list-filter']) $filter = $_POST['product-list-filter'];
else $filter = $_SESSION['bo']['product-list-filter'];
if (is_numeric($this->GET['taxonomy_tree_id'])) $filter['taxonomy_json'] = json_encode(array($this->GET['taxonomy_tree_id']));
else $filter['taxonomy_json'] = false;
/**
* Get the list
*/
require_once('models/ecommerce/ecommerce_product.php');
$Product = new ecommerce_product();
$product_list = $Product->getFilteredProductList($filter);
if (!is_array($product_list)) return false;
if (count($product_list) == 0) {
$this->tpl->parse('content.empty_list');
return true;
}
/**
* Sorting
*/
//$_Onxshop_Request = new Onxshop_Request("component/ecommerce/product_list_sorting");
//$this->tpl->assign('SORTING', $_Onxshop_Request->getContent());
if ($this->GET['product-list-sort-by']) {
$_SESSION['bo']['product-list-sort-by'] = $this->GET['product-list-sort-by'];
}
if ($this->GET['product-list-sort-direction']) {
$_SESSION['bo']['product-list-sort-direction'] = $this->GET['product-list-sort-direction'];
}
if ($_SESSION['bo']['product-list-sort-by']) {
$sortby = $_SESSION['bo']['product-list-sort-by'];
} else {
$sortby = "modified";
}
if ($_SESSION['bo']['product-list-sort-direction']) {
$direction = $_SESSION['bo']['product-list-sort-direction'];
} else {
$direction = "DESC";
}
//msg("Sorted by $sortby $direction");
$product_list_sorted = array();
switch ($sortby) {
default:
case 'id':
$product_list = php_multisort($product_list, array(array('key'=>'product_id', 'sort'=>$direction), array('key'=>'product_id', 'type'=>'numeric')));
break;
case 'modified':
$product_list = php_multisort($product_list, array(array('key'=>'modified', 'sort'=>$direction), array('key'=>'product_id', 'type'=>'numeric')));
break;
case 'product_name':
$product_list = php_multisort($product_list, array(array('key'=>'product_name', 'sort'=>$direction), array('key'=>'product_id', 'type'=>'numeric')));
break;
case 'variety_name':
$product_list = php_multisort($product_list, array(array('key'=>'variety_name', 'sort'=>$direction), array('key'=>'product_id', 'type'=>'numeric')));
break;
case 'price':
$product_list = php_multisort($product_list, array(array('key'=>'price', 'sort'=>$direction), array('key'=>'product_id', 'type'=>'numeric')));
break;
case 'sku':
$product_list = php_multisort($product_list, array(array('key'=>'sku', 'sort'=>$direction), array('key'=>'product_id', 'type'=>'numeric')));
break;
case 'stock':
$product_list = php_multisort($product_list, array(array('key'=>'stock', 'sort'=>$direction), array('key'=>'product_id', 'type'=>'numeric')));
break;
}
foreach ($product_list as $item) {
$product_list_sorted[] = $item;
}
$product_list = $product_list_sorted;
//print_r($product_list);exit;
/**
* Reformat
*/
$pl = array();
foreach ($product_list as $item) {
$pl[$item['product_id']][] = $item;
}
$product_list = array();
foreach ($pl as $item) {
$product_list[] = $item;
}
/**
* Initialize pagination variables
*/
if (is_numeric($this->GET['limit_from'])) $from = $this->GET['limit_from'];
else $from = 0;
if (is_numeric($this->GET['limit_per_page'])) $per_page = $this->GET['limit_per_page'];
else $per_page = 25;
$limit = "$from,$per_page";
/**
* Display pagination
*/
//$link = "/page/" . $_SESSION['active_pages'][0];
$count = count($product_list);
$_Onxshop_Request = new Onxshop_Request("component/pagination~link=/request/bo/component/ecommerce/product_list:limit_from=$from:limit_per_page=$per_page:count=$count~");
$this->tpl->assign('PAGINATION', $_Onxshop_Request->getContent());
/**
* Parse items
* Implemented pagination
*/
//print_r($product_list); exit;
foreach ($product_list as $i=>$p_item) {
if ($i >= $from && $i < ($from + $per_page) ) {
$item = $p_item[0];
$rowspan = count($p_item);
$this->tpl->assign('ROWSPAN', "rowspan='$rowspan'");
$item['disabled'] = ($item['publish']) ? '' : 'disabled';
$this->tpl->assign('ITEM', $item);
if ($item['image_src']) $this->tpl->parse('content.list.item.imagetitle.image');
$this->tpl->parse('content.list.item.imagetitle');
$even_odd = ( 'odd' != $even_odd ) ? 'odd' : 'even';
$this->tpl->assign('CLASS', "class='$even_odd fullproduct'");
foreach ($p_item as $item) {
if ($item['variety_publish'] == 0) $item['variety_publish'] = 'disabled';
$this->checkNotifications($item);
$this->tpl->assign('ITEM', $item);
$this->tpl->parse('content.list.item');
$this->tpl->assign('CLASS', "class='$even_odd'");
}
}
}
$this->tpl->parse('content.list');
return true;
}
/**
* display confirmation if notifications are about to be sent out
*/
public function checkNotifications(&$item)
{
require_once('models/common/common_watchdog.php');
$Watchdog = new common_watchdog();
if ($item['stock'] == 0) {
$item['num_notifications'] = $Watchdog->checkWatchdog('back_in_stock_customer', $item['variety_id'], 0, 1, true);
} else {
$item['num_notifications'] = 0;
}
}
}
| {
"content_hash": "08b7a34249114e670831efa2732a5be1",
"timestamp": "",
"source": "github",
"line_count": 201,
"max_line_length": 172,
"avg_line_length": 27.895522388059703,
"alnum_prop": 0.5894417692170502,
"repo_name": "chrisblackni/onxshop",
"id": "bfd31051929dc38e471454e05c8bb15b4f89ec6e",
"size": "5796",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "controllers/bo/component/ecommerce/product_list.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "ApacheConf",
"bytes": "17"
},
{
"name": "Batchfile",
"bytes": "1036"
},
{
"name": "CSS",
"bytes": "251826"
},
{
"name": "HTML",
"bytes": "1456886"
},
{
"name": "JavaScript",
"bytes": "577601"
},
{
"name": "PHP",
"bytes": "22186480"
},
{
"name": "PowerShell",
"bytes": "1028"
},
{
"name": "Shell",
"bytes": "9451"
}
],
"symlink_target": ""
} |
package org.apache.hadoop.mapred;
import java.io.IOException;
import org.apache.hadoop.ipc.VersionedProtocol;
import org.apache.hadoop.mapreduce.JobContext;
import org.apache.hadoop.security.KerberosInfo;
/**
* Protocol that a TaskTracker and the central JobTracker use to communicate.
* The JobTracker is the Server, which implements this protocol.
*/
@KerberosInfo(
serverPrincipal = JobTracker.JT_USER_NAME,
clientPrincipal = TaskTracker.TT_USER_NAME)
interface InterTrackerProtocol extends VersionedProtocol {
/**
* version 3 introduced to replace
* emitHearbeat/pollForNewTask/pollForTaskWithClosedJob with
* {@link #heartbeat(TaskTrackerStatus, boolean, boolean, boolean, short)}
* version 4 changed TaskReport for HADOOP-549.
* version 5 introduced that removes locateMapOutputs and instead uses
* getTaskCompletionEvents to figure finished maps and fetch the outputs
* version 6 adds maxTasks to TaskTrackerStatus for HADOOP-1245
* version 7 replaces maxTasks by maxMapTasks and maxReduceTasks in
* TaskTrackerStatus for HADOOP-1274
* Version 8: HeartbeatResponse is added with the next heartbeat interval.
* version 9 changes the counter representation for HADOOP-2248
* version 10 changes the TaskStatus representation for HADOOP-2208
* version 11 changes string to JobID in getTaskCompletionEvents().
* version 12 changes the counters representation for HADOOP-1915
* version 13 added call getBuildVersion() for HADOOP-236
* Version 14: replaced getFilesystemName with getSystemDir for HADOOP-3135
* Version 15: Changed format of Task and TaskStatus for HADOOP-153
* Version 16: adds ResourceStatus to TaskTrackerStatus for HADOOP-3759
* Version 17: Changed format of Task and TaskStatus for HADOOP-3150
* Version 18: Changed status message due to changes in TaskStatus
* Version 19: Changed heartbeat to piggyback JobTracker restart information
so that the TaskTracker can synchronize itself.
* Version 20: Changed status message due to changes in TaskStatus
* (HADOOP-4232)
* Version 21: Changed information reported in TaskTrackerStatus'
* ResourceStatus and the corresponding accessor methods
* (HADOOP-4035)
* Version 22: Replaced parameter 'initialContact' with 'restarted'
* in heartbeat method (HADOOP-4305)
* Version 23: Added parameter 'initialContact' again in heartbeat method
* (HADOOP-4869)
* Version 24: Changed format of Task and TaskStatus for HADOOP-4759
* Version 25: JobIDs are passed in response to JobTracker restart
* Version 26: Added numRequiredSlots to TaskStatus for MAPREDUCE-516
* Version 27: Adding node health status to TaskStatus for MAPREDUCE-211
* Version 28: Adding user name to the serialized Task for use by TT.
* Version 29: Adding available memory and CPU usage information on TT to
* TaskTrackerStatus for MAPREDUCE-1218
* Version 30: Adding disk failure to TaskTrackerStatus for MAPREDUCE-3015
* Version 31: Adding version methods for HADOOP-8209
*/
public static final long versionID = 31L;
public final static int TRACKERS_OK = 0;
public final static int UNKNOWN_TASKTRACKER = 1;
/**
* Called regularly by the {@link TaskTracker} to update the status of its
* tasks within the job tracker. {@link JobTracker} responds with a
* {@link HeartbeatResponse} that directs the
* {@link TaskTracker} to undertake a series of 'actions'
* (see {@link org.apache.hadoop.mapred.TaskTrackerAction.ActionType}).
*
* {@link TaskTracker} must also indicate whether this is the first
* interaction (since state refresh) and acknowledge the last response
* it recieved from the {@link JobTracker}
*
* @param status the status update
* @param restarted <code>true</code> if the process has just started or
* restarted, <code>false</code> otherwise
* @param initialContact <code>true</code> if this is first interaction since
* 'refresh', <code>false</code> otherwise.
* @param acceptNewTasks <code>true</code> if the {@link TaskTracker} is
* ready to accept new tasks to run.
* @param responseId the last responseId successfully acted upon by the
* {@link TaskTracker}.
* @return a {@link org.apache.hadoop.mapred.HeartbeatResponse} with
* fresh instructions.
*/
HeartbeatResponse heartbeat(TaskTrackerStatus status,
boolean restarted,
boolean initialContact,
boolean acceptNewTasks,
short responseId)
throws IOException;
/**
* The task tracker calls this once, to discern where it can find
* files referred to by the JobTracker
*/
public String getFilesystemName() throws IOException;
/**
* Report a problem to the job tracker.
* @param taskTracker the name of the task tracker
* @param errorClass the kind of error (eg. the class that was thrown)
* @param errorMessage the human readable error message
* @throws IOException if there was a problem in communication or on the
* remote side
*/
public void reportTaskTrackerError(String taskTracker,
String errorClass,
String errorMessage) throws IOException;
/**
* Get task completion events for the jobid, starting from fromEventId.
* Returns empty aray if no events are available.
* @param jobid job id
* @param fromEventId event id to start from.
* @param maxEvents the max number of events we want to look at
* @return array of task completion events.
* @throws IOException
*/
TaskCompletionEvent[] getTaskCompletionEvents(JobID jobid, int fromEventId
, int maxEvents) throws IOException;
/**
* Grab the jobtracker system directory path where job-specific files are to be placed.
*
* @return the system directory where job-specific files are to be placed.
*/
public String getSystemDir();
/**
* Returns the VersionInfo build version of the JobTracker
*/
public String getBuildVersion() throws IOException;
/**
* Returns the VersionInfo version of the JobTracker
*/
public String getVIVersion() throws IOException;
}
| {
"content_hash": "a4518b71fb5abe0660816016ded8227a",
"timestamp": "",
"source": "github",
"line_count": 141,
"max_line_length": 89,
"avg_line_length": 45.94326241134752,
"alnum_prop": 0.6979005866008027,
"repo_name": "gndpig/hadoop",
"id": "96749e38cf9f58feb5e2bd2dad8b057d12dbb1db",
"size": "7284",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/mapred/org/apache/hadoop/mapred/InterTrackerProtocol.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "AspectJ",
"bytes": "64797"
},
{
"name": "C",
"bytes": "404230"
},
{
"name": "C++",
"bytes": "404241"
},
{
"name": "CSS",
"bytes": "59808"
},
{
"name": "Java",
"bytes": "18199115"
},
{
"name": "JavaScript",
"bytes": "76752"
},
{
"name": "Objective-C",
"bytes": "118273"
},
{
"name": "PHP",
"bytes": "152555"
},
{
"name": "Perl",
"bytes": "149888"
},
{
"name": "Python",
"bytes": "1075029"
},
{
"name": "Ruby",
"bytes": "28485"
},
{
"name": "Shell",
"bytes": "1631056"
},
{
"name": "Smalltalk",
"bytes": "56562"
},
{
"name": "TeX",
"bytes": "26547"
},
{
"name": "XSLT",
"bytes": "205073"
}
],
"symlink_target": ""
} |
import numpy as np
''' Look up: https://docs.scipy.org/doc/numpy/reference/routines.random.html '''
def random_integer_array():
x = np.random.normal(0, 2, size = (2, 3)) # integers in [low, high) as 2D array
print('Original array: ')
print(x)
return x
def replace_one_element(array, row, column, number):
array[row, column] = number
print('Changed array: ')
print(array)
return array
if __name__ == "__main__":
x = random_integer_array()
changed_array = replace_one_element(x, 0, 0, 7)
| {
"content_hash": "3751cd2c849fcfad449bebf783c15d55",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 80,
"avg_line_length": 21.125,
"alnum_prop": 0.6587771203155819,
"repo_name": "arcyfelix/Courses",
"id": "e5c01bdc990a8ac9d92af148b4eba230568be796",
"size": "507",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "17-06-05-Machine-Learning-For-Trading/21_replacing_elements.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "30658"
},
{
"name": "CSS",
"bytes": "68601"
},
{
"name": "Dockerfile",
"bytes": "2012"
},
{
"name": "Elixir",
"bytes": "60760"
},
{
"name": "Groovy",
"bytes": "3605"
},
{
"name": "HTML",
"bytes": "3083919"
},
{
"name": "Java",
"bytes": "561657"
},
{
"name": "JavaScript",
"bytes": "161601"
},
{
"name": "Jupyter Notebook",
"bytes": "95735180"
},
{
"name": "PHP",
"bytes": "82"
},
{
"name": "Python",
"bytes": "185224"
},
{
"name": "Scala",
"bytes": "84149"
},
{
"name": "Shell",
"bytes": "47283"
},
{
"name": "Vue",
"bytes": "90691"
},
{
"name": "XSLT",
"bytes": "88587"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
bootstrap="autoload.php.dist"
>
<php>
<ini name="intl.default_locale" value="en"/>
<ini name="intl.error_level" value="0"/>
<ini name="memory_limit" value="-1"/>
</php>
<testsuites>
<testsuite name="email-parse Test Suite">
<directory>./tests/</directory>
</testsuite>
</testsuites>
<groups>
<exclude>
<group>benchmark</group>
</exclude>
</groups>
<filter>
<whitelist>
<directory>./src/</directory>
<exclude>
<directory>./tests/</directory>
</exclude>
</whitelist>
</filter>
</phpunit>
| {
"content_hash": "469b65900e3b1f52c724dc202e01f856",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 52,
"avg_line_length": 25.794871794871796,
"alnum_prop": 0.547713717693837,
"repo_name": "mmucklo/email-parse",
"id": "c366ba6935ff496432330a62c00ae0cad90098d1",
"size": "1006",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "phpunit.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "42809"
}
],
"symlink_target": ""
} |
package elasticsearch
//Licensed under the Apache License, Version 2.0 (the "License");
//you may not use this file except in compliance with the License.
//You may obtain a copy of the License at
//
//http://www.apache.org/licenses/LICENSE-2.0
//
//Unless required by applicable law or agreed to in writing, software
//distributed under the License is distributed on an "AS IS" BASIS,
//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//See the License for the specific language governing permissions and
//limitations under the License.
//
// Code generated by Alibaba Cloud SDK Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
// ResultInListDefaultCollectorConfigurations is a nested struct in elasticsearch response
type ResultInListDefaultCollectorConfigurations struct {
ResultItem []ResultItem `json:"Result" xml:"Result"`
}
| {
"content_hash": "aba62dcf064324232de71acada4b0368",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 90,
"avg_line_length": 43.476190476190474,
"alnum_prop": 0.7853231106243155,
"repo_name": "aliyun/alibaba-cloud-sdk-go",
"id": "2a7e50a7c3b0ba8373b969a3afd77834c5fa55fe",
"size": "913",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "services/elasticsearch/struct_result_in_list_default_collector_configurations.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Go",
"bytes": "734307"
},
{
"name": "Makefile",
"bytes": "183"
}
],
"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>Selecting the Cache Size</title>
<link rel="stylesheet" href="gettingStarted.css" type="text/css" />
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
<link rel="start" href="index.html" title="Getting Started with Berkeley DB" />
<link rel="up" href="dbconfig.html" title="Chapter 6. Database Configuration" />
<link rel="prev" href="dbconfig.html" title="Chapter 6. Database Configuration" />
<link rel="next" href="btree.html" title="BTree Configuration" />
</head>
<body>
<div xmlns="" class="navheader">
<div class="libver">
<p>Library Version 11.2.5.3</p>
</div>
<table width="100%" summary="Navigation header">
<tr>
<th colspan="3" align="center">Selecting the Cache Size</th>
</tr>
<tr>
<td width="20%" align="left"><a accesskey="p" href="dbconfig.html">Prev</a> </td>
<th width="60%" align="center">Chapter 6. Database Configuration</th>
<td width="20%" align="right"> <a accesskey="n" href="btree.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="cachesize"></a>Selecting the Cache Size</h2>
</div>
</div>
</div>
<p>
Cache size is important to your application because if it is set to too
small of a value, your application's performance will suffer from too
much disk I/O. On the other hand, if your cache is too large, then your
application will use more memory than it actually needs.
Moreover, if your application uses too much memory, then on most
operating systems this can result in your application being swapped out
of memory, resulting in extremely poor performance.
</p>
<p>
You select your cache size using either
<span>
<code class="methodname">Db::set_cachesize()</code>, or
<code class="methodname">DbEnv::set_cachesize()</code>,
</span>
depending on whether you are using a database environment or not. You
cache size must be a power of 2, but it is otherwise limited only by
available memory and performance considerations.
</p>
<p>
Selecting a cache size is something of an art, but fortunately you
can change it any time, so it can be easily tuned to your
application's changing data requirements. The best way to
determine how large your cache needs to be is to put your
application into a production environment and watch to see how much
disk I/O is occurring. If your application is going to disk quite a
lot to retrieve database records, then you should increase the size
of your cache (provided that you have enough memory to do so).
</p>
<p>
You can use the <code class="literal">db_stat</code> command line utility with the
<code class="literal">-m</code> option to gauge the effectiveness of your cache.
In particular, the number of pages found in the cache is shown, along
with a percentage value. The closer to 100% that you can get, the
better. If this value drops too low, and you are experiencing
performance problems, then you should consider increasing the size of
your cache, assuming you have memory to support it.
</p>
</div>
<div class="navfooter">
<hr />
<table width="100%" summary="Navigation footer">
<tr>
<td width="40%" align="left"><a accesskey="p" href="dbconfig.html">Prev</a> </td>
<td width="20%" align="center">
<a accesskey="u" href="dbconfig.html">Up</a>
</td>
<td width="40%" align="right"> <a accesskey="n" href="btree.html">Next</a></td>
</tr>
<tr>
<td width="40%" align="left" valign="top">Chapter 6. Database Configuration </td>
<td width="20%" align="center">
<a accesskey="h" href="index.html">Home</a>
</td>
<td width="40%" align="right" valign="top"> BTree Configuration</td>
</tr>
</table>
</div>
</body>
</html>
| {
"content_hash": "fda3409ecb14ada7c48dda7dc2daee9e",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 121,
"avg_line_length": 46.55,
"alnum_prop": 0.6085929108485499,
"repo_name": "iadix/iadixcoin",
"id": "e60da97f962aa1e9f453e8981f6cb3be9f56847d",
"size": "4669",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "db-5.3.28.NC/docs/gsg/CXX/cachesize.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "21896"
},
{
"name": "Assembly",
"bytes": "52315"
},
{
"name": "Awk",
"bytes": "14973"
},
{
"name": "Batchfile",
"bytes": "192"
},
{
"name": "C",
"bytes": "20479063"
},
{
"name": "C#",
"bytes": "2168773"
},
{
"name": "C++",
"bytes": "3655123"
},
{
"name": "CSS",
"bytes": "75032"
},
{
"name": "DTrace",
"bytes": "22240"
},
{
"name": "Erlang",
"bytes": "22675"
},
{
"name": "Groff",
"bytes": "19516"
},
{
"name": "HTML",
"bytes": "58797564"
},
{
"name": "Java",
"bytes": "5962444"
},
{
"name": "JavaScript",
"bytes": "80758"
},
{
"name": "M4",
"bytes": "22796"
},
{
"name": "Makefile",
"bytes": "126124"
},
{
"name": "NSIS",
"bytes": "18836"
},
{
"name": "Objective-C",
"bytes": "858"
},
{
"name": "Objective-C++",
"bytes": "3517"
},
{
"name": "OpenEdge ABL",
"bytes": "71055"
},
{
"name": "PHP",
"bytes": "1306"
},
{
"name": "Perl",
"bytes": "566089"
},
{
"name": "Python",
"bytes": "54355"
},
{
"name": "QMake",
"bytes": "13707"
},
{
"name": "R",
"bytes": "4009"
},
{
"name": "Shell",
"bytes": "1271754"
},
{
"name": "Tcl",
"bytes": "3377538"
},
{
"name": "XS",
"bytes": "200617"
},
{
"name": "Yacc",
"bytes": "49248"
}
],
"symlink_target": ""
} |
<?php
namespace AppBundle\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
class DefaultController extends Controller
{
/**
* @Route("/", name="homepage")
*/
public function indexAction(Request $request)
{
return $this->render('AppBundle:Default:index.html.twig');
}
}
| {
"content_hash": "5c1f00a8377f7ef8daad7144ac7ccf53",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 66,
"avg_line_length": 24.055555555555557,
"alnum_prop": 0.7274826789838337,
"repo_name": "spritex123/symfony-products",
"id": "056bf60bdb02dd65ba4c1927e494df6fc2dfb984",
"size": "433",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/AppBundle/Controller/DefaultController.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "3606"
},
{
"name": "HTML",
"bytes": "5927"
},
{
"name": "PHP",
"bytes": "70784"
}
],
"symlink_target": ""
} |
package com.ticketmaster.discovery.model;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import com.fasterxml.jackson.annotation.JsonInclude;
@ToString(callSuper = true)
@Getter
@Setter
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class Classification extends BaseModel {
private Boolean primary;
private Segment segment;
private Genre genre;
private SubGenre subGenre;
@ToString(callSuper = true)
@Getter
@Setter
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public static class Segment extends BaseModel {
private String id;
private String name;
}
@ToString(callSuper = true)
@Getter
@Setter
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public static class Genre extends BaseModel {
private String id;
private String name;
}
@ToString(callSuper = true)
@Getter
@Setter
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public static class SubGenre extends BaseModel {
private String id;
private String name;
}
}
| {
"content_hash": "55e4cbb0780cfa9668c5f9a2d61f8e7b",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 52,
"avg_line_length": 21.417910447761194,
"alnum_prop": 0.7693379790940766,
"repo_name": "ticketmaster-api/sdk-java",
"id": "1b8968e027b12ab16330c0254f8ce86aaa6e9ff1",
"size": "1435",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "discovery-model/src/main/java/com/ticketmaster/discovery/model/Classification.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "68216"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title></title>
<link rel="Stylesheet" href="../css/analysis.css" />
<script type="text/javascript">
function init() {
if (window.location.hash) {
var parentDiv, nodes, i, helpInfo, helpId, helpInfoArr, helpEnvFilter, envContent, hideEnvClass, hideNodes;
helpInfo = window.location.hash.substring(1);
if(helpInfo.indexOf("-")) {
helpInfoArr = helpInfo.split("-");
helpId = helpInfoArr[0];
helpEnvFilter = helpInfoArr[1];
}
else {
helpId = helpInfo;
}
parentDiv = document.getElementById("topics");
nodes = parentDiv.children;
hideEnvClass = (helpEnvFilter === "OnlineOnly"? "PortalOnly": "OnlineOnly");
if(document.getElementsByClassName) {
hideNodes = document.getElementsByClassName(hideEnvClass);
}
else {
hideNodes = document.querySelectorAll(hideEnvClass);
}
for(i=0; i < nodes.length; i++) {
if(nodes[i].id !== helpId) {
nodes[i].style.display ="none";
}
}
for(i=0; i < hideNodes.length; i++) {
hideNodes[i].style.display ="none";
}
}
}
</script>
</head>
<body onload="init()">
<div id="topics">
<div id="toolDescription" class="largesize">
<h2>Leia lähim</h2><p/>
<h2><img src="../images/GUID-150C2484-7459-405A-8835-B4E72CD49738-web.png" alt="Leia lähim"></h2>
<hr/>
<p>See tööriist leiab lähimad objektid ning raporteerib ja reastab vahemaad lähedalasuvate objektideni, Lähima leidmisel võib tööriist mõõtmisel kasutada kas sirgjoonelist lineaarset vahemaad või valitud liikumisviisi. Otsitavate lähimate objektide arvu või soovitud otsinguulatust saate vajadusel piirata. Selle tööriistaga saadud tulemused aitavad teil leida vastuseid näiteks järgmistele küsimustele.
<ul>
<li>Milline park asub mulle kõige lähemal?
</li>
<li>Millisesse haiglasse on võimalik jõuda lühima sõiduajaga? Kui kaua kestab sõit algusega kell 5:30 teisipäeva õhtusel tipptunnil?
</li>
<li>Milline on kahe linna vahemaa piki maanteed?
</li>
<li>Millised neist patsientidest elavad neist keemiatehastest kolme kilomeetri raadiuses?
</li>
</ul>
</p>
<p>Lähima leidmise funktsioon tagastab kihi, mis sisaldab lähimaid objekte ja joonekihi, mis seostab alguspunktid neile lähimate asukohtadega. Joonekiht sisaldab teavet lähtepunkti ja lähimate asukohtade ning nendevaheliste vahemaade kohta.
</p>
<p>Kui ruut <b>Kasuta praegust kaardi ulatust</b> on märgitud, kaalutakse võimalike alguspunktide ja potentsiaalsete lähimate objektidena üksnes neid objekte, mis on kaardil näha. Kui see ruut pole märgitud, kasutatakse kõiki sisendkihis olevaid objekte ka siis, kui need pole praegu kaardil näha.
</p>
</div>
<!--Parameter divs for each param-->
<div id="analysisLayer">
<div><h2>Vali punktikiht, kust lähimaid asukohti otsitakse</h2></div>
<hr/>
<div>
<p>Lähima leidmise funktsioon mõõdab siin määratud kihi objektide (alguspunktide) vahemaa järgmises parameetris määratud asukohtadeni. Kaasata saab kuni 1000 objekti iga kihi kohta.
</p>
</div>
</div>
<div id="NearbyLocationsLayer">
<div><h2>Leia lähimad asukohad</h2></div>
<hr/>
<div>
<p>Lähima leidmise funktsioon mõõdab esimeses kihis asuvate objektide vahemaa selle kihi asukohtadeni. Ühte kihti saab kaasata kuni 1000 asukohta.
</p>
<p class="OnlineOnly">Lisaks kaardil asuvale kihile saate valida variandi <b>Vali elukeskkonna atlase analüüsikiht</b> või <b>Vali analüüsikiht</b>. Nii avaneb galerii, mis sisaldab mitmete analüüside jaoks tarvilikku kihtide kollektsiooni.
</p>
</div>
</div>
<div id="MeasurementMethod">
<div><h2>Mõõda</h2></div>
<hr/>
<div>
<p>Saate valida, kas soovite lähimad asukohad leida sirgjoonelise vahemaa või valitud liikumisviisi põhjal. Liikumisviisid on lubatud üksnes juhul, kui teie sisendkiht sisaldab punkte. Lubatud reisimisviisid määrab teie asutuse administraator. Liikumisviisi kasutamisel mõõdetakse vahemaad piki maanteid või jalgteid ning arvesse võetakse kehtivad reeglid (nt ühesuunalised teed, keelatud pöördeid jne).
</p>
<p>Kui mõõdate vahemaad joonte või alade vahel, leitakse vahemaa lähimast punktist või lähima punktini piki joont või ala piiri.
</p>
<p>Valiku <b>Sõiduaeg</b> korral saate sõiduaja mõõtmiseks mitme variandi vahel valida.
<ul>
<li>
<p>Tühjendage ruut <b>Kasuta liiklusinfot</b>, kui soovite lähimate objektide leidmisel võtta aluseks staatilise sõidukiiruse (nt kiirusepiirangutest lähtudes), mitte muutuvatest liiklusoludest tingitud muutuvad kiirused.
</p>
<p>Selle variandi võiksite valida juhul, kui soovite teada saada üldiselt lähimat objekti, mitte tingimata seda, mis oleks teile kõige lähemal konkreetse päeva ja kellaaja liiklusolusid arvestades.
</p>
</li>
<li>
<p>Märkige ruut <b>Kasuta liiklusinfot</b>, kui soovite lähimate objektide leidmisel lähtuda kindlast alguskellaajast ja muutuvatest liiklusoludest. Kui märgite ka ruudu <b>Reaalajas liiklus</b>, määratakse alguspunktist väljumise ajaks praegune kellaaeg ning lähimate objektide tuvastamisel võetakse arvesse andurite ja voogude kaudu hangitavat teavet praeguse ja prognoositud liikluskiiruse kohta. Prognoositud liikluskiirused arvutatakse lähtuvalt liikluse kiirusest reaalajas, varem mõõdetud kiirustest ja muudest tingimustest (nt ilm). Liikluskiirust saab prognoosida kuni 12 tundi ette. Seega saate liugurit liigutades määrata väljumisaja, mis on praegusest kuni 12 tundi hilisem.
</p>
<p>Reaalajas liikluse seadete abil saate välja selgitada, milliste objektideni jõuaksite kõige lühema ajaga praegu väljudes, sõitu näiteks tunni aja pärast alustades jne.
</p>
</li>
<li>
<p>Kui märgite ruudu <b>Kasuta liiklusinfot</b> ja valite seade <b>Liiklusinfo põhineb tavapärastel tingimustel</b> koos kindla päeva ja kellaajaga, leiab tööriist lähimad objektid, võttes aluseks varasemalt viieminutise intervalliga mõõdetud keskmised kiirused tavapärasel nädalal. Tulemused sisaldavad liiklusinfot, kuid ei sisalda praeguste liiklusolude ja sündmuste mõju, mis võib sõltuvalt päevast oluliselt varieeruda.
</p>
<p>Neid ajaloolisi liikluseandmeid saate kasutada näiteks selleks, et leida vastus küsimusele, milliste objektideni jõuab kõige lühema ajaga, kui väljuda kolmapäeval kell 11.30.
</p>
<p>Teie määratud kellaaeg viitab konkreetsele ajavööndile, kus teie algusobjektid asuvad. Kui määrate kellaaja 8:00 (hommikul) ning teie kaks alguspunkti asuvad erinevates ajavööndites, siis arvestatakse vastavalt teekonna genereerimisel mõlemas erinevas ajavööndis väljumiskellaaega 8:00.
</p>
</li>
</ul>
Võtke arvesse, et sõiduki liikumisel lähtepunktist edasi aeg kulub ja liiklusolud muutuvad. See tööriist arvestab nende variatsioonidega, kui märgite ruudu <b>Kasuta liiklusinfot</b>, kuid kõik piirkonnad ei toeta liiklusteabe kasutamist. Klõpsake linki <b>Vaata kättesaadavust</b>, et teada saada, kas antud funktsioon on teie piirkonnas kättesaadav.
</p>
</div>
</div>
<div id="Cutoffs">
<div><h2>Iga sisendkihi asukoha jaoks</h2></div>
<hr/>
<div>
<p>Lähimate asukohtade otsingu piiramiseks on teil kaks varianti. Esimene variant on piirata ühe alguspunkti kohta leitavate lähimate asukohtade arvu. Näiteks saate otsida kas ühte lähimat parki, kahte kõige lähemal asuvat parki jne. Teine võimalus on määrata maksimaalne otsinguulatus või sõiduaeg.
</p>
<p>Kui jätate need ruudud märkimata, on leitavate lähimate asukohtade arv maksimaalselt 100 (tööriista piirmäär) ja otsinguulatus on piiramatu.
</p>
<p>Töötlemiseks kuluv aeg sõltub alguspunktide ja lähimate asukohtade arvust ning maksimaalsest otsinguulatusest. Kui asukohti on rohkem ja otsinguulatus suurem, kulub analüüsimiseks rohkem aega.
</p>
<p>Pange tähele, et kui otsinguulatus on piiratud, võib juhtuda, et tööriist ei leia selles ulatuses ühtegi lähimat asukohta või leitakse teie määratud lähimate asukohtade maksimaalsest arvust vähem asukohti.
</p>
</div>
</div>
<div id="OutputNearestLocationsLayer">
<div><h2>Tulemkihi nimi</h2></div>
<hr/>
<div>
<p>See on selle objektikihi nimi, mis luuakse jaotises <b>Minu sisu</b> ja lisatakse kaardile. Kui objektikiht on juba olemas, palutakse teil sisestada mõni muu nimi. See objektikiht koosneb kahest kihist: lähimate asukohtadega kihist ja kihist, milles sisalduvad jooned, mis ühendavad sisendpunktid lähimate asukohtadega.
</p>
<p>Kui valite <b>Kaasa marsruudikihid</b>, salvestatakse tulemuse iga marsruut marsruudikihina. Marsruudikiht sisaldab teavet konkreetse marsruudi kohta (nt marsruudile määratud peatused ja ka teejuhised). Marsruudikihtide loomine on kasulik, kui soovite üksikuid marsruute jagada oma ettevõtte teiste liikmetega või kui soovite neid marsruute edaspidi muuta kaardivaaturi nupu <b>Teejuhised</b> abil. Marsruudikihid kasutavad objektikihi jaoks pandud nime eesliitena ja analüüsi osana genereeritud marsruudinimi lisatakse iga marsruudikihi kordumatu nime loomiseks.
</p>
<p>Maksimaalselt saab luua 1000 marsruudikihti. Kui tulem sisaldab enam kui 1000 marsruuti ja ruut <b>Kaasa marsruudikihid</b> on märgitud, loob tööriist ainult väljundi objektiteenuse.
</p>
<p>Ripploendi <b>Salvesta tulemus</b> kaudu saate määrata jaotises <b>Minu sisu</b> selle kausta nime, kuhu objektikiht ja marsruudikihid salvestatakse.
</p>
</div>
</div>
</div>
</html>
| {
"content_hash": "de05bbd8cb6391dbc339d04e9d213819",
"timestamp": "",
"source": "github",
"line_count": 149,
"max_line_length": 792,
"avg_line_length": 81.6510067114094,
"alnum_prop": 0.6597073812263685,
"repo_name": "wanglongbiao/webapp-tools",
"id": "35a111931344092236ece17250043a123ae2e956",
"size": "12171",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Highlander/ship-gis/src/main/webapp/js/arcgis_js_api/library/3.22/esri/dijit/analysis/help/et/FindNearest.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "46720"
},
{
"name": "Python",
"bytes": "4289"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "d5b469171fbb9021de05db5666f05ba1",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 31,
"avg_line_length": 9.692307692307692,
"alnum_prop": 0.7063492063492064,
"repo_name": "mdoering/backbone",
"id": "98a56c948ad8bb3f5cfb455b96d3c115cfb6dad4",
"size": "186",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Piperales/Piperaceae/Piper/Piper uspantanense/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
package org.apache.jena.sparql.core.mem;
import static java.util.stream.Stream.empty;
import static java.util.stream.Stream.of;
import static org.slf4j.LoggerFactory.getLogger;
import java.util.stream.Stream;
import org.apache.jena.atlas.lib.persistent.PMap;
import org.apache.jena.atlas.lib.persistent.PersistentSet;
import org.apache.jena.atlas.lib.tuple.TConsumer4;
import org.apache.jena.atlas.lib.tuple.TFunction4;
import org.apache.jena.atlas.lib.tuple.TupleMap;
import org.apache.jena.graph.Node;
import org.apache.jena.sparql.core.Quad;
import org.apache.jena.sparql.core.mem.FourTupleMap.ThreeTupleMap;
import org.apache.jena.sparql.core.mem.FourTupleMap.TwoTupleMap;
import org.slf4j.Logger;
/**
* An implementation of {@link QuadTable} based on the use of nested {@link PMap}s. Intended for high-speed in-memory
* use.
*
*/
public class PMapQuadTable extends PMapTupleTable<FourTupleMap, Quad, TConsumer4<Node>>implements QuadTable {
/**
* @param order an internal order for this table
*/
public PMapQuadTable(final String order) {
this("GSPO", order);
}
/**
* @param canonical the canonical order outside this table
* @param order the internal order for this table
*/
public PMapQuadTable(final String canonical, final String order) {
this(canonical + "->" + order, TupleMap.create(canonical, order));
}
/**
* @param tableName a name for this table
* @param order the order of elements in this table
*/
public PMapQuadTable(final String tableName, final TupleMap order) {
super(tableName, order);
}
private static final Logger log = getLogger(PMapQuadTable.class);
@Override
protected Logger log() {
return log;
}
@Override
protected FourTupleMap initial() {
return new FourTupleMap();
}
@Override
public void add(final Quad q) {
map(add()).accept(q);
}
@Override
public void delete(final Quad q) {
map(delete()).accept(q);
}
@Override
public Stream<Quad> find(Node g, Node s, Node p, Node o) {
return map(find).apply(g, s, p, o);
}
/**
* We descend through the nested {@link PMap}s building up {@link Stream}s of partial tuples from which we develop a
* {@link Stream} of full tuples which is our result. Use {@link Node#ANY} or <code>null</code> for a wildcard.
*/
@SuppressWarnings("unchecked") // Because of (Stream<Quad>) -- but why is that needed?
private TFunction4<Node, Stream<Quad>> find = (first, second, third, fourth) -> {
debug("Querying on four-tuple pattern: {} {} {} {} .", first, second, third, fourth);
final FourTupleMap fourTuples = local().get();
if (isConcrete(first)) {
debug("Using a specific first slot value.");
return (Stream<Quad>) fourTuples.get(first).map(threeTuples -> {
if (isConcrete(second)) {
debug("Using a specific second slot value.");
return threeTuples.get(second).map(twoTuples -> {
if (isConcrete(third)) {
debug("Using a specific third slot value.");
return twoTuples.get(third).map(oneTuples -> {
if (isConcrete(fourth)) {
debug("Using a specific fourth slot value.");
return oneTuples.contains(fourth) ? of(unmap(first, second, third, fourth))
: empty();
}
debug("Using a wildcard fourth slot value.");
return oneTuples.stream().map(slot4 -> unmap(first, second, third, slot4));
}).orElse(empty());
}
debug("Using wildcard third and fourth slot values.");
return twoTuples.flatten((slot3, oneTuples) -> oneTuples.stream()
.map(slot4 -> unmap(first, second, slot3, slot4)));
}).orElse(empty());
}
debug("Using wildcard second, third and fourth slot values.");
return threeTuples.flatten((slot2, twoTuples) -> twoTuples.flatten(
(slot3, oneTuples) -> oneTuples.stream().map(slot4 -> unmap(first, slot2, slot3, slot4))));
}).orElse(empty());
}
debug("Using a wildcard for all slot values.");
return fourTuples.flatten((slot1, threeTuples) -> threeTuples.flatten((slot2, twoTuples) -> twoTuples
.flatten((slot3, oneTuples) -> oneTuples.stream().map(slot4 -> unmap(slot1, slot2, slot3, slot4)))));
};
@Override
protected TConsumer4<Node> add() {
return (first, second, third, fourth) -> {
debug("Adding four-tuple: {} {} {} {} .", first, second, third, fourth);
final FourTupleMap fourTuples = local().get();
ThreeTupleMap threeTuples = fourTuples.get(first).orElse(new ThreeTupleMap());
TwoTupleMap twoTuples = threeTuples.get(second).orElse(new TwoTupleMap());
PersistentSet<Node> oneTuples = twoTuples.get(third).orElse(PersistentSet.empty());
if (!oneTuples.contains(fourth)) oneTuples = oneTuples.plus(fourth);
twoTuples = twoTuples.minus(third).plus(third, oneTuples);
threeTuples = threeTuples.minus(second).plus(second, twoTuples);
debug("Setting transactional index to new value.");
local().set(fourTuples.minus(first).plus(first, threeTuples));
};
}
@Override
protected TConsumer4<Node> delete() {
return (first, second, third, fourth) -> {
debug("Removing four-tuple: {} {} {} {} .", first, second, third, fourth);
final FourTupleMap fourTuples = local().get();
fourTuples.get(first).ifPresent(threeTuples -> threeTuples.get(second)
.ifPresent(twoTuples -> twoTuples.get(third).ifPresent(oneTuples -> {
if (oneTuples.contains(fourth)) {
oneTuples = oneTuples.minus(fourth);
final TwoTupleMap newTwoTuples = twoTuples.minus(third).plus(third, oneTuples);
final ThreeTupleMap newThreeTuples = threeTuples.minus(second).plus(second, newTwoTuples);
debug("Setting transactional index to new value.");
local().set(fourTuples.minus(first).plus(first, newThreeTuples));
}
})));
};
}
}
| {
"content_hash": "39ad9109b6643a86988c2009e1f19580",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 120,
"avg_line_length": 43.21290322580645,
"alnum_prop": 0.5915198566736339,
"repo_name": "CesarPantoja/jena",
"id": "8a31f2e48e24e264105aea1475b5cda7e0a03aef",
"size": "7503",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "jena-arq/src/main/java/org/apache/jena/sparql/core/mem/PMapQuadTable.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ApacheConf",
"bytes": "145"
},
{
"name": "AspectJ",
"bytes": "3446"
},
{
"name": "Batchfile",
"bytes": "16824"
},
{
"name": "C++",
"bytes": "5037"
},
{
"name": "CSS",
"bytes": "26180"
},
{
"name": "Elixir",
"bytes": "2548"
},
{
"name": "HTML",
"bytes": "100718"
},
{
"name": "Java",
"bytes": "25062598"
},
{
"name": "JavaScript",
"bytes": "918311"
},
{
"name": "Lex",
"bytes": "82672"
},
{
"name": "Perl",
"bytes": "37209"
},
{
"name": "Ruby",
"bytes": "354871"
},
{
"name": "Shell",
"bytes": "223592"
},
{
"name": "Smarty",
"bytes": "17096"
},
{
"name": "Thrift",
"bytes": "3201"
},
{
"name": "Web Ontology Language",
"bytes": "518275"
},
{
"name": "XSLT",
"bytes": "101830"
}
],
"symlink_target": ""
} |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE TypeSynonymInstances #-}
module AuthServer where
import System.Random
import Control.Monad.Trans.Except
import Control.Monad.Trans.Resource
import Control.Monad.IO.Class
import Data.Aeson
import Data.Aeson.TH
import Data.Bson.Generic
import Data.List.Split
import Crypto.BCrypt
import Crypto.Cipher.AES
import Crypto.Random.DRBG
import Codec.Crypto.RSA
import GHC.Generics
import Network.Wai hiding(Response)
import Network.Wai.Handler.Warp
import Network.Wai.Logger
import Servant
import Servant.API
import Servant.Client
import System.IO
import System.Directory
import System.Environment (getArgs, getProgName, lookupEnv)
import System.Log.Formatter
import System.Log.Handler (setFormatter)
import System.Log.Handler.Simple
import System.Log.Handler.Syslog
import System.Log.Logger
import Data.Bson.Generic
import qualified Data.List as DL
import qualified Data.ByteString.Char8 as BS
import qualified Data.ByteString.Lazy.Char8 as C
import Data.Maybe (catMaybes, fromJust)
import Data.Text (pack, unpack)
import Data.Time.Clock (UTCTime, getCurrentTime)
import Data.Time.Format (defaultTimeLocale, formatTime)
import Database.MongoDB
import Control.Monad (when)
import Network.HTTP.Client (newManager, defaultManagerSettings)
import Data.UUID.V1
import Data.UUID hiding (null)
import Data.Time
import Crypto.Types.PubKey.RSA
import OpenSSL.EVP.PKey
data Response = Response{
response :: String
} deriving (Eq, Show, Generic)
instance ToJSON Response
instance FromJSON Response
data KeyMapping = KeyMapping{
auth :: String,
publickey :: String,
privatekey :: String
}deriving (Eq, Show, Generic)
instance ToJSON KeyMapping
instance FromJSON KeyMapping
instance ToBSON KeyMapping
instance FromBSON KeyMapping
data User = User{
uusername :: String,
upassword :: String,
timeout :: String,
utoken :: String
} deriving (Eq, Show, Generic)
instance ToJSON User
instance FromJSON User
instance ToBSON User
instance FromBSON User
data Signin = Signin{
susername :: String,
spassword :: String
} deriving (Eq, Show, Generic)
instance ToJSON Signin
instance FromJSON Signin
instance ToBSON Signin
instance FromBSON Signin
type ApiHandler = ExceptT ServantErr IO
serverport :: String
serverport = "8082"
serverhost :: String
serverhost = "localhost"
type AuthApi =
"signin" :> ReqBody '[JSON] Signin :> Post '[JSON] User :<|>
"register" :> ReqBody '[JSON] Signin :> Post '[JSON] Response :<|>
"isvalid" :> ReqBody '[JSON] User :> Post '[JSON] Response :<|>
"extend" :> ReqBody '[JSON] User :> Post '[JSON] Response
authApi :: Proxy AuthApi
authApi = Proxy
server :: Server AuthApi
server =
login :<|>
newuser :<|>
checkToken :<|>
extendToken
authApp :: Application
authApp = serve authApi server
mkApp :: IO()
mkApp = do
run (read (serverport) ::Int) authApp
login :: Signin -> ApiHandler User
login signin@(Signin uName psswrd) = liftIO $ do
decryptedpassword <- decryptPassword psswrd
warnLog $ "Decrypted password: " ++ decryptedpassword ++ ", For user: " ++ uName
user <- withMongoDbConnection $ do
docs <- find (select ["_id" =: uName] "USER_RECORD") >>= drainCursor
return $ catMaybes $ DL.map (\ b -> fromBSON b :: Maybe Signin) docs
let thisuser = head $ user
let isvalid = checkPassword thisuser decryptedpassword
case isvalid of
False -> return (User "" "" "" "")
True -> do a <- nextUUID
let sessionKey = Data.UUID.toString $ fromJust a
currentTime <- getCurrentTime
currentZone <- getCurrentTimeZone
let fiveMinutes = 5 * 60
let newTime = addUTCTime fiveMinutes currentTime
let timeouter = utcToLocalTime currentZone newTime
let finaltimeout = show timeouter
warnLog $ "Storing Session key under key " ++ uName ++ "."
let session = (User (susername thisuser) "" finaltimeout sessionKey)
withMongoDbConnection $ upsert (select ["_id" =: uName] "SESSION_RECORD") $ toBSON session
warnLog $ "Session Successfully Stored."
return (session)
newuser :: Signin -> ApiHandler Response
newuser v@(Signin uName psswrd) = liftIO $ do
warnLog $ "Registering account: " ++ uName
warnLog $ "Encrypted password: " ++ psswrd
unencrypted <- decryptPassword psswrd
warnLog $ "Decrypted password: " ++ unencrypted
withMongoDbConnection $ do
docs <- findOne (select ["_id" =: uName] "USER_RECORD")
case docs of
Just _ -> return (Response "Account already exists")
Nothing -> liftIO $ do
hash <- hashPasswordUsingPolicy slowerBcryptHashingPolicy (BS.pack unencrypted)
let hashedpsswrd = BS.unpack $ fromJust hash
liftIO $ do
warnLog $ "Storing new user: " ++ uName ++ ". With hashed password: " ++ hashedpsswrd
let newaccount = (Signin uName hashedpsswrd)
withMongoDbConnection $ upsert (select ["_id" =: uName] "USER_RECORD") $ toBSON newaccount
return (Response "Success")
checkToken :: User -> ApiHandler Response
checkToken user = liftIO $ do
let uname = uusername user
let tokener = utoken user
warnLog $ "Searching for user: " ++ uname
session <- withMongoDbConnection $ do
docs <- find (select ["_id" =: uname] "SESSION_RECORD") >>= drainCursor
return $ catMaybes $ DL.map (\ b -> fromBSON b :: Maybe User) docs
warnLog $ "User found" ++ (show session)
let thissession = head $ session
let senttoken = utoken user
let storedtoken = utoken thissession
case senttoken == storedtoken of
False -> return (Response "Token not valid")
True -> do let tokentimeout = timeout thissession
currentTime <- getCurrentTime
currentZone <- getCurrentTimeZone
let localcurrentTime = show (utcToLocalTime currentZone currentTime)
let tokentimeoutsplit = splitOn " " $ tokentimeout
let localcurrentTimesplit = splitOn " " $ localcurrentTime
case ((tokentimeoutsplit !! 0) == (localcurrentTimesplit !! 0)) of
False -> return (Response "Current date not equal to token date")
True -> do let localcurrenthours = localcurrentTimesplit !! 1
let tokenhours = tokentimeoutsplit !! 1
let localhour = read(((splitOn ":" $ localcurrenthours) !! 0))
let tokenhour = read(((splitOn ":" $ tokenhours) !! 0))
let tokenminutes = read(((splitOn ":" $ tokenhours) !! 1))
let currentminutes = read(((splitOn ":" $ localcurrenthours) !! 1))
let totaltokenminutes = (tokenhour * 60) + tokenminutes
let totalcurrentminutes = (localhour * 60) + currentminutes
case totaltokenminutes > totalcurrentminutes of
False -> return (Response "Token Timeout")
True -> return (Response "Token is Valid")
extendToken :: User -> ApiHandler Response
extendToken user = liftIO $ do
currentTime <- getCurrentTime
currentZone <- getCurrentTimeZone
let fiveMinutes = 5 * 60
let newTime = addUTCTime fiveMinutes currentTime
let timeouter = utcToLocalTime currentZone newTime
let finaltimeout = show timeouter
warnLog $ "Storing Session key under key " ++ (uusername user) ++ "."
let session = (User (uusername user) "" finaltimeout (utoken user))
withMongoDbConnection $ upsert (select ["_id" =: (uusername user)] "SESSION_RECORD") $ toBSON session
warnLog $ "Session Successfully Stored."
return (Response "Success")
loadOrGenPublicKey :: ApiHandler Response
loadOrGenPublicKey = liftIO $ do
withMongoDbConnection $ do
let auth= "auth" :: String
docs <- find (select ["_id" =: auth] "KEY_RECORD") >>= drainCursor
let key = catMaybes $ DL.map (\ b -> fromBSON b :: Maybe KeyMapping) docs
case key of
[(KeyMapping _ publickey privatekey)]-> return (Response publickey)
[] -> liftIO $ do
r1 <- newGenIO :: IO HashDRBG
let (publickey,privatekey,g2) = generateKeyPair r1 1024
--let strPublicKey = fromPublicKey publickey
--let strPublicKey = (PublicKeyInfo (show(key_size publickey)) (show(n publickey)) (show(e publickey)))
--let strPrivateKey = fromPrivateKey privatekey
--let strPrivateKey = (PrivateKeyInfo (PublicKeyInfo (show(key_size (private_pub privatekey)))) (show(n (private_pub privatekey))) (show(e (private_pub privatekey))))
let key = (KeyMapping auth (show publickey) (show privatekey))
withMongoDbConnection $ upsert (select ["_id" =: auth] "KEY_RECORD") $ toBSON key
return (Response (show publickey))
decryptPassword :: String -> IO String
decryptPassword psswrd = do
withMongoDbConnection $ do
let auth= "auth" :: String
keypair <- find (select ["_id" =: auth] "KEY_RECORD") >>= drainCursor
let [(KeyMapping _ publickey privatekey)]= catMaybes $ DL.map (\ b -> fromBSON b :: Maybe KeyMapping) keypair
let prvKey = toPrivateKey privatekey
let password = C.pack psswrd
let decryptedpassword = decrypt privateKey password
return $ C.unpack decryptedpassword
checkPassword :: Signin -> String -> Bool
checkPassword val@(Signin _ hash) password = validatePassword (BS.pack hash) (BS.pack password)
-- | Logging stuff
iso8601 :: UTCTime -> String
iso8601 = formatTime defaultTimeLocale "%FT%T%q%z"
-- global loggin functions
debugLog, warnLog, errorLog :: String -> IO ()
debugLog = doLog debugM
warnLog = doLog warningM
errorLog = doLog errorM
noticeLog = doLog noticeM
doLog f s = getProgName >>= \ p -> do
t <- getCurrentTime
f p $ (iso8601 t) ++ " " ++ s
withLogging act = withStdoutLogger $ \aplogger -> do
lname <- getProgName
llevel <- logLevel
updateGlobalLogger lname
(setLevel $ case llevel of
"WARNING" -> WARNING
"ERROR" -> ERROR
_ -> DEBUG)
act aplogger
-- | Mongodb helpers...
-- | helper to open connection to mongo database and run action
-- generally run as follows:
-- withMongoDbConnection $ do ...
--
withMongoDbConnection :: Action IO a -> IO a
withMongoDbConnection act = do
ip <- mongoDbIp
port <- mongoDbPort
database <- mongoDbDatabase
pipe <- connect (host ip)
ret <- runResourceT $ liftIO $ access pipe master (pack database) act
Database.MongoDB.close pipe
return ret
-- | helper method to ensure we force extraction of all results
-- note how it is defined recursively - meaning that draincursor' calls itself.
-- the purpose is to iterate through all documents returned if the connection is
-- returning the documents in batch mode, meaning in batches of retruned results with more
-- to come on each call. The function recurses until there are no results left, building an
-- array of returned [Document]
drainCursor :: Cursor -> Action IO [Document]
drainCursor cur = drainCursor' cur []
where
drainCursor' cur res = do
batch <- nextBatch cur
if null batch
then return res
else drainCursor' cur (res ++ batch)
-- | Environment variable functions, that return the environment variable if set, or
-- default values if not set.
-- | The IP address of the mongoDB database that devnostics-rest uses to store and access data
mongoDbIp :: IO String
mongoDbIp = defEnv "MONGODB_IP" Prelude.id "127.0.0.1" True
-- | The port number of the mongoDB database that devnostics-rest uses to store and access data
mongoDbPort :: IO Integer
mongoDbPort = defEnv "MONGODB_PORT" read 27017 False -- 27017 is the default mongodb port
-- | The name of the mongoDB database that devnostics-rest uses to store and access data
mongoDbDatabase :: IO String
mongoDbDatabase = defEnv "MONGODB_DATABASE" Prelude.id "USEHASKELLDB" True
-- | Determines log reporting level. Set to "DEBUG", "WARNING" or "ERROR" as preferred. Loggin is
-- provided by the hslogger library.
logLevel :: IO String
logLevel = defEnv "LOG_LEVEL" Prelude.id "DEBUG" True
-- | Helper function to simplify the setting of environment variables
-- function that looks up environment variable and returns the result of running funtion fn over it
-- or if the environment variable does not exist, returns the value def. The function will optionally log a
-- warning based on Boolean tag
defEnv :: Show a
=> String -- Environment Variable name
-> (String -> a) -- function to process variable string (set as 'id' if not needed)
-> a -- default value to use if environment variable is not set
-> Bool -- True if we should warn if environment variable is not set
-> IO a
defEnv env fn def doWarn = lookupEnv env >>= \ e -> case e of
Just s -> return $ fn s
Nothing -> do
when doWarn (doLog warningM $ "Environment variable: " ++ env ++
" is not set. Defaulting to " ++ (show def))
return def
| {
"content_hash": "16c05b9a0590ad448df1d0b38ace4856",
"timestamp": "",
"source": "github",
"line_count": 356,
"max_line_length": 174,
"avg_line_length": 39.853932584269664,
"alnum_prop": 0.6399069636312377,
"repo_name": "Garygunn94/DFS",
"id": "91144fb71994f2cf8e270ef4f6c3ce12a184c7f4",
"size": "14188",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "AuthServer/.stack-work/intero/intero15053Txj.hs",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "234"
},
{
"name": "Emacs Lisp",
"bytes": "101631"
},
{
"name": "Haskell",
"bytes": "1152730"
},
{
"name": "Shell",
"bytes": "2103"
}
],
"symlink_target": ""
} |
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'other_joins'
require 'minitest/autorun'
require "active_record"
ActiveRecord::Base.establish_connection(:adapter => "sqlite3",
:database => ":memory:")
class Order < ActiveRecord::Base
belongs_to :user
belongs_to :shop
end
class Shop < ActiveRecord::Base
has_many :orders
end
class User < ActiveRecord::Base
has_many :orders
end
# migrations
ActiveRecord::Migration.verbose = false
ActiveRecord::Migration.create_table :users, force: true do |t|
t.string :name
t.string :email
t.timestamps null: false
end
ActiveRecord::Migration.create_table :orders, force: true do |t|
t.integer :user_id
t.integer :shop_id
t.string :title
t.timestamps null: false
end
ActiveRecord::Migration.create_table :shops, force: true do |t|
t.string :title
t.timestamps null: false
end
| {
"content_hash": "68a273e3503c044d210316663ed71ffe",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 64,
"avg_line_length": 23.153846153846153,
"alnum_prop": 0.6965669988925803,
"repo_name": "ilp416/other_joins",
"id": "369ad5601338c363a98c13e934b63af35061a5d3",
"size": "903",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/test_helper.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "7516"
},
{
"name": "Shell",
"bytes": "115"
}
],
"symlink_target": ""
} |
[tangle](https://github.com/tanglejs/tangle) is a set of tools
for building web applications.
`tangle-config` implements the `config` subcommand for
[tangle](https://github.com/tanglejs/tangle).
| {
"content_hash": "d6094f7a5293311dac628dedd1523bfe",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 62,
"avg_line_length": 39.2,
"alnum_prop": 0.7704081632653061,
"repo_name": "tanglejs/config",
"id": "dacecf4df2e2b2115cc0581299c221468646de21",
"size": "196",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "readme/overview.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CoffeeScript",
"bytes": "7031"
},
{
"name": "JavaScript",
"bytes": "5629"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#99000000" />
<corners android:radius="5dp"/>
</shape> | {
"content_hash": "0b27e3d871eebc42bb30a9e679a9b12a",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 65,
"avg_line_length": 31.571428571428573,
"alnum_prop": 0.6742081447963801,
"repo_name": "pili-engineering/PLDroidShortVideo",
"id": "7314bec790fb3a2a958557dc5b4d54e857fb1c41",
"size": "221",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ShortVideoUIDemo/TuSDKFilterEngineModule/src/main/res/drawable/tusdk_view_widget_filter_item_select.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "2111232"
},
{
"name": "JavaScript",
"bytes": "30211"
}
],
"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 (1.8.0_40) on Tue Jun 23 23:05:53 JST 2015 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Serialized Form (twitter4j-async 4.0.4 API)</title>
<meta name="date" content="2015-06-23">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script type="text/javascript" src="script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Serialized Form (twitter4j-async 4.0.4 API)";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="overview-summary.html">Overview</a></li>
<li>Package</li>
<li>Class</li>
<li>Use</li>
<li><a href="overview-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?serialized-form.html" target="_top">Frames</a></li>
<li><a href="serialized-form.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">
<h1 title="Serialized Form" class="title">Serialized Form</h1>
</div>
<div class="serializedFormContainer">
<ul class="blockList">
<li class="blockList">
<h2 title="Package">Package twitter4j</h2>
<ul class="blockList">
<li class="blockList"><a name="twitter4j.AsyncTwitterFactory">
<!-- -->
</a>
<h3>Class <a href="twitter4j/AsyncTwitterFactory.html" title="class in twitter4j">twitter4j.AsyncTwitterFactory</a> extends <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>1394946919393640158L</dd>
</dl>
<ul class="blockList">
<li class="blockList">
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockListLast">
<h4>conf</h4>
<pre><a href="http://twitter4j.org/apidocs/twitter4j/conf/Configuration.html?is-external=true" title="class or interface in twitter4j.conf">Configuration</a> conf</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="twitter4j.ExtendedMediaEntityJSONImpl">
<!-- -->
</a>
<h3>Class <a href="http://twitter4j.org/apidocs/twitter4j/ExtendedMediaEntityJSONImpl.html?is-external=true" title="class or interface in twitter4j">twitter4j.ExtendedMediaEntityJSONImpl</a> extends <a href="http://twitter4j.org/apidocs/twitter4j/MediaEntityJSONImpl.html?is-external=true" title="class or interface in twitter4j">MediaEntityJSONImpl</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>-3889082303259253211L</dd>
</dl>
<ul class="blockList">
<li class="blockList">
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockList">
<h4>videoAspectRatioWidth</h4>
<pre>int videoAspectRatioWidth</pre>
</li>
<li class="blockList">
<h4>videoAspectRatioHeight</h4>
<pre>int videoAspectRatioHeight</pre>
</li>
<li class="blockList">
<h4>videoDurationMillis</h4>
<pre>long videoDurationMillis</pre>
</li>
<li class="blockListLast">
<h4>videoVariants</h4>
<pre><a href="http://twitter4j.org/apidocs/twitter4j/ExtendedMediaEntityJSONImpl.Variant.html?is-external=true" title="class or interface in twitter4j">twitter4j.ExtendedMediaEntityJSONImpl.Variant</a>[] videoVariants</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="twitter4j.GeoLocation">
<!-- -->
</a>
<h3>Class <a href="http://twitter4j.org/apidocs/twitter4j/GeoLocation.html?is-external=true" title="class or interface in twitter4j">twitter4j.GeoLocation</a> extends <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>6353721071298376949L</dd>
</dl>
<ul class="blockList">
<li class="blockList">
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockList">
<h4>latitude</h4>
<pre>double latitude</pre>
</li>
<li class="blockListLast">
<h4>longitude</h4>
<pre>double longitude</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="twitter4j.GeoQuery">
<!-- -->
</a>
<h3>Class <a href="http://twitter4j.org/apidocs/twitter4j/GeoQuery.html?is-external=true" title="class or interface in twitter4j">twitter4j.GeoQuery</a> extends <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>5434503339001056634L</dd>
</dl>
<ul class="blockList">
<li class="blockList">
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockList">
<h4>location</h4>
<pre><a href="http://twitter4j.org/apidocs/twitter4j/GeoLocation.html?is-external=true" title="class or interface in twitter4j">GeoLocation</a> location</pre>
</li>
<li class="blockList">
<h4>query</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> query</pre>
</li>
<li class="blockList">
<h4>ip</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> ip</pre>
</li>
<li class="blockList">
<h4>accuracy</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> accuracy</pre>
</li>
<li class="blockList">
<h4>granularity</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> granularity</pre>
</li>
<li class="blockListLast">
<h4>maxResults</h4>
<pre>int maxResults</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="twitter4j.HttpClientBase">
<!-- -->
</a>
<h3>Class <a href="http://twitter4j.org/apidocs/twitter4j/HttpClientBase.html?is-external=true" title="class or interface in twitter4j">twitter4j.HttpClientBase</a> extends <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>-8016974810651763053L</dd>
</dl>
<ul class="blockList">
<li class="blockList">
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockList">
<h4>CONF</h4>
<pre><a href="http://twitter4j.org/apidocs/twitter4j/HttpClientConfiguration.html?is-external=true" title="class or interface in twitter4j">HttpClientConfiguration</a> CONF</pre>
</li>
<li class="blockListLast">
<h4>requestHeaders</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a><<a href="http://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">K</a>,<a href="http://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">V</a>> requestHeaders</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="twitter4j.HttpParameter">
<!-- -->
</a>
<h3>Class <a href="http://twitter4j.org/apidocs/twitter4j/HttpParameter.html?is-external=true" title="class or interface in twitter4j">twitter4j.HttpParameter</a> extends <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>4046908449190454692L</dd>
</dl>
<ul class="blockList">
<li class="blockList">
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockList">
<h4>name</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name</pre>
</li>
<li class="blockList">
<h4>value</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> value</pre>
</li>
<li class="blockList">
<h4>file</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file</pre>
</li>
<li class="blockListLast">
<h4>fileBody</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a> fileBody</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="twitter4j.HttpRequest">
<!-- -->
</a>
<h3>Class <a href="http://twitter4j.org/apidocs/twitter4j/HttpRequest.html?is-external=true" title="class or interface in twitter4j">twitter4j.HttpRequest</a> extends <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>3365496352032493020L</dd>
</dl>
<ul class="blockList">
<li class="blockList">
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockList">
<h4>method</h4>
<pre><a href="http://twitter4j.org/apidocs/twitter4j/RequestMethod.html?is-external=true" title="class or interface in twitter4j">RequestMethod</a> method</pre>
</li>
<li class="blockList">
<h4>url</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> url</pre>
</li>
<li class="blockList">
<h4>parameters</h4>
<pre><a href="http://twitter4j.org/apidocs/twitter4j/HttpParameter.html?is-external=true" title="class or interface in twitter4j">HttpParameter</a>[] parameters</pre>
</li>
<li class="blockList">
<h4>authorization</h4>
<pre><a href="http://twitter4j.org/apidocs/twitter4j/auth/Authorization.html?is-external=true" title="class or interface in twitter4j.auth">Authorization</a> authorization</pre>
</li>
<li class="blockListLast">
<h4>requestHeaders</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a><<a href="http://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">K</a>,<a href="http://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">V</a>> requestHeaders</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="twitter4j.JSONException">
<!-- -->
</a>
<h3>Class <a href="http://twitter4j.org/apidocs/twitter4j/JSONException.html?is-external=true" title="class or interface in twitter4j">twitter4j.JSONException</a> extends <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>-4144585377907783745L</dd>
</dl>
<ul class="blockList">
<li class="blockList">
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockListLast">
<h4>cause</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html?is-external=true" title="class or interface in java.lang">Throwable</a> cause</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="twitter4j.MediaEntityJSONImpl">
<!-- -->
</a>
<h3>Class <a href="http://twitter4j.org/apidocs/twitter4j/MediaEntityJSONImpl.html?is-external=true" title="class or interface in twitter4j">twitter4j.MediaEntityJSONImpl</a> extends <a href="http://twitter4j.org/apidocs/twitter4j/EntityIndex.html?is-external=true" title="class or interface in twitter4j">twitter4j.EntityIndex</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>3609683338035442290L</dd>
</dl>
<ul class="blockList">
<li class="blockList">
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockList">
<h4>id</h4>
<pre>long id</pre>
</li>
<li class="blockList">
<h4>url</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> url</pre>
</li>
<li class="blockList">
<h4>mediaURL</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> mediaURL</pre>
</li>
<li class="blockList">
<h4>mediaURLHttps</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> mediaURLHttps</pre>
</li>
<li class="blockList">
<h4>expandedURL</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> expandedURL</pre>
</li>
<li class="blockList">
<h4>displayURL</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> displayURL</pre>
</li>
<li class="blockList">
<h4>sizes</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a><<a href="http://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">K</a>,<a href="http://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">V</a>> sizes</pre>
</li>
<li class="blockListLast">
<h4>type</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> type</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="twitter4j.OEmbedJSONImpl">
<!-- -->
</a>
<h3>Class <a href="http://twitter4j.org/apidocs/twitter4j/OEmbedJSONImpl.html?is-external=true" title="class or interface in twitter4j">twitter4j.OEmbedJSONImpl</a> extends <a href="http://twitter4j.org/apidocs/twitter4j/TwitterResponseImpl.html?is-external=true" title="class or interface in twitter4j">twitter4j.TwitterResponseImpl</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>-2207801480251709819L</dd>
</dl>
<ul class="blockList">
<li class="blockList">
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockList">
<h4>html</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> html</pre>
</li>
<li class="blockList">
<h4>authorName</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> authorName</pre>
</li>
<li class="blockList">
<h4>url</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> url</pre>
</li>
<li class="blockList">
<h4>version</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> version</pre>
</li>
<li class="blockList">
<h4>cacheAge</h4>
<pre>long cacheAge</pre>
</li>
<li class="blockList">
<h4>authorURL</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> authorURL</pre>
</li>
<li class="blockListLast">
<h4>width</h4>
<pre>int width</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="twitter4j.OEmbedRequest">
<!-- -->
</a>
<h3>Class <a href="http://twitter4j.org/apidocs/twitter4j/OEmbedRequest.html?is-external=true" title="class or interface in twitter4j">twitter4j.OEmbedRequest</a> extends <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>7454130135274547901L</dd>
</dl>
<ul class="blockList">
<li class="blockList">
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockList">
<h4>statusId</h4>
<pre>long statusId</pre>
</li>
<li class="blockList">
<h4>url</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> url</pre>
</li>
<li class="blockList">
<h4>maxWidth</h4>
<pre>int maxWidth</pre>
</li>
<li class="blockList">
<h4>hideMedia</h4>
<pre>boolean hideMedia</pre>
</li>
<li class="blockList">
<h4>hideThread</h4>
<pre>boolean hideThread</pre>
</li>
<li class="blockList">
<h4>omitScript</h4>
<pre>boolean omitScript</pre>
</li>
<li class="blockList">
<h4>align</h4>
<pre><a href="http://twitter4j.org/apidocs/twitter4j/OEmbedRequest.Align.html?is-external=true" title="class or interface in twitter4j">OEmbedRequest.Align</a> align</pre>
</li>
<li class="blockList">
<h4>related</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[] related</pre>
</li>
<li class="blockListLast">
<h4>lang</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> lang</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="twitter4j.Paging">
<!-- -->
</a>
<h3>Class <a href="http://twitter4j.org/apidocs/twitter4j/Paging.html?is-external=true" title="class or interface in twitter4j">twitter4j.Paging</a> extends <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>-7226113618341047983L</dd>
</dl>
<ul class="blockList">
<li class="blockList">
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockList">
<h4>page</h4>
<pre>int page</pre>
</li>
<li class="blockList">
<h4>count</h4>
<pre>int count</pre>
</li>
<li class="blockList">
<h4>sinceId</h4>
<pre>long sinceId</pre>
</li>
<li class="blockListLast">
<h4>maxId</h4>
<pre>long maxId</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="twitter4j.Query">
<!-- -->
</a>
<h3>Class <a href="http://twitter4j.org/apidocs/twitter4j/Query.html?is-external=true" title="class or interface in twitter4j">twitter4j.Query</a> extends <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>7196404519192910019L</dd>
</dl>
<ul class="blockList">
<li class="blockList">
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockList">
<h4>query</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> query</pre>
</li>
<li class="blockList">
<h4>lang</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> lang</pre>
</li>
<li class="blockList">
<h4>locale</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> locale</pre>
</li>
<li class="blockList">
<h4>maxId</h4>
<pre>long maxId</pre>
</li>
<li class="blockList">
<h4>count</h4>
<pre>int count</pre>
</li>
<li class="blockList">
<h4>since</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> since</pre>
</li>
<li class="blockList">
<h4>sinceId</h4>
<pre>long sinceId</pre>
</li>
<li class="blockList">
<h4>geocode</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> geocode</pre>
</li>
<li class="blockList">
<h4>until</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> until</pre>
</li>
<li class="blockList">
<h4>resultType</h4>
<pre><a href="http://twitter4j.org/apidocs/twitter4j/Query.ResultType.html?is-external=true" title="class or interface in twitter4j">Query.ResultType</a> resultType</pre>
</li>
<li class="blockListLast">
<h4>nextPageQuery</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> nextPageQuery</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="twitter4j.RateLimitStatusEvent">
<!-- -->
</a>
<h3>Class <a href="http://twitter4j.org/apidocs/twitter4j/RateLimitStatusEvent.html?is-external=true" title="class or interface in twitter4j">twitter4j.RateLimitStatusEvent</a> extends <a href="http://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html?is-external=true" title="class or interface in java.util">EventObject</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>3749366911109722414L</dd>
</dl>
<ul class="blockList">
<li class="blockList">
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockList">
<h4>rateLimitStatus</h4>
<pre><a href="http://twitter4j.org/apidocs/twitter4j/RateLimitStatus.html?is-external=true" title="class or interface in twitter4j">RateLimitStatus</a> rateLimitStatus</pre>
</li>
<li class="blockListLast">
<h4>isAccountRateLimitStatus</h4>
<pre>boolean isAccountRateLimitStatus</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="twitter4j.ScopesImpl">
<!-- -->
</a>
<h3>Class <a href="http://twitter4j.org/apidocs/twitter4j/ScopesImpl.html?is-external=true" title="class or interface in twitter4j">twitter4j.ScopesImpl</a> extends <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> implements Serializable</h3>
<ul class="blockList">
<li class="blockList">
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockListLast">
<h4>placeIds</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[] placeIds</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="twitter4j.StatusUpdate">
<!-- -->
</a>
<h3>Class <a href="http://twitter4j.org/apidocs/twitter4j/StatusUpdate.html?is-external=true" title="class or interface in twitter4j">twitter4j.StatusUpdate</a> extends <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>7422094739799350035L</dd>
</dl>
<ul class="blockList">
<li class="blockList">
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockList">
<h4>status</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> status</pre>
</li>
<li class="blockList">
<h4>inReplyToStatusId</h4>
<pre>long inReplyToStatusId</pre>
</li>
<li class="blockList">
<h4>location</h4>
<pre><a href="http://twitter4j.org/apidocs/twitter4j/GeoLocation.html?is-external=true" title="class or interface in twitter4j">GeoLocation</a> location</pre>
</li>
<li class="blockList">
<h4>placeId</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> placeId</pre>
</li>
<li class="blockList">
<h4>displayCoordinates</h4>
<pre>boolean displayCoordinates</pre>
</li>
<li class="blockList">
<h4>possiblySensitive</h4>
<pre>boolean possiblySensitive</pre>
</li>
<li class="blockList">
<h4>mediaName</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> mediaName</pre>
</li>
<li class="blockList">
<h4>mediaFile</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> mediaFile</pre>
</li>
<li class="blockListLast">
<h4>mediaIds</h4>
<pre>long[] mediaIds</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="twitter4j.TimeZoneJSONImpl">
<!-- -->
</a>
<h3>Class <a href="http://twitter4j.org/apidocs/twitter4j/TimeZoneJSONImpl.html?is-external=true" title="class or interface in twitter4j">twitter4j.TimeZoneJSONImpl</a> extends <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>81958969762484144L</dd>
</dl>
<ul class="blockList">
<li class="blockList">
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockList">
<h4>NAME</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> NAME</pre>
</li>
<li class="blockList">
<h4>TZINFO_NAME</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> TZINFO_NAME</pre>
</li>
<li class="blockListLast">
<h4>UTC_OFFSET</h4>
<pre>int UTC_OFFSET</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="twitter4j.TwitterException">
<!-- -->
</a>
<h3>Class <a href="http://twitter4j.org/apidocs/twitter4j/TwitterException.html?is-external=true" title="class or interface in twitter4j">twitter4j.TwitterException</a> extends <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>6006561839051121336L</dd>
</dl>
<ul class="blockList">
<li class="blockList">
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockList">
<h4>statusCode</h4>
<pre>int statusCode</pre>
</li>
<li class="blockList">
<h4>errorCode</h4>
<pre>int errorCode</pre>
</li>
<li class="blockList">
<h4>exceptionDiagnosis</h4>
<pre><a href="http://twitter4j.org/apidocs/twitter4j/ExceptionDiagnosis.html?is-external=true" title="class or interface in twitter4j">twitter4j.ExceptionDiagnosis</a> exceptionDiagnosis</pre>
</li>
<li class="blockList">
<h4>response</h4>
<pre><a href="http://twitter4j.org/apidocs/twitter4j/HttpResponse.html?is-external=true" title="class or interface in twitter4j">HttpResponse</a> response</pre>
</li>
<li class="blockList">
<h4>errorMessage</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> errorMessage</pre>
</li>
<li class="blockListLast">
<h4>nested</h4>
<pre>boolean nested</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="twitter4j.TwitterFactory">
<!-- -->
</a>
<h3>Class <a href="http://twitter4j.org/apidocs/twitter4j/TwitterFactory.html?is-external=true" title="class or interface in twitter4j">twitter4j.TwitterFactory</a> extends <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>-563983536986910054L</dd>
</dl>
<ul class="blockList">
<li class="blockList">
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockListLast">
<h4>conf</h4>
<pre><a href="http://twitter4j.org/apidocs/twitter4j/conf/Configuration.html?is-external=true" title="class or interface in twitter4j.conf">Configuration</a> conf</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="twitter4j.UploadedMedia">
<!-- -->
</a>
<h3>Class <a href="http://twitter4j.org/apidocs/twitter4j/UploadedMedia.html?is-external=true" title="class or interface in twitter4j">twitter4j.UploadedMedia</a> extends <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>5393092535610604718L</dd>
</dl>
<ul class="blockList">
<li class="blockList">
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockList">
<h4>imageWidth</h4>
<pre>int imageWidth</pre>
</li>
<li class="blockList">
<h4>imageHeight</h4>
<pre>int imageHeight</pre>
</li>
<li class="blockList">
<h4>imageType</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> imageType</pre>
</li>
<li class="blockList">
<h4>mediaId</h4>
<pre>long mediaId</pre>
</li>
<li class="blockListLast">
<h4>size</h4>
<pre>long size</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="twitter4j.XAuthAuthorization">
<!-- -->
</a>
<h3>Class <a href="http://twitter4j.org/apidocs/twitter4j/XAuthAuthorization.html?is-external=true" title="class or interface in twitter4j">twitter4j.XAuthAuthorization</a> extends <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>-7260372598870697494L</dd>
</dl>
<ul class="blockList">
<li class="blockList">
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockList">
<h4>basic</h4>
<pre><a href="http://twitter4j.org/apidocs/twitter4j/auth/BasicAuthorization.html?is-external=true" title="class or interface in twitter4j.auth">BasicAuthorization</a> basic</pre>
</li>
<li class="blockList">
<h4>consumerKey</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> consumerKey</pre>
</li>
<li class="blockListLast">
<h4>consumerSecret</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> consumerSecret</pre>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList">
<h2 title="Package">Package twitter4j.auth</h2>
<ul class="blockList">
<li class="blockList"><a name="twitter4j.auth.AccessToken">
<!-- -->
</a>
<h3>Class <a href="http://twitter4j.org/apidocs/twitter4j/auth/AccessToken.html?is-external=true" title="class or interface in twitter4j.auth">twitter4j.auth.AccessToken</a> extends <a href="http://twitter4j.org/apidocs/twitter4j/auth/OAuthToken.html?is-external=true" title="class or interface in twitter4j.auth">twitter4j.auth.OAuthToken</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>2470022129505774772L</dd>
</dl>
<ul class="blockList">
<li class="blockList">
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockList">
<h4>screenName</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> screenName</pre>
</li>
<li class="blockListLast">
<h4>userId</h4>
<pre>long userId</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="twitter4j.auth.BasicAuthorization">
<!-- -->
</a>
<h3>Class <a href="http://twitter4j.org/apidocs/twitter4j/auth/BasicAuthorization.html?is-external=true" title="class or interface in twitter4j.auth">twitter4j.auth.BasicAuthorization</a> extends <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>7420629998989177351L</dd>
</dl>
<ul class="blockList">
<li class="blockList">
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockList">
<h4>userId</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> userId</pre>
</li>
<li class="blockList">
<h4>password</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> password</pre>
</li>
<li class="blockListLast">
<h4>basic</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> basic</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="twitter4j.auth.NullAuthorization">
<!-- -->
</a>
<h3>Class <a href="http://twitter4j.org/apidocs/twitter4j/auth/NullAuthorization.html?is-external=true" title="class or interface in twitter4j.auth">twitter4j.auth.NullAuthorization</a> extends <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>-7704668493278727510L</dd>
</dl>
<ul class="blockList">
<li class="blockList">
<h3>Serialization Methods</h3>
<ul class="blockList">
<li class="blockListLast">
<h4>readResolve</h4>
<pre>private <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> readResolve()
throws <a href="http://docs.oracle.com/javase/8/docs/api/java/io/ObjectStreamException.html?is-external=true" title="class or interface in java.io">ObjectStreamException</a></pre>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/8/docs/api/java/io/ObjectStreamException.html?is-external=true" title="class or interface in java.io">ObjectStreamException</a></code></dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="twitter4j.auth.OAuth2Authorization">
<!-- -->
</a>
<h3>Class <a href="http://twitter4j.org/apidocs/twitter4j/auth/OAuth2Authorization.html?is-external=true" title="class or interface in twitter4j.auth">twitter4j.auth.OAuth2Authorization</a> extends <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>-2895232598422218647L</dd>
</dl>
<ul class="blockList">
<li class="blockList">
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockList">
<h4>conf</h4>
<pre><a href="http://twitter4j.org/apidocs/twitter4j/conf/Configuration.html?is-external=true" title="class or interface in twitter4j.conf">Configuration</a> conf</pre>
</li>
<li class="blockList">
<h4>http</h4>
<pre><a href="http://twitter4j.org/apidocs/twitter4j/HttpClient.html?is-external=true" title="class or interface in twitter4j">HttpClient</a> http</pre>
</li>
<li class="blockList">
<h4>consumerKey</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> consumerKey</pre>
</li>
<li class="blockList">
<h4>consumerSecret</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> consumerSecret</pre>
</li>
<li class="blockListLast">
<h4>token</h4>
<pre><a href="http://twitter4j.org/apidocs/twitter4j/auth/OAuth2Token.html?is-external=true" title="class or interface in twitter4j.auth">OAuth2Token</a> token</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="twitter4j.auth.OAuth2Token">
<!-- -->
</a>
<h3>Class <a href="http://twitter4j.org/apidocs/twitter4j/auth/OAuth2Token.html?is-external=true" title="class or interface in twitter4j.auth">twitter4j.auth.OAuth2Token</a> extends <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>-8985359441959903216L</dd>
</dl>
<ul class="blockList">
<li class="blockList">
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockList">
<h4>tokenType</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> tokenType</pre>
</li>
<li class="blockListLast">
<h4>accessToken</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> accessToken</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="twitter4j.auth.OAuthAuthorization">
<!-- -->
</a>
<h3>Class <a href="http://twitter4j.org/apidocs/twitter4j/auth/OAuthAuthorization.html?is-external=true" title="class or interface in twitter4j.auth">twitter4j.auth.OAuthAuthorization</a> extends <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>-886869424811858868L</dd>
</dl>
<ul class="blockList">
<li class="blockList">
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockList">
<h4>conf</h4>
<pre><a href="http://twitter4j.org/apidocs/twitter4j/conf/Configuration.html?is-external=true" title="class or interface in twitter4j.conf">Configuration</a> conf</pre>
</li>
<li class="blockList">
<h4>consumerKey</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> consumerKey</pre>
</li>
<li class="blockList">
<h4>consumerSecret</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> consumerSecret</pre>
</li>
<li class="blockList">
<h4>realm</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> realm</pre>
</li>
<li class="blockListLast">
<h4>oauthToken</h4>
<pre><a href="http://twitter4j.org/apidocs/twitter4j/auth/OAuthToken.html?is-external=true" title="class or interface in twitter4j.auth">twitter4j.auth.OAuthToken</a> oauthToken</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="twitter4j.auth.RequestToken">
<!-- -->
</a>
<h3>Class <a href="http://twitter4j.org/apidocs/twitter4j/auth/RequestToken.html?is-external=true" title="class or interface in twitter4j.auth">twitter4j.auth.RequestToken</a> extends <a href="http://twitter4j.org/apidocs/twitter4j/auth/OAuthToken.html?is-external=true" title="class or interface in twitter4j.auth">twitter4j.auth.OAuthToken</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>-8806439091674811734L</dd>
</dl>
<ul class="blockList">
<li class="blockList">
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockList">
<h4>conf</h4>
<pre><a href="http://twitter4j.org/apidocs/twitter4j/conf/Configuration.html?is-external=true" title="class or interface in twitter4j.conf">Configuration</a> conf</pre>
</li>
<li class="blockListLast">
<h4>oauth</h4>
<pre><a href="http://twitter4j.org/apidocs/twitter4j/auth/OAuthSupport.html?is-external=true" title="class or interface in twitter4j.auth">OAuthSupport</a> oauth</pre>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="overview-summary.html">Overview</a></li>
<li>Package</li>
<li>Class</li>
<li>Use</li>
<li><a href="overview-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?serialized-form.html" target="_top">Frames</a></li>
<li><a href="serialized-form.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 © 2015. All rights reserved.</small></p>
</body>
</html>
| {
"content_hash": "529e883bfeae9c8fc843a619fc5c471d",
"timestamp": "",
"source": "github",
"line_count": 1044,
"max_line_length": 433,
"avg_line_length": 40.497126436781606,
"alnum_prop": 0.7178031646916909,
"repo_name": "emedine/hair_feels",
"id": "c4e44c72a6572ac8937077732a1a22b518e8712a",
"size": "42279",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "lib/twitter4j/twitter4j-async/javadoc/serialized-form.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "17076"
},
{
"name": "Java",
"bytes": "2205547"
},
{
"name": "PHP",
"bytes": "369"
},
{
"name": "Processing",
"bytes": "19803"
},
{
"name": "Shell",
"bytes": "28452"
}
],
"symlink_target": ""
} |
#include "informationwindow.h"
#include "imageitem.h"
#include "view.h"
//! [0]
View::View(const QString &offices, const QString &images, QWidget *parent)
: QGraphicsView(parent)
{
officeTable = new QSqlRelationalTableModel(this);
officeTable->setTable(offices);
officeTable->setRelation(1, QSqlRelation(images, "locationid", "file"));
officeTable->select();
//! [0]
//! [1]
scene = new QGraphicsScene(this);
scene->setSceneRect(0, 0, 465, 615);
setScene(scene);
addItems();
QGraphicsPixmapItem *logo = scene->addPixmap(QPixmap(":/logo.png"));
logo->setPos(30, 515);
#if !defined(Q_OS_SYMBIAN) && !defined(Q_WS_MAEMO_5)
setMinimumSize(470, 620);
setMaximumSize(470, 620);
#else
setDragMode(QGraphicsView::ScrollHandDrag);
#endif
setWindowTitle(tr("Offices World Wide"));
}
//! [1]
//! [3]
void View::addItems()
{
int officeCount = officeTable->rowCount();
int imageOffset = 150;
int leftMargin = 70;
int topMargin = 40;
for (int i = 0; i < officeCount; i++) {
ImageItem *image;
QGraphicsTextItem *label;
QSqlRecord record = officeTable->record(i);
int id = record.value("id").toInt();
QString file = record.value("file").toString();
QString location = record.value("location").toString();
int columnOffset = ((i / 3) * 37);
int x = ((i / 3) * imageOffset) + leftMargin + columnOffset;
int y = ((i % 3) * imageOffset) + topMargin;
image = new ImageItem(id, QPixmap(":/" + file));
image->setData(0, i);
image->setPos(x, y);
scene->addItem(image);
label = scene->addText(location);
QPointF labelOffset((150 - label->boundingRect().width()) / 2, 120.0);
label->setPos(QPointF(x, y) + labelOffset);
}
}
//! [3]
//! [5]
void View::mouseReleaseEvent(QMouseEvent *event)
{
if (QGraphicsItem *item = itemAt(event->pos())) {
if (ImageItem *image = qgraphicsitem_cast<ImageItem *>(item))
showInformation(image);
}
QGraphicsView::mouseReleaseEvent(event);
}
//! [5]
//! [6]
void View::showInformation(ImageItem *image)
{
int id = image->id();
if (id < 0 || id >= officeTable->rowCount())
return;
InformationWindow *window = findWindow(id);
if (window && window->isVisible()) {
window->raise();
window->activateWindow();
} else if (window && !window->isVisible()) {
#ifndef Q_OS_SYMBIAN
window->show();
#else
window->showMaximized();
#endif
} else {
InformationWindow *window;
window = new InformationWindow(id, officeTable, this);
connect(window, SIGNAL(imageChanged(int,QString)),
this, SLOT(updateImage(int,QString)));
#ifndef Q_OS_SYMBIAN
window->move(pos() + QPoint(20, 40));
window->show();
#else
window->showMaximized();
#endif
informationWindows.append(window);
}
}
//! [6]
//! [7]
void View::updateImage(int id, const QString &fileName)
{
QList<QGraphicsItem *> items = scene->items();
while(!items.empty()) {
QGraphicsItem *item = items.takeFirst();
if (ImageItem *image = qgraphicsitem_cast<ImageItem *>(item)) {
if (image->id() == id){
image->setPixmap(QPixmap(":/" +fileName));
image->adjust();
break;
}
}
}
}
//! [7]
//! [8]
InformationWindow* View::findWindow(int id)
{
QList<InformationWindow*>::iterator i, beginning, end;
beginning = informationWindows.begin();
end = informationWindows.end();
for (i = beginning; i != end; ++i) {
InformationWindow *window = (*i);
if (window && (window->id() == id))
return window;
}
return 0;
}
//! [8]
| {
"content_hash": "d56c01c2ddb92574b615b6fdedd660e9",
"timestamp": "",
"source": "github",
"line_count": 153,
"max_line_length": 78,
"avg_line_length": 24.92156862745098,
"alnum_prop": 0.5864148964070286,
"repo_name": "stephaneAG/PengPod700",
"id": "6d9d7724374235288fa55ad4db54e41bac094fdc",
"size": "5806",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "QtEsrc/backup_qt/qt-everywhere-opensource-src-4.8.5/examples/sql/drilldown/view.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "167426"
},
{
"name": "Batchfile",
"bytes": "25368"
},
{
"name": "C",
"bytes": "3755463"
},
{
"name": "C#",
"bytes": "9282"
},
{
"name": "C++",
"bytes": "177871700"
},
{
"name": "CSS",
"bytes": "600936"
},
{
"name": "GAP",
"bytes": "758872"
},
{
"name": "GLSL",
"bytes": "32226"
},
{
"name": "Groff",
"bytes": "106542"
},
{
"name": "HTML",
"bytes": "273585110"
},
{
"name": "IDL",
"bytes": "1194"
},
{
"name": "JavaScript",
"bytes": "435912"
},
{
"name": "Makefile",
"bytes": "289373"
},
{
"name": "Objective-C",
"bytes": "1898658"
},
{
"name": "Objective-C++",
"bytes": "3222428"
},
{
"name": "PHP",
"bytes": "6074"
},
{
"name": "Perl",
"bytes": "291672"
},
{
"name": "Prolog",
"bytes": "102468"
},
{
"name": "Python",
"bytes": "22546"
},
{
"name": "QML",
"bytes": "3580408"
},
{
"name": "QMake",
"bytes": "2191574"
},
{
"name": "Scilab",
"bytes": "2390"
},
{
"name": "Shell",
"bytes": "116533"
},
{
"name": "TypeScript",
"bytes": "42452"
},
{
"name": "Visual Basic",
"bytes": "8370"
},
{
"name": "XQuery",
"bytes": "25094"
},
{
"name": "XSLT",
"bytes": "252382"
}
],
"symlink_target": ""
} |
<?php
namespace App\CoreBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class AppCoreBundle extends Bundle
{
}
| {
"content_hash": "3c17e1c59360cb7d8be04d3b9ffc92a5",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 47,
"avg_line_length": 13.555555555555555,
"alnum_prop": 0.7950819672131147,
"repo_name": "abdeltiflouardi/CMSsf",
"id": "62a9df142a8d295ec6aacaf80c097631a84883c4",
"size": "122",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "src/App/CoreBundle/AppCoreBundle.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "176"
},
{
"name": "CSS",
"bytes": "22208"
},
{
"name": "PHP",
"bytes": "175048"
},
{
"name": "XML",
"bytes": "4701"
}
],
"symlink_target": ""
} |
[](http://unmaintained.tech/)
rundeck
=======
[](https://travis-ci.org/kbrebanov/ansible-rundeck)
Installs Rundeck
Requirements
------------
This role requires Ansible 1.9 or higher.
Role Variables
--------------
| Name | Default | Description |
|:----------------|:--------|:------------------------------|
| rundeck_version | 2.6.7 | Version of Rundeck to install |
Dependencies
------------
- kbrebanov.java (Java 7)
Example Playbook
----------------
Install Rundeck
```yaml
- hosts: all
roles:
- kbrebanov.rundeck
```
Install Rundeck specifying version
```yaml
- hosts: all
vars:
rundeck_version: 2.4.1
roles:
- kbrebanov.rundeck
```
License
-------
BSD
Author Information
------------------
Kevin Brebanov
| {
"content_hash": "b53cf42118601002b1f0aead69399050",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 133,
"avg_line_length": 17.037037037037038,
"alnum_prop": 0.5804347826086956,
"repo_name": "kbrebanov/ansible-rundeck",
"id": "4c60dbbb8c7f799453c97c8d314d2bdf2e349994",
"size": "920",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "bsd-2-clause",
"language": [],
"symlink_target": ""
} |
package de.devsurf.common.lang.build;
public interface Factory<Type, ExceptionType extends Exception> {
Type build()
throws ExceptionType;
} | {
"content_hash": "4bf3a34f31a55d54b2af771ddfefe39a",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 65,
"avg_line_length": 22.857142857142858,
"alnum_prop": 0.7125,
"repo_name": "manzke/common-lang",
"id": "a52df4d36cf3c0035d0267369f71b1fa4125555e",
"size": "744",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/de/devsurf/common/lang/build/Factory.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "63554"
}
],
"symlink_target": ""
} |
layout: page
title: ve-Venezuela
---
{% include postbycat key="ve" %} | {
"content_hash": "7dc9049470f936c155dd31bfdac7b93f",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 32,
"avg_line_length": 17.25,
"alnum_prop": 0.6811594202898551,
"repo_name": "binhbat/binhbat.github.io",
"id": "c234b8a27b71221da31cb4476bf44eab880b4f47",
"size": "73",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "_drafts/ve/index.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "353"
},
{
"name": "HTML",
"bytes": "20897"
},
{
"name": "JavaScript",
"bytes": "479"
}
],
"symlink_target": ""
} |
/**
* This code was auto-generated by a Codezu.
*
* Changes to this file may cause incorrect behavior and will be lost if
* the code is regenerated.
*/
package com.mozu.api.contracts.reference;
import org.joda.time.DateTime;
import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.joda.time.DateTime;
/**
* A world date and time standard such as "Dateline Standard Time" or "UTC-12".
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class TimeZone implements Serializable
{
// Default Serial Version UID
private static final long serialVersionUID = 1L;
/**
* Unique identifier of the source product property. For a product field it will be the name of the field. For a product attribute it will be the Attribute FQN.
*/
protected String id;
public String getId() {
return this.id;
}
public void setId(String id) {
this.id = id;
}
/**
* If true, the time zone standard observes daylight savings time advancements, for example, twice a year so that evenings have more daylight and mornings have less. If false, the time zone standard does not adhere to daylight savings changes.
*/
protected Boolean isDaylightSavingsTime;
public Boolean getIsDaylightSavingsTime() {
return this.isDaylightSavingsTime;
}
public void setIsDaylightSavingsTime(Boolean isDaylightSavingsTime) {
this.isDaylightSavingsTime = isDaylightSavingsTime;
}
/**
* The offset associated with the time zone, such as "-12".
*/
protected double offset;
public double getOffset() {
return this.offset;
}
public void setOffset(double offset) {
this.offset = offset;
}
}
| {
"content_hash": "d81ed79768b61cc2fd7f2829890d17d9",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 244,
"avg_line_length": 26.838709677419356,
"alnum_prop": 0.7403846153846154,
"repo_name": "bhewett/mozu-java",
"id": "67c20d296a09fbaff34e1f8ac6a39a16831ca2b5",
"size": "1664",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "mozu-java-core/src/main/java/com/mozu/api/contracts/reference/TimeZone.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "102"
},
{
"name": "Java",
"bytes": "11397868"
}
],
"symlink_target": ""
} |
var searchData=
[
['quads',['Quads',['../class_unity_standard_assets_1_1_image_effects_1_1_quads.html',1,'UnityStandardAssets::ImageEffects']]]
];
| {
"content_hash": "65d16170b6c671af6beb619c73e93be8",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 127,
"avg_line_length": 37.25,
"alnum_prop": 0.697986577181208,
"repo_name": "kesumu/dokidoki",
"id": "1df591f8b13352d4b4eb99f3f9faab238978866f",
"size": "149",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "doc/api/html/search/classes_b.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "374881"
},
{
"name": "GLSL",
"bytes": "33375"
},
{
"name": "Smalltalk",
"bytes": "20286"
}
],
"symlink_target": ""
} |
{% extends 'helpcenter/base.html' %}
{% block page_title %}Create Article{% endblock %}
{% block content %}
<h1>Create Article</h1>
<form method='post'>
{% csrf_token %}
{{ form.as_p }}
<button type='submit'>Create Article</button>
</form>
{% endblock %}
| {
"content_hash": "07cdedb5fcd9642a24603341f90b2fb4",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 50,
"avg_line_length": 13.523809523809524,
"alnum_prop": 0.5845070422535211,
"repo_name": "smalls12/django_helpcenter",
"id": "739de32b8eb1b8f4019dd607d05a75f162f126a3",
"size": "284",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "helpcenter/templates/helpcenter/article_create.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "3229"
},
{
"name": "Python",
"bytes": "60400"
}
],
"symlink_target": ""
} |
// Copyright (c) Laurence J. Golding. All rights reserved. Licensed under the Apache License, Version 2.0. See the LICENSE file in the project root for license information.
using System.ComponentModel.Composition;
using System.Globalization;
using Lakewood.AutoScale.Syntax;
using Microsoft.VisualStudio.Package;
namespace Lakewood.AutoScale.Diagnostics.Rules
{
[Export(typeof(IDiagnosticRule))]
public class InvalidAssignmentToNodeDeallocationOptionRule: DiagnosticRuleBase
{
public static readonly DiagnosticDescriptor Descriptor = new DiagnosticDescriptor("ASF0004", Severity.Error);
public override void Visit(AssignmentNode assignment)
{
string identifierName = assignment.Identifier.Name;
if (identifierName == VariableName.NodeDeallocationOption)
{
var keywordNode = assignment.Expression as KeywordNode;
if (keywordNode == null)
{
AddDiagnostic(
new Diagnostic(
Descriptor,
FormatMessage(),
assignment.Expression.StartIndex,
assignment.Expression.EndIndex));
}
}
}
internal static string FormatMessage()
{
return string.Format(
CultureInfo.CurrentCulture,
Resources.DiagnosticInvalidAssignmentToNodeDeallocationOption,
VariableName.NodeDeallocationOption,
string.Join(", ", Lexer.NodeDeallocationOptionKeywords));
}
}
}
| {
"content_hash": "62ab5ebeb36fbee8ef5ed365309adc59",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 173,
"avg_line_length": 40.19512195121951,
"alnum_prop": 0.6183252427184466,
"repo_name": "lgolding/auto-scale",
"id": "c086067d9f8ddc4f2a1362522c97a19cef0018e6",
"size": "1650",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "AutoScaleLanguageService/Diagnostics/Rules/InvalidAssignmentToNodeDeallocationOptionRule.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "260322"
},
{
"name": "CSS",
"bytes": "2044"
},
{
"name": "HTML",
"bytes": "3517"
}
],
"symlink_target": ""
} |
#include <memory>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <RegistrationManager/CustomerDataHandler.h>
#include <RegistrationManager/CustomerDataManager.h>
namespace alexaClientSDK {
namespace registrationManager {
namespace test {
class MockCustomerDataHandler : public CustomerDataHandler {
public:
explicit MockCustomerDataHandler(std::shared_ptr<CustomerDataManager> dataManager) :
CustomerDataHandler(dataManager) {
}
MOCK_METHOD0(clearData, void());
};
/**
* Testing harness for @c CustomerDataManager.
*/
class CustomerDataManagerTest : public ::testing::Test {
protected:
void SetUp() override {
m_dataManager = std::make_shared<CustomerDataManager>();
}
void TearDown() override {
m_dataManager.reset();
}
std::shared_ptr<CustomerDataManager> m_dataManager;
};
/**
* Test for making sure create succeeds.
*/
TEST_F(CustomerDataManagerTest, test_createCustomerDataManagerInterface) {
ASSERT_NE(nullptr, m_dataManager->createCustomerDataManagerInteface());
}
/**
* Test that all data handlers are cleared.
*/
TEST_F(CustomerDataManagerTest, test_clearData) {
MockCustomerDataHandler handler1{m_dataManager};
MockCustomerDataHandler handler2{m_dataManager};
EXPECT_CALL(handler1, clearData()).Times(1);
EXPECT_CALL(handler2, clearData()).Times(1);
m_dataManager->clearData();
}
/**
* Test that removing a data handler does not leave any dangling reference inside @c CustomerDataManager.
*/
TEST_F(CustomerDataManagerTest, test_clearDataAfterHandlerDeletion) {
{
// CustomerDataHandler will register and deregister with CustomerDataManager during ctor and dtor, respectively.
MockCustomerDataHandler handler1{m_dataManager};
EXPECT_CALL(handler1, clearData()).Times(0);
}
MockCustomerDataHandler handler2{m_dataManager};
EXPECT_CALL(handler2, clearData()).Times(1);
m_dataManager->clearData();
}
} // namespace test
} // namespace registrationManager
} // namespace alexaClientSDK
| {
"content_hash": "2544cf2da615203932f0ad9da7c3c8d9",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 120,
"avg_line_length": 28.164383561643834,
"alnum_prop": 0.732976653696498,
"repo_name": "alexa/avs-device-sdk",
"id": "87e90bced724a7c5ddfdc1c416b676de2bb55819",
"size": "2634",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "core/acsdkRegistrationManager/test/CustomerDataManagerTest.cpp",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "45439"
},
{
"name": "C++",
"bytes": "32228121"
},
{
"name": "CMake",
"bytes": "279679"
},
{
"name": "PLSQL",
"bytes": "144"
},
{
"name": "Python",
"bytes": "7916"
},
{
"name": "Shell",
"bytes": "61345"
}
],
"symlink_target": ""
} |
require 'xcodeproj'
module Fastlane
module Actions
class AutomaticCodeSigningAction < Action
def self.run(params)
FastlaneCore::PrintTable.print_values(config: params, title: "Summary for Automatic Codesigning")
path = params[:path]
path = File.join(File.expand_path(path), "project.pbxproj")
project = Xcodeproj::Project.open(params[:path])
UI.user_error!("Could not find path to project config '#{path}'. Pass the path to your project (not workspace)!") unless File.exist?(path)
UI.message("Updating the Automatic Codesigning flag to #{params[:use_automatic_signing] ? 'enabled' : 'disabled'} for the given project '#{path}'")
unless project.root_object.attributes["TargetAttributes"]
UI.user_error!("Seems to be a very old project file format - please open your project file in a more recent version of Xcode")
return false
end
target_dictionary = project.targets.map { |f| { name: f.name, uuid: f.uuid } }
changed_targets = []
project.root_object.attributes["TargetAttributes"].each do |target, sett|
found_target = target_dictionary.detect { |h| h[:uuid] == target }
if params[:targets]
# get target name
unless params[:targets].include?(found_target[:name])
UI.important("Skipping #{found_target[:name]} not selected (#{params[:targets].join(',')})")
next
end
end
sett["ProvisioningStyle"] = params[:use_automatic_signing] ? 'Automatic' : 'Manual'
if params[:team_id]
sett["DevelopmentTeam"] = params[:team_id]
UI.important("Set Team id to: #{params[:team_id]} for target: #{found_target[:name]}")
end
changed_targets << found_target[:name]
end
project.save
if changed_targets.empty?
UI.important("None of the specified targets has been modified")
UI.important("available targets:")
target_dictionary.each do |target|
UI.important("\t* #{target[:name]}")
end
else
UI.success("Successfully updated project settings to use ProvisioningStyle '#{params[:use_automatic_signing] ? 'Automatic' : 'Manual'}'")
UI.success("Modified Targets:")
changed_targets.each do |target|
UI.success("\t * #{target}")
end
end
params[:use_automatic_signing]
end
def self.alias_used(action_alias, params)
params[:use_automatic_signing] = true if action_alias == "enable_automatic_code_signing"
end
def self.aliases
["enable_automatic_code_signing", "disable_automatic_code_signing"]
end
def self.description
"Updates the Xcode 8 Automatic Codesigning Flag"
end
def self.details
"Updates the Xcode 8 Automatic Codesigning Flag of all targets in the project"
end
def self.available_options
[
FastlaneCore::ConfigItem.new(key: :path,
env_name: "FL_PROJECT_SIGNING_PROJECT_PATH",
description: "Path to your Xcode project",
verify_block: proc do |value|
UI.user_error!("Path is invalid") unless File.exist?(File.expand_path(value))
end),
FastlaneCore::ConfigItem.new(key: :use_automatic_signing,
env_name: "FL_PROJECT_USE_AUTOMATIC_SIGNING",
description: "Defines if project should use automatic signing",
is_string: false,
default_value: false),
FastlaneCore::ConfigItem.new(key: :team_id,
env_name: "FASTLANE_TEAM_ID",
optional: true,
description: "Team ID, is used when upgrading project",
is_string: true),
FastlaneCore::ConfigItem.new(key: :targets,
env_name: "FL_PROJECT_SIGNING_TARGETS",
optional: true,
type: Array,
description: "Specify targets you want to toggle the signing mech. (default to all targets)",
is_string: false)
]
end
def self.output
end
def self.example_code
[
'# enable automatic code signing
enable_automatic_code_signing',
'enable_automatic_code_signing(
path: "demo-project/demo/demo.xcodeproj"
)',
'# disable automatic code signing
disable_automatic_code_signing',
'disable_automatic_code_signing(
path: "demo-project/demo/demo.xcodeproj"
)',
'# also set team id
disable_automatic_code_signing(
path: "demo-project/demo/demo.xcodeproj",
team_id: "XXXX"
)',
'# Only specific targets
disable_automatic_code_signing(
path: "demo-project/demo/demo.xcodeproj",
use_automatic_signing: false,
targets: ["demo"]
)
',
' # via generic action
automatic_code_signing(
path: "demo-project/demo/demo.xcodeproj",
use_automatic_signing: false
)',
'automatic_code_signing(
path: "demo-project/demo/demo.xcodeproj",
use_automatic_signing: true
)'
]
end
def self.category
:code_signing
end
def self.return_value
"The current status (boolean) of codesigning after modification"
end
def self.authors
["mathiasAichinger", "hjanuschka"]
end
def self.is_supported?(platform)
[:ios, :mac].include?(platform)
end
end
end
end
| {
"content_hash": "ad403fe71ed485c1b19ed674f8e94fc1",
"timestamp": "",
"source": "github",
"line_count": 157,
"max_line_length": 155,
"avg_line_length": 39.388535031847134,
"alnum_prop": 0.5386481241914618,
"repo_name": "soxjke/fastlane",
"id": "98b25c125bbdb0b6305712f228685b14b5eae166",
"size": "6184",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "fastlane/lib/fastlane/actions/automatic_code_signing.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "42105"
},
{
"name": "Java",
"bytes": "30549"
},
{
"name": "JavaScript",
"bytes": "39"
},
{
"name": "Matlab",
"bytes": "115"
},
{
"name": "Objective-C",
"bytes": "69198"
},
{
"name": "Ruby",
"bytes": "3424496"
},
{
"name": "Shell",
"bytes": "45224"
},
{
"name": "Swift",
"bytes": "8536"
}
],
"symlink_target": ""
} |
import sys
from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
from azure.core.exceptions import (
ClientAuthenticationError,
HttpResponseError,
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
map_error,
)
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpResponse
from azure.core.rest import HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
from .._vendor import _convert_request, _format_url_section
if sys.version_info >= (3, 8):
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
else:
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
_SERIALIZER.client_side_validation = False
def build_usage_request(scope: str, *, filter: Optional[str] = None, **kwargs: Any) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"]
content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str]
accept = _headers.pop("Accept", "application/json")
# Construct URL
_url = kwargs.pop("template_url", "/{scope}/providers/Microsoft.CostManagement/forecast")
path_format_arguments = {
"scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
if filter is not None:
_params["$filter"] = _SERIALIZER.query("filter", filter, "str")
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
# Construct headers
if content_type is not None:
_headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
_headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
def build_external_cloud_provider_usage_request(
external_cloud_provider_type: Union[str, _models.ExternalCloudProviderType],
external_cloud_provider_id: str,
*,
filter: Optional[str] = None,
**kwargs: Any
) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"]
content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str]
accept = _headers.pop("Accept", "application/json")
# Construct URL
_url = kwargs.pop(
"template_url",
"/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/forecast",
) # pylint: disable=line-too-long
path_format_arguments = {
"externalCloudProviderType": _SERIALIZER.url(
"external_cloud_provider_type", external_cloud_provider_type, "str"
),
"externalCloudProviderId": _SERIALIZER.url("external_cloud_provider_id", external_cloud_provider_id, "str"),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
if filter is not None:
_params["$filter"] = _SERIALIZER.query("filter", filter, "str")
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
# Construct headers
if content_type is not None:
_headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
_headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
class ForecastOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.
Instead, you should access the following operations through
:class:`~azure.mgmt.costmanagement.CostManagementClient`'s
:attr:`forecast` attribute.
"""
models = _models
def __init__(self, *args, **kwargs):
input_args = list(args)
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
@overload
def usage(
self,
scope: str,
parameters: _models.ForecastDefinition,
filter: Optional[str] = None,
*,
content_type: str = "application/json",
**kwargs: Any
) -> Optional[_models.ForecastResult]:
"""Lists the forecast charges for scope defined.
:param scope: The scope associated with forecast operations. This includes
'/subscriptions/{subscriptionId}/' for subscription scope,
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
for Department scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group
scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for billingProfile scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
for invoiceSection scope, and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}'
specific for partners. Required.
:type scope: str
:param parameters: Parameters supplied to the CreateOrUpdate Forecast Config operation.
Required.
:type parameters: ~azure.mgmt.costmanagement.models.ForecastDefinition
:param filter: May be used to filter forecasts by properties/usageDate (Utc time),
properties/chargeType or properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge',
and 'and'. It does not currently support 'ne', 'or', or 'not'. Default value is None.
:type filter: str
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: ForecastResult or None or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.ForecastResult or None
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
def usage(
self,
scope: str,
parameters: IO,
filter: Optional[str] = None,
*,
content_type: str = "application/json",
**kwargs: Any
) -> Optional[_models.ForecastResult]:
"""Lists the forecast charges for scope defined.
:param scope: The scope associated with forecast operations. This includes
'/subscriptions/{subscriptionId}/' for subscription scope,
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
for Department scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group
scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for billingProfile scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
for invoiceSection scope, and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}'
specific for partners. Required.
:type scope: str
:param parameters: Parameters supplied to the CreateOrUpdate Forecast Config operation.
Required.
:type parameters: IO
:param filter: May be used to filter forecasts by properties/usageDate (Utc time),
properties/chargeType or properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge',
and 'and'. It does not currently support 'ne', 'or', or 'not'. Default value is None.
:type filter: str
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: ForecastResult or None or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.ForecastResult or None
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace
def usage(
self, scope: str, parameters: Union[_models.ForecastDefinition, IO], filter: Optional[str] = None, **kwargs: Any
) -> Optional[_models.ForecastResult]:
"""Lists the forecast charges for scope defined.
:param scope: The scope associated with forecast operations. This includes
'/subscriptions/{subscriptionId}/' for subscription scope,
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
for Department scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
for EnrollmentAccount scope,
'/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group
scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
for billingProfile scope,
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'
for invoiceSection scope, and
'/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}'
specific for partners. Required.
:type scope: str
:param parameters: Parameters supplied to the CreateOrUpdate Forecast Config operation. Is
either a model type or a IO type. Required.
:type parameters: ~azure.mgmt.costmanagement.models.ForecastDefinition or IO
:param filter: May be used to filter forecasts by properties/usageDate (Utc time),
properties/chargeType or properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge',
and 'and'. It does not currently support 'ne', 'or', or 'not'. Default value is None.
:type filter: str
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
Default value is None.
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: ForecastResult or None or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.ForecastResult or None
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version = kwargs.pop(
"api_version", _params.pop("api-version", self._config.api_version)
) # type: Literal["2022-10-01"]
content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str]
cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ForecastResult]]
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(parameters, (IO, bytes)):
_content = parameters
else:
_json = self._serialize.body(parameters, "ForecastDefinition")
request = build_usage_request(
scope=scope,
filter=filter,
api_version=api_version,
content_type=content_type,
json=_json,
content=_content,
template_url=self.usage.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url) # type: ignore
pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request, stream=False, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200, 204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize("ForecastResult", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
usage.metadata = {"url": "/{scope}/providers/Microsoft.CostManagement/forecast"} # type: ignore
@overload
def external_cloud_provider_usage(
self,
external_cloud_provider_type: Union[str, _models.ExternalCloudProviderType],
external_cloud_provider_id: str,
parameters: _models.ForecastDefinition,
filter: Optional[str] = None,
*,
content_type: str = "application/json",
**kwargs: Any
) -> _models.ForecastResult:
"""Lists the forecast charges for external cloud provider type defined.
:param external_cloud_provider_type: The external cloud provider type associated with
dimension/query operations. This includes 'externalSubscriptions' for linked account and
'externalBillingAccounts' for consolidated account. Known values are: "externalSubscriptions"
and "externalBillingAccounts". Required.
:type external_cloud_provider_type: str or
~azure.mgmt.costmanagement.models.ExternalCloudProviderType
:param external_cloud_provider_id: This can be '{externalSubscriptionId}' for linked account or
'{externalBillingAccountId}' for consolidated account used with dimension/query operations.
Required.
:type external_cloud_provider_id: str
:param parameters: Parameters supplied to the CreateOrUpdate Forecast Config operation.
Required.
:type parameters: ~azure.mgmt.costmanagement.models.ForecastDefinition
:param filter: May be used to filter forecasts by properties/usageDate (Utc time),
properties/chargeType or properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge',
and 'and'. It does not currently support 'ne', 'or', or 'not'. Default value is None.
:type filter: str
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: ForecastResult or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.ForecastResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
@overload
def external_cloud_provider_usage(
self,
external_cloud_provider_type: Union[str, _models.ExternalCloudProviderType],
external_cloud_provider_id: str,
parameters: IO,
filter: Optional[str] = None,
*,
content_type: str = "application/json",
**kwargs: Any
) -> _models.ForecastResult:
"""Lists the forecast charges for external cloud provider type defined.
:param external_cloud_provider_type: The external cloud provider type associated with
dimension/query operations. This includes 'externalSubscriptions' for linked account and
'externalBillingAccounts' for consolidated account. Known values are: "externalSubscriptions"
and "externalBillingAccounts". Required.
:type external_cloud_provider_type: str or
~azure.mgmt.costmanagement.models.ExternalCloudProviderType
:param external_cloud_provider_id: This can be '{externalSubscriptionId}' for linked account or
'{externalBillingAccountId}' for consolidated account used with dimension/query operations.
Required.
:type external_cloud_provider_id: str
:param parameters: Parameters supplied to the CreateOrUpdate Forecast Config operation.
Required.
:type parameters: IO
:param filter: May be used to filter forecasts by properties/usageDate (Utc time),
properties/chargeType or properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge',
and 'and'. It does not currently support 'ne', 'or', or 'not'. Default value is None.
:type filter: str
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
Default value is "application/json".
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: ForecastResult or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.ForecastResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
@distributed_trace
def external_cloud_provider_usage(
self,
external_cloud_provider_type: Union[str, _models.ExternalCloudProviderType],
external_cloud_provider_id: str,
parameters: Union[_models.ForecastDefinition, IO],
filter: Optional[str] = None,
**kwargs: Any
) -> _models.ForecastResult:
"""Lists the forecast charges for external cloud provider type defined.
:param external_cloud_provider_type: The external cloud provider type associated with
dimension/query operations. This includes 'externalSubscriptions' for linked account and
'externalBillingAccounts' for consolidated account. Known values are: "externalSubscriptions"
and "externalBillingAccounts". Required.
:type external_cloud_provider_type: str or
~azure.mgmt.costmanagement.models.ExternalCloudProviderType
:param external_cloud_provider_id: This can be '{externalSubscriptionId}' for linked account or
'{externalBillingAccountId}' for consolidated account used with dimension/query operations.
Required.
:type external_cloud_provider_id: str
:param parameters: Parameters supplied to the CreateOrUpdate Forecast Config operation. Is
either a model type or a IO type. Required.
:type parameters: ~azure.mgmt.costmanagement.models.ForecastDefinition or IO
:param filter: May be used to filter forecasts by properties/usageDate (Utc time),
properties/chargeType or properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge',
and 'and'. It does not currently support 'ne', 'or', or 'not'. Default value is None.
:type filter: str
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
Default value is None.
:paramtype content_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: ForecastResult or the result of cls(response)
:rtype: ~azure.mgmt.costmanagement.models.ForecastResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version = kwargs.pop(
"api_version", _params.pop("api-version", self._config.api_version)
) # type: Literal["2022-10-01"]
content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str]
cls = kwargs.pop("cls", None) # type: ClsType[_models.ForecastResult]
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(parameters, (IO, bytes)):
_content = parameters
else:
_json = self._serialize.body(parameters, "ForecastDefinition")
request = build_external_cloud_provider_usage_request(
external_cloud_provider_type=external_cloud_provider_type,
external_cloud_provider_id=external_cloud_provider_id,
filter=filter,
api_version=api_version,
content_type=content_type,
json=_json,
content=_content,
template_url=self.external_cloud_provider_usage.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url) # type: ignore
pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request, stream=False, **kwargs
)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize("ForecastResult", pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
external_cloud_provider_usage.metadata = {"url": "/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/forecast"} # type: ignore
| {
"content_hash": "4e4ae348433476f21f9e4ec4bd77ff0a",
"timestamp": "",
"source": "github",
"line_count": 484,
"max_line_length": 170,
"avg_line_length": 49.71694214876033,
"alnum_prop": 0.6764742550804139,
"repo_name": "Azure/azure-sdk-for-python",
"id": "87053c2968cf68362bace45740eff472918d156b",
"size": "24563",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "sdk/costmanagement/azure-mgmt-costmanagement/azure/mgmt/costmanagement/operations/_forecast_operations.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "1224"
},
{
"name": "Bicep",
"bytes": "24196"
},
{
"name": "CSS",
"bytes": "6089"
},
{
"name": "Dockerfile",
"bytes": "4892"
},
{
"name": "HTML",
"bytes": "12058"
},
{
"name": "JavaScript",
"bytes": "8137"
},
{
"name": "Jinja",
"bytes": "10377"
},
{
"name": "Jupyter Notebook",
"bytes": "272022"
},
{
"name": "PowerShell",
"bytes": "518535"
},
{
"name": "Python",
"bytes": "715484989"
},
{
"name": "Shell",
"bytes": "3631"
}
],
"symlink_target": ""
} |
package com.geishatokyo.sqlgen.process.input
import com.geishatokyo.sqlgen.core.Workbook
import com.geishatokyo.sqlgen.process.{Context, ImportProc, InputProc}
/**
* Created by takezoux2 on 2017/07/05.
*/
class WorkbookImportProc(workbook: Workbook) extends ImportProc {
override def load(c: Context): Option[Workbook] = {
Some(workbook)
}
}
| {
"content_hash": "7ea1655cfb7e1099035a83d54f19620f",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 70,
"avg_line_length": 25.5,
"alnum_prop": 0.7535014005602241,
"repo_name": "geishatokyo/sql-generator",
"id": "1396256b4d193d81e45b843b0462f9c2d678cf87",
"size": "357",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "src/main/scala/com/geishatokyo/sqlgen/process/input/WorkbookImportProc.scala",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Scala",
"bytes": "127581"
}
],
"symlink_target": ""
} |
package edu.sjsu.cmpe275.team6.SnippetShare;
import edu.sjsu.cmpe275.team6.SnippetShare.dao.BoardDAO;
import edu.sjsu.cmpe275.team6.SnippetShare.dao.RequestDAO;
import edu.sjsu.cmpe275.team6.SnippetShare.dao.UserDAO;
import edu.sjsu.cmpe275.team6.SnippetShare.model.Board;
import edu.sjsu.cmpe275.team6.SnippetShare.model.User;
import org.junit.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import java.util.ArrayList;
import java.util.List;
/**
* Created by Rucha on 5/1/15.
*/
public class RequestDaoTest {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("spring-module.xml");
RequestDAO requestDAO = (RequestDAO) context.getBean("requestDAO");
UserDAO userDAO = (UserDAO) context.getBean("userDAO");
BoardDAO boardDAO = (BoardDAO) context.getBean("boardDAO");
@Test
public void addRequest(){
List<User> requestors = new ArrayList<User>();
User user = userDAO.findByUserId(1);
Board board = boardDAO.findByBoardId(4);
requestDAO.addRequest(board,user);
requestors = board.getRequestors();
System.out.println("requestors::" + requestors);
assert (!requestors.isEmpty());
}
@Test
public void approveRequest(){
User user = userDAO.findByUserId(1);
Board board = boardDAO.findByBoardId(4);
requestDAO.approveRequest(board,user);
List<User> members = new ArrayList<User>();
members = board.getMembers();
System.out.println("Members::" + members);
assert (!members.isEmpty());
}
@Test
public void removeAccess(){
Board board = boardDAO.findByBoardId(4);
User user = userDAO.findByUserId(1);
requestDAO.removeAccess(board,user);
List<User> members = new ArrayList<User>();
members = board.getMembers();
assert (!members.contains(user.getUserid()));
}
@Test
public void denyAccess(){
User user = userDAO.findByUserId(2);
Board board = boardDAO.findByBoardId(4);
requestDAO.addRequest(board,user);
System.out.println("Sent Request...");
requestDAO.denyRequest(board,user);
System.out.println("Access denied..");
List<User> members = new ArrayList<User>();
members = board.getMembers();
assert (!members.contains(user.getUserid()));
}
}
| {
"content_hash": "12f168d5c0cd27865c335d1f98cdde84",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 101,
"avg_line_length": 33.816901408450704,
"alnum_prop": 0.675551853394419,
"repo_name": "jiangxiaoli/SnippetShare",
"id": "13110526d69ee6586ea2db690cbf0cdab802a0fc",
"size": "2401",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/test/java/edu/sjsu/cmpe275/team6/SnippetShare/RequestDaoTest.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "4354"
},
{
"name": "HTML",
"bytes": "51198"
},
{
"name": "Java",
"bytes": "126446"
},
{
"name": "JavaScript",
"bytes": "62266"
}
],
"symlink_target": ""
} |
package org.lielas.lielasdataloggerstudio.main.Fragments;
import android.content.Context;
import android.os.Bundle;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.Spinner;
import org.lielas.dataloggerstudio.lib.FileCreator.CsvFileCreator;
import org.lielas.dataloggerstudio.lib.FileCreator.FileCreator;
import org.lielas.dataloggerstudio.lib.Logger.UsbCube.UsbCube;
import org.lielas.dataloggerstudio.lib.LoggerRecord;
import org.lielas.lielasdataloggerstudio.R;
import org.lielas.lielasdataloggerstudio.main.FileSaver.AndroidFileSaver;
import org.lielas.lielasdataloggerstudio.main.LielasToast;
import org.lielas.lielasdataloggerstudio.main.LoggerRecordManager;
import java.util.ArrayList;
import java.util.List;
/**
* Created by Andi on 21.02.2015.
*/
public class ExportFragment extends LielasFragment {
Spinner logfilesSpinner;
Spinner delimiterSpinner;
Spinner commaSpinner;
EditText filename;
Button saveBttn;
CheckBox chkOverwrite;
private boolean userinteraction;
private ImageButton navLeft;
public static ExportFragment newInstance(){
ExportFragment f = new ExportFragment();
return f;
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceSet){
Context context = getActivity();
View v = inflater.inflate(R.layout.export_fragment, container, false);
if(context != null){
delimiterSpinner = (Spinner) v.findViewById(R.id.spExportDelimiterData);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(context, android.R.layout.simple_list_item_1, getDelimiterList());
delimiterSpinner.setAdapter(adapter);
commaSpinner = (Spinner) v.findViewById(R.id.spExportCommaData);
adapter = new ArrayAdapter<String>(context, android.R.layout.simple_list_item_1, getCommaList());
commaSpinner.setAdapter(adapter);
logfilesSpinner = (Spinner)v.findViewById(R.id.spExportLogfileData);
logfilesSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
LogfileSpinnerSelectionChanged();
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
userinteraction = false;
logfilesSpinner.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
userinteraction = true;
return false;
}
});
logfilesSpinner.setVisibility(View.INVISIBLE);
saveBttn = (Button)v.findViewById(R.id.bttnExportBttn);
saveBttn.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v){
onButtonClick(v);
}
});
chkOverwrite = (CheckBox) v.findViewById(R.id.chkOverwrite);
filename = (EditText)v.findViewById(R.id.txtFilename);
navLeft = (ImageButton)v.findViewById(R.id.exportNavLeft);
navLeft.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ViewPager pager = (ViewPager)getActivity().findViewById(R.id.viewpager);
pager.setCurrentItem(pager.getCurrentItem() - 1);
}
});
updateUI();
}
return v;
}
@Override
public void onResume(){
super.onResume();
updateUI();
}
@Override
public void onDestroyView(){
super.onDestroyView();
}
private List<String> getDelimiterList(){
List<String> list = new ArrayList<String>();
list.add(";");
list.add(".");
list.add(",");
list.add("tab");
list.add("space");
return list;
}
private List<String> getCommaList(){
List<String> list = new ArrayList<String>();
list.add(",");
list.add(".");
return list;
}
@Override
public void update(){
updateUI();
}
public void updateUI(){
UsbCube l = (UsbCube) logger;
if(this.logfilesSpinner == null){
return;
}
if(l == null || l.getCommunicationInterface() == null){
return;
}
if(l.getCommunicationInterface().isOpen() && l.getRecordCount() > 0){
ArrayAdapter<LoggerRecord> adapter = new ArrayAdapter<LoggerRecord>(getActivity(), R.layout.logfile_spinner_item, l.getRecordsetArray());
logfilesSpinner.setAdapter(adapter);
logfilesSpinner.setVisibility(View.VISIBLE);
LoggerRecord lr = LoggerRecordManager.getInstance().getActiveLoggerRecord();
if(lr != null) {
LoggerRecord loggerRecords[] = l.getRecordsetArray();
for (int i = 0; i < loggerRecords.length; i++) {
if (loggerRecords[i].getId() == lr.getId()) {
logfilesSpinner.setSelection(i);
break;
}
}
filename.setText(lr.getName());
}
}else if(l.getRecordCount() == 0){
//create empty adapter
String[] emptyString = new String[1];
emptyString[0] = " ";
ArrayAdapter<String> adapter = new ArrayAdapter<String>(getActivity(), R.layout.logfile_spinner_item, emptyString);
logfilesSpinner.setAdapter(adapter);
logfilesSpinner.setVisibility(View.INVISIBLE);
filename.setText("");
chkOverwrite.setChecked(false);
}
}
private void LogfileSpinnerSelectionChanged(){
if(!userinteraction) {
return;
}
userinteraction = false;
LoggerRecord lr = (LoggerRecord)logfilesSpinner.getSelectedItem();
if(LoggerRecordManager.getInstance().getActiveLoggerRecord() == null ||
lr.getId() != LoggerRecordManager.getInstance().getActiveLoggerRecord().getId()) {
LoggerRecordManager.getInstance().setActiveLoggerRecord(lr);
updateManager.update();
}
}
private void onButtonClick(View v){
int status;
String fname = filename.getText().toString();
LoggerRecord lr = LoggerRecordManager.getInstance().getActiveLoggerRecord();
if(lr == null){
new LielasToast().show("No logfile selected", getActivity());
return;
}
if(lr.getCount() != (lr.getEndIndex() - lr.getStartIndex() + 1)){
new LielasToast().show("No data pressent, please go to Data and load the logfile", getActivity());
return;
}
if(fname == null || fname.equals("")){
new LielasToast().show("Please specify a filename", getActivity());
return;
}
if(fname.contains(" ") ||fname.contains("\n")){
new LielasToast().show("The filename may not include spaces or newlines", getActivity());
return;
}
fname = fname + ".csv";
AndroidFileSaver fileSaver = new AndroidFileSaver();
CsvFileCreator fileCreator = new CsvFileCreator();
fileCreator.setFileSaverType(fileSaver);
fileCreator.setDelimiter(delimiterSpinner.getSelectedItem().toString());
fileCreator.setComma(commaSpinner.getSelectedItem().toString());
fileCreator.setPath(fname);
fileCreator.create(LoggerRecordManager.getInstance().getActiveLoggerRecord());
status = fileCreator.save(LoggerRecordManager.getInstance().getActiveLoggerRecord(), chkOverwrite.isChecked());
if(status == FileCreator.STATUS_OK){
new LielasToast().show("File successfully written to Download/lielas", getActivity());
}else if(status == FileCreator.STATUS_FILE_EXISTS){
new LielasToast().show("File already exists", getActivity());
}else{
new LielasToast().show("Failed to write file", getActivity());
}
}
}
| {
"content_hash": "1ebaa4d1c9893ff172304c538217d044",
"timestamp": "",
"source": "github",
"line_count": 254,
"max_line_length": 149,
"avg_line_length": 34.28740157480315,
"alnum_prop": 0.6192444597542772,
"repo_name": "anre/LielasDataloggerstudio",
"id": "35b964c1798ca3d9a7a9b6856b45fa15f58ca114",
"size": "8709",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/dataloggerstudio/android/lielasdataloggerstudio/main/Fragments/ExportFragment.java",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "139669"
},
{
"name": "HTML",
"bytes": "507"
},
{
"name": "Inno Setup",
"bytes": "8000"
},
{
"name": "Java",
"bytes": "858730"
},
{
"name": "JavaScript",
"bytes": "75562"
},
{
"name": "PHP",
"bytes": "120661"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
namespace Simocracy.SportSim
{
/// <summary>
/// Wiki-Vorlage einer Gruppenvorlage
/// </summary>
[DataContract]
[DebuggerDisplay("LeagueWikiTemplate, Name={Name}")]
public class LeagueWikiTemplate : WikiTemplate
{
#region Members
private static LeagueWikiTemplate _NoneTemplate = new LeagueWikiTemplate(-1, String.Empty, String.Empty, 0, false, false);
private int _LeagueSize;
private bool _IsDate;
private bool _IsLocation;
#endregion
#region Constructor
/// <summary>
/// Definiert eine neue Gruppenvorlage
/// </summary>
/// <param name="id">ID</param>
/// <param name="name">Vorlagenname</param>
public LeagueWikiTemplate(int id, string name)
: this(id, name, String.Empty, 0)
{ }
/// <summary>
/// Definiert eine neue Gruppenvorlage
/// </summary>
/// <param name="id">ID</param>
/// <param name="name">Vorlagenname</param>
/// <param name="templateCode">Einbindungscode der Vorlage</param>
/// <param name="leagueSize">Gruppengröße</param>
public LeagueWikiTemplate(int id, string name, string templateCode, int leagueSize)
: this(id, name, templateCode, 0, false, false)
{ }
/// <summary>
/// Definiert eine neue Gruppenvorlage
/// </summary>
/// <param name="id">ID</param>
/// <param name="name">Vorlagenname</param>
/// <param name="templateCode">Einbindungscode der Vorlage</param>
/// <param name="leagueSize">Gruppengröße</param>
/// <param name="isDate">Angabe ob Datum enthalten ist</param>
/// <param name="isLocation">Angabe ob Ort enthalten ist</param>
public LeagueWikiTemplate(int id, string name, string templateCode, int leagueSize, bool isDate, bool isLocation)
: base(id, name, templateCode)
{
LeagueSize = leagueSize;
IsDate = isDate;
IsLocation = isLocation;
}
#endregion
#region Properties
/// <summary>
/// Leere Vorlage
/// </summary>
[IgnoreDataMember]
public static LeagueWikiTemplate NoneTemplate
{
get { return _NoneTemplate; }
}
/// <summary>
/// Gruppengröße
/// </summary>
[DataMember(Order = 1000)]
public int LeagueSize
{
get { return _LeagueSize; }
set { _LeagueSize = value; Notify(); }
}
/// <summary>
/// Ist Datumsangabe enthalten
/// </summary>
[DataMember(Order = 1010)]
public bool IsDate
{
get { return _IsDate; }
set { _IsDate = value; Notify(); }
}
/// <summary>
/// Ist Ortsangabe Enthalten
/// </summary>
[DataMember(Order = 1020)]
public bool IsLocation
{
get { return _IsLocation; }
set { _IsLocation = value; Notify(); }
}
#endregion
#region Overrided Methods
/// <summary>
/// Gibt einen <see cref="String"/> zurück, der das Objekt darstellt.
/// </summary>
/// <returns>Objekt als String</returns>
public override string ToString()
{
return String.Format("{0} LeagueSize={1} IsDate={2} IsLocation={3}", base.ToString(), LeagueSize, IsDate, IsLocation);
}
#endregion
}
}
| {
"content_hash": "397821c3ed91c82dcc2f746bc016fbdc",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 124,
"avg_line_length": 25,
"alnum_prop": 0.66976,
"repo_name": "Simocracy/Simocracy-Sports-Simulator",
"id": "4a1d387ac5f7c35f6f8860ab54aa32a4820413b4",
"size": "3134",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "SportSim/Data/LeagueWikiTemplate.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "2542"
},
{
"name": "C#",
"bytes": "281407"
},
{
"name": "HTML",
"bytes": "16789"
}
],
"symlink_target": ""
} |
// @formatter:off
// @formatter:on
package org.tensorics.core.commons.operations;
/**
* Static utility methods pertaining to {@link Conversion} instances.
*
* @author caguiler
*/
public final class Conversions {
/**
* Returns the identity conversion.
*/
@SuppressWarnings("unchecked")
public static <T> Conversion<T, T> identity() {
return (Conversion<T, T>) IdentityConversion.INSTANCE;
}
private enum IdentityConversion implements Conversion<Object, Object> {
INSTANCE;
@Override
public Object apply(Object input) {
return input;
}
}
}
| {
"content_hash": "aeae6c1fba34a306918ac62875641c17",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 75,
"avg_line_length": 22.2,
"alnum_prop": 0.6081081081081081,
"repo_name": "tensorics/tensorics.github.io",
"id": "c0584269ff542e6ced75b7f626bc8727e593bfbc",
"size": "1504",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "projects/tensorics-core/src/java/org/tensorics/core/commons/operations/Conversions.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "34298"
},
{
"name": "HTML",
"bytes": "74670"
},
{
"name": "Java",
"bytes": "1663226"
},
{
"name": "JavaScript",
"bytes": "3136"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Castle.MicroKernel.Registration;
using Castle.MicroKernel.SubSystems.Configuration;
using Castle.Windsor;
namespace Snake.App.ContainerInstallers
{
public class WindsorInstaller
{
public void Install(IWindsorContainer container, IConfigurationStore store)
{
//注册窗体和视图
//注册服务
}
}
}
| {
"content_hash": "db52b65efb9adfe5ce74b0016c4b1f99",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 83,
"avg_line_length": 21.272727272727273,
"alnum_prop": 0.7115384615384616,
"repo_name": "yepeng2002/Snake",
"id": "87d33697ff1d9cbf9d7bc43c988b6ed6755fa60e",
"size": "492",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Snake.App/ContainerInstallers/WindsorInstaller.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ASP.NET",
"bytes": "420"
},
{
"name": "Batchfile",
"bytes": "1114"
},
{
"name": "C#",
"bytes": "530826"
},
{
"name": "CSS",
"bytes": "10504"
},
{
"name": "HTML",
"bytes": "59784"
},
{
"name": "JavaScript",
"bytes": "936264"
}
],
"symlink_target": ""
} |
package ajuda.ai.backend.v1.util;
import javax.enterprise.context.RequestScoped;
import javax.enterprise.event.Event;
import javax.enterprise.inject.Specializes;
import javax.inject.Inject;
import javax.servlet.FilterChain;
import br.com.caelum.vraptor.Result;
import br.com.caelum.vraptor.controller.DefaultControllerNotFoundHandler;
import br.com.caelum.vraptor.controller.HttpMethod;
import br.com.caelum.vraptor.events.ControllerNotFound;
import br.com.caelum.vraptor.http.MutableRequest;
import br.com.caelum.vraptor.http.MutableResponse;
import br.com.caelum.vraptor.http.route.ControllerNotFoundException;
import br.com.caelum.vraptor.http.route.Router;
import br.com.caelum.vraptor.view.Results;
/**
* Tenta acessar uma URL colocando um "/" no final antes de dar um 404.
*
* @author Rafael Lins
*
*/
@Specializes
@RequestScoped
public class Error404 extends DefaultControllerNotFoundHandler {
private final Router router;
private final Result result;
@Inject
public Error404(final Router router, final Result result, final Event<ControllerNotFound> event) {
super(event);
this.router = router;
this.result = result;
}
/**
* @deprecated CDI eyes only
*/
@Deprecated
public Error404() {
this(null, null, null);
}
@Override
public void couldntFind(final FilterChain chain, final MutableRequest request, final MutableResponse response) {
try {
final String uri = request.getRequestedUri();
if (uri.endsWith("/")) {
tryMovePermanentlyTo(request, uri.substring(0, uri.length() - 1));
} else {
tryMovePermanentlyTo(request, uri + "/");
}
} catch (final ControllerNotFoundException ex) {
super.couldntFind(chain, request, response);
}
}
private void tryMovePermanentlyTo(final MutableRequest request, final String newUri) {
router.parse(newUri, HttpMethod.of(request), request);
result.use(Results.status()).movedPermanentlyTo(newUri);
}
} | {
"content_hash": "ecc271ac33dc01fc7974751805ab44d1",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 113,
"avg_line_length": 29.523076923076925,
"alnum_prop": 0.7613340281396561,
"repo_name": "g0dkar/ajuda-ai",
"id": "97139152900cab99f6cea57d6ec57a57931baa2c",
"size": "1919",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ajuda.ai/backend/src/main/java/ajuda/ai/backend/v1/util/Error404.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "188433"
},
{
"name": "HTML",
"bytes": "80349"
},
{
"name": "Java",
"bytes": "271055"
},
{
"name": "JavaScript",
"bytes": "1765686"
}
],
"symlink_target": ""
} |
cask 'airfoil' do
version '5.6.2'
sha256 '0efe57559b8da1e16e0b792b6fb72e33870d3d7db9bd1876abaa5293a7730f6f'
url 'https://rogueamoeba.com/airfoil/download/Airfoil.zip'
appcast 'https://rogueamoeba.net/ping/versionCheck.cgi?format=sparkle&bundleid=com.rogueamoeba.Airfoil&platform=osx',
checkpoint: 'c1954b71e71ef9708e60b4091f8e78dfa1ba959e69e952edb329aa18825a6365'
name 'Airfoil'
homepage 'https://www.rogueamoeba.com/airfoil/mac/'
auto_updates true
depends_on macos: '>= :mavericks'
app 'Airfoil/Airfoil Satellite.app'
app 'Airfoil/Airfoil.app'
zap quit: [
'com.rogueamoeba.Airfoil',
'com.rogueamoeba.AirfoilSpeakers',
],
login_item: 'Airfoil Satellite',
delete: [
'/Library/Audio/Plug-Ins/HAL/InstantOn.driver',
'~/Library/Application Support/Airfoil',
'~/Library/Application Support/Airfoil Satellite',
'~/Library/Caches/com.rogueamoeba.Airfoil',
'~/Library/Caches/com.rogueamoeba.AirfoilSpeakers',
'~/Library/Preferences/com.rogueamoeba.Airfoil.plist',
'~/Library/Preferences/com.rogueamoeba.AirfoilSpeakers.plist',
'~/Library/Saved Application State/com.rogueamoeba.Airfoil.savedState',
'~/Library/Saved Application State/com.rogueamoeba.AirfoilSpeakers.savedState',
]
end
| {
"content_hash": "5230547c0c8f5d88a53c4f06c610c057",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 119,
"avg_line_length": 45.18181818181818,
"alnum_prop": 0.636485580147552,
"repo_name": "kkdd/homebrew-cask",
"id": "1e3081cb1cda2612817279caa334c50d49443dc5",
"size": "1491",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Casks/airfoil.rb",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "Ruby",
"bytes": "2145766"
},
{
"name": "Shell",
"bytes": "56584"
}
],
"symlink_target": ""
} |
import PropTypes from 'prop-types';
import React, { PureComponent } from 'react';
import {
View,
Text,
TextInput,
Animated,
StyleSheet,
Platform,
ViewPropTypes,
} from 'react-native';
import RN from 'react-native/package.json';
import Line from '../line';
import Label from '../label';
import Affix from '../affix';
import Helper from '../helper';
import Counter from '../counter';
import styles from './styles.js';
export default class TextField extends PureComponent {
static defaultProps = {
underlineColorAndroid: 'transparent',
disableFullscreenUI: true,
autoCapitalize: 'sentences',
blurOnSubmit: true,
editable: true,
animationDuration: 225,
fontSize: 16,
titleFontSize: 12,
labelFontSize: 12,
labelHeight: 32,
labelPadding: 4,
tintColor: 'rgb(0, 145, 234)',
textColor: 'rgba(0, 0, 0, .87)',
baseColor: 'rgba(0, 0, 0, .38)',
errorColor: 'rgb(213, 0, 0)',
disabled: false,
};
static propTypes = {
...TextInput.propTypes,
animationDuration: PropTypes.number,
fontSize: PropTypes.number,
titleFontSize: PropTypes.number,
labelFontSize: PropTypes.number,
labelHeight: PropTypes.number,
labelPadding: PropTypes.number,
labelTextStyle: Text.propTypes.style,
titleTextStyle: Text.propTypes.style,
affixTextStyle: Text.propTypes.style,
tintColor: PropTypes.string,
textColor: PropTypes.string,
baseColor: PropTypes.string,
label: PropTypes.string.isRequired,
title: PropTypes.string,
characterRestriction: PropTypes.number,
error: PropTypes.string,
errorColor: PropTypes.string,
disabled: PropTypes.bool,
renderAccessory: PropTypes.func,
prefix: PropTypes.string,
suffix: PropTypes.string,
containerStyle: (ViewPropTypes || View.propTypes).style,
};
constructor(props) {
super(props);
this.onBlur = this.onBlur.bind(this);
this.onFocus = this.onFocus.bind(this);
this.onPress = this.focus.bind(this);
this.onChange = this.onChange.bind(this);
this.onChangeText = this.onChangeText.bind(this);
this.onContentSizeChange = this.onContentSizeChange.bind(this);
this.updateRef = this.updateRef.bind(this, 'input');
let { value, error, fontSize } = this.props;
this.mounted = false;
this.state = {
text: value,
focus: new Animated.Value(error? -1 : 0),
focused: false,
receivedFocus: false,
error: error,
errored: !!error,
height: fontSize * 1.5,
};
}
componentWillReceiveProps(props) {
let { error } = this.state;
if (null != props.value) {
this.setState({ text: props.value });
}
if (props.error && props.error !== error) {
this.setState({ error: props.error });
}
if (props.error !== this.props.error) {
this.setState({ errored: !!props.error });
}
}
componentDidMount() {
this.mounted = true;
}
componentWillUnmount() {
this.mounted = false;
}
componentWillUpdate(props, state) {
let { error, animationDuration } = this.props;
let { focus, focused } = this.state;
if (props.error !== error || focused ^ state.focused) {
Animated
.timing(focus, {
toValue: props.error? -1 : (state.focused? 1 : 0),
duration: animationDuration,
})
.start(() => {
if (this.mounted) {
this.setState((state, { error }) => ({ error }));
}
});
}
}
updateRef(name, ref) {
this[name] = ref;
}
focus() {
let { disabled, editable } = this.props;
if (!disabled && editable) {
this.input.focus();
}
}
blur() {
this.input.blur();
}
clear() {
this.input.clear();
}
value() {
let { text, receivedFocus } = this.state;
let { value, defaultValue } = this.props;
return (receivedFocus || null != value || null == defaultValue)?
text:
defaultValue;
}
isFocused() {
return this.input.isFocused();
}
isRestricted() {
let { characterRestriction } = this.props;
let { text = '' } = this.state;
return characterRestriction < text.length;
}
onFocus(event) {
let { onFocus } = this.props;
if ('function' === typeof onFocus) {
onFocus(event);
}
this.setState({ focused: true, receivedFocus: true });
}
onBlur(event) {
let { onBlur } = this.props;
if ('function' === typeof onBlur) {
onBlur(event);
}
this.setState({ focused: false });
}
onChange(event) {
let { onChange, multiline } = this.props;
if ('function' === typeof onChange) {
onChange(event);
}
/* XXX: onContentSizeChange is not called on RN 0.44 and 0.45 */
if (multiline && 'android' === Platform.OS) {
if (/^0\.4[45]\./.test(RN.version)) {
this.onContentSizeChange(event);
}
}
}
onChangeText(text) {
let { onChangeText } = this.props;
this.setState({ text });
if ('function' === typeof onChangeText) {
onChangeText(text);
}
}
onContentSizeChange(event) {
let { onContentSizeChange, fontSize } = this.props;
let { height } = event.nativeEvent.contentSize;
if ('function' === typeof onContentSizeChange) {
onContentSizeChange(event);
}
this.setState({
height: Math.max(
fontSize * 1.5,
Math.ceil(height) + Platform.select({ ios: 5, android: 1 })
),
});
}
renderAccessory() {
let { renderAccessory } = this.props;
if ('function' !== typeof renderAccessory) {
return null;
}
return (
<View style={styles.accessory}>
{renderAccessory()}
</View>
);
}
renderAffix(type, active, focused) {
let {
[type]: affix,
fontSize,
baseColor,
animationDuration,
affixTextStyle,
} = this.props;
if (null == affix) {
return null;
}
let props = {
type,
active,
focused,
fontSize,
baseColor,
animationDuration,
};
return (
<Affix style={affixTextStyle} {...props}>{affix}</Affix>
);
}
render() {
let { receivedFocus, focus, focused, error, errored, height, text = '' } = this.state;
let {
style,
label,
title,
value,
defaultValue,
characterRestriction: limit,
editable,
disabled,
animationDuration,
fontSize,
titleFontSize,
labelFontSize,
labelHeight,
labelPadding,
labelTextStyle,
titleTextStyle,
tintColor,
baseColor,
textColor,
errorColor,
containerStyle,
...props
} = this.props;
if (props.multiline && props.height) {
/* Disable autogrow if height is passed as prop */
height = props.height;
}
let defaultVisible = !(receivedFocus || null != value || null == defaultValue);
value = defaultVisible?
defaultValue:
text;
let active = !!(value || props.placeholder);
let count = value.length;
let restricted = limit < count;
let borderBottomColor = restricted?
errorColor:
focus.interpolate({
inputRange: [-1, 0, 1],
outputRange: [errorColor, baseColor, tintColor],
});
let borderBottomWidth = restricted?
2:
focus.interpolate({
inputRange: [-1, 0, 1],
outputRange: [2, StyleSheet.hairlineWidth, 2],
});
let paddingBottom = 8;
let inputContainerStyle = {
paddingTop: labelHeight,
paddingBottom,
...(disabled?
{ overflow: 'hidden' }:
{ borderBottomColor, borderBottomWidth }),
...(props.multiline?
{ height: labelHeight + paddingBottom + height }:
{ height: labelHeight + paddingBottom + fontSize * 1.5 }),
};
let inputStyle = {
fontSize,
color: (disabled || defaultVisible)?
baseColor:
textColor,
...(props.multiline?
{
height: fontSize * 1.5 + height,
...Platform.select({
ios: { top: -1 },
android: { textAlignVertical: 'top' },
}),
}:
{ height: fontSize * 1.5 }),
};
let errorStyle = {
color: errorColor,
opacity: focus.interpolate({
inputRange: [-1, 0, 1],
outputRange: [1, 0, 0],
}),
fontSize: title?
titleFontSize:
focus.interpolate({
inputRange: [-1, 0, 1],
outputRange: [titleFontSize, 0, 0],
}),
};
let titleStyle = {
color: baseColor,
opacity: focus.interpolate({
inputRange: [-1, 0, 1],
outputRange: [0, 1, 1],
}),
fontSize: titleFontSize,
};
let helperContainerStyle = {
flexDirection: 'row',
height: (title || limit)?
titleFontSize * 2:
focus.interpolate({
inputRange: [-1, 0, 1],
outputRange: [titleFontSize * 2, 8, 8],
}),
};
let containerProps = {
style: containerStyle,
onStartShouldSetResponder: () => true,
onResponderRelease: this.onPress,
pointerEvents: !disabled && editable?
'auto':
'none',
};
let labelProps = {
baseSize: labelHeight,
basePadding: labelPadding,
fontSize,
activeFontSize: labelFontSize,
tintColor,
baseColor,
errorColor,
animationDuration,
active,
focused,
errored,
restricted,
style: labelTextStyle,
};
let counterProps = {
baseColor,
errorColor,
count,
limit,
fontSize: titleFontSize,
style: titleTextStyle,
};
return (
<View {...containerProps}>
<Animated.View style={[styles.inputContainer, inputContainerStyle]}>
{disabled && <Line type='dotted' color={baseColor} />}
<Label {...labelProps}>{label}</Label>
<View style={styles.row}>
{this.renderAffix('prefix', active, focused)}
<TextInput
style={[styles.input, inputStyle, style]}
selectionColor={tintColor}
{...props}
editable={!disabled && editable}
onChange={this.onChange}
onChangeText={this.onChangeText}
onContentSizeChange={this.onContentSizeChange}
onFocus={this.onFocus}
onBlur={this.onBlur}
value={value}
ref={this.updateRef}
/>
{this.renderAffix('suffix', active, focused)}
{this.renderAccessory()}
</View>
</Animated.View>
<Animated.View style={helperContainerStyle}>
<View style={styles.flex}>
<Helper style={[errorStyle, titleTextStyle]}>{error}</Helper>
<Helper style={[titleStyle, titleTextStyle]}>{title}</Helper>
</View>
<Counter {...counterProps} />
</Animated.View>
</View>
);
}
}
| {
"content_hash": "415d89cb8c09d90469532d79fbd9e688",
"timestamp": "",
"source": "github",
"line_count": 500,
"max_line_length": 90,
"avg_line_length": 22.008,
"alnum_prop": 0.5717920756088695,
"repo_name": "RahulDesai92/PHR",
"id": "28358774401f54c9d7016f3f41f80cbf4fe34e02",
"size": "11004",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "node_modules/react-native-material-dropdown/node_modules/react-native-material-textfield/src/components/field/index.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "JavaScript",
"bytes": "179048"
}
],
"symlink_target": ""
} |
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="com.hiernate.persistence.User" table="tb_User" lazy="false"><!-- name指定持久化类的包名和类名,table指定数据库中的表名 -->
<id name="id" column="Id" type="int" >
<generator class="increment" /> <!--确定id为主键,增量为1-->
</id>
<property name="userName" column="userName" type="string" />
<property name="pwd" column="pwd" type="string"/>
<property name="name" column="name" type="string"/>
<property name="purview" column="purview" type="string"/>
<property name="branch" column="branch" type="string"/>
<property name="job" column="job" type="string"/>
<property name="sex" column="sex" type="string"/>
<property name="email" column="email" type="string"/>
<property name="tel" column="tel" type="string"/>
<property name="address" column="address" type="string"/>
<property name="bestMan" column="bestMan" type="int"/>
</class>
</hibernate-mapping>
| {
"content_hash": "0ced8e16142b97fce388148f2324f271",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 120,
"avg_line_length": 54.27272727272727,
"alnum_prop": 0.602177554438861,
"repo_name": "java-scott/java-project",
"id": "ea2ed119642c91d6597d71c60758ff46e175b4e6",
"size": "1258",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "实战突击:JavaWeb项目整合开发/08/WebRoot/WEB-INF/classes/com/hiernate/persistence/User.hbm.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "76093"
},
{
"name": "FreeMarker",
"bytes": "4912"
},
{
"name": "HTML",
"bytes": "78841"
},
{
"name": "Java",
"bytes": "4357896"
},
{
"name": "JavaScript",
"bytes": "68490"
}
],
"symlink_target": ""
} |
from django.contrib.contenttypes.models import ContentType
from django.utils.translation import ugettext as _
from django.utils import timezone
from taiga.base import response
from taiga.base.decorators import detail_route
from taiga.base.api import ReadOnlyListViewSet
from taiga.mdrender.service import render as mdrender
from . import permissions
from . import serializers
from . import services
class HistoryViewSet(ReadOnlyListViewSet):
serializer_class = serializers.HistoryEntrySerializer
content_type = None
def get_content_type(self):
app_name, model = self.content_type.split(".", 1)
return ContentType.objects.get_by_natural_key(app_name, model)
def get_queryset(self):
ct = self.get_content_type()
model_cls = ct.model_class()
qs = model_cls.objects.all()
filtered_qs = self.filter_queryset(qs)
return filtered_qs
def response_for_queryset(self, queryset):
# Switch between paginated or standard style responses
page = self.paginate_queryset(queryset)
if page is not None:
serializer = self.get_pagination_serializer(page)
else:
serializer = self.get_serializer(queryset, many=True)
return response.Ok(serializer.data)
@detail_route(methods=['get'])
def comment_versions(self, request, pk):
obj = self.get_object()
history_entry_id = request.QUERY_PARAMS.get('id', None)
history_entry = services.get_history_queryset_by_model_instance(obj).filter(id=history_entry_id).first()
if history_entry is None:
return response.NotFound()
self.check_permissions(request, 'comment_versions', history_entry)
if history_entry is None:
return response.NotFound()
history_entry.attach_user_info_to_comment_versions()
return response.Ok(history_entry.comment_versions)
@detail_route(methods=['post'])
def edit_comment(self, request, pk):
obj = self.get_object()
history_entry_id = request.QUERY_PARAMS.get('id', None)
history_entry = services.get_history_queryset_by_model_instance(obj).filter(id=history_entry_id).first()
if history_entry is None:
return response.NotFound()
obj = services.get_instance_from_key(history_entry.key)
comment = request.DATA.get("comment", None)
self.check_permissions(request, 'edit_comment', history_entry)
if history_entry is None:
return response.NotFound()
if comment is None:
return response.BadRequest({"error": _("comment is required")})
if history_entry.delete_comment_date or history_entry.delete_comment_user:
return response.BadRequest({"error": _("deleted comments can't be edited")})
# comment_versions can be None if there are no historic versions of the comment
comment_versions = history_entry.comment_versions or []
comment_versions.append({
"date": history_entry.created_at,
"comment": history_entry.comment,
"comment_html": history_entry.comment_html,
"user": {
"id": request.user.pk,
}
})
history_entry.edit_comment_date = timezone.now()
history_entry.comment = comment
history_entry.comment_html = mdrender(obj.project, comment)
history_entry.comment_versions = comment_versions
history_entry.save()
return response.Ok()
@detail_route(methods=['post'])
def delete_comment(self, request, pk):
obj = self.get_object()
history_entry_id = request.QUERY_PARAMS.get('id', None)
history_entry = services.get_history_queryset_by_model_instance(obj).filter(id=history_entry_id).first()
if history_entry is None:
return response.NotFound()
self.check_permissions(request, 'delete_comment', history_entry)
if history_entry is None:
return response.NotFound()
if history_entry.delete_comment_date or history_entry.delete_comment_user:
return response.BadRequest({"error": _("Comment already deleted")})
history_entry.delete_comment_date = timezone.now()
history_entry.delete_comment_user = {"pk": request.user.pk, "name": request.user.get_full_name()}
history_entry.save()
return response.Ok()
@detail_route(methods=['post'])
def undelete_comment(self, request, pk):
obj = self.get_object()
history_entry_id = request.QUERY_PARAMS.get('id', None)
history_entry = services.get_history_queryset_by_model_instance(obj).filter(id=history_entry_id).first()
if history_entry is None:
return response.NotFound()
self.check_permissions(request, 'undelete_comment', history_entry)
if history_entry is None:
return response.NotFound()
if not history_entry.delete_comment_date and not history_entry.delete_comment_user:
return response.BadRequest({"error": _("Comment not deleted")})
history_entry.delete_comment_date = None
history_entry.delete_comment_user = None
history_entry.save()
return response.Ok()
# Just for restframework! Because it raises
# 404 on main api root if this method not exists.
def list(self, request):
return response.NotFound()
def retrieve(self, request, pk):
obj = self.get_object()
self.check_permissions(request, "retrieve", obj)
qs = services.get_history_queryset_by_model_instance(obj)
qs = services.prefetch_owners_in_history_queryset(qs)
return self.response_for_queryset(qs)
class EpicHistory(HistoryViewSet):
content_type = "epics.epic"
permission_classes = (permissions.EpicHistoryPermission,)
class UserStoryHistory(HistoryViewSet):
content_type = "userstories.userstory"
permission_classes = (permissions.UserStoryHistoryPermission,)
class TaskHistory(HistoryViewSet):
content_type = "tasks.task"
permission_classes = (permissions.TaskHistoryPermission,)
class IssueHistory(HistoryViewSet):
content_type = "issues.issue"
permission_classes = (permissions.IssueHistoryPermission,)
class WikiHistory(HistoryViewSet):
content_type = "wiki.wikipage"
permission_classes = (permissions.WikiHistoryPermission,)
| {
"content_hash": "ecdebb381e637390d745e5b309fb085d",
"timestamp": "",
"source": "github",
"line_count": 175,
"max_line_length": 112,
"avg_line_length": 36.61714285714286,
"alnum_prop": 0.6683832709113608,
"repo_name": "mattcongy/itshop",
"id": "17c2fa8343c4c72842f53be5fd52fdf854f4a8c6",
"size": "7344",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "docker-images/taigav2/taiga-back/taiga/projects/history/api.py",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "103474"
},
{
"name": "CoffeeScript",
"bytes": "3380"
},
{
"name": "HTML",
"bytes": "274547"
},
{
"name": "JavaScript",
"bytes": "203660"
},
{
"name": "Nginx",
"bytes": "1286"
},
{
"name": "Python",
"bytes": "3591150"
},
{
"name": "Ruby",
"bytes": "164978"
},
{
"name": "Shell",
"bytes": "5238"
}
],
"symlink_target": ""
} |
from okcoincnapi.HttpMD5Util import buildMySign,httpGet,httpPost
class OKCoinSpot:
def __init__(self,url,apikey,secretkey):
self.__url = url
self.__apikey = apikey
self.__secretkey = secretkey
#获取OKCOIN现货行情信息
def ticker(self,symbol = ''):
TICKER_RESOURCE = "/api/v1/ticker.do"
params=''
if symbol:
params = 'symbol=%(symbol)s' %{'symbol':symbol}
return httpGet(self.__url,TICKER_RESOURCE,params)
#获取OKCOIN现货市场深度信息
def depth(self,symbol = None, size = None):
DEPTH_RESOURCE = "/api/v1/depth.do"
params=[]
if symbol is not None:
params.append('symbol=%s' % symbol)
if size is not None:
params.append('size=%s' % size)
return httpGet(self.__url,DEPTH_RESOURCE,'&'.join(params))
#获取OKCOIN现货历史交易信息
def trades(self,symbol = None, since = None):
TRADES_RESOURCE = "/api/v1/trades.do"
params=[]
if symbol is not None:
params.append('symbol=%s' % symbol)
if since is not None:
params.append('since=%s' % since)
return httpGet(self.__url,TRADES_RESOURCE,'&'.join(params))
#获取用户现货账户信息
def userinfo(self):
USERINFO_RESOURCE = "/api/v1/userinfo.do"
params ={}
params['api_key'] = self.__apikey
params['sign'] = buildMySign(params,self.__secretkey)
return httpPost(self.__url,USERINFO_RESOURCE,params)
#现货交易
def trade(self,symbol,tradeType,price='',amount=''):
TRADE_RESOURCE = "/api/v1/trade.do"
params = {
'api_key':self.__apikey,
'symbol':symbol,
'type':tradeType
}
if price:
params['price'] = price
if amount:
params['amount'] = amount
params['sign'] = buildMySign(params,self.__secretkey)
return httpPost(self.__url,TRADE_RESOURCE,params)
#现货批量下单
def batchTrade(self,symbol,tradeType,orders_data):
BATCH_TRADE_RESOURCE = "/api/v1/batch_trade.do"
params = {
'api_key':self.__apikey,
'symbol':symbol,
'type':tradeType,
'orders_data':orders_data
}
params['sign'] = buildMySign(params,self.__secretkey)
return httpPost(self.__url,BATCH_TRADE_RESOURCE,params)
#现货取消订单
def cancelOrder(self,symbol,orderId):
CANCEL_ORDER_RESOURCE = "/api/v1/cancel_order.do"
params = {
'api_key':self.__apikey,
'symbol':symbol,
'order_id':orderId
}
params['sign'] = buildMySign(params,self.__secretkey)
return httpPost(self.__url,CANCEL_ORDER_RESOURCE,params)
#现货订单信息查询
def orderinfo(self,symbol,orderId):
ORDER_INFO_RESOURCE = "/api/v1/order_info.do"
params = {
'api_key':self.__apikey,
'symbol':symbol,
'order_id':orderId
}
params['sign'] = buildMySign(params,self.__secretkey)
return httpPost(self.__url,ORDER_INFO_RESOURCE,params)
#现货批量订单信息查询
def ordersinfo(self,symbol,orderId,tradeType):
ORDERS_INFO_RESOURCE = "/api/v1/orders_info.do"
params = {
'api_key':self.__apikey,
'symbol':symbol,
'order_id':orderId,
'type':tradeType
}
params['sign'] = buildMySign(params,self.__secretkey)
return httpPost(self.__url,ORDERS_INFO_RESOURCE,params)
#现货获得历史订单信息
def orderHistory(self,symbol,status,currentPage,pageLength):
ORDER_HISTORY_RESOURCE = "/api/v1/order_history.do"
params = {
'api_key':self.__apikey,
'symbol':symbol,
'status':status,
'current_page':currentPage,
'page_length':pageLength
}
params['sign'] = buildMySign(params,self.__secretkey)
return httpPost(self.__url,ORDER_HISTORY_RESOURCE,params)
| {
"content_hash": "9e471e545a1106d8f7ae9a5593818399",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 68,
"avg_line_length": 29.866666666666667,
"alnum_prop": 0.560515873015873,
"repo_name": "supercuiller/OKCoin.cn-REST-API-Python3",
"id": "e53364325ea693b080cc1c1f4651b745faf11ce6",
"size": "4273",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/OkcoinSpotAPI.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "13003"
}
],
"symlink_target": ""
} |
using System.Collections;
using System.Collections.ObjectModel;
using System.Linq.Expressions;
using System.Reflection;
using Zyan.InterLinq.Expressions.SerializableTypes;
using Zyan.InterLinq.Types.Anonymous;
namespace Zyan.InterLinq.Expressions.Helpers
{
/// <summary>
/// This class is an <see cref="ExpressionVisitor"/> implementation
/// used to convert a <see cref="Expression"/> to a
/// <see cref="SerializableExpression"/>.
/// </summary>
/// <seealso cref="ExpressionVisitor"/>
public class ExpressionConverter : ExpressionVisitor
{
#region Constructors
/// <summary>
/// Initializes this class.
/// </summary>
/// <param name="expression"><see cref="Expression"/> to convert.</param>
public ExpressionConverter(Expression expression) : base(expression) { }
#endregion
#region New Methods
/// <summary>
/// Converts an <see cref="Expression"/> to a <see cref="SerializableExpression"/>.
/// </summary>
/// <param name="expression"><see cref="Expression"/> to convert.</param>
/// <returns>Returns the converted <see cref="SerializableExpression"/>.</returns>
internal SerializableExpression Convert(Expression expression)
{
return Convert<SerializableExpression>(expression);
}
/// <summary>
/// Converts an <see cref="Expression"/> to <typeparamref name="T"/>.
/// </summary>
/// <typeparam name="T">Target type.</typeparam>
/// <param name="expression"><see cref="Expression"/> to convert.</param>
/// <returns>Returns the converted <typeparamref name="T"/>.</returns>
internal T Convert<T>(Expression expression)
{
return Visit<T>(expression);
}
/// <summary>
/// Converts an <see cref="IEnumerable"/> to a <see cref="ReadOnlyCollection{T}"/>.
/// </summary>
/// <typeparam name="T">Target type.</typeparam>
/// <param name="enumerable"><see cref="IEnumerable"/> to convert.</param>
/// <returns>Returns the converted <see cref="ReadOnlyCollection{T}"/>.</returns>
internal ReadOnlyCollection<T> ConvertCollection<T>(IEnumerable enumerable)
{
return new ReadOnlyCollection<T>(VisitCollection<T>(enumerable));
}
/// <summary>
/// Converts an <see cref="IEnumerable"/> to a <see cref="ReadOnlyCollection{T}"/>.
/// </summary>
/// <remarks>
/// This method is called for classes like <see cref="SerializableElementInit"/>,
/// <see cref="SerializableMemberBinding"/>, etc.
/// </remarks>
/// <typeparam name="T">Target type.</typeparam>
/// <param name="enumerable"><see cref="IEnumerable"/> to convert.</param>
/// <returns>Returns the converted <see cref="ReadOnlyCollection{T}"/>.</returns>
internal ReadOnlyCollection<T> ConvertToSerializableObjectCollection<T>(IEnumerable enumerable)
{
return new ReadOnlyCollection<T>(VisitObjectCollection<T>(enumerable));
}
#endregion
#region Conversion Methods
/// <summary>
/// Converts a <see cref="BinaryExpression"/> to a
/// <see cref="SerializableBinaryExpression"/>.
/// </summary>
/// <param name="expression"><see cref="BinaryExpression"/> to convert.</param>
/// <returns>Returns the converted <see cref="SerializableBinaryExpression"/>.</returns>
/// <seealso cref="ExpressionVisitor.VisitBinaryExpression"/>
protected override object VisitBinaryExpression(BinaryExpression expression)
{
return new SerializableBinaryExpression(expression, this);
}
/// <summary>
/// Converts a <see cref="ConditionalExpression"/> to a
/// <see cref="SerializableConditionalExpression"/>.
/// </summary>
/// <param name="expression"><see cref="ConditionalExpression"/> to convert.</param>
/// <returns>Returns the converted <see cref="SerializableConditionalExpression"/>.</returns>
/// <seealso cref="ExpressionVisitor.VisitConditionalExpression"/>
protected override object VisitConditionalExpression(ConditionalExpression expression)
{
return new SerializableConditionalExpression(expression, this);
}
/// <summary>
/// Converts a <see cref="ConstantExpression"/> to a
/// <see cref="SerializableConstantExpression"/>.
/// </summary>
/// <param name="expression"><see cref="ConstantExpression"/> to convert.</param>
/// <returns>Returns the converted <see cref="SerializableConstantExpression"/>.</returns>
/// <seealso cref="ExpressionVisitor.VisitConstantExpression"/>
protected override object VisitConstantExpression(ConstantExpression expression)
{
return new SerializableConstantExpression(expression, this);
}
/// <summary>
/// Converts a <see cref="Expression{T}"/> to a
/// <see cref="SerializableExpressionTyped"/>.
/// </summary>
/// <param name="expression"><see cref="Expression{T}"/> to convert.</param>
/// <returns>Returns the converted <see cref="SerializableExpressionTyped"/>.</returns>
/// <seealso cref="ExpressionVisitor.VisitTypedExpression{T}"/>
protected override object VisitTypedExpression<T>(Expression<T> expression)
{
return new SerializableExpressionTyped(expression, typeof(T), this);
}
/// <summary>
/// Converts a <see cref="InvocationExpression"/> to a
/// <see cref="SerializableInvocationExpression"/>.
/// </summary>
/// <param name="expression"><see cref="InvocationExpression"/> to convert.</param>
/// <returns>Returns the converted <see cref="SerializableInvocationExpression"/>.</returns>
/// <seealso cref="ExpressionVisitor.VisitInvocationExpression"/>
protected override object VisitInvocationExpression(InvocationExpression expression)
{
return new SerializableInvocationExpression(expression, this);
}
/// <summary>
/// Converts a <see cref="LambdaExpression"/> to a
/// <see cref="SerializableLambdaExpression"/>.
/// </summary>
/// <param name="expression"><see cref="LambdaExpression"/> to convert.</param>
/// <returns>Returns the converted <see cref="SerializableLambdaExpression"/>.</returns>
/// <seealso cref="ExpressionVisitor.VisitLambdaExpression"/>
protected override object VisitLambdaExpression(LambdaExpression expression)
{
return new SerializableLambdaExpression(expression, this);
}
/// <summary>
/// Converts a <see cref="ListInitExpression"/> to a
/// <see cref="SerializableListInitExpression"/>.
/// </summary>
/// <param name="expression"><see cref="ListInitExpression"/> to convert.</param>
/// <returns>Returns the converted <see cref="SerializableListInitExpression"/>.</returns>
/// <seealso cref="ExpressionVisitor.VisitListInitExpression"/>
protected override object VisitListInitExpression(ListInitExpression expression)
{
return new SerializableListInitExpression(expression, this);
}
/// <summary>
/// Converts a <see cref="MemberExpression"/> to a
/// <see cref="SerializableMemberExpression"/>.
/// </summary>
/// <param name="expression"><see cref="MemberExpression"/> to convert.</param>
/// <returns>Returns the converted <see cref="SerializableMemberExpression"/>.</returns>
/// <seealso cref="ExpressionVisitor.VisitMemberExpression"/>
protected override object VisitMemberExpression(MemberExpression expression)
{
// If the member is a display class member (non-serializable, internal)
// replace the whole member expression by a constant expression containing
// the display class member value.
if (expression.Expression != null && expression.Expression.Type != null && expression.Expression.Type.IsDisplayClass())
{
// C# 6.0 can generate nested display classes
if (expression.Expression is MemberExpression)
{
var scx = VisitMemberExpression((MemberExpression)expression.Expression) as SerializableConstantExpression;
if (scx != null)
{
object value = ((FieldInfo)expression.Member).GetValue(scx.Value);
return Visit(Expression.Constant(value));
}
}
else if (expression.Expression is ConstantExpression)
{
var innerExpression = (ConstantExpression)expression.Expression;
if (innerExpression.Type.IsDisplayClass())
{
object value = ((FieldInfo)expression.Member).GetValue(innerExpression.Value);
return Visit(Expression.Constant(value));
}
}
}
return new SerializableMemberExpression(expression, this);
}
/// <summary>
/// Converts a <see cref="MemberInitExpression"/> to a
/// <see cref="SerializableMemberInitExpression"/>.
/// </summary>
/// <param name="expression"><see cref="MemberInitExpression"/> to convert.</param>
/// <returns>Returns the converted <see cref="SerializableMemberInitExpression"/>.</returns>
/// <seealso cref="ExpressionVisitor.VisitMemberInitExpression"/>
protected override object VisitMemberInitExpression(MemberInitExpression expression)
{
return new SerializableMemberInitExpression(expression, this);
}
/// <summary>
/// Converts a <see cref="MethodCallExpression"/> to a
/// <see cref="SerializableMethodCallExpression"/>.
/// </summary>
/// <param name="expression"><see cref="MethodCallExpression"/> to convert.</param>
/// <returns>Returns the converted <see cref="SerializableMethodCallExpression"/>.</returns>
/// <seealso cref="ExpressionVisitor.VisitMethodCallExpression"/>
protected override object VisitMethodCallExpression(MethodCallExpression expression)
{
return new SerializableMethodCallExpression(expression, this);
}
/// <summary>
/// Converts a <see cref="NewArrayExpression"/> to a
/// <see cref="SerializableNewArrayExpression"/>.
/// </summary>
/// <param name="expression"><see cref="NewArrayExpression"/> to convert.</param>
/// <returns>Returns the converted <see cref="SerializableNewArrayExpression"/>.</returns>
/// <seealso cref="ExpressionVisitor.VisitNewArrayExpression"/>
protected override object VisitNewArrayExpression(NewArrayExpression expression)
{
return new SerializableNewArrayExpression(expression, this);
}
/// <summary>
/// Converts a <see cref="NewExpression"/> to a
/// <see cref="SerializableNewExpression"/>.
/// </summary>
/// <param name="expression"><see cref="NewExpression"/> to convert.</param>
/// <returns>Returns the converted <see cref="SerializableNewExpression"/>.</returns>
/// <seealso cref="ExpressionVisitor.VisitNewExpression"/>
protected override object VisitNewExpression(NewExpression expression)
{
return new SerializableNewExpression(expression, this);
}
/// <summary>
/// Converts a <see cref="ParameterExpression"/> to a
/// <see cref="SerializableParameterExpression"/>.
/// </summary>
/// <param name="expression"><see cref="ParameterExpression"/> to convert.</param>
/// <returns>Returns the converted <see cref="SerializableParameterExpression"/>.</returns>
/// <seealso cref="ExpressionVisitor.VisitParameterExpression"/>
protected override object VisitParameterExpression(ParameterExpression expression)
{
return new SerializableParameterExpression(expression, this);
}
/// <summary>
/// Converts a <see cref="TypeBinaryExpression"/> to a
/// <see cref="SerializableTypeBinaryExpression"/>.
/// </summary>
/// <param name="expression"><see cref="TypeBinaryExpression"/> to convert.</param>
/// <returns>Returns the converted <see cref="SerializableTypeBinaryExpression"/>.</returns>
/// <seealso cref="ExpressionVisitor.VisitTypeBinaryExpression"/>
protected override object VisitTypeBinaryExpression(TypeBinaryExpression expression)
{
return new SerializableTypeBinaryExpression(expression, this);
}
/// <summary>
/// Converts a <see cref="UnaryExpression"/> to a
/// <see cref="SerializableUnaryExpression"/>.
/// </summary>
/// <param name="expression"><see cref="UnaryExpression"/> to convert.</param>
/// <returns>Returns the converted <see cref="SerializableUnaryExpression"/>.</returns>
/// <seealso cref="ExpressionVisitor.VisitUnaryExpression"/>
protected override object VisitUnaryExpression(UnaryExpression expression)
{
return new SerializableUnaryExpression(expression, this);
}
/// <summary>
/// Converts a <see cref="ElementInit"/> to a
/// <see cref="SerializableElementInit"/>.
/// </summary>
/// <param name="elementInit"><see cref="ElementInit"/> to convert.</param>
/// <returns>Returns the converted <see cref="SerializableElementInit"/>.</returns>
/// <seealso cref="ExpressionVisitor.VisitElementInit"/>
protected override object VisitElementInit(ElementInit elementInit)
{
return new SerializableElementInit(elementInit, this);
}
/// <summary>
/// Converts a <see cref="MemberAssignment"/> to a
/// <see cref="SerializableMemberAssignment"/>.
/// </summary>
/// <param name="memberAssignment"><see cref="MemberAssignment"/> to convert.</param>
/// <returns>Returns the converted <see cref="SerializableMemberAssignment"/>.</returns>
/// <seealso cref="ExpressionVisitor.VisitMemberAssignment"/>
protected override object VisitMemberAssignment(MemberAssignment memberAssignment)
{
return new SerializableMemberAssignment(memberAssignment, this);
}
/// <summary>
/// Converts a <see cref="MemberListBinding"/> to a
/// <see cref="SerializableMemberListBinding"/>.
/// </summary>
/// <param name="memberListBinding"><see cref="MemberListBinding"/> to convert.</param>
/// <returns>Returns the converted <see cref="SerializableMemberListBinding"/>.</returns>
/// <seealso cref="ExpressionVisitor.VisitMemberListBinding"/>
protected override object VisitMemberListBinding(MemberListBinding memberListBinding)
{
return new SerializableMemberListBinding(memberListBinding, this);
}
/// <summary>
/// Converts a <see cref="MemberMemberBinding"/> to a
/// <see cref="SerializableMemberMemberBinding"/>.
/// </summary>
/// <param name="memberMemberBinding"><see cref="MemberMemberBinding"/> to convert.</param>
/// <returns>Returns the converted <see cref="SerializableMemberMemberBinding"/>.</returns>
/// <seealso cref="ExpressionVisitor.VisitMemberMemberBinding"/>
protected override object VisitMemberMemberBinding(MemberMemberBinding memberMemberBinding)
{
return new SerializableMemberMemberBinding(memberMemberBinding, this);
}
#endregion
}
}
| {
"content_hash": "362e02bcf75f167dd7bcb8480fdd7c33",
"timestamp": "",
"source": "github",
"line_count": 337,
"max_line_length": 122,
"avg_line_length": 42.881305637982194,
"alnum_prop": 0.7036191267040344,
"repo_name": "yallie/Zyan",
"id": "22f8e54a2a6f4ee365ce20e71d3d2144bdc69f9c",
"size": "14453",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "source/Zyan.Communication/InterLinq/Expressions/Helpers/ExpressionConverter.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "849"
},
{
"name": "C#",
"bytes": "5167105"
},
{
"name": "CSS",
"bytes": "54094"
},
{
"name": "HTML",
"bytes": "39089"
},
{
"name": "TSQL",
"bytes": "7623"
}
],
"symlink_target": ""
} |
package com.nway.platform.wform.design.dao;
import java.util.List;
import java.util.Map;
import com.nway.platform.wform.design.entity.FormField;
import com.nway.platform.wform.design.entity.Page;
public interface PageMapper {
Page getFormPage(String id);
List<Map<String, String>> listFieldAttr(String pageId);
void saveFieldBase(Map<String, String> field);
void saveFieldExt(Map<String, String> field);
void saveFieldCustom(Map<String, String> field);
List<FormField> listFields(String pageId);
}
| {
"content_hash": "305d1c0416d663c1d028657792e218db",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 56,
"avg_line_length": 23.5,
"alnum_prop": 0.7717601547388782,
"repo_name": "zdtjss/wform",
"id": "75ada3881e9f2534fa6a89fab048ff30d3717daa",
"size": "517",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/com/nway/platform/wform/design/dao/PageMapper.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "142526"
},
{
"name": "FreeMarker",
"bytes": "13291"
},
{
"name": "Java",
"bytes": "139817"
},
{
"name": "JavaScript",
"bytes": "43369"
}
],
"symlink_target": ""
} |
#ifndef TRIANGLE_PY_H
#define TRIANGLE_PY_H
#include <sstream>
#include <boost/python.hpp>
#include <boost/foreach.hpp>
#include "triangle.h"
namespace ocl
{
///
/// \brief python wrapper for Triangle
///
class Triangle_py : public Triangle {
public:
/// default constructor
Triangle_py() : Triangle() {};
/// construct from three points
Triangle_py( const Point& p0,
const Point& p1,
const Point& p2) : Triangle(p0,p1,p2) {};
/// copy constructor
Triangle_py( const Triangle_py& t) : Triangle(t) {};
/// cast-down constructor
Triangle_py( const Triangle& t) : Triangle(t) {};
/// string repr
std::string str() const {
std::ostringstream o;
o << *this;
return o.str();
};
/// Returns a list of the vertices to Python
boost::python::list getPoints() const {
boost::python::list plist;
BOOST_FOREACH(Point vertex, p) {
plist.append(vertex);
}
return plist;
};
};
} // end namespace
#endif
// end file triangle_py.h
| {
"content_hash": "8249f2109671010699b14fdbafdca3c5",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 62,
"avg_line_length": 23.901960784313726,
"alnum_prop": 0.5192780968006563,
"repo_name": "play113/swer",
"id": "48dc344c5e4ad4fb6d056ad139ca9dbbf88479ab",
"size": "2056",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "opencamlib-read-only/src/geo/triangle_py.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "1742"
},
{
"name": "C",
"bytes": "57380"
},
{
"name": "C++",
"bytes": "11096257"
},
{
"name": "CMake",
"bytes": "92079"
},
{
"name": "CSS",
"bytes": "10910"
},
{
"name": "HTML",
"bytes": "6017820"
},
{
"name": "Inno Setup",
"bytes": "18322"
},
{
"name": "Makefile",
"bytes": "12871"
},
{
"name": "Objective-C",
"bytes": "419"
},
{
"name": "Prolog",
"bytes": "276"
},
{
"name": "Python",
"bytes": "1478808"
},
{
"name": "QMake",
"bytes": "6856"
},
{
"name": "Shell",
"bytes": "14599"
}
],
"symlink_target": ""
} |
using System;
using System.Xml.Serialization;
namespace Aop.Api.Domain
{
/// <summary>
/// AlipayUserAccountInstitutionCertifyModel Data Structure.
/// </summary>
[Serializable]
public class AlipayUserAccountInstitutionCertifyModel : AopObject
{
/// <summary>
/// 描述机构的名称
/// </summary>
[XmlElement("institution_name")]
public string InstitutionName { get; set; }
/// <summary>
/// 登录号,可以是手机号码或者邮箱号码
/// </summary>
[XmlElement("logon_id")]
public string LogonId { get; set; }
}
}
| {
"content_hash": "4ab2009ec1b87a498c48dbdaa74c0738",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 69,
"avg_line_length": 24.583333333333332,
"alnum_prop": 0.5915254237288136,
"repo_name": "329277920/Snail",
"id": "315ffb751ecf343f2357ec00e4b128b3f7599e98",
"size": "638",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "Snail.Pay.Ali.Sdk/Domain/AlipayUserAccountInstitutionCertifyModel.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "8409939"
},
{
"name": "CSS",
"bytes": "8789"
},
{
"name": "Dockerfile",
"bytes": "639"
},
{
"name": "HTML",
"bytes": "14995"
},
{
"name": "JavaScript",
"bytes": "29933"
}
],
"symlink_target": ""
} |
<div class="footer">
</div><!-- .footer --> | {
"content_hash": "3850e1cb576fddfc3939abc4508c652d",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 22,
"avg_line_length": 14.666666666666666,
"alnum_prop": 0.5227272727272727,
"repo_name": "farhang/angularjs-stb",
"id": "ca187576a8161c20bd6d0297f281c1154cde5901",
"size": "44",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/templates/shared/footer.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "89421"
},
{
"name": "HTML",
"bytes": "7697"
},
{
"name": "JavaScript",
"bytes": "13842"
},
{
"name": "Ruby",
"bytes": "974"
}
],
"symlink_target": ""
} |
require 'rails_helper'
RSpec.describe 'POST /mail_gun/drops' do
scenario 'inbound hooks create activity entries' do
with_a_configured_token('deadbeef') do
given_an_appointment
when_mail_gun_posts_a_drop_notification
then_an_activity_is_created
and_the_service_responds_ok
end
end
def with_a_configured_token(token)
existing = ENV['MAILGUN_API_TOKEN']
ENV['MAILGUN_API_TOKEN'] = token
yield
ensure
ENV['MAILGUN_API_TOKEN'] = existing
end
def given_an_appointment
@appointment = create(:appointment)
end
def when_mail_gun_posts_a_drop_notification
post mail_gun_drops_path, params: {
'event' => 'dropped',
'description' => 'the reasoning',
'environment' => 'production',
'message_type' => 'booking_created',
'appointment_id' => @appointment.to_param,
'timestamp' => '1474638633',
'token' => 'secret',
'signature' => 'abf02bef01e803bea52213cb092a31dc2174f63bcc2382ba25732f4c84e084c1'
}
end
def then_an_activity_is_created
expect(DropActivity.last.appointment).to eq(@appointment)
end
def and_the_service_responds_ok
expect(response).to be_successful
end
end
| {
"content_hash": "a69d62687dfdaf112796e14dff15e870",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 92,
"avg_line_length": 26.956521739130434,
"alnum_prop": 0.6540322580645161,
"repo_name": "guidance-guarantee-programme/telephone_appointment_planner",
"id": "1bd247edf3b0c563a0042a33dfa2869478b86168",
"size": "1240",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "spec/requests/mailgun_drop_notification_spec.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "137213"
},
{
"name": "JavaScript",
"bytes": "68537"
},
{
"name": "Procfile",
"bytes": "128"
},
{
"name": "Ruby",
"bytes": "565019"
},
{
"name": "SCSS",
"bytes": "17478"
}
],
"symlink_target": ""
} |
// $Id$
package javax.xml.xpath;
/**
* <code>XPathExpressionException</code> represents an error in an XPath expression.</p>
*
* @author <a href="mailto:[email protected]">Norman Walsh</a>
* @author <a href="mailto:[email protected]">Jeff Suttor</a>
* @version $Revision$, $Date$
* @since 1.5
*/
public class XPathExpressionException extends XPathException {
/**
* <p>Stream Unique Identifier.</p>
*/
private static final long serialVersionUID = -1837080260374986980L;
/**
* <p>Constructs a new <code>XPathExpressionException</code> with the specified detail <code>message</code>.</p>
*
* <p>The <code>cause</code> is not initialized.</p>
*
* <p>If <code>message</code> is <code>null</code>, then a <code>NullPointerException</code> is thrown.</p>
*
* @param message The detail message.
*/
public XPathExpressionException(String message) {
super(message);
}
/**
* <p>Constructs a new <code>XPathExpressionException</code> with the specified <code>cause</code>.</p>
*
* <p>If <code>cause</code> is <code>null</code>, then a <code>NullPointerException</code> is thrown.</p>
*
* @param cause The cause.
*
* @throws NullPointerException if <code>cause</code> is <code>null</code>.
*/
public XPathExpressionException(Throwable cause) {
super(cause);
}
}
| {
"content_hash": "80506146590a6c7299bd3ca260c4a744",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 116,
"avg_line_length": 30.58695652173913,
"alnum_prop": 0.6375266524520256,
"repo_name": "svn2github/xerces-xml-commons",
"id": "23daf971c31157d8341f77c9c15a26d8a2a2df9e",
"size": "2208",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "java/external/src/javax/xml/xpath/XPathExpressionException.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "435147"
}
],
"symlink_target": ""
} |
import pdfkit, os, frappe
from frappe.utils import scrub_urls
def get_pdf(html, options=None):
if not options:
options = {}
options.update({
"print-media-type": None,
"background": None,
"images": None,
'margin-top': '15mm',
'margin-right': '15mm',
'margin-bottom': '15mm',
'margin-left': '15mm',
'encoding': "UTF-8",
'quiet': None,
'no-outline': None
})
if not options.get("page-size"):
options['page-size'] = frappe.db.get_single_value("Print Settings", "pdf_page_size") or "A4"
html = scrub_urls(html)
fname = os.path.join("/tmp", frappe.generate_hash() + ".pdf")
pdfkit.from_string(html, fname, options=options or {})
with open(fname, "rb") as fileobj:
filedata = fileobj.read()
os.remove(fname)
return filedata
| {
"content_hash": "1e3bc1202ebb686d8d27ed2ed80a956f",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 94,
"avg_line_length": 23,
"alnum_prop": 0.6521739130434783,
"repo_name": "gangadharkadam/v5_frappe",
"id": "e92b5b23fb07bff1a10f782f8d44c74369c8554b",
"size": "863",
"binary": false,
"copies": "4",
"ref": "refs/heads/v5.0",
"path": "frappe/utils/pdf.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "152220"
},
{
"name": "HTML",
"bytes": "111716"
},
{
"name": "JavaScript",
"bytes": "1227854"
},
{
"name": "Python",
"bytes": "969285"
},
{
"name": "Shell",
"bytes": "517"
}
],
"symlink_target": ""
} |
/*
* (c) the authors
* Licensed under the Apache License, Version 2.0.
*/
package org.roaringbitmap;
/**
* Representing a general bitmap interface.
*
*/
public interface BitmapDataProvider extends ImmutableBitmapDataProvider {
/**
* set the value to "true", whether it already appears or not.
*
* @param x integer value
*/
public void add(int x);
/**
* If present remove the specified integers (effectively, sets its bit
* value to false)
*
* @param x integer value representing the index in a bitmap
*/
public void remove(int x);
/**
* Return the jth value stored in this bitmap.
*
* @param j index of the value
*
* @return the value
*/
@Override
public int select(int j);
/**
* Recover allocated but unused memory.
*/
public void trim();
}
| {
"content_hash": "ea2aa35684588ddb8c0b21841e937c56",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 74,
"avg_line_length": 20.80952380952381,
"alnum_prop": 0.6075514874141876,
"repo_name": "gssiyankai/RoaringBitmap",
"id": "02caa5ea9ae57016200d0fa09252c9e782ae3cfe",
"size": "874",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/org/roaringbitmap/BitmapDataProvider.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "346"
},
{
"name": "Java",
"bytes": "1638558"
},
{
"name": "Python",
"bytes": "817"
},
{
"name": "Shell",
"bytes": "1907"
}
],
"symlink_target": ""
} |
package com.vk.api.sdk.queries.ads;
import com.vk.api.sdk.queries.EnumParam;
/**
* Created by Anton Tsivarev on 22.09.16.
*/
public enum AdsCheckLinkType implements EnumParam {
COMMUNITY("community"),
POST("post"),
TWITTER("application"),
VIDEO("video"),
SITE("site");
private final String value;
AdsCheckLinkType(String value) {
this.value = value;
}
@Override
public String getValue() {
return value;
}
}
| {
"content_hash": "8e74a5a53841020d64703619e86b120d",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 51,
"avg_line_length": 17.62962962962963,
"alnum_prop": 0.6323529411764706,
"repo_name": "kokorin/vk-java-sdk",
"id": "81abdbd200ca780ec741705635416cfce910628d",
"size": "476",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "sdk/src/main/java/com/vk/api/sdk/queries/ads/AdsCheckLinkType.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "2634022"
}
],
"symlink_target": ""
} |
Tired of clicking the refresh button every new term? This program aims to help reduce the pain...
When an spot opens up on your desired course, it will automatically opens up the link in the default web browser ready for you.
Download: <br />
--
JAR: https://github.com/superbstreak/RegistrationStatusScraper/raw/master/Build/classScraper.jar
Feature:
--
- Customizable refresh interval (>= 2 minutes)
- Monitor as many classes as you like
- Automatically open the available class in the default web browser
- Free
How To Use:<br />
--
1. Put both classScraper.jar and classes.txt in the same folder.<br />
2. open termial if you're on OSX or cmd.exe if your are on Windows<br />
3. cd into that folder<br />
4. start classScraper.jar by typing 'java -jar classScraper.jar' then press enter<br />
5. Leave the terminal/cmd up as long as you like<br />
The jar file reads in a text file 'classes.txt' and the format should be:
--
- Start the file with a number (in minutes, refresh interval)
- The refresh interval should be greater than or equal to 2 minutes
- Each line should be separted by starting a new line
- Sample format: https://github.com/superbstreak/RegistrationStatusScraper/blob/master/Build/classes.txt
| {
"content_hash": "54a9754c0df06d780326f734da35a71b",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 127,
"avg_line_length": 40.8,
"alnum_prop": 0.7598039215686274,
"repo_name": "superbstreak/RegistrationStatusScraper",
"id": "d3d90dc1eae53ea0751f37768243ba6176f6f2c6",
"size": "1252",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "7526"
}
],
"symlink_target": ""
} |
//
// NewFeatureVC.m
// LYHPagecontrol
//
// Created by 厉煜寰 on 15/11/7.
// Copyright © 2015年 SXT. All rights reserved.
//
#import "YHNewFeatureVC.h"
#import "YHPageControl.h"
#import "YHCheckBox.h"
#define kWidth [UIScreen mainScreen].bounds.size.width
#define kHeight [UIScreen mainScreen].bounds.size.height
// 6.四舍五入函数
#define WBDounble2Int(doubleNumber) (int)(doubleNumber+0.5)
@interface YHNewFeatureVC ()<UIScrollViewDelegate,LYHPageControlDelegate>
@property (nonatomic, weak) YHBasicPageControl *page;
@property (nonatomic, strong) UIScrollView *scrolleView;
@property (nonatomic, assign) NSInteger row;
@end
@implementation YHNewFeatureVC
- (instancetype)initWithRow:(NSInteger)row
{
if (self = [super init]) {
self.row = row;
}
return self;
}
- (void)viewDidLoad {
[super viewDidLoad];
// self.navigationController.navigationBarHidden = YES;
// 添加scrollView
[self setupScrollView];
// 添加pageControl
[self setupPageControl];
}
- (void)viewDidDisappear:(BOOL)animated
{
[super viewDidDisappear:animated];
self.navigationController.navigationBarHidden = NO;
}
/**
* 添加scrollView
*/
- (void)setupScrollView
{
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kWidth, kHeight)];
[self.view addSubview:view];
view.backgroundColor = [UIColor orangeColor];
UIScrollView *scrolleView = [[UIScrollView alloc]init];
scrolleView.frame = CGRectMake(0, 0, kWidth, kHeight);
scrolleView.delegate = self;
scrolleView.contentSize = CGSizeMake(3*kWidth, kHeight-64);
scrolleView.pagingEnabled = YES;
scrolleView.showsHorizontalScrollIndicator = NO;
scrolleView.showsVerticalScrollIndicator = NO;
scrolleView.bounces = NO;
[view addSubview:scrolleView];
self.scrolleView = scrolleView;
// 添加图片
for (int index=1; index<4; index++) {
UIImageView *imageView = [[UIImageView alloc]init];
imageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"new_feature_%d-568h@2x",index]];
CGFloat imageX = (index-1) * kWidth;
CGFloat imageY = 0;
CGFloat imageH = kHeight;
CGFloat imageW = kWidth;
imageView.frame = CGRectMake(imageX, imageY, imageW, imageH);
[scrolleView addSubview:imageView];
if (index == 3) {
[self setupLastImageView:imageView];
}
}
}
/**
* 添加pageControl
*/
- (void)setupPageControl
{
CGFloat centerX = kWidth * 0.5;
CGFloat centerY = kHeight - 30 ;
YHBasicPageControl *page;
switch (self.row) {
case 0:{
page = [[YHPageControlHorizontal alloc] initWithStyel:LYHPageControlHorizontalTpyeDefault];
break;
}
case 1:{
page = [[YHPageControlHorizontal alloc] initWithStyel:LYHPageControlHorizontalTpyeRectangle];
break;
}
case 2:{
page = [[YHPageControlHorizontal alloc] initWithStyel:LYHPageControlHorizontalTpyeMixRectanglePoint];
break;
}
default:
break;
}
page.center = CGPointMake(centerX, centerY);
page.numberOfPages = 3;
page.delegate = self;
[self.view addSubview:page];
self.page = page;
}
/**
* 添加内容到最后一张图片上
*/
- (void)setupLastImageView:(UIImageView *) imageView
{
imageView.userInteractionEnabled = YES;
// 添加开始按钮
UIButton *startButton = [[UIButton alloc]init];
[startButton setBackgroundImage:[UIImage resizeImageWithName:@"new_feature_finish_button"] forState:UIControlStateNormal];
[startButton setBackgroundImage:[UIImage resizeImageWithName:@"new_feature_finish_button_highlighted"] forState:UIControlStateHighlighted];
[imageView addSubview:startButton];
CGFloat centerX = kWidth *0.5;
CGFloat centerY = kHeight *0.6;
startButton.center = CGPointMake(centerX, centerY);
startButton.bounds = (CGRect){CGPointZero, startButton.currentBackgroundImage.size};
[startButton setTitle:@"立即体验" forState:UIControlStateNormal];
[startButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
// [startButton addTarget:self action:@selector(start) forControlEvents:UIControlEventTouchUpInside];
// 添加checkBox
YHCheckBox *checkbox = [YHCheckBox checkBox];
checkbox.title = @"点击进入";
CGFloat centerCheckY = kHeight * 0.5;
checkbox.center = CGPointMake(centerX, centerCheckY);
checkbox.bounds = CGRectMake(0, 0, 200, 30);
[imageView addSubview:checkbox];
}
/**
* 滑动UIScrollerView就滚动
*/
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
CGFloat contentOffX = scrollView.contentOffset.x;
double currentPageDouble = contentOffX/kWidth;
int currentPageInt = WBDounble2Int(currentPageDouble);
self.page.currentPage = currentPageInt;
}
- (void)pageControl:(YHBasicPageControl *)pageControl changgeCurrentPage:(NSInteger)currentPage
{
[UIView animateWithDuration:0.5f animations:^{
self.scrolleView.contentOffset = CGPointMake(self.page.currentPage*kWidth, 0);
}];
}
@end
| {
"content_hash": "e512fbde2cb5c5773cff810cc91726f2",
"timestamp": "",
"source": "github",
"line_count": 158,
"max_line_length": 143,
"avg_line_length": 31.924050632911392,
"alnum_prop": 0.6968675654242664,
"repo_name": "YuHuanLi/YHPageControl",
"id": "3776b379b03542306945c9b34fd6abe5778820f2",
"size": "5155",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "YHPageControl/YHNewFeatureVC.m",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Objective-C",
"bytes": "36521"
},
{
"name": "Ruby",
"bytes": "504"
}
],
"symlink_target": ""
} |
package com.exam.base;
import org.apache.log4j.Logger;
public class MysqlSQLPageHandleImpl implements SQLPageHandle {
private Logger logger=Logger.getLogger(MysqlSQLPageHandleImpl.class);
@Override
public String handlerPagingSQL(String oldSql, int begin, int pageSize) {
StringBuffer sql = new StringBuffer(oldSql);
if (pageSize > 0) {
int firstResult = begin;
if (firstResult <= 0) {
sql.append(" limit ").append(pageSize);
} else {
sql.append(" limit ").append(firstResult).append(",").append(pageSize);
}
}
return sql.toString();
}
}
| {
"content_hash": "24e943a1279325ae04aaa83033deeadd",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 75,
"avg_line_length": 25,
"alnum_prop": 0.7095652173913043,
"repo_name": "viplz/AccountManagement",
"id": "d036bfabbb0a56bf51a5f0c5ebb17ad406a59c09",
"size": "575",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/com/exam/base/MysqlSQLPageHandleImpl.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "35208"
},
{
"name": "FreeMarker",
"bytes": "22788"
},
{
"name": "HTML",
"bytes": "33002"
},
{
"name": "Java",
"bytes": "30883"
},
{
"name": "JavaScript",
"bytes": "1504064"
}
],
"symlink_target": ""
} |
package net.openhft.chronicle.logger.log4j2;
import net.openhft.chronicle.logger.ChronicleLogLevel;
import net.openhft.chronicle.logger.ChronicleLogWriter;
import net.openhft.chronicle.logger.LogAppenderConfig;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.core.Filter;
import org.apache.logging.log4j.core.LogEvent;
import org.apache.logging.log4j.core.appender.AbstractAppender;
import org.apache.logging.log4j.core.config.plugins.Plugin;
import org.apache.logging.log4j.core.config.plugins.PluginAttribute;
import org.apache.logging.log4j.core.config.plugins.PluginFactory;
import org.jetbrains.annotations.NotNull;
import java.io.IOException;
public abstract class AbstractChronicleAppender extends AbstractAppender {
private String path;
private String wireType;
private ChronicleLogWriter writer;
AbstractChronicleAppender(String name, Filter filter, String path, String wireType) {
super(name, filter, null, true, null);
this.path = path;
this.wireType = wireType;
this.writer = null;
}
// *************************************************************************
// Custom logging options
// *************************************************************************
static ChronicleLogLevel toChronicleLogLevel(final Level level) {
if (level.intLevel() == Level.DEBUG.intLevel()) {
return ChronicleLogLevel.DEBUG;
} else if (level.intLevel() == Level.TRACE.intLevel()) {
return ChronicleLogLevel.TRACE;
} else if (level.intLevel() == Level.INFO.intLevel()) {
return ChronicleLogLevel.INFO;
} else if (level.intLevel() == Level.WARN.intLevel()) {
return ChronicleLogLevel.WARN;
} else if (level.intLevel() == Level.ERROR.intLevel()) {
return ChronicleLogLevel.ERROR;
}
throw new IllegalArgumentException(level.intLevel() + " not a valid level value");
}
public String getPath() {
return this.path;
}
public void setPath(String path) {
this.path = path;
}
public String getWireType() {
return wireType;
}
// *************************************************************************
// Chronicle implementation
// *************************************************************************
public void setWireType(String wireType) {
this.wireType = wireType;
}
protected abstract ChronicleLogWriter createWriter() throws IOException;
// *************************************************************************
//
// *************************************************************************
protected abstract void doAppend(@NotNull final LogEvent event, @NotNull final ChronicleLogWriter writer);
@Override
public void start() {
if (getPath() == null) {
LOGGER.error("Appender " + getName() + " has configuration errors and is not started!");
} else {
try {
this.writer = createWriter();
} catch (IOException e) {
this.writer = null;
LOGGER.error("Appender " + getName() + " " + e.getMessage());
}
super.start();
}
}
@Override
public void stop() {
if (this.writer != null) {
try {
this.writer.close();
} catch (IOException e) {
LOGGER.error("Appender " + getName() + " " + e.getMessage());
}
}
super.stop();
}
// *************************************************************************
//
// *************************************************************************
@Override
public void append(final LogEvent event) {
if (this.writer != null) {
doAppend(event, writer);
}
}
// *************************************************************************
//
// *************************************************************************
@Plugin(
name = "chronicleCfg",
category = "Core")
public static final class ChronicleCfg extends LogAppenderConfig {
ChronicleCfg() {
}
@PluginFactory
public static ChronicleCfg create(
@PluginAttribute("blockSize") final String blockSize,
@PluginAttribute("bufferCapacity") final String bufferCapacity,
@PluginAttribute("rollCycle") final String rollCycle) {
final ChronicleCfg cfg = new ChronicleCfg();
if (blockSize != null)
cfg.setProperty("blockSize", blockSize);
if (bufferCapacity != null)
cfg.setProperty("bufferCapacity", bufferCapacity);
if (rollCycle != null)
cfg.setProperty("rollCycle", rollCycle);
return cfg;
}
}
}
| {
"content_hash": "fbc5730af96d45528e3b7b8eaf837f26",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 110,
"avg_line_length": 31.980645161290322,
"alnum_prop": 0.5126084325196691,
"repo_name": "OpenHFT/Chronicle-Logger",
"id": "91e738620e7fc5077516d0d61df267c50952bc53",
"size": "5604",
"binary": false,
"copies": "1",
"ref": "refs/heads/ea",
"path": "logger-log4j-2/src/main/java/net/openhft/chronicle/logger/log4j2/AbstractChronicleAppender.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "242392"
}
],
"symlink_target": ""
} |
import { get, computed } from '@ember/object';
import Component from '@ember/component';
import { alias } from '@ember/object/computed'
export default Component.extend({
showAdvanced: false,
config: alias('model.config'),
didInsertElement() {
this.$('#splunk-endpoint').focus()
},
enableSSLConfig: computed('config.endpoint', function() {
const endpoint = get(this, 'config.endpoint') || ''
if (endpoint.startsWith('https')) {
return true
} else {
return false
}
}),
logPreview: computed('fieldsStr', function() {
const fieldsStr = get(this, 'fieldsStr');
const template = `{
"log": "time=\"${ new Date().toString() }\" level=info msg=\"Cluster [local] condition status unknown\"",
"stream": "stderr",
"tag": "default.var.log.containers.cattle-6b4ccb5b9d-v57vw_default_cattle-xxx.log"
"docker": {
"container_id": "xxx"
},
"kubernetes": {
"container_name": "cattle",
"namespace_name": "default",
"pod_name": "cattle-6b4ccb5b9d-v57vw",
"pod_id": "30c685d0-fa43-11e7-b992-00163e016dc2",
"labels": {
"app": "cattle",
"pod-template-hash": "2607761658"
},
"host": "47.52.113.251",
"master_url": "https://10.233.0.1:443/api"
},
${ fieldsStr }
...
}`;
return template
}),
fieldsStr: computed('model.outputTags', function() {
const keyValueMap = get(this, 'model.outputTags')
if (!keyValueMap) {
return '';
}
return Object.keys(keyValueMap).map((key) => ` "${ key }": "${ keyValueMap[key] }"`).join(',\n');
}),
});
| {
"content_hash": "1fb3babb1fa3d39230efec456ac146b6",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 109,
"avg_line_length": 27.283333333333335,
"alnum_prop": 0.579108124618204,
"repo_name": "lvuch/ui",
"id": "b98a9ec7bb38603743544883c0f002f1dc2e4f5a",
"size": "1637",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/logging/addon/components/logging/target-splunk/component.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "174666"
},
{
"name": "Dockerfile",
"bytes": "196"
},
{
"name": "HTML",
"bytes": "1415278"
},
{
"name": "JavaScript",
"bytes": "2335968"
},
{
"name": "Shell",
"bytes": "10901"
}
],
"symlink_target": ""
} |
<div #formToast class="user-form">
<div class="reg-card">
<div class="title-color">
<div>Sign In</div>
</div>
<div class="reg-content">
<form #loginForm="ngForm" (ngSubmit)="userActions.login(loginForm) || userFormActions.loginForm(false)">
<div>
<div class="input-wrapper">
<input id="login_email" name="login_email" ngModel required placeholder="Email">
</div>
<div class="input-wrapper">
<input id="login_password" type="password" name="login_password" ngModel required placeholder="Password">
</div>
</div>
<div>
<button id="back-btn" type="button" (click)="userFormActions.loginForm(false)">BACK</button>
<button id="signup-btn" type="button" (click)="userFormActions.registerForm(true)">SIGN UP</button>
<button id="login-btn">LOGIN</button>
</div>
</form>
</div>
</div>
<div id="reg" class="reg-card">
<div class="title-color">
<div>Create New User</div>
</div>
<div class="reg-content">
<form #registerForm="ngForm" (ngSubmit)="userActions.register(registerForm) || userFormActions.registerForm(false)">
<div>
<div class="input-wrapper">
<input id="signup_username" name="signup_username" ngModel required placeholder="Username" autoComplete="off">
</div>
<div class="input-wrapper">
<input id="signup_email" name="signup_email" ngModel required placeholder="Email" autoComplete="off">
</div>
<div class="input-wrapper">
<input id="signup_password" type="password" name="signup_password" ngModel required placeholder="Password" autoComplete="off">
</div>
<div class="input-wrapper">
<input id="signup_re_password" type="password" name="signup_re_password" ngModel required placeholder="Password Again" autoComplete="off">
</div>
</div>
<div>
<button id="back-btn2" type="button" (click)="userFormActions.registerForm(false)">BACK</button>
<button id="signin-btn" type="button" (click)="userFormActions.loginForm(true)">SIGN IN</button>
<button id="reg-btn">REGISTER</button>
</div>
</form>
</div>
</div>
</div>
<div #errorToast class="error-card">
<div>
<div class="error-color">
<div>Error Message</div>
</div>
<div class="error-content">
<div><p id="error-text" *ngIf="(error$ | async).get('message')">{{ (error$ | async).get('message') }}</p></div>
</div>
</div>
</div> | {
"content_hash": "f46d82068087b8b69eb7d5ac3ab8578d",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 146,
"avg_line_length": 40.15873015873016,
"alnum_prop": 0.6142292490118577,
"repo_name": "projectSHAI/GOATstack",
"id": "8f3ead1d199ba9011dc8f48ddb627d6cecc34ecb",
"size": "2530",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "client/modules/core/core.component.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "15781"
},
{
"name": "HTML",
"bytes": "10759"
},
{
"name": "JavaScript",
"bytes": "35527"
},
{
"name": "Shell",
"bytes": "705"
},
{
"name": "TypeScript",
"bytes": "139947"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
namespace HansWehr
{
public class MatchInfo
{
private static int _phraseCountPosition = 0;
private static int _columnCountPosition = 4;
private static int _rowCountPosition = 8;
private static int _averageTokenCountsPosition = 12;
private int TokenCountsPosition { get { return _averageTokenCountsPosition + (ColumnCount * 4); } }
private int PhraseDatasPosition { get { return TokenCountsPosition + (ColumnCount * 4); } }
/// <summary>
/// Gets or sets the number of phrases in the query.
/// </summary>
/// <value>The number of phrases in the query.</value>
public int PhraseCount { get; set; }
/// <summary>
/// Gets or sets the number of columns in the fts table this result belongs to.
/// </summary>
/// <value>The number of columns in the fts table this result belongs to.</value>
public int ColumnCount { get; set; }
/// <summary>
/// Gets or sets the number of rows returned by the query.
/// </summary>
/// <value>The number of rows returned by the query.</value>
public int RowCount { get; set; }
/// <summary>
/// Gets or sets the average token count of each column in the FTS table
/// </summary>
/// <value>The average token count of each column in the FTS table.</value>
public int[] AverageTokenCounts { get; set; }
/// <summary>
/// Gets or sets the token count for each column for the current row in the FTS table.
/// </summary>
/// <value>The token count for each column for the current row in the FTS table.</value>
public int[] TokenCounts { get; set; }
/// <summary>
/// Gets or sets the details on occurances of each phrase in respect to this row.
/// </summary>
/// <value>Details on occurances of each phrase in respect to this row.</value>
public PhraseData[] PhraseDatas { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="T:HansWehr.MatchInfo"/> class.
/// </summary>
/// <param name="rawBytes">The raw blob from the sqlite function matchInfo(tableName,'pcnalx') as a byte array</param>
public MatchInfo(IEnumerable<string> phrases, byte[] rawBytes)
{
// there should be a minimum of 32 bytes in a valid matchinfo('pcnalx')
if (rawBytes == null || rawBytes.Length < 32) throw new ArgumentException("The byte array length is incorrect");
try
{
// initialise the single properties with their values
PhraseCount = BitConverter.ToInt32(rawBytes, _phraseCountPosition);
ColumnCount = BitConverter.ToInt32(rawBytes, _columnCountPosition);
RowCount = BitConverter.ToInt32(rawBytes, _rowCountPosition);
// initialise the array properties as empty arrays
AverageTokenCounts = new int[ColumnCount];
TokenCounts = new int[ColumnCount];
PhraseDatas = new PhraseData[PhraseCount];
// everything before averageTokenCounts has already been extracted above
// so we go from the beginning of average token counts to the end of the byte array to extract everything else
for (int i = _averageTokenCountsPosition; i < rawBytes.Length; i += 4)
{
int currentInt = BitConverter.ToInt32(rawBytes, i);
if (i < TokenCountsPosition)
{
// still looking at average token counts, add to the property
int row = (i - _averageTokenCountsPosition) / 4;
AverageTokenCounts[row] = currentInt;
}
else if (i < PhraseDatasPosition)
{
// now looking at token counts, add to the property
int row = (i - TokenCountsPosition) / 4;
TokenCounts[row] = currentInt;
}
else
{
// now we're looking at phrase datas, which are 3 values for each phrase for each colomn (3 * n(col) * n(phrase))
// work out or current position relative to the start of phrase datas
int position = (i - PhraseDatasPosition) / 4;
// floor the index by the number of bytes for each phrase to get the phrase index
// so if there are 3 phrases and 2 columns, each phrase will have (3*2) values,
// 0 - 5 will give us 0, 6-11 will give us 1, 12-17 gives us 2, which is the correct phrase index
int phraseIndex = position / (ColumnCount * 3);
// this tells us which column we are looking at within the phrase
// same example as above, our position will be between 0 and 17,
// all even numbers will be for the first column of the respective phrase
// all odd numbers will be for the second column of the respective phrase
int columnIndex = (position / 3) % ColumnCount;
if (PhraseDatas[phraseIndex] == null)
PhraseDatas[phraseIndex] = new PhraseData { ColumnDatas = new PhraseColumnData[ColumnCount] };
PhraseDatas[phraseIndex].ColumnDatas[columnIndex] = new PhraseColumnData
{
CurrentRowTermFrequency = currentInt,
TotalTermFrequency = BitConverter.ToInt32(rawBytes, i + 4),
MatchCount = BitConverter.ToInt32(rawBytes, i + 8)
};
// skip the next to bytes as we extracted them above
i += 8;
}
}
}
catch (IndexOutOfRangeException e)
{
throw new ArgumentException("The byte array length is incorrect", e);
}
}
}
public class PhraseData
{
/// <summary>
/// Gets or sets the column datas.
/// </summary>
/// <value>Details on the phrase occurances for each column.</value>
public PhraseColumnData[] ColumnDatas { get; set; }
}
public class PhraseColumnData
{
/// <summary>
/// Gets or sets the number of times the phrase appears in the column for the current row.
/// </summary>
/// <value>The number of times the phrase appears in the column for the current row.</value>
public int CurrentRowTermFrequency { get; set; }
/// <summary>
/// Gets or sets the total number of times the phrase appears in the column in all rows in the FTS table.
/// </summary>
/// <value>The total number of times the phrase appears in the column in all rows in the FTS table.</value>
public int TotalTermFrequency { get; set; }
/// <summary>
/// Gets or sets the total number of rows in the FTS table for which the column contains at least one instance of the phrase.
/// </summary>
/// <value>The total number of rows in the FTS table for which the column contains at least one instance of the phrase.</value>
public int MatchCount { get; set; }
}
}
| {
"content_hash": "99a296d72819a8d1aa792a794ee50cc9",
"timestamp": "",
"source": "github",
"line_count": 165,
"max_line_length": 129,
"avg_line_length": 38.2969696969697,
"alnum_prop": 0.6830194651052381,
"repo_name": "jamal-osman/hanswehr-app",
"id": "148ee7f97bb2dc4c449ba4cabe241305e2da175b",
"size": "6321",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "HansWehr/MatchInfo.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "195996"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2015 Google Inc. All rights reserved.
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.
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<ImageView
android:id="@+id/icon_view"
android:layout_width="68dp"
android:layout_height="68dp"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:scaleType="fitXY"
android:src="@drawable/album_art_placeholder" />
<TextView
android:id="@+id/title_view"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/icon_view"
android:layout_marginLeft="8dp"
android:layout_marginRight="5dp"
android:layout_marginTop="12dp"
android:layout_toRightOf="@+id/icon_view"
android:ellipsize="marquee"
android:fadingEdge="horizontal"
android:maxLines="1"
android:textAppearance="@style/android:TextAppearance.StatusBar.EventContent.Title" />
<TextView
android:id="@+id/subtitle_view"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/icon_view"
android:layout_marginBottom="12dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="5dp"
android:layout_toRightOf="@+id/icon_view"
android:ellipsize="marquee"
android:fadingEdge="horizontal"
android:maxLines="1"
android:textAppearance="@style/android:TextAppearance.StatusBar.EventContent" />
</RelativeLayout> | {
"content_hash": "8a549d47a8ce77f4c9f7ab0716487e7e",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 94,
"avg_line_length": 38.793103448275865,
"alnum_prop": 0.6862222222222222,
"repo_name": "xiaoyanit/CastVideos-Android-Sample",
"id": "e238f44ed03d5a972e5ce3f5f5be955a95008515",
"size": "2250",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "CastCompanionLibrary/res/layout-v10/custom_notification.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "551377"
}
],
"symlink_target": ""
} |
require 'rack/utils'
module Hanami
module Http
# An HTTP status
#
# @since 0.1.0
# @api private
class Status
# A set of standard codes and messages for HTTP statuses
#
# @since 0.1.0
# @api private
ALL = ::Rack::Utils::HTTP_STATUS_CODES.dup.merge({
103 => 'Checkpoint',
122 => 'Request-URI too long',
413 => 'Payload Too Large', # Rack 1.5 compat
414 => 'URI Too Long', # Rack 1.5 compat
416 => 'Range Not Satisfiable', # Rack 1.5 compat
418 => 'I\'m a teapot',
420 => 'Enhance Your Calm',
444 => 'No Response',
449 => 'Retry With',
450 => 'Blocked by Windows Parental Controls',
451 => 'Wrong Exchange server',
499 => 'Client Closed Request',
506 => 'Variant Also Negotiates', # Rack 1.5 compat
598 => 'Network read timeout error',
599 => 'Network connect timeout error'
}).freeze
# Return a status for the given code
#
# @param code [Integer] a valid HTTP code
#
# @return [Array] a pair of code and message for an HTTP status
#
# @since 0.1.0
# @api private
#
# @example
# require 'hanami/http/status'
#
# Hanami::Http::Status.for_code(418) # => [418, "I'm a teapot"]
def self.for_code(code)
ALL.assoc(code)
end
# Return a message for the given status code
#
# @param code [Integer] a valid HTTP code
#
# @return [String] a message for the given status code
#
# @since 0.3.2
# @api private
def self.message_for(code)
for_code(code)[1]
end
end
end
end
| {
"content_hash": "c399f9c4f4f4d9ebe6a0d10b80c19644",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 80,
"avg_line_length": 29.258064516129032,
"alnum_prop": 0.5088202866593164,
"repo_name": "lotus/controller",
"id": "7d3d7ff6626bc19079dda0c2c3c2d1e44d1634b6",
"size": "1814",
"binary": false,
"copies": "1",
"ref": "refs/heads/1.3.x",
"path": "lib/hanami/http/status.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "236452"
}
],
"symlink_target": ""
} |
package com.pizza.model;
import javax.persistence.Column;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.MappedSuperclass;
import javax.persistence.Table;
import javax.persistence.InheritanceType;
import com.fasterxml.jackson.annotation.JsonIgnore;
@MappedSuperclass
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
abstract public class HOrderedEntity {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private long id;
@Column(name = "ITEM", nullable = false)
@Enumerated(EnumType.ORDINAL)
private Item item;
@Column(name = "COUNT", nullable = false)
private int count;
@Column(name = "USER", nullable = false)
private String user;
@Column(name = "DETAILS", nullable = false)
private String details;
@ManyToOne(fetch=FetchType.LAZY)
@JoinColumn(name="ORDER_ID", nullable=false)
@JsonIgnore
private HOrder order;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public Item getItem() {
return item;
}
public void setItem(Item item) {
this.item = item;
}
public int getCount() {
return count;
}
public void setCount(int count) {
this.count = count;
}
public String getUser() {
return user;
}
public void setUser(String user) {
this.user = user;
}
public HOrder getOrder() {
return order;
}
public void setOrder(HOrder order) {
this.order = order;
}
public String getDetails() {
return details;
}
public void setDetails(String details) {
this.details = details;
}
}
| {
"content_hash": "b66c3595e9c6126f7385c526db850313",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 53,
"avg_line_length": 19.340425531914892,
"alnum_prop": 0.7337733773377337,
"repo_name": "pavelbt2/pizza",
"id": "7a4b656ed81ed9c34a85190008eb2471d2c2397e",
"size": "1818",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Pizza/src/com/pizza/model/HOrderedEntity.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "63813"
},
{
"name": "JavaScript",
"bytes": "5767"
}
],
"symlink_target": ""
} |
title: IPv6 und IPsec
modulverantwortlich: Herr Prof. Dr. Hans L. Stahl
modulniveau:
kuezel: WPF62
untertitel:
studiensemester: 4
kategorie:
sprache:
zuordnung-zum-curriculum: Medieninformatik Bachelor
kreditpunkte: 5
voraussetzungen-nach-pruefungsordnung: KT, EBR
empfohlene-voraussetzungen:
published: true
---
## Lehrform/SWS:
## Arbeitsaufwand:
## Angestrebte Lernergebnisse:
## Inhalt:
Wird in diesem Semester nicht angeboten bzw. in Kombination mit WPF36 (Mobile IT Security) durchgeführt.
## Studien-/Prüfungsleistungen:
## Medienformen:
## Literatur:
(folgt)
| {
"content_hash": "21ea4255013fa7e432ac3389025abc45",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 104,
"avg_line_length": 16.6,
"alnum_prop": 0.774526678141136,
"repo_name": "th-koeln/mi-2017",
"id": "0c77068777694e68bf305053e2c56ca977821d5b",
"size": "587",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "_modulbeschreibungen-bpo3/WPF_4_IPv6undIPsec.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "344373"
},
{
"name": "HTML",
"bytes": "738422"
},
{
"name": "JavaScript",
"bytes": "504454"
},
{
"name": "Less",
"bytes": "172527"
},
{
"name": "PHP",
"bytes": "29346"
},
{
"name": "Ruby",
"bytes": "152"
},
{
"name": "SCSS",
"bytes": "139417"
},
{
"name": "Sass",
"bytes": "56280"
},
{
"name": "TeX",
"bytes": "685468"
}
],
"symlink_target": ""
} |
#ifndef UTILITY_OTRADIOLINK_MESSAGING_H_
#define UTILITY_OTRADIOLINK_MESSAGING_H_
#include <OTV0p2Base.h>
#include "OTV0P2BASE_Util.h"
#include "OTRadioLink_SecureableFrameType.h"
#include "OTRadioLink_SecureableFrameType_V0p2Impl.h"
#include "OTRadValve_BoilerDriver.h"
#include "OTRadioLink_OTRadioLink.h"
#include "OTRadioLink_MessagingFS20.h"
namespace OTRadioLink
{
////////////////// FUNCTION TYPEDEFS.
/**
* @brief Function containing the desired operation for the frame handler to
* perform on receipt of a valid frame.
* @retval True if operation is performed successfully.
* FIXME Return values are always unused.
*/
typedef bool (frameOperator_fn_t) (const OTDecodeData_T &fd);
/**
* @brief High level protocol/frame handler for decoding an RXed message.
* @param Pointer to message buffer. Message length is contained in the byte
* before the buffer.
* May contain trailing bytes after the message.
* @retval True if frame is successfully handled. NOTE: This does not mean it
* could be decoded/decrypted, just that the handler recognised the
* frame type.
*/
typedef bool (frameDecodeHandler_fn_t) (volatile const uint8_t *msg);
////////////////// FUNCTION DECLARATIONS.
// Stub version of a frameOperator_fn_t type function.
inline frameOperator_fn_t nullFrameOperation;
// Print a JSON frame to serial
frameOperator_fn_t serialFrameOperation;
// Attempt to add raw RXed frame to rt send queue, if basic validity check of
// decrypted frame passed.
frameOperator_fn_t relayFrameOperation;
// Trigger a boiler call for heat.
frameOperator_fn_t boilerFrameOperation;
// Dummy frame decoder and handler.
frameDecodeHandler_fn_t decodeAndHandleDummyFrame;
// Handle an OT style secure frame. Will return false for *secureable* small
// frames that aren't secure.
frameDecodeHandler_fn_t decodeAndHandleOTSecureFrame;
/**
* @brief Stub version of a frameOperator_fn_t type function.
* @retval Always false.
* @note Used as a dummy operation. Should be optimised out by the compiler.
*/
bool nullFrameOperation (const OTDecodeData_T & /*fd*/) { return (false); }
/**
* @brief Operation for printing to serial
* @param p_t: Type of printable object (usually Print, included for
* consistency with other handlers).
* @param p: Reference to printable object. Usually the "Serial" object on
* the arduino. NOTE! must be the concrete instance. AVR-GCC cannot
* currently detect compile time constness of references or pointers (20170608).
* @param fd: Decoded frame data.
* @retval False if decryptedBody fails basic validation, else true. NOTE will
* return true even if printing fails, as long as it was attempted.
*/
template <typename p_t, p_t &p>
bool serialFrameOperation(const OTDecodeData_T &fd)
{
const uint8_t * const db = fd.ptext;
const uint8_t dbLen = fd.ptextLen;
const uint8_t * const senderNodeID = fd.id;
// Perform some basic validation of the plain text (is it worth printing) and print.
if((0 != (db[1] & 0x10)) && (dbLen > 3) && ('{' == db[2])) {
// FIXME Feel like this should be moved somewhere else.
// TODO JSON output not implemented yet.
// Write out the JSON message, inserting synthetic ID/@ and seq/+.
p.print(F("{\"@\":\""));
for(int i = 0; i < OTV0P2BASE::OpenTRV_Node_ID_Bytes; ++i) { p.print(senderNodeID[i], 16); } // print in hex
p.print(F("\",\"+\":"));
p.print(fd.sfh.getSeq());
p.print(',');
p.write(db + 3, dbLen - 3);
p.println('}');
// OTV0P2BASE::outputJSONStats(&Serial, secure, msg, msglen);
// Attempt to ensure that trailing characters are pushed out fully.
// FIXME DHD is dubious about this setup.
#ifdef ARDUINO_ARCH_AVR
OTV0P2BASE::flushSerialProductive();
#endif // ARDUINO_ARCH_AVR
return true;
}
return false;
}
/**
* @brief Attempt to add raw RXed frame to rt send queue, if basic validity
* check of decrypted frame passed.
* @param rt_t: Type of rt. Should be an implementation of OTRadioLink.
* @param rt: Radio to relay frame over. NOTE! must be the concrete instance
* (e.g. SIM900 rather than SecondaryRadio). AVR-GCC cannot currently
* detect compile time constness of references or pointers (20170608).
* @param fd: Decoded frame data.
* retval True if frame successfully added to send queue on rt, else false.
*/
template <typename rt_t, rt_t &rt>
bool relayFrameOperation(const OTDecodeData_T &fd)
{
// Check msg exists.
if(nullptr == fd.ctext) return false;
const uint8_t * const db = fd.ptext;
const uint8_t dbLen = fd.ptextLen;
// Perform some basic validation of the plain text (is it worth sending) and add to relay radio queue.
if((0 != (db[1] & 0x10)) && (dbLen > 3) && ('{' == db[2])) {
return rt.queueToSend(fd.ctext + 1, fd.ctextLen);
}
return false;
}
/**
* @brief Operator for triggering a boiler call for heat.
* @param bh_t: Type of bh
* @param bh: Boiler Hub driver. Should implement the interface of
* OnOffBoilerDriverLogic. NOTE! must be the concrete instance.
* AVR-GCC cannot currently detect compile time constness of
* references or pointers (20170608).
* @param minuteCount: Reference to the minuteCount variable in Control.cpp (20170608).
* NOTE: minuteCount may be removed from the API in future (DE20170616)
* @param fd: Decoded frame data.
* @retval True if call for heat handled. False if percentOpen is invalid.
*/
template <typename bh_t, bh_t &bh, const uint8_t &minuteCount>
bool boilerFrameOperation(const OTDecodeData_T &fd)
{
const uint8_t * const db = fd.ptext;
const uint8_t percentOpen = db[0];
if(percentOpen <= 100) {
bh.remoteCallForHeatRX(0, percentOpen, minuteCount);
return (true);
}
return (false);
}
/**
* @brief Authenticate and decrypt secure frames. Expects syntax checking and
* validation to already have been done.
* @param fd: OTFrameData_T object containing message to decrypt.
* @param decrypt: Function to decrypt secure frame with.
* @param getKey: Function that fills a buffer with the 16 byte secret key.
* Should return true on success.
* @retval True if frame successfully authenticated and decoded, else false.
*
* Note: the scratch space (workspace) depends on the underlying decrypt
* function and the receiver class.
*/
// Local scratch: total incl template srfx_t::decodeSecureSmallFrameSafely().
static constexpr uint8_t authAndDecodeOTSecurableFrameWithWorkspace_scratch_usage =
16; // Primary building key size.
template <typename sfrx_t,
SimpleSecureFrame32or0BodyRXBase::fixed32BTextSize12BNonce16BTagSimpleDec_fn_t &decrypt,
OTV0P2BASE::GetPrimary16ByteSecretKey_t &getKey>
inline bool authAndDecodeOTSecurableFrame(OTDecodeData_T &fd, OTV0P2BASE::ScratchSpaceL &sW)
{
constexpr size_t scratchSpaceNeededHere = authAndDecodeOTSecurableFrameWithWorkspace_scratch_usage;
if(sW.bufsize < scratchSpaceNeededHere) { return(false); } // ERROR
#if 0
// Probe the stack here, in case we don't get deeper.
OTV0P2BASE::MemoryChecks::recordIfMinSP();
#endif
// Use scratch space for 16-byte key.
uint8_t *key = sW.buf;
// Get the building primary key.
if(!getKey(key)) { // CI throws "address will never be null" error.
OTV0P2BASE::serialPrintlnAndFlush(F("!RX key"));
return(false);
}
// Create sub-space for callee.
OTV0P2BASE::ScratchSpaceL subScratch(sW, scratchSpaceNeededHere);
// Now attempt to decrypt.
// Assumed no need to 'adjust' node ID for this form of RX.
// Look up full ID in associations table,
// validate the RX message counter,
// authenticate and decrypt,
// then update the RX message counter.
const bool isOK = (0 != sfrx_t::getInstance().decode(
fd,
decrypt,
subScratch, key,
true));
#if 1 // && defined(DEBUG)
if(!isOK) {
// Useful brief network diagnostics.
// A couple of bytes of the claimed ID of rejected frames.
// Warnings rather than errors
// because there may legitimately be multiple disjoint networks.
//
// Missing association or failed auth.
OTV0P2BASE::serialPrintAndFlush(F("?RX auth"));
if(fd.sfh.getIl() > 0) { OTV0P2BASE::serialPrintAndFlush(' '); OTV0P2BASE::serialPrintAndFlush(fd.sfh.id[0], 16); }
if(fd.sfh.getIl() > 1) { OTV0P2BASE::serialPrintAndFlush(' '); OTV0P2BASE::serialPrintAndFlush(fd.sfh.id[1], 16); }
// More detailed ID of rejected frames
#if 0
if(fd.sfh.getIl() > 2) { OTV0P2BASE::serialPrintAndFlush(' '); OTV0P2BASE::serialPrintAndFlush(fd.sfh.id[2], 16); }
if(fd.sfh.getIl() > 3) { OTV0P2BASE::serialPrintAndFlush(' '); OTV0P2BASE::serialPrintAndFlush(fd.sfh.id[3], 16); }
if(fd.sfh.getIl() > 4) { OTV0P2BASE::serialPrintAndFlush(' '); OTV0P2BASE::serialPrintAndFlush(fd.sfh.id[4], 16); }
if(fd.sfh.getIl() > 5) { OTV0P2BASE::serialPrintAndFlush(' '); OTV0P2BASE::serialPrintAndFlush(fd.sfh.id[5], 16); }
if(fd.sfh.getIl() > 6) { OTV0P2BASE::serialPrintAndFlush(' '); OTV0P2BASE::serialPrintAndFlush(fd.sfh.id[6], 16); }
if(fd.sfh.getIl() > 7) { OTV0P2BASE::serialPrintAndFlush(' '); OTV0P2BASE::serialPrintAndFlush(fd.sfh.id[7], 16); }
#endif
OTV0P2BASE::serialPrintlnAndFlush();
}
#endif
return(isOK); // Return if successfully decoded, authenticated, etc.
}
/**
* @brief Stub version of a frameOperator_fn_t type function.
* @retval Always false.
* @note Used as a dummy operation and should be optimised out by the compiler.
*/
inline bool decodeAndHandleDummyFrame(volatile const uint8_t * const /*msg*/)
{
return false;
}
/**
* @brief Attempt to decode a message as if it is a standard OT secure "O"
* type frame. May perform up to two "operations" if the decode
* succeeds.
*
* First confirms that the frame "looks like" a secure O frame and that it can
* attempt to decode, i.e.
* - The message has a valid header.
* - The first byte matches an O frame with the secure bit set.
* - The message is a secure frame.
*
* Any actions to be taken on a succesful decode must be passed in as callbacks,
* or the message will be decoded then lost. In this library, they are labelled
* `operators` to avoid confusion with the message/frame handlers.
* The operators are called in ascending order and will always all be called
* if the message is successfully decoded. They should not alter the decoded
* frame data (fd) in any way.
* Note that operators can only take the frame data as function parameters and
* anything else must be passed in as template parameters.
*
* @param sfrx_t: TODO
* @param decrypt: A function to decrypt secure frame with.
* @param getKey: A function that fills a buffer with the 16 byte secret key.
* Should return true on success.
* @param o1: First operator to be called.
* @param o2: Second operator to be called. Defaults to a dummy impl.
* @param _msg: Raw RXed message. msgLen should be stored in the byte before
* and can be accessed with msg[-1]. This routine is NOT allowed to
* alter content of the buffer passed.
* @param sW: Scratch space to perform decode routine in. Should be large
* enough for both the frame RX type and the underlying decryption
* routine.
* @retval False if the frame header could not be decoded, does not match a
* secure "O" frame, or the frame is otherwise malformed in any way.
* True if the frame is a valid secure frame.
* NOTE! A frame that "looks like" a secure "O" frame but can not be
* authed or decoded, it will return true.
*/
template<typename sfrx_t,
SimpleSecureFrame32or0BodyRXBase::fixed32BTextSize12BNonce16BTagSimpleDec_fn_t &decrypt,
OTV0P2BASE::GetPrimary16ByteSecretKey_t &getKey,
frameOperator_fn_t &o1,
frameOperator_fn_t &o2 = nullFrameOperation>
bool decodeAndHandleOTSecureOFrame(volatile const uint8_t * const _msg, OTV0P2BASE::ScratchSpaceL &sW)
{
const uint8_t * const msg = (const uint8_t * const)_msg - 1;
const uint8_t firstByte = msg[1];
const uint8_t msglen = msg[0];
// Buffer for receiving secure frame body.
// (Non-secure frame bodies should be read directly from the frame buffer.)
// FIXME: Should this be passed in by scratch space?
// TODO: Consider moving this out by one layer and passing it in, to avoid
// needing to re-decode header in second handler.
uint8_t decryptedBodyOut[OTDecodeData_T::ptextLenMax];
OTDecodeData_T fd(msg, decryptedBodyOut);
// Validate structure of header/frame first.
// This is quick and checks for insane/dangerous values throughout.
const uint8_t l = fd.sfh.decodeHeader(msg, msglen + 1);
// If failed this early and this badly,
// then let another protocol handler try parsing the message buffer...
if(0 == l) { return(false); }
// Make sure frame thinks it is a secure OFrame.
constexpr uint8_t expectedOFrameFirstByte = 'O' | 0x80;
if(expectedOFrameFirstByte != firstByte) { return (false); }
// Validate integrity of frame (CRC for non-secure, auth for secure).
if(!fd.sfh.isSecure()) { return(false); }
// After this point, once the frame is established as the correct protocol,
// this routine must return true to avoid another handler
// attempting to process it.
// Even if auth fails, we have now handled this frame by protocol.
if(!authAndDecodeOTSecurableFrame<sfrx_t, decrypt, getKey>(fd, sW))
{ return(true); }
// Make sure frame is long enough to have useful information in it
// and then call operations.
if(2 < fd.ptextLenMax) {
o1(fd);
o2(fd);
}
// This frame has now been dealt with (by protocol)
// even if we happened not to be able to process it successfully.
return(true);
}
/*
* @brief Attempt to decode an inbound message using all available decoders.
*
* The decoder/router should cope with message that contain trailing garbage at
* the end. The message is passed on to a set of handlers that are passed in as
* template parameters.
*
* Handlers should be passed in the order they should be executed as the
* function will return on the first successful handler, skipping all
* subsequent ones.
*
* `msg` may be reused when this returns, so a copy should be taken of anything
* that needs to be retained.
*
* @param msg: Raw RXed message. msgLen should be stored in the byte before
* and can be accessed with msg[-1]. This routine is NOT allowed to
* alter content of the buffer passed.
* @param h1: First frame handler to attempt.
* @param h2: Second frame handler to attempt. Defaults to a dummy handler.
* Handlers are called in order, until the first successful handler.
* By default all operations but h1 will default to a dummy stub operation (decodeAndHandleDummyFrame).
*/
template<frameDecodeHandler_fn_t &h1, frameDecodeHandler_fn_t &h2 = decodeAndHandleDummyFrame>
void decodeAndHandleRawRXedMessage(volatile const uint8_t * const msg)
{
const uint8_t msglen = msg[-1];
// TODO: consider extracting hash of all message data (good/bad) and injecting into entropy pool.
if(msglen < 2) { return; } // Too short to be useful, so ignore.
// Go through handlers. (20170616) Currently relying on compiler to optimise out anything unneeded.
if(h1(msg)) { return; }
if(h2(msg)) { return; }
// Unparseable frame: drop it.
return;
}
/**
* @brief Abstract interface for handling message queues.
* Provided as V0p2 is still spaghetti (20170608).
*/
class OTMessageQueueHandlerBase
{
public:
/**
* @brief Check the supplied radio if a frame has been received and pass
* on to any relevant handlers.
* @param wakeSerialIfNeeded: If true, makes sure the serial port is
* enabled on entry and returns it to how it found it on exit.
* @param rl: Radio to check for new RXed frames.
* @retval Returns true if anything was done..
*/
virtual bool handle(bool /*wakeSerialIfNeeded*/, OTRadioLink & /*rl*/) = 0;
};
/**
* @brief Null implementation. Always returns false.
*/
class OTMessageQueueHandlerNull final : public OTMessageQueueHandlerBase
{
public:
/**
* @retval Always false as it never never tries to do anything.
*/
virtual bool handle(bool /*wakeSerialIfNeeded*/, OTRadioLink & /*rl*/) override
{ return false; };
};
/*
* @param pollIO: Function to call before handling inbound messages. TODO Rename this.
* @param baud: Serial baud for serial output.
* @param h1: First frame handler to attempt.
* @param h2: Second frame handler to attempt. Defaults to a dummy handler.
* See `handle` for details on how handlers are called.
*/
template<bool (*pollIO) (bool), uint16_t baud,
frameDecodeHandler_fn_t &h1,
frameDecodeHandler_fn_t &h2 = decodeAndHandleDummyFrame>
class OTMessageQueueHandler final: public OTMessageQueueHandlerBase
{
public:
/**
* @brief Poll radio and incrementally process any queued messages.
*
* This will attempt to decode an inbound frame using up to two frame
* handlers. The handlers will be tried in the order they are passed in to
* the message queue handler and this function will:
* - exit on the first handler to return a success (bool true)
* - after all handlers have failed, in which case the frame is dropped.
* Handlers are expected to be perform or trigger any action required by
* the frame.
*
* Typical workflow:
* - Setup a radio (derived from OTRadioLink::OTRadioLink).
* - Define a pollIO function, e.g. poll all IO lines, excluding sensors
* and serial ports and return true if any was processed.
* - Define up to two frame handlers (See docs for `frameDecodeHandler_fn_t`
* in this file).
* - Create an OTMessageQueueHandler object.
* - Call handle(...) periodically to handle incoming messages.
* See OpenTRV-Arduino-V0p2/Arduino/hardware/REV10/REV10SecureBHR/REV10SecureBHR.ino
* for an example that relays a frame over another radio and notifies the
* boiler hub driver of the states of any associated valves.
*
* This will attempt to process messages in such a way
* as to avoid internal overflows or other resource exhaustion,
* which may mean deferring work at certain times
* such as the end of minor cycle.
*
* @param wakeSerialIfNeeded: If true, makes sure the serial port is
* enabled on entry and returns it to how it found it on exit.
* @param rl: Radio to check for new RXed frames.
* @retval Returns true if a message was RXed and processed, or if pollIO
* returns true. NOTE that this is independant of whether the
* message was successfully handled.
*/
virtual bool handle(bool
#ifdef ARDUINO_ARCH_AVR
wakeSerialIfNeeded
#endif // ARDUINO_ARCH_AVR
, OTRadioLink &rl) override
{
// Avoid starting any potentially-slow processing very late in the minor cycle.
// This is to reduce the risk of loop overruns
// at the risk of delaying some processing
// or even dropping some incoming messages if queues fill up.
//
// DHD20180919 note: timings for AVR (ATMega328P) ~REV7 h/w...
// Decoding (and printing to serial) a secure 'O' frame
// takes ~60 ticks (~0.47s).
// Allow for up to 0.5s of such processing worst-case,
// ie don't start processing anything later than
// 0.5s before the minor cycle end.
#ifdef ARDUINO_ARCH_AVR
const uint8_t sctStart = OTV0P2BASE::getSubCycleTime();
if(sctStart >= ((OTV0P2BASE::GSCT_MAX/4)*3)) { return(false); }
#endif // ARDUINO_ARCH_AVR
// Deal with any I/O that is queued.
bool workDone = pollIO(true);
// Check for activity on the radio link.
rl.poll();
// Pointer to RX message buffer of radio.
const volatile uint8_t *pb = rl.peekRXMsg();
// If pb is a nullptr at this stage, no message has been RXed.
if(nullptr != pb) {
#ifdef ARDUINO_ARCH_AVR
bool neededWaking = false; // Set true once this routine wakes Serial.
if(!neededWaking && wakeSerialIfNeeded && OTV0P2BASE::powerUpSerialIfDisabled<baud>()) { neededWaking = true; } // FIXME
#endif // ARDUINO_ARCH_AVR
// Don't currently regard anything arriving over the air as 'secure'.
// FIXME: shouldn't have to cast away volatile to process the message content.
decodeAndHandleRawRXedMessage<h1, h2> (pb);
rl.removeRXMsg();
// Note that some work has been done.
workDone = true;
// Turn off serial at end, if this routine woke it.
#ifdef ARDUINO_ARCH_AVR
if(neededWaking) { OTV0P2BASE::flushSerialProductive(); OTV0P2BASE::powerDownSerial(); }
#endif // ARDUINO_ARCH_AVR
}
return(workDone);
}
};
}
// Used to be in the switch on frame type in decodeAndHandleOTSecurableFrame.
//#if defined(ENABLE_SECURE_RADIO_BEACON)
//#if defined(ENABLE_OTSECUREFRAME_INSECURE_RX_PERMITTED) // Allow insecure.
// // Beacon / Alive frame, non-secure.
// case OTRadioLink::FTS_ALIVE:
// {
//#if 0 && defined(DEBUG)
//DEBUG_SERIAL_PRINTLN_FLASHSTRING("Beacon nonsecure");
//#endif
// // Ignores any body data.
// return(true);
// }
//#endif // defined(ENABLE_OTSECUREFRAME_INSECURE_RX_PERMITTED)
// // Beacon / Alive frame, secure.
// case OTRadioLink::FTS_ALIVE | 0x80:
// {
//#if 0 && defined(DEBUG)
//DEBUG_SERIAL_PRINTLN_FLASHSTRING("Beacon");
//#endif
// // Does not expect any body data.
// if(decryptedBodyOutSize != 0)
// {
//#if 0 && defined(DEBUG)
//DEBUG_SERIAL_PRINT_FLASHSTRING("!Beacon data ");
//DEBUG_SERIAL_PRINT(decryptedBodyOutSize);
//DEBUG_SERIAL_PRINTLN();
//#endif
// break;
// }
// return(true);
// }
//#endif // defined(ENABLE_SECURE_RADIO_BEACON)
#endif /* UTILITY_OTRADIOLINK_MESSAGING_H_ */
| {
"content_hash": "0b4c592c95467308a8d17d10157c9f19",
"timestamp": "",
"source": "github",
"line_count": 543,
"max_line_length": 132,
"avg_line_length": 41.729281767955804,
"alnum_prop": 0.6732865528046251,
"repo_name": "Denzo77/OTRadioLink",
"id": "6d182ef6d4458d750d1f696dcc44c7c1392f9dca",
"size": "23318",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "content/OTRadioLink/utility/OTRadioLink_Messaging.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "11457"
},
{
"name": "C",
"bytes": "1167908"
},
{
"name": "C++",
"bytes": "2565386"
},
{
"name": "Gnuplot",
"bytes": "2542"
},
{
"name": "Meson",
"bytes": "8318"
},
{
"name": "Python",
"bytes": "17099"
},
{
"name": "Shell",
"bytes": "3951"
}
],
"symlink_target": ""
} |
void f() {
int i;
asm ("foo\n" : : "a" (i + 2));
asm ("foo\n" : : "a" (f())); // expected-error {{invalid type 'void' in asm input}}
asm ("foo\n" : "=a" (f())); // expected-error {{invalid lvalue in asm output}}
asm ("foo\n" : "=a" (i + 2)); // expected-error {{invalid lvalue in asm output}}
asm ("foo\n" : [symbolic_name] "=a" (i) : "[symbolic_name]" (i));
asm ("foo\n" : "=a" (i) : "[" (i)); // expected-error {{invalid input constraint '[' in asm}}
asm ("foo\n" : "=a" (i) : "[foo" (i)); // expected-error {{invalid input constraint '[foo' in asm}}
asm ("foo\n" : "=a" (i) : "[symbolic_name]" (i)); // expected-error {{invalid input constraint '[symbolic_name]' in asm}}
asm ("foo\n" : : "" (i)); // expected-error {{invalid input constraint '' in asm}}
asm ("foo\n" : "=a" (i) : "" (i)); // expected-error {{invalid input constraint '' in asm}}
}
void clobbers() {
asm ("nop" : : : "ax", "#ax", "%ax");
asm ("nop" : : : "eax", "rax", "ah", "al");
asm ("nop" : : : "0", "%0", "#0");
asm ("nop" : : : "foo"); // expected-error {{unknown register name 'foo' in asm}}
asm ("nop" : : : "52");
asm ("nop" : : : "104"); // expected-error {{unknown register name '104' in asm}}
asm ("nop" : : : "-1"); // expected-error {{unknown register name '-1' in asm}}
asm ("nop" : : : "+1"); // expected-error {{unknown register name '+1' in asm}}
}
// rdar://6094010
void test3() {
int x;
asm(L"foo" : "=r"(x)); // expected-error {{wide string}}
asm("foo" : L"=r"(x)); // expected-error {{wide string}}
}
// <rdar://problem/6156893>
void test4(const volatile void *addr)
{
asm ("nop" : : "r"(*addr)); // expected-error {{invalid type 'const volatile void' in asm input for constraint 'r'}}
asm ("nop" : : "m"(*addr));
asm ("nop" : : "r"(test4(addr))); // expected-error {{invalid type 'void' in asm input for constraint 'r'}}
asm ("nop" : : "m"(test4(addr))); // expected-error {{invalid lvalue in asm input for constraint 'm'}}
asm ("nop" : : "m"(f())); // expected-error {{invalid lvalue in asm input for constraint 'm'}}
}
// <rdar://problem/6512595>
void test5() {
asm("nop" : : "X" (8));
}
// PR3385
void test6(long i) {
asm("nop" : : "er"(i));
}
void asm_string_tests(int i) {
asm("%!"); // simple asm string, %! is not an error.
asm("%!" : ); // expected-error {{invalid % escape in inline assembly string}}
asm("xyz %" : ); // expected-error {{invalid % escape in inline assembly string}}
asm ("%[somename]" :: [somename] "i"(4)); // ok
asm ("%[somename]" :: "i"(4)); // expected-error {{unknown symbolic operand name in inline assembly string}}
asm ("%[somename" :: "i"(4)); // expected-error {{unterminated symbolic operand name in inline assembly string}}
asm ("%[]" :: "i"(4)); // expected-error {{empty symbolic operand name in inline assembly string}}
// PR3258
asm("%9" :: "i"(4)); // expected-error {{invalid operand number in inline asm string}}
asm("%1" : "+r"(i)); // ok, referring to input.
}
// PR4077
int test7(unsigned long long b) {
int a;
asm volatile("foo %0 %1" : "=a" (a) :"0" (b)); // expected-error {{input with type 'unsigned long long' matching output with type 'int'}}
return a;
}
// <rdar://problem/7574870>
asm volatile (""); // expected-warning {{meaningless 'volatile' on asm outside function}}
// PR3904
void test8(int i) {
// A number in an input constraint can't point to a read-write constraint.
asm("" : "+r" (i), "=r"(i) : "0" (i)); // expected-error{{invalid input constraint '0' in asm}}
}
// PR3905
void test9(int i) {
asm("" : [foo] "=r" (i), "=r"(i) : "1[foo]"(i)); // expected-error{{invalid input constraint '1[foo]' in asm}}
asm("" : [foo] "=r" (i), "=r"(i) : "[foo]1"(i)); // expected-error{{invalid input constraint '[foo]1' in asm}}
}
void test10(void){
static int g asm ("g_asm") = 0;
extern int gg asm ("gg_asm");
__private_extern__ int ggg asm ("ggg_asm");
int a asm ("a_asm"); // expected-warning{{ignored asm label 'a_asm' on automatic variable}}
auto int aa asm ("aa_asm"); // expected-warning{{ignored asm label 'aa_asm' on automatic variable}}
register int r asm ("cx");
register int rr asm ("rr_asm"); // expected-error{{unknown register name 'rr_asm' in asm}}
register int rrr asm ("%"); // expected-error{{unknown register name '%' in asm}}
}
// This is just an assert because of the boolean conversion.
// Feel free to change the assembly to something sensible if it causes a problem.
// rdar://problem/9414925
void test11(void) {
_Bool b;
asm volatile ("movb %%gs:%P2,%b0" : "=q"(b) : "0"(0), "i"(5L));
}
void test12(void) {
register int cc __asm ("cc"); // expected-error{{unknown register name 'cc' in asm}}
}
// PR10223
void test13(void) {
void *esp;
__asm__ volatile ("mov %%esp, %o" : "=r"(esp) : : ); // expected-error {{invalid % escape in inline assembly string}}
}
// <rdar://problem/12700799>
struct S; // expected-note 2 {{forward declaration of 'struct S'}}
void test14(struct S *s) {
__asm("": : "a"(*s)); // expected-error {{dereference of pointer to incomplete type 'struct S'}}
__asm("": "=a" (*s) :); // expected-error {{dereference of pointer to incomplete type 'struct S'}}
}
// PR15759.
double test15() {
double ret = 0;
__asm("0.0":"="(ret)); // expected-error {{invalid output constraint '=' in asm}}
__asm("0.0":"=&"(ret)); // expected-error {{invalid output constraint '=&' in asm}}
__asm("0.0":"+?"(ret)); // expected-error {{invalid output constraint '+?' in asm}}
__asm("0.0":"+!"(ret)); // expected-error {{invalid output constraint '+!' in asm}}
__asm("0.0":"+#"(ret)); // expected-error {{invalid output constraint '+#' in asm}}
__asm("0.0":"+*"(ret)); // expected-error {{invalid output constraint '+*' in asm}}
__asm("0.0":"=%"(ret)); // expected-error {{invalid output constraint '=%' in asm}}
__asm("0.0":"=,="(ret)); // expected-error {{invalid output constraint '=,=' in asm}}
__asm("0.0":"=,g"(ret)); // no-error
__asm("0.0":"=g"(ret)); // no-error
return ret;
}
// PR19837
struct foo {
int a;
char b;
};
register struct foo bar asm("sp"); // expected-error {{bad type for named register variable}}
register float baz asm("sp"); // expected-error {{bad type for named register variable}}
double f_output_constraint(void) {
double result;
__asm("foo1": "=f" (result)); // expected-error {{invalid output constraint '=f' in asm}}
return result;
}
void fn1() {
int l;
__asm__(""
: [l] "=r"(l)
: "[l],m"(l)); // expected-error {{asm constraint has an unexpected number of alternatives: 1 vs 2}}
}
void fn2() {
int l;
__asm__(""
: "+&m"(l)); // expected-error {{invalid output constraint '+&m' in asm}}
}
void fn3() {
int l;
__asm__(""
: "+#r"(l)); // expected-error {{invalid output constraint '+#r' in asm}}
}
void fn4() {
int l;
__asm__(""
: "=r"(l)
: "m#"(l));
}
void fn5() {
int l;
__asm__(""
: [g] "+r"(l)
: "[g]"(l)); // expected-error {{invalid input constraint '[g]' in asm}}
}
void fn6() {
int a;
__asm__(""
: "=rm"(a), "=rm"(a)
: "11m"(a)) // expected-error {{invalid input constraint '11m' in asm}}
}
| {
"content_hash": "311f796ae4c41fad735732a5b8bfb44b",
"timestamp": "",
"source": "github",
"line_count": 202,
"max_line_length": 139,
"avg_line_length": 35.82673267326733,
"alnum_prop": 0.5701257427110681,
"repo_name": "Rapier-Foundation/rapier-script",
"id": "6c6f3f398e33087f2b852623abd0a673514e3de7",
"size": "7330",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/rapierlang/test/Sema/asm.c",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "AppleScript",
"bytes": "1429"
},
{
"name": "Assembly",
"bytes": "13988"
},
{
"name": "Batchfile",
"bytes": "10286"
},
{
"name": "C",
"bytes": "7566017"
},
{
"name": "C#",
"bytes": "12133"
},
{
"name": "C++",
"bytes": "39435677"
},
{
"name": "CMake",
"bytes": "69644"
},
{
"name": "CSS",
"bytes": "22918"
},
{
"name": "Cuda",
"bytes": "31200"
},
{
"name": "Emacs Lisp",
"bytes": "15377"
},
{
"name": "FORTRAN",
"bytes": "7033"
},
{
"name": "Groff",
"bytes": "9943"
},
{
"name": "HTML",
"bytes": "1148463"
},
{
"name": "JavaScript",
"bytes": "24233"
},
{
"name": "LLVM",
"bytes": "688"
},
{
"name": "Limbo",
"bytes": "755"
},
{
"name": "M",
"bytes": "2529"
},
{
"name": "Makefile",
"bytes": "93929"
},
{
"name": "Mathematica",
"bytes": "5122"
},
{
"name": "Matlab",
"bytes": "40309"
},
{
"name": "Mercury",
"bytes": "1222"
},
{
"name": "Objective-C",
"bytes": "4355070"
},
{
"name": "Objective-C++",
"bytes": "1428214"
},
{
"name": "Perl",
"bytes": "102454"
},
{
"name": "Python",
"bytes": "470720"
},
{
"name": "Shell",
"bytes": "6997"
}
],
"symlink_target": ""
} |
package com.yumodev.baidulbs;
import android.app.Notification;
import android.content.Context;
import android.widget.Toast;
import com.baidu.location.BDAbstractLocationListener;
import com.baidu.location.BDLocation;
import com.baidu.location.LocationClient;
import com.baidu.location.LocationClientOption;
/**
* Created by yumo on 2018/4/20.
*/
public class BaiduLocHelper {
private Context mContext = null;
public LocationClient mLocationClient = null;
private MyLocationListener myListener = new MyLocationListener();
private BaiduLocHelper(){};
public static BaiduLocHelper getInstance(){
return SingletonHolder.instance;
}
//BDAbstractLocationListener为7.2版本新增的Abstract类型的监听接口
//原有BDLocationListener接口暂时同步保留。具体介绍请参考后文中的说明
public void init(Context context) {
mContext = context;
mLocationClient = new LocationClient(context);
//声明LocationClient类
mLocationClient.registerLocationListener(myListener);
//注册监听函数
LocationClientOption option = new LocationClientOption();
option.setLocationMode(LocationClientOption.LocationMode.Hight_Accuracy);
//可选,设置定位模式,默认高精度
//LocationMode.Hight_Accuracy:高精度;
//LocationMode. Battery_Saving:低功耗;
//LocationMode. Device_Sensors:仅使用设备;
option.setCoorType("bd09ll");
//可选,设置返回经纬度坐标类型,默认gcj02
//gcj02:国测局坐标;
//bd09ll:百度经纬度坐标;
//bd09:百度墨卡托坐标;
//海外地区定位,无需设置坐标类型,统一返回wgs84类型坐标
option.setScanSpan(1000);
//可选,设置发起定位请求的间隔,int类型,单位ms
//如果设置为0,则代表单次定位,即仅定位一次,默认为0
//如果设置非0,需设置1000ms以上才有效
option.setOpenGps(true);
//可选,设置是否使用gps,默认false
//使用高精度和仅用设备两种定位模式的,参数必须设置为true
option.setLocationNotify(true);
//可选,设置是否当GPS有效时按照1S/1次频率输出GPS结果,默认false
option.setIgnoreKillProcess(false);
//可选,定位SDK内部是一个service,并放到了独立进程。
//设置是否在stop的时候杀死这个进程,默认(建议)不杀死,即setIgnoreKillProcess(true)
option.SetIgnoreCacheException(false);
//可选,设置是否收集Crash信息,默认收集,即参数为false
option.setWifiCacheTimeOut(5 * 60 * 1000);
//可选,7.2版本新增能力
//如果设置了该接口,首次启动定位时,会先判断当前WiFi是否超出有效期,若超出有效期,会先重新扫描WiFi,然后定位
option.setEnableSimulateGps(false);
//可选,设置是否需要过滤GPS仿真结果,默认需要,即参数为false
mLocationClient.setLocOption(option);
//mLocationClient为第二步初始化过的LocationClient对象
//需将配置好的LocationClientOption对象,通过setLocOption方法传递给LocationClient对象使用
//更多LocationClientOption的配置,请参照类参考中LocationClientOption类的详细说明
}
public void start(){
mLocationClient.start();
}
public void stop(){
mLocationClient.stop();
}
public void enableLocInForeground(int id, Notification notification){
mLocationClient.enableLocInForeground(id, notification);
}
public void disableLocInForeground(boolean disable){
mLocationClient.disableLocInForeground(disable);
}
public class MyLocationListener extends BDAbstractLocationListener{
@Override
public void onReceiveLocation(BDLocation location) {
//此处的BDLocation为定位结果信息类,通过它的各种get方法可获取定位相关的全部结果
//以下只列举部分获取经纬度相关(常用)的结果信息
//更多结果信息获取说明,请参照类参考中BDLocation类中的说明
double latitude = location.getLatitude(); //获取纬度信息
double longitude = location.getLongitude(); //获取经度信息
float radius = location.getRadius(); //获取定位精度,默认值为0.0f
String coorType = location.getCoorType();
//获取经纬度坐标类型,以LocationClientOption中设置过的坐标类型为准
int errorCode = location.getLocType();
//获取定位类型、定位错误返回码,具体信息可参照类参考中BDLocation类中的说明
StringBuilder sb = new StringBuilder();
sb.append(latitude);
sb.append(location.getLocTypeDescription());
sb.append(" " + longitude);
sb.append(" " + radius);
sb.append(" " + coorType);
sb.append(" " + errorCode);
Toast.makeText(mContext, "baidu "+sb.toString(), Toast.LENGTH_SHORT).show();
}
}
private static class SingletonHolder{
private static final BaiduLocHelper instance = new BaiduLocHelper();
}
}
| {
"content_hash": "0583d296177c3240a3c39b6de3e4afc9",
"timestamp": "",
"source": "github",
"line_count": 134,
"max_line_length": 88,
"avg_line_length": 31.440298507462686,
"alnum_prop": 0.676952290529314,
"repo_name": "YumoDevTest/AndroidOpenTest",
"id": "40af2482e3e681a3ebf1f9270b76a627363f1bfa",
"size": "5445",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "baidulbs/src/main/java/com/yumodev/baidulbs/BaiduLocHelper.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "1284385"
},
{
"name": "Kotlin",
"bytes": "46687"
}
],
"symlink_target": ""
} |
/*! http://mths.be/placeholder v2.0.7 by @mathias */
(function (root, factory) {
define(['jquery'], factory);
}(this, function($) {
var isInputSupported = 'placeholder' in document.createElement('input'),
isTextareaSupported = 'placeholder' in document.createElement('textarea'),
prototype = $.fn,
valHooks = $.valHooks,
hooks,
placeholder;
if (isInputSupported && isTextareaSupported) {
placeholder = prototype.placeholder = function() {
return this;
};
placeholder.input = placeholder.textarea = true;
} else {
placeholder = prototype.placeholder = function() {
var $this = this;
$this
.filter((isInputSupported ? 'textarea' : ':input') + '[placeholder]')
.not('.placeholder')
.bind({
'focus.placeholder': clearPlaceholder,
'blur.placeholder': setPlaceholder
})
.data('placeholder-enabled', true)
.trigger('blur.placeholder');
return $this;
};
placeholder.input = isInputSupported;
placeholder.textarea = isTextareaSupported;
hooks = {
'get': function(element) {
var $element = $(element);
return $element.data('placeholder-enabled') && $element.hasClass('placeholder') ? '' : element.value;
},
'set': function(element, value) {
var $element = $(element);
if (!$element.data('placeholder-enabled')) {
return element.value = value;
}
if (value == '') {
element.value = value;
// Issue #56: Setting the placeholder causes problems if the element continues to have focus.
if (element != document.activeElement) {
// We can't use `triggerHandler` here because of dummy text/password inputs :(
setPlaceholder.call(element);
}
} else if ($element.hasClass('placeholder')) {
clearPlaceholder.call(element, true, value) || (element.value = value);
} else {
element.value = value;
}
// `set` can not return `undefined`; see http://jsapi.info/jquery/1.7.1/val#L2363
return $element;
}
};
isInputSupported || (valHooks.input = hooks);
isTextareaSupported || (valHooks.textarea = hooks);
$(function() {
// Look for forms
$(document).delegate('form', 'submit.placeholder', function() {
// Clear the placeholder values so they don't get submitted
var $inputs = $('.placeholder', this).each(clearPlaceholder);
setTimeout(function() {
$inputs.each(setPlaceholder);
}, 10);
});
});
// Clear placeholder values upon page reload
$(window).bind('beforeunload.placeholder', function() {
$('.placeholder').each(function() {
this.value = '';
});
});
}
function args(elem) {
// Return an object of element attributes
var newAttrs = {},
rinlinejQuery = /^jQuery\d+$/;
$.each(elem.attributes, function(i, attr) {
if (attr.specified && !rinlinejQuery.test(attr.name)) {
newAttrs[attr.name] = attr.value;
}
});
return newAttrs;
}
function clearPlaceholder(event, value) {
var input = this,
$input = $(input);
if (input.value == $input.attr('placeholder') && $input.hasClass('placeholder')) {
if ($input.data('placeholder-password')) {
$input = $input.hide().next().show().attr('id', $input.removeAttr('id').data('placeholder-id'));
// If `clearPlaceholder` was called from `$.valHooks.input.set`
if (event === true) {
return $input[0].value = value;
}
$input.focus();
} else {
input.value = '';
$input.removeClass('placeholder');
input == document.activeElement && input.select();
}
}
}
function setPlaceholder() {
var $replacement,
input = this,
$input = $(input),
$origInput = $input,
id = this.id;
if (input.value == '') {
if (input.type == 'password') {
if (!$input.data('placeholder-textinput')) {
try {
$replacement = $input.clone().attr({ 'type': 'text' });
} catch(e) {
$replacement = $('<input>').attr($.extend(args(this), { 'type': 'text' }));
}
$replacement
.removeAttr('name')
.data({
'placeholder-password': true,
'placeholder-id': id
})
.bind('focus.placeholder', clearPlaceholder);
$input
.data({
'placeholder-textinput': $replacement,
'placeholder-id': id
})
.before($replacement);
}
$input = $input.removeAttr('id').hide().prev().attr('id', id).show();
// Note: `$input[0] != input` now!
}
$input.addClass('placeholder');
$input[0].value = $input.attr('placeholder');
} else {
$input.removeClass('placeholder');
}
}
})); | {
"content_hash": "91d2ae7eea27bed0905c03d8cc2fcea1",
"timestamp": "",
"source": "github",
"line_count": 159,
"max_line_length": 105,
"avg_line_length": 28.547169811320753,
"alnum_prop": 0.6093853271645737,
"repo_name": "alanzhou-okta/okta-signin-widget",
"id": "33a75dd5561b667669edeb9ea4ae037be6d34557",
"size": "4539",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "node_modules/@okta/courage/src/vendor/plugins/jquery.placeholder.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "173037"
},
{
"name": "JavaScript",
"bytes": "960169"
},
{
"name": "Ruby",
"bytes": "1057"
},
{
"name": "Shell",
"bytes": "2823"
},
{
"name": "Smarty",
"bytes": "5124"
}
],
"symlink_target": ""
} |
from shutil import rmtree
from tempfile import mkdtemp
from nipype.testing import (assert_equal, example_data)
def test_split_and_merge():
import numpy as np
import nibabel as nb
import os.path as op
import os
cwd = os.getcwd()
from nipype.algorithms.misc import split_rois, merge_rois
tmpdir = mkdtemp()
in_mask = example_data('tpms_msk.nii.gz')
dwfile = op.join(tmpdir, 'dwi.nii.gz')
mskdata = nb.load(in_mask).get_data()
aff = nb.load(in_mask).affine
dwshape = (mskdata.shape[0], mskdata.shape[1], mskdata.shape[2], 6)
dwdata = np.random.normal(size=dwshape)
os.chdir(tmpdir)
nb.Nifti1Image(dwdata.astype(np.float32),
aff, None).to_filename(dwfile)
resdw, resmsk, resid = split_rois(dwfile, in_mask, roishape=(20, 20, 2))
merged = merge_rois(resdw, resid, in_mask)
dwmerged = nb.load(merged).get_data()
dwmasked = dwdata * mskdata[:, :, :, np.newaxis]
os.chdir(cwd)
rmtree(tmpdir)
yield assert_equal, np.allclose(dwmasked, dwmerged), True
| {
"content_hash": "0079db9cee3b26715a2240048d8af6a4",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 76,
"avg_line_length": 30.2,
"alnum_prop": 0.6584673604541155,
"repo_name": "FCP-INDI/nipype",
"id": "89af22afe784659f29443956471350eacf65b827",
"size": "1104",
"binary": false,
"copies": "12",
"ref": "refs/heads/master",
"path": "nipype/algorithms/tests/test_splitmerge.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "HTML",
"bytes": "9823"
},
{
"name": "KiCad",
"bytes": "3797"
},
{
"name": "Makefile",
"bytes": "2063"
},
{
"name": "Matlab",
"bytes": "1717"
},
{
"name": "Python",
"bytes": "5280923"
},
{
"name": "Shell",
"bytes": "1958"
},
{
"name": "Tcl",
"bytes": "43408"
}
],
"symlink_target": ""
} |
<?php
/**
* Packages the zip and phar file using a staging directory.
*
* @license MIT, Michael Dowling https://github.com/mtdowling
* @license https://github.com/mtdowling/Burgomaster/LICENSE
*/
class Burgomaster
{
/** @var string Base staging directory of the project */
public $stageDir;
/** @var string Root directory of the project */
public $projectRoot;
/** @var array stack of sections */
private $sections = array();
/**
* @param string $stageDir Staging base directory where your packaging
* takes place. This folder will be created for
* you if it does not exist. If it exists, it
* will be deleted and recreated to start fresh.
* @param string $projectRoot Root directory of the project.
*
* @throws \InvalidArgumentException
* @throws \RuntimeException
*/
public function __construct($stageDir, $projectRoot = null)
{
$this->startSection('setting_up');
$this->stageDir = $stageDir;
$this->projectRoot = $projectRoot;
if (!$this->stageDir || $this->stageDir == '/') {
throw new \InvalidArgumentException('Invalid base directory');
}
if (is_dir($this->stageDir)) {
$this->debug("Removing existing directory: $this->stageDir");
echo $this->exec("rm -rf $this->stageDir");
}
$this->debug("Creating staging directory: $this->stageDir");
if (!mkdir($this->stageDir, 0777, true)) {
throw new \RuntimeException("Could not create {$this->stageDir}");
}
$this->stageDir = realpath($this->stageDir);
$this->debug("Creating staging directory at: {$this->stageDir}");
if (!is_dir($this->projectRoot)) {
throw new \InvalidArgumentException(
"Project root not found: $this->projectRoot"
);
}
$this->endSection();
$this->startSection('staging');
chdir($this->projectRoot);
}
/**
* Cleanup if the last section was not already closed.
*/
public function __destruct()
{
if ($this->sections) {
$this->endSection();
}
}
/**
* Call this method when starting a specific section of the packager.
*
* This makes the debug messages used in your script more meaningful and
* adds context when things go wrong. Be sure to call endSection() when
* you have finished a section of your packaging script.
*
* @param string $section Part of the packager that is running
*/
public function startSection($section)
{
$this->sections[] = $section;
$this->debug('Starting');
}
/**
* Call this method when leaving the last pushed section of the packager.
*/
public function endSection()
{
if ($this->sections) {
$this->debug('Completed');
array_pop($this->sections);
}
}
/**
* Prints a debug message to STDERR bound to the current section.
*
* @param string $message Message to echo to STDERR
*/
public function debug($message)
{
$prefix = date('c') . ': ';
if ($this->sections) {
$prefix .= '[' . end($this->sections) . '] ';
}
fwrite(STDERR, $prefix . $message . "\n");
}
/**
* Copies a file and creates the destination directory if needed.
*
* @param string $from File to copy
* @param string $to Destination to copy the file to, relative to the
* base staging directory.
* @throws \InvalidArgumentException if the file cannot be found
* @throws \RuntimeException if the directory cannot be created.
* @throws \RuntimeException if the file cannot be copied.
*/
public function deepCopy($from, $to)
{
if (!is_file($from)) {
throw new \InvalidArgumentException("File not found: {$from}");
}
$to = str_replace('//', '/', $this->stageDir . '/' . $to);
$dir = dirname($to);
if (!is_dir($dir)) {
if (!mkdir($dir, 0777, true)) {
throw new \RuntimeException("Unable to create directory: $dir");
}
}
if (!copy($from, $to)) {
throw new \RuntimeException("Unable to copy $from to $to");
}
}
/**
* Recursively copy one folder to another.
*
* Any LICENSE file is automatically copied.
*
* @param string $sourceDir Source directory to copy from
* @param string $destDir Directory to copy the files to that is relative
* to the the stage base directory.
* @param array $extensions File extensions to copy from the $sourceDir.
* Defaults to "php" files only (e.g., ['php']).
* @param Iterator|null $files Files to copy from the source directory, each
* yielded out as an SplFileInfo object.
* Defaults to a recursive iterator of $sourceDir
* @throws \InvalidArgumentException if the source directory is invalid.
*/
function recursiveCopy(
$sourceDir,
$destDir,
$extensions = array('php'),
Iterator $files = null
) {
if (!realpath($sourceDir)) {
throw new \InvalidArgumentException("$sourceDir not found");
}
if (!$extensions) {
throw new \InvalidArgumentException('$extensions is empty!');
}
$sourceDir = realpath($sourceDir);
$exts = array_fill_keys($extensions, true);
if (empty($files)) {
$files = new \RecursiveIteratorIterator(
new \RecursiveDirectoryIterator($sourceDir)
);
}
$total = 0;
$this->startSection('copy');
$this->debug("Starting to copy files from $sourceDir");
foreach ($files as $file) {
if (isset($exts[$file->getExtension()])
|| $file->getBaseName() == 'LICENSE'
) {
// Remove the source directory from the destination path
$toPath = str_replace($sourceDir, '', (string) $file);
$toPath = $destDir . '/' . $toPath;
$toPath = str_replace('//', '/', $toPath);
$this->deepCopy((string) $file, $toPath);
$total++;
}
}
$this->debug("Copied $total files from $sourceDir");
$this->endSection();
}
/**
* Execute a command and throw an exception if the return code is not 0.
*
* @param string $command Command to execute
*
* @return string Returns the output of the command as a string
* @throws \RuntimeException on error.
*/
public function exec($command)
{
$this->debug("Executing: $command");
$output = $returnValue = null;
exec($command, $output, $returnValue);
if ($returnValue != 0) {
throw new \RuntimeException('Error executing command: '
. $command . ' : ' . implode("\n", $output));
}
return implode("\n", $output);
}
/**
* Creates a class-map autoloader to the staging directory in a file
* named autoloader.php
*
* @param array $files Files to explicitly require in the autoloader. This
* is similar to Composer's "files" "autoload" section.
* @param string $filename Name of the autoloader file.
* @throws \RuntimeException if the file cannot be written
*/
function createAutoloader($files = array(), $filename = 'autoloader.php') {
$sourceDir = realpath($this->stageDir);
$iter = new \RecursiveDirectoryIterator($sourceDir);
$iter = new \RecursiveIteratorIterator($iter);
$this->startSection('autoloader');
$this->debug('Creating classmap autoloader');
$this->debug("Collecting valid PHP files from {$this->stageDir}");
$classMap = array();
foreach ($iter as $file) {
if ($file->getExtension() == 'php') {
$location = str_replace($this->stageDir . '/', '', (string) $file);
$className = str_replace('/', '\\', $location);
$className = substr($className, 0, -4);
// Remove "src\" or "lib\"
if (strpos($className, 'src\\') === 0
|| strpos($className, 'lib\\') === 0
) {
$className = substr($className, 4);
}
$classMap[$className] = "__DIR__ . '/$location'";
$this->debug("Found $className");
}
}
$destFile = $this->stageDir . '/' . $filename;
$this->debug("Writing autoloader to {$destFile}");
if (!($h = fopen($destFile, 'w'))) {
throw new \RuntimeException('Unable to open file for writing');
}
$this->debug('Writing classmap files');
fwrite($h, "<?php\n\n");
fwrite($h, "\$mapping = array(\n");
foreach ($classMap as $c => $f) {
fwrite($h, " '$c' => $f,\n");
}
fwrite($h, ");\n\n");
fwrite($h, <<<EOT
spl_autoload_register(function (\$class) use (\$mapping) {
if (isset(\$mapping[\$class])) {
require \$mapping[\$class];
}
}, true);
EOT
);
fwrite($h, "\n");
$this->debug('Writing automatically included files');
foreach ($files as $file) {
fwrite($h, "require __DIR__ . '/$file';\n");
}
fclose($h);
$this->endSection();
}
/**
* Creates a default stub for the phar that includeds the generated
* autoloader.
*
* This phar also registers a constant that can be used to check if you
* are running the phar. The constant is the basename of the $dest variable
* without the extension, with "_PHAR" appended, then converted to all
* caps (e.g., "/foo/guzzle.phar" gets a contant defined as GUZZLE_PHAR.
*
* @param $dest
* @param string $autoloaderFilename Name of the autoloader file.
* @param string $alias The phar alias to use
*
* @return string
*/
private function createStub($dest, $autoloaderFilename = 'autoloader.php', $alias = null)
{
$this->startSection('stub');
$this->debug("Creating phar stub at $dest");
$alias = $alias ?: basename($dest);
$constName = str_replace('.phar', '', strtoupper($alias)) . '_PHAR';
$stub = "<?php\n";
$stub .= "define('$constName', true);\n";
$stub .= "Phar::mapPhar('$alias');\n";
$stub .= "require 'phar://$alias/{$autoloaderFilename}';\n";
$stub .= "__HALT_COMPILER();\n";
$this->endSection();
return $stub;
}
/**
* Creates a phar that automatically registers an autoloader.
*
* Call this only after your staging directory is built.
*
* @param string $dest Where to save the file. The basename of the file
* is also used as the alias name in the phar
* (e.g., /path/to/guzzle.phar => guzzle.phar).
* @param string|bool|null $stub The path to the phar stub file. Pass or
* leave null to automatically have one created for you. Pass false
* to no use a stub in the generated phar.
* @param string $autoloaderFilename Name of the autolaoder filename.
*/
public function createPhar(
$dest,
$stub = null,
$autoloaderFilename = 'autoloader.php',
$alias = null
) {
$this->startSection('phar');
$this->debug("Creating phar file at $dest");
$this->createDirIfNeeded(dirname($dest));
$phar = new \Phar($dest, 0, $alias ?: basename($dest));
$phar->buildFromDirectory($this->stageDir);
if ($stub !== false) {
if (!$stub) {
$stub = $this->createStub($dest, $autoloaderFilename, $alias);
}
$phar->setStub($stub);
}
$this->debug("Created phar at $dest");
$this->endSection();
}
/**
* Creates a zip file containing the staged files of your project.
*
* Call this only after your staging directory is built.
*
* @param string $dest Where to save the zip file
*/
public function createZip($dest)
{
$this->startSection('zip');
$this->debug("Creating a zip file at $dest");
$this->createDirIfNeeded(dirname($dest));
chdir($this->stageDir);
$this->exec("zip -r $dest ./");
$this->debug(" > Created at $dest");
chdir(__DIR__);
$this->endSection();
}
private function createDirIfNeeded($dir)
{
if (!is_dir($dir) && !mkdir($dir, 0755, true)) {
throw new \RuntimeException("Could not create dir: $dir");
}
}
}
| {
"content_hash": "de367b5d1bde7c48bab97ec343191a89",
"timestamp": "",
"source": "github",
"line_count": 394,
"max_line_length": 93,
"avg_line_length": 33.19796954314721,
"alnum_prop": 0.544954128440367,
"repo_name": "andythorne/aws-sdk-php",
"id": "0d64c49422a968a6a438198094aa7200e2e2fd77",
"size": "13080",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "build/Burgomaster.php",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Cucumber",
"bytes": "37218"
},
{
"name": "Makefile",
"bytes": "5217"
},
{
"name": "PHP",
"bytes": "9099564"
}
],
"symlink_target": ""
} |
package org.wso2.carbon.identity.application.authentication.framework.exception;
import static org.wso2.carbon.identity.application.authentication.framework.exception.ErrorToI18nCodeTranslator.I18NErrorMessages.ERROR_CODE_DEFAULT;
import static org.wso2.carbon.identity.application.authentication.framework.exception.ErrorToI18nCodeTranslator.I18NErrorMessages.ERROR_CODE_JIT_PROVISIONING_USERNAME_EXISTENCE;
import static org.wso2.carbon.identity.application.authentication.framework.exception.ErrorToI18nCodeTranslator.I18NErrorMessages.ERROR_CODE_MISSING_CLAIM_REQUEST;
import static org.wso2.carbon.identity.application.authentication.framework.exception.ErrorToI18nCodeTranslator.I18NErrorMessages.ERROR_CONSENT_DISABLED_FOR_SSO;
import static org.wso2.carbon.identity.application.authentication.framework.exception.ErrorToI18nCodeTranslator.I18NErrorMessages.ERROR_GETTING_ASSOCIATION_FOR_USER;
import static org.wso2.carbon.identity.application.authentication.framework.exception.ErrorToI18nCodeTranslator.I18NErrorMessages.ERROR_INVALID_USER_STORE;
import static org.wso2.carbon.identity.application.authentication.framework.exception.ErrorToI18nCodeTranslator.I18NErrorMessages.ERROR_INVALID_USER_STORE_DOMAIN;
import static org.wso2.carbon.identity.application.authentication.framework.exception.ErrorToI18nCodeTranslator.I18NErrorMessages.ERROR_POST_AUTH_COOKIE_NOT_FOUND;
import static org.wso2.carbon.identity.application.authentication.framework.exception.ErrorToI18nCodeTranslator.I18NErrorMessages.ERROR_PROCESSING_APPLICATION_CLAIM_CONFIGS;
import static org.wso2.carbon.identity.application.authentication.framework.exception.ErrorToI18nCodeTranslator.I18NErrorMessages.ERROR_RETRIEVING_CLAIM;
import static org.wso2.carbon.identity.application.authentication.framework.exception.ErrorToI18nCodeTranslator.I18NErrorMessages.ERROR_UPDATING_CLAIMS_FOR_LOCAL_USER;
import static org.wso2.carbon.identity.application.authentication.framework.exception.ErrorToI18nCodeTranslator.I18NErrorMessages.ERROR_USER_DENIED_CONSENT;
import static org.wso2.carbon.identity.application.authentication.framework.exception.ErrorToI18nCodeTranslator.I18NErrorMessages.ERROR_USER_DENIED_CONSENT_FOR_MANDATORY;
import static org.wso2.carbon.identity.application.authentication.framework.exception.ErrorToI18nCodeTranslator.I18NErrorMessages.ERROR_WHILE_ADDING_CONSENT;
import static org.wso2.carbon.identity.application.authentication.framework.exception.ErrorToI18nCodeTranslator.I18NErrorMessages.ERROR_WHILE_BUILDING_REDIRECT_URI;
import static org.wso2.carbon.identity.application.authentication.framework.exception.ErrorToI18nCodeTranslator.I18NErrorMessages.ERROR_WHILE_CONSENT_INPUT_FOR_USER;
import static org.wso2.carbon.identity.application.authentication.framework.exception.ErrorToI18nCodeTranslator.I18NErrorMessages.ERROR_WHILE_GETTING_CLAIM_MAPPINGS;
import static org.wso2.carbon.identity.application.authentication.framework.exception.ErrorToI18nCodeTranslator.I18NErrorMessages.ERROR_WHILE_GETTING_IDP_BY_NAME;
import static org.wso2.carbon.identity.application.authentication.framework.exception.ErrorToI18nCodeTranslator.I18NErrorMessages.ERROR_WHILE_GETTING_LOCAL_USER_ID;
import static org.wso2.carbon.identity.application.authentication.framework.exception.ErrorToI18nCodeTranslator.I18NErrorMessages.ERROR_WHILE_GETTING_REALM_IN_POST_AUTHENTICATION;
import static org.wso2.carbon.identity.application.authentication.framework.exception.ErrorToI18nCodeTranslator.I18NErrorMessages.ERROR_WHILE_GETTING_REALM_TO_HANDLE_CLAIMS;
import static org.wso2.carbon.identity.application.authentication.framework.exception.ErrorToI18nCodeTranslator.I18NErrorMessages.ERROR_WHILE_GETTING_USERNAME_ASSOCIATED_WITH_IDP;
import static org.wso2.carbon.identity.application.authentication.framework.exception.ErrorToI18nCodeTranslator.I18NErrorMessages.ERROR_WHILE_GETTING_USER_STORE_DOMAIN;
import static org.wso2.carbon.identity.application.authentication.framework.exception.ErrorToI18nCodeTranslator.I18NErrorMessages.ERROR_WHILE_GETTING_USER_STORE_MANAGER;
import static org.wso2.carbon.identity.application.authentication.framework.exception.ErrorToI18nCodeTranslator.I18NErrorMessages.ERROR_WHILE_HANDLING_CLAIM_MAPPINGS;
import static org.wso2.carbon.identity.application.authentication.framework.exception.ErrorToI18nCodeTranslator.I18NErrorMessages.ERROR_WHILE_REDIRECTING_TO_CONSENT_PAGE;
import static org.wso2.carbon.identity.application.authentication.framework.exception.ErrorToI18nCodeTranslator.I18NErrorMessages.ERROR_WHILE_REDIRECTING_TO_REQUEST_CLAIMS_PAGE;
import static org.wso2.carbon.identity.application.authentication.framework.exception.ErrorToI18nCodeTranslator.I18NErrorMessages.ERROR_WHILE_RETRIEVING_CONSENT_DATA;
import static org.wso2.carbon.identity.application.authentication.framework.exception.ErrorToI18nCodeTranslator.I18NErrorMessages.ERROR_WHILE_SETTING_IDP_DATA;
import static org.wso2.carbon.identity.application.authentication.framework.exception.ErrorToI18nCodeTranslator.I18NErrorMessages.ERROR_WHILE_SETTING_IDP_DATA_IDP_IS_NULL;
import static org.wso2.carbon.identity.application.authentication.framework.exception.ErrorToI18nCodeTranslator.I18NErrorMessages.ERROR_WHILE_TRYING_CALL_SIGN_UP_ENDPOINT_FOR_PASSWORD_PROVISIONING;
import static org.wso2.carbon.identity.application.authentication.framework.exception.ErrorToI18nCodeTranslator.I18NErrorMessages.ERROR_WHILE_TRYING_TO_GET_CLAIMS_WHILE_TRYING_TO_PASSWORD_PROVISION;
import static org.wso2.carbon.identity.application.authentication.framework.exception.ErrorToI18nCodeTranslator.I18NErrorMessages.USER_ALREADY_EXISTS_ERROR;
/**
* Responsible for translating the error codes into respective status and the status message and keeping the mapping
* details of the status and status messages against the error codes.
*/
public class ErrorToI18nCodeTranslator {
/**
* Enum for I18N Messages.
*/
public enum I18NErrorMessages {
// Generic error messages.
ERROR_CODE_MISSING_CLAIM_REQUEST("One or more read-only claim is missing in the requested claim set. " +
"Please contact your administrator for more information about this issue.",
"authentication.attempt.failed", "claim.request.missing"),
ERROR_CODE_JIT_PROVISIONING_USERNAME_EXISTENCE("80019", "authentication.attempt.failed",
"username.existence.error"),
USER_ALREADY_EXISTS_ERROR("80018", "authentication.attempt.failed",
"username.already.exists.error"),
ERROR_WHILE_GETTING_USER_STORE_DOMAIN("80020", "authentication.attempt.failed",
"user.store.domain.error"),
ERROR_INVALID_USER_STORE_DOMAIN("80021", "authentication.attempt.failed",
"invalid.user.store.domain"),
ERROR_WHILE_GETTING_USER_STORE_MANAGER("80022", "authentication.attempt.failed",
"user.store.manager.error"),
ERROR_INVALID_USER_STORE("80023", "authentication.attempt.failed",
"invalid.user.store"),
ERROR_WHILE_GETTING_IDP_BY_NAME("80001", "authentication.attempt.failed",
"idp.for.tenant.in.post.auth.error"),
ERROR_WHILE_GETTING_REALM_IN_POST_AUTHENTICATION("80002", "authentication.attempt.failed",
"realm.for.tenant.in.post.auth.error"),
ERROR_WHILE_TRYING_TO_GET_CLAIMS_WHILE_TRYING_TO_PASSWORD_PROVISION("8008",
"authentication.attempt.failed", "claim.error.while.password.provision"),
ERROR_WHILE_GETTING_USERNAME_ASSOCIATED_WITH_IDP("80010", "authentication.attempt.failed",
"username.associated.with.idp.error"),
ERROR_WHILE_TRYING_CALL_SIGN_UP_ENDPOINT_FOR_PASSWORD_PROVISIONING("80006",
"authentication.attempt.failed", "sign.up.end.point.for.provision.error"),
ERROR_WHILE_ADDING_CONSENT("80014", "authentication.attempt.failed",
"add.consent.for.tenant.error"),
ERROR_WHILE_SETTING_IDP_DATA("80015", "authentication.attempt.failed",
"set.idp.data.for.tenant.error"),
ERROR_WHILE_HANDLING_CLAIM_MAPPINGS("80017", "authentication.attempt.failed",
"claim.mapping.handling.error"),
ERROR_WHILE_SETTING_IDP_DATA_IDP_IS_NULL("80016", "authentication.attempt.failed",
"resident.idp.null.for.tenant.error"),
ERROR_WHILE_GETTING_CLAIM_MAPPINGS("80013", "authentication.attempt.failed",
"claim.mapping.getting.error"),
ERROR_WHILE_GETTING_LOCAL_USER_ID("80012", "authentication.attempt.failed",
"associated.local.user.id.error"),
ERROR_WHILE_RETRIEVING_CONSENT_DATA("Authentication failed. Error occurred while processing user consent.",
"authentication.attempt.failed", "consent.retrieve.for.user.error"),
ERROR_CONSENT_DISABLED_FOR_SSO("Authentication Failure: Consent management is disabled for SSO.",
"authentication.attempt.failed", "consent.disabled.for.sso.error"),
ERROR_WHILE_CONSENT_INPUT_FOR_USER("Authentication failed. Error while processing user consent input.",
"authentication.attempt.failed", "consent.input.for.user.error"),
ERROR_USER_DENIED_CONSENT("Authentication failed. User denied consent to share information with",
"authentication.attempt.failed", "user.denied.consent.error"),
ERROR_USER_DENIED_CONSENT_FOR_MANDATORY("Authentication failed. Consent denied for mandatory attributes.",
"authentication.attempt.failed", "user.denied.mandatory.consent.error"),
ERROR_WHILE_REDIRECTING_TO_CONSENT_PAGE("Authentication failed. Error while processing consent requirements.",
"authentication.attempt.failed", "consent.page.error"),
ERROR_PROCESSING_APPLICATION_CLAIM_CONFIGS("Authentication failed. Error while processing application " +
"claim configurations.", "authentication.attempt.failed", "application.configs.null.error"),
ERROR_XACML_EVAL_FAILED("Authorization Failed.XACML policy evaluation failed for user.",
"authentication.attempt.failed", "xacml.policy.evaluation.failed"),
ERROR_WHILE_EVAL_AUTHZ("Authorization Failed.Error while trying to evaluate authorization",
"authentication.attempt.failed", "xacml.authz.eval.failed"),
ERROR_WHILE_REDIRECTING_TO_REQUEST_CLAIMS_PAGE("Error while handling missing mandatory claims. Error in " +
"request claims page.", "authentication.attempt.failed", "request.claims.page.error"),
ERROR_WHILE_BUILDING_REDIRECT_URI("Error while handling missing mandatory claims. Error in redirect URI.",
"authentication.attempt.failed", "request.claims.page.uri.build.error"),
ERROR_RETRIEVING_CLAIM("Error while handling missing mandatory claims. Error in retrieving claim.",
"authentication.attempt.failed", "retrieve.claim.error"),
ERROR_GETTING_ASSOCIATION_FOR_USER("Error while handling missing mandatory claims. Error in association.",
"authentication.attempt.failed", "get.association.for.user.error"),
ERROR_UPDATING_CLAIMS_FOR_LOCAL_USER("Error while handling missing mandatory claims. Error in updating claims.",
"authentication.attempt.failed", "update.local.user.claims.error"),
ERROR_WHILE_GETTING_REALM_TO_HANDLE_CLAIMS("Error while handling missing mandatory claims. Error in realm.",
"authentication.attempt.failed", "retrieving.realm.to.handle.claims.error"),
ERROR_POST_AUTH_COOKIE_NOT_FOUND("Invalid Request: Your authentication flow is ended or invalid. " +
"Please initiate again.", "authentication.attempt.failed", "post.auth.cookie.not.found"),
ERROR_CODE_DEFAULT("Default", "authentication.attempt.failed", "authorization.failed");
private final String errorCode;
private final String status;
private final String statusMsg;
I18NErrorMessages(String errorCode, String status, String statusMsg) {
this.errorCode = errorCode;
this.status = status;
this.statusMsg = statusMsg;
}
public String getErrorCode() {
return errorCode;
}
public String getStatus() {
return status;
}
public String getStatusMsg() {
return statusMsg;
}
@Override
public String toString() {
return status + "_" + statusMsg;
}
}
public static I18nErrorCodeWrapper translate(String errorCode) {
if (ERROR_CODE_MISSING_CLAIM_REQUEST.getErrorCode().equals(errorCode)) {
return new I18nErrorCodeWrapper(ERROR_CODE_MISSING_CLAIM_REQUEST.getStatus(),
ERROR_CODE_MISSING_CLAIM_REQUEST.getStatusMsg());
} else if (USER_ALREADY_EXISTS_ERROR.getErrorCode().equals(errorCode)) {
return new I18nErrorCodeWrapper(USER_ALREADY_EXISTS_ERROR.getStatus(),
USER_ALREADY_EXISTS_ERROR.getStatusMsg());
} else if (ERROR_CODE_JIT_PROVISIONING_USERNAME_EXISTENCE.getErrorCode().equals(errorCode)) {
return new I18nErrorCodeWrapper(ERROR_CODE_JIT_PROVISIONING_USERNAME_EXISTENCE.getStatus(),
ERROR_CODE_JIT_PROVISIONING_USERNAME_EXISTENCE.getStatusMsg());
} else if (ERROR_WHILE_GETTING_USER_STORE_DOMAIN.getErrorCode().equals(errorCode)) {
return new I18nErrorCodeWrapper(ERROR_WHILE_GETTING_USER_STORE_DOMAIN.getStatus(),
ERROR_WHILE_GETTING_USER_STORE_DOMAIN.getStatusMsg());
} else if (ERROR_INVALID_USER_STORE_DOMAIN.getErrorCode().equals(errorCode)) {
return new I18nErrorCodeWrapper(ERROR_INVALID_USER_STORE_DOMAIN.getStatus(),
ERROR_INVALID_USER_STORE_DOMAIN.getStatusMsg());
} else if (ERROR_WHILE_GETTING_USER_STORE_MANAGER.getErrorCode().equals(errorCode)) {
return new I18nErrorCodeWrapper(ERROR_WHILE_GETTING_USER_STORE_MANAGER.getStatus(),
ERROR_WHILE_GETTING_USER_STORE_MANAGER.getStatusMsg());
} else if (ERROR_INVALID_USER_STORE.getErrorCode().equals(errorCode)) {
return new I18nErrorCodeWrapper(ERROR_INVALID_USER_STORE.getStatus(),
ERROR_INVALID_USER_STORE.getStatusMsg());
} else if (ERROR_WHILE_GETTING_IDP_BY_NAME.getErrorCode().equals(errorCode)) {
return new I18nErrorCodeWrapper(ERROR_WHILE_GETTING_IDP_BY_NAME.getStatus(),
ERROR_WHILE_GETTING_IDP_BY_NAME.getStatusMsg());
} else if (ERROR_WHILE_GETTING_REALM_IN_POST_AUTHENTICATION.getErrorCode().equals(errorCode)) {
return new I18nErrorCodeWrapper(ERROR_WHILE_GETTING_REALM_IN_POST_AUTHENTICATION.getStatus(),
ERROR_WHILE_GETTING_REALM_IN_POST_AUTHENTICATION.getStatusMsg());
} else if (ERROR_WHILE_TRYING_TO_GET_CLAIMS_WHILE_TRYING_TO_PASSWORD_PROVISION
.getErrorCode().equals(errorCode)) {
return new I18nErrorCodeWrapper(ERROR_WHILE_TRYING_TO_GET_CLAIMS_WHILE_TRYING_TO_PASSWORD_PROVISION
.getStatus(),
ERROR_WHILE_TRYING_TO_GET_CLAIMS_WHILE_TRYING_TO_PASSWORD_PROVISION.getStatusMsg());
} else if (ERROR_WHILE_GETTING_USERNAME_ASSOCIATED_WITH_IDP.getErrorCode().equals(errorCode)) {
return new I18nErrorCodeWrapper(ERROR_WHILE_GETTING_USERNAME_ASSOCIATED_WITH_IDP.getStatus(),
ERROR_WHILE_GETTING_USERNAME_ASSOCIATED_WITH_IDP.getStatusMsg());
} else if (ERROR_WHILE_TRYING_CALL_SIGN_UP_ENDPOINT_FOR_PASSWORD_PROVISIONING.getErrorCode()
.equals(errorCode)) {
return new I18nErrorCodeWrapper(ERROR_WHILE_TRYING_CALL_SIGN_UP_ENDPOINT_FOR_PASSWORD_PROVISIONING
.getStatus(),
ERROR_WHILE_TRYING_CALL_SIGN_UP_ENDPOINT_FOR_PASSWORD_PROVISIONING.getStatusMsg());
} else if (ERROR_WHILE_ADDING_CONSENT.getErrorCode().equals(errorCode)) {
return new I18nErrorCodeWrapper(ERROR_WHILE_ADDING_CONSENT.getStatus(),
ERROR_WHILE_ADDING_CONSENT.getStatusMsg());
} else if (ERROR_WHILE_SETTING_IDP_DATA.getErrorCode().equals(errorCode)) {
return new I18nErrorCodeWrapper(ERROR_WHILE_SETTING_IDP_DATA.getStatus(),
ERROR_WHILE_SETTING_IDP_DATA.getStatusMsg());
} else if (ERROR_WHILE_HANDLING_CLAIM_MAPPINGS.getErrorCode().equals(errorCode)) {
return new I18nErrorCodeWrapper(ERROR_WHILE_HANDLING_CLAIM_MAPPINGS.getStatus(),
ERROR_WHILE_HANDLING_CLAIM_MAPPINGS.getStatusMsg());
} else if (ERROR_WHILE_SETTING_IDP_DATA_IDP_IS_NULL.getErrorCode().equals(errorCode)) {
return new I18nErrorCodeWrapper(ERROR_WHILE_SETTING_IDP_DATA_IDP_IS_NULL.getStatus(),
ERROR_WHILE_SETTING_IDP_DATA_IDP_IS_NULL.getStatusMsg());
} else if (ERROR_WHILE_GETTING_CLAIM_MAPPINGS.getErrorCode().equals(errorCode)) {
return new I18nErrorCodeWrapper(ERROR_WHILE_GETTING_CLAIM_MAPPINGS.getStatus(),
ERROR_WHILE_GETTING_CLAIM_MAPPINGS.getStatusMsg());
} else if (ERROR_WHILE_GETTING_LOCAL_USER_ID.getErrorCode().equals(errorCode)) {
return new I18nErrorCodeWrapper(ERROR_WHILE_GETTING_LOCAL_USER_ID.getStatus(),
ERROR_WHILE_GETTING_LOCAL_USER_ID.getStatusMsg());
} else if (ERROR_WHILE_RETRIEVING_CONSENT_DATA.getErrorCode().equals(errorCode)) {
return new I18nErrorCodeWrapper(ERROR_WHILE_RETRIEVING_CONSENT_DATA.getStatus(),
ERROR_WHILE_RETRIEVING_CONSENT_DATA.getStatusMsg());
} else if (ERROR_CONSENT_DISABLED_FOR_SSO.getErrorCode().equals(errorCode)) {
return new I18nErrorCodeWrapper(ERROR_CONSENT_DISABLED_FOR_SSO.getStatus(),
ERROR_CONSENT_DISABLED_FOR_SSO.getStatusMsg());
} else if (ERROR_WHILE_CONSENT_INPUT_FOR_USER.getErrorCode().equals(errorCode)) {
return new I18nErrorCodeWrapper(ERROR_WHILE_CONSENT_INPUT_FOR_USER.getStatus(),
ERROR_WHILE_CONSENT_INPUT_FOR_USER.getStatusMsg());
} else if (ERROR_USER_DENIED_CONSENT.getErrorCode().contains(errorCode)) {
return new I18nErrorCodeWrapper(ERROR_USER_DENIED_CONSENT.getStatus(),
ERROR_USER_DENIED_CONSENT.getStatusMsg());
} else if (ERROR_USER_DENIED_CONSENT_FOR_MANDATORY.getErrorCode().equals(errorCode)) {
return new I18nErrorCodeWrapper(ERROR_USER_DENIED_CONSENT_FOR_MANDATORY.getStatus(),
ERROR_USER_DENIED_CONSENT_FOR_MANDATORY.getStatusMsg());
} else if (ERROR_WHILE_REDIRECTING_TO_CONSENT_PAGE.getErrorCode().equals(errorCode)) {
return new I18nErrorCodeWrapper(ERROR_WHILE_REDIRECTING_TO_CONSENT_PAGE.getStatus(),
ERROR_WHILE_REDIRECTING_TO_CONSENT_PAGE.getStatusMsg());
} else if (ERROR_PROCESSING_APPLICATION_CLAIM_CONFIGS.getErrorCode().equals(errorCode)) {
return new I18nErrorCodeWrapper(ERROR_PROCESSING_APPLICATION_CLAIM_CONFIGS.getStatus(),
ERROR_PROCESSING_APPLICATION_CLAIM_CONFIGS.getStatusMsg());
} else if (ERROR_WHILE_REDIRECTING_TO_REQUEST_CLAIMS_PAGE.getErrorCode().equals(errorCode)) {
return new I18nErrorCodeWrapper(ERROR_WHILE_REDIRECTING_TO_REQUEST_CLAIMS_PAGE.getStatus(),
ERROR_WHILE_REDIRECTING_TO_REQUEST_CLAIMS_PAGE.getStatusMsg());
} else if (ERROR_WHILE_BUILDING_REDIRECT_URI.getErrorCode().equals(errorCode)) {
return new I18nErrorCodeWrapper(ERROR_WHILE_BUILDING_REDIRECT_URI.getStatus(),
ERROR_WHILE_BUILDING_REDIRECT_URI.getStatusMsg());
} else if (ERROR_RETRIEVING_CLAIM.getErrorCode().equals(errorCode)) {
return new I18nErrorCodeWrapper(ERROR_RETRIEVING_CLAIM.getStatus(),
ERROR_RETRIEVING_CLAIM.getStatusMsg());
} else if (ERROR_GETTING_ASSOCIATION_FOR_USER.getErrorCode().equals(errorCode)) {
return new I18nErrorCodeWrapper(ERROR_GETTING_ASSOCIATION_FOR_USER.getStatus(),
ERROR_GETTING_ASSOCIATION_FOR_USER.getStatusMsg());
} else if (ERROR_UPDATING_CLAIMS_FOR_LOCAL_USER.getErrorCode().equals(errorCode)) {
return new I18nErrorCodeWrapper(ERROR_UPDATING_CLAIMS_FOR_LOCAL_USER.getStatus(),
ERROR_UPDATING_CLAIMS_FOR_LOCAL_USER.getStatusMsg());
} else if (ERROR_WHILE_GETTING_REALM_TO_HANDLE_CLAIMS.getErrorCode().equals(errorCode)) {
return new I18nErrorCodeWrapper(ERROR_WHILE_GETTING_REALM_TO_HANDLE_CLAIMS.getStatus(),
ERROR_WHILE_GETTING_REALM_TO_HANDLE_CLAIMS.getStatusMsg());
} else if (ERROR_POST_AUTH_COOKIE_NOT_FOUND.getErrorCode().equals(errorCode)) {
return new I18nErrorCodeWrapper(ERROR_POST_AUTH_COOKIE_NOT_FOUND.getStatus(),
ERROR_POST_AUTH_COOKIE_NOT_FOUND.getStatusMsg());
} else {
return new I18nErrorCodeWrapper(ERROR_CODE_DEFAULT.getStatus(), ERROR_CODE_DEFAULT.getStatusMsg());
}
}
}
| {
"content_hash": "1c5b7521404c612a027cb04866438805",
"timestamp": "",
"source": "github",
"line_count": 261,
"max_line_length": 198,
"avg_line_length": 81.55555555555556,
"alnum_prop": 0.7294465846096025,
"repo_name": "wso2/carbon-identity-framework",
"id": "faba22db16a5b05d4971871bce396abb71067d52",
"size": "21956",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/main/java/org/wso2/carbon/identity/application/authentication/framework/exception/ErrorToI18nCodeTranslator.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "132102"
},
{
"name": "HTML",
"bytes": "10775"
},
{
"name": "Java",
"bytes": "16415770"
},
{
"name": "JavaScript",
"bytes": "547683"
},
{
"name": "Jinja",
"bytes": "225118"
},
{
"name": "PLSQL",
"bytes": "210726"
},
{
"name": "PLpgSQL",
"bytes": "126494"
},
{
"name": "SQLPL",
"bytes": "65672"
},
{
"name": "Shell",
"bytes": "11996"
},
{
"name": "TSQL",
"bytes": "115317"
},
{
"name": "Thrift",
"bytes": "1513"
},
{
"name": "XSLT",
"bytes": "1030"
}
],
"symlink_target": ""
} |
NPM = npm
GRUNT = ./node_modules/grunt-cli/bin/grunt
all: build
bootstrap:
@if [ ! -x $(GRUNT) ]; then $(NPM) install; fi
build: bootstrap
@$(GRUNT)
clean: bootstrap
@$(GRUNT) clean:clean
distclean: bootstrap
@$(GRUNT) clean:clean clean:distclean
| {
"content_hash": "a59eab2b37388bb24bd116f8fec13651",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 47,
"avg_line_length": 15.294117647058824,
"alnum_prop": 0.6692307692307692,
"repo_name": "rse/grunt-extend-config",
"id": "2c10f3ed5c9e69ab72f961e70835bb57bd7c2765",
"size": "1505",
"binary": false,
"copies": "6",
"ref": "refs/heads/master",
"path": "Makefile",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "4364"
},
{
"name": "Makefile",
"bytes": "1505"
}
],
"symlink_target": ""
} |
module Rapns
module Daemon
module Reflectable
def reflect(name, *args)
begin
Rapns.reflections.__dispatch(name, *args)
rescue StandardError => e
Rapns.logger.error(e)
end
end
end
end
end
| {
"content_hash": "f0ed3ff9c1997db7a263aaf89c93de12",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 51,
"avg_line_length": 19.615384615384617,
"alnum_prop": 0.5764705882352941,
"repo_name": "eleostech/rapns",
"id": "6466b47a0dec1343f76ac26938ace1936c60a333",
"size": "255",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "lib/rapns/daemon/reflectable.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "232742"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<StructureDefinition xmlns="http://hl7.org/fhir">
<id value="Duration"/>
<text>
<status value="generated"/>
<div xmlns="http://www.w3.org/1999/xhtml">
<h2>Data type Duration</h2>
<p>A length of time</p>
<h3>Rule</h3>
<p>There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM.</p>
<p>XPath:</p>
<blockquote>
<pre>(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')</pre>
</blockquote>
</div>
</text>
<url value="http://hl7.org/fhir/StructureDefinition/Duration"/>
<name value="Duration"/>
<publisher value="HL7 FHIR Standard"/>
<contact>
<telecom>
<system value="other"/>
<value value="http://hl7.org/fhir"/>
</telecom>
</contact>
<description value="A length of time"/>
<status value="draft"/>
<date value="2015-07-23T16:50:38-04:00"/>
<kind value="datatype"/>
<constrainedType value="Quantity"/>
<abstract value="false"/>
<base value="http://hl7.org/fhir/StructureDefinition/Quantity"/>
<snapshot>
<element>
<path value="Quantity"/>
<name value="Duration"/>
<short value="A length of time"/>
<definition value="There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM."/>
<requirements value="Need to able to capture all sorts of measured values, even if the measured value are not precisely quantified. Values include exact measures such as 3.51g, customary units such as 3 tablets, and currencies such as $100.32USD."/>
<min value="1"/>
<max value="1"/>
<base>
<path value="Quantity"/>
<min value="0"/>
<max value="*"/>
</base>
<type>
<code value="Quantity"/>
</type>
<constraint>
<key value="qty-3"/>
<severity value="error"/>
<human value="If a code for the units is present, the system SHALL also be present"/>
<xpath value="not(exists(f:code)) or exists(f:system)"/>
</constraint>
<constraint>
<key value="drt-1"/>
<severity value="error"/>
<human value="There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM."/>
<xpath value="(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')"/>
</constraint>
<mapping>
<identity value="v2"/>
<map value="SN (see also Range) or CQ"/>
</mapping>
<mapping>
<identity value="rim"/>
<map value="PQ, IVL<PQ>, MO, CO, depending on the values"/>
</mapping>
</element>
<element>
<path value="Quantity.id"/>
<representation value="xmlAttr"/>
<short value="xml:id (or equivalent in JSON)"/>
<definition value="unique id for the element within a resource (for internal references)."/>
<min value="0"/>
<max value="1"/>
<base>
<path value="Quantity.id"/>
<min value="0"/>
<max value="1"/>
</base>
<type>
<code value="id"/>
</type>
<mapping>
<identity value="rim"/>
<map value="n/a"/>
</mapping>
</element>
<element>
<path value="Quantity.extension"/>
<short value="Additional Content defined by implementations"/>
<definition value="May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."/>
<alias value="extensions"/>
<alias value="user content"/>
<min value="0"/>
<max value="*"/>
<base>
<path value="Quantity.extension"/>
<min value="0"/>
<max value="*"/>
</base>
<type>
<code value="Extension"/>
</type>
<mapping>
<identity value="rim"/>
<map value="n/a"/>
</mapping>
</element>
<element>
<path value="Quantity.value"/>
<short value="Numerical value (with implicit precision)"/>
<definition value="The value of the measured amount. The value includes an implicit precision in the presentation of the value."/>
<requirements value="Precision is handled implicitly in almost all cases of measurement."/>
<min value="0"/>
<max value="1"/>
<base>
<path value="Quantity.value"/>
<min value="0"/>
<max value="1"/>
</base>
<type>
<code value="decimal"/>
</type>
<mapping>
<identity value="v2"/>
<map value="SN.2 / CQ - N/A"/>
</mapping>
<mapping>
<identity value="rim"/>
<map value="PQ.value, CO.value, MO.value, IVL.high or IVL.low depending on the value"/>
</mapping>
</element>
<element>
<path value="Quantity.comparator"/>
<short value="< | <= | >= | > - how to understand the value"/>
<definition value="How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is "<" , then the real value is < stated value."/>
<requirements value="Need a framework for handling measures where the value is <5ug/L or >400mg/L due to the limitations of measuring methodology."/>
<min value="0"/>
<max value="1"/>
<base>
<path value="Quantity.comparator"/>
<min value="0"/>
<max value="1"/>
</base>
<type>
<code value="code"/>
</type>
<meaningWhenMissing value="If there is no comparator, then there is no modification of the value"/>
<isModifier value="true"/>
<binding>
<strength value="required"/>
<description value="How the Quantity should be understood and represented"/>
<valueSetReference>
<reference value="http://hl7.org/fhir/ValueSet/quantity-comparator"/>
</valueSetReference>
</binding>
<mapping>
<identity value="v2"/>
<map value="SN.1 / CQ.1"/>
</mapping>
<mapping>
<identity value="rim"/>
<map value="IVL properties"/>
</mapping>
</element>
<element>
<path value="Quantity.units"/>
<short value="Unit representation"/>
<definition value="A human-readable form of the units."/>
<requirements value="There are many representations for units and in many contexts, particular representations are fixed and required. I.e. mcg for micrograms."/>
<min value="0"/>
<max value="1"/>
<base>
<path value="Quantity.units"/>
<min value="0"/>
<max value="1"/>
</base>
<type>
<code value="string"/>
</type>
<mapping>
<identity value="v2"/>
<map value="(see OBX.6 etc) / CQ.2"/>
</mapping>
<mapping>
<identity value="rim"/>
<map value="PQ.unit"/>
</mapping>
</element>
<element>
<path value="Quantity.system"/>
<short value="System that defines coded unit form"/>
<definition value="The identification of the system that provides the coded form of the unit."/>
<requirements value="Need to know the system that defines the coded form of the unit."/>
<min value="0"/>
<max value="1"/>
<base>
<path value="Quantity.system"/>
<min value="0"/>
<max value="1"/>
</base>
<type>
<code value="uri"/>
</type>
<condition value="qty-3"/>
<mapping>
<identity value="v2"/>
<map value="(see OBX.6 etc) / CQ.2"/>
</mapping>
<mapping>
<identity value="rim"/>
<map value="CO.codeSystem, PQ.translation.codeSystem"/>
</mapping>
</element>
<element>
<path value="Quantity.code"/>
<short value="Coded form of the unit"/>
<definition value="A computer processable form of the units in some unit representation system."/>
<requirements value="Need a computable form of the units that is fixed across all forms. UCUM provides this for quantities, but SNOMED CT provides many units of interest."/>
<min value="0"/>
<max value="1"/>
<base>
<path value="Quantity.code"/>
<min value="0"/>
<max value="1"/>
</base>
<type>
<code value="code"/>
</type>
<mapping>
<identity value="v2"/>
<map value="(see OBX.6 etc) / CQ.2"/>
</mapping>
<mapping>
<identity value="rim"/>
<map value="PQ.code, MO.currency, PQ.translation.code"/>
</mapping>
</element>
</snapshot>
<differential>
<element>
<path value="Quantity"/>
<name value="Duration"/>
<short value="A length of time"/>
<definition value="There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM."/>
<min value="1"/>
<max value="1"/>
<type>
<code value="Quantity"/>
</type>
<constraint>
<key value="drt-1"/>
<severity value="error"/>
<human value="There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM."/>
<xpath value="(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')"/>
</constraint>
<isModifier value="false"/>
</element>
</differential>
</StructureDefinition> | {
"content_hash": "262210593fb0b813b9e7ddcf94499d6e",
"timestamp": "",
"source": "github",
"line_count": 264,
"max_line_length": 429,
"avg_line_length": 37.63257575757576,
"alnum_prop": 0.5884247609461499,
"repo_name": "Nodstuff/hapi-fhir",
"id": "1db73a5884d6daf2cb7d5cea42bd324436e00463",
"size": "9935",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/profile/duration.profile.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "228150"
},
{
"name": "Eagle",
"bytes": "1818144"
},
{
"name": "HTML",
"bytes": "189422"
},
{
"name": "Java",
"bytes": "19541099"
},
{
"name": "JavaScript",
"bytes": "23709"
},
{
"name": "KiCad",
"bytes": "12030"
},
{
"name": "Ruby",
"bytes": "238370"
},
{
"name": "Shell",
"bytes": "6692"
}
],
"symlink_target": ""
} |
package com.jeequan.jeepay.core.utils;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;
/**
* @description: Spring 框架下, 获取Beans静态函数方法。
* @Author terrfly
* @Date 2019/12/31 13:57
*/
@Component
public class SpringBeansUtil implements ApplicationContextAware {
private static ApplicationContext applicationContext = null;
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
if(SpringBeansUtil.applicationContext == null){
SpringBeansUtil.applicationContext = applicationContext;
}
}
/** 获取applicationContext */
public static ApplicationContext getApplicationContext() {
return applicationContext;
}
/** 通过name获取 Bean. */
public static Object getBean(String name){
if(!getApplicationContext().containsBean(name)){
return null;
}
return getApplicationContext().getBean(name);
}
/** 通过class获取Bean. */
public static <T> T getBean(Class<T> clazz){
try {
return getApplicationContext().getBean(clazz);
} catch (BeansException e) {
return null;
}
}
/** 通过name,以及Clazz返回指定的Bean */
public static <T> T getBean(String name, Class<T> clazz){
if(!getApplicationContext().containsBean(name)){
return null;
}
return getApplicationContext().getBean(name, clazz);
}
}
| {
"content_hash": "f86a07af9378484921bdfb771d358451",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 100,
"avg_line_length": 27.271186440677965,
"alnum_prop": 0.6780609073958981,
"repo_name": "jmdhappy/xxpay-master",
"id": "6efdfde0497a510bf8e697970cf80e2f5f5cf624",
"size": "2336",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "jeepay-core/src/main/java/com/jeequan/jeepay/core/utils/SpringBeansUtil.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "158171"
},
{
"name": "Dockerfile",
"bytes": "938"
},
{
"name": "FreeMarker",
"bytes": "110264"
},
{
"name": "HTML",
"bytes": "9457"
},
{
"name": "Java",
"bytes": "1149779"
},
{
"name": "JavaScript",
"bytes": "604196"
},
{
"name": "Shell",
"bytes": "5503"
},
{
"name": "TSQL",
"bytes": "10858"
}
],
"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.9.1"/>
<title>V8 API Reference Guide for node.js v0.8.2: Class Members</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 style="padding-left: 0.5em;">
<div id="projectname">V8 API Reference Guide for node.js v0.8.2
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<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="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li><a href="examples.html"><span>Examples</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="classes.html"><span>Class Index</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li class="current"><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
<div id="navrow3" class="tabs2">
<ul class="tablist">
<li class="current"><a href="functions.html"><span>All</span></a></li>
<li><a href="functions_func.html"><span>Functions</span></a></li>
<li><a href="functions_vars.html"><span>Variables</span></a></li>
<li><a href="functions_type.html"><span>Typedefs</span></a></li>
<li><a href="functions_enum.html"><span>Enumerations</span></a></li>
</ul>
</div>
<div id="navrow4" class="tabs3">
<ul class="tablist">
<li><a href="functions.html#index_a"><span>a</span></a></li>
<li><a href="functions_b.html#index_b"><span>b</span></a></li>
<li><a href="functions_c.html#index_c"><span>c</span></a></li>
<li><a href="functions_d.html#index_d"><span>d</span></a></li>
<li><a href="functions_e.html#index_e"><span>e</span></a></li>
<li><a href="functions_f.html#index_f"><span>f</span></a></li>
<li><a href="functions_g.html#index_g"><span>g</span></a></li>
<li class="current"><a href="functions_h.html#index_h"><span>h</span></a></li>
<li><a href="functions_i.html#index_i"><span>i</span></a></li>
<li><a href="functions_k.html#index_k"><span>k</span></a></li>
<li><a href="functions_l.html#index_l"><span>l</span></a></li>
<li><a href="functions_m.html#index_m"><span>m</span></a></li>
<li><a href="functions_n.html#index_n"><span>n</span></a></li>
<li><a href="functions_o.html#index_o"><span>o</span></a></li>
<li><a href="functions_p.html#index_p"><span>p</span></a></li>
<li><a href="functions_r.html#index_r"><span>r</span></a></li>
<li><a href="functions_s.html#index_s"><span>s</span></a></li>
<li><a href="functions_t.html#index_t"><span>t</span></a></li>
<li><a href="functions_u.html#index_u"><span>u</span></a></li>
<li><a href="functions_v.html#index_v"><span>v</span></a></li>
<li><a href="functions_w.html#index_w"><span>w</span></a></li>
<li><a href="functions_~.html#index_~"><span>~</span></a></li>
</ul>
</div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="contents">
<div class="textblock">Here is a list of all documented class members with links to the class documentation for each member:</div>
<h3><a class="anchor" id="index_h"></a>- h -</h3><ul>
<li>Handle()
: <a class="el" href="classv8_1_1_handle.html#aa7543a3d572565806a66e922634cc2f4">v8::Handle< T ></a>
</li>
<li>HasCaught()
: <a class="el" href="classv8_1_1_try_catch.html#a48f704fbf2b82564b5d2a4ff596e4137">v8::TryCatch</a>
</li>
<li>HasError()
: <a class="el" href="classv8_1_1_script_data.html#ab5cea77b299b7dd73b7024fb114fd7e4">v8::ScriptData</a>
</li>
<li>HasIndexedLookupInterceptor()
: <a class="el" href="classv8_1_1_object.html#afd36ea440a254335bde065a4ceafffb3">v8::Object</a>
</li>
<li>HasInstance()
: <a class="el" href="classv8_1_1_function_template.html#aa883e4ab6643498662f7873506098c98">v8::FunctionTemplate</a>
</li>
<li>HasNamedLookupInterceptor()
: <a class="el" href="classv8_1_1_object.html#ad0791109068a7816d65a06bbc9f6f870">v8::Object</a>
</li>
<li>HasOutOfMemoryException()
: <a class="el" href="classv8_1_1_context.html#aadec400a5da1e79e58a8770fd706b9a0">v8::Context</a>
</li>
<li>HostDispatchHandler
: <a class="el" href="classv8_1_1_debug.html#a442f686afe7d80928b57b3ff8ac3f6e7">v8::Debug</a>
</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue Aug 11 2015 23:48:26 for V8 API Reference Guide for node.js v0.8.2 by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.9.1
</small></address>
</body>
</html>
| {
"content_hash": "743ff401b5e448defa170309be216bd0",
"timestamp": "",
"source": "github",
"line_count": 158,
"max_line_length": 154,
"avg_line_length": 45.765822784810126,
"alnum_prop": 0.6375328446964459,
"repo_name": "v8-dox/v8-dox.github.io",
"id": "6da569b495ff4c6ae94de5c41ea4efacb3714e6d",
"size": "7231",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "1c1ad9b/html/functions_h.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.lang.xml;
import com.intellij.lang.ASTNode;
import com.intellij.lang.ParserDefinition;
import com.intellij.lang.PsiParser;
import com.intellij.lexer.Lexer;
import com.intellij.lexer.XmlLexer;
import com.intellij.openapi.project.Project;
import com.intellij.psi.FileViewProvider;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiFile;
import com.intellij.psi.impl.source.parsing.xml.XmlParser;
import com.intellij.psi.impl.source.xml.XmlFileImpl;
import com.intellij.psi.impl.source.xml.stub.XmlStubBasedElementType;
import com.intellij.psi.tree.IFileElementType;
import com.intellij.psi.tree.TokenSet;
import com.intellij.psi.util.PsiUtilCore;
import com.intellij.psi.xml.XmlElementType;
import com.intellij.psi.xml.XmlTokenType;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
public class XMLParserDefinition implements ParserDefinition {
@Override
@NotNull
public Lexer createLexer(Project project) {
return new XmlLexer();
}
@Override
public @NotNull IFileElementType getFileNodeType() {
return XmlElementType.XML_FILE;
}
@Override
@NotNull
public TokenSet getWhitespaceTokens() {
return XmlTokenType.WHITESPACES;
}
@Override
@NotNull
public TokenSet getCommentTokens() {
return XmlTokenType.COMMENTS;
}
@Override
@NotNull
public TokenSet getStringLiteralElements() {
return TokenSet.EMPTY;
}
@Override
@NotNull
public PsiParser createParser(final Project project) {
return new XmlParser();
}
@Override
@NotNull
public PsiElement createElement(ASTNode node) {
if (node.getElementType() instanceof XmlStubBasedElementType) {
//noinspection rawtypes
return ((XmlStubBasedElementType)node.getElementType()).createPsi(node);
}
return PsiUtilCore.NULL_PSI_ELEMENT;
}
@Override
public @NotNull PsiFile createFile(@NotNull FileViewProvider viewProvider) {
return new XmlFileImpl(viewProvider, XmlElementType.XML_FILE);
}
@Override
public @NotNull SpaceRequirements spaceExistenceTypeBetweenTokens(ASTNode left, ASTNode right) {
return canStickTokensTogether(left, right);
}
/**
* @deprecated use {@link XMLParserDefinition#canStickTokensTogether(ASTNode, ASTNode)} instead
*/
@Deprecated
@ApiStatus.ScheduledForRemoval(inVersion = "2021.3")
public static SpaceRequirements canStickTokensTogetherByLexerInXml(final ASTNode left,
final ASTNode right,
final Lexer lexer,
int state) {
return canStickTokensTogether(left, right);
}
public static SpaceRequirements canStickTokensTogether(final ASTNode left, final ASTNode right) {
if (left.getElementType() == XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN ||
right.getElementType() == XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN) {
return SpaceRequirements.MUST_NOT;
}
if (left.getElementType() == XmlTokenType.XML_ATTRIBUTE_VALUE_END_DELIMITER && right.getElementType() == XmlTokenType.XML_NAME) {
return SpaceRequirements.MUST;
}
if (left.getElementType() == XmlTokenType.XML_NAME && right.getElementType() == XmlTokenType.XML_NAME) {
return SpaceRequirements.MUST;
}
if (left.getElementType() == XmlTokenType.XML_TAG_NAME && right.getElementType() == XmlTokenType.XML_NAME) {
return SpaceRequirements.MUST;
}
return SpaceRequirements.MAY;
}
}
| {
"content_hash": "48ff4e8ff4364e0c6723bf289866199e",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 140,
"avg_line_length": 34.93518518518518,
"alnum_prop": 0.7073946461701563,
"repo_name": "zdary/intellij-community",
"id": "484dfdcb3b5cc3bd1ef46c7ec795e4833b19d8e0",
"size": "3773",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "xml/xml-psi-impl/src/com/intellij/lang/xml/XMLParserDefinition.java",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
import JSONFeed from '../../eleventy/feed'
module.exports = class ElsewhereFeed extends JSONFeed {
collection = 'elsewhere'
title = 'Elsewhere'
}
| {
"content_hash": "454d78f101712231acda1c0a8d58b99d",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 55,
"avg_line_length": 25.5,
"alnum_prop": 0.7124183006535948,
"repo_name": "chriskrycho/lightning-rs",
"id": "5f803e0bb6a0362293d18a6a9fd55c3bfae9c068",
"size": "153",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "tests/sympolymathesy/content/feeds/elsewhere.11ty.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "1844"
},
{
"name": "Nunjucks",
"bytes": "34639"
},
{
"name": "Rust",
"bytes": "44723"
},
{
"name": "SCSS",
"bytes": "56635"
}
],
"symlink_target": ""
} |
package org.cloudfoundry.client.v2.featureflags;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import org.immutables.value.Value;
/**
* The response payload for the Set feature flag operation
*/
@JsonDeserialize
@Value.Immutable
abstract class _SetFeatureFlagResponse extends AbstractFeatureFlag {
}
| {
"content_hash": "477288523751f7d940907d75211df56d",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 68,
"avg_line_length": 21.8,
"alnum_prop": 0.8134556574923547,
"repo_name": "alexander071/cf-java-client",
"id": "e876ed4539349863b0fc6034a2b8540ed539a9bc",
"size": "947",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "cloudfoundry-client/src/main/java/org/cloudfoundry/client/v2/featureflags/_SetFeatureFlagResponse.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "5043"
},
{
"name": "Java",
"bytes": "4410753"
},
{
"name": "Shell",
"bytes": "8834"
}
],
"symlink_target": ""
} |
namespace Z80NavBar.Themes
{
/// <summary>
/// Z80_Navigation control theme enumerations
/// </summary>
public enum Theme
{
// Note: If you implement more themes or your own themes, just add enumeration here
Dark = 0,
Blue
}
}
| {
"content_hash": "cc5227c29c45ecbb2a40fa5597f61e23",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 91,
"avg_line_length": 17.5,
"alnum_prop": 0.5857142857142857,
"repo_name": "kernelENREK/Z80_NavigationBar",
"id": "588c1df2b659120a8e1adcf35fc34b32e09eb7ea",
"size": "282",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "DemoCS/Z80_NavBar/Themes/Definitions/ThemeEnums.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "108995"
},
{
"name": "Visual Basic",
"bytes": "216017"
}
],
"symlink_target": ""
} |
Subsets and Splits