text stringlengths 2 1.04M | meta dict |
|---|---|
SET(CMAKE_DEPENDS_LANGUAGES
"CXX"
)
# The set of files for implicit dependencies of each language:
SET(CMAKE_DEPENDS_CHECK_CXX
"/home/cmeon/SimplexLP/eigen/test/geo_alignedbox.cpp" "/home/cmeon/SimplexLP/lib/test/CMakeFiles/geo_alignedbox_13.dir/geo_alignedbox.cpp.o"
)
SET(CMAKE_CXX_COMPILER_ID "GNU")
# Targets to which this target links.
SET(CMAKE_TARGET_LINKED_INFO_FILES
)
# The include file search paths:
SET(CMAKE_C_TARGET_INCLUDE_PATH
"test"
"/home/cmeon/SimplexLP/eigen/test"
"/home/cmeon/SimplexLP/eigen"
"."
)
SET(CMAKE_CXX_TARGET_INCLUDE_PATH ${CMAKE_C_TARGET_INCLUDE_PATH})
SET(CMAKE_Fortran_TARGET_INCLUDE_PATH ${CMAKE_C_TARGET_INCLUDE_PATH})
SET(CMAKE_ASM_TARGET_INCLUDE_PATH ${CMAKE_C_TARGET_INCLUDE_PATH})
| {
"content_hash": "4e74c7f8b05c17cdb99a59af35517606",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 142,
"avg_line_length": 32.391304347826086,
"alnum_prop": 0.7476510067114094,
"repo_name": "cmeon/Simplex",
"id": "1a06c38fd8ca0ef691ce63cd1099de02da9051cb",
"size": "812",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/test/CMakeFiles/geo_alignedbox_13.dir/DependInfo.cmake",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "2192597"
},
{
"name": "C++",
"bytes": "3497542"
},
{
"name": "CSS",
"bytes": "5151"
},
{
"name": "FORTRAN",
"bytes": "1462981"
},
{
"name": "JavaScript",
"bytes": "7839"
},
{
"name": "Objective-C",
"bytes": "2089"
},
{
"name": "Python",
"bytes": "8750"
},
{
"name": "Shell",
"bytes": "15472"
},
{
"name": "Tcl",
"bytes": "2329"
}
],
"symlink_target": ""
} |
/*
mc_socket.h
author: Xiongfei Shi <jenson.shixf(a)gmail.com>
license: MIT
*/
#ifndef __MC_SOCKET_H__
#define __MC_SOCKET_H__
#include "mc.h"
#ifndef _WIN32
# include <errno.h>
# include <net/if.h>
# include <sys/param.h>
# include <sys/socket.h>
# include <netinet/in.h>
# include <netinet/tcp.h>
# include <arpa/inet.h>
# include <sys/ioctl.h>
# include <netdb.h>
# include <unistd.h>
# include <ifaddrs.h>
# include <fcntl.h>
# ifdef __linux__
# define AF_LINK AF_PACKET
# else
# include <net/if_media.h>
# include <net/if.h>
# include <net/if_dl.h>
# endif
#else
# include <winsock2.h>
# include <ws2tcpip.h>
# include <iphlpapi.h>
# include <Windows.h>
# include <io.h>
# include <fcntl.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
#ifndef _WIN32
# define SOCKET int
# define INVALID_SOCKET ((SOCKET)(~0))
# define SOCKET_ERROR (-1)
#else
# define socklen_t int
#endif
#ifndef MAXHOSTNAMELEN
# define MAXHOSTNAMELEN 64
#endif
#define MC_MAX_MTU_SIZE 1500
#define MC_MIN_MTU_SIZE 400
#define MC_HWADDR_LEN 6
#define MC_SOMAXCONN SOMAXCONN
/* addr is in_addr or in6_addr */
MC_API const char *mc_inet_ntop(int af, const void *addr, char *strbuf, socklen_t strbuf_size);
MC_API int mc_inet_pton(int af, const char *strbuf, void *addr);
MC_API int mc_sockaddr_isnat(const struct sockaddr_storage *addr);
MC_API const char *mc_hostname(void);
MC_API int mc_resolve_host(struct sockaddr_storage *addr_list, int count, int af, const char *hostname, unsigned short port);
typedef struct mc_addr_t {
char addr[INET6_ADDRSTRLEN];
unsigned short port;
} mc_addr_t;
MC_API int mc_addr_info(mc_addr_t *addr, const struct sockaddr_storage *ss);
#define mc_sockaddr_len(a) ((NULL == (a)) ? 0 : \
(AF_INET == (a)->ss_family) ? sizeof(struct sockaddr_in) : \
(AF_INET6 == (a)->ss_family) ? sizeof(struct sockaddr_in6) : 0)
#ifndef _WIN32
# define MC_EINTR EINTR
# define MC_EFAULT EFAULT
# define MC_EINVAL EINVAL
# define MC_ENOTCONN ENOTCONN
# define MC_ESHUTDOWN ESHUTDOWN
# define MC_ENOTSOCK ENOTSOCK
# define MC_EADDRINUSE EADDRINUSE
# define MC_ECONNREFUSED ECONNREFUSED
# define MC_ECONNABORTED ECONNABORTED
# define MC_ECONNRESET ECONNRESET
# define MC_ETIMEDOUT ETIMEDOUT
# define MC_EAGAIN EAGAIN
# define MC_EISCONN EISCONN
# define MC_EACCES EACCES
# define MC_EINPROGRESS EINPROGRESS
# define MC_EALREADY EALREADY
# define mc_socket(af, type, protocol) socket(af, type, protocol)
# define mc_socket_close(s) close(s)
# define mc_socket_ioctl ioctl
# define mc_socket_connect(s, addr) connect(s, (struct sockaddr *)(addr), mc_sockaddr_len(addr))
# define mc_socket_errno() errno
#else
# define SHUT_RD SD_RECEIVE
# define SHUT_WR SD_SEND
# define SHUT_RDWR SD_BOTH
# define MC_EINTR WSAEINTR
# define MC_EFAULT WSAEFAULT
# define MC_EINVAL WSAEINVAL
# define MC_ENOTCONN WSAENOTCONN
# define MC_ESHUTDOWN WSAESHUTDOWN
# define MC_ENOTSOCK WSAENOTSOCK
# define MC_EADDRINUSE WSAEADDRINUSE
# define MC_ECONNREFUSED WSAECONNREFUSED
# define MC_ECONNABORTED WSAECONNABORTED
# define MC_ECONNRESET WSAECONNRESET
# define MC_ETIMEDOUT WSAETIMEDOUT
# define MC_EAGAIN WSAEWOULDBLOCK
# define MC_EISCONN WSAEISCONN
# define MC_EACCES WSAEACCES
# define MC_EINPROGRESS WSAEINPROGRESS
# define MC_EALREADY WSAEALREADY
# define mc_socket(af, type, protocol) WSASocket(af, type, protocol, NULL, 0, 0)
# define mc_socket_close(s) closesocket(s)
# define mc_socket_ioctl ioctlsocket
# define mc_socket_connect(s, addr) WSAConnect(s, (struct sockaddr *)(addr), mc_sockaddr_len(addr), NULL, NULL, NULL, NULL)
# define mc_socket_errno() WSAGetLastError()
#endif
#define mc_socket_bind(s, addr) bind(s, (struct sockaddr *)(addr), mc_sockaddr_len(addr))
#define mc_socket_listen(s, backlog) listen(s, backlog)
#define mc_socket_shutdown(s, how) shutdown(s, how)
MC_API SOCKET mc_socket_accept(SOCKET sock, struct sockaddr_storage *addr);
MC_API int mc_socket_peername(SOCKET sock, struct sockaddr_storage *addr);
MC_API int mc_socket_sockname(SOCKET sock, struct sockaddr_storage *addr);
MC_API int mc_socket_send(SOCKET sock, const void *buffer, socklen_t len, int flags);
MC_API int mc_socket_recv(SOCKET sock, void *buffer, socklen_t len, int flags);
MC_API int mc_socket_sendto(SOCKET sock, const struct sockaddr_storage *addr, const void *buffer, socklen_t len, int flags);
MC_API int mc_socket_recvfrom(SOCKET sock, struct sockaddr_storage *addr, void *buffer, socklen_t len, int flags);
MC_API int mc_socket_sendall(SOCKET sock, const void *buffer, socklen_t len);
MC_API int mc_socket_recvall(SOCKET sock, void *buffer, socklen_t len);
#define mc_socket_tcp(af) mc_socket(af, SOCK_STREAM, IPPROTO_TCP)
#define mc_socket_udp(af) mc_socket(af, SOCK_DGRAM, IPPROTO_IP)
#define mc_socket_tcp4() mc_socket_tcp(AF_INET)
#define mc_socket_tcp6() mc_socket_tcp(AF_INET6)
#define mc_socket_udp4() mc_socket_udp(AF_INET)
#define mc_socket_udp6() mc_socket_udp(AF_INET6)
/* multiaddr: 224.0.0.0 ~ 239.255.255.255, FF00::/8 */
MC_API int mc_socket_add_membership(SOCKET sock, const struct sockaddr_storage *multiaddr);
MC_API int mc_socket_drop_membership(SOCKET sock, const struct sockaddr_storage *multiaddr);
MC_API void mc_socket_multicast_loop(SOCKET sock, const struct sockaddr_storage *multiaddr, int on);
MC_API int mc_socket_nonblock(SOCKET sock, int nonblock);
MC_API int mc_socket_keepvalues(SOCKET sock, int idle, int interval, int count);
#define mc_socket_reuse_addr(s, on) do { int t_on = (on); setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (char *)&t_on, sizeof(t_on)); } while ( 0 )
#define mc_socket_tcp_nodelay(s, on) do { int t_on = (on); setsockopt(s, IPPROTO_TCP, TCP_NODELAY, (char *)&t_on, sizeof(t_on)); } while ( 0 )
#define mc_socket_no_fragment(s, proto, on) do { int t_on = (on); setsockopt(s, proto, IP_DONTFRAGMENT, (char *)&t_on, sizeof(t_on)); } while ( 0 )
#define mc_socket_udp_broadcast(s, on) do { int t_on = (on); setsockopt(s, SOL_SOCKET, SO_BROADCAST, (char *)&t_on, sizeof(t_on)); } while ( 0 )
#define mc_socket_keepalive(s, on) do { int t_on = (on); setsockopt(s, SOL_SOCKET, SO_KEEPALIVE, (char *)&t_on, sizeof(t_on)); } while ( 0 )
/* Only for SOCKET on Windows */
MC_API int mc_io_readable(int fd, unsigned int timedout);
/* Only for SOCKET on Windows */
MC_API int mc_io_writable(int fd, unsigned int timedout);
MC_API int mc_socket_pipe(SOCKET socks[2]);
MC_API int mc_socket_popen(SOCKET *sock, const char *cmdline);
typedef struct mc_hwaddr_t {
unsigned char hwaddr[MC_HWADDR_LEN];
} mc_hwaddr_t;
MC_API int mc_hwaddr(mc_hwaddr_t *hwaddr, int count);
#ifdef __cplusplus
};
#endif
#endif /* __MC_SOCKET_H__ */
| {
"content_hash": "4f63e205c905c3bd6376dfe790eaf327",
"timestamp": "",
"source": "github",
"line_count": 196,
"max_line_length": 153,
"avg_line_length": 42.66836734693877,
"alnum_prop": 0.5694128901112041,
"repo_name": "jenson-shi/mclib",
"id": "68c6e354ac9c052d3ca8071f2190498762ce218a",
"size": "8363",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "impl/mc_socket.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "523779"
},
{
"name": "C++",
"bytes": "2101"
},
{
"name": "Lua",
"bytes": "2139"
},
{
"name": "Python",
"bytes": "5815"
}
],
"symlink_target": ""
} |
/*
* Powered By wufuwei
*/
package com.osp.biz.dao;
import java.util.*;
import javacommon.base.*;
import cn.org.rapid_framework.page.Page;
import cn.org.rapid_framework.page.PageRequest;
/**
* @author David Wu email:oradb(a)163.com
* @version 1.0
* @since 1.0
*/
import com.osp.biz.model.OspDebitcredit;
public interface IOspDebitcreditDao extends EntityDao<OspDebitcredit,java.lang.Long>{
public Class getEntityClass();
public OspDebitcredit getByTradeid(java.lang.String v) ;
}
| {
"content_hash": "0ab76fc1e960c7a033ac0aadf7b1a10d",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 85,
"avg_line_length": 18.275862068965516,
"alnum_prop": 0.6962264150943396,
"repo_name": "wufuwei/dubbox",
"id": "9424dad1205a2e1195ac8c606de4c3d454a61b28",
"size": "530",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "dubbo-osp/dubbo-osp-provider/src/main/java/com/osp/biz/dao/IOspDebitcreditDao.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "3753"
},
{
"name": "CSS",
"bytes": "18582"
},
{
"name": "Java",
"bytes": "6464527"
},
{
"name": "JavaScript",
"bytes": "63148"
},
{
"name": "Lex",
"bytes": "2077"
},
{
"name": "Shell",
"bytes": "7337"
},
{
"name": "Thrift",
"bytes": "668"
}
],
"symlink_target": ""
} |
package net.pevnostgames.lwjglserver;
import com.badlogic.gdx.Net;
import com.badlogic.gdx.net.Socket;
import com.badlogic.gdx.net.SocketHints;
import com.badlogic.gdx.utils.GdxRuntimeException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.InetSocketAddress;
public class ClientSocket implements Socket {
/**
* Our socket or null for disposed, aka closed.
*/
private java.net.Socket socket;
public ClientSocket(Net.Protocol protocol, String host, int port, SocketHints hints) {
try {
// create the socket
socket = new java.net.Socket();
applyHints(hints); // better to call BEFORE socket is connected!
// and connect...
InetSocketAddress address = new InetSocketAddress(host, port);
if (hints != null) {
socket.connect(address, hints.connectTimeout);
} else {
socket.connect(address);
}
} catch (Exception e) {
throw new GdxRuntimeException("Error making a socket connection to " + host + ":" + port, e);
}
}
public ClientSocket(java.net.Socket socket, SocketHints hints) {
this.socket = socket;
applyHints(hints);
}
private void applyHints(SocketHints hints) {
if (hints != null) {
try {
socket.setPerformancePreferences(hints.performancePrefConnectionTime,
hints.performancePrefLatency,
hints.performancePrefBandwidth);
socket.setTrafficClass(hints.trafficClass);
socket.setTcpNoDelay(hints.tcpNoDelay);
socket.setKeepAlive(hints.keepAlive);
socket.setSendBufferSize(hints.sendBufferSize);
socket.setReceiveBufferSize(hints.receiveBufferSize);
socket.setSoLinger(hints.linger, hints.lingerDuration);
} catch (Exception e) {
throw new GdxRuntimeException("Error setting socket hints.", e);
}
}
}
@Override
public boolean isConnected() {
if (socket != null) {
return socket.isConnected();
} else {
return false;
}
}
@Override
public InputStream getInputStream() {
try {
return socket.getInputStream();
} catch (Exception e) {
throw new GdxRuntimeException("Error getting input stream from socket.", e);
}
}
@Override
public OutputStream getOutputStream() {
try {
return socket.getOutputStream();
} catch (Exception e) {
throw new GdxRuntimeException("Error getting output stream from socket.", e);
}
}
@Override
public void dispose() {
if (socket != null) {
try {
socket.close();
socket = null;
} catch (Exception e) {
throw new GdxRuntimeException("Error closing socket.", e);
}
}
}
}
| {
"content_hash": "f1b5ba86675ae087072a447fa7979a47",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 96,
"avg_line_length": 25.16,
"alnum_prop": 0.7058823529411765,
"repo_name": "Olloth/LibGDXServer",
"id": "47e40c86cd8d15b7c03719a8767b65171fdbb97c",
"size": "3269",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/net/pevnostgames/lwjglserver/ClientSocket.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "39210"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>hammer: Not compatible 👼</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.12.1 / hammer - 1.3.1+8.13</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
hammer
<small>
1.3.1+8.13
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-05-30 07:14:38 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-05-30 07:14:38 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-num base Num library distributed with the OCaml compiler
base-threads base
base-unix base
conf-findutils 1 Virtual package relying on findutils
coq 8.12.1 Formal proof management system
num 0 The Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.05.0 The OCaml compiler (virtual package)
ocaml-base-compiler 4.05.0 Official 4.05.0 release
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.3 A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "palmskog@gmail.com"
homepage: "https://github.com/lukaszcz/coqhammer"
dev-repo: "git+https://github.com/lukaszcz/coqhammer.git"
bug-reports: "https://github.com/lukaszcz/coqhammer/issues"
license: "LGPL-2.1-only"
synopsis: "General-purpose automated reasoning hammer tool for Coq"
description: """
A general-purpose automated reasoning hammer tool for Coq that combines
learning from previous proofs with the translation of problems to the
logics of automated systems and the reconstruction of successfully found proofs.
"""
build: [make "-j%{jobs}%" "plugin"]
install: [
[make "install-plugin"]
[make "test-plugin"] {with-test}
]
depends: [
"ocaml" { >= "4.08" }
"coq" {>= "8.13" & < "8.14~"}
("conf-g++" {build} | "conf-clang" {build})
"coq-hammer-tactics" {= version}
]
tags: [
"category:Miscellaneous/Coq Extensions"
"keyword:automation"
"keyword:hammer"
"logpath:Hammer.Plugin"
"date:2021-05-20"
]
authors: [
"Lukasz Czajka <lukaszcz@mimuw.edu.pl>"
"Cezary Kaliszyk <cezary.kaliszyk@uibk.ac.at>"
]
url {
src: "https://github.com/lukaszcz/coqhammer/archive/refs/tags/v1.3.1-coq8.13.tar.gz"
checksum: "sha512=68f0471fbf12be87e850a91ceaff1a6799319d62cc5cf48fca04bcb5be5d800813bad9e325036d6d13673d79a4b353f14d8f164034c577ee0da91d32e9a444ad"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install 🏜️</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-hammer.1.3.1+8.13 coq.8.12.1</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.12.1).
The following dependencies couldn't be met:
- coq-hammer -> ocaml >= 4.08
base of this switch (use `--unlock-base' to force)
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-hammer.1.3.1+8.13</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
| {
"content_hash": "5765204ace5b3e5e62698252e56be5ec",
"timestamp": "",
"source": "github",
"line_count": 177,
"max_line_length": 159,
"avg_line_length": 40.85875706214689,
"alnum_prop": 0.5537887168141593,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "1fc07a43a9e3262bb2de9fd6a78df5f2850ea512",
"size": "7257",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.05.0-2.0.1/released/8.12.1/hammer/1.3.1+8.13.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
package com.nortal.jroad.client.priatoetusreg;
import java.math.BigDecimal;
import javax.annotation.Resource;
import junit.framework.Assert;
import org.junit.Test;
import com.nortal.jroad.client.exception.XRoadServiceConsumptionException;
import com.nortal.jroad.client.priatoetusreg.PriaToetusregXteeService;
import com.nortal.jroad.client.priatoetusreg.types.ee.riik.xtee.pria_toetusreg.producers.producer.pria_toetusreg.VtaJaakResponse;
import com.nortal.jroad.client.test.BaseXTeeServiceImplTest;
/**
* @author Lauri Lättemäe <lauri.lattemae@nortal.com>
* @since 05.11.2013
*/
public class PriaToetusregXTeeServiceImplTest extends BaseXTeeServiceImplTest {
@Resource
private PriaToetusregXteeService priaToetusregXteeService;
@Test
public void vtaJaakV1() throws XRoadServiceConsumptionException {
VtaJaakResponse rsp = priaToetusregXteeService.vtaJaakV1(null, null);
Assert.assertNull(rsp.getPriaIsikVtaJaak());
Assert.assertNull(rsp.getPriaEttevoteVtaJaak());
Assert.assertTrue(rsp.getVeakood() == -1);
rsp = priaToetusregXteeService.vtaJaakV1("123", "xyz");
Assert.assertNotNull(rsp.getPriaIsikVtaJaak());
Assert.assertNotNull(rsp.getPriaEttevoteVtaJaak());
rsp = priaToetusregXteeService.vtaJaakV1ByIsikukood("456");
Assert.assertTrue(rsp.getPriaIsikVtaJaak() != null && rsp.getPriaIsikVtaJaak().compareTo(BigDecimal.ZERO) >= 0);
Assert.assertNull(rsp.getPriaEttevoteVtaJaak());
rsp = priaToetusregXteeService.vtaJaakV1ByRegistrikood("123456");
Assert.assertTrue(rsp.getPriaEttevoteVtaJaak() != null
&& rsp.getPriaEttevoteVtaJaak().compareTo(BigDecimal.ZERO) >= 0);
Assert.assertNull(rsp.getPriaIsikVtaJaak());
}
}
| {
"content_hash": "8c39efea882ccee08775efab3c6eca0d",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 129,
"avg_line_length": 35.625,
"alnum_prop": 0.783625730994152,
"repo_name": "raulpiiber/j-road",
"id": "a641f9830589652440e780d19cd85715db093e36",
"size": "1712",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "client-service/pria-toetusreg/src/test/java/com/nortal/jroad/client/priatoetusreg/PriaToetusregXTeeServiceImplTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "963399"
},
{
"name": "Shell",
"bytes": "168"
}
],
"symlink_target": ""
} |
var isCommonJS = typeof window == "undefined";
/**
* Top level namespace for Jasmine, a lightweight JavaScript BDD/spec/testing framework.
*
* @namespace
*/
var jasmine = {};
if (isCommonJS) exports.jasmine = jasmine;
/**
* @private
*/
jasmine.unimplementedMethod_ = function() {
throw new Error("unimplemented method");
};
/**
* Use <code>jasmine.undefined</code> instead of <code>undefined</code>, since <code>undefined</code> is just
* a plain old variable and may be redefined by somebody else.
*
* @private
*/
jasmine.undefined = jasmine.___undefined___;
/**
* Show diagnostic messages in the console if set to true
*
*/
jasmine.VERBOSE = false;
/**
* Default interval in milliseconds for event loop yields (e.g. to allow network activity or to refresh the screen with the HTML-based runner). Small values here may result in slow test running. Zero means no updates until all tests have completed.
*
*/
jasmine.DEFAULT_UPDATE_INTERVAL = 250;
/**
* Default timeout interval in milliseconds for waitsFor() blocks.
*/
jasmine.DEFAULT_TIMEOUT_INTERVAL = 5000;
jasmine.getGlobal = function() {
function getGlobal() {
return this;
}
return getGlobal();
};
/**
* Allows for bound functions to be compared. Internal use only.
*
* @ignore
* @private
* @param base {Object} bound 'this' for the function
* @param name {Function} function to find
*/
jasmine.bindOriginal_ = function(base, name) {
var original = base[name];
if (original.apply) {
return function() {
return original.apply(base, arguments);
};
} else {
// IE support
return jasmine.getGlobal()[name];
}
};
jasmine.setTimeout = jasmine.bindOriginal_(jasmine.getGlobal(), 'setTimeout');
jasmine.clearTimeout = jasmine.bindOriginal_(jasmine.getGlobal(), 'clearTimeout');
jasmine.setInterval = jasmine.bindOriginal_(jasmine.getGlobal(), 'setInterval');
jasmine.clearInterval = jasmine.bindOriginal_(jasmine.getGlobal(), 'clearInterval');
jasmine.MessageResult = function(values) {
this.type = 'log';
this.values = values;
this.trace = new Error(); // todo: test better
};
jasmine.MessageResult.prototype.toString = function() {
var text = "";
for (var i = 0; i < this.values.length; i++) {
if (i > 0) text += " ";
if (jasmine.isString_(this.values[i])) {
text += this.values[i];
} else {
text += jasmine.pp(this.values[i]);
}
}
return text;
};
jasmine.ExpectationResult = function(params) {
this.type = 'expect';
this.matcherName = params.matcherName;
this.passed_ = params.passed;
this.expected = params.expected;
this.actual = params.actual;
this.message = this.passed_ ? 'Passed.' : params.message;
var trace = (params.trace || new Error(this.message));
this.trace = this.passed_ ? '' : trace;
};
jasmine.ExpectationResult.prototype.toString = function () {
return this.message;
};
jasmine.ExpectationResult.prototype.passed = function () {
return this.passed_;
};
/**
* Getter for the Jasmine environment. Ensures one gets created
*/
jasmine.getEnv = function() {
var env = jasmine.currentEnv_ = jasmine.currentEnv_ || new jasmine.Env();
return env;
};
/**
* @ignore
* @private
* @param value
* @returns {Boolean}
*/
jasmine.isArray_ = function(value) {
return jasmine.isA_("Array", value);
};
/**
* @ignore
* @private
* @param value
* @returns {Boolean}
*/
jasmine.isString_ = function(value) {
return jasmine.isA_("String", value);
};
/**
* @ignore
* @private
* @param value
* @returns {Boolean}
*/
jasmine.isNumber_ = function(value) {
return jasmine.isA_("Number", value);
};
/**
* @ignore
* @private
* @param {String} typeName
* @param value
* @returns {Boolean}
*/
jasmine.isA_ = function(typeName, value) {
return Object.prototype.toString.apply(value) === '[object ' + typeName + ']';
};
/**
* Pretty printer for expecations. Takes any object and turns it into a human-readable string.
*
* @param value {Object} an object to be outputted
* @returns {String}
*/
jasmine.pp = function(value) {
var stringPrettyPrinter = new jasmine.StringPrettyPrinter();
stringPrettyPrinter.format(value);
return stringPrettyPrinter.string;
};
/**
* Returns true if the object is a DOM Node.
*
* @param {Object} obj object to check
* @returns {Boolean}
*/
jasmine.isDomNode = function(obj) {
return obj.nodeType > 0;
};
/**
* Returns a matchable 'generic' object of the class type. For use in expecations of type when values don't matter.
*
* @example
* // don't care about which function is passed in, as long as it's a function
* expect(mySpy).toHaveBeenCalledWith(jasmine.any(Function));
*
* @param {Class} clazz
* @returns matchable object of the type clazz
*/
jasmine.any = function(clazz) {
return new jasmine.Matchers.Any(clazz);
};
/**
* Returns a matchable subset of a JSON object. For use in expectations when you don't care about all of the
* attributes on the object.
*
* @example
* // don't care about any other attributes than foo.
* expect(mySpy).toHaveBeenCalledWith(jasmine.objectContaining({foo: "bar"});
*
* @param sample {Object} sample
* @returns matchable object for the sample
*/
jasmine.objectContaining = function (sample) {
return new jasmine.Matchers.ObjectContaining(sample);
};
/**
* Jasmine Spies are test doubles that can act as stubs, spies, fakes or when used in an expecation, mocks.
*
* Spies should be created in test setup, before expectations. They can then be checked, using the standard Jasmine
* expectation syntax. Spies can be checked if they were called or not and what the calling params were.
*
* A Spy has the following fields: wasCalled, callCount, mostRecentCall, and argsForCall (see docs).
*
* Spies are torn down at the end of every spec.
*
* Note: Do <b>not</b> call new jasmine.Spy() directly - a spy must be created using spyOn, jasmine.createSpy or jasmine.createSpyObj.
*
* @example
* // a stub
* var myStub = jasmine.createSpy('myStub'); // can be used anywhere
*
* // spy example
* var foo = {
* not: function(bool) { return !bool; }
* }
*
* // actual foo.not will not be called, execution stops
* spyOn(foo, 'not');
// foo.not spied upon, execution will continue to implementation
* spyOn(foo, 'not').andCallThrough();
*
* // fake example
* var foo = {
* not: function(bool) { return !bool; }
* }
*
* // foo.not(val) will return val
* spyOn(foo, 'not').andCallFake(function(value) {return value;});
*
* // mock example
* foo.not(7 == 7);
* expect(foo.not).toHaveBeenCalled();
* expect(foo.not).toHaveBeenCalledWith(true);
*
* @constructor
* @see spyOn, jasmine.createSpy, jasmine.createSpyObj
* @param {String} name
*/
jasmine.Spy = function(name) {
/**
* The name of the spy, if provided.
*/
this.identity = name || 'unknown';
/**
* Is this Object a spy?
*/
this.isSpy = true;
/**
* The actual function this spy stubs.
*/
this.plan = function() {
};
/**
* Tracking of the most recent call to the spy.
* @example
* var mySpy = jasmine.createSpy('foo');
* mySpy(1, 2);
* mySpy.mostRecentCall.args = [1, 2];
*/
this.mostRecentCall = {};
/**
* Holds arguments for each call to the spy, indexed by call count
* @example
* var mySpy = jasmine.createSpy('foo');
* mySpy(1, 2);
* mySpy(7, 8);
* mySpy.mostRecentCall.args = [7, 8];
* mySpy.argsForCall[0] = [1, 2];
* mySpy.argsForCall[1] = [7, 8];
*/
this.argsForCall = [];
this.calls = [];
};
/**
* Tells a spy to call through to the actual implemenatation.
*
* @example
* var foo = {
* bar: function() { // do some stuff }
* }
*
* // defining a spy on an existing property: foo.bar
* spyOn(foo, 'bar').andCallThrough();
*/
jasmine.Spy.prototype.andCallThrough = function() {
this.plan = this.originalValue;
return this;
};
/**
* For setting the return value of a spy.
*
* @example
* // defining a spy from scratch: foo() returns 'baz'
* var foo = jasmine.createSpy('spy on foo').andReturn('baz');
*
* // defining a spy on an existing property: foo.bar() returns 'baz'
* spyOn(foo, 'bar').andReturn('baz');
*
* @param {Object} value
*/
jasmine.Spy.prototype.andReturn = function(value) {
this.plan = function() {
return value;
};
return this;
};
/**
* For throwing an exception when a spy is called.
*
* @example
* // defining a spy from scratch: foo() throws an exception w/ message 'ouch'
* var foo = jasmine.createSpy('spy on foo').andThrow('baz');
*
* // defining a spy on an existing property: foo.bar() throws an exception w/ message 'ouch'
* spyOn(foo, 'bar').andThrow('baz');
*
* @param {String} exceptionMsg
*/
jasmine.Spy.prototype.andThrow = function(exceptionMsg) {
this.plan = function() {
throw exceptionMsg;
};
return this;
};
/**
* Calls an alternate implementation when a spy is called.
*
* @example
* var baz = function() {
* // do some stuff, return something
* }
* // defining a spy from scratch: foo() calls the function baz
* var foo = jasmine.createSpy('spy on foo').andCall(baz);
*
* // defining a spy on an existing property: foo.bar() calls an anonymnous function
* spyOn(foo, 'bar').andCall(function() { return 'baz';} );
*
* @param {Function} fakeFunc
*/
jasmine.Spy.prototype.andCallFake = function(fakeFunc) {
this.plan = fakeFunc;
return this;
};
/**
* Resets all of a spy's the tracking variables so that it can be used again.
*
* @example
* spyOn(foo, 'bar');
*
* foo.bar();
*
* expect(foo.bar.callCount).toEqual(1);
*
* foo.bar.reset();
*
* expect(foo.bar.callCount).toEqual(0);
*/
jasmine.Spy.prototype.reset = function() {
this.wasCalled = false;
this.callCount = 0;
this.argsForCall = [];
this.calls = [];
this.mostRecentCall = {};
};
jasmine.createSpy = function(name) {
var spyObj = function() {
spyObj.wasCalled = true;
spyObj.callCount++;
var args = jasmine.util.argsToArray(arguments);
spyObj.mostRecentCall.object = this;
spyObj.mostRecentCall.args = args;
spyObj.argsForCall.push(args);
spyObj.calls.push({object: this, args: args});
return spyObj.plan.apply(this, arguments);
};
var spy = new jasmine.Spy(name);
for (var prop in spy) {
spyObj[prop] = spy[prop];
}
spyObj.reset();
return spyObj;
};
/**
* Determines whether an object is a spy.
*
* @param {jasmine.Spy|Object} putativeSpy
* @returns {Boolean}
*/
jasmine.isSpy = function(putativeSpy) {
return putativeSpy && putativeSpy.isSpy;
};
/**
* Creates a more complicated spy: an Object that has every property a function that is a spy. Used for stubbing something
* large in one call.
*
* @param {String} baseName name of spy class
* @param {Array} methodNames array of names of methods to make spies
*/
jasmine.createSpyObj = function(baseName, methodNames) {
if (!jasmine.isArray_(methodNames) || methodNames.length === 0) {
throw new Error('createSpyObj requires a non-empty array of method names to create spies for');
}
var obj = {};
for (var i = 0; i < methodNames.length; i++) {
obj[methodNames[i]] = jasmine.createSpy(baseName + '.' + methodNames[i]);
}
return obj;
};
/**
* All parameters are pretty-printed and concatenated together, then written to the current spec's output.
*
* Be careful not to leave calls to <code>jasmine.log</code> in production code.
*/
jasmine.log = function() {
var spec = jasmine.getEnv().currentSpec;
spec.log.apply(spec, arguments);
};
/**
* Function that installs a spy on an existing object's method name. Used within a Spec to create a spy.
*
* @example
* // spy example
* var foo = {
* not: function(bool) { return !bool; }
* }
* spyOn(foo, 'not'); // actual foo.not will not be called, execution stops
*
* @see jasmine.createSpy
* @param obj
* @param methodName
* @returns a Jasmine spy that can be chained with all spy methods
*/
var spyOn = function(obj, methodName) {
return jasmine.getEnv().currentSpec.spyOn(obj, methodName);
};
if (isCommonJS) exports.spyOn = spyOn;
/**
* Creates a Jasmine spec that will be added to the current suite.
*
* // TODO: pending tests
*
* @example
* it('should be true', function() {
* expect(true).toEqual(true);
* });
*
* @param {String} desc description of this specification
* @param {Function} func defines the preconditions and expectations of the spec
*/
var it = function(desc, func) {
return jasmine.getEnv().it(desc, func);
};
if (isCommonJS) exports.it = it;
/**
* Creates a <em>disabled</em> Jasmine spec.
*
* A convenience method that allows existing specs to be disabled temporarily during development.
*
* @param {String} desc description of this specification
* @param {Function} func defines the preconditions and expectations of the spec
*/
var xit = function(desc, func) {
return jasmine.getEnv().xit(desc, func);
};
if (isCommonJS) exports.xit = xit;
/**
* Starts a chain for a Jasmine expectation.
*
* It is passed an Object that is the actual value and should chain to one of the many
* jasmine.Matchers functions.
*
* @param {Object} actual Actual value to test against and expected value
*/
var expect = function(actual) {
return jasmine.getEnv().currentSpec.expect(actual);
};
if (isCommonJS) exports.expect = expect;
/**
* Defines part of a jasmine spec. Used in cominbination with waits or waitsFor in asynchrnous specs.
*
* @param {Function} func Function that defines part of a jasmine spec.
*/
var runs = function(func) {
jasmine.getEnv().currentSpec.runs(func);
};
if (isCommonJS) exports.runs = runs;
/**
* Waits a fixed time period before moving to the next block.
*
* @deprecated Use waitsFor() instead
* @param {Number} timeout milliseconds to wait
*/
var waits = function(timeout) {
jasmine.getEnv().currentSpec.waits(timeout);
};
if (isCommonJS) exports.waits = waits;
/**
* Waits for the latchFunction to return true before proceeding to the next block.
*
* @param {Function} latchFunction
* @param {String} optional_timeoutMessage
* @param {Number} optional_timeout
*/
var waitsFor = function(latchFunction, optional_timeoutMessage, optional_timeout) {
jasmine.getEnv().currentSpec.waitsFor.apply(jasmine.getEnv().currentSpec, arguments);
};
if (isCommonJS) exports.waitsFor = waitsFor;
/**
* A function that is called before each spec in a suite.
*
* Used for spec setup, including validating assumptions.
*
* @param {Function} beforeEachFunction
*/
var beforeEach = function(beforeEachFunction) {
jasmine.getEnv().beforeEach(beforeEachFunction);
};
if (isCommonJS) exports.beforeEach = beforeEach;
/**
* A function that is called after each spec in a suite.
*
* Used for restoring any state that is hijacked during spec execution.
*
* @param {Function} afterEachFunction
*/
var afterEach = function(afterEachFunction) {
jasmine.getEnv().afterEach(afterEachFunction);
};
if (isCommonJS) exports.afterEach = afterEach;
/**
* Defines a suite of specifications.
*
* Stores the description and all defined specs in the Jasmine environment as one suite of specs. Variables declared
* are accessible by calls to beforeEach, it, and afterEach. Describe blocks can be nested, allowing for specialization
* of setup in some tests.
*
* @example
* // TODO: a simple suite
*
* // TODO: a simple suite with a nested describe block
*
* @param {String} description A string, usually the class under test.
* @param {Function} specDefinitions function that defines several specs.
*/
var describe = function(description, specDefinitions) {
return jasmine.getEnv().describe(description, specDefinitions);
};
if (isCommonJS) exports.describe = describe;
/**
* Disables a suite of specifications. Used to disable some suites in a file, or files, temporarily during development.
*
* @param {String} description A string, usually the class under test.
* @param {Function} specDefinitions function that defines several specs.
*/
var xdescribe = function(description, specDefinitions) {
return jasmine.getEnv().xdescribe(description, specDefinitions);
};
if (isCommonJS) exports.xdescribe = xdescribe;
// Provide the XMLHttpRequest class for IE 5.x-6.x:
jasmine.XmlHttpRequest = (typeof XMLHttpRequest == "undefined") ? function() {
function tryIt(f) {
try {
return f();
} catch(e) {
}
return null;
}
var xhr = tryIt(function() {
return new ActiveXObject("Msxml2.XMLHTTP.6.0");
}) ||
tryIt(function() {
return new ActiveXObject("Msxml2.XMLHTTP.3.0");
}) ||
tryIt(function() {
return new ActiveXObject("Msxml2.XMLHTTP");
}) ||
tryIt(function() {
return new ActiveXObject("Microsoft.XMLHTTP");
});
if (!xhr) throw new Error("This browser does not support XMLHttpRequest.");
return xhr;
} : XMLHttpRequest;
/**
* @namespace
*/
jasmine.util = {};
/**
* Declare that a child class inherit it's prototype from the parent class.
*
* @private
* @param {Function} childClass
* @param {Function} parentClass
*/
jasmine.util.inherit = function(childClass, parentClass) {
/**
* @private
*/
var subclass = function() {
};
subclass.prototype = parentClass.prototype;
childClass.prototype = new subclass();
};
jasmine.util.formatException = function(e) {
var lineNumber;
if (e.line) {
lineNumber = e.line;
}
else if (e.lineNumber) {
lineNumber = e.lineNumber;
}
var file;
if (e.sourceURL) {
file = e.sourceURL;
}
else if (e.fileName) {
file = e.fileName;
}
var message = (e.name && e.message) ? (e.name + ': ' + e.message) : e.toString();
if (file && lineNumber) {
message += ' in ' + file + ' (line ' + lineNumber + ')';
}
return message;
};
jasmine.util.htmlEscape = function(str) {
if (!str) return str;
return str.replace(/&/g, '&')
.replace(/</g, '<')
.replace(/>/g, '>');
};
jasmine.util.argsToArray = function(args) {
var arrayOfArgs = [];
for (var i = 0; i < args.length; i++) arrayOfArgs.push(args[i]);
return arrayOfArgs;
};
jasmine.util.extend = function(destination, source) {
for (var property in source) destination[property] = source[property];
return destination;
};
/**
* Environment for Jasmine
*
* @constructor
*/
jasmine.Env = function() {
this.currentSpec = null;
this.currentSuite = null;
this.currentRunner_ = new jasmine.Runner(this);
this.reporter = new jasmine.MultiReporter();
this.updateInterval = jasmine.DEFAULT_UPDATE_INTERVAL;
this.defaultTimeoutInterval = jasmine.DEFAULT_TIMEOUT_INTERVAL;
this.lastUpdate = 0;
this.specFilter = function() {
return true;
};
this.nextSpecId_ = 0;
this.nextSuiteId_ = 0;
this.equalityTesters_ = [];
// wrap matchers
this.matchersClass = function() {
jasmine.Matchers.apply(this, arguments);
};
jasmine.util.inherit(this.matchersClass, jasmine.Matchers);
jasmine.Matchers.wrapInto_(jasmine.Matchers.prototype, this.matchersClass);
};
jasmine.Env.prototype.setTimeout = jasmine.setTimeout;
jasmine.Env.prototype.clearTimeout = jasmine.clearTimeout;
jasmine.Env.prototype.setInterval = jasmine.setInterval;
jasmine.Env.prototype.clearInterval = jasmine.clearInterval;
/**
* @returns an object containing jasmine version build info, if set.
*/
jasmine.Env.prototype.version = function () {
if (jasmine.version_) {
return jasmine.version_;
} else {
throw new Error('Version not set');
}
};
/**
* @returns string containing jasmine version build info, if set.
*/
jasmine.Env.prototype.versionString = function() {
if (!jasmine.version_) {
return "version unknown";
}
var version = this.version();
var versionString = version.major + "." + version.minor + "." + version.build;
if (version.release_candidate) {
versionString += ".rc" + version.release_candidate;
}
versionString += " revision " + version.revision;
return versionString;
};
/**
* @returns a sequential integer starting at 0
*/
jasmine.Env.prototype.nextSpecId = function () {
return this.nextSpecId_++;
};
/**
* @returns a sequential integer starting at 0
*/
jasmine.Env.prototype.nextSuiteId = function () {
return this.nextSuiteId_++;
};
/**
* Register a reporter to receive status updates from Jasmine.
* @param {jasmine.Reporter} reporter An object which will receive status updates.
*/
jasmine.Env.prototype.addReporter = function(reporter) {
this.reporter.addReporter(reporter);
};
jasmine.Env.prototype.execute = function() {
this.currentRunner_.execute();
};
jasmine.Env.prototype.describe = function(description, specDefinitions) {
var suite = new jasmine.Suite(this, description, specDefinitions, this.currentSuite);
var parentSuite = this.currentSuite;
if (parentSuite) {
parentSuite.add(suite);
} else {
this.currentRunner_.add(suite);
}
this.currentSuite = suite;
var declarationError = null;
try {
specDefinitions.call(suite);
} catch(e) {
declarationError = e;
}
if (declarationError) {
this.it("encountered a declaration exception", function() {
throw declarationError;
});
}
this.currentSuite = parentSuite;
return suite;
};
jasmine.Env.prototype.beforeEach = function(beforeEachFunction) {
if (this.currentSuite) {
this.currentSuite.beforeEach(beforeEachFunction);
} else {
this.currentRunner_.beforeEach(beforeEachFunction);
}
};
jasmine.Env.prototype.currentRunner = function () {
return this.currentRunner_;
};
jasmine.Env.prototype.afterEach = function(afterEachFunction) {
if (this.currentSuite) {
this.currentSuite.afterEach(afterEachFunction);
} else {
this.currentRunner_.afterEach(afterEachFunction);
}
};
jasmine.Env.prototype.xdescribe = function(desc, specDefinitions) {
return {
execute: function() {
}
};
};
jasmine.Env.prototype.it = function(description, func) {
var spec = new jasmine.Spec(this, this.currentSuite, description);
this.currentSuite.add(spec);
this.currentSpec = spec;
if (func) {
spec.runs(func);
}
return spec;
};
jasmine.Env.prototype.xit = function(desc, func) {
return {
id: this.nextSpecId(),
runs: function() {
}
};
};
jasmine.Env.prototype.compareObjects_ = function(a, b, mismatchKeys, mismatchValues) {
if (a.__Jasmine_been_here_before__ === b && b.__Jasmine_been_here_before__ === a) {
return true;
}
a.__Jasmine_been_here_before__ = b;
b.__Jasmine_been_here_before__ = a;
var hasKey = function(obj, keyName) {
return obj !== null && obj[keyName] !== jasmine.undefined;
};
for (var property in b) {
if (!hasKey(a, property) && hasKey(b, property)) {
mismatchKeys.push("expected has key '" + property + "', but missing from actual.");
}
}
for (property in a) {
if (!hasKey(b, property) && hasKey(a, property)) {
mismatchKeys.push("expected missing key '" + property + "', but present in actual.");
}
}
for (property in b) {
if (property == '__Jasmine_been_here_before__') continue;
if (!this.equals_(a[property], b[property], mismatchKeys, mismatchValues)) {
mismatchValues.push("'" + property + "' was '" + (b[property] ? jasmine.util.htmlEscape(b[property].toString()) : b[property]) + "' in expected, but was '" + (a[property] ? jasmine.util.htmlEscape(a[property].toString()) : a[property]) + "' in actual.");
}
}
if (jasmine.isArray_(a) && jasmine.isArray_(b) && a.length != b.length) {
mismatchValues.push("arrays were not the same length");
}
delete a.__Jasmine_been_here_before__;
delete b.__Jasmine_been_here_before__;
return (mismatchKeys.length === 0 && mismatchValues.length === 0);
};
jasmine.Env.prototype.equals_ = function(a, b, mismatchKeys, mismatchValues) {
mismatchKeys = mismatchKeys || [];
mismatchValues = mismatchValues || [];
for (var i = 0; i < this.equalityTesters_.length; i++) {
var equalityTester = this.equalityTesters_[i];
var result = equalityTester(a, b, this, mismatchKeys, mismatchValues);
if (result !== jasmine.undefined) return result;
}
if (a === b) return true;
if (a === jasmine.undefined || a === null || b === jasmine.undefined || b === null) {
return (a == jasmine.undefined && b == jasmine.undefined);
}
if (jasmine.isDomNode(a) && jasmine.isDomNode(b)) {
return a === b;
}
if (a instanceof Date && b instanceof Date) {
return a.getTime() == b.getTime();
}
if (a.jasmineMatches) {
return a.jasmineMatches(b);
}
if (b.jasmineMatches) {
return b.jasmineMatches(a);
}
if (a instanceof jasmine.Matchers.ObjectContaining) {
return a.matches(b);
}
if (b instanceof jasmine.Matchers.ObjectContaining) {
return b.matches(a);
}
if (jasmine.isString_(a) && jasmine.isString_(b)) {
return (a == b);
}
if (jasmine.isNumber_(a) && jasmine.isNumber_(b)) {
return (a == b);
}
if (typeof a === "object" && typeof b === "object") {
return this.compareObjects_(a, b, mismatchKeys, mismatchValues);
}
//Straight check
return (a === b);
};
jasmine.Env.prototype.contains_ = function(haystack, needle) {
if (jasmine.isArray_(haystack)) {
for (var i = 0; i < haystack.length; i++) {
if (this.equals_(haystack[i], needle)) return true;
}
return false;
}
return haystack.indexOf(needle) >= 0;
};
jasmine.Env.prototype.addEqualityTester = function(equalityTester) {
this.equalityTesters_.push(equalityTester);
};
/** No-op base class for Jasmine reporters.
*
* @constructor
*/
jasmine.Reporter = function() {
};
//noinspection JSUnusedLocalSymbols
jasmine.Reporter.prototype.reportRunnerStarting = function(runner) {
};
//noinspection JSUnusedLocalSymbols
jasmine.Reporter.prototype.reportRunnerResults = function(runner) {
};
//noinspection JSUnusedLocalSymbols
jasmine.Reporter.prototype.reportSuiteResults = function(suite) {
};
//noinspection JSUnusedLocalSymbols
jasmine.Reporter.prototype.reportSpecStarting = function(spec) {
};
//noinspection JSUnusedLocalSymbols
jasmine.Reporter.prototype.reportSpecResults = function(spec) {
};
//noinspection JSUnusedLocalSymbols
jasmine.Reporter.prototype.log = function(str) {
};
/**
* Blocks are functions with executable code that make up a spec.
*
* @constructor
* @param {jasmine.Env} env
* @param {Function} func
* @param {jasmine.Spec} spec
*/
jasmine.Block = function(env, func, spec) {
this.env = env;
this.func = func;
this.spec = spec;
};
jasmine.Block.prototype.execute = function(onComplete) {
try {
this.func.apply(this.spec);
} catch (e) {
this.spec.fail(e);
}
onComplete();
};
/** JavaScript API reporter.
*
* @constructor
*/
jasmine.JsApiReporter = function() {
this.started = false;
this.finished = false;
this.suites_ = [];
this.results_ = {};
};
jasmine.JsApiReporter.prototype.reportRunnerStarting = function(runner) {
this.started = true;
var suites = runner.topLevelSuites();
for (var i = 0; i < suites.length; i++) {
var suite = suites[i];
this.suites_.push(this.summarize_(suite));
}
};
jasmine.JsApiReporter.prototype.suites = function() {
return this.suites_;
};
jasmine.JsApiReporter.prototype.summarize_ = function(suiteOrSpec) {
var isSuite = suiteOrSpec instanceof jasmine.Suite;
var summary = {
id: suiteOrSpec.id,
name: suiteOrSpec.description,
type: isSuite ? 'suite' : 'spec',
children: []
};
if (isSuite) {
var children = suiteOrSpec.children();
for (var i = 0; i < children.length; i++) {
summary.children.push(this.summarize_(children[i]));
}
}
return summary;
};
jasmine.JsApiReporter.prototype.results = function() {
return this.results_;
};
jasmine.JsApiReporter.prototype.resultsForSpec = function(specId) {
return this.results_[specId];
};
//noinspection JSUnusedLocalSymbols
jasmine.JsApiReporter.prototype.reportRunnerResults = function(runner) {
this.finished = true;
};
//noinspection JSUnusedLocalSymbols
jasmine.JsApiReporter.prototype.reportSuiteResults = function(suite) {
};
//noinspection JSUnusedLocalSymbols
jasmine.JsApiReporter.prototype.reportSpecResults = function(spec) {
this.results_[spec.id] = {
messages: spec.results().getItems(),
result: spec.results().failedCount > 0 ? "failed" : "passed"
};
};
//noinspection JSUnusedLocalSymbols
jasmine.JsApiReporter.prototype.log = function(str) {
};
jasmine.JsApiReporter.prototype.resultsForSpecs = function(specIds){
var results = {};
for (var i = 0; i < specIds.length; i++) {
var specId = specIds[i];
results[specId] = this.summarizeResult_(this.results_[specId]);
}
return results;
};
jasmine.JsApiReporter.prototype.summarizeResult_ = function(result){
var summaryMessages = [];
var messagesLength = result.messages.length;
for (var messageIndex = 0; messageIndex < messagesLength; messageIndex++) {
var resultMessage = result.messages[messageIndex];
summaryMessages.push({
text: resultMessage.type == 'log' ? resultMessage.toString() : jasmine.undefined,
passed: resultMessage.passed ? resultMessage.passed() : true,
type: resultMessage.type,
message: resultMessage.message,
trace: {
stack: resultMessage.passed && !resultMessage.passed() ? resultMessage.trace.stack : jasmine.undefined
}
});
}
return {
result : result.result,
messages : summaryMessages
};
};
/**
* @constructor
* @param {jasmine.Env} env
* @param actual
* @param {jasmine.Spec} spec
*/
jasmine.Matchers = function(env, actual, spec, opt_isNot) {
this.env = env;
this.actual = actual;
this.spec = spec;
this.isNot = opt_isNot || false;
this.reportWasCalled_ = false;
};
// todo: @deprecated as of Jasmine 0.11, remove soon [xw]
jasmine.Matchers.pp = function(str) {
throw new Error("jasmine.Matchers.pp() is no longer supported, please use jasmine.pp() instead!");
};
// todo: @deprecated Deprecated as of Jasmine 0.10. Rewrite your custom matchers to return true or false. [xw]
jasmine.Matchers.prototype.report = function(result, failing_message, details) {
throw new Error("As of jasmine 0.11, custom matchers must be implemented differently -- please see jasmine docs");
};
jasmine.Matchers.wrapInto_ = function(prototype, matchersClass) {
for (var methodName in prototype) {
if (methodName == 'report') continue;
var orig = prototype[methodName];
matchersClass.prototype[methodName] = jasmine.Matchers.matcherFn_(methodName, orig);
}
};
jasmine.Matchers.matcherFn_ = function(matcherName, matcherFunction) {
return function() {
var matcherArgs = jasmine.util.argsToArray(arguments);
var result = matcherFunction.apply(this, arguments);
if (this.isNot) {
result = !result;
}
if (this.reportWasCalled_) return result;
var message;
if (!result) {
if (this.message) {
message = this.message.apply(this, arguments);
if (jasmine.isArray_(message)) {
message = message[this.isNot ? 1 : 0];
}
} else {
var englishyPredicate = matcherName.replace(/[A-Z]/g, function(s) { return ' ' + s.toLowerCase(); });
message = "Expected " + jasmine.pp(this.actual) + (this.isNot ? " not " : " ") + englishyPredicate;
if (matcherArgs.length > 0) {
for (var i = 0; i < matcherArgs.length; i++) {
if (i > 0) message += ",";
message += " " + jasmine.pp(matcherArgs[i]);
}
}
message += ".";
}
}
var expectationResult = new jasmine.ExpectationResult({
matcherName: matcherName,
passed: result,
expected: matcherArgs.length > 1 ? matcherArgs : matcherArgs[0],
actual: this.actual,
message: message
});
this.spec.addMatcherResult(expectationResult);
return jasmine.undefined;
};
};
/**
* toBe: compares the actual to the expected using ===
* @param expected
*/
jasmine.Matchers.prototype.toBe = function(expected) {
return this.actual === expected;
};
/**
* toNotBe: compares the actual to the expected using !==
* @param expected
* @deprecated as of 1.0. Use not.toBe() instead.
*/
jasmine.Matchers.prototype.toNotBe = function(expected) {
return this.actual !== expected;
};
/**
* toEqual: compares the actual to the expected using common sense equality. Handles Objects, Arrays, etc.
*
* @param expected
*/
jasmine.Matchers.prototype.toEqual = function(expected) {
return this.env.equals_(this.actual, expected);
};
/**
* toNotEqual: compares the actual to the expected using the ! of jasmine.Matchers.toEqual
* @param expected
* @deprecated as of 1.0. Use not.toEqual() instead.
*/
jasmine.Matchers.prototype.toNotEqual = function(expected) {
return !this.env.equals_(this.actual, expected);
};
/**
* Matcher that compares the actual to the expected using a regular expression. Constructs a RegExp, so takes
* a pattern or a String.
*
* @param expected
*/
jasmine.Matchers.prototype.toMatch = function(expected) {
return new RegExp(expected).test(this.actual);
};
/**
* Matcher that compares the actual to the expected using the boolean inverse of jasmine.Matchers.toMatch
* @param expected
* @deprecated as of 1.0. Use not.toMatch() instead.
*/
jasmine.Matchers.prototype.toNotMatch = function(expected) {
return !(new RegExp(expected).test(this.actual));
};
/**
* Matcher that compares the actual to jasmine.undefined.
*/
jasmine.Matchers.prototype.toBeDefined = function() {
return (this.actual !== jasmine.undefined);
};
/**
* Matcher that compares the actual to jasmine.undefined.
*/
jasmine.Matchers.prototype.toBeUndefined = function() {
return (this.actual === jasmine.undefined);
};
/**
* Matcher that compares the actual to null.
*/
jasmine.Matchers.prototype.toBeNull = function() {
return (this.actual === null);
};
/**
* Matcher that boolean not-nots the actual.
*/
jasmine.Matchers.prototype.toBeTruthy = function() {
return !!this.actual;
};
/**
* Matcher that boolean nots the actual.
*/
jasmine.Matchers.prototype.toBeFalsy = function() {
return !this.actual;
};
/**
* Matcher that checks to see if the actual, a Jasmine spy, was called.
*/
jasmine.Matchers.prototype.toHaveBeenCalled = function() {
if (arguments.length > 0) {
throw new Error('toHaveBeenCalled does not take arguments, use toHaveBeenCalledWith');
}
if (!jasmine.isSpy(this.actual)) {
throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.');
}
this.message = function() {
return [
"Expected spy " + this.actual.identity + " to have been called.",
"Expected spy " + this.actual.identity + " not to have been called."
];
};
return this.actual.wasCalled;
};
/** @deprecated Use expect(xxx).toHaveBeenCalled() instead */
jasmine.Matchers.prototype.wasCalled = jasmine.Matchers.prototype.toHaveBeenCalled;
/**
* Matcher that checks to see if the actual, a Jasmine spy, was not called.
*
* @deprecated Use expect(xxx).not.toHaveBeenCalled() instead
*/
jasmine.Matchers.prototype.wasNotCalled = function() {
if (arguments.length > 0) {
throw new Error('wasNotCalled does not take arguments');
}
if (!jasmine.isSpy(this.actual)) {
throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.');
}
this.message = function() {
return [
"Expected spy " + this.actual.identity + " to not have been called.",
"Expected spy " + this.actual.identity + " to have been called."
];
};
return !this.actual.wasCalled;
};
/**
* Matcher that checks to see if the actual, a Jasmine spy, was called with a set of parameters.
*
* @example
*
*/
jasmine.Matchers.prototype.toHaveBeenCalledWith = function() {
var expectedArgs = jasmine.util.argsToArray(arguments);
if (!jasmine.isSpy(this.actual)) {
throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.');
}
this.message = function() {
if (this.actual.callCount === 0) {
// todo: what should the failure message for .not.toHaveBeenCalledWith() be? is this right? test better. [xw]
return [
"Expected spy " + this.actual.identity + " to have been called with " + jasmine.pp(expectedArgs) + " but it was never called.",
"Expected spy " + this.actual.identity + " not to have been called with " + jasmine.pp(expectedArgs) + " but it was."
];
} else {
return [
"Expected spy " + this.actual.identity + " to have been called with " + jasmine.pp(expectedArgs) + " but was called with " + jasmine.pp(this.actual.argsForCall),
"Expected spy " + this.actual.identity + " not to have been called with " + jasmine.pp(expectedArgs) + " but was called with " + jasmine.pp(this.actual.argsForCall)
];
}
};
return this.env.contains_(this.actual.argsForCall, expectedArgs);
};
/** @deprecated Use expect(xxx).toHaveBeenCalledWith() instead */
jasmine.Matchers.prototype.wasCalledWith = jasmine.Matchers.prototype.toHaveBeenCalledWith;
/** @deprecated Use expect(xxx).not.toHaveBeenCalledWith() instead */
jasmine.Matchers.prototype.wasNotCalledWith = function() {
var expectedArgs = jasmine.util.argsToArray(arguments);
if (!jasmine.isSpy(this.actual)) {
throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.');
}
this.message = function() {
return [
"Expected spy not to have been called with " + jasmine.pp(expectedArgs) + " but it was",
"Expected spy to have been called with " + jasmine.pp(expectedArgs) + " but it was"
];
};
return !this.env.contains_(this.actual.argsForCall, expectedArgs);
};
/**
* Matcher that checks that the expected item is an element in the actual Array.
*
* @param {Object} expected
*/
jasmine.Matchers.prototype.toContain = function(expected) {
return this.env.contains_(this.actual, expected);
};
/**
* Matcher that checks that the expected item is NOT an element in the actual Array.
*
* @param {Object} expected
* @deprecated as of 1.0. Use not.toContain() instead.
*/
jasmine.Matchers.prototype.toNotContain = function(expected) {
return !this.env.contains_(this.actual, expected);
};
jasmine.Matchers.prototype.toBeLessThan = function(expected) {
return this.actual < expected;
};
jasmine.Matchers.prototype.toBeGreaterThan = function(expected) {
return this.actual > expected;
};
/**
* Matcher that checks that the expected item is equal to the actual item
* up to a given level of decimal precision (default 2).
*
* @param {Number} expected
* @param {Number} precision
*/
jasmine.Matchers.prototype.toBeCloseTo = function(expected, precision) {
if (!(precision === 0)) {
precision = precision || 2;
}
var multiplier = Math.pow(10, precision);
var actual = Math.round(this.actual * multiplier);
expected = Math.round(expected * multiplier);
return expected == actual;
};
/**
* Matcher that checks that the expected exception was thrown by the actual.
*
* @param {String} expected
*/
jasmine.Matchers.prototype.toThrow = function(expected) {
var result = false;
var exception;
if (typeof this.actual != 'function') {
throw new Error('Actual is not a function');
}
try {
this.actual();
} catch (e) {
exception = e;
}
if (exception) {
result = (expected === jasmine.undefined || this.env.equals_(exception.message || exception, expected.message || expected));
}
var not = this.isNot ? "not " : "";
this.message = function() {
if (exception && (expected === jasmine.undefined || !this.env.equals_(exception.message || exception, expected.message || expected))) {
return ["Expected function " + not + "to throw", expected ? expected.message || expected : "an exception", ", but it threw", exception.message || exception].join(' ');
} else {
return "Expected function to throw an exception.";
}
};
return result;
};
jasmine.Matchers.Any = function(expectedClass) {
this.expectedClass = expectedClass;
};
jasmine.Matchers.Any.prototype.jasmineMatches = function(other) {
if (this.expectedClass == String) {
return typeof other == 'string' || other instanceof String;
}
if (this.expectedClass == Number) {
return typeof other == 'number' || other instanceof Number;
}
if (this.expectedClass == Function) {
return typeof other == 'function' || other instanceof Function;
}
if (this.expectedClass == Object) {
return typeof other == 'object';
}
return other instanceof this.expectedClass;
};
jasmine.Matchers.Any.prototype.jasmineToString = function() {
return '<jasmine.any(' + this.expectedClass + ')>';
};
jasmine.Matchers.ObjectContaining = function (sample) {
this.sample = sample;
};
jasmine.Matchers.ObjectContaining.prototype.jasmineMatches = function(other, mismatchKeys, mismatchValues) {
mismatchKeys = mismatchKeys || [];
mismatchValues = mismatchValues || [];
var env = jasmine.getEnv();
var hasKey = function(obj, keyName) {
return obj != null && obj[keyName] !== jasmine.undefined;
};
for (var property in this.sample) {
if (!hasKey(other, property) && hasKey(this.sample, property)) {
mismatchKeys.push("expected has key '" + property + "', but missing from actual.");
}
else if (!env.equals_(this.sample[property], other[property], mismatchKeys, mismatchValues)) {
mismatchValues.push("'" + property + "' was '" + (other[property] ? jasmine.util.htmlEscape(other[property].toString()) : other[property]) + "' in expected, but was '" + (this.sample[property] ? jasmine.util.htmlEscape(this.sample[property].toString()) : this.sample[property]) + "' in actual.");
}
}
return (mismatchKeys.length === 0 && mismatchValues.length === 0);
};
jasmine.Matchers.ObjectContaining.prototype.jasmineToString = function () {
return "<jasmine.objectContaining(" + jasmine.pp(this.sample) + ")>";
};
/**
* @constructor
*/
jasmine.MultiReporter = function() {
this.subReporters_ = [];
};
jasmine.util.inherit(jasmine.MultiReporter, jasmine.Reporter);
jasmine.MultiReporter.prototype.addReporter = function(reporter) {
this.subReporters_.push(reporter);
};
(function() {
var functionNames = [
"reportRunnerStarting",
"reportRunnerResults",
"reportSuiteResults",
"reportSpecStarting",
"reportSpecResults",
"log"
];
for (var i = 0; i < functionNames.length; i++) {
var functionName = functionNames[i];
jasmine.MultiReporter.prototype[functionName] = (function(functionName) {
return function() {
for (var j = 0; j < this.subReporters_.length; j++) {
var subReporter = this.subReporters_[j];
if (subReporter[functionName]) {
subReporter[functionName].apply(subReporter, arguments);
}
}
};
})(functionName);
}
})();
/**
* Holds results for a set of Jasmine spec. Allows for the results array to hold another jasmine.NestedResults
*
* @constructor
*/
jasmine.NestedResults = function() {
/**
* The total count of results
*/
this.totalCount = 0;
/**
* Number of passed results
*/
this.passedCount = 0;
/**
* Number of failed results
*/
this.failedCount = 0;
/**
* Was this suite/spec skipped?
*/
this.skipped = false;
/**
* @ignore
*/
this.items_ = [];
};
/**
* Roll up the result counts.
*
* @param result
*/
jasmine.NestedResults.prototype.rollupCounts = function(result) {
this.totalCount += result.totalCount;
this.passedCount += result.passedCount;
this.failedCount += result.failedCount;
};
/**
* Adds a log message.
* @param values Array of message parts which will be concatenated later.
*/
jasmine.NestedResults.prototype.log = function(values) {
this.items_.push(new jasmine.MessageResult(values));
};
/**
* Getter for the results: message & results.
*/
jasmine.NestedResults.prototype.getItems = function() {
return this.items_;
};
/**
* Adds a result, tracking counts (total, passed, & failed)
* @param {jasmine.ExpectationResult|jasmine.NestedResults} result
*/
jasmine.NestedResults.prototype.addResult = function(result) {
if (result.type != 'log') {
if (result.items_) {
this.rollupCounts(result);
} else {
this.totalCount++;
if (result.passed()) {
this.passedCount++;
} else {
this.failedCount++;
}
}
}
this.items_.push(result);
};
/**
* @returns {Boolean} True if <b>everything</b> below passed
*/
jasmine.NestedResults.prototype.passed = function() {
return this.passedCount === this.totalCount;
};
/**
* Base class for pretty printing for expectation results.
*/
jasmine.PrettyPrinter = function() {
this.ppNestLevel_ = 0;
};
/**
* Formats a value in a nice, human-readable string.
*
* @param value
*/
jasmine.PrettyPrinter.prototype.format = function(value) {
if (this.ppNestLevel_ > 40) {
throw new Error('jasmine.PrettyPrinter: format() nested too deeply!');
}
this.ppNestLevel_++;
try {
if (value === jasmine.undefined) {
this.emitScalar('undefined');
} else if (value === null) {
this.emitScalar('null');
} else if (value === jasmine.getGlobal()) {
this.emitScalar('<global>');
} else if (value.jasmineToString) {
this.emitScalar(value.jasmineToString());
} else if (typeof value === 'string') {
this.emitString(value);
} else if (jasmine.isSpy(value)) {
this.emitScalar("spy on " + value.identity);
} else if (value instanceof RegExp) {
this.emitScalar(value.toString());
} else if (typeof value === 'function') {
this.emitScalar('Function');
} else if (typeof value.nodeType === 'number') {
this.emitScalar('HTMLNode');
} else if (value instanceof Date) {
this.emitScalar('Date(' + value + ')');
} else if (value.__Jasmine_been_here_before__) {
this.emitScalar('<circular reference: ' + (jasmine.isArray_(value) ? 'Array' : 'Object') + '>');
} else if (jasmine.isArray_(value) || typeof value == 'object') {
value.__Jasmine_been_here_before__ = true;
if (jasmine.isArray_(value)) {
this.emitArray(value);
} else {
this.emitObject(value);
}
delete value.__Jasmine_been_here_before__;
} else {
this.emitScalar(value.toString());
}
} finally {
this.ppNestLevel_--;
}
};
jasmine.PrettyPrinter.prototype.iterateObject = function(obj, fn) {
for (var property in obj) {
if (property == '__Jasmine_been_here_before__') continue;
fn(property, obj.__lookupGetter__ ? (obj.__lookupGetter__(property) !== jasmine.undefined &&
obj.__lookupGetter__(property) !== null) : false);
}
};
jasmine.PrettyPrinter.prototype.emitArray = jasmine.unimplementedMethod_;
jasmine.PrettyPrinter.prototype.emitObject = jasmine.unimplementedMethod_;
jasmine.PrettyPrinter.prototype.emitScalar = jasmine.unimplementedMethod_;
jasmine.PrettyPrinter.prototype.emitString = jasmine.unimplementedMethod_;
jasmine.StringPrettyPrinter = function() {
jasmine.PrettyPrinter.call(this);
this.string = '';
};
jasmine.util.inherit(jasmine.StringPrettyPrinter, jasmine.PrettyPrinter);
jasmine.StringPrettyPrinter.prototype.emitScalar = function(value) {
this.append(value);
};
jasmine.StringPrettyPrinter.prototype.emitString = function(value) {
this.append("'" + value + "'");
};
jasmine.StringPrettyPrinter.prototype.emitArray = function(array) {
this.append('[ ');
for (var i = 0; i < array.length; i++) {
if (i > 0) {
this.append(', ');
}
this.format(array[i]);
}
this.append(' ]');
};
jasmine.StringPrettyPrinter.prototype.emitObject = function(obj) {
var self = this;
this.append('{ ');
var first = true;
this.iterateObject(obj, function(property, isGetter) {
if (first) {
first = false;
} else {
self.append(', ');
}
self.append(property);
self.append(' : ');
if (isGetter) {
self.append('<getter>');
} else {
self.format(obj[property]);
}
});
this.append(' }');
};
jasmine.StringPrettyPrinter.prototype.append = function(value) {
this.string += value;
};
jasmine.Queue = function(env) {
this.env = env;
this.blocks = [];
this.running = false;
this.index = 0;
this.offset = 0;
this.abort = false;
};
jasmine.Queue.prototype.addBefore = function(block) {
this.blocks.unshift(block);
};
jasmine.Queue.prototype.add = function(block) {
this.blocks.push(block);
};
jasmine.Queue.prototype.insertNext = function(block) {
this.blocks.splice((this.index + this.offset + 1), 0, block);
this.offset++;
};
jasmine.Queue.prototype.start = function(onComplete) {
this.running = true;
this.onComplete = onComplete;
this.next_();
};
jasmine.Queue.prototype.isRunning = function() {
return this.running;
};
jasmine.Queue.LOOP_DONT_RECURSE = true;
jasmine.Queue.prototype.next_ = function() {
var self = this;
var goAgain = true;
while (goAgain) {
goAgain = false;
if (self.index < self.blocks.length && !this.abort) {
var calledSynchronously = true;
var completedSynchronously = false;
var onComplete = function () {
if (jasmine.Queue.LOOP_DONT_RECURSE && calledSynchronously) {
completedSynchronously = true;
return;
}
if (self.blocks[self.index].abort) {
self.abort = true;
}
self.offset = 0;
self.index++;
var now = new Date().getTime();
if (self.env.updateInterval && now - self.env.lastUpdate > self.env.updateInterval) {
self.env.lastUpdate = now;
self.env.setTimeout(function() {
self.next_();
}, 0);
} else {
if (jasmine.Queue.LOOP_DONT_RECURSE && completedSynchronously) {
goAgain = true;
} else {
self.next_();
}
}
};
self.blocks[self.index].execute(onComplete);
calledSynchronously = false;
if (completedSynchronously) {
onComplete();
}
} else {
self.running = false;
if (self.onComplete) {
self.onComplete();
}
}
}
};
jasmine.Queue.prototype.results = function() {
var results = new jasmine.NestedResults();
for (var i = 0; i < this.blocks.length; i++) {
if (this.blocks[i].results) {
results.addResult(this.blocks[i].results());
}
}
return results;
};
/**
* Runner
*
* @constructor
* @param {jasmine.Env} env
*/
jasmine.Runner = function(env) {
var self = this;
self.env = env;
self.queue = new jasmine.Queue(env);
self.before_ = [];
self.after_ = [];
self.suites_ = [];
};
jasmine.Runner.prototype.execute = function() {
var self = this;
if (self.env.reporter.reportRunnerStarting) {
self.env.reporter.reportRunnerStarting(this);
}
self.queue.start(function () {
self.finishCallback();
});
};
jasmine.Runner.prototype.beforeEach = function(beforeEachFunction) {
beforeEachFunction.typeName = 'beforeEach';
this.before_.splice(0,0,beforeEachFunction);
};
jasmine.Runner.prototype.afterEach = function(afterEachFunction) {
afterEachFunction.typeName = 'afterEach';
this.after_.splice(0,0,afterEachFunction);
};
jasmine.Runner.prototype.finishCallback = function() {
this.env.reporter.reportRunnerResults(this);
};
jasmine.Runner.prototype.addSuite = function(suite) {
this.suites_.push(suite);
};
jasmine.Runner.prototype.add = function(block) {
if (block instanceof jasmine.Suite) {
this.addSuite(block);
}
this.queue.add(block);
};
jasmine.Runner.prototype.specs = function () {
var suites = this.suites();
var specs = [];
for (var i = 0; i < suites.length; i++) {
specs = specs.concat(suites[i].specs());
}
return specs;
};
jasmine.Runner.prototype.suites = function() {
return this.suites_;
};
jasmine.Runner.prototype.topLevelSuites = function() {
var topLevelSuites = [];
for (var i = 0; i < this.suites_.length; i++) {
if (!this.suites_[i].parentSuite) {
topLevelSuites.push(this.suites_[i]);
}
}
return topLevelSuites;
};
jasmine.Runner.prototype.results = function() {
return this.queue.results();
};
/**
* Internal representation of a Jasmine specification, or test.
*
* @constructor
* @param {jasmine.Env} env
* @param {jasmine.Suite} suite
* @param {String} description
*/
jasmine.Spec = function(env, suite, description) {
if (!env) {
throw new Error('jasmine.Env() required');
}
if (!suite) {
throw new Error('jasmine.Suite() required');
}
var spec = this;
spec.id = env.nextSpecId ? env.nextSpecId() : null;
spec.env = env;
spec.suite = suite;
spec.description = description;
spec.queue = new jasmine.Queue(env);
spec.afterCallbacks = [];
spec.spies_ = [];
spec.results_ = new jasmine.NestedResults();
spec.results_.description = description;
spec.matchersClass = null;
};
jasmine.Spec.prototype.getFullName = function() {
return this.suite.getFullName() + ' ' + this.description + '.';
};
jasmine.Spec.prototype.results = function() {
return this.results_;
};
/**
* All parameters are pretty-printed and concatenated together, then written to the spec's output.
*
* Be careful not to leave calls to <code>jasmine.log</code> in production code.
*/
jasmine.Spec.prototype.log = function() {
return this.results_.log(arguments);
};
jasmine.Spec.prototype.runs = function (func) {
var block = new jasmine.Block(this.env, func, this);
this.addToQueue(block);
return this;
};
jasmine.Spec.prototype.addToQueue = function (block) {
if (this.queue.isRunning()) {
this.queue.insertNext(block);
} else {
this.queue.add(block);
}
};
/**
* @param {jasmine.ExpectationResult} result
*/
jasmine.Spec.prototype.addMatcherResult = function(result) {
this.results_.addResult(result);
};
jasmine.Spec.prototype.expect = function(actual) {
var positive = new (this.getMatchersClass_())(this.env, actual, this);
positive.not = new (this.getMatchersClass_())(this.env, actual, this, true);
return positive;
};
/**
* Waits a fixed time period before moving to the next block.
*
* @deprecated Use waitsFor() instead
* @param {Number} timeout milliseconds to wait
*/
jasmine.Spec.prototype.waits = function(timeout) {
var waitsFunc = new jasmine.WaitsBlock(this.env, timeout, this);
this.addToQueue(waitsFunc);
return this;
};
/**
* Waits for the latchFunction to return true before proceeding to the next block.
*
* @param {Function} latchFunction
* @param {String} optional_timeoutMessage
* @param {Number} optional_timeout
*/
jasmine.Spec.prototype.waitsFor = function(latchFunction, optional_timeoutMessage, optional_timeout) {
var latchFunction_ = null;
var optional_timeoutMessage_ = null;
var optional_timeout_ = null;
for (var i = 0; i < arguments.length; i++) {
var arg = arguments[i];
switch (typeof arg) {
case 'function':
latchFunction_ = arg;
break;
case 'string':
optional_timeoutMessage_ = arg;
break;
case 'number':
optional_timeout_ = arg;
break;
}
}
var waitsForFunc = new jasmine.WaitsForBlock(this.env, optional_timeout_, latchFunction_, optional_timeoutMessage_, this);
this.addToQueue(waitsForFunc);
return this;
};
jasmine.Spec.prototype.fail = function (e) {
var expectationResult = new jasmine.ExpectationResult({
passed: false,
message: e ? jasmine.util.formatException(e) : 'Exception',
trace: { stack: e.stack }
});
this.results_.addResult(expectationResult);
};
jasmine.Spec.prototype.getMatchersClass_ = function() {
return this.matchersClass || this.env.matchersClass;
};
jasmine.Spec.prototype.addMatchers = function(matchersPrototype) {
var parent = this.getMatchersClass_();
var newMatchersClass = function() {
parent.apply(this, arguments);
};
jasmine.util.inherit(newMatchersClass, parent);
jasmine.Matchers.wrapInto_(matchersPrototype, newMatchersClass);
this.matchersClass = newMatchersClass;
};
jasmine.Spec.prototype.finishCallback = function() {
this.env.reporter.reportSpecResults(this);
};
jasmine.Spec.prototype.finish = function(onComplete) {
this.removeAllSpies();
this.finishCallback();
if (onComplete) {
onComplete();
}
};
jasmine.Spec.prototype.after = function(doAfter) {
if (this.queue.isRunning()) {
this.queue.add(new jasmine.Block(this.env, doAfter, this));
} else {
this.afterCallbacks.unshift(doAfter);
}
};
jasmine.Spec.prototype.execute = function(onComplete) {
var spec = this;
if (!spec.env.specFilter(spec)) {
spec.results_.skipped = true;
spec.finish(onComplete);
return;
}
this.env.reporter.reportSpecStarting(this);
spec.env.currentSpec = spec;
spec.addBeforesAndAftersToQueue();
spec.queue.start(function () {
spec.finish(onComplete);
});
};
jasmine.Spec.prototype.addBeforesAndAftersToQueue = function() {
var runner = this.env.currentRunner();
var i;
for (var suite = this.suite; suite; suite = suite.parentSuite) {
for (i = 0; i < suite.before_.length; i++) {
this.queue.addBefore(new jasmine.Block(this.env, suite.before_[i], this));
}
}
for (i = 0; i < runner.before_.length; i++) {
this.queue.addBefore(new jasmine.Block(this.env, runner.before_[i], this));
}
for (i = 0; i < this.afterCallbacks.length; i++) {
this.queue.add(new jasmine.Block(this.env, this.afterCallbacks[i], this));
}
for (suite = this.suite; suite; suite = suite.parentSuite) {
for (i = 0; i < suite.after_.length; i++) {
this.queue.add(new jasmine.Block(this.env, suite.after_[i], this));
}
}
for (i = 0; i < runner.after_.length; i++) {
this.queue.add(new jasmine.Block(this.env, runner.after_[i], this));
}
};
jasmine.Spec.prototype.explodes = function() {
throw 'explodes function should not have been called';
};
jasmine.Spec.prototype.spyOn = function(obj, methodName, ignoreMethodDoesntExist) {
if (obj == jasmine.undefined) {
throw "spyOn could not find an object to spy upon for " + methodName + "()";
}
if (!ignoreMethodDoesntExist && obj[methodName] === jasmine.undefined) {
throw methodName + '() method does not exist';
}
if (!ignoreMethodDoesntExist && obj[methodName] && obj[methodName].isSpy) {
throw new Error(methodName + ' has already been spied upon');
}
var spyObj = jasmine.createSpy(methodName);
this.spies_.push(spyObj);
spyObj.baseObj = obj;
spyObj.methodName = methodName;
spyObj.originalValue = obj[methodName];
obj[methodName] = spyObj;
return spyObj;
};
jasmine.Spec.prototype.removeAllSpies = function() {
for (var i = 0; i < this.spies_.length; i++) {
var spy = this.spies_[i];
spy.baseObj[spy.methodName] = spy.originalValue;
}
this.spies_ = [];
};
/**
* Internal representation of a Jasmine suite.
*
* @constructor
* @param {jasmine.Env} env
* @param {String} description
* @param {Function} specDefinitions
* @param {jasmine.Suite} parentSuite
*/
jasmine.Suite = function(env, description, specDefinitions, parentSuite) {
var self = this;
self.id = env.nextSuiteId ? env.nextSuiteId() : null;
self.description = description;
self.queue = new jasmine.Queue(env);
self.parentSuite = parentSuite;
self.env = env;
self.before_ = [];
self.after_ = [];
self.children_ = [];
self.suites_ = [];
self.specs_ = [];
};
jasmine.Suite.prototype.getFullName = function() {
var fullName = this.description;
for (var parentSuite = this.parentSuite; parentSuite; parentSuite = parentSuite.parentSuite) {
fullName = parentSuite.description + ' ' + fullName;
}
return fullName;
};
jasmine.Suite.prototype.finish = function(onComplete) {
this.env.reporter.reportSuiteResults(this);
this.finished = true;
if (typeof(onComplete) == 'function') {
onComplete();
}
};
jasmine.Suite.prototype.beforeEach = function(beforeEachFunction) {
beforeEachFunction.typeName = 'beforeEach';
this.before_.unshift(beforeEachFunction);
};
jasmine.Suite.prototype.afterEach = function(afterEachFunction) {
afterEachFunction.typeName = 'afterEach';
this.after_.unshift(afterEachFunction);
};
jasmine.Suite.prototype.results = function() {
return this.queue.results();
};
jasmine.Suite.prototype.add = function(suiteOrSpec) {
this.children_.push(suiteOrSpec);
if (suiteOrSpec instanceof jasmine.Suite) {
this.suites_.push(suiteOrSpec);
this.env.currentRunner().addSuite(suiteOrSpec);
} else {
this.specs_.push(suiteOrSpec);
}
this.queue.add(suiteOrSpec);
};
jasmine.Suite.prototype.specs = function() {
return this.specs_;
};
jasmine.Suite.prototype.suites = function() {
return this.suites_;
};
jasmine.Suite.prototype.children = function() {
return this.children_;
};
jasmine.Suite.prototype.execute = function(onComplete) {
var self = this;
this.queue.start(function () {
self.finish(onComplete);
});
};
jasmine.WaitsBlock = function(env, timeout, spec) {
this.timeout = timeout;
jasmine.Block.call(this, env, null, spec);
};
jasmine.util.inherit(jasmine.WaitsBlock, jasmine.Block);
jasmine.WaitsBlock.prototype.execute = function (onComplete) {
if (jasmine.VERBOSE) {
this.env.reporter.log('>> Jasmine waiting for ' + this.timeout + ' ms...');
}
this.env.setTimeout(function () {
onComplete();
}, this.timeout);
};
/**
* A block which waits for some condition to become true, with timeout.
*
* @constructor
* @extends jasmine.Block
* @param {jasmine.Env} env The Jasmine environment.
* @param {Number} timeout The maximum time in milliseconds to wait for the condition to become true.
* @param {Function} latchFunction A function which returns true when the desired condition has been met.
* @param {String} message The message to display if the desired condition hasn't been met within the given time period.
* @param {jasmine.Spec} spec The Jasmine spec.
*/
jasmine.WaitsForBlock = function(env, timeout, latchFunction, message, spec) {
this.timeout = timeout || env.defaultTimeoutInterval;
this.latchFunction = latchFunction;
this.message = message;
this.totalTimeSpentWaitingForLatch = 0;
jasmine.Block.call(this, env, null, spec);
};
jasmine.util.inherit(jasmine.WaitsForBlock, jasmine.Block);
jasmine.WaitsForBlock.TIMEOUT_INCREMENT = 10;
jasmine.WaitsForBlock.prototype.execute = function(onComplete) {
if (jasmine.VERBOSE) {
this.env.reporter.log('>> Jasmine waiting for ' + (this.message || 'something to happen'));
}
var latchFunctionResult;
try {
latchFunctionResult = this.latchFunction.apply(this.spec);
} catch (e) {
this.spec.fail(e);
onComplete();
return;
}
if (latchFunctionResult) {
onComplete();
} else if (this.totalTimeSpentWaitingForLatch >= this.timeout) {
var message = 'timed out after ' + this.timeout + ' msec waiting for ' + (this.message || 'something to happen');
this.spec.fail({
name: 'timeout',
message: message
});
this.abort = true;
onComplete();
} else {
this.totalTimeSpentWaitingForLatch += jasmine.WaitsForBlock.TIMEOUT_INCREMENT;
var self = this;
this.env.setTimeout(function() {
self.execute(onComplete);
}, jasmine.WaitsForBlock.TIMEOUT_INCREMENT);
}
};
// Mock setTimeout, clearTimeout
// Contributed by Pivotal Computer Systems, www.pivotalsf.com
jasmine.FakeTimer = function() {
this.reset();
var self = this;
self.setTimeout = function(funcToCall, millis) {
self.timeoutsMade++;
self.scheduleFunction(self.timeoutsMade, funcToCall, millis, false);
return self.timeoutsMade;
};
self.setInterval = function(funcToCall, millis) {
self.timeoutsMade++;
self.scheduleFunction(self.timeoutsMade, funcToCall, millis, true);
return self.timeoutsMade;
};
self.clearTimeout = function(timeoutKey) {
self.scheduledFunctions[timeoutKey] = jasmine.undefined;
};
self.clearInterval = function(timeoutKey) {
self.scheduledFunctions[timeoutKey] = jasmine.undefined;
};
};
jasmine.FakeTimer.prototype.reset = function() {
this.timeoutsMade = 0;
this.scheduledFunctions = {};
this.nowMillis = 0;
};
jasmine.FakeTimer.prototype.tick = function(millis) {
var oldMillis = this.nowMillis;
var newMillis = oldMillis + millis;
this.runFunctionsWithinRange(oldMillis, newMillis);
this.nowMillis = newMillis;
};
jasmine.FakeTimer.prototype.runFunctionsWithinRange = function(oldMillis, nowMillis) {
var scheduledFunc;
var funcsToRun = [];
for (var timeoutKey in this.scheduledFunctions) {
scheduledFunc = this.scheduledFunctions[timeoutKey];
if (scheduledFunc != jasmine.undefined &&
scheduledFunc.runAtMillis >= oldMillis &&
scheduledFunc.runAtMillis <= nowMillis) {
funcsToRun.push(scheduledFunc);
this.scheduledFunctions[timeoutKey] = jasmine.undefined;
}
}
if (funcsToRun.length > 0) {
funcsToRun.sort(function(a, b) {
return a.runAtMillis - b.runAtMillis;
});
for (var i = 0; i < funcsToRun.length; ++i) {
try {
var funcToRun = funcsToRun[i];
this.nowMillis = funcToRun.runAtMillis;
funcToRun.funcToCall();
if (funcToRun.recurring) {
this.scheduleFunction(funcToRun.timeoutKey,
funcToRun.funcToCall,
funcToRun.millis,
true);
}
} catch(e) {
}
}
this.runFunctionsWithinRange(oldMillis, nowMillis);
}
};
jasmine.FakeTimer.prototype.scheduleFunction = function(timeoutKey, funcToCall, millis, recurring) {
this.scheduledFunctions[timeoutKey] = {
runAtMillis: this.nowMillis + millis,
funcToCall: funcToCall,
recurring: recurring,
timeoutKey: timeoutKey,
millis: millis
};
};
/**
* @namespace
*/
jasmine.Clock = {
defaultFakeTimer: new jasmine.FakeTimer(),
reset: function() {
jasmine.Clock.assertInstalled();
jasmine.Clock.defaultFakeTimer.reset();
},
tick: function(millis) {
jasmine.Clock.assertInstalled();
jasmine.Clock.defaultFakeTimer.tick(millis);
},
runFunctionsWithinRange: function(oldMillis, nowMillis) {
jasmine.Clock.defaultFakeTimer.runFunctionsWithinRange(oldMillis, nowMillis);
},
scheduleFunction: function(timeoutKey, funcToCall, millis, recurring) {
jasmine.Clock.defaultFakeTimer.scheduleFunction(timeoutKey, funcToCall, millis, recurring);
},
useMock: function() {
if (!jasmine.Clock.isInstalled()) {
var spec = jasmine.getEnv().currentSpec;
spec.after(jasmine.Clock.uninstallMock);
jasmine.Clock.installMock();
}
},
installMock: function() {
jasmine.Clock.installed = jasmine.Clock.defaultFakeTimer;
},
uninstallMock: function() {
jasmine.Clock.assertInstalled();
jasmine.Clock.installed = jasmine.Clock.real;
},
real: {
setTimeout: jasmine.getGlobal().setTimeout,
clearTimeout: jasmine.getGlobal().clearTimeout,
setInterval: jasmine.getGlobal().setInterval,
clearInterval: jasmine.getGlobal().clearInterval
},
assertInstalled: function() {
if (!jasmine.Clock.isInstalled()) {
throw new Error("Mock clock is not installed, use jasmine.Clock.useMock()");
}
},
isInstalled: function() {
return jasmine.Clock.installed == jasmine.Clock.defaultFakeTimer;
},
installed: null
};
jasmine.Clock.installed = jasmine.Clock.real;
//else for IE support
jasmine.getGlobal().setTimeout = function(funcToCall, millis) {
if (jasmine.Clock.installed.setTimeout.apply) {
return jasmine.Clock.installed.setTimeout.apply(this, arguments);
} else {
return jasmine.Clock.installed.setTimeout(funcToCall, millis);
}
};
jasmine.getGlobal().setInterval = function(funcToCall, millis) {
if (jasmine.Clock.installed.setInterval.apply) {
return jasmine.Clock.installed.setInterval.apply(this, arguments);
} else {
return jasmine.Clock.installed.setInterval(funcToCall, millis);
}
};
jasmine.getGlobal().clearTimeout = function(timeoutKey) {
if (jasmine.Clock.installed.clearTimeout.apply) {
return jasmine.Clock.installed.clearTimeout.apply(this, arguments);
} else {
return jasmine.Clock.installed.clearTimeout(timeoutKey);
}
};
jasmine.getGlobal().clearInterval = function(timeoutKey) {
if (jasmine.Clock.installed.clearTimeout.apply) {
return jasmine.Clock.installed.clearInterval.apply(this, arguments);
} else {
return jasmine.Clock.installed.clearInterval(timeoutKey);
}
};
jasmine.version_= {
"major": 1,
"minor": 1,
"build": 0,
"revision": 1329350614
};
| {
"content_hash": "4329cdf80a6ed3445cab1733776fc26b",
"timestamp": "",
"source": "github",
"line_count": 2528,
"max_line_length": 302,
"avg_line_length": 27.151898734177216,
"alnum_prop": 0.673513986013986,
"repo_name": "mennovanslooten/Scout",
"id": "884c6789dcf0c247dfe7296e474fea30eea78161",
"size": "68640",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "demo_tests/flight/components/flight/test/jasmine/jasmine.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "19726"
},
{
"name": "HTML",
"bytes": "19311"
},
{
"name": "JavaScript",
"bytes": "740458"
},
{
"name": "Shell",
"bytes": "1082"
}
],
"symlink_target": ""
} |
(function (root, factory) {
var deps = ['physicsjs'];
if (typeof exports === 'object') {
// Node.
var mods = deps.map(require);
module.exports = factory.call(root, mods[ 0 ]);
} else if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(deps, function( p ){ return factory.call(root, p); });
} else {
// Browser globals (root is window). Dependency management is up to you.
root.Physics = factory.call(root, root.Physics);
}
}(this, function ( Physics ) {
'use strict';
/**
* A pathetically simple dom renderer
*/
Physics.renderer('dom', function( proto ){
// utility methods
var thePrefix = {}
,tmpdiv = document.createElement("div")
,toTitleCase = function toTitleCase(str) {
return str.replace(/(?:^|\s)\w/g, function(match) {
return match.toUpperCase();
});
}
// return the prefixed name for the specified css property
,pfx = function pfx(prop) {
if (thePrefix[prop]){
return thePrefix[prop];
}
var arrayOfPrefixes = ['Webkit', 'Moz', 'Ms', 'O']
,name
;
for (var i = 0, l = arrayOfPrefixes.length; i < l; ++i) {
name = arrayOfPrefixes[i] + toTitleCase(prop);
if (name in tmpdiv.style){
return thePrefix[prop] = name;
}
}
if (name in tmpdiv.style){
return thePrefix[prop] = prop;
}
return false;
}
;
var classpfx = 'pjs-'
,px = 'px'
,cssTransform = pfx('transform')
;
var newEl = function( node, content ){
var el = document.createElement(node || 'div');
if (content){
el.innerHTML = content;
}
return el;
}
,drawBody
;
// determine which drawBody method we can use
if (cssTransform){
drawBody = function( body, view ){
var pos = body.state.pos;
view.style[cssTransform] = 'translate('+pos.get(0)+'px,'+pos.get(1)+'px) rotate('+body.state.angular.pos+'rad)';
};
} else {
drawBody = function( body, view ){
var pos = body.state.pos;
view.style.left = pos.get(0) + px;
view.style.top = pos.get(1) + px;
};
}
return {
/**
* Initialization
* @param {Object} options Config options passed by initializer
* @return {void}
*/
init: function( options ){
// call proto init
proto.init.call(this, options);
var viewport = this.el;
viewport.style.position = 'relative';
viewport.style.overflow = 'hidden';
viewport.style.width = this.options.width + px;
viewport.style.height = this.options.height + px;
this.els = {};
if (options.meta){
var stats = newEl();
stats.className = 'pjs-meta';
this.els.fps = newEl('span');
this.els.ipf = newEl('span');
stats.appendChild(newEl('span', 'fps: '));
stats.appendChild(this.els.fps);
stats.appendChild(newEl('br'));
stats.appendChild(newEl('span', 'ipf: '));
stats.appendChild(this.els.ipf);
viewport.appendChild(stats);
}
},
/**
* Set dom element style properties for a circle
* @param {HTMLElement} el The element
* @param {Geometry} geometry The bodie's geometry
* @return {void}
*/
circleProperties: function( el, geometry ){
var aabb = geometry.aabb();
el.style.width = (aabb.halfWidth * 2) + px;
el.style.height = (aabb.halfHeight * 2) + px;
el.style.marginLeft = (-aabb.halfWidth) + px;
el.style.marginTop = (-aabb.halfHeight) + px;
},
/**
* Create a dom element for the specified geometry
* @param {Geometry} geometry The bodie's geometry
* @return {HTMLElement} The element
*/
createView: function( geometry ){
var el = newEl()
,fn = geometry.name + 'Properties'
;
el.className = classpfx + geometry.name;
el.style.position = 'absolute';
el.style.top = '0px';
el.style.left = '0px';
if (this[ fn ]){
this[ fn ](el, geometry);
}
this.el.appendChild( el );
return el;
},
/**
* Draw the meta data
* @param {Object} meta The meta data
* @return {void}
*/
drawMeta: function( meta ){
this.els.fps.innerHTML = meta.fps.toFixed(2);
this.els.ipf.innerHTML = meta.ipf;
},
/**
* Update dom element to reflect bodie's current state
* @param {Body} body The body to draw
* @param {HTMLElement} view The view for that body
* @return {void}
*/
drawBody: drawBody
};
});
// end module: renderers/dom.js
return Physics;
})); // UMD | {
"content_hash": "92c8d8eb6b0129a49aad406efd8f3a7f",
"timestamp": "",
"source": "github",
"line_count": 186,
"max_line_length": 128,
"avg_line_length": 33.05913978494624,
"alnum_prop": 0.4334038054968288,
"repo_name": "lejoying/ibrainstroms",
"id": "64db502b74db2d8396c47db63ed58682a6e289c1",
"size": "6386",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "web/PhysicsJS/dist/renderers/dom.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "9326"
},
{
"name": "JavaScript",
"bytes": "1838061"
}
],
"symlink_target": ""
} |
SELECT *
FROM
(SELECT qview1."unique2" AS t0v0, qview1."evenonepercent" AS t1v0, qview1."stringu2" AS t1v1, qview1."stringu1" AS t1v2, qview2."evenonepercent" AS t2v0, qview2."stringu2" AS t2v1, qview2."stringu1"
AS t2v2 FROM
"public"."t21_1m" qview1,
"public"."t22_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview1."evenonepercent" AS t1v0, qview1."stringu2" AS t1v1, qview1."stringu1" AS t1v2, qview2."evenonepercent" AS t2v0, qview2."stringu1" AS t2v1, qview2."string4"
AS t2v2 FROM
"public"."t21_1m" qview1,
"public"."t18_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
qview2."string4" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview1."evenonepercent" AS t1v0, qview1."stringu2" AS t1v1, qview1."stringu1" AS t1v2, qview2."evenonepercent" AS t2v0, qview2."stringu1" AS t2v1, qview2."stringu2"
AS t2v2 FROM
"public"."t21_1m" qview1,
"public"."t14_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview1."evenonepercent" AS t1v0, qview1."stringu2" AS t1v1, qview1."stringu1" AS t1v2, qview2."evenonepercent" AS t2v0, qview2."stringu1" AS t2v1, qview2."stringu2"
AS t2v2 FROM
"public"."t21_1m" qview1,
"public"."t10_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview1."evenonepercent" AS t1v0, qview1."stringu2" AS t1v1, qview1."stringu1" AS t1v2, qview2."evenonepercent" AS t2v0, qview2."stringu1" AS t2v1, qview2."stringu2"
AS t2v2 FROM
"public"."t21_1m" qview1,
"public"."t6_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview1."evenonepercent" AS t1v0, qview1."stringu2" AS t1v1, qview1."stringu1" AS t1v2, qview2."evenonepercent" AS t2v0, qview2."stringu1" AS t2v1, qview2."stringu2"
AS t2v2 FROM
"public"."t21_1m" qview1,
"public"."t2_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview1."evenonepercent" AS t1v0, qview1."stringu1" AS t1v1, qview1."string4" AS t1v2, qview2."evenonepercent" AS t2v0, qview2."stringu2" AS t2v1, qview2."stringu1"
AS t2v2 FROM
"public"."t17_1m" qview1,
"public"."t22_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."string4" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview1."evenonepercent" AS t1v0, qview1."stringu1" AS t1v1, qview1."string4" AS t1v2, qview2."evenonepercent" AS t2v0, qview2."stringu1" AS t2v1, qview2."string4"
AS t2v2 FROM
"public"."t17_1m" qview1,
"public"."t18_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."string4" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
qview2."string4" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview1."evenonepercent" AS t1v0, qview1."stringu1" AS t1v1, qview1."string4" AS t1v2, qview2."evenonepercent" AS t2v0, qview2."stringu1" AS t2v1, qview2."stringu2"
AS t2v2 FROM
"public"."t17_1m" qview1,
"public"."t14_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."string4" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview1."evenonepercent" AS t1v0, qview1."stringu1" AS t1v1, qview1."string4" AS t1v2, qview2."evenonepercent" AS t2v0, qview2."stringu1" AS t2v1, qview2."stringu2"
AS t2v2 FROM
"public"."t17_1m" qview1,
"public"."t10_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."string4" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview1."evenonepercent" AS t1v0, qview1."stringu1" AS t1v1, qview1."string4" AS t1v2, qview2."evenonepercent" AS t2v0, qview2."stringu1" AS t2v1, qview2."stringu2"
AS t2v2 FROM
"public"."t17_1m" qview1,
"public"."t6_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."string4" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview1."evenonepercent" AS t1v0, qview1."stringu1" AS t1v1, qview1."string4" AS t1v2, qview2."evenonepercent" AS t2v0, qview2."stringu1" AS t2v1, qview2."stringu2"
AS t2v2 FROM
"public"."t17_1m" qview1,
"public"."t2_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."string4" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview1."evenonepercent" AS t1v0, qview1."stringu1" AS t1v1, qview1."stringu2" AS t1v2, qview2."evenonepercent" AS t2v0, qview2."stringu2" AS t2v1, qview2."stringu1"
AS t2v2 FROM
"public"."t13_1m" qview1,
"public"."t22_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview1."evenonepercent" AS t1v0, qview1."stringu1" AS t1v1, qview1."stringu2" AS t1v2, qview2."evenonepercent" AS t2v0, qview2."stringu1" AS t2v1, qview2."string4"
AS t2v2 FROM
"public"."t13_1m" qview1,
"public"."t18_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
qview2."string4" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview1."evenonepercent" AS t1v0, qview1."stringu1" AS t1v1, qview1."stringu2" AS t1v2, qview2."evenonepercent" AS t2v0, qview2."stringu1" AS t2v1, qview2."stringu2"
AS t2v2 FROM
"public"."t13_1m" qview1,
"public"."t14_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview1."evenonepercent" AS t1v0, qview1."stringu1" AS t1v1, qview1."stringu2" AS t1v2, qview2."evenonepercent" AS t2v0, qview2."stringu1" AS t2v1, qview2."stringu2"
AS t2v2 FROM
"public"."t13_1m" qview1,
"public"."t10_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview1."evenonepercent" AS t1v0, qview1."stringu1" AS t1v1, qview1."stringu2" AS t1v2, qview2."evenonepercent" AS t2v0, qview2."stringu1" AS t2v1, qview2."stringu2"
AS t2v2 FROM
"public"."t13_1m" qview1,
"public"."t6_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview1."evenonepercent" AS t1v0, qview1."stringu1" AS t1v1, qview1."stringu2" AS t1v2, qview2."evenonepercent" AS t2v0, qview2."stringu1" AS t2v1, qview2."stringu2"
AS t2v2 FROM
"public"."t13_1m" qview1,
"public"."t2_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview1."evenonepercent" AS t1v0, qview1."stringu1" AS t1v1, qview1."stringu2" AS t1v2, qview2."evenonepercent" AS t2v0, qview2."stringu2" AS t2v1, qview2."stringu1"
AS t2v2 FROM
"public"."t9_1m" qview1,
"public"."t22_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview1."evenonepercent" AS t1v0, qview1."stringu1" AS t1v1, qview1."stringu2" AS t1v2, qview2."evenonepercent" AS t2v0, qview2."stringu1" AS t2v1, qview2."string4"
AS t2v2 FROM
"public"."t9_1m" qview1,
"public"."t18_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
qview2."string4" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview1."evenonepercent" AS t1v0, qview1."stringu1" AS t1v1, qview1."stringu2" AS t1v2, qview2."evenonepercent" AS t2v0, qview2."stringu1" AS t2v1, qview2."stringu2"
AS t2v2 FROM
"public"."t9_1m" qview1,
"public"."t14_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview1."evenonepercent" AS t1v0, qview1."stringu1" AS t1v1, qview1."stringu2" AS t1v2, qview2."evenonepercent" AS t2v0, qview2."stringu1" AS t2v1, qview2."stringu2"
AS t2v2 FROM
"public"."t9_1m" qview1,
"public"."t10_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview1."evenonepercent" AS t1v0, qview1."stringu1" AS t1v1, qview1."stringu2" AS t1v2, qview2."evenonepercent" AS t2v0, qview2."stringu1" AS t2v1, qview2."stringu2"
AS t2v2 FROM
"public"."t9_1m" qview1,
"public"."t6_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview1."evenonepercent" AS t1v0, qview1."stringu1" AS t1v1, qview1."stringu2" AS t1v2, qview2."evenonepercent" AS t2v0, qview2."stringu1" AS t2v1, qview2."stringu2"
AS t2v2 FROM
"public"."t9_1m" qview1,
"public"."t2_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview1."evenonepercent" AS t1v0, qview1."stringu1" AS t1v1, qview1."stringu2" AS t1v2, qview2."evenonepercent" AS t2v0, qview2."stringu2" AS t2v1, qview2."stringu1"
AS t2v2 FROM
"public"."t5_1m" qview1,
"public"."t22_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview1."evenonepercent" AS t1v0, qview1."stringu1" AS t1v1, qview1."stringu2" AS t1v2, qview2."evenonepercent" AS t2v0, qview2."stringu1" AS t2v1, qview2."string4"
AS t2v2 FROM
"public"."t5_1m" qview1,
"public"."t18_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
qview2."string4" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview1."evenonepercent" AS t1v0, qview1."stringu1" AS t1v1, qview1."stringu2" AS t1v2, qview2."evenonepercent" AS t2v0, qview2."stringu1" AS t2v1, qview2."stringu2"
AS t2v2 FROM
"public"."t5_1m" qview1,
"public"."t14_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview1."evenonepercent" AS t1v0, qview1."stringu1" AS t1v1, qview1."stringu2" AS t1v2, qview2."evenonepercent" AS t2v0, qview2."stringu1" AS t2v1, qview2."stringu2"
AS t2v2 FROM
"public"."t5_1m" qview1,
"public"."t10_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview1."evenonepercent" AS t1v0, qview1."stringu1" AS t1v1, qview1."stringu2" AS t1v2, qview2."evenonepercent" AS t2v0, qview2."stringu1" AS t2v1, qview2."stringu2"
AS t2v2 FROM
"public"."t5_1m" qview1,
"public"."t6_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview1."evenonepercent" AS t1v0, qview1."stringu1" AS t1v1, qview1."stringu2" AS t1v2, qview2."evenonepercent" AS t2v0, qview2."stringu1" AS t2v1, qview2."stringu2"
AS t2v2 FROM
"public"."t5_1m" qview1,
"public"."t2_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview1."evenonepercent" AS t1v0, qview1."stringu1" AS t1v1, qview1."stringu2" AS t1v2, qview2."evenonepercent" AS t2v0, qview2."stringu2" AS t2v1, qview2."stringu1"
AS t2v2 FROM
"public"."t1_1m" qview1,
"public"."t22_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview1."evenonepercent" AS t1v0, qview1."stringu1" AS t1v1, qview1."stringu2" AS t1v2, qview2."evenonepercent" AS t2v0, qview2."stringu1" AS t2v1, qview2."string4"
AS t2v2 FROM
"public"."t1_1m" qview1,
"public"."t18_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
qview2."string4" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview1."evenonepercent" AS t1v0, qview1."stringu1" AS t1v1, qview1."stringu2" AS t1v2, qview2."evenonepercent" AS t2v0, qview2."stringu1" AS t2v1, qview2."stringu2"
AS t2v2 FROM
"public"."t1_1m" qview1,
"public"."t14_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview1."evenonepercent" AS t1v0, qview1."stringu1" AS t1v1, qview1."stringu2" AS t1v2, qview2."evenonepercent" AS t2v0, qview2."stringu1" AS t2v1, qview2."stringu2"
AS t2v2 FROM
"public"."t1_1m" qview1,
"public"."t10_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview1."evenonepercent" AS t1v0, qview1."stringu1" AS t1v1, qview1."stringu2" AS t1v2, qview2."evenonepercent" AS t2v0, qview2."stringu1" AS t2v1, qview2."stringu2"
AS t2v2 FROM
"public"."t1_1m" qview1,
"public"."t6_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview1."evenonepercent" AS t1v0, qview1."stringu1" AS t1v1, qview1."stringu2" AS t1v2, qview2."evenonepercent" AS t2v0, qview2."stringu1" AS t2v1, qview2."stringu2"
AS t2v2 FROM
"public"."t1_1m" qview1,
"public"."t2_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
) f_1, (SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t3v0, qview2."stringu2" AS t3v1, qview2."stringu1"
AS t3v2 FROM
"public"."t21_1m" qview1,
"public"."t23_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t3v0, qview2."stringu1" AS t3v1, qview2."string4"
AS t3v2 FROM
"public"."t21_1m" qview1,
"public"."t19_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
qview2."string4" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t3v0, qview2."stringu1" AS t3v1, qview2."stringu2"
AS t3v2 FROM
"public"."t21_1m" qview1,
"public"."t15_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t3v0, qview2."stringu1" AS t3v1, qview2."stringu2"
AS t3v2 FROM
"public"."t21_1m" qview1,
"public"."t11_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t3v0, qview2."stringu1" AS t3v1, qview2."stringu2"
AS t3v2 FROM
"public"."t21_1m" qview1,
"public"."t7_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t3v0, qview2."stringu1" AS t3v1, qview2."stringu2"
AS t3v2 FROM
"public"."t21_1m" qview1,
"public"."t3_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t3v0, qview2."stringu2" AS t3v1, qview2."stringu1"
AS t3v2 FROM
"public"."t17_1m" qview1,
"public"."t23_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."string4" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t3v0, qview2."stringu1" AS t3v1, qview2."string4"
AS t3v2 FROM
"public"."t17_1m" qview1,
"public"."t19_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."string4" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
qview2."string4" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t3v0, qview2."stringu1" AS t3v1, qview2."stringu2"
AS t3v2 FROM
"public"."t17_1m" qview1,
"public"."t15_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."string4" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t3v0, qview2."stringu1" AS t3v1, qview2."stringu2"
AS t3v2 FROM
"public"."t17_1m" qview1,
"public"."t11_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."string4" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t3v0, qview2."stringu1" AS t3v1, qview2."stringu2"
AS t3v2 FROM
"public"."t17_1m" qview1,
"public"."t7_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."string4" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t3v0, qview2."stringu1" AS t3v1, qview2."stringu2"
AS t3v2 FROM
"public"."t17_1m" qview1,
"public"."t3_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."string4" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t3v0, qview2."stringu2" AS t3v1, qview2."stringu1"
AS t3v2 FROM
"public"."t13_1m" qview1,
"public"."t23_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t3v0, qview2."stringu1" AS t3v1, qview2."string4"
AS t3v2 FROM
"public"."t13_1m" qview1,
"public"."t19_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
qview2."string4" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t3v0, qview2."stringu1" AS t3v1, qview2."stringu2"
AS t3v2 FROM
"public"."t13_1m" qview1,
"public"."t15_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t3v0, qview2."stringu1" AS t3v1, qview2."stringu2"
AS t3v2 FROM
"public"."t13_1m" qview1,
"public"."t11_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t3v0, qview2."stringu1" AS t3v1, qview2."stringu2"
AS t3v2 FROM
"public"."t13_1m" qview1,
"public"."t7_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t3v0, qview2."stringu1" AS t3v1, qview2."stringu2"
AS t3v2 FROM
"public"."t13_1m" qview1,
"public"."t3_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t3v0, qview2."stringu2" AS t3v1, qview2."stringu1"
AS t3v2 FROM
"public"."t9_1m" qview1,
"public"."t23_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t3v0, qview2."stringu1" AS t3v1, qview2."string4"
AS t3v2 FROM
"public"."t9_1m" qview1,
"public"."t19_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
qview2."string4" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t3v0, qview2."stringu1" AS t3v1, qview2."stringu2"
AS t3v2 FROM
"public"."t9_1m" qview1,
"public"."t15_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t3v0, qview2."stringu1" AS t3v1, qview2."stringu2"
AS t3v2 FROM
"public"."t9_1m" qview1,
"public"."t11_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t3v0, qview2."stringu1" AS t3v1, qview2."stringu2"
AS t3v2 FROM
"public"."t9_1m" qview1,
"public"."t7_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t3v0, qview2."stringu1" AS t3v1, qview2."stringu2"
AS t3v2 FROM
"public"."t9_1m" qview1,
"public"."t3_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t3v0, qview2."stringu2" AS t3v1, qview2."stringu1"
AS t3v2 FROM
"public"."t5_1m" qview1,
"public"."t23_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t3v0, qview2."stringu1" AS t3v1, qview2."string4"
AS t3v2 FROM
"public"."t5_1m" qview1,
"public"."t19_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
qview2."string4" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t3v0, qview2."stringu1" AS t3v1, qview2."stringu2"
AS t3v2 FROM
"public"."t5_1m" qview1,
"public"."t15_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t3v0, qview2."stringu1" AS t3v1, qview2."stringu2"
AS t3v2 FROM
"public"."t5_1m" qview1,
"public"."t11_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t3v0, qview2."stringu1" AS t3v1, qview2."stringu2"
AS t3v2 FROM
"public"."t5_1m" qview1,
"public"."t7_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t3v0, qview2."stringu1" AS t3v1, qview2."stringu2"
AS t3v2 FROM
"public"."t5_1m" qview1,
"public"."t3_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t3v0, qview2."stringu2" AS t3v1, qview2."stringu1"
AS t3v2 FROM
"public"."t1_1m" qview1,
"public"."t23_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t3v0, qview2."stringu1" AS t3v1, qview2."string4"
AS t3v2 FROM
"public"."t1_1m" qview1,
"public"."t19_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
qview2."string4" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t3v0, qview2."stringu1" AS t3v1, qview2."stringu2"
AS t3v2 FROM
"public"."t1_1m" qview1,
"public"."t15_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t3v0, qview2."stringu1" AS t3v1, qview2."stringu2"
AS t3v2 FROM
"public"."t1_1m" qview1,
"public"."t11_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t3v0, qview2."stringu1" AS t3v1, qview2."stringu2"
AS t3v2 FROM
"public"."t1_1m" qview1,
"public"."t7_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t3v0, qview2."stringu1" AS t3v1, qview2."stringu2"
AS t3v2 FROM
"public"."t1_1m" qview1,
"public"."t3_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
) f_2, (SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t4v0, qview2."stringu2" AS t4v1, qview2."stringu1"
AS t4v2 FROM
"public"."t21_1m" qview1,
"public"."t24_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t4v0, qview2."stringu1" AS t4v1, qview2."string4"
AS t4v2 FROM
"public"."t21_1m" qview1,
"public"."t20_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
qview2."string4" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t4v0, qview2."stringu1" AS t4v1, qview2."stringu2"
AS t4v2 FROM
"public"."t21_1m" qview1,
"public"."t16_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t4v0, qview2."stringu1" AS t4v1, qview2."stringu2"
AS t4v2 FROM
"public"."t21_1m" qview1,
"public"."t12_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t4v0, qview2."stringu1" AS t4v1, qview2."stringu2"
AS t4v2 FROM
"public"."t21_1m" qview1,
"public"."t8_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t4v0, qview2."stringu1" AS t4v1, qview2."stringu2"
AS t4v2 FROM
"public"."t21_1m" qview1,
"public"."t4_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t4v0, qview2."stringu2" AS t4v1, qview2."stringu1"
AS t4v2 FROM
"public"."t17_1m" qview1,
"public"."t24_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."string4" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t4v0, qview2."stringu1" AS t4v1, qview2."string4"
AS t4v2 FROM
"public"."t17_1m" qview1,
"public"."t20_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."string4" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
qview2."string4" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t4v0, qview2."stringu1" AS t4v1, qview2."stringu2"
AS t4v2 FROM
"public"."t17_1m" qview1,
"public"."t16_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."string4" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t4v0, qview2."stringu1" AS t4v1, qview2."stringu2"
AS t4v2 FROM
"public"."t17_1m" qview1,
"public"."t12_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."string4" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t4v0, qview2."stringu1" AS t4v1, qview2."stringu2"
AS t4v2 FROM
"public"."t17_1m" qview1,
"public"."t8_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."string4" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t4v0, qview2."stringu1" AS t4v1, qview2."stringu2"
AS t4v2 FROM
"public"."t17_1m" qview1,
"public"."t4_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."string4" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t4v0, qview2."stringu2" AS t4v1, qview2."stringu1"
AS t4v2 FROM
"public"."t13_1m" qview1,
"public"."t24_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t4v0, qview2."stringu1" AS t4v1, qview2."string4"
AS t4v2 FROM
"public"."t13_1m" qview1,
"public"."t20_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
qview2."string4" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t4v0, qview2."stringu1" AS t4v1, qview2."stringu2"
AS t4v2 FROM
"public"."t13_1m" qview1,
"public"."t16_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t4v0, qview2."stringu1" AS t4v1, qview2."stringu2"
AS t4v2 FROM
"public"."t13_1m" qview1,
"public"."t12_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t4v0, qview2."stringu1" AS t4v1, qview2."stringu2"
AS t4v2 FROM
"public"."t13_1m" qview1,
"public"."t8_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t4v0, qview2."stringu1" AS t4v1, qview2."stringu2"
AS t4v2 FROM
"public"."t13_1m" qview1,
"public"."t4_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t4v0, qview2."stringu2" AS t4v1, qview2."stringu1"
AS t4v2 FROM
"public"."t9_1m" qview1,
"public"."t24_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t4v0, qview2."stringu1" AS t4v1, qview2."string4"
AS t4v2 FROM
"public"."t9_1m" qview1,
"public"."t20_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
qview2."string4" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t4v0, qview2."stringu1" AS t4v1, qview2."stringu2"
AS t4v2 FROM
"public"."t9_1m" qview1,
"public"."t16_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t4v0, qview2."stringu1" AS t4v1, qview2."stringu2"
AS t4v2 FROM
"public"."t9_1m" qview1,
"public"."t12_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t4v0, qview2."stringu1" AS t4v1, qview2."stringu2"
AS t4v2 FROM
"public"."t9_1m" qview1,
"public"."t8_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t4v0, qview2."stringu1" AS t4v1, qview2."stringu2"
AS t4v2 FROM
"public"."t9_1m" qview1,
"public"."t4_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t4v0, qview2."stringu2" AS t4v1, qview2."stringu1"
AS t4v2 FROM
"public"."t5_1m" qview1,
"public"."t24_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t4v0, qview2."stringu1" AS t4v1, qview2."string4"
AS t4v2 FROM
"public"."t5_1m" qview1,
"public"."t20_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
qview2."string4" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t4v0, qview2."stringu1" AS t4v1, qview2."stringu2"
AS t4v2 FROM
"public"."t5_1m" qview1,
"public"."t16_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t4v0, qview2."stringu1" AS t4v1, qview2."stringu2"
AS t4v2 FROM
"public"."t5_1m" qview1,
"public"."t12_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t4v0, qview2."stringu1" AS t4v1, qview2."stringu2"
AS t4v2 FROM
"public"."t5_1m" qview1,
"public"."t8_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t4v0, qview2."stringu1" AS t4v1, qview2."stringu2"
AS t4v2 FROM
"public"."t5_1m" qview1,
"public"."t4_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t4v0, qview2."stringu2" AS t4v1, qview2."stringu1"
AS t4v2 FROM
"public"."t1_1m" qview1,
"public"."t24_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t4v0, qview2."stringu1" AS t4v1, qview2."string4"
AS t4v2 FROM
"public"."t1_1m" qview1,
"public"."t20_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
qview2."string4" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t4v0, qview2."stringu1" AS t4v1, qview2."stringu2"
AS t4v2 FROM
"public"."t1_1m" qview1,
"public"."t16_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t4v0, qview2."stringu1" AS t4v1, qview2."stringu2"
AS t4v2 FROM
"public"."t1_1m" qview1,
"public"."t12_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t4v0, qview2."stringu1" AS t4v1, qview2."stringu2"
AS t4v2 FROM
"public"."t1_1m" qview1,
"public"."t8_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2" AS t0v0, qview2."evenonepercent" AS t4v0, qview2."stringu1" AS t4v1, qview2."stringu2"
AS t4v2 FROM
"public"."t1_1m" qview1,
"public"."t4_1m" qview2
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 15) AND (qview2."onepercent" < 35)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL
) f_3 WHERE f_1.t0v0=f_2.t0v0 AND f_1.t0v0=f_3.t0v0
| {
"content_hash": "fa2f3ae86c8ed153766baaec336a91eb",
"timestamp": "",
"source": "github",
"line_count": 1833,
"max_line_length": 204,
"avg_line_length": 37.48390616475723,
"alnum_prop": 0.7260726552948711,
"repo_name": "ontop/ontop-examples",
"id": "a8017dc9084d75f9de5dd3cdf058b050c9e978e0",
"size": "68708",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "iswc-2017-cost/wisconsin-experiment/4-atoms/jucq/executed-queries/ontop-19.sql",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "AMPL",
"bytes": "45155"
},
{
"name": "C",
"bytes": "36579"
},
{
"name": "C++",
"bytes": "33985"
},
{
"name": "CSS",
"bytes": "19257"
},
{
"name": "Dockerfile",
"bytes": "3259"
},
{
"name": "HTML",
"bytes": "3413161"
},
{
"name": "HiveQL",
"bytes": "45997"
},
{
"name": "Java",
"bytes": "31232"
},
{
"name": "JavaScript",
"bytes": "26337"
},
{
"name": "Makefile",
"bytes": "2017"
},
{
"name": "PHP",
"bytes": "8056"
},
{
"name": "PLpgSQL",
"bytes": "540592"
},
{
"name": "Python",
"bytes": "5272"
},
{
"name": "R",
"bytes": "722"
},
{
"name": "Roff",
"bytes": "61"
},
{
"name": "Scala",
"bytes": "348559"
},
{
"name": "Shell",
"bytes": "7064"
},
{
"name": "TeX",
"bytes": "229961"
},
{
"name": "q",
"bytes": "362407"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<section name="Workbench">
<section name="ExternalProjectImportWizard">
<item value="false" key="WizardProjectsImportPage.STORE_NESTED_PROJECTS"/>
<item value="false" key="WizardProjectsImportPage.STORE_COPY_PROJECT_ID"/>
<item value="false" key="WizardProjectsImportPage.STORE_ARCHIVE_SELECTED"/>
<list key="WizardProjectsImportPage.STORE_DIRECTORIES">
<item value="C:\Users\Ben\workspace\TuringGame"/>
</list>
<list key="WizardProjectsImportPage.STORE_ARCHIVES">
<item value=""/>
</list>
</section>
</section>
| {
"content_hash": "131f5448f139ee46e3881a6dbaf61343",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 77,
"avg_line_length": 40.92857142857143,
"alnum_prop": 0.7347294938917975,
"repo_name": "nebeel0/TuringGame",
"id": "907936470af3e544af60934e72cfdb3058218183",
"size": "573",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": ".metadata/.plugins/org.eclipse.ui.ide/dialog_settings.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "403162"
},
{
"name": "HTML",
"bytes": "60994"
},
{
"name": "JavaScript",
"bytes": "9781"
}
],
"symlink_target": ""
} |
'use strict';
var OBJECT_SYMBOL = '[object Object]';
module.exports = function (target) {
return Object.prototype.toString.call(target) === OBJECT_SYMBOL;
}; | {
"content_hash": "6f9521dde789f4ba10e2957b0db09c13",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 66,
"avg_line_length": 26.666666666666668,
"alnum_prop": 0.7125,
"repo_name": "nicholascloud/vette",
"id": "4be3f7656f1373d24577c5ebf373d756a78d164d",
"size": "160",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/is-object.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "154801"
},
{
"name": "Shell",
"bytes": "31"
}
],
"symlink_target": ""
} |
import numpy as np
import pandas as pd
import datetime
from tools import TreeLeaf, TreeNode
# Module to categorise values into:
# 1. Not missing
# 2. Missing, due to PACKAGE LOSS
# 3. Missing, due to NOT WEARING THE DEVICE
# 4. Missing, due to NOT CHARGING THE DEVICE
# Note: the decision tree is specific to the data collected during the SleepSight pilot study
# DT
# If all intra FB values are missing: either not worn
# If battery =<= 1 not charged
# If phone sensors + (non intra) wearables missing for more than 6 minutes = package loss
class MissingnessDT:
def __init__(self, passiveData, activeDataSymptom, activeDataSleep, startDate):
self.passive = passiveData
self.activeSymptom = activeDataSymptom
self.activeSleep = activeDataSleep
self.startDate = datetime.datetime.strptime(startDate, '%d/%m/%Y')
def constructDecisionTree(self):
def evalBattery(data):
batteryEvalStart = data[['timestamp', 'battery']].values[0]
batteryEvalEnd = data[['timestamp', 'battery']].values[4]
if batteryEvalStart[1] in '-' or float(batteryEvalStart[1]) > 1:
return (False, data)
else:
dateStart = datetime.datetime.strptime(batteryEvalStart[0], '%Y-%m-%d %H:%M')
dateEnd = datetime.datetime.strptime(batteryEvalEnd[0], '%Y-%m-%d %H:%M')
elapsedTime = dateEnd - dateStart
elapsedMin = elapsedTime.total_seconds() / 60
return (True, batteryEvalStart[0])
def evalHeartRate(data):
heartEval = data[['timestamp', 'heart_Minutes']].values
if heartEval[0][1] not in '-':
return (False, data)
else:
hasNotValue = True
for i in range(1, len(heartEval)):
if heartEval[i][1] not in '-':
hasNotValue = False
if not hasNotValue:
break
return (hasNotValue, heartEval[0][0])
def evalTransmissionFailure(data):
tfTime = data['timestamp'].values
tfEval = data[['steps', 'light', 'FAM', 'LAM', 'VAM', 'awake_count']].values
tfEvalFlat = [val for sublist in tfEval for val in sublist]
hasNotValue = True
for i in range(0, len(tfEvalFlat)):
if tfEvalFlat[i] not in '-':
hasNotValue = False
if not hasNotValue:
break
return (hasNotValue, tfTime[0])
def finaLeafPass(data):
time = data.values[0][0]
return (True, time)
def channelThrough(d):
return (True, d)
def simFailure(d):
return (False, d)
leaf0 = TreeLeaf(name='Not Charged', evalMethod=evalBattery)
leaf1 = TreeLeaf(name='Not Worn', evalMethod=evalHeartRate)
leaf2 = TreeLeaf(name='Transmission Failure', evalMethod=evalTransmissionFailure)
leaf3 = TreeLeaf(name='No Missingness', evalMethod=finaLeafPass)
node2 = TreeNode(name='Leaf2<>Leaf3', children=[leaf2, leaf3], evalMethod=channelThrough)
node1 = TreeNode(name='Leaf1<>Node2', children=[leaf1, node2], evalMethod=channelThrough)
self.root = TreeNode(name='Root[Leaf0<>Node1]', children=[leaf0, node1], evalMethod=channelThrough)
def run(self):
for i in range(self.passive.index[0], self.passive.index[round(len(self.passive.index)-10)]):
self.root.invoke(self.passive.loc[i:(i+10)])
self.result = self.root.retrieveLeaves()
def formatMissingness(self):
self.missingness = {'count':dict(), 'daily':dict()}
for category in self.result:
self.missingness['count'][category.name] = len(category.result)
self.missingness['daily'][category.name] = self.countDailyTreeLeaf(category)
self.missingness['count']['symptom'] = len(self.activeSymptom['datetime'].values)
self.missingness['daily']['symptom'] = self.countDailyActive(self.activeSymptom['datetime'].values)
self.missingness['count']['sleep'] = len(self.activeSleep['datetime'].values)
self.missingness['daily']['sleep'] = self.countDailyActive(self.activeSleep['datetime'].values)
print(self.missingness)
def countDailyTreeLeaf(self, category):
idxEnd = len(self.passive['timestamp'].values)-1
dayEnd = datetime.datetime.strptime(self.passive['timestamp'].values[idxEnd], '%Y-%m-%d %H:%M')
dayStart = datetime.datetime.strptime(self.passive['timestamp'].values[0], '%Y-%m-%d %H:%M')
delta = dayEnd - dayStart
dailyCount = [0]*delta.days
if len(category.result) > 0:
evalDay = datetime.datetime.strptime(category.result[0], '%Y-%m-%d %H:%M')
dayIdx = 0
for dateTime in category.result:
currentDay = datetime.datetime.strptime(dateTime, '%Y-%m-%d %H:%M')
if evalDay.date() == currentDay.date():
dailyCount[dayIdx] += 1
else:
evalDay = currentDay
dayIdx +=1
if dayIdx < len(dailyCount):
dailyCount[dayIdx] += 1
else:
break
return dailyCount
def countDailyActive(self, dates):
dates = self.activeSymptom['datetime'].values
dailyCount = [0]*56
dayIdx = 0
evalDay = self.startDate
for dateTime in dates:
currentDay = datetime.datetime.strptime(dateTime, '%Y-%m-%d %H:%M')
if evalDay.date() == currentDay.date():
dailyCount[dayIdx] += 1
else:
evalDay = currentDay
dayIdx += 1
if dayIdx < len(dailyCount):
dailyCount[dayIdx] += 1
else:
break
return dailyCount
def __str__(self):
rendered = '\nMissingness Summary (Count)\n'
for key in self.missingness['count'].keys():
rendered += '{}: {}\n'.format(str.capitalize(key), self.missingness['count'][key])
return rendered | {
"content_hash": "eace41b20476f8f86a3cefdbbd59b964",
"timestamp": "",
"source": "github",
"line_count": 145,
"max_line_length": 107,
"avg_line_length": 43.12413793103448,
"alnum_prop": 0.581001119462658,
"repo_name": "KHP-Informatics/sleepsight-analytics",
"id": "854bcb46d9607b7cab7550fc18e25510f5c7c764",
"size": "6269",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "analysis/missingness.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Python",
"bytes": "156054"
}
],
"symlink_target": ""
} |
package org.elasticsearch.ingest;
import org.elasticsearch.ElasticsearchParseException;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.common.bytes.BytesReference;
import org.elasticsearch.node.NodeService;
import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.test.ESIntegTestCase;
import org.elasticsearch.xcontent.XContentType;
import java.io.IOException;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.notNullValue;
@ESIntegTestCase.ClusterScope(numDataNodes = 0, numClientNodes = 0, scope = ESIntegTestCase.Scope.TEST)
public class IngestProcessorNotInstalledOnAllNodesIT extends ESIntegTestCase {
private final BytesReference pipelineSource;
private volatile boolean installPlugin;
public IngestProcessorNotInstalledOnAllNodesIT() throws IOException {
pipelineSource = BytesReference.bytes(
jsonBuilder().startObject()
.startArray("processors")
.startObject()
.startObject("test")
.endObject()
.endObject()
.endArray()
.endObject()
);
}
@Override
protected Collection<Class<? extends Plugin>> nodePlugins() {
return installPlugin ? Arrays.asList(IngestTestPlugin.class) : Collections.emptyList();
}
public void testFailPipelineCreation() throws Exception {
installPlugin = true;
String node1 = internalCluster().startNode();
installPlugin = false;
String node2 = internalCluster().startNode();
ensureStableCluster(2, node1);
ensureStableCluster(2, node2);
try {
client().admin().cluster().preparePutPipeline("_id", pipelineSource, XContentType.JSON).get();
fail("exception expected");
} catch (ElasticsearchParseException e) {
assertThat(e.getMessage(), containsString("Processor type [test] is not installed on node"));
}
}
public void testFailPipelineCreationProcessorNotInstalledOnMasterNode() throws Exception {
internalCluster().startNode();
installPlugin = true;
internalCluster().startNode();
try {
client().admin().cluster().preparePutPipeline("_id", pipelineSource, XContentType.JSON).get();
fail("exception expected");
} catch (ElasticsearchParseException e) {
assertThat(e.getMessage(), equalTo("No processor type exists with name [test]"));
}
}
// If there is pipeline defined and a node joins that doesn't have the processor installed then
// that pipeline can't be used on this node.
public void testFailStartNode() throws Exception {
installPlugin = true;
String node1 = internalCluster().startNode();
AcknowledgedResponse response = client().admin().cluster().preparePutPipeline("_id", pipelineSource, XContentType.JSON).get();
assertThat(response.isAcknowledged(), is(true));
Pipeline pipeline = internalCluster().getInstance(NodeService.class, node1).getIngestService().getPipeline("_id");
assertThat(pipeline, notNullValue());
installPlugin = false;
String node2 = internalCluster().startNode();
pipeline = internalCluster().getInstance(NodeService.class, node2).getIngestService().getPipeline("_id");
assertNotNull(pipeline);
assertThat(pipeline.getId(), equalTo("_id"));
assertThat(
pipeline.getDescription(),
equalTo("this is a place holder pipeline, " + "because pipeline with id [_id] could not be loaded")
);
}
}
| {
"content_hash": "2246bd5c030ac9d6810f18098b1bba4a",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 134,
"avg_line_length": 39.29,
"alnum_prop": 0.6887248663782133,
"repo_name": "GlenRSmith/elasticsearch",
"id": "0d178e09a37107a2872f6395b04cf0b08d2b8e9f",
"size": "4282",
"binary": false,
"copies": "22",
"ref": "refs/heads/master",
"path": "server/src/internalClusterTest/java/org/elasticsearch/ingest/IngestProcessorNotInstalledOnAllNodesIT.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "11082"
},
{
"name": "Batchfile",
"bytes": "11057"
},
{
"name": "Emacs Lisp",
"bytes": "3341"
},
{
"name": "FreeMarker",
"bytes": "45"
},
{
"name": "Groovy",
"bytes": "337461"
},
{
"name": "HTML",
"bytes": "2186"
},
{
"name": "Java",
"bytes": "43224931"
},
{
"name": "Perl",
"bytes": "11756"
},
{
"name": "Python",
"bytes": "19852"
},
{
"name": "Shell",
"bytes": "99571"
}
],
"symlink_target": ""
} |
LauncherItemController::LauncherItemController(
Type type,
const std::string& app_id,
ChromeLauncherController* launcher_controller)
: type_(type),
app_id_(app_id),
shelf_id_(0),
launcher_controller_(launcher_controller),
locked_(0),
image_set_by_controller_(false) {}
LauncherItemController::~LauncherItemController() {}
ash::ShelfItemType LauncherItemController::GetShelfItemType() const {
if (extension_misc::IsImeMenuExtensionId(app_id_))
return ash::TYPE_IME_MENU;
switch (type_) {
case LauncherItemController::TYPE_SHORTCUT:
case LauncherItemController::TYPE_WINDOWED_APP:
return ash::TYPE_APP_SHORTCUT;
case LauncherItemController::TYPE_APP:
return ash::TYPE_PLATFORM_APP;
case LauncherItemController::TYPE_APP_PANEL:
return ash::TYPE_APP_PANEL;
}
NOTREACHED();
return ash::TYPE_APP_SHORTCUT;
}
| {
"content_hash": "4c5c0872e32d48c850f7e75d63685971",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 69,
"avg_line_length": 31,
"alnum_prop": 0.7041156840934372,
"repo_name": "axinging/chromium-crosswalk",
"id": "e6f47426d54cac5cd54d153982a6f847e70204cc",
"size": "1269",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "chrome/browser/ui/ash/launcher/launcher_item_controller.cc",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "ApacheConf",
"bytes": "8242"
},
{
"name": "AppleScript",
"bytes": "6973"
},
{
"name": "Arduino",
"bytes": "464"
},
{
"name": "Assembly",
"bytes": "23945"
},
{
"name": "C",
"bytes": "4103204"
},
{
"name": "C++",
"bytes": "225022948"
},
{
"name": "CSS",
"bytes": "949808"
},
{
"name": "Dart",
"bytes": "74976"
},
{
"name": "Go",
"bytes": "18155"
},
{
"name": "HTML",
"bytes": "28206993"
},
{
"name": "Java",
"bytes": "7651204"
},
{
"name": "JavaScript",
"bytes": "18831169"
},
{
"name": "Makefile",
"bytes": "96270"
},
{
"name": "Objective-C",
"bytes": "1228122"
},
{
"name": "Objective-C++",
"bytes": "7563676"
},
{
"name": "PHP",
"bytes": "97817"
},
{
"name": "Perl",
"bytes": "63937"
},
{
"name": "Protocol Buffer",
"bytes": "418221"
},
{
"name": "Python",
"bytes": "7855597"
},
{
"name": "Shell",
"bytes": "472586"
},
{
"name": "Standard ML",
"bytes": "4965"
},
{
"name": "XSLT",
"bytes": "418"
},
{
"name": "nesC",
"bytes": "18335"
}
],
"symlink_target": ""
} |
//*******************************************************************************************//
// //
// Download Free Evaluation Version From: https://bytescout.com/download/web-installer //
// //
// Also available as Web API! Get Your Free API Key: https://app.pdf.co/signup //
// //
// Copyright © 2017-2020 ByteScout, Inc. All rights reserved. //
// https://www.bytescout.com //
// https://pdf.co //
// //
//*******************************************************************************************//
package com.company;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import okhttp3.*;
import java.io.*;
import java.net.*;
public class Main
{
// The authentication key (API Key).
// Get your own by registering at https://app.pdf.co
final static String API_KEY = "***********************************";
// Direct URL of source file to search barcodes in.
// You can also upload your own file into PDF.co and use it as url. Check "Upload File" samples for code snippets: https://github.com/bytescout/pdf-co-api-samples/tree/master/File%20Upload/
final static String SourceFileURL = "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/encryption/barcode_encrypted_aes128.png";
// Comma-separated list of barcode types to search.
// See valid barcode types in the documentation https://apidocs.pdf.co
final static String BarcodeTypes = "QRCode";
// Refer to documentations for more info. https://apidocs.pdf.co/32-1-user-controlled-data-encryption-and-decryption
final static String Profiles = "{ 'DataDecryptionAlgorithm': 'AES128', 'DataDecryptionKey': 'Qweasd1234567890', 'DataDecryptionIV': '0mDI&qLv*ivTCd$*' }";
public static void main(String[] args) throws IOException
{
// Create HTTP client instance
OkHttpClient webClient = new OkHttpClient();
// Prepare URL for `Barcode Reader` API call
String query = "https://api.pdf.co/v1/barcode/read/from/url";
// Make correctly escaped (encoded) URL
URL url = null;
try
{
url = new URI(null, query, null).toURL();
}
catch (URISyntaxException e)
{
e.printStackTrace();
}
// Create JSON payload
String jsonPayload = String.format("{\"types\": \"%s\", \"profiles\": \"%s\", \"url\": \"%s\"}",
BarcodeTypes,
Profiles,
SourceFileURL);
// Prepare request body
RequestBody body = RequestBody.create(MediaType.parse("application/json"), jsonPayload);
// Prepare request
Request request = new Request.Builder()
.url(url)
.addHeader("x-api-key", API_KEY) // (!) Set API Key
.addHeader("Content-Type", "application/json")
.post(body)
.build();
// Execute request
Response response = webClient.newCall(request).execute();
if (response.code() == 200)
{
// Parse JSON response
JsonObject json = new JsonParser().parse(response.body().string()).getAsJsonObject();
boolean error = json.get("error").getAsBoolean();
if (!error)
{
// Display found barcodes in console
for (JsonElement element : json.get("barcodes").getAsJsonArray())
{
JsonObject barcode = (JsonObject) element;
System.out.println("Found barcode:");
System.out.println(" Type: " + barcode.get("TypeName").getAsString());
System.out.println(" Value: " + barcode.get("Value").getAsString());
System.out.println(" Document Page Index: " + barcode.get("Page").getAsString());
System.out.println(" Rectangle: " + barcode.get("Rect").getAsString());
System.out.println(" Confidence: " + barcode.get("Confidence").getAsString());
System.out.println();
}
}
else
{
// Display service reported error
System.out.println(json.get("message").getAsString());
}
}
else
{
// Display request error
System.out.println(response.code() + " " + response.message());
}
}
}
| {
"content_hash": "be170aab1da772db591e9d1898f72001",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 197,
"avg_line_length": 44.60526315789474,
"alnum_prop": 0.4849557522123894,
"repo_name": "bytescout/ByteScout-SDK-SourceCode",
"id": "4b3f25ca4dd7ff051e3a2d383a2cb4bc21898f4d",
"size": "5086",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "PDF.co Web API/Barcode Reader API/Java/Read Barcode From Encrypted URL/src/com/company/Main.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ASP.NET",
"bytes": "364116"
},
{
"name": "Apex",
"bytes": "243500"
},
{
"name": "Batchfile",
"bytes": "151832"
},
{
"name": "C",
"bytes": "224568"
},
{
"name": "C#",
"bytes": "12909855"
},
{
"name": "C++",
"bytes": "440474"
},
{
"name": "CSS",
"bytes": "56817"
},
{
"name": "Classic ASP",
"bytes": "46655"
},
{
"name": "Dockerfile",
"bytes": "776"
},
{
"name": "Gherkin",
"bytes": "3386"
},
{
"name": "HTML",
"bytes": "17276296"
},
{
"name": "Java",
"bytes": "1483408"
},
{
"name": "JavaScript",
"bytes": "3033610"
},
{
"name": "PHP",
"bytes": "838746"
},
{
"name": "Pascal",
"bytes": "398090"
},
{
"name": "PowerShell",
"bytes": "715204"
},
{
"name": "Python",
"bytes": "703542"
},
{
"name": "QMake",
"bytes": "880"
},
{
"name": "TSQL",
"bytes": "3080"
},
{
"name": "VBA",
"bytes": "383773"
},
{
"name": "VBScript",
"bytes": "1504410"
},
{
"name": "Visual Basic .NET",
"bytes": "9489450"
}
],
"symlink_target": ""
} |
#include "MemLibInternals.h"
/**
Copies a source GUID to a destination GUID.
This function copies the contents of the 128-bit GUID specified by SourceGuid to
DestinationGuid, and returns DestinationGuid.
If DestinationGuid is NULL, then ASSERT().
If SourceGuid is NULL, then ASSERT().
@param DestinationGuid A pointer to the destination GUID.
@param SourceGuid A pointer to the source GUID.
@return DestinationGuid.
**/
GUID *
EFIAPI
CopyGuid (
OUT GUID *DestinationGuid,
IN CONST GUID *SourceGuid
)
{
WriteUnaligned64 (
(UINT64*)DestinationGuid,
ReadUnaligned64 ((CONST UINT64*)SourceGuid)
);
WriteUnaligned64 (
(UINT64*)DestinationGuid + 1,
ReadUnaligned64 ((CONST UINT64*)SourceGuid + 1)
);
return DestinationGuid;
}
/**
Compares two GUIDs.
This function compares Guid1 to Guid2. If the GUIDs are identical then TRUE is returned.
If there are any bit differences in the two GUIDs, then FALSE is returned.
If Guid1 is NULL, then ASSERT().
If Guid2 is NULL, then ASSERT().
@param Guid1 A pointer to a 128 bit GUID.
@param Guid2 A pointer to a 128 bit GUID.
@retval TRUE Guid1 and Guid2 are identical.
@retval FALSE Guid1 and Guid2 are not identical.
**/
BOOLEAN
EFIAPI
CompareGuid (
IN CONST GUID *Guid1,
IN CONST GUID *Guid2
)
{
UINT64 LowPartOfGuid1;
UINT64 LowPartOfGuid2;
UINT64 HighPartOfGuid1;
UINT64 HighPartOfGuid2;
LowPartOfGuid1 = ReadUnaligned64 ((CONST UINT64*) Guid1);
LowPartOfGuid2 = ReadUnaligned64 ((CONST UINT64*) Guid2);
HighPartOfGuid1 = ReadUnaligned64 ((CONST UINT64*) Guid1 + 1);
HighPartOfGuid2 = ReadUnaligned64 ((CONST UINT64*) Guid2 + 1);
return (BOOLEAN) (LowPartOfGuid1 == LowPartOfGuid2 && HighPartOfGuid1 == HighPartOfGuid2);
}
/**
Scans a target buffer for a GUID, and returns a pointer to the matching GUID
in the target buffer.
This function searches the target buffer specified by Buffer and Length from
the lowest address to the highest address at 128-bit increments for the 128-bit
GUID value that matches Guid. If a match is found, then a pointer to the matching
GUID in the target buffer is returned. If no match is found, then NULL is returned.
If Length is 0, then NULL is returned.
If Length > 0 and Buffer is NULL, then ASSERT().
If Buffer is not aligned on a 32-bit boundary, then ASSERT().
If Length is not aligned on a 128-bit boundary, then ASSERT().
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
@param Buffer The pointer to the target buffer to scan.
@param Length The number of bytes in Buffer to scan.
@param Guid The value to search for in the target buffer.
@return A pointer to the matching Guid in the target buffer or NULL otherwise.
**/
VOID *
EFIAPI
ScanGuid (
IN CONST VOID *Buffer,
IN UINTN Length,
IN CONST GUID *Guid
)
{
CONST GUID *GuidPtr;
ASSERT (((UINTN)Buffer & (sizeof (Guid->Data1) - 1)) == 0);
ASSERT (Length <= (MAX_ADDRESS - (UINTN)Buffer + 1));
ASSERT ((Length & (sizeof (*GuidPtr) - 1)) == 0);
GuidPtr = (GUID*)Buffer;
Buffer = GuidPtr + Length / sizeof (*GuidPtr);
while (GuidPtr < (CONST GUID*)Buffer) {
if (CompareGuid (GuidPtr, Guid)) {
return (VOID*)GuidPtr;
}
GuidPtr++;
}
return NULL;
}
/**
Checks if the given GUID is a zero GUID.
This function checks whether the given GUID is a zero GUID. If the GUID is
identical to a zero GUID then TRUE is returned. Otherwise, FALSE is returned.
If Guid is NULL, then ASSERT().
@param Guid The pointer to a 128 bit GUID.
@retval TRUE Guid is a zero GUID.
@retval FALSE Guid is not a zero GUID.
**/
BOOLEAN
EFIAPI
IsZeroGuid (
IN CONST GUID *Guid
)
{
UINT64 LowPartOfGuid;
UINT64 HighPartOfGuid;
LowPartOfGuid = ReadUnaligned64 ((CONST UINT64*) Guid);
HighPartOfGuid = ReadUnaligned64 ((CONST UINT64*) Guid + 1);
return (BOOLEAN) (LowPartOfGuid == 0 && HighPartOfGuid == 0);
}
| {
"content_hash": "99d94b3faf45e273d65b7a151477231e",
"timestamp": "",
"source": "github",
"line_count": 148,
"max_line_length": 92,
"avg_line_length": 28.493243243243242,
"alnum_prop": 0.662556319658525,
"repo_name": "mdkinney/Test",
"id": "e2976dd0c0f19a951b5b96e7faed53f33c3de71f",
"size": "4651",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "MdePkg/Library/BaseMemoryLib/MemLibGuid.c",
"mode": "33188",
"license": "bsd-2-clause",
"language": [],
"symlink_target": ""
} |
"""
Tests for evb_get_info.py.
Also, test diff_lines
"""
import os
import unittest
from md_utils.evb_get_info import main
from md_utils.md_common import capture_stdout, capture_stderr, diff_lines, silent_remove
import logging
# logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(__name__)
DISABLE_REMOVE = logger.isEnabledFor(logging.DEBUG)
__author__ = 'hmayes'
# Directories #
DATA_DIR = os.path.join(os.path.dirname(__file__), 'test_data')
SUB_DATA_DIR = os.path.join(DATA_DIR, 'evb_info')
# Input files paired with output #
INCOMP_INI = os.path.join(SUB_DATA_DIR, 'evb_get_info_missing_data.ini')
BAD_PATH_INI = os.path.join(SUB_DATA_DIR, 'evb_get_info_bad_path.ini')
NO_PATH_INI = os.path.join(SUB_DATA_DIR, 'evb_get_info_no_path.ini')
CI_INI = os.path.join(SUB_DATA_DIR, 'evb_get_info.ini')
# noinspection PyUnresolvedReferences
DEF_CI_OUT1 = os.path.join(SUB_DATA_DIR, '1.500_20c_short_evb_info.csv')
GOOD_CI_OUT1 = os.path.join(SUB_DATA_DIR, '1.500_20c_short_ci_sq_good.csv')
# noinspection PyUnresolvedReferences
DEF_CI_OUT2 = os.path.join(SUB_DATA_DIR, '2.000_20c_short_evb_info.csv')
GOOD_CI_OUT2 = os.path.join(SUB_DATA_DIR, '2.000_20c_short_ci_sq_good.csv')
BAD_CI_OUT2 = os.path.join(SUB_DATA_DIR, '2.000_20c_short_ci_sq_bad.csv')
CI_SUBSET_INI = os.path.join(SUB_DATA_DIR, 'evb_get_info_subset.ini')
# noinspection PyUnresolvedReferences
DEF_CI_SUBSET_OUT = os.path.join(SUB_DATA_DIR, '1.500_20c_short_ci_sq_ts.csv')
GOOD_CI_SUBSET_OUT = os.path.join(SUB_DATA_DIR, '1.500_20c_short_ci_sq_ts_good.csv')
CI_ONE_STATE_INI = os.path.join(SUB_DATA_DIR, 'serca_evb_get_info.ini')
CI_ONE_STATE_EACH_FILE_INI = os.path.join(SUB_DATA_DIR, 'serca_evb_get_info_per_file.ini')
# noinspection PyUnresolvedReferences
DEF_ONE_STATE_OUT = os.path.join(SUB_DATA_DIR, '0_3_evb_info.csv')
GOOD_ONE_STATE_OUT = os.path.join(SUB_DATA_DIR, '0_3_ci_sq_good.csv')
# noinspection PyUnresolvedReferences
DEF_ONE_STATE_OUT2 = os.path.join(SUB_DATA_DIR, '31_3_evb_info.csv')
GOOD_ONE_STATE_OUT2 = os.path.join(SUB_DATA_DIR, '31_3_ci_sq_good.csv')
# noinspection PyUnresolvedReferences
DEF_LIST_OUT = os.path.join(SUB_DATA_DIR, 'serca_evb_list_evb_info.csv')
GOOD_LIST_OUT = os.path.join(SUB_DATA_DIR, 'serca_evb_list_ci_sq_good.csv')
BAD_KEY_INI = os.path.join(SUB_DATA_DIR, 'evb_get_info_bad_key.ini')
BAD_EVB_INI = os.path.join(SUB_DATA_DIR, 'evb_get_info_bad_evb.ini')
NO_SUCH_EVB_INI = os.path.join(SUB_DATA_DIR, 'evb_get_info_no_such_evb.ini')
KEY_PROPS_INI = os.path.join(SUB_DATA_DIR, 'evb_get_key_props.ini')
KEY_PROPS_OUT = os.path.join(SUB_DATA_DIR, 'evb_list_evb_info.csv')
GOOD_KEY_PROPS_OUT = os.path.join(SUB_DATA_DIR, 'evb_list_evb_info_good.csv')
WATER_MOL_INI = os.path.join(SUB_DATA_DIR, 'evb_get_water_mol.ini')
GOOD_WATER_MOL_OUT1 = os.path.join(SUB_DATA_DIR, '1.500_20c_short_wat_mols_good.csv')
GOOD_WATER_MOL_OUT2 = os.path.join(SUB_DATA_DIR, '2.000_20c_short_wat_mols_good.csv')
WATER_MOL_COMB_INI = os.path.join(SUB_DATA_DIR, 'evb_get_water_mol_combine.ini')
WATER_MOL_COMB_OUT = os.path.join(SUB_DATA_DIR, 'evb_list_evb_info.csv')
GOOD_WATER_MOL_COMB_OUT = os.path.join(SUB_DATA_DIR, 'evb_list_wat_mols_good.csv')
REL_ENE_INI = os.path.join(SUB_DATA_DIR, 'evb_rel_ene.ini')
REL_ENE_OUT = os.path.join(SUB_DATA_DIR, 'evb_ene_list_evb_info.csv')
GOOD_REL_ENE_OUT = os.path.join(SUB_DATA_DIR, 'evb_ene_list_rel_e_good.csv')
REL_ENE_INI2 = os.path.join(SUB_DATA_DIR, 'evb_rel_ene2.ini')
REL_ENE_OUT2 = os.path.join(SUB_DATA_DIR, 'evb_ene_list2_evb_info.csv')
GOOD_REL_ENE_OUT2 = os.path.join(SUB_DATA_DIR, 'evb_ene_list2_evb_info_good.csv')
DECOMP_ENE_INI = os.path.join(SUB_DATA_DIR, 'evb_decomp_ene.ini')
GOOD_DECOMP_ENE_OUT = os.path.join(SUB_DATA_DIR, 'evb_ene_list2_ene_info_good.csv')
RMSD_ENE_INI = os.path.join(SUB_DATA_DIR, 'evb_rel_ene_rmsd.ini')
GOOD_RMSD_ENE_OUT = os.path.join(SUB_DATA_DIR, 'evb_ene_list2_rmsd_good.csv')
MAX_STEPS_INI = os.path.join(SUB_DATA_DIR, 'evb_get_info_max_steps.ini')
MAX_STEPS_OUT = os.path.join(SUB_DATA_DIR, '2.000_20c_short_evb_info.csv')
GOOD_MAX_STEPS_OUT = os.path.join(SUB_DATA_DIR, '2.000_20c_max_steps_good.csv')
MULTI_SUM_INI = os.path.join(SUB_DATA_DIR, 'evb_get_info_multi_sum.ini')
MULTI_SUM_OUT = os.path.join(SUB_DATA_DIR, 'gluprot1min_evb_evb_info.csv')
GOOD_MULTI_SUM_OUT = os.path.join(SUB_DATA_DIR, 'gluprot1min_evb_evb_info_good.csv')
REPEATED_EVB_STEP_INI = os.path.join(SUB_DATA_DIR, 'evb_get_info_repeated_timestep.ini')
REPEATED_EVB_STEP_OUT = os.path.join(SUB_DATA_DIR, 'gluprot13_-6_evb_info.csv')
GOOD_REPEATED_EVB_STEP_OUT = os.path.join(SUB_DATA_DIR, 'gluprot13_-6_evb_info_good.csv')
ONLY_STEPS_INI = os.path.join(SUB_DATA_DIR, 'evb_get_info_specific_step.ini')
ONLY_STEPS_OUT = os.path.join(SUB_DATA_DIR, '2.000_20c_short_evb_info.csv')
GOOD_ONLY_STEPS_OUT = os.path.join(SUB_DATA_DIR, '2.000_20c_only_step_good.csv')
REF_ENE_NON_INT_TIME_INI = os.path.join(SUB_DATA_DIR, 'evb_get_info_non_int_timestep.ini')
ONLY_STEPS_REF_ENE_INI = os.path.join(SUB_DATA_DIR, 'evb_get_info_timestep_ref.ini')
ONLY_STEPS_REF_ENE_OUT = os.path.join(SUB_DATA_DIR, 'evb_list_timestep_ref_evb_info.csv')
GOOD_ONLY_STEPS_REF_ENE_OUT = os.path.join(SUB_DATA_DIR, 'evb_list_timestep_ref_evb_info_good.csv')
class TestEVBGetInfoNoOutput(unittest.TestCase):
def testHelp(self):
test_input = ['-h']
if logger.isEnabledFor(logging.DEBUG):
main(test_input)
with capture_stderr(main, test_input) as output:
self.assertFalse(output)
with capture_stdout(main, test_input) as output:
self.assertTrue("optional arguments" in output)
def testNoIni(self):
test_input = []
if logger.isEnabledFor(logging.DEBUG):
main(test_input)
with capture_stdout(main, test_input) as output:
self.assertTrue("usage:" in output)
with capture_stderr(main, test_input) as output:
self.assertTrue("Problems reading file: Could not read file" in output)
def testMissingInfo(self):
test_input = ["-c", INCOMP_INI]
if logger.isEnabledFor(logging.DEBUG):
main(test_input)
with capture_stderr(main, test_input) as output:
self.assertTrue("Missing config val for key 'prot_res_mol_id'" in output)
with capture_stdout(main, test_input) as output:
self.assertTrue("optional arguments" in output)
def testBadPath(self):
test_input = ["-c", BAD_PATH_INI]
if logger.isEnabledFor(logging.DEBUG):
main(test_input)
with capture_stderr(main, test_input) as output:
self.assertTrue("No such file or directory:" in output)
def testNoPath(self):
test_input = ["-c", NO_PATH_INI]
if logger.isEnabledFor(logging.DEBUG):
main(test_input)
with capture_stderr(main, test_input) as output:
self.assertTrue("Found no evb file names" in output)
def testBadKeyword(self):
with capture_stderr(main, ["-c", BAD_KEY_INI]) as output:
self.assertTrue("Unexpected key" in output)
def testBadEVB(self):
with capture_stderr(main, ["-c", BAD_EVB_INI]) as output:
self.assertTrue("Problems reading data" in output)
def testNoSuchEVB(self):
with capture_stderr(main, ["-c", NO_SUCH_EVB_INI]) as output:
self.assertTrue("No such file or directory" in output)
def testNonIntTimestep(self):
test_input = ["-c", REF_ENE_NON_INT_TIME_INI]
if logger.isEnabledFor(logging.DEBUG):
main(test_input)
with capture_stderr(main, test_input) as output:
self.assertTrue("Could not convert" in output)
class TestEVBGetInfo(unittest.TestCase):
def testCiInfo(self):
try:
main(["-c", CI_INI])
self.assertFalse(diff_lines(DEF_CI_OUT1, GOOD_CI_OUT1))
self.assertEqual(1, len(diff_lines(DEF_CI_OUT2, BAD_CI_OUT2)))
self.assertFalse(diff_lines(DEF_CI_OUT2, GOOD_CI_OUT2))
finally:
silent_remove(DEF_CI_OUT1, disable=DISABLE_REMOVE)
silent_remove(DEF_CI_OUT2, disable=DISABLE_REMOVE)
def testSubsetCiInfo(self):
with capture_stderr(main, ["-c", CI_SUBSET_INI]) as output:
self.assertTrue("found no data from" in output)
self.assertFalse(diff_lines(DEF_CI_SUBSET_OUT, GOOD_CI_SUBSET_OUT))
silent_remove(DEF_CI_SUBSET_OUT, disable=DISABLE_REMOVE)
silent_remove(DEF_CI_OUT1, disable=DISABLE_REMOVE)
silent_remove(DEF_CI_OUT2, disable=DISABLE_REMOVE)
def testOneStateCiInfo(self):
"""
Make sure can handle input that only has one state (such steps have a vector instead of a matrix)
and does not skip them
Also, check that properly reads to make a summary file
"""
try:
main(["-c", CI_ONE_STATE_INI])
self.assertFalse(diff_lines(DEF_LIST_OUT, GOOD_LIST_OUT))
finally:
silent_remove(DEF_LIST_OUT, disable=DISABLE_REMOVE)
def testOneStateEachFileCiInfo(self):
"""
Make sure can handle input that only has one state (such steps have a vector instead of a matrix)
this time, printing a separate output for each file
And, skip one-state-steps
"""
try:
main(["-c", CI_ONE_STATE_EACH_FILE_INI])
self.assertFalse(diff_lines(DEF_ONE_STATE_OUT, GOOD_ONE_STATE_OUT))
self.assertFalse(diff_lines(DEF_ONE_STATE_OUT2, GOOD_ONE_STATE_OUT2))
finally:
silent_remove(DEF_ONE_STATE_OUT, disable=DISABLE_REMOVE)
silent_remove(DEF_ONE_STATE_OUT2, disable=DISABLE_REMOVE)
def testKeyProps(self):
try:
main(["-c", KEY_PROPS_INI])
self.assertFalse(diff_lines(KEY_PROPS_OUT, GOOD_KEY_PROPS_OUT))
finally:
silent_remove(KEY_PROPS_OUT, disable=DISABLE_REMOVE)
def testWaterMol(self):
try:
main(["-c", WATER_MOL_INI, "-p"])
self.assertFalse(diff_lines(DEF_CI_OUT1, GOOD_WATER_MOL_OUT1))
self.assertFalse(diff_lines(DEF_CI_OUT2, GOOD_WATER_MOL_OUT2))
finally:
silent_remove(DEF_CI_OUT1, disable=DISABLE_REMOVE)
silent_remove(DEF_CI_OUT2, disable=DISABLE_REMOVE)
def testWaterMolCombine(self):
# Should skip the timestep with only 1 state
try:
main(["-c", WATER_MOL_COMB_INI, "-p"])
self.assertFalse(diff_lines(WATER_MOL_COMB_OUT, GOOD_WATER_MOL_COMB_OUT))
finally:
silent_remove(WATER_MOL_COMB_OUT, disable=DISABLE_REMOVE)
def testRelEnergy(self):
# calculates relative energy
try:
main(["-c", REL_ENE_INI, "-p"])
print(REL_ENE_OUT)
print(GOOD_REL_ENE_OUT)
self.assertFalse(diff_lines(REL_ENE_OUT, GOOD_REL_ENE_OUT))
finally:
silent_remove(REL_ENE_OUT, disable=DISABLE_REMOVE)
def testRelEnergyMissingInfo(self):
# Check that prints "nan" instead of printing a stack trace (uncaught error)
try:
main(["-c", REL_ENE_INI2, "-p"])
print(REL_ENE_OUT2)
print(GOOD_REL_ENE_OUT2)
self.assertFalse(diff_lines(REL_ENE_OUT2, GOOD_REL_ENE_OUT2))
finally:
silent_remove(REL_ENE_OUT2, disable=DISABLE_REMOVE)
def testDecomposedEnergyInfo(self):
try:
main(["-c", DECOMP_ENE_INI, "-p"])
self.assertFalse(diff_lines(REL_ENE_OUT2, GOOD_DECOMP_ENE_OUT))
finally:
silent_remove(REL_ENE_OUT2, disable=DISABLE_REMOVE)
def testRMSDEnergy(self):
try:
test_input = ["-c", RMSD_ENE_INI]
if logger.isEnabledFor(logging.DEBUG):
main(test_input)
with capture_stdout(main, test_input) as output:
self.assertTrue("23.760125" in output)
print(REL_ENE_OUT2)
print(GOOD_RMSD_ENE_OUT)
self.assertFalse(diff_lines(REL_ENE_OUT2, GOOD_RMSD_ENE_OUT))
finally:
silent_remove(REL_ENE_OUT2, disable=DISABLE_REMOVE)
def testMaxSteps(self):
try:
test_input = ["-c", MAX_STEPS_INI]
main(test_input)
self.assertFalse(diff_lines(MAX_STEPS_OUT, GOOD_MAX_STEPS_OUT))
finally:
silent_remove(MAX_STEPS_OUT, disable=DISABLE_REMOVE)
def testMultiFileSum(self):
try:
test_input = ["-c", MULTI_SUM_INI]
silent_remove(MULTI_SUM_OUT)
if logger.isEnabledFor(logging.DEBUG):
main(test_input)
with capture_stderr(main, test_input) as output:
self.assertTrue("setting 'print_output_file_list' to 'True'" in output)
self.assertFalse(diff_lines(MULTI_SUM_OUT, GOOD_MULTI_SUM_OUT))
finally:
silent_remove(MULTI_SUM_OUT, disable=DISABLE_REMOVE)
def testRepeatedTimestep(self):
try:
test_input = ["-c", REPEATED_EVB_STEP_INI]
main(test_input)
self.assertFalse(diff_lines(REPEATED_EVB_STEP_OUT, GOOD_REPEATED_EVB_STEP_OUT))
finally:
silent_remove(REPEATED_EVB_STEP_OUT, disable=DISABLE_REMOVE)
def testSpecificTimestep(self):
try:
test_input = ["-c", ONLY_STEPS_INI]
main(test_input)
self.assertFalse(diff_lines(ONLY_STEPS_OUT, GOOD_ONLY_STEPS_OUT))
finally:
silent_remove(ONLY_STEPS_OUT, disable=DISABLE_REMOVE)
def testSpecificTimestepWithRefEne(self):
try:
test_input = ["-c", ONLY_STEPS_REF_ENE_INI]
main(test_input)
self.assertFalse(diff_lines(ONLY_STEPS_REF_ENE_OUT, GOOD_ONLY_STEPS_REF_ENE_OUT))
finally:
silent_remove(ONLY_STEPS_REF_ENE_OUT, disable=DISABLE_REMOVE)
| {
"content_hash": "164219c43eb394de5bb387135d168a72",
"timestamp": "",
"source": "github",
"line_count": 320,
"max_line_length": 105,
"avg_line_length": 43.425,
"alnum_prop": 0.646804835924007,
"repo_name": "cmayes/md_utils",
"id": "cce93011d945dbbb5faee1d06b577e9cb778a786",
"size": "13912",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "tests/test_evb_get_info.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Makefile",
"bytes": "1698"
},
{
"name": "Python",
"bytes": "115128"
},
{
"name": "Shell",
"bytes": "664"
},
{
"name": "Smarty",
"bytes": "211"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE ldml SYSTEM "../../common/dtd/ldml.dtd">
<!-- © 1991-2013 Unicode, Inc.
CLDR data files are interpreted according to the LDML specification (http://unicode.org/reports/tr35/)
For terms of use, see http://www.unicode.org/copyright.html
-->
<ldml>
<identity>
<version number="$Revision: 9061 $"/>
<generation date="$Date: 2013-07-20 12:27:45 -0500 (Sat, 20 Jul 2013) $"/>
<language type="ar"/>
<territory type="EH"/>
</identity>
<numbers>
<defaultNumberingSystem>latn</defaultNumberingSystem>
</numbers>
</ldml>
| {
"content_hash": "58b47b23efbcde7fe018e58d76b3d3d0",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 102,
"avg_line_length": 33.8235294117647,
"alnum_prop": 0.6817391304347826,
"repo_name": "ProfilerTeam/Profiler",
"id": "918c17284b092d62b1c41ba3a3c336e8e3547763",
"size": "576",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "protected/vendors/Zend/Locale/Data/ar_EH.xml",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "427"
},
{
"name": "Batchfile",
"bytes": "431"
},
{
"name": "CSS",
"bytes": "326435"
},
{
"name": "HTML",
"bytes": "917"
},
{
"name": "JavaScript",
"bytes": "581447"
},
{
"name": "PHP",
"bytes": "7311409"
},
{
"name": "Shell",
"bytes": "41"
}
],
"symlink_target": ""
} |
package ch.javasoft.math.linalg;
import ch.javasoft.math.array.ArrayOperations;
import ch.javasoft.math.array.NumberArrayOperations;
import ch.javasoft.math.array.NumberOperators;
import ch.javasoft.math.array.impl.DefaultNumberArrayOperations;
import ch.javasoft.math.operator.AggregatingUnaryOperator;
import ch.javasoft.math.operator.BinaryOperator;
import ch.javasoft.math.operator.BooleanUnaryOperator;
import ch.javasoft.math.operator.TernaryOperator;
import ch.javasoft.math.operator.UnaryOperator;
import ch.javasoft.util.IntArray;
/**
* The <code>DefaultLinAlgOperations</code> class extends
* {@link DefaultBasicLinAlgOperations} and adds default implementations for
* more complex linear algebra functions defined by {@link LinAlgOperations}.
* <p>
* An instance of this class defines the (boxed) number type and the array type,
* such as {@link Double} and {@code double[]}.
*
* @type N the number type of a single number
* @type A the number type of an array of numbers
*/
public class DefaultLinAlgOperations<N extends Number, A> extends DefaultBasicLinAlgOperations<N, A> implements LinAlgOperations<N, A> {
private final GaussPivotingFactory<N, A> gaussPivotingFactory;
//algebraic expressions
private final UnaryOperator<N, A> negater;
private final BinaryOperator<N, A> multiplier;
private final BinaryOperator<N, A> divider;
private final BinaryOperator<N, A> multiplierNormalizer;
private final BinaryOperator<N, A> dividerNormalizer;
/** see {@link #subtractPivotRowMultiple(Object[], int, int, int, Object)} */
private final TernaryOperator<N, A> pivotRowMultipleSubtracter;
public DefaultLinAlgOperations(NumberOperators<N, A> numberOps, ArrayOperations<A> arrayOps, GaussPivotingFactory<N, A> gaussPivotingFactory) {
this(new DefaultNumberArrayOperations<N, A>(numberOps, arrayOps), gaussPivotingFactory);
}
public DefaultLinAlgOperations(NumberArrayOperations<N, A> numberArrayOps, GaussPivotingFactory<N, A> gaussPivotingFactory) {
super(numberArrayOps);
this.gaussPivotingFactory = gaussPivotingFactory;
negater = expressionComposer.neg();
multiplier = expressionComposer.mul();
divider = expressionComposer.div();
multiplierNormalizer = expressionComposer.normalize(expressionComposer.mul());
dividerNormalizer = expressionComposer.normalize(expressionComposer.div());
//matrix[row][col] = matrix[row][col] - matrix[row][piv] * matrix[piv][col]
//result = x1 - x2 * x3
pivotRowMultipleSubtracter = expressionComposer.normalize(expressionComposer.subFromFree(expressionComposer.mul()));
}
public A[] kernel(A[] matrix, int[] rowmap, int[] colmap, int[] ptrNullity) {
final int cols = arrayOps.getColumnCount(matrix);
final int[] ptrRank = new int[1];
if (colmap == null) {
colmap = new int[cols];
}
final A[] rref = rowEchelon(matrix, true /*reduced*/, rowmap, colmap, ptrRank);
final int rank = ptrRank[0];
final int ndim = cols - rank;
final A[] ker = numberArrayOps.newZeroMatrix(cols, ndim);
final boolean isDivSup =
numberOps.getDivisionSupport().isSufficientlyExact() &&
!numberOps.getDivisionSupport().mightCauseException();
if (isDivSup) {
//diagonal
for (int i = 0; i < ndim; i++) {
numberArrayOps.set(ker, colmap[i + rank], i, numberOps.one());
}
//rest
for (int row = 0; row < rank; row++) {
for (int col = 0; col < ndim; col++) {
arrayOps.copyMatrixElement(rref, row, col + rank, ker, colmap[row], col);
negater.operate(ker[colmap[row]], col, ker[colmap[row]], col);
}
}
}
else {
//if we had fraction numbers, we would divide the whole row by
//the diagonal element (including the diagonal element)
//for integers, we multiply by LCM(diag(:))/diag(i) instead
final AggregatingUnaryOperator<N, A> gcdOp = numberOps.aggregatingUnary(AggregatingUnaryOperator.Id.normDivisor);
//first, reduce each row by its gcd
A tmp = arrayOps.newVector(2);
for (int row = 0; row < rank; row++) {
//copy diag element to tmp[0]
arrayOps.copyMatrixRowElementsToVector(rref, row, row, tmp, 0, 1);
//copy gcd of non-diag elements to tmp[1]
gcdOp.operate(rref[row], rank, ndim, tmp, 1);
//gcd of tmp[0] and tmp[1], stored in tmp[0]
gcdOp.operate(tmp, 0, 2, tmp, 0);
if (!isOne(tmp, 0)) {
final N gcd = numberArrayOps.get(tmp, 0);
final UnaryOperator<N, A> divOp = expressionComposer.divFreeBy(expressionComposer.constant(gcd));
//divide diag element
divOp.operate(rref[row], row, rref[row], row);
//divide non-diag elements
for (int col = 0; col < ndim; col++) {
divOp.operate(rref[row], col + rank, rref[row], col + rank);
}
}
}
//now, make all diag elements equal, i.e. mul by LCM(diag(:))/diag(i)
numberArrayOps.set(tmp, 0, numberOps.one());
for (int row = 0; row < rank; row++) {
arrayOps.copyMatrixRowElementsToVector(rref, row, row, tmp, 1, 1);
gcdOp.operate(tmp, 0, 2, tmp, 1);
multiplier.operate(tmp, 0, rref[row], row, tmp, 0);
divider.operate(tmp, 0, tmp, 1, tmp, 0);
}
//LCM is in tmp[0]
final N lcm = numberArrayOps.get(tmp, 0);
for (int row = 0; row < rank; row++) {
final UnaryOperator<N, A> mulOp =
expressionComposer.div(
expressionComposer.mul(expressionComposer.constant(lcm)),
expressionComposer.constant(numberArrayOps.get(rref, row, row))
);
//multiply diagonal element
mulOp.operate(rref[row], row, rref[row], row);
//copy diagonal
for (int i = 0; i < ndim; i++) {
numberArrayOps.set(ker, colmap[i + rank], i, lcm);
}
//multiply & copy rest
for (int col = 0; col < ndim; col++) {
mulOp.operate(rref[row], col + rank, rref[row], col + rank);
arrayOps.copyMatrixElement(rref, row, col + rank, ker, colmap[row], col);
negater.operate(ker[colmap[row]], col, ker[colmap[row]], col);
}
}
}
if (ptrNullity != null) {
ptrNullity[0] = ndim;
}
return ker;
}
public A[] invertMatrix(A[] matrix, int[] rowmap, int[] colmap) {
if (rowmap == null) {
final int rows = arrayOps.getRowCount(matrix);
final int cols = arrayOps.getColumnCount(matrix);
rowmap = new int[rows];
colmap = new int[cols];
initializeMapping(rows, rowmap);
initializeMapping(cols, colmap);
}
return invertMaximalSubmatrixInternal(matrix, rowmap, colmap, null, true /*square*/);
}
public A[] invertMaximalSubmatrix(A[] matrix, int[] rowmap, int[] colmap, int[] ptrRank) {
return invertMaximalSubmatrixInternal(matrix, rowmap, colmap, ptrRank, false /*square*/);
}
private A[] invertMaximalSubmatrixInternal(A[] matrix, int[] rowmap, int[] colmap, int[] ptrRank, boolean square) {
final int rows = arrayOps.getRowCount(matrix);
final int cols = arrayOps.getColumnCount(matrix);
if (square && rows != cols) {
throw new IllegalArgumentException("matrix must be square to be invertible: " + rows + "x" + cols);
}
//create matrix [mx I]
final A[] rref = arrayOps.newMatrix(rows, rows + cols);
arrayOps.copyMatrixElements(matrix, 0, 0, rref, 0, 0, rows, cols);
for (int row = 0; row < rows; row++) {
for (int col = 0; col < rows; col++) {
numberArrayOps.set(rref, row, cols + col, numberOps.zero());
}
numberArrayOps.set(rref, row, cols + row, numberOps.one());
}
//reduced row echelon
final int rank = rowEchelon(rref, rref, true/*reduced*/, rowmap, colmap);
if (ptrRank != null) {
ptrRank[0] = rank;
}
if (square && rank < Math.min(rows, cols)) {
throw new ArithmeticException("singular matrix, rank < size: " + rank + " < " + rows);
}
//rref has form [I inv(mx)], but rows are swapped as reflected in colmap
final A[] inv = arrayOps.newMatrix(rank, rank);
for (int row = 0; row < rank; row++) {
final int dstRow = square ? colmap[row] : row;
for (int col = 0; col < rank; col++) {
final int dstCol = square ? rowmap[col] : col;
arrayOps.copyMatrixElement(rref, row, cols + rowmap[col], inv, dstRow, dstCol);
}
}
return inv;
}
public int nullity(A[] matrix) {
final int rows = arrayOps.getRowCount(matrix);
final int cols = arrayOps.getColumnCount(matrix);
final A[] res = arrayOps.newMatrix(rows, cols);
return cols - rowEchelon(matrix, res, false /*reduced*/, null, null);
}
public int rank(A[] matrix) {
final int rows = arrayOps.getRowCount(matrix);
final int cols = arrayOps.getColumnCount(matrix);
final A[] res = arrayOps.newMatrix(rows, cols);
return rowEchelon(matrix, res, false /*reduced*/, null, null);
}
public A[] rowEchelon(A[] matrix, boolean reduced, int[] rowmap, int[] colmap, int[] ptrRank) {
final int rows = arrayOps.getRowCount(matrix);
final int cols = arrayOps.getColumnCount(matrix);
final A[] res = arrayOps.newMatrix(rows, cols);
final int rank = rowEchelon(matrix, res, reduced, rowmap, colmap);
if (ptrRank != null && ptrRank.length > 0) {
ptrRank[0] = rank;
}
return res;
}
public int rowEchelon(A[] src, A[] dst, boolean reduced, int[] rowmap, int[] colmap) {
final boolean isDivSup =
numberOps.getDivisionSupport().isSufficientlyExact() &&
!numberOps.getDivisionSupport().mightCauseException();
final int rows = arrayOps.getRowCount(dst);
final int cols = arrayOps.getColumnCount(dst);
if (src != dst) {
arrayOps.copyMatrixElements(src, 0, 0, dst, 0, 0, rows, cols);
}
final int prows = initializeMapping(rows, rowmap);
final int pcols = initializeMapping(cols, colmap);
final int pivs = Math.min(prows, pcols);
final IntArray prowNonZeroIndices = new IntArray(cols);
for (int pivot = 0; pivot < pivs; pivot++) {
//find pivot row/column
final GaussPivoting<N, A> pivoting = gaussPivotingFactory.getGaussPivoting(numberArrayOps, pivot);
for (int row = pivot; row < prows; row++) {
final int rowResult = pivoting.checkCandidateRow(dst, pivot, row);
boolean cont = true;
for (int col = pivot; col < pcols && cont; col++) {
if (isNonZero(dst, row, col)) {
// if (pivot == 0) mx.reduceValueAt(row, col);
cont = pivoting.checkCandidateCol(dst, pivot, row, col, rowResult);
}
}
}
final int prow = pivoting.getPivotRow();
final int pcol = pivoting.getPivotCol();
// System.out.println("pivot " + pivot + " of " + pivs + " has length " + plen + ": " + (plen < 128*128 ? mx.getBigIntegerFractionNumberValueAt(prow, pcol) : "-"));
if (isZero(dst, prow, pcol)) {
// System.out.println("exit at rank/pivot " + pivot);
return pivot;
}
//swap rows / columns
if (prow != pivot) {
arrayOps.swapMatrixRows(dst, prow, pivot);
if (rowmap != null) {
IntArray.swap(rowmap, prow, pivot);
}
}
if (pcol != pivot) {
arrayOps.swapMatrixColumns(dst, pcol, pivot);
if (colmap != null) {
IntArray.swap(colmap, pcol, pivot);
}
}
//normalize pivot row
prowNonZeroIndices.clear();
if (isDivSup) {
final boolean divide = !isOne(dst, pivot, pivot);
//collect non-zero row values and divide by pivot if necessary
for (int col = pivot + 1; col < cols; col++) {
if (isNonZero(dst, pivot, col)) {
if (divide) {
divide(dst, pivot, col, pivot, pivot);
}
prowNonZeroIndices.add(col);
}
}
numberArrayOps.set(dst, pivot, pivot, numberOps.one());
}
else {
final boolean negate = isNeg(dst, pivot, pivot);
//collect non-zero row values and negate if necessary
for (int col = pivot + 1; col < cols; col++) {
if (isNonZero(dst, pivot, col)) {
if (negate) {
negate(dst, pivot, col);
}
prowNonZeroIndices.add(col);
}
}
if (negate) {
negate(dst, pivot, pivot);
}
}
//subtract pivot row from other rows
for (int row = pivot + 1; row < rows; row++) {
if (isNonZero(dst, row, pivot)) {
if (isDivSup) {
for (int i = 0; i < prowNonZeroIndices.length(); i++) {
final int col = prowNonZeroIndices.get(i);
subtractPivotRowMultiple(dst, row, col, pivot);
}
}
else {
int i = 0;
for (int col = pivot + 1; col < cols; col++) {
if (i < prowNonZeroIndices.length() && prowNonZeroIndices.get(i) == col) {
i++;
//non-zero row pivot, multiply and subtract row
multiply(dst, row, col, pivot, pivot, false);
subtractPivotRowMultiple(dst, row, col, pivot);
}
else {
//zero row pivot, multiply only
multiply(dst, row, col, pivot, pivot, true);
}
}
}
numberArrayOps.set(dst, row, pivot, numberOps.zero());
}
}
if (reduced) {
//subtract pivot from rows above pivot row, too
for (int row = 0; row < pivot; row++) {
if (isNonZero(dst, row, pivot)) {
if (isDivSup) {
for (int i = 0; i < prowNonZeroIndices.length(); i++) {
final int col = prowNonZeroIndices.get(i);
subtractPivotRowMultiple(dst, row, col, pivot);
}
}
else {
int i = 0;
for (int col = pivot + 1; col < cols; col++) {
if (i < prowNonZeroIndices.length() && prowNonZeroIndices.get(i) == col) {
i++;
//non-zero row pivot, multiply and subtract row
multiply(dst, row, col, pivot, pivot, false);
// pivotRowMultipleSubtracter.operate(dst[row], col, dst[row], pivot, dst[pivot], col, dst[row], col);
// subtractPivotRowMultiple(dst, row, col, pivot, ptrTmp);
subtractPivotRowMultiple(dst, row, col, pivot);
}
else {
//zero row pivot, multiply only
multiply(dst, row, col, pivot, pivot, true);
}
}
//important: also multiply the row pivot element
multiply(dst, row, row, pivot, pivot, true);
}
numberArrayOps.set(dst, row, pivot, numberOps.zero());
}
}
}
}
return pivs;
}
private boolean isZero(A[] matrix, int row, int col) {
return numberOps.booleanUnary(BooleanUnaryOperator.Id.isZero).booleanOperate(matrix[row], col);
}
private boolean isNonZero(A[] matrix, int row, int col) {
return numberOps.booleanUnary(BooleanUnaryOperator.Id.isNonZero).booleanOperate(matrix[row], col);
}
private boolean isOne(A[] matrix, int row, int col) {
return numberOps.booleanUnary(BooleanUnaryOperator.Id.isOne).booleanOperate(matrix[row], col);
}
private boolean isOne(A vec, int index) {
return numberOps.booleanUnary(BooleanUnaryOperator.Id.isOne).booleanOperate(vec, index);
}
private boolean isNeg(A[] matrix, int row, int col) {
return numberOps.booleanUnary(BooleanUnaryOperator.Id.isNegative).booleanOperate(matrix[row], col);
}
/**
* Negates the specified value, that is,
* <pre>
* matrix[row][col] =-matrix[row][col]
* </pre>
*/
private void negate(A[] matrix, int row, int col) {
negater.operate(matrix[row], col, matrix[row], col);
}
/**
* Divides and normalizes, that is,
* <pre>
* matrix[row][col] = normalize( matrix[row][col] / matrix[divRow][divCol] )
* </pre>
*/
private void divide(A[] matrix, int row, int col, int divRow, int divCol) {
dividerNormalizer.operate(matrix[row], col, matrix[divRow], divCol, matrix[row], col);
}
/**
* Multiplies, that is,
* <pre>
* matrix[row][col] = matrix[row][col] * matrix[mulRow][mulCol]
* </pre>
* The result value is normalized if {@code normalize = true}.
*/
private void multiply(A[] matrix, int row, int col, int mulRow, int mulCol, boolean normalize) {
if (normalize) {
multiplierNormalizer.operate(matrix[row], col, matrix[mulRow], mulCol, matrix[row], col);
}
else {
multiplier.operate(matrix[row], col, matrix[mulRow], mulCol, matrix[row], col);
}
}
/**
* Operates a single value of subtracting the pivot row from the current
* row:
* <pre>
* matrix[row][col] = matrix[row][col] - matrix[row][piv] * matrix[piv][col]
* </pre>
* The value is normalized.
* <p>
* <b>Note:</b> If the pivot value is unequal to one, the matrix value must
* be multiplied with it before calling this method, that is, perform
* <pre>
* matrix[row][col] = matrix[piv][piv] * matrix[row][col]
* </pre>
* in advance to get the correct overall operation
* <pre>
* matrix[row][col] = matrix[piv][piv] * matrix[row][col] - matrix[row][piv] * matrix[piv][col]
* </pre>
*/
private void subtractPivotRowMultiple(A[] matrix, int row, int col, int piv) {
pivotRowMultipleSubtracter.operate(matrix[row], col, matrix[row], piv, matrix[piv], col, matrix[row], col);
}
/**
* Fills the mapping {@code map} such that {@code map[i] = i} and returns
* {@code min(size, length(map))}. If {@code map == null}, {@code size}
* is returned.
*/
private static int initializeMapping(int size, int[] map) {
if (map == null) return size;
for (int i = 0; i < map.length; i++) {
map[i] = i;
}
return Math.min(size, map.length);
}
}
| {
"content_hash": "6152f4755859cfad44e24470d0b64717",
"timestamp": "",
"source": "github",
"line_count": 453,
"max_line_length": 166,
"avg_line_length": 37.22958057395144,
"alnum_prop": 0.6537207233916394,
"repo_name": "mpgerstl/tEFMA",
"id": "d12ee3517d6b2a79e198ca02f6c0485ae97a3f74",
"size": "18858",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "ch/javasoft/math/linalg/DefaultLinAlgOperations.java",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "Java",
"bytes": "5891365"
},
{
"name": "Makefile",
"bytes": "101974"
}
],
"symlink_target": ""
} |
Monocle helps you tame your database views by keeping the SQLs versioned neatly in your project and knowing when and how to migrate them if necessary. It knows how to deal with PostgreSQL materialized views and dependencies (view A points to view B) as well as regular views.
Monocle works with or without Rails, all it assumes is you're using ActiveRecord. See _Usage_ for more details.
## Reasoning
At [InvitedHome](http://invitedhome.com/) we needed an easy to use system to manage a bunch of complex views (often materialized) that we use for things like caching.
The only gem that did something similar at the time was Thoughtbot's [Scenic](https://github.com/thoughtbot/scenic), but we didn't like some of its features such as how it would generate multiple versions of the same view's SQL.
We wanted something way simpler, one SQL file per view, versioning maintained by a timestamp at the top of the file. Thus, Monocle was born.
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'ar-monocle', require: 'monocle'
```
And then execute:
$ bundle
Or install it yourself as:
$ gem install ar-monocle
## Setup
If you're using Rails, there are generators for bootstrapping the gem:
$ rails g monocle:install
It will generate a migration for creating the Monocle::Migration table. If you're not using Rails, you'll need to create the table yourself. Check https://github.com/darkside/monocle/blob/master/spec/support/database_utils.rb for an example on how to do it.
## Usage
The basic gist is you have a `db/views` in your project which contains all the view / materialized view SQL definitions. On top of those files there's a timestamp that you can control. Every time you change that timestamp, Monocle will try to migrate that view when calling `rake monocle:migrate`. You can automate this easily by hooking `monocle:migrate` to your deployment process.
Monocle knows about view dependencies and will drop and recreate dependants as necessary. So if you have a view A that references a view B and you need to upgrade view B, it will drop view A first, then drop and create view B, then create view A.
## Included Generators (for Rails)
### Generating a view
With Rails, you can use the generator:
$ rails g monocle:view view_name
This will generate a Monocle SQL template and a model. You can skip creating the model with `--skip-model`.
### Generating a materialized view
With Rails, you can use the generator:
$ rails g monocle:matview view_name
This will generate a Monocle materialized SQL template and a model. You can skip creating the model with `--skip-model`.
## Included Rake Tasks
### List all views
You can use `rake monocle:list` to see all the view names that are being managed by Monocle.
### List all migrated view slugs
You can use `rake monocle:versions` to see all the view slugs that have been migrated by Monocle.
### Migrate views
You can use `rake monocle:migrate` to migrate any views that have a new timestamp. I recommend you hook this to your deployment process i.e after you call `rake db:migrate`
### Bumping a view timestamp
With monocle, you decide when it's time to upgrade a view. So even if you have an updated view definition that you're working on, it won't actually change it unless the timestamp has changed. To bump a view timestamp, you can either do it yourself by changing the first line of the template or use the supplied rake task:
$ rake monocle:bump[my_view_name]
### Refresh a view
For materialized views, this makes it easy for you to trigger a refresh, say, in a cron job or something.
$ rake monocle:refresh[my_view_name]
### Refresh all views
This is also available as a top level method for Monocle. It will refresh all your materialized views.
$ rake monocle:refresh_all
## Development
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/darkside/monocle.
## License
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
| {
"content_hash": "f8e421a7dbf16007b8072e947ec980b3",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 383,
"avg_line_length": 43.698113207547166,
"alnum_prop": 0.758419689119171,
"repo_name": "darkside/monocle",
"id": "8e4606ccc93979d17cb206d86c76e934a5615ca8",
"size": "4644",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "25872"
},
{
"name": "Shell",
"bytes": "131"
}
],
"symlink_target": ""
} |
package org.pathvisio.core.view;
import java.awt.Shape;
/**
ArrowShapes determine how the ending of a line can be drawn. These
are arrows in a broad sense - they could be T-bars for example.
<p>
ArrowShapes have a fill type. FillType can be OPEN, CLOSED or WIRE.
The fillType determines whether the body of the arrow head is filled
with the foreground color or with the canvas color.
<p>
For the outline, the shape returned by getShape() will be used.
getFillShape() optionally defines a different shape for the body. If there
is no separate fillShape defined, the same shape is used for the outline
and for the body.
<pre>
open closed wire
|\ #\ \
______| \ ______##\ _____\
| / ##/ /
|/ #/ /
</pre>
*/
public class ArrowShape
{
/**
* Enumerates possible ways to combine the outline and body.
*/
public enum FillType
{
/**
* Open fill-type, where the outline is colored with the foreground color and the
* body is colored with the canvas color.
*/
OPEN,
/**
* Closed fill-type, where both the outline and the body are
* colored with the line color.
*/
CLOSED,
/**
* Wire fill-type, there is only an outline.
*/
WIRE
}
/**
* Normally, this constructor is not called directly.
* Use {@link ShapeRegistry.registerShape} instead to define a new ArrowShape.
*/
public ArrowShape (Shape shape, FillType fillType, int gap) {
this.shape = shape;
this.fillType = fillType;
this.gap = gap;
}
/**
* Normally, this constructor is not called directly.
* Use {@link ShapeRegistry.registerShape} instead to define a new ArrowShape.
*/
public ArrowShape (Shape shape, FillType fillType) {
this.shape = shape;
this.fillType = fillType;
}
/**
* @return one of {@link FillType.OPEN}, {@link FillType.CLOSED} or {@link FillType.WIRE}
*/
public FillType getFillType () { return fillType; }
/**
* @return the outline for this arrow type.
*/
public Shape getShape() { return shape; }
/**
* @return the gap at the end of the line, for arrow shapes
* that should not overlap the thing the line is connected with.
*/
public double getGap()
{
return (double)gap;
}
private Shape shape;
private FillType fillType;
private int gap = 0;
}
| {
"content_hash": "f956ea80ab2b2ecbf874a3654ad042d4",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 90,
"avg_line_length": 25.46315789473684,
"alnum_prop": 0.628358825961141,
"repo_name": "PathVisio/pathvisio",
"id": "724ed85b1eb7e0d352bf0b43e872e5a015de3236",
"size": "3269",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "modules/org.pathvisio.core/src/org/pathvisio/core/view/ArrowShape.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "74"
},
{
"name": "CSS",
"bytes": "390"
},
{
"name": "HTML",
"bytes": "27652"
},
{
"name": "Inno Setup",
"bytes": "2290"
},
{
"name": "Java",
"bytes": "2303047"
},
{
"name": "JavaScript",
"bytes": "16917"
},
{
"name": "Shell",
"bytes": "12653"
}
],
"symlink_target": ""
} |
package mil.nga.giat.geowave.format.stanag4676.parser.model;
public class IDdata
{
private String stationId;
private String nationality;
public String getStationId() {
return stationId;
}
public void setStationId(
String stationId ) {
this.stationId = stationId;
}
public String getNationality() {
return nationality;
}
public void setNationality(
String nationality ) {
this.nationality = nationality;
}
}
| {
"content_hash": "5ba77fee84fe91234a0c5d9e22b8bbb0",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 60,
"avg_line_length": 16.807692307692307,
"alnum_prop": 0.7368421052631579,
"repo_name": "chizou/geowave",
"id": "96b852860405af7e0b21d54d48d03674c51c43d8",
"size": "437",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "extensions/formats/stanag4676/format/src/main/java/mil/nga/giat/geowave/format/stanag4676/parser/model/IDdata.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C++",
"bytes": "5073"
},
{
"name": "CMake",
"bytes": "2032"
},
{
"name": "FreeMarker",
"bytes": "2879"
},
{
"name": "Gnuplot",
"bytes": "57750"
},
{
"name": "Groovy",
"bytes": "1414"
},
{
"name": "HTML",
"bytes": "1903"
},
{
"name": "Java",
"bytes": "5823710"
},
{
"name": "Protocol Buffer",
"bytes": "1525"
},
{
"name": "Puppet",
"bytes": "4039"
},
{
"name": "Scala",
"bytes": "21759"
},
{
"name": "Scheme",
"bytes": "20491"
},
{
"name": "Shell",
"bytes": "58741"
}
],
"symlink_target": ""
} |
import json
import logging
from cutlass import Visit
from cutlass import iHMPSession
from pprint import pprint
import sys
username = "test"
password = "test"
def set_logging():
root = logging.getLogger()
root.setLevel(logging.DEBUG)
ch = logging.StreamHandler(sys.stdout)
ch.setLevel(logging.DEBUG)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
ch.setFormatter(formatter)
root.addHandler(ch)
set_logging()
session = iHMPSession(username, password)
print("Required fields:")
print(Visit.required_fields())
test_visit = Visit()
test_visit.visit_id = "ABC123"
test_visit.visit_number = 2
test_visit.date = "2000-01-01"
test_visit.interval = 4
test_visit.clinic_id = "Test clinic ID"
test_visit.tags = [ "visit", "ihmp" ]
test_visit.add_tag("another")
test_visit.add_tag("and_another")
test_visit.links = { "by": [ "610a4911a5ca67de12cdc1e4b400e7e9" ] }
print(test_visit.to_json(indent=2))
if test_visit.is_valid():
print("Valid!")
success = test_visit.save()
if success:
visit_id = test_visit.id
print("Successfully saved visit. ID: %s" % visit_id)
visit2 = Visit.load(visit_id)
print(test_visit.to_json(indent=4))
deletion_success = test_visit.delete()
if deletion_success:
print("Deleted visit with ID %s" % visit_id)
else:
print("Deletion of visit %s failed." % visit_id)
else:
print("Save failed")
else:
print("Invalid...")
validation_errors = test_visit.validate()
pprint(validation_errors)
| {
"content_hash": "b846df42d58dbc8307f76f041c0c94f9",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 89,
"avg_line_length": 24.136363636363637,
"alnum_prop": 0.6629001883239172,
"repo_name": "ihmpdcc/cutlass",
"id": "db96f6843decc7e5256b735409de6679cba07014",
"size": "1616",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "examples/visit.py",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "1322642"
}
],
"symlink_target": ""
} |
#include <aws/location/model/DescribePlaceIndexResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <utility>
using namespace Aws::LocationService::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
DescribePlaceIndexResult::DescribePlaceIndexResult()
{
}
DescribePlaceIndexResult::DescribePlaceIndexResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
*this = result;
}
DescribePlaceIndexResult& DescribePlaceIndexResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
JsonView jsonValue = result.GetPayload().View();
if(jsonValue.ValueExists("CreateTime"))
{
m_createTime = jsonValue.GetString("CreateTime");
}
if(jsonValue.ValueExists("DataSource"))
{
m_dataSource = jsonValue.GetString("DataSource");
}
if(jsonValue.ValueExists("DataSourceConfiguration"))
{
m_dataSourceConfiguration = jsonValue.GetObject("DataSourceConfiguration");
}
if(jsonValue.ValueExists("Description"))
{
m_description = jsonValue.GetString("Description");
}
if(jsonValue.ValueExists("IndexArn"))
{
m_indexArn = jsonValue.GetString("IndexArn");
}
if(jsonValue.ValueExists("IndexName"))
{
m_indexName = jsonValue.GetString("IndexName");
}
if(jsonValue.ValueExists("UpdateTime"))
{
m_updateTime = jsonValue.GetString("UpdateTime");
}
return *this;
}
| {
"content_hash": "60f8557a77f170b2c339b5df0f7e9d0f",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 116,
"avg_line_length": 21.095890410958905,
"alnum_prop": 0.7376623376623377,
"repo_name": "jt70471/aws-sdk-cpp",
"id": "67672e286ba1c1e7f1408c0721e96e2856f1a35c",
"size": "1659",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "aws-cpp-sdk-location/source/model/DescribePlaceIndexResult.cpp",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "13452"
},
{
"name": "C++",
"bytes": "278594037"
},
{
"name": "CMake",
"bytes": "653931"
},
{
"name": "Dockerfile",
"bytes": "5555"
},
{
"name": "HTML",
"bytes": "4471"
},
{
"name": "Java",
"bytes": "302182"
},
{
"name": "Python",
"bytes": "110380"
},
{
"name": "Shell",
"bytes": "4674"
}
],
"symlink_target": ""
} |
<?php
/*
Unsafe sample
input : use shell_exec to cat /tmp/tainted.txt
sanitize : regular expression accepts everything
construction : interpretation with simple quote
*/
/*Copyright 2015 Bertrand STIVALET
Permission is hereby granted, without written agreement or royalty fee, to
use, copy, modify, and distribute this software and its documentation for
any purpose, provided that the above copyright notice and the following
three paragraphs appear in all copies of this software.
IN NO EVENT SHALL AUTHORS BE LIABLE TO ANY PARTY FOR DIRECT,
INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF AUTHORS HAVE
BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
AUTHORS SPECIFICALLY DISCLAIM ANY WARRANTIES INCLUDING, BUT NOT
LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
THE SOFTWARE IS PROVIDED ON AN "AS-IS" BASIS AND AUTHORS HAVE NO
OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
MODIFICATIONS.*/
$tainted = shell_exec('cat /tmp/tainted.txt');
$re = "/^.*$/";
if(preg_match($re, $tainted) == 1){
$tainted = $tainted;
}
else{
$tainted = "";
}
$query = "SELECT lastname, firstname FROM drivers, vehicles WHERE drivers.id = vehicles.ownerid AND vehicles.tag=' $tainted '";
//flaw
$conn = mysql_connect('localhost', 'mysql_user', 'mysql_password'); // Connection to the database (address, user, password)
mysql_select_db('dbname') ;
echo "query : ". $query ."<br /><br />" ;
$res = mysql_query($query); //execution
while($data =mysql_fetch_array($res)){
print_r($data) ;
echo "<br />" ;
}
mysql_close($conn);
?> | {
"content_hash": "c6473ee8686997d1292d947991a59dd8",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 127,
"avg_line_length": 24.32857142857143,
"alnum_prop": 0.7345860246623606,
"repo_name": "stivalet/PHP-Vulnerability-test-suite",
"id": "04dbff6c7e44a11ec15f076eb0b4e1c887ffeaf2",
"size": "1703",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Injection/CWE_89/unsafe/CWE_89__shell_exec__func_preg_match-no_filtering__join-interpretation_simple_quote.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "64184004"
}
],
"symlink_target": ""
} |
package org.apache.kafka.streams.state.internals;
import org.apache.kafka.common.serialization.Serde;
import org.apache.kafka.common.utils.Bytes;
import org.apache.kafka.streams.errors.InvalidStateStoreException;
import org.apache.kafka.streams.kstream.Windowed;
import org.apache.kafka.streams.kstream.internals.CacheFlushListener;
import org.apache.kafka.streams.kstream.internals.TimeWindow;
import org.apache.kafka.streams.processor.ProcessorContext;
import org.apache.kafka.streams.processor.StateStore;
import org.apache.kafka.streams.processor.internals.InternalProcessorContext;
import org.apache.kafka.streams.processor.internals.RecordContext;
import org.apache.kafka.streams.state.StateSerdes;
import org.apache.kafka.streams.state.WindowStore;
import org.apache.kafka.streams.state.WindowStoreIterator;
import java.util.List;
class CachingWindowStore<K, V> implements WindowStore<K, V>, CachedStateStore<Windowed<K>, V> {
private final WindowStore<Bytes, byte[]> underlying;
private final Serde<K> keySerde;
private final Serde<V> valueSerde;
private CacheFlushListener<Windowed<K>, V> flushListener;
private final long windowSize;
private String name;
private ThreadCache cache;
private InternalProcessorContext context;
private StateSerdes<K, V> serdes;
CachingWindowStore(final WindowStore<Bytes, byte[]> underlying,
final Serde<K> keySerde,
final Serde<V> valueSerde,
final long windowSize) {
this.underlying = underlying;
this.keySerde = keySerde;
this.valueSerde = valueSerde;
this.windowSize = windowSize;
}
@Override
public String name() {
return underlying.name();
}
@SuppressWarnings("unchecked")
@Override
public void init(final ProcessorContext context, final StateStore root) {
underlying.init(context, root);
initInternal(context);
}
@SuppressWarnings("unchecked")
void initInternal(final ProcessorContext context) {
this.context = (InternalProcessorContext) context;
this.serdes = new StateSerdes<>(underlying.name(),
keySerde == null ? (Serde<K>) context.keySerde() : keySerde,
valueSerde == null ? (Serde<V>) context.valueSerde() : valueSerde);
this.name = context.taskId() + "-" + underlying.name();
this.cache = this.context.getCache();
cache.addDirtyEntryFlushListener(name, new ThreadCache.DirtyEntryFlushListener() {
@Override
public void apply(final List<ThreadCache.DirtyEntry> entries) {
for (ThreadCache.DirtyEntry entry : entries) {
final byte[] binaryKey = entry.key().get();
final Bytes key = WindowStoreUtils.bytesKeyFromBinaryKey(binaryKey);
final long timestamp = WindowStoreUtils.timestampFromBinaryKey(binaryKey);
final Windowed<K> windowedKey = new Windowed<>(WindowStoreUtils.keyFromBinaryKey(binaryKey, serdes),
new TimeWindow(timestamp, timestamp + windowSize));
maybeForward(entry, key, timestamp, windowedKey, (InternalProcessorContext) context);
underlying.put(key, entry.newValue(), timestamp);
}
}
});
}
private void maybeForward(final ThreadCache.DirtyEntry entry,
final Bytes key,
final long timestamp,
final Windowed<K> windowedKey,
final InternalProcessorContext context) {
if (flushListener != null) {
final RecordContext current = context.recordContext();
context.setRecordContext(entry.recordContext());
try {
flushListener.apply(windowedKey,
serdes.valueFrom(entry.newValue()), fetchPrevious(key, timestamp));
} finally {
context.setRecordContext(current);
}
}
}
public void setFlushListener(CacheFlushListener<Windowed<K>, V> flushListener) {
this.flushListener = flushListener;
}
@Override
public synchronized void flush() {
cache.flush(name);
underlying.flush();
}
@Override
public void close() {
flush();
underlying.close();
cache.close(name);
}
@Override
public boolean persistent() {
return underlying.persistent();
}
@Override
public boolean isOpen() {
return underlying.isOpen();
}
@Override
public synchronized void put(final K key, final V value) {
put(key, value, context.timestamp());
}
@Override
public synchronized void put(final K key, final V value, final long timestamp) {
validateStoreOpen();
final byte[] binaryKey = WindowStoreUtils.toBinaryKey(key, timestamp, 0, serdes);
final LRUCacheEntry entry = new LRUCacheEntry(serdes.rawValue(value), true, context.offset(),
timestamp, context.partition(), context.topic());
cache.put(name, binaryKey, entry);
}
@Override
public synchronized WindowStoreIterator<V> fetch(final K key, final long timeFrom, final long timeTo) {
validateStoreOpen();
byte[] binaryFrom = WindowStoreUtils.toBinaryKey(key, timeFrom, 0, serdes);
byte[] binaryTo = WindowStoreUtils.toBinaryKey(key, timeTo, 0, serdes);
final WindowStoreIterator<byte[]> underlyingIterator = underlying.fetch(Bytes.wrap(serdes.rawKey(key)), timeFrom, timeTo);
final ThreadCache.MemoryLRUCacheBytesIterator cacheIterator = cache.range(name, binaryFrom, binaryTo);
return new MergedSortedCachedWindowStoreIterator<>(cacheIterator, new DelegatingPeekingWindowIterator<>(underlyingIterator), serdes);
}
private V fetchPrevious(final Bytes key, final long timestamp) {
try (final WindowStoreIterator<byte[]> iterator = underlying.fetch(key, timestamp, timestamp)) {
if (!iterator.hasNext()) {
return null;
}
return serdes.valueFrom(iterator.next().value);
}
}
private void validateStoreOpen() {
if (!isOpen()) {
throw new InvalidStateStoreException("Store " + this.name + " is currently closed");
}
}
}
| {
"content_hash": "fe40d6c63bdad85dbef348ac2f4471b2",
"timestamp": "",
"source": "github",
"line_count": 165,
"max_line_length": 141,
"avg_line_length": 39.878787878787875,
"alnum_prop": 0.6369300911854103,
"repo_name": "eribeiro/kafka",
"id": "71856fa96c1aec63d4c64ba32347f393c0abe6ea",
"size": "7386",
"binary": false,
"copies": "1",
"ref": "refs/heads/trunk",
"path": "streams/src/main/java/org/apache/kafka/streams/state/internals/CachingWindowStore.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "25631"
},
{
"name": "HTML",
"bytes": "5443"
},
{
"name": "Java",
"bytes": "6254418"
},
{
"name": "Python",
"bytes": "462640"
},
{
"name": "Scala",
"bytes": "3469375"
},
{
"name": "Shell",
"bytes": "54956"
},
{
"name": "XSLT",
"bytes": "7116"
}
],
"symlink_target": ""
} |
====
News
====
|build| |coverage|
|logo|
.. |build| image:: https://travis-ci.org/kuc2477/news.svg?branch=dev
:target: https://travis-ci.org/kuc2477/news
.. |coverage| image:: https://coveralls.io/repos/github/kuc2477/news/badge.svg?branch=dev
:target: https://coveralls.io/github/kuc2477/news?branch=dev
.. |logo| image:: http://emojipedia-us.s3.amazonaws.com/cache/31/52/3152d71c04eb9dc2082c057e466b35cb.png
:alt: News, subscription engine built on top of asynchronosy
News is an asynchronous web subscription engine built on top of **asnycio** and **aiohttp**.
Author
======
* `Ha Junsoo <kuc2477@gmail.com>`_
Requirements
============
* Python 3.5+
* Redis (optional)
Documentation
=============
* `Read the Docs <http://news.readthedocs.org/en/latest>`_
Note
====
- You can check the protject's roadmap at ``ROADMAP.org``
- The project is currently under heavy development. Most of public APIs are
settled but breaking changes can happen at any time.
| {
"content_hash": "23633386875b471c8930748c701ccb3b",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 104,
"avg_line_length": 24,
"alnum_prop": 0.698170731707317,
"repo_name": "kuc2477/news",
"id": "e0e22ce6748c19bebb5afbbfa785bdcb4f019627",
"size": "984",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.rst",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "85073"
}
],
"symlink_target": ""
} |
<div>
<div class="row section2 aboutPageSection">
<div class="col-md-1"></div>
<div class="col-md-5 col-xs-12 topMargin">
<div class="mediumSizePic">
<img src="{{contentList[contentListIndex].image}}" class="img-responsive img-rounded aboutPagePic">
</div>
</div>
<div class="col-md-5 col-xs-12 topMargin">
<accordion close-others="true">
<accordion-group heading="Toggle collapse Collapsible Group Item #1" is-open="true" class="textAreaBorder" ng-click="updateIndex(0)">
<div class="panel-body">
{{contentList[0].blurb}}
</div>
</accordion-group>
<accordion-group heading="Toggle collapse Collapsible Group Item #2" class="textAreaBorder" ng-click="updateIndex(1)">
<div class="panel-body">
{{contentList[1].blurb}}
</div>
</accordion-group>
<accordion-group heading="Toggle collapse Collapsible Group Item #3" class="textAreaBorder" ng-click="updateIndex(2)">
<div class="panel-body">
{{contentList[2].blurb}}
</div>
</accordion-group>
</accordion>
</div>
<div class="col-md-1"></div>
</div>
</div> | {
"content_hash": "5a014af399bba00ff100acb593d14e29",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 137,
"avg_line_length": 27.926829268292682,
"alnum_prop": 0.6323144104803493,
"repo_name": "yerabashtard/MDDetailing",
"id": "3aa8d0265a1ed3683aa36ad390814394b4c1b8d4",
"size": "1145",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/partials/about.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "562"
},
{
"name": "CSS",
"bytes": "366617"
},
{
"name": "HTML",
"bytes": "14395"
},
{
"name": "JavaScript",
"bytes": "20195"
},
{
"name": "Ruby",
"bytes": "1396"
},
{
"name": "Shell",
"bytes": "2036"
}
],
"symlink_target": ""
} |
<?php
/**
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* http://www.gnu.org/copyleft/gpl.html
*
* @file
* @author Daniel Kinzler
*/
/**
* @covers TitleValue
*
* @group Title
*/
class TitleValueTest extends MediaWikiTestCase {
public function testConstruction() {
$title = new TitleValue( NS_USER, 'TestThis', 'stuff' );
$this->assertEquals( NS_USER, $title->getNamespace() );
$this->assertEquals( 'TestThis', $title->getText() );
$this->assertEquals( 'stuff', $title->getFragment() );
}
public function badConstructorProvider() {
return array(
array( 'foo', 'title', 'fragment' ),
array( null, 'title', 'fragment' ),
array( 2.3, 'title', 'fragment' ),
array( NS_MAIN, 5, 'fragment' ),
array( NS_MAIN, null, 'fragment' ),
array( NS_MAIN, '', 'fragment' ),
array( NS_MAIN, 'foo bar', '' ),
array( NS_MAIN, 'bar_', '' ),
array( NS_MAIN, '_foo', '' ),
array( NS_MAIN, ' eek ', '' ),
array( NS_MAIN, 'title', 5 ),
array( NS_MAIN, 'title', null ),
array( NS_MAIN, 'title', array() ),
);
}
/**
* @dataProvider badConstructorProvider
*/
public function testConstructionErrors( $ns, $text, $fragment ) {
$this->setExpectedException( 'InvalidArgumentException' );
new TitleValue( $ns, $text, $fragment );
}
public function fragmentTitleProvider() {
return array(
array( new TitleValue( NS_MAIN, 'Test' ), 'foo' ),
array( new TitleValue( NS_TALK, 'Test', 'foo' ), '' ),
array( new TitleValue( NS_CATEGORY, 'Test', 'foo' ), 'bar' ),
);
}
/**
* @dataProvider fragmentTitleProvider
*/
public function testCreateFragmentTitle( TitleValue $title, $fragment ) {
$fragmentTitle = $title->createFragmentTitle( $fragment );
$this->assertEquals( $title->getNamespace(), $fragmentTitle->getNamespace() );
$this->assertEquals( $title->getText(), $fragmentTitle->getText() );
$this->assertEquals( $fragment, $fragmentTitle->getFragment() );
}
public function getTextProvider() {
return array(
array( 'Foo', 'Foo' ),
array( 'Foo_Bar', 'Foo Bar' ),
);
}
/**
* @dataProvider getTextProvider
*/
public function testGetText( $dbkey, $text ) {
$title = new TitleValue( NS_MAIN, $dbkey );
$this->assertEquals( $text, $title->getText() );
}
}
| {
"content_hash": "d3fdacc94abfae276dc1ce6140a588ca",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 80,
"avg_line_length": 29.535353535353536,
"alnum_prop": 0.6569767441860465,
"repo_name": "owen-kellie-smith/mediawiki",
"id": "184198d2aa3f39ca6c4f8a1b83bf495e99e076b2",
"size": "2924",
"binary": false,
"copies": "61",
"ref": "refs/heads/master",
"path": "wiki/tests/phpunit/includes/title/TitleValueTest.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "405"
},
{
"name": "Batchfile",
"bytes": "45"
},
{
"name": "CSS",
"bytes": "522322"
},
{
"name": "Cucumber",
"bytes": "33293"
},
{
"name": "HTML",
"bytes": "26024"
},
{
"name": "JavaScript",
"bytes": "3615192"
},
{
"name": "Lua",
"bytes": "478"
},
{
"name": "Makefile",
"bytes": "8898"
},
{
"name": "PHP",
"bytes": "21628114"
},
{
"name": "PLSQL",
"bytes": "61551"
},
{
"name": "PLpgSQL",
"bytes": "31212"
},
{
"name": "Perl",
"bytes": "27998"
},
{
"name": "Python",
"bytes": "17169"
},
{
"name": "Ruby",
"bytes": "69896"
},
{
"name": "SQLPL",
"bytes": "2159"
},
{
"name": "Shell",
"bytes": "31740"
}
],
"symlink_target": ""
} |
import { ModuleWithProviders, NgModule } from '@angular/core';
import { NGX_MOMENT_OPTIONS, NgxMomentOptions } from './moment-options';
import { AddPipe } from './add.pipe';
import { CalendarPipe } from './calendar.pipe';
import { DateFormatPipe } from './date-format.pipe';
import { DifferencePipe } from './difference.pipe';
import { DurationPipe } from './duration.pipe';
import { FromUnixPipe } from './from-unix.pipe';
import { FromUtcPipe } from './from-utc.pipe';
import { IsAfterPipe } from './is-after.pipe';
import { IsBeforePipe } from './is-before.pipe';
import { LocalTimePipe } from './local.pipe';
import { LocalePipe } from './locale.pipe';
import { ParsePipe } from './parse.pipe';
import { ParseZonePipe } from './parse-zone.pipe';
import { SubtractPipe } from './subtract.pipe';
import { TimeAgoPipe } from './time-ago.pipe';
import { UtcPipe } from './utc.pipe';
const ANGULAR_MOMENT_PIPES = [
AddPipe,
CalendarPipe,
DateFormatPipe,
DifferencePipe,
DurationPipe,
FromUnixPipe,
ParsePipe,
SubtractPipe,
TimeAgoPipe,
UtcPipe,
FromUtcPipe,
LocalTimePipe,
LocalePipe,
ParseZonePipe,
IsBeforePipe,
IsAfterPipe,
];
@NgModule({
declarations: ANGULAR_MOMENT_PIPES,
exports: ANGULAR_MOMENT_PIPES,
})
export class MomentModule {
static forRoot(options?: NgxMomentOptions): ModuleWithProviders<MomentModule> {
return {
ngModule: MomentModule,
providers: [
{
provide: NGX_MOMENT_OPTIONS,
useValue: {
...options,
},
},
],
};
}
}
| {
"content_hash": "438b0652f52712a909dbc4919b2032b4",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 81,
"avg_line_length": 26.948275862068964,
"alnum_prop": 0.6705054382597568,
"repo_name": "urish/angular2-moment",
"id": "641c6ead1ce2b05cc7d97a9b6219319ce6810943",
"size": "1563",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/moment.module.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "283"
},
{
"name": "TypeScript",
"bytes": "33358"
}
],
"symlink_target": ""
} |
PhysicsJS is a prototype for Physics Sugar Activity.
by Lionel Laské
Images credits:
- Gyroscope by Arthur Shlain from the Noun Project
- Apple by Magicon from the Noun Project
| {
"content_hash": "5cc5fc8323b0640fd8fb38d015ab80a2",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 52,
"avg_line_length": 25.571428571428573,
"alnum_prop": 0.7988826815642458,
"repo_name": "shlesha/My-Activities",
"id": "eee96bb94a39250202c2a00f696b116cb57bee50",
"size": "181",
"binary": false,
"copies": "8",
"ref": "refs/heads/master",
"path": "activities/PhysicsJS.activity/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ActionScript",
"bytes": "39385"
},
{
"name": "ApacheConf",
"bytes": "42"
},
{
"name": "CSS",
"bytes": "1028851"
},
{
"name": "CoffeeScript",
"bytes": "78585"
},
{
"name": "HTML",
"bytes": "105596"
},
{
"name": "JavaScript",
"bytes": "16864054"
},
{
"name": "Makefile",
"bytes": "1933"
},
{
"name": "Python",
"bytes": "31679"
},
{
"name": "Shell",
"bytes": "286"
}
],
"symlink_target": ""
} |
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
import Header from './components/Header'
class App extends Component {
render() {
return (
<div className="App">
<Header/>
<div className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<h2>Welcome to React</h2>
</div>
<p className="App-intro">
To get started, edit <code>src/App.js</code> and save to reload.
</p>
</div>
);
}
}
export default App;
| {
"content_hash": "1970aa09780064bf141043a35f191e85",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 74,
"avg_line_length": 23.083333333333332,
"alnum_prop": 0.5613718411552346,
"repo_name": "jensraaby/restbucks-finatra",
"id": "f38f6f2de11ef59605bac992947c5ab9f2cf6446",
"size": "554",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "webapp/src/App.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "414"
},
{
"name": "HTML",
"bytes": "1098"
},
{
"name": "JavaScript",
"bytes": "12981"
},
{
"name": "Scala",
"bytes": "12753"
},
{
"name": "Shell",
"bytes": "647"
}
],
"symlink_target": ""
} |
'use strict';
var path = require('path');
var express = require('express');
var app = express();
var bodyParser = require('body-parser');
var http = require('http').Server(app);
var options = {
port: process.env.VCAP_APP_PORT || 3000
};
app.use(bodyParser.urlencoded({ extended: false }));
require('./api')(app);
http.listen(options.port);
| {
"content_hash": "50cc214c66de86f8c9d809be7a0a25a1",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 52,
"avg_line_length": 21.75,
"alnum_prop": 0.6695402298850575,
"repo_name": "lukasmartinelli/lintfox",
"id": "17120b7a07c9904b2c86836e723fd58b55112d3f",
"size": "348",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/server.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "10842"
}
],
"symlink_target": ""
} |
package io.budgetapp.managed;
import com.codahale.metrics.MetricRegistry;
import io.budgetapp.configuration.AppConfiguration;
import io.dropwizard.db.DataSourceFactory;
import io.dropwizard.db.ManagedDataSource;
import io.dropwizard.lifecycle.Managed;
import io.dropwizard.migrations.CloseableLiquibase;
import io.dropwizard.migrations.CloseableLiquibaseWithClassPathMigrationsFile;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
*/
public class MigrationManaged implements Managed {
private static final Logger LOGGER = LoggerFactory.getLogger(MigrationManaged.class);
private final DataSourceFactory dataSourceFactory;
public MigrationManaged(AppConfiguration configuration) {
this.dataSourceFactory = configuration.getDataSourceFactory();
}
@Override
public void start() throws Exception {
LOGGER.info("begin migration");
final ManagedDataSource dataSource = dataSourceFactory.build(new MetricRegistry(), "liquibase");
try(CloseableLiquibase liquibase = new CloseableLiquibaseWithClassPathMigrationsFile(dataSource, "migrations.xml")) {
liquibase.update("migrations");
}
LOGGER.info("finish migration");
}
@Override
public void stop() throws Exception {
}
}
| {
"content_hash": "f04593ee3e02c6b22da7fe84e28b0502",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 125,
"avg_line_length": 31.414634146341463,
"alnum_prop": 0.7616459627329193,
"repo_name": "paukiatwee/budgetapp",
"id": "f588c026a1d9b5fccf2a3cd095d2ba9c74acfb33",
"size": "1288",
"binary": false,
"copies": "2",
"ref": "refs/heads/develop",
"path": "src/main/java/io/budgetapp/managed/MigrationManaged.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "81195"
},
{
"name": "Dockerfile",
"bytes": "199"
},
{
"name": "HTML",
"bytes": "65299"
},
{
"name": "Java",
"bytes": "157284"
},
{
"name": "JavaScript",
"bytes": "72244"
},
{
"name": "Shell",
"bytes": "193"
}
],
"symlink_target": ""
} |
namespace Service
{
partial class pGinaServiceHost
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
//
// pGinaServiceHost
//
this.CanHandleSessionChangeEvent = true;
this.ServiceName = "pGina";
}
#endregion
}
}
| {
"content_hash": "37e72cc5d7740dd760331d4e78c34073",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 107,
"avg_line_length": 28.025,
"alnum_prop": 0.5316681534344335,
"repo_name": "stefanwerfling/pgina",
"id": "4129633cf62be813b54f9a931cccfaf8ca459772",
"size": "1123",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "pGina/src/Service/Service/ServiceHost.Designer.cs",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "12726"
},
{
"name": "C#",
"bytes": "954851"
},
{
"name": "C++",
"bytes": "369023"
},
{
"name": "Inno Setup",
"bytes": "34475"
},
{
"name": "NSIS",
"bytes": "5700"
},
{
"name": "Objective-C",
"bytes": "1776"
}
],
"symlink_target": ""
} |
export { Analytics32 as default } from "../../";
| {
"content_hash": "7fc02f52c82588fcf7dc24af82b79cc4",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 48,
"avg_line_length": 49,
"alnum_prop": 0.6122448979591837,
"repo_name": "georgemarshall/DefinitelyTyped",
"id": "741eca5d94c0d12e338cf9613c4cac1da619e43e",
"size": "49",
"binary": false,
"copies": "24",
"ref": "refs/heads/master",
"path": "types/carbon__icons-react/es/analytics/32.d.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "16338312"
},
{
"name": "Ruby",
"bytes": "40"
},
{
"name": "Shell",
"bytes": "73"
},
{
"name": "TypeScript",
"bytes": "17728346"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 297028 $ -->
<chapter xml:id="features.xforms" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Dealing with XForms</title>
<para>
<link xlink:href="&url.xforms;">XForms</link> defines a variation on traditional
webforms which allows them to be used on a wider variety of platforms and
browsers or even non-traditional media such as PDF documents.
</para>
<para>
The first key difference in XForms is how the form is sent to the client.
<link xlink:href="&url.xforms.htmlauthors;"><literal>XForms for HTML Authors</literal></link>
contains a detailed description of how to create XForms, for the purpose
of this tutorial we'll only be looking at a simple example.
</para>
<example>
<title>A simple XForms search form</title>
<programlisting role="html">
<![CDATA[
<h:html xmlns:h="http://www.w3.org/1999/xhtml"
xmlns="http://www.w3.org/2002/xforms">
<h:head>
<h:title>Search</h:title>
<model>
<submission action="http://example.com/search"
method="post" id="s"/>
</model>
</h:head>
<h:body>
<h:p>
<input ref="q"><label>Find</label></input>
<submit submission="s"><label>Go</label></submit>
</h:p>
</h:body>
</h:html>
]]>
</programlisting>
</example>
<para>
The above form displays a text input box (named <parameter>q</parameter>),
and a submit button. When the submit button is clicked, the form will be
sent to the page referred to by <literal>action</literal>.
</para>
<para>
Here's where it starts to look different from your web application's point
of view. In a normal HTML form, the data would be sent as
<literal>application/x-www-form-urlencoded</literal>, in the XForms world
however, this information is sent as <acronym>XML</acronym> formatted data.
</para>
<para>
If you're choosing to work with XForms then you probably want that data as
<acronym>XML</acronym>, in that case, look in <varname>$HTTP_RAW_POST_DATA</varname> where
you'll find the <acronym>XML</acronym> document generated by the browser which you can pass
into your favorite <acronym>XSLT</acronym> engine or document parser.
</para>
<para>
If you're not interested in formatting and just want your data to be loaded
into the traditional <varname>$_POST</varname> variable, you can instruct
the client browser to send it as <literal>application/x-www-form-urlencoded</literal>
by changing the <parameter>method</parameter> attribute to
<emphasis>urlencoded-post</emphasis>.
</para>
<example>
<title>Using an XForm to populate <varname>$_POST</varname></title>
<programlisting role="html">
<![CDATA[
<h:html xmlns:h="http://www.w3.org/1999/xhtml"
xmlns="http://www.w3.org/2002/xforms">
<h:head>
<h:title>Search</h:title>
<model>
<submission action="http://example.com/search"
method="urlencoded-post" id="s"/>
</model>
</h:head>
<h:body>
<h:p>
<input ref="q"><label>Find</label></input>
<submit submission="s"><label>Go</label></submit>
</h:p>
</h:body>
</h:html>
]]>
</programlisting>
</example>
<note>
<simpara>
As of this writing, many browsers do not support XForms.
Check your browser version if the above examples fails.
</simpara>
</note>
</chapter>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
| {
"content_hash": "47d48965ce29e4da98a7828a350566a9",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 115,
"avg_line_length": 33.097345132743364,
"alnum_prop": 0.7050802139037433,
"repo_name": "mziyut/.vim",
"id": "45253b9b87a4d89330d44e4519604d66934b24a6",
"size": "3740",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "dict/.neocomplete-php/phpdoc/en/features/xforms.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "2223"
},
{
"name": "Ruby",
"bytes": "939"
},
{
"name": "Shell",
"bytes": "582"
},
{
"name": "Vim script",
"bytes": "22415"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Infestation
{
class AggressionCatalyst:ISupplement
{
public void ReactTo(ISupplement otherSupplement)
{
}
public int PowerEffect
{
get { return 0; }
}
public int HealthEffect
{
get { return 0; }
}
public int AggressionEffect
{
get { return 3; }
}
}
}
| {
"content_hash": "2a83ba2acb720f876267efa35b007f6f",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 56,
"avg_line_length": 17.103448275862068,
"alnum_prop": 0.530241935483871,
"repo_name": "Ico093/TelerikAcademy",
"id": "abbc0f86108695596b2421caa150f82288672075",
"size": "498",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "C#OOP/Exams/C#OOP-March-2014-Varian-1/2. Infestation_Скелет на решението/Infestation/AggressionCatalyst .cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "172617"
},
{
"name": "C",
"bytes": "1487"
},
{
"name": "C#",
"bytes": "2694080"
},
{
"name": "CSS",
"bytes": "253424"
},
{
"name": "HTML",
"bytes": "518941"
},
{
"name": "Java",
"bytes": "47848"
},
{
"name": "JavaScript",
"bytes": "1224835"
},
{
"name": "Visual Basic",
"bytes": "540085"
}
],
"symlink_target": ""
} |
package com.badlogic.gdx.utils;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.Map;
import java.util.Set;
import com.badlogic.gdx.Net.HttpRequest;
/** Provides utility methods to copy streams */
public class StreamUtils {
/** Copy the data from an {@link InputStream} to an {@link OutputStream}.
* @throws IOException */
public static void copyStream (InputStream input, OutputStream output) throws IOException {
copyStream(input, output, 8192);
}
/** Copy the data from an {@link InputStream} to an {@link OutputStream}.
* @throws IOException */
public static void copyStream (InputStream input, OutputStream output, int bufferSize) throws IOException {
byte[] buffer = new byte[bufferSize];
int bytesRead;
while ((bytesRead = input.read(buffer)) != -1) {
output.write(buffer, 0, bytesRead);
}
}
}
| {
"content_hash": "2baf71c538e8a64461684e2c3c827196",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 108,
"avg_line_length": 29.875,
"alnum_prop": 0.7426778242677824,
"repo_name": "MathieuDuponchelle/gdx",
"id": "9770d165bc84f15943c69692cd4167f026dbf5e3",
"size": "956",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "gdx/src/com/badlogic/gdx/utils/StreamUtils.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "299963"
},
{
"name": "Awk",
"bytes": "3965"
},
{
"name": "C",
"bytes": "11019832"
},
{
"name": "C#",
"bytes": "5046"
},
{
"name": "C++",
"bytes": "8682960"
},
{
"name": "Delphi",
"bytes": "17677"
},
{
"name": "Java",
"bytes": "11089892"
},
{
"name": "JavaScript",
"bytes": "265"
},
{
"name": "Lua",
"bytes": "63243"
},
{
"name": "Objective-C",
"bytes": "279124"
},
{
"name": "OpenEdge ABL",
"bytes": "8244"
},
{
"name": "PHP",
"bytes": "726"
},
{
"name": "Perl",
"bytes": "4054"
},
{
"name": "Python",
"bytes": "172284"
},
{
"name": "Racket",
"bytes": "577"
},
{
"name": "Ragel in Ruby Host",
"bytes": "26543"
},
{
"name": "Shell",
"bytes": "574836"
},
{
"name": "Smalltalk",
"bytes": "10092"
}
],
"symlink_target": ""
} |
"""
Vectors
"""
"""
Copyright 2001 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the LGPL. See http://www.fsf.org
NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
$Revision: 1.2 $
$Date: 2001-05-31 17:48:55 $
Pearu Peterson
"""
import DataSetAttr
import common
class Vectors(DataSetAttr.DataSetAttr):
"""Holds VTK Vectors.
Usage:
Vectors(<sequence of 3-tuples> ,name = <string>)
Attributes:
vectors
name
Public methods:
get_size()
to_string(format = 'ascii')
"""
def __init__(self,vectors,name=None):
self.name = self._get_name(name)
self.vectors = self.get_3_tuple_list(vectors,(self.default_value,)*3)
def to_string(self,format='ascii'):
t = self.get_datatype(self.vectors)
ret = ['VECTORS %s %s'%(self.name,t),
self.seq_to_string(self.vectors,format,t)]
return '\n'.join(ret)
def get_size(self):
return len(self.vectors)
def vectors_fromfile(f,n,sl):
dataname = sl[0]
datatype = sl[1].lower()
assert datatype in ['bit','unsigned_char','char','unsigned_short','short','unsigned_int','int','unsigned_long','long','float','double'],`datatype`
vectors = []
while len(vectors) < 3*n:
vectors += map(eval,common._getline(f).split(' '))
assert len(vectors) == 3*n
return Vectors(vectors,dataname)
if __name__ == "__main__":
print Vectors([[3,3],[4,3.],240,3,2]).to_string()
| {
"content_hash": "11ced8fe55cd681826c88de63f3be9bb",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 150,
"avg_line_length": 29.566037735849058,
"alnum_prop": 0.6234843650287173,
"repo_name": "chunshen1987/iSS",
"id": "fd0228d69e4a24f030b7e5fff23f25667dcf8696",
"size": "1589",
"binary": false,
"copies": "9",
"ref": "refs/heads/main",
"path": "utilities/for_paraview/lib/Vectors.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C++",
"bytes": "862112"
},
{
"name": "CMake",
"bytes": "2790"
},
{
"name": "Makefile",
"bytes": "2165"
},
{
"name": "Python",
"bytes": "194348"
},
{
"name": "Shell",
"bytes": "3726"
}
],
"symlink_target": ""
} |
require 'spec_helper'
require 'bundler/settings'
describe Bundler::Settings do
subject(:settings) { described_class.new(bundled_app) }
describe "#set_local" do
context "when the local config file is not found" do
subject(:settings) { described_class.new(nil) }
it "raises a GemfileNotFound error with explanation" do
expect{ subject.set_local("foo", "bar") }.
to raise_error(Bundler::GemfileNotFound, "Could not locate Gemfile")
end
end
end
describe "#[]" do
context "when not set" do
context "when default value present" do
it "retrieves value" do
expect(settings[:retry]).to be 3
end
end
it "returns nil" do
expect(settings[:buttermilk]).to be nil
end
end
context "when is boolean" do
it "returns a boolean" do
settings[:frozen] = "true"
expect(settings[:frozen]).to be true
end
context "when specific gem is configured" do
it "returns a boolean" do
settings["ignore_messages.foobar"] = "true"
expect(settings["ignore_messages.foobar"]).to be true
end
end
end
end
describe "#mirror_for" do
let(:uri) { URI("https://rubygems.org/") }
context "with no configured mirror" do
it "returns the original URI" do
expect(settings.mirror_for(uri)).to eq(uri)
end
it "converts a string parameter to a URI" do
expect(settings.mirror_for("https://rubygems.org/")).to eq(uri)
end
end
context "with a configured mirror" do
let(:mirror_uri) { URI("https://rubygems-mirror.org/") }
before { settings["mirror.https://rubygems.org/"] = mirror_uri.to_s }
it "returns the mirror URI" do
expect(settings.mirror_for(uri)).to eq(mirror_uri)
end
it "converts a string parameter to a URI" do
expect(settings.mirror_for("https://rubygems.org/")).to eq(mirror_uri)
end
it "normalizes the URI" do
expect(settings.mirror_for("https://rubygems.org")).to eq(mirror_uri)
end
it "is case insensitive" do
expect(settings.mirror_for("HTTPS://RUBYGEMS.ORG/")).to eq(mirror_uri)
end
end
end
describe "#credentials_for" do
let(:uri) { URI("https://gemserver.example.org/") }
let(:credentials) { "username:password" }
context "with no configured credentials" do
it "returns nil" do
expect(settings.credentials_for(uri)).to be_nil
end
end
context "with credentials configured by URL" do
before { settings["https://gemserver.example.org/"] = credentials }
it "returns the configured credentials" do
expect(settings.credentials_for(uri)).to eq(credentials)
end
end
context "with credentials configured by hostname" do
before { settings["gemserver.example.org"] = credentials }
it "returns the configured credentials" do
expect(settings.credentials_for(uri)).to eq(credentials)
end
end
end
describe "URI normalization" do
it "normalizes HTTP URIs in credentials configuration" do
settings["http://gemserver.example.org"] = "username:password"
expect(settings.all).to include("http://gemserver.example.org/")
end
it "normalizes HTTPS URIs in credentials configuration" do
settings["https://gemserver.example.org"] = "username:password"
expect(settings.all).to include("https://gemserver.example.org/")
end
it "normalizes HTTP URIs in mirror configuration" do
settings["mirror.http://rubygems.org"] = "http://rubygems-mirror.org"
expect(settings.all).to include("mirror.http://rubygems.org/")
end
it "normalizes HTTPS URIs in mirror configuration" do
settings["mirror.https://rubygems.org"] = "http://rubygems-mirror.org"
expect(settings.all).to include("mirror.https://rubygems.org/")
end
it "does not normalize other config keys that happen to contain 'http'" do
settings["local.httparty"] = home("httparty")
expect(settings.all).to include("local.httparty")
end
it "does not normalize other config keys that happen to contain 'https'" do
settings["local.httpsmarty"] = home("httpsmarty")
expect(settings.all).to include("local.httpsmarty")
end
it "reads older keys without trailing slashes" do
settings["mirror.https://rubygems.org"] = "http://rubygems-mirror.org"
expect(settings.gem_mirrors).to eq(URI("https://rubygems.org/") => URI("http://rubygems-mirror.org/"))
end
end
describe "BUNDLE_ keys format" do
let(:settings) { described_class.new(bundled_app('.bundle')) }
it "converts older keys without double dashes" do
config("BUNDLE_MY__PERSONAL.RACK" => "~/Work/git/rack")
expect(settings["my.personal.rack"]).to eq("~/Work/git/rack")
end
it "converts older keys without trailing slashes and double dashes" do
config("BUNDLE_MIRROR__HTTPS://RUBYGEMS.ORG" => "http://rubygems-mirror.org")
expect(settings["mirror.https://rubygems.org/"]).to eq("http://rubygems-mirror.org")
end
it "reads newer keys format properly" do
config("BUNDLE_MIRROR__HTTPS://RUBYGEMS__ORG/" => "http://rubygems-mirror.org")
expect(settings["mirror.https://rubygems.org/"]).to eq("http://rubygems-mirror.org")
end
end
end
| {
"content_hash": "15f42e4b001fa22021c53ff2076c1aab",
"timestamp": "",
"source": "github",
"line_count": 164,
"max_line_length": 108,
"avg_line_length": 32.76219512195122,
"alnum_prop": 0.6495440163781873,
"repo_name": "mattbrictson/bundler-1",
"id": "54485f8ccb95dd797a82968c159853f22f19eeda",
"size": "5373",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "spec/bundler/settings_spec.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "823981"
},
{
"name": "Shell",
"bytes": "115"
}
],
"symlink_target": ""
} |
'use strict';
goog.provide('safelight.application.module');
goog.require('safelight.alerter.module');
goog.require('safelight.assemblyPanel.module');
goog.require('safelight.builder.module');
goog.require('safelight.defaultInputValues.module');
goog.require('safelight.filterManager.module');
goog.require('safelight.htmlPanel.module');
goog.require('safelight.logPanel.module');
goog.require('safelight.naclSniffer.module');
goog.require('safelight.nexeModuleLoader.module');
goog.require('safelight.parameterPanel.module');
goog.require('safelight.runnerPanel.module');
goog.require('safelight.showTail.module');
goog.require('safelight.stmtPanel.module');
goog.require('safelight.textPanel.module');
goog.require('safelight.timingPanel.module');
goog.require('safelight.visualizer.module');
/**
* The main module for the Safelight app.
* @type {!angular.Module}
*/
safelight.application.module =
angular.module('safelight.application', [
'ngCookies',
'ui.bootstrap',
safelight.alerter.module.name,
safelight.assemblyPanel.module.name,
safelight.builder.module.name,
safelight.defaultInputValues.module.name,
safelight.filterManager.module.name,
safelight.htmlPanel.module.name,
safelight.logPanel.module.name,
safelight.naclSniffer.module.name,
safelight.nexeModuleLoader.module.name,
safelight.parameterPanel.module.name,
safelight.runnerPanel.module.name,
safelight.showTail.module.name,
safelight.stmtPanel.module.name,
safelight.textPanel.module.name,
safelight.timingPanel.module.name,
safelight.visualizer.module.name
])
.run([
'alerter',
'builder',
'filterManager',
'naclSniffer',
function(alerter, builder, filterManager, naclSniffer) {
// Ignore result: just forces naclSniffer to be instantiated
// immediately, so that the NaCl fetch-and-load happens in parallel
naclSniffer.getHalideTargets().then(
function(targets) {
console.log('Halide Targets: ' + targets);
},
function(failure) {
console.log('NaCl failure: ' + failure);
alerter.error(
'Native Client appears to be disabled; ' +
'please enable "Native Client" under ' +
'chrome://flags/#enable-nacl and restart Chrome. ');
});
// Bind the filterManager to the builder service by default.
builder.addBuildListener(filterManager.loadFilter.bind(filterManager));
}
]);
| {
"content_hash": "665a623a9b6aaf4f868e49d1970ed6a3",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 79,
"avg_line_length": 35.47945205479452,
"alnum_prop": 0.683011583011583,
"repo_name": "mcanthony/Safelight",
"id": "0ee13e88d53cf2b9c19ccdd34b41ec0daef01d60",
"size": "3205",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "ui/app.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C++",
"bytes": "117230"
},
{
"name": "CSS",
"bytes": "5529"
},
{
"name": "Go",
"bytes": "25696"
},
{
"name": "HTML",
"bytes": "12983"
},
{
"name": "JavaScript",
"bytes": "150868"
},
{
"name": "Shell",
"bytes": "21362"
}
],
"symlink_target": ""
} |
import mongoose, { Schema } from 'mongoose';
import timestamps from 'mongoose-timestamp';
import mongooseStringQuery from 'mongoose-string-query';
import autopopulate from 'mongoose-autopopulate';
import Content from './content';
import { ParseContent } from '../parsers/content';
import { getUrl } from '../utils/urls';
import sanitize from '../utils/sanitize';
import { isBlockedURLs } from '../utils/blockedURLs';
import { EnclosureSchema } from './enclosure';
export const ArticleSchema = new Schema(
{
rss: {
type: Schema.Types.ObjectId,
ref: 'RSS',
required: true,
autopopulate: {
select: [
'title',
'url',
'feedUrl',
'favicon',
'categories',
'description',
'public',
'valid',
'publicationDate',
'lastScraped',
'images',
'featured',
],
},
index: true,
},
duplicateOf: {
type: Schema.Types.ObjectId,
ref: 'Article',
required: false,
},
url: {
type: String,
trim: true,
required: true,
index: { type: 'hashed' },
},
canonicalUrl: {
type: String,
trim: true,
},
fingerprint: {
type: String,
trim: true,
required: true,
},
guid: {
type: String,
trim: true,
},
link: {
type: String,
trim: true,
},
title: {
type: String,
trim: true,
required: true,
},
description: {
type: String,
trim: true,
// maxLength: 240,
default: '',
},
content: {
type: String,
trim: true,
default: '',
},
commentUrl: {
type: String,
trim: true,
default: '',
},
images: {
featured: {
type: String,
trim: true,
default: '',
},
banner: {
type: String,
trim: true,
default: '',
},
favicon: {
type: String,
trim: true,
default: '',
},
og: {
type: String,
trim: true,
default: '',
},
},
publicationDate: {
type: Date,
default: Date.now,
},
enclosures: [EnclosureSchema],
likes: {
type: Number,
default: 0,
},
socialScore: {
reddit: {
type: Number,
},
hackernews: {
type: Number,
},
},
valid: {
type: Boolean,
default: true,
valid: true,
},
},
{
collection: 'articles',
toJSON: {
transform: function (doc, ret) {
// Frontend breaks if images is null, should be {} instead
if (!ret.images) {
ret.images = {};
}
ret.images.favicon = ret.images.favicon || '';
ret.images.og = ret.images.og || '';
ret.type = 'articles';
},
},
toObject: {
transform: function (doc, ret) {
// Frontend breaks if images is null, should be {} instead
if (!ret.images) {
ret.images = {};
}
ret.images.favicon = ret.images.favicon || '';
ret.images.og = ret.images.og || '';
ret.type = 'articles';
},
},
},
);
ArticleSchema.plugin(timestamps, {
createdAt: { index: true },
updatedAt: { index: true },
});
ArticleSchema.plugin(mongooseStringQuery);
ArticleSchema.plugin(autopopulate);
ArticleSchema.index({ rss: 1, fingerprint: 1 }, { unique: true });
ArticleSchema.index({ rss: 1, publicationDate: -1 });
ArticleSchema.index({ publicationDate: -1 });
ArticleSchema.methods.getUrl = function () {
return getUrl('article_detail', this.rss._id, this._id);
};
ArticleSchema.methods.getParsedArticle = async function () {
const url = this.url;
const content = await Content.findOne({ url });
if (content) return content;
if (isBlockedURLs(url)) {
throw new Error(`Blocked URL: ${this.url}`);
}
try {
const parsed = await ParseContent(url);
const title = parsed.title || this.title;
const excerpt = parsed.excerpt || title || this.description;
if (!title) return null;
let content = sanitize(parsed.content);
// XKCD doesn't like Mercury
if (this.url.indexOf('https://xkcd') === 0) content = this.content;
return await Content.create({
content,
title,
url,
excerpt,
image: parsed.lead_image_url || '',
publicationDate: parsed.date_published || this.publicationDate,
commentUrl: this.commentUrl,
enclosures: this.enclosures,
});
} catch (e) {
throw new Error(`Mercury call failed for ${this.url}: ${e.message}`);
}
};
module.exports = exports = mongoose.model('Article', ArticleSchema);
module.exports.ArticleSchema = ArticleSchema;
| {
"content_hash": "be75bb4fbd45f33daa5047670dbf1271",
"timestamp": "",
"source": "github",
"line_count": 212,
"max_line_length": 71,
"avg_line_length": 20.17924528301887,
"alnum_prop": 0.6042543244506778,
"repo_name": "GetStream/Winds",
"id": "3a5a3534c08488f21f785fd0b14db667704b4218",
"size": "4278",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "api/src/models/article.js",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "74902"
},
{
"name": "DIGITAL Command Language",
"bytes": "754629"
},
{
"name": "Dockerfile",
"bytes": "898"
},
{
"name": "HTML",
"bytes": "1198472"
},
{
"name": "JavaScript",
"bytes": "728128"
},
{
"name": "Shell",
"bytes": "1605"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using QuantConnect.Indicators;
using QuantConnect.Orders;
using QuantConnect.Securities;
namespace QuantConnect.Algorithm.CSharp
{
public class Sig10Strategy : BaseStrategy
{
#region "fields"
private bool bReverseTrade = false;
public decimal RevPct = 1.0015m;
private decimal _lossThreshhold = -50;
private decimal _tolerance = -.001m;
private int _period; // used to size the length of the trendArray
private Indicator _price;
public InstantaneousTrend Trend;
public Momentum TrendMomentum;
public RollingWindow<decimal> MomentumWindow;
public bool IsActive = true;
public int TradeAttempts = 0;
public OrderStatus Status = OrderStatus.None;
public string comment = string.Empty;
private SecurityHolding _holding;
#endregion
#region "Properties"
/// <summary>
/// The symbol being processed
/// </summary>
public Symbol symbol { get; set; }
public int Id { get; set; }
/// <summary>
/// The entry price from the last trade, set from the outside
/// </summary>
public decimal nEntryPrice { get; set; }
/// <summary>
/// The crossover carried from one instance to the next via serialization
/// set to 1 when (nTrig Greater Than the current trend)
/// set to -1 when (nTrig less than the current trend)
/// It needs to be public because it is Serialized
/// </summary>
public int xOver { get; set; }
/// <summary>
/// The trigger use in the decision process
/// Used internally only, not serialized or set from the outside
/// </summary>
public decimal nTrig { get; set; }
/// <summary>
/// True if the the order was filled in the last trade. Mostly used after Limit orders
/// It needs to be public because it is set from the outside by checking the ticket in the Transactions collection
/// </summary>
public Boolean orderFilled { get; set; }
/// <summary>
/// A flag to disable the trading. True means make the trade. This is left over from the
/// InstantTrendStrategy where the trade was being made in the strategy.
/// </summary>
//public Boolean maketrade { get; set; }
/// <summary>
/// The array used to keep track of the last n trend inputs
/// It works like a RollingWindow by pushing down the [0] to [1] etc. before updating the [0]
/// </summary>
public decimal[] trendArray { get; set; }
/// <summary>
/// The bar count from the algorithm
/// This is set each time through to the barcount in the algorithm
/// </summary>
public int Barcount { get; set; }
/// <summary>
/// The state of the portfolio. This is pushed in each time it is run from the Portfolio
/// it is not Serialized.
/// </summary>
public bool IsShort { get; set; }
/// <summary>
/// The state of the portfolio. This is pushed in each time it is run from the Portfolio
/// </summary>
public bool IsLong { get; set; }
/// <summary>
/// Internal state variables. This POCO is used to report the internal state of the Signal.
/// </summary>
public SigC sigC { get; set; }
public decimal UnrealizedProfit { get; set; }
private bool BarcountLT4 { get; set; }
private bool NTrigLTEP { get; set; }
private bool NTrigGTEP { get; set; }
private bool NTrigGTTA0 { get; set; }
private bool NTrigLTTA0 { get; set; }
private bool ReverseTrade { get; set; }
private bool xOverIsPositive { get; set; }
private bool xOverisNegative { get; set; }
private bool OrderFilled { get; set; }
#endregion
public Sig10Strategy(SecurityHolding sym, Indicator priceIdentity, int trendPeriod, decimal lossThreshhold, decimal tolerance, decimal revertPct)
{
trendArray = new decimal[trendPeriod + 1]; // initialized to 0. Add a period for Deserialize to make IsReady true
symbol = sym.Symbol;
_holding = sym;
_price = priceIdentity;
_period = trendPeriod;
_lossThreshhold = lossThreshhold;
_tolerance = tolerance;
RevPct = revertPct;
Trend = new InstantaneousTrend(sym.Symbol.Value, 7, .24m).Of(priceIdentity);
TrendMomentum = new Momentum(2).Of(Trend);
MomentumWindow = new RollingWindow<decimal>(2);
ActualSignal = OrderSignal.doNothing;
Trend.Updated += (object sender, IndicatorDataPoint updated) =>
{
Barcount++;
UpdateTrendArray(Trend.Current.Value);
nTrig = Trend.Current.Value;
if (Trend.IsReady)
{
TrendMomentum.Update(Trend.Current);
}
if (TrendMomentum.IsReady)
MomentumWindow.Add(TrendMomentum.Current.Value);
if (MomentumWindow.IsReady)
CheckSignal();
};
}
public override void CheckSignal()
{
ActualSignal = OrderSignal.doNothing;
if (Barcount < 4)
{
BarcountLT4 = true;
comment = "Barcount < 4";
nTrig = Trend.Current.Value;
ActualSignal = OrderSignal.doNothing;
}
else
{
nTrig = 2m * trendArray[0] - trendArray[2];
IsShort = _holding.IsShort;
IsLong = _holding.IsLong;
#region "Selection Logic Reversals"
ActualSignal = CheckLossThreshhold(ref comment, ActualSignal);
if (Barcount>17)
Debug.WriteLine("Bar count > 17");
if (nTrig < (Math.Abs(nEntryPrice) / RevPct))
{
NTrigLTEP = true;
if (IsLong)
{
ActualSignal = OrderSignal.revertToShort;
bReverseTrade = true;
ReverseTrade = true;
comment =
string.Format("nTrig {0} < (nEntryPrice {1} * RevPct {2}) {3} IsLong {4} )",
Math.Round(nTrig, 4),
nEntryPrice,
RevPct,
NTrigLTEP,
IsLong);
}
else
{
NTrigLTEP = false;
}
}
else
{
if (nTrig > (Math.Abs(nEntryPrice) * RevPct))
{
NTrigGTEP = true;
if (IsShort)
{
ActualSignal = OrderSignal.revertToLong;
bReverseTrade = true;
ReverseTrade = true;
comment =
string.Format("nTrig {0} > (nEntryPrice {1} * RevPct {2}) {3} IsLong {4} )",
Math.Round(nTrig, 4),
nEntryPrice,
RevPct,
NTrigLTEP,
IsLong);
}
else
{
NTrigGTEP = false;
}
}
}
#endregion
#region "selection logic buy/sell"
ActualSignal = CheckLossThreshhold(ref comment, ActualSignal);
if (!bReverseTrade)
{
if (nTrig > trendArray[0])
{
NTrigGTTA0 = true;
if (xOver == -1)
{
#region "If Not Long"
if (!IsLong)
{
if (!orderFilled)
{
ActualSignal = OrderSignal.goLong;
comment =
string.Format(
"nTrig {0} > trend {1} xOver {2} !IsLong {3} !orderFilled {4}",
Math.Round(nTrig, 4),
Math.Round(trendArray[0], 4),
xOver,
!IsLong,
!orderFilled);
}
else
{
ActualSignal = OrderSignal.goLongLimit;
comment =
string.Format(
"nTrig {0} > trend {1} xOver {2} !IsLong {3} !orderFilled {4}",
Math.Round(nTrig, 4),
Math.Round(trendArray[0], 4),
xOver,
!IsLong,
!orderFilled);
}
}
#endregion
}
if (comment.Length == 0)
comment = "Trigger over trend - setting xOver to 1";
xOver = 1;
xOverisNegative = xOver < 0;
xOverIsPositive = xOver > 0;
}
else
{
if (nTrig < trendArray[0])
{
NTrigLTTA0 = true;
if (xOver == 1)
{
#region "If Not Short"
if (!IsShort)
{
if (!orderFilled)
{
ActualSignal = OrderSignal.goShort;
comment =
string.Format(
"nTrig {0} < trend {1} xOver {2} !isShort {3} orderFilled {4}",
Math.Round(nTrig, 4),
Math.Round(trendArray[0], 4),
xOver,
!IsShort,
!orderFilled);
}
else
{
ActualSignal = OrderSignal.goShortLimit;
comment =
string.Format(
"nTrig {0} < trend {1} xOver {2} !isShort {3} orderFilled {4}",
Math.Round(nTrig, 4),
Math.Round(trendArray[0], 4),
xOver,
!IsShort,
!orderFilled);
}
}
#endregion
}
if (comment.Length == 0)
comment = "Trigger under trend - setting xOver to -1";
xOver = -1;
xOverisNegative = xOver < 0;
xOverIsPositive = xOver > 0;
}
}
}
#endregion
}
}
private void UpdateTrendArray(decimal trendCurrent)
{
for (int i = trendArray.Length - 2; i >= 0; i--)
{
trendArray[i + 1] = trendArray[i];
}
trendArray[0] = trendCurrent;
}
private OrderSignal CheckLossThreshhold(ref string comment, OrderSignal retval)
{
//if (Barcount >= 376)
// System.Diagnostics.Debug.WriteLine("Barcount: " + Barcount);
if (UnrealizedProfit < _lossThreshhold)
{
if (IsLong)
{
retval = OrderSignal.goShortLimit;
}
if (IsShort)
{
retval = OrderSignal.goLongLimit;
}
comment = string.Format("Unrealized loss exceeded {0}", _lossThreshhold);
bReverseTrade = true;
}
return retval;
}
/// <summary>
/// Convenience function which creates an IndicatorDataPoint
/// </summary>
/// <param name="time">DateTime - the bar time for the IndicatorDataPoint</param>
/// <param name="value">decimal - the value for the IndicatorDataPoint</param>
/// <returns>a new IndicatorDataPoint</returns>
/// <remarks>I use this function to shorten the a Add call from
/// new IndicatorDataPoint(this.Time, value)
/// Less typing.</remarks>
private IndicatorDataPoint idp(DateTime time, decimal value)
{
return new IndicatorDataPoint(time, value);
}
}
}
| {
"content_hash": "f828a3b5582864eef379a66059b571a8",
"timestamp": "",
"source": "github",
"line_count": 364,
"max_line_length": 153,
"avg_line_length": 39.48076923076923,
"alnum_prop": 0.417368311182242,
"repo_name": "bizcad/LeanJJN",
"id": "aaa8ac161b7fc1b8812a2f87226990ddb4e5c0ed",
"size": "14373",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Algorithm.CSharp/BizcadAlgorithms/Signal/Sig10Strategy.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "2792"
},
{
"name": "C#",
"bytes": "5168885"
},
{
"name": "F#",
"bytes": "1723"
},
{
"name": "Java",
"bytes": "852"
},
{
"name": "Python",
"bytes": "632"
},
{
"name": "Shell",
"bytes": "2324"
},
{
"name": "Visual Basic",
"bytes": "2448"
}
],
"symlink_target": ""
} |
require 'rspec/core/source/node'
class RSpec::Core::Source
RSpec.describe Node, :if => RSpec::Support::RubyFeatures.ripper_supported? do
let(:root_node) do
Node.new(sexp)
end
let(:sexp) do
require 'ripper'
Ripper.sexp(source)
end
let(:source) { <<-END }
variable = do_something(1, 2)
variable.do_anything do |arg|
puts arg
end
END
# [:program,
# [[:assign,
# [:var_field, [:@ident, "variable", [1, 6]]],
# [:method_add_arg,
# [:fcall, [:@ident, "do_something", [1, 17]]],
# [:arg_paren,
# [:args_add_block,
# [[:@int, "1", [1, 30]], [:@int, "2", [1, 33]]],
# false]]]],
# [:method_add_block,
# [:call,
# [:var_ref, [:@ident, "variable", [2, 6]]],
# :".",
# [:@ident, "do_anything", [2, 15]]],
# [:do_block,
# [:block_var,
# [:params, [[:@ident, "arg", [2, 31]]], nil, nil, nil, nil, nil, nil],
# false],
# [[:command,
# [:@ident, "puts", [3, 8]],
# [:args_add_block, [[:var_ref, [:@ident, "arg", [3, 13]]]], false]]]]]]]
describe '#args' do
context 'when the sexp args consist of direct child sexps' do
let(:target_node) do
root_node.find { |node| node.type == :method_add_arg }
end
it 'returns the child nodes' do
expect(target_node.args).to match([
an_object_having_attributes(:type => :fcall),
an_object_having_attributes(:type => :arg_paren)
])
end
end
context 'when the sexp args include an array of sexps' do
let(:target_node) do
root_node.find { |node| node.type == :args_add_block }
end
it 'returns pseudo group node for the array' do
expect(target_node.args).to match([
an_object_having_attributes(:type => :group),
false
])
end
end
end
describe '#each_ancestor' do
let(:target_node) do
root_node.find { |node| node.type == :arg_paren }
end
it 'yields ancestor nodes from parent to root' do
expect { |b| target_node.each_ancestor(&b) }.to yield_successive_args(
an_object_having_attributes(:type => :method_add_arg),
an_object_having_attributes(:type => :assign),
an_object_having_attributes(:type => :group),
an_object_having_attributes(:type => :program)
)
end
end
describe '#location' do
context 'with identifier type node' do
let(:target_node) do
root_node.find { |node| node.type == :@ident }
end
it 'returns a Location object with line and column numbers' do
expect(target_node.location).to have_attributes(:line => 1, :column => 6)
end
end
context 'with non-identifier type node' do
let(:target_node) do
root_node.find { |node| node.type == :assign }
end
it 'returns nil' do
expect(target_node.location).to be_nil
end
end
end
describe '#inspect' do
it 'returns a string including class name and node type' do
expect(root_node.inspect).to eq('#<RSpec::Core::Source::Node program>')
end
end
end
end
| {
"content_hash": "602e60cd4e4ed4ecadf557ec223cb847",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 83,
"avg_line_length": 29.210526315789473,
"alnum_prop": 0.5249249249249249,
"repo_name": "unite-us/rspec-rails",
"id": "7f3066a1f2e4092f656bba35a34db7858aa8d80c",
"size": "3330",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "gems/rspec-core/spec/rspec/core/source/node_spec.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "257"
},
{
"name": "Cucumber",
"bytes": "534635"
},
{
"name": "HTML",
"bytes": "15527"
},
{
"name": "Ruby",
"bytes": "3029600"
},
{
"name": "Shell",
"bytes": "63098"
}
],
"symlink_target": ""
} |
package com.github.sbouclier.jaads.sort;
import static org.junit.Assert.assertArrayEquals;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.util.Arrays;
import java.util.List;
import org.junit.Test;
/**
* Bogosort test
*
* @author Stéphane Bouclier
*
*/
public class BogosortTest {
@Test
public void should_sort() {
List<Integer> list = Arrays.asList(3, 2, 8, 4);
Bogosort.sort(list);
assertArrayEquals(new Integer[] { 2, 3, 4, 8 }, list.toArray());
}
@Test
public void should_sort_empty_list() {
List<Integer> list = Arrays.asList();
Bogosort.sort(list);
assertArrayEquals(new Integer[] {}, list.toArray());
}
@Test(expected = UnsupportedOperationException.class)
public void should_not_instanciate_class() throws Throwable {
final Constructor<Bogosort> constructor = Bogosort.class.getDeclaredConstructor();
constructor.setAccessible(true);
try {
constructor.newInstance();
} catch (InvocationTargetException e) {
throw e.getTargetException();
}
}
}
| {
"content_hash": "ad3c72ab8e966e58b4080aadb7085729",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 84,
"avg_line_length": 22.51063829787234,
"alnum_prop": 0.7268431001890359,
"repo_name": "sbouclier/java-algorithms-and-data-structures",
"id": "09b183ed3438ba7237542bb487fc263235ae010b",
"size": "1059",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/test/java/com/github/sbouclier/jaads/sort/BogosortTest.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "46391"
}
],
"symlink_target": ""
} |
require 'spec_helper'
describe PerformLater do
end | {
"content_hash": "50d50126ddd9777e13dfe00a62f7ba32",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 24,
"avg_line_length": 10.8,
"alnum_prop": 0.7777777777777778,
"repo_name": "KensoDev/perform_later",
"id": "787008ce006d7d5e0e8c48044792b7fe47a211df",
"size": "54",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "spec/lib/perform_later_spec.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "30187"
}
],
"symlink_target": ""
} |
<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
/*Route::get('/', 'HomeController@index');
Route::get('home', 'HomeController@index');
Route::controllers([
'auth' => 'Auth\AuthController',
'password' => 'Auth\PasswordController',
]);*/
Route::controllers([
'auth' => 'Auth\AuthController',
'password' => 'Auth\PasswordController'
]);
//Route::get('auth/login', 'Auth\AuthController@getLogin');
Route::get('/', ['middleware' => ['auth'], 'uses' => 'HomeController@index']);
Route::resource('projects', 'ProjectController');
Route::resource('tasks', 'TaskController');
Route::post('tasks/update2', 'TaskController@update2');
Route::post('tasks/upload_file', 'TaskController@upload_file');
Route::resource('issues', 'IssueController');
Route::post('issues/update2', 'IssueController@update2');
Route::get('users/user_list', ['uses' => 'Auth\AuthController@getUserList']);
Route::get('users/edit/{id}', ['uses' => 'Auth\AuthController@userEdit']);
Route::post('users/update', ['uses' => 'Auth\AuthController@update']);
Route::get('users/delete/{id}', ['uses' => 'Auth\AuthController@destroy']);
Route::resource('timesheets', 'TimesheetController');
Route::post('timesheets/taskByProjectID', 'TimesheetController@taskByProjectID');
Route::resource('file_manager', 'FileManagerController');
Route::post('file_manager/upload', 'FileManagerController@upload');
Route::post('file_manager/delete_temp_file', 'FileManagerController@delete_temp_file');
Route::post('file_manager/get_issue_files', 'FileManagerController@get_issue_files');
Route::post('file_manager/get_task_files', 'FileManagerController@get_task_files');
//Route::get('file_manager/delete_file/{id}', 'FileManagerController@delete_file');
Route::get('reports/project_list', 'ReportController@project_list');
Route::get('reports/project_detail/{id}', ['uses' => 'Auth\AuthController@destroy']);
Route::post('/sendmail', 'EmailController@sendmail'); | {
"content_hash": "120570d56818284b1503a57fcbfb7748",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 87,
"avg_line_length": 38.40677966101695,
"alnum_prop": 0.6707855251544572,
"repo_name": "icteuro/pm",
"id": "9a58a6a6413b01e4a833972ef99262e3c91d37a2",
"size": "2266",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/Http/routes.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "357"
},
{
"name": "HTML",
"bytes": "233152"
},
{
"name": "JavaScript",
"bytes": "613771"
},
{
"name": "PHP",
"bytes": "123951"
}
],
"symlink_target": ""
} |
class ShareReviewToFacebookJob < ApplicationJob
queue_as :default
def perform(user_id, review_id)
user = User.find(user_id)
review = user.reviews.published.find(review_id)
work_image = review.work.work_image
image_url = if work_image.present? && Rails.env.production?
work_image.decorate.image_url(:attachment, size: "600x315")
else
"https://annict.com/images/og_image.png"
end
FacebookService.new(user).share_review!(review, image_url)
end
end
| {
"content_hash": "264a6961117e508ce6c3e5c4e015b21d",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 65,
"avg_line_length": 29.058823529411764,
"alnum_prop": 0.6983805668016194,
"repo_name": "elzzup/annict",
"id": "19baee4fc50f8a2e1a8fdae43c2f489d5a0e5d0c",
"size": "525",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/jobs/share_review_to_facebook_job.rb",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "48592"
},
{
"name": "CoffeeScript",
"bytes": "16467"
},
{
"name": "HTML",
"bytes": "153898"
},
{
"name": "JavaScript",
"bytes": "791"
},
{
"name": "Ruby",
"bytes": "294320"
}
],
"symlink_target": ""
} |
package org.wso2.carbon.identity.mgt.endpoint.serviceclient.beans;
import org.wso2.carbon.identity.mgt.beans.User;
import org.wso2.carbon.identity.mgt.endpoint.serviceclient.model.UserChallengeAnswer;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import java.io.Serializable;
/**
* Store attributes required to verify single challenge question answer
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(propOrder = {
"user",
"answer",
"code"
})
@XmlRootElement(name = "verifyAnswerRequest")
public class VerifyAnswerRequest implements Serializable {
@XmlElement(required = true)
private User user;
@XmlElement(required = true)
private UserChallengeAnswer answer;
@XmlElement(required = true)
private String code;
public VerifyAnswerRequest() {
}
public VerifyAnswerRequest(User user, UserChallengeAnswer answer, String code) {
this.user = user;
this.answer = answer;
this.code = code;
}
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public UserChallengeAnswer getAnswer() {
return answer;
}
public void setAnswer(UserChallengeAnswer answer) {
this.answer = answer;
}
}
| {
"content_hash": "b70f2a262e50a66a8556e9e7c755d028",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 85,
"avg_line_length": 24.196969696969695,
"alnum_prop": 0.6931747025673137,
"repo_name": "nuwandi-is/identity-framework",
"id": "8c494e6be18ed4e0d64693aa26ddca32cb595046",
"size": "2274",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "components/identity-mgt/org.wso2.carbon.identity.mgt.endpoint/src/main/java/org/wso2/carbon/identity/mgt/endpoint/serviceclient/beans/VerifyAnswerRequest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "117871"
},
{
"name": "HTML",
"bytes": "78224"
},
{
"name": "Java",
"bytes": "9456745"
},
{
"name": "JavaScript",
"bytes": "473754"
},
{
"name": "PLSQL",
"bytes": "70461"
},
{
"name": "Thrift",
"bytes": "338"
},
{
"name": "XSLT",
"bytes": "1030"
}
],
"symlink_target": ""
} |
CosaWirelessDS18B20
===================
Demonstration sending temperature readings from two 1-Wire DS18B20
devices over the Wireless Interface and devices. Uses power down mode
with only watchdog active (5-6 uA on ATtiny85-20PU). This sketch is
designed to run on an ATtiny85 running on the internal 8 MHz clock.
Circuit
-------
Connect RF433/315 Transmitter Data to ATtiny85 D0, connect VCC
GND. Connect 1-Wire digital thermometer to D3 with pullup resistor.
The pullup resistor (4K7) may be connected to D4 to allow active power
control. This sketch supports parasite powered DS18B20 devices.
Connect the DS18B20 VCC to GND.
| {
"content_hash": "1f5675052fd9b19494bb8e360e4e9f78",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 70,
"avg_line_length": 39.5625,
"alnum_prop": 0.7740916271721959,
"repo_name": "UECIDE/UECIDE_data",
"id": "3f93fbc5ce56b546501d2e6c2461d6ebd37d4be8",
"size": "633",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "cores/Cosa/examples/Wireless/CosaWirelessDS18B20/README.md",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Arduino",
"bytes": "3816646"
},
{
"name": "Assembly",
"bytes": "1421566"
},
{
"name": "C",
"bytes": "546627695"
},
{
"name": "C++",
"bytes": "113272035"
},
{
"name": "CSS",
"bytes": "64919"
},
{
"name": "Emacs Lisp",
"bytes": "237675"
},
{
"name": "Erlang",
"bytes": "5952"
},
{
"name": "Java",
"bytes": "3443"
},
{
"name": "JavaScript",
"bytes": "22190"
},
{
"name": "Max",
"bytes": "312593"
},
{
"name": "Objective-C",
"bytes": "98663423"
},
{
"name": "Perl",
"bytes": "563426"
},
{
"name": "Processing",
"bytes": "1052533"
},
{
"name": "Pure Data",
"bytes": "9910"
},
{
"name": "Python",
"bytes": "383681"
},
{
"name": "Shell",
"bytes": "800332"
},
{
"name": "Tcl",
"bytes": "1379995"
},
{
"name": "TeX",
"bytes": "510"
},
{
"name": "XC",
"bytes": "79648"
}
],
"symlink_target": ""
} |
module.exports = function (grunt) {
//#region Global Properties
var // Init
_ = grunt.util._,
EOL = grunt.util.linefeed,
URL = require('url'),
path = require('path'),
beautifier = require('js-beautify'),
beautify = {
js: beautifier.js,
css: beautifier.css,
html: beautifier.html
},
// Tags Regular Expressions
regexTagStartTemplate = "<!--\\s*%parseTag%:(\\w+)\\s*(inline)?\\s*(optional)?\\s*(recursive)?\\s*(noprocess)?\\s*([^\\s]*)\\s*-->", // <!-- build:{type} [inline] [optional] [recursive] {name} --> {} required [] optional
regexTagEndTemplate = "<!--\\s*\\/%parseTag%\\s*-->", // <!-- /build -->
regexTagStart = "",
regexTagEnd = "",
isFileRegex = /\.(\w+){2,4}$/;
//#endregion
//#region Private Methods
function getBuildTags(content) {
var lines = content.replace(/\r\n/g, '\n').split(/\n/),
tag = false,
tags = [],
last;
lines.forEach(function (l) {
var tagStart = l.match(new RegExp(regexTagStart)),
tagEnd = new RegExp(regexTagEnd).test(l);
if (tagStart) {
tag = true;
last = {
type: tagStart[1],
inline: !!tagStart[2],
optional: !!tagStart[3],
recursive: !!tagStart[4],
noprocess: !!tagStart[5],
name: tagStart[6],
lines: []
};
tags.push(last);
}
// switch back tag flag when endbuild
if (tag && tagEnd) {
last.lines.push(l);
tag = false;
}
if (tag && last) {
last.lines.push(l);
}
});
return tags;
}
function validateBlockWithName(tag, params) {
var src = params[tag.type + "s"],
keys = tag.name.split("."),
ln = keys.length;
for (var i = 0; i < ln; i++) {
src = src[keys[i]]; // Search target
}
if (src) {
var opt = {},
files = src;
if (_.isObject(src)) {
if (src.files) {
opt = _.omit(src, "files");
files = src.files;
}
else {
// if paths are named, just take values
files = _.values(src);
}
}
files = grunt.file.expand(opt, files);
if (params.relative && opt.cwd) {
files = files.map(function (src) { return path.join(opt.cwd, src); });
}
return files;
}
}
function validateBlockAlways(tag) {
return true;
}
function setTagRegexes(parseTag) {
regexTagStart = regexTagStartTemplate.replace(/%parseTag%/, function () { return parseTag });
regexTagEnd = regexTagEndTemplate.replace(/%parseTag%/, function () { return parseTag });
}
//#endregion
//#region Processors Methods
function createTemplateData(options, extend) {
return {
data: extend ? _.extend({}, options.data, extend) : options.data
};
}
function processTemplate(template, options, extend) {
return grunt.template.process(template, createTemplateData(options, extend));
}
function processHtmlTagTemplate(options, extend) {
var template = templates[options.type + (options.inline ? "-inline" : "")];
if (options.noprocess) {
return template.replace("<%= src %>", extend.src);
}
else {
return processTemplate(template, options, extend);
}
}
function processHtmlTag(options) {
if (options.inline) {
var content = options.files.map(grunt.file.read).join(EOL);
return processHtmlTagTemplate(options, { src: content });
}
else {
return options.files.map(function (f) {
var url = options.relative ? path.relative(options.dest, f) : f;
url = url.replace(/\\/g, '/');
if (options.prefix) {
url = URL.resolve(options.prefix.replace(/\\/g, '/'), url);
}
return processHtmlTagTemplate(options, { src: url });
}).join(EOL);
}
}
//#endregion
//#region Processors / Validators / Templates
var
templates = {
'script': '<script type="text/javascript" src="<%= src %>"></script>',
'script-inline': '<script type="text/javascript"><%= src %></script>',
'component': '<link rel="import" href="<%= src %>" />',
'style': '<link type="text/css" rel="stylesheet" href="<%= src %>" />',
'style-inline': '<style><%= src %></style>'
},
validators = {
script: validateBlockWithName,
style: validateBlockWithName,
component: validateBlockWithName,
section: validateBlockWithName,
process: validateBlockAlways,
remove: validateBlockAlways,
//base method
validate: function (tag, params) {
return validators[tag.type](tag, params);
}
},
processors = {
script: processHtmlTag,
style: processHtmlTag,
component: processHtmlTag,
section: function (options) {
return options.files.map(function (f) {
var content = grunt.file.read(f).toString();
return options.recursive ?
transformContent(content, options.params, options.dest) :
content;
}).join(EOL);
},
process: function (options) {
return options.lines
.map(function (l) { return processTemplate(l, options); })
.join(EOL)
.replace(new RegExp(regexTagStart), "")
.replace(new RegExp(regexTagEnd), "");
},
remove: function (options) {
if (!options.name) return "";
var targets = options.name.split(",");
if (targets.indexOf(grunt.task.current.target) < 0) {
return options.lines.join(EOL).replace(new RegExp(regexTagStart), "").replace(new RegExp(regexTagEnd), "");
}
return "";
},
//base method
transform: function (options) {
return processors[options.type](options);
}
};
//#endregion
function transformContent(content, params, dest) {
var tags = getBuildTags(content),
config = grunt.config();
tags.forEach(function (tag) {
var raw = tag.lines.join(EOL),
result = "",
tagFiles = validators.validate(tag, params);
if (tagFiles) {
var options = _.extend({}, tag, {
data: _.extend({}, config, params.data),
files: tagFiles,
dest: dest,
prefix: params.prefix,
relative: params.relative,
params: params
});
result = processors.transform(options);
}
else if (tag.optional) {
if (params.logOptionals)
grunt.log.error().error("Tag with type: '" + tag.type + "' and name: '" + tag.name + "' is not configured in your Gruntfile.js but is set optional, deleting block !");
}
else {
grunt.fail.warn("Tag with type '" + tag.type + "' and name: '" + tag.name + "' is not configured in your Gruntfile.js !");
}
content = content.replace(raw, function () { return result });
});
if (params.beautify) {
content = beautify.html(content, _.isObject(params.beautify) ? params.beautify : {});
}
return content;
}
grunt.registerMultiTask('htmlbuild', "Grunt HTML Builder - Replace scripts and styles, Removes debug parts, append html partials, Template options", function () {
var params = this.options({
beautify: false,
logOptionals: false,
relative: true,
scripts: {},
styles: {},
components: {},
sections: {},
data: {},
parseTag: 'build'
});
setTagRegexes(params.parseTag);
this.files.forEach(function (file) {
var dest = file.dest || "",
destPath, content;
file.src.forEach(function (src) {
if (params.replace) {
destPath = src;
}
else if (isFileRegex.test(dest)) {
destPath = dest;
}
else {
destPath = path.join(dest, path.basename(src));
}
content = transformContent(grunt.file.read(src), params, dest);
// write the contents to destination
grunt.file.write(destPath, content);
grunt.log.ok("File " + destPath + " created !");
});
});
});
};
| {
"content_hash": "f98eed1b01c3783fa673d4a9423407c7",
"timestamp": "",
"source": "github",
"line_count": 294,
"max_line_length": 228,
"avg_line_length": 32.734693877551024,
"alnum_prop": 0.47163341645885287,
"repo_name": "techfano/swamPolymer",
"id": "a17869aba48563dd3b2cad7c8e52d529dfee8831",
"size": "10867",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "build-html-modified.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1496"
},
{
"name": "HTML",
"bytes": "5875"
},
{
"name": "JavaScript",
"bytes": "30433"
}
],
"symlink_target": ""
} |
'use strict';
var nock = require('nock');
var sinon = require('sinon');
var expect = require('chai').expect;
var Promise = require('es6-promise').Promise;
var SapHelper = require('../../services/sapHelper');
var testCredentials = require('../support/testCredentials');
describe('SapHelper', function () {
this.timeout(6000);
describe('execute', function () {
var options,
sapHelper,
accessToken,
mockToken = 'mock_token',
expectedResult = { 'id': '1' },
credentials = testCredentials;
beforeEach(function () {
options = {
method: 'GET',
path: 'Customers'
};
credentials = JSON.parse(JSON.stringify(testCredentials));
sapHelper = new SapHelper(credentials);
accessToken = sinon.stub(sapHelper.authService, 'accessToken');
accessToken.returns(Promise.resolve('mock_token'));
});
afterEach(function () {
accessToken.restore();
});
it('sends a custom GET request', function (done) {
nock(sapHelper.httpUri)
.get('/' + sapHelper.version +
'/' + options.path +
'?pasta=true&access_token=' + mockToken)
.reply(200, expectedResult);
options.params = {
pasta: true
};
sapHelper.execute(options, function (err, data, status) {
expect(status).to.equal(200);
expect(data).to.eql(expectedResult);
done();
});
});
it('sends a custom POST request', function (done) {
var customer = {
"customerType": "INDIVIDUAL_CUSTOMER",
"firstName": "Rick",
"lastName": "Morty",
"stage": "CUSTOMER"
};
nock(sapHelper.httpUri)
.post('/' + sapHelper.version +
'/' + options.path +
'?access_token=' + mockToken)
.reply(201, 1);
options.method = 'POST';
options.body = customer;
sapHelper.execute(options, function (err, data, status) {
expect(status).to.equal(201);
expect(data).to.equal(1);
done();
});
});
describe('when it receives an error status code', function () {
it('passes an error to the callback', function (done) {
options.path = 'Invalid';
var mockErrorMessage = 'Mock 404 error message';
var badRequest = nock(sapHelper.httpUri)
.get('/' + sapHelper.version +
'/' + options.path +
'?access_token=' + mockToken)
.reply(404, {
errorCode: 1234,
message: mockErrorMessage
});
sapHelper.execute(options, function (err, data, status) {
expect(err.message).to.equal(404 + ' error: ' + mockErrorMessage);
expect(status).to.equal(404);
expect(badRequest.isDone()).to.be.true;
done();
});
});
});
describe('when unable to authorize', function () {
it('passes an error to the callback', function (done) {
var authError = new Error('Mock error message');
credentials.client_id = 'invalid';
// create new sapHelper with invalid credentials
sapHelper = new SapHelper(credentials);
// re-stub accessToken
accessToken = sinon.stub(sapHelper.authService, 'accessToken');
accessToken.returns(Promise.reject(authError));
sapHelper.execute(options, function (err, data, status) {
expect(err.message).to.equal(authError.message);
done();
});
});
});
});
});
| {
"content_hash": "298d93964a5a129130d2ca083e2fe189",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 76,
"avg_line_length": 28.94214876033058,
"alnum_prop": 0.5711022272986864,
"repo_name": "DarylRodrigo/node-sap",
"id": "45d33f5d48b5d10cf0d709ac66ebdf775b9fe4f0",
"size": "3502",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/unit/sapHelperSpec.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "38032"
}
],
"symlink_target": ""
} |
title: |
Correlation from the Scatter Plot
rdname: ggally_cor
date: 2015-10-22
output: html_document
layout: article
category: ggally
images:
- /allYourFigureAreBelongToUs/figure/source/1991-05-31-ggally_cor//ggally_cor-1.png
- /allYourFigureAreBelongToUs/figure/source/1991-05-31-ggally_cor//ggally_cor-2.png
- /allYourFigureAreBelongToUs/figure/source/1991-05-31-ggally_cor//ggally_cor-3.png
---
{% highlight r %}
data(tips, package = "reshape")
ggally_cor(tips, mapping = ggplot2::aes_string(x = "total_bill", y = "tip"))
{% endhighlight %}

{% highlight r %}
ggally_cor(
tips,
mapping = ggplot2::aes_string(x = "total_bill", y = "tip", size = 15, colour = "red")
)
{% endhighlight %}

{% highlight r %}
ggally_cor(
tips,
mapping = ggplot2::aes_string(x = "total_bill", y = "tip", color = "sex"),
size = 5
)
{% endhighlight %}
{% highlight text %}
## Warning in stri_c(..., sep = sep, collapse = collapse, ignore_null =
## TRUE): longer object length is not a multiple of shorter object length
{% endhighlight %}
{% highlight text %}
## Warning: The plyr::rename operation has created duplicates for the
## following name(s): (`colour`)
{% endhighlight %}
 | {
"content_hash": "a4a84829fcbe341e20583db0b6135516",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 110,
"avg_line_length": 27.8,
"alnum_prop": 0.7024198822759974,
"repo_name": "yutannihilation/allYourFigureAreBelongToUs",
"id": "26b483b02afa122c0892cb481d4baba12e79ebdd",
"size": "1533",
"binary": false,
"copies": "1",
"ref": "refs/heads/gh-pages",
"path": "_posts/1991-05-31-ggally_cor.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "57369"
},
{
"name": "HTML",
"bytes": "16716"
},
{
"name": "JavaScript",
"bytes": "8587"
},
{
"name": "Makefile",
"bytes": "1028"
},
{
"name": "R",
"bytes": "6043"
},
{
"name": "Ruby",
"bytes": "2470"
}
],
"symlink_target": ""
} |
struct Data
{
XMFLOAT3 v1;
XMFLOAT2 v2;
};
class VecAddApp : public D3DApp
{
public:
VecAddApp(HINSTANCE hInstance);
~VecAddApp();
bool Init();
void OnResize();
void UpdateScene(float dt);
void DrawScene();
void DoComputeWork();
private:
void BuildBuffersAndViews();
private:
ID3D11Buffer* mOutputBuffer;
ID3D11Buffer* mOutputDebugBuffer;
ID3D11ShaderResourceView* mInputASRV;
ID3D11ShaderResourceView* mInputBSRV;
ID3D11UnorderedAccessView* mOutputUAV;
UINT mNumElements;
};
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE prevInstance,
PSTR cmdLine, int showCmd)
{
// Enable run-time memory check for debug builds.
#if defined(DEBUG) | defined(_DEBUG)
_CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
#endif
VecAddApp theApp(hInstance);
if( !theApp.Init() )
return 0;
theApp.DoComputeWork();
return 0;
}
VecAddApp::VecAddApp(HINSTANCE hInstance)
: D3DApp(hInstance), mOutputBuffer(0), mOutputDebugBuffer(0),
mInputASRV(0), mInputBSRV(0), mOutputUAV(0), mNumElements(32)
{
mMainWndCaption = L"Compute Shader Vec Add Demo";
}
VecAddApp::~VecAddApp()
{
md3dImmediateContext->ClearState();
ReleaseCOM(mOutputBuffer);
ReleaseCOM(mOutputDebugBuffer);
ReleaseCOM(mInputASRV);
ReleaseCOM(mInputBSRV);
ReleaseCOM(mOutputUAV);
Effects::DestroyAll();
InputLayouts::DestroyAll();
RenderStates::DestroyAll();
}
bool VecAddApp::Init()
{
if(!D3DApp::Init())
return false;
// Must init Effects first since InputLayouts depend on shader signatures.
Effects::InitAll(md3dDevice);
InputLayouts::InitAll(md3dDevice);
RenderStates::InitAll(md3dDevice);
BuildBuffersAndViews();
return true;
}
void VecAddApp::OnResize()
{
D3DApp::OnResize();
}
void VecAddApp::UpdateScene(float dt)
{
}
void VecAddApp::DrawScene()
{
md3dImmediateContext->ClearRenderTargetView(mRenderTargetView, reinterpret_cast<const float*>(&Colors::Silver));
md3dImmediateContext->ClearDepthStencilView(mDepthStencilView, D3D11_CLEAR_DEPTH|D3D11_CLEAR_STENCIL, 1.0f, 0);
HR(mSwapChain->Present(0, 0));
}
void VecAddApp::DoComputeWork()
{
D3DX11_TECHNIQUE_DESC techDesc;
Effects::VecAddFX->SetInputA(mInputASRV);
Effects::VecAddFX->SetInputB(mInputBSRV);
Effects::VecAddFX->SetOutput(mOutputUAV);
Effects::VecAddFX->VecAddTech->GetDesc( &techDesc );
for(UINT p = 0; p < techDesc.Passes; ++p)
{
ID3DX11EffectPass* pass = Effects::VecAddFX->VecAddTech->GetPassByIndex(p);
pass->Apply(0, md3dImmediateContext);
md3dImmediateContext->Dispatch(1, 1, 1);
}
// Unbind the input textures from the CS for good housekeeping.
ID3D11ShaderResourceView* nullSRV[1] = { 0 };
md3dImmediateContext->CSSetShaderResources( 0, 1, nullSRV );
// Unbind output from compute shader (we are going to use this output as an input in the next pass,
// and a resource cannot be both an output and input at the same time.
ID3D11UnorderedAccessView* nullUAV[1] = { 0 };
md3dImmediateContext->CSSetUnorderedAccessViews( 0, 1, nullUAV, 0 );
// Disable compute shader.
md3dImmediateContext->CSSetShader(0, 0, 0);
std::ofstream fout("results.txt");
// Copy the output buffer to system memory.
md3dImmediateContext->CopyResource(mOutputDebugBuffer, mOutputBuffer);
// Map the data for reading.
D3D11_MAPPED_SUBRESOURCE mappedData;
md3dImmediateContext->Map(mOutputDebugBuffer, 0, D3D11_MAP_READ, 0, &mappedData);
Data* dataView = reinterpret_cast<Data*>(mappedData.pData);
for(int i = 0; i < mNumElements; ++i)
{
fout << "(" << dataView[i].v1.x << ", " << dataView[i].v1.y << ", " << dataView[i].v1.z <<
", " << dataView[i].v2.x << ", " << dataView[i].v2.y << ")" << std::endl;
}
md3dImmediateContext->Unmap(mOutputDebugBuffer, 0);
fout.close();
}
void VecAddApp::BuildBuffersAndViews()
{
std::vector<Data> dataA(mNumElements);
std::vector<Data> dataB(mNumElements);
for(int i = 0; i < mNumElements; ++i)
{
dataA[i].v1 = XMFLOAT3(i, i, i);
dataA[i].v2 = XMFLOAT2(i, 0);
dataB[i].v1 = XMFLOAT3(-i, i, 0.0f);
dataB[i].v2 = XMFLOAT2(0, -i);
}
// Create a buffer to be bound as a shader input (D3D11_BIND_SHADER_RESOURCE).
D3D11_BUFFER_DESC inputDesc;
inputDesc.Usage = D3D11_USAGE_DEFAULT;
inputDesc.ByteWidth = sizeof(Data) * mNumElements;
inputDesc.BindFlags = D3D11_BIND_SHADER_RESOURCE;
inputDesc.CPUAccessFlags = 0;
inputDesc.StructureByteStride = sizeof(Data);
inputDesc.MiscFlags = D3D11_RESOURCE_MISC_BUFFER_STRUCTURED;
D3D11_SUBRESOURCE_DATA vinitDataA;
vinitDataA.pSysMem = &dataA[0];
ID3D11Buffer* bufferA = 0;
HR(md3dDevice->CreateBuffer(&inputDesc, &vinitDataA, &bufferA));
D3D11_SUBRESOURCE_DATA vinitDataB;
vinitDataB.pSysMem = &dataB[0];
ID3D11Buffer* bufferB = 0;
HR(md3dDevice->CreateBuffer(&inputDesc, &vinitDataB, &bufferB));
// Create a read-write buffer the compute shader can write to (D3D11_BIND_UNORDERED_ACCESS).
D3D11_BUFFER_DESC outputDesc;
outputDesc.Usage = D3D11_USAGE_DEFAULT;
outputDesc.ByteWidth = sizeof(Data) * mNumElements;
outputDesc.BindFlags = D3D11_BIND_UNORDERED_ACCESS;
outputDesc.CPUAccessFlags = 0;
outputDesc.StructureByteStride = sizeof(Data);
outputDesc.MiscFlags = D3D11_RESOURCE_MISC_BUFFER_STRUCTURED;
HR(md3dDevice->CreateBuffer(&outputDesc, 0, &mOutputBuffer));
// Create a system memory version of the buffer to read the results back from.
outputDesc.Usage = D3D11_USAGE_STAGING;
outputDesc.BindFlags = 0;
outputDesc.CPUAccessFlags = D3D11_CPU_ACCESS_READ;
HR(md3dDevice->CreateBuffer(&outputDesc, 0, &mOutputDebugBuffer));
D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc;
srvDesc.Format = DXGI_FORMAT_UNKNOWN;
srvDesc.ViewDimension = D3D11_SRV_DIMENSION_BUFFEREX;
srvDesc.BufferEx.FirstElement = 0;
srvDesc.BufferEx.Flags = 0;
srvDesc.BufferEx.NumElements = mNumElements;
md3dDevice->CreateShaderResourceView(bufferA, &srvDesc, &mInputASRV);
md3dDevice->CreateShaderResourceView(bufferB, &srvDesc, &mInputBSRV);
D3D11_UNORDERED_ACCESS_VIEW_DESC uavDesc;
uavDesc.Format = DXGI_FORMAT_UNKNOWN;
uavDesc.ViewDimension = D3D11_UAV_DIMENSION_BUFFER;
uavDesc.Buffer.FirstElement = 0;
uavDesc.Buffer.Flags = 0;
uavDesc.Buffer.NumElements = mNumElements;
md3dDevice->CreateUnorderedAccessView(mOutputBuffer, &uavDesc, &mOutputUAV);
// Views hold references to buffers, so we can release these.
ReleaseCOM(bufferA);
ReleaseCOM(bufferB);
}
| {
"content_hash": "01f559653db1eedad5970a47d5c626e7",
"timestamp": "",
"source": "github",
"line_count": 235,
"max_line_length": 113,
"avg_line_length": 27.157446808510638,
"alnum_prop": 0.735819492322156,
"repo_name": "jjuiddong/Introduction-to-3D-Game-Programming-With-DirectX11",
"id": "0556f852cb72f644fd8600ed17ebc3da0e201914",
"size": "7015",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "Chapter 12 The Compute Shader/VecAdd/VecAddDemo.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "83027"
},
{
"name": "C++",
"bytes": "1546137"
},
{
"name": "HLSL",
"bytes": "839443"
}
],
"symlink_target": ""
} |
import Ember from 'ember';
import { moduleFor, test } from 'ember-qunit';
moduleFor('service:message-bus', 'Unit | Service | message bus', {
// Specify the other units that are required for this test.
// needs: ['service:foo']
integration: true
});
test('`publish` calls the `callback` on all subscribers', function(assert) {
assert.expect(2);
const service = this.subject();
const object = Ember.Route.create({
callFoo(...messages) {
assert.deepEqual(messages, ['bar', 'baz'], 'messages are passed through to object');
}
});
const object2 = Ember.Route.create({
callFoo(...messages) {
assert.deepEqual(messages, ['bar', 'baz'], 'messages are passed through to object2');
}
});
service.subscribe('foo', object, object.callFoo);
service.subscribe('foo', object2, object2.callFoo);
service.publish('foo', 'bar', 'baz');
});
test('`subscribed`ed objects will unsubscribe themselves if destroyed, upon next `publish`', function(assert) {
assert.expect(1);
const done = assert.async();
const service = this.subject();
const cb = function() {};
const route1 = Ember.Route.create();
const route2 = Ember.Route.create();
const routeStable = Ember.Route.create();
service.subscribe('foo', route1, cb);
service.subscribe('foo', route2, cb);
service.subscribe('foo', routeStable, cb);
Ember.run(() => {
route1.destroy();
route2.destroy();
});
Ember.run.later(() => {
service.publish('foo');
assert.equal(service.get('_subscriptionMap.foo.length'), 1, 'destroyed registrants removed');
done();
}, 250);
});
test('`unsubscribe` removes all subscriptions with the provided context and callback', function(assert) {
assert.expect(1);
const service = this.subject();
const cb1 = function() {};
const cb2 = function() {};
const context1 = Ember.Route.create();
const context2 = Ember.Route.create();
service.subscribe('foo', context1, cb1);
service.subscribe('foo', context1, cb2);
service.subscribe('foo', context1, cb1);
service.subscribe('foo', context2, cb1);
service.subscribe('bar', context1, cb1);
service.unsubscribe('foo', context1, cb1);
assert.deepEqual(service.get('_subscriptionMap'), { foo: [{ context: context1, callback: cb2 }, { context: context2, callback: cb1 }], bar: [{ context: context1, callback: cb1 }] }, 'only removed specific context and callback');
});
test('`unsubscribe` removes all subscriptions with the provided context if no callback is provided', function(assert) {
assert.expect(1);
const service = this.subject();
const cb1 = function() {};
const cb2 = function() {};
const context1 = Ember.Route.create();
const context2 = Ember.Route.create();
service.subscribe('foo', context1, cb1);
service.subscribe('foo', context1, cb2);
service.subscribe('foo', context1, cb1);
service.subscribe('foo', context2, cb1);
service.subscribe('bar', context1, cb1);
service.unsubscribe('foo', context1);
assert.deepEqual(service.get('_subscriptionMap'), { foo: [{ context: context2, callback: cb1 }], bar: [{ context: context1, callback: cb1 }] }, 'only removed specific context');
});
test('`unsubscribeAll` removes all subscriptions for the provided context', function(assert) {
assert.expect(1);
const service = this.subject();
const cb1 = function() {};
const cb2 = function() {};
const context1 = Ember.Route.create();
const context2 = Ember.Route.create();
service.subscribe('foo', context1, cb1);
service.subscribe('foo', context1, cb2);
service.subscribe('foo', context1, cb1);
service.subscribe('foo', context2, cb1);
service.subscribe('bar', context1, cb1);
service.unsubscribeAll(context1);
assert.deepEqual(service.get('_subscriptionMap'), { foo: [{ context: context2, callback: cb1 }] }, 'removes specified context for all names');
});
| {
"content_hash": "01428c7d47b3583050694e1041401f48",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 230,
"avg_line_length": 30.46456692913386,
"alnum_prop": 0.6761437063840786,
"repo_name": "null-null-null/ember-message-bus",
"id": "c9b3994587280b3174f7f29d8626d79ca17711e5",
"size": "3869",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tests/unit/services/message-bus-test.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "1800"
},
{
"name": "JavaScript",
"bytes": "17368"
}
],
"symlink_target": ""
} |
set(CMAKE_C_FLAGS_RELEASE "-O2")
set(CMAKE_C_FLAGS_DEBUG "-g3 -O0 -ggdb -Wall -fstack-protector-all")
set(CMAKE_CXX_FLAGS_RELEASE "-O2")
set(CMAKE_CXX_FLAGS_DEBUG "-g3 -O0 -ggdb -Wall -fstack-protector-all")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g -Wall -fstack-protector-all")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -Wall -fstack-protector-all")
| {
"content_hash": "bbd4dc2807fe406ea3d0cdcf1a65331f",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 73,
"avg_line_length": 40.333333333333336,
"alnum_prop": 0.7052341597796143,
"repo_name": "cern-it-sdc-id/gfal2-dropbox",
"id": "8b350c4b7ef09f699a81188119de76c172000330",
"size": "400",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "cmake/modules/ReleaseDebugAutoFlags.cmake",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "63104"
},
{
"name": "CMake",
"bytes": "90154"
},
{
"name": "Makefile",
"bytes": "1435"
}
],
"symlink_target": ""
} |
from datetime import date
from lxml import html
from juriscraper.opinions.united_states.state import hawapp
class Site(hawapp.Site):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.court_id = self.__module__
# If it's the beginning of January, we need to make sure that we aren't
# missing any late-coming cases from the previous year.
today = date.today()
if today.day < 15 and today.month == 1:
this_year = today.year
last_year = this_year - 1
self.url = self.url.replace(str(this_year), str(last_year))
else:
# This simply aborts the crawler.
self.status = 200
self.html = html.fromstring("<html></html>")
| {
"content_hash": "51b9e4ccc28bf215483140d718c06069",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 79,
"avg_line_length": 33.65217391304348,
"alnum_prop": 0.5930232558139535,
"repo_name": "freelawproject/juriscraper",
"id": "946214907e13a9ea649e529ac90ac6186699a5e1",
"size": "806",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "juriscraper/opinions/united_states/state/hawapp_beginningofyear.py",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "HTML",
"bytes": "63242956"
},
{
"name": "Jinja",
"bytes": "2201"
},
{
"name": "Makefile",
"bytes": "75"
},
{
"name": "Python",
"bytes": "1059228"
}
],
"symlink_target": ""
} |
curl https://start.spring.io/starter.zip \
-d type=gradle-project \
-d applicationName="ConfigServerApplication" \
-d packageName="jp.bikon" \
-d groupId="jp.bikon" -d name="config" -d artifactId="config" \
-d description="Spring Cloud Config Server" \
-d dependencies=cloud-config-server,actuator,devtools \
-d version="0.2.0-SNAPSHOT" \
-d javaVersion="1.8" \
| tar -xzvf -
| {
"content_hash": "f1b11627569abff659cc2c7bb5218629",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 65,
"avg_line_length": 39.4,
"alnum_prop": 0.6903553299492385,
"repo_name": "jaseb/spring-cloud",
"id": "4bd178ac0daaf55a99eda47e659e70e2d82c0b62",
"size": "541",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "config-server/bin/boot-gradle.sh",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "40048"
},
{
"name": "Java",
"bytes": "21088"
},
{
"name": "Shell",
"bytes": "67876"
}
],
"symlink_target": ""
} |
package module3;
import de.fhpotsdam.unfolding.data.Feature;
import de.fhpotsdam.unfolding.data.PointFeature;
import de.fhpotsdam.unfolding.geo.Location;
import de.fhpotsdam.unfolding.marker.SimplePointMarker;
import processing.core.PGraphics;
/** Implements a visual marker for cities on an earthquake map
*
* @author tang
* @author 你的姓名
*
*/
public class CityMarker extends SimplePointMarker {
// 三角形标记的大小, 在draw方法中使用
public static final int TRI_SIZE = 5;
public CityMarker(Location location) {
super(location);
}
public CityMarker(Feature city) {
super(((PointFeature)city).getLocation(), city.getProperties());
}
/**
* 在地图上绘制标记
*/
public void draw(PGraphics pg, float x, float y) {
// 保存之前的绘制风格
pg.pushStyle();
// TODO: 添加代码实现绘制三角形用于表示CityMarker
// 提示: pg是可以用来调用图形方法的对象. 例如 pg.fill(255, 0, 0)可以设置颜色为红色
// x和y是所绘制对象的中心,用于计算出坐标并传递给图形绘制方法.
// 例如pg.rect(x, y, 10, 10)将绘制一个10x10的正方形,左上角坐标为x, y
// 其它方法可以参考processing库的文档
// 恢复之前的绘制风格
pg.popStyle();
}
public String getCity()
{
return getStringProperty("name");
}
public String getCountry()
{
return getStringProperty("country");
}
public float getPopulation()
{
return Float.parseFloat(getStringProperty("population"));
}
}
| {
"content_hash": "f96be812c2fa89a8c554f83dddc87d43",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 66,
"avg_line_length": 20.063492063492063,
"alnum_prop": 0.7112341772151899,
"repo_name": "simontangbit/CourseCode",
"id": "d962bbc46b7f33d4a4c25dfc572a1ac1e100f7d3",
"size": "1552",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/module3/CityMarker.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "GLSL",
"bytes": "3358"
},
{
"name": "Java",
"bytes": "44668"
}
],
"symlink_target": ""
} |
if (window.PalmSystem) {
// add webOS-specific gesture features
enyo.dispatcher.features.push(
function(e) {
if (enyo.webosGesture[e.type]) {
enyo.webosGesture[e.type](e);
}
}
);
enyo.webosGesture = {
mousedown: function(e) {
// need to cache the target because the gesture events are missing this info
this.lastDownTarget = e.target;
}
// NOTE: 'back' event is synthesized from ESC key on all platforms in core/Gesture.js
};
// FIXME: LunaSysMgr callbacks still use Mojo namespace.
Mojo = window.Mojo || {};
Mojo.handleGesture = function(type, properties) {
var synth = enyo.mixin({type: type, target: enyo.webosGesture.lastDownTarget}, properties);
enyo.dispatch(synth);
};
// NOTE: we are generating the event for orientation change by watching window.resize since
// this method is not called on dartfish. However, it is called in catfish and sysmgr
// generates an error if this function does not exist!
Mojo.screenOrientationChanged = function() {};
enyo.requiresWindow(function() {
// add gesture event suppport
document.addEventListener("gesturestart", enyo.dispatch);
document.addEventListener("gesturechange", enyo.dispatch);
document.addEventListener("gestureend", enyo.dispatch);
});
}
// window.webosEvent apparently not present on <= webOS 2.1; also needed for non-PalmSystem environments
if (typeof(webosEvent) === "undefined") {
// thunk for device-only profiler API
webosEvent = {
event: enyo.nop,
start: enyo.nop,
stop: enyo.nop
};
} | {
"content_hash": "ef9052c07311e49c10fd2f91c377547b",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 104,
"avg_line_length": 31.645833333333332,
"alnum_prop": 0.7202106649111257,
"repo_name": "Herrie82/enyo-1.0",
"id": "174e3ccb361e63dd218d968f37a1cb1084baa891",
"size": "1534",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "framework/source/compatibility/webosGesture.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "223374"
},
{
"name": "HTML",
"bytes": "49958"
},
{
"name": "JavaScript",
"bytes": "2689741"
}
],
"symlink_target": ""
} |
<?php
declare(strict_types=1);
namespace Doctrine\Migrations\Provider;
use Doctrine\DBAL\Schema\Schema;
/**
* The SchemaProviderInterface defines the interface used to create a Doctrine\DBAL\Schema\Schema instance that
* represents the current state of your database.
*/
interface SchemaProviderInterface
{
public function createSchema() : Schema;
}
| {
"content_hash": "c3791a8861b71065bc7c55f7585e5ed9",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 111,
"avg_line_length": 22.5625,
"alnum_prop": 0.778393351800554,
"repo_name": "localheinz/migrations",
"id": "324dc5028a717923f7d0e619eec59fc208b4b030",
"size": "361",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/Doctrine/Migrations/Provider/SchemaProviderInterface.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "549140"
},
{
"name": "Shell",
"bytes": "332"
},
{
"name": "Smarty",
"bytes": "595"
}
],
"symlink_target": ""
} |
package org.apache.ambari.server.api.predicate;
/**
* Token representation which is generated by the lexer.
* Contains type and value information.
*/
public class Token {
/**
* Token types.
*/
public enum TYPE {
/** Property name operand. This is the left operand in relational expressions. */
PROPERTY_OPERAND,
/** Value operand. This is the right operand in relational expressions. */
VALUE_OPERAND,
/** Relational operator */
RELATIONAL_OPERATOR,
/** Relational operator function */
RELATIONAL_OPERATOR_FUNC,
/** Logical operator */
LOGICAL_OPERATOR,
/** Logical unary operator such as !*/
LOGICAL_UNARY_OPERATOR,
/** Opening bracket */
BRACKET_OPEN,
/** Closing bracket */
BRACKET_CLOSE
}
/**
* Token type.
*/
private TYPE m_type;
/**
* Token value.
*/
private String m_value;
/**
* Constructor.
*
* @param type type
* @param value value
*/
public Token(TYPE type, String value) {
m_type = type;
m_value = value;
}
/**
* Get the token type.
* @return token type
*/
public TYPE getType() {
return m_type;
}
/**
* Get the token value.
* @return token value
*/
public String getValue() {
return m_value;
}
@Override
public String toString() {
return "Token{ type=" + m_type + ", value='" + m_value + "' }";
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Token token = (Token) o;
return m_type == token.m_type &&
(m_value == null ? token.m_value == null : m_value.equals(token.m_value));
}
@Override
public int hashCode() {
int result = m_type.hashCode();
result = 31 * result + (m_value != null ? m_value.hashCode() : 0);
return result;
}
}
| {
"content_hash": "aafcef719274bf18b5af1c5bb3e67ceb",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 86,
"avg_line_length": 19.925531914893618,
"alnum_prop": 0.589962626801922,
"repo_name": "radicalbit/ambari",
"id": "e812dd93bec8a67bf20d3f9259e688e2ac5c9535",
"size": "2678",
"binary": false,
"copies": "3",
"ref": "refs/heads/trunk",
"path": "ambari-server/src/main/java/org/apache/ambari/server/api/predicate/Token.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "42212"
},
{
"name": "C",
"bytes": "331204"
},
{
"name": "C#",
"bytes": "182799"
},
{
"name": "C++",
"bytes": "257"
},
{
"name": "CSS",
"bytes": "1287531"
},
{
"name": "CoffeeScript",
"bytes": "4323"
},
{
"name": "FreeMarker",
"bytes": "2654"
},
{
"name": "Groovy",
"bytes": "88056"
},
{
"name": "HTML",
"bytes": "5098825"
},
{
"name": "Java",
"bytes": "29006663"
},
{
"name": "JavaScript",
"bytes": "17274453"
},
{
"name": "Makefile",
"bytes": "11111"
},
{
"name": "PHP",
"bytes": "149648"
},
{
"name": "PLSQL",
"bytes": "2160"
},
{
"name": "PLpgSQL",
"bytes": "314333"
},
{
"name": "PowerShell",
"bytes": "2087991"
},
{
"name": "Python",
"bytes": "14584206"
},
{
"name": "R",
"bytes": "1457"
},
{
"name": "Roff",
"bytes": "13935"
},
{
"name": "Ruby",
"bytes": "14478"
},
{
"name": "SQLPL",
"bytes": "2117"
},
{
"name": "Shell",
"bytes": "741459"
},
{
"name": "Vim script",
"bytes": "5813"
}
],
"symlink_target": ""
} |
package kbaserelationengine.io.tsv;
import java.util.List;
import org.apache.commons.csv.CSVRecord;
public class ConditionsTSV extends TSVFile{
/**
* header:
*
* kbcondid= KBaseConID - a condition id
* media= a medium name e.g. LB, M9, etc/
* pH= the pH if known
* Temperature= the Temperature if known
* Pressure= the pressure if known
* Time= the Time if known
* OD= the optical density of known
* Growth_Phase= e.g Exponential, Stationary, etc.
* Growth_State= Planktonic or Swarmer or Sporulating or....
* Growth_Mode= Chemostat or Drip_FLOW_REACTOR etc.
* kbchemid_list= a list of KBCheID which are chemical ids along with
* concentration values if relevant
* strain_variant= if comparison among strains is given- name of comparison
* strain (be nice to map to taxonomy but I haven't)
* plasmid= plasmid used in test strain
* Mutant= mutant in test strain : gene name (not yet mapped to KBaseGenID) and type -- complement, overexpression, etc.
* Other_Label= other information about the condition
*
* @author psnovichkov
*
*/
enum H{kbcondid, media, pH, Temperature, Pressure, Time, OD,
Growth_Phase, Growth_State, Growth_Mode, kbchemid_list, Strain_variant,
Plasmid, Mutant, Other_Label}
static final String ID_PREFIX = "kb_cnd";
// static final int DATA_SIZE = 500000;
static final int DATA_SIZE = 10000;
public ConditionsTSV(String fileName) {
super(fileName, ID_PREFIX, DATA_SIZE, H.class);
}
@Override
public void processRecord(CSVRecord record) {
// TODO Auto-generated method stub
}
@Override
public void buildFakeRecord(int index, List<String> record) {
// kbcondid
record.add(ID_PREFIX + index);
// media
record.add("media" + index);
// pH
record.add("pH" + index);
// Temperature
record.add("Temperature" + index);
// Pressure
record.add("Pressure" + index);
// Time
record.add("Time" + index);
// OD
record.add("OD" + index);
// Growth_Phase
record.add("Growth_Phase" + index);
// Growth_State
record.add("Growth_State" + index);
// Growth_Mode
record.add("Growth_Mode" + index);
// kbchemid_list
record.add("kbchemid_list" + index);
// Strain_variant,
record.add("Strain_variant" + index);
// Plasmid
record.add("Plasmid" + index);
// Mutant
record.add("Mutant" + index);
// Other_Label
record.add("Other_Label" + index);
}
}
| {
"content_hash": "14731b3ee532102b78dabe2926f92316",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 122,
"avg_line_length": 28.357142857142858,
"alnum_prop": 0.6872376154492024,
"repo_name": "psnovichkov/KBaseRelationEngine",
"id": "d1854b6b3112d3aefb01034b85abeff9bae5881d",
"size": "2382",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/src/kbaserelationengine/io/tsv/ConditionsTSV.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "592651"
},
{
"name": "JavaScript",
"bytes": "17617"
},
{
"name": "Makefile",
"bytes": "2528"
},
{
"name": "Perl",
"bytes": "92286"
},
{
"name": "Python",
"bytes": "32620"
},
{
"name": "Ruby",
"bytes": "6775"
},
{
"name": "Shell",
"bytes": "1364"
}
],
"symlink_target": ""
} |
#region Copyright
#endregion
#region
using Autodesk.DesignScript.Runtime;
using Dynamo.Models;
using System.Collections.Generic;
using Dynamo.Nodes;
using Concrete.ACI318.General.Reinforcement;
using Wosad.Concrete.ACI318_14;
using Wosad.Concrete.ACI;
using Wosad.Common.CalculationLogger;
using System;
#endregion
namespace Concrete.ACI318.Details
{
/// <summary>
/// Headed bar tension development length (Basic)
/// Category: Concrete.ACI318.Details
/// </summary>
///
public partial class DevelopmentLength
{
/// <summary>
/// Standard hook tension development length (Basic)
/// </summary>
/// <param name="ConcreteMaterial"> Concrete material object used to extract material properties, create the object using input parameters first </param>
/// <param name="d_b"> Nominal diameter of bar, wire, or prestressing strand </param>
/// <param name="RebarMaterial"> Reinforcement material </param>
/// <param name="HookType"> Identifies rebar hook configuration (90-degree versus 180-degree) </param>
/// <param name="RebarCoatingType"> Type of rebar surface coating (epoxy coated or black) </param>
/// <param name="ExcessRebarRatio"> Indicates the ration of areas of required reinforcement and provided renforcement. This value must be less than 1 </param>
/// <param name="c_side"> Reinforcement side clear cover </param>
/// <param name="c_extension"> Reinforcement standard hook clear cover for bar extension </param>
/// <param name="EnclosingRebarDirection"> Indicates if enclosing reinforcement is perpendicular or parallel to bar </param>
/// <param name="s_enclosing">Spacing of enclosing reinforcement</param>
/// <param name="Code"> Applicable version of code/standard</param>
/// <returns name="l_dh"> Development length in tension of deformed bar or deformed wire with a standard hook, measured from outside end of hook, point of tangency, toward critical section </returns>
[MultiReturn(new[] { "l_dh" })]
public static Dictionary<string, object> StandardHookTensionDevelopmentLengthBasic(Concrete.ACI318.General.Concrete.ConcreteMaterial ConcreteMaterial, double d_b,
RebarMaterial RebarMaterial, string HookType, string RebarCoatingType, double ExcessRebarRatio, double c_side, double c_extension, string EnclosingRebarDirection,
double s_enclosing, string Code = "ACI318-14")
{
//Default values
double l_dh = 0;
//Calculation logic:
IRebarMaterial mat = RebarMaterial.Material;
bool IsEpoxyCoated = true;
if (RebarCoatingType.ToLower() == "uncoated")
{
IsEpoxyCoated=false;
}
else if (RebarCoatingType.ToLower() == "epoxycoated")
{
IsEpoxyCoated =true;
}
else
{
throw new Exception("Unrecognized rebar coating string.");
}
Rebar rebar = new Rebar(d_b, IsEpoxyCoated, mat);
CalcLog log = new CalcLog();
StandardHookInTension hook = new StandardHookInTension(ConcreteMaterial.Concrete, rebar, log, ExcessRebarRatio);
HookType _HookType;
bool IsValidHookTypeString = Enum.TryParse(HookType, true, out _HookType);
if (IsValidHookTypeString == false)
{
throw new Exception("Failed to convert string. Check HookType string. Please check input");
}
bool enclosingRebarIsPerpendicular = false;
if (EnclosingRebarDirection.ToLower()=="perpendicular")
{
enclosingRebarIsPerpendicular = true;
}
else if (EnclosingRebarDirection.ToLower() == "parallel")
{
enclosingRebarIsPerpendicular = false;
}
else
{
throw new Exception("Failed to convert string. Check EnclosingRebarDirection string. Please check input");
}
l_dh = hook.GetDevelopmentLength(_HookType, c_side, c_extension, enclosingRebarIsPerpendicular,s_enclosing);
return new Dictionary<string, object>
{
{ "l_dh", l_dh }
};
}
}
}
| {
"content_hash": "ff5246b8e57a87185f77732028811f78",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 212,
"avg_line_length": 38.79661016949152,
"alnum_prop": 0.607907383136741,
"repo_name": "Wosad/Wosad.Dynamo",
"id": "d0d83a76bad4fd55b677692e7637eb86c2161ad5",
"size": "5162",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Wosad/Concrete/ACI318/Details/StandardHookTensionDevelopmentLengthDetailed.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "1399678"
}
],
"symlink_target": ""
} |
module CC
module Kafka
module OffsetStorage
module Minidoc
def self.included(base)
base.extend ClassMethods
base.attribute :topic, String
base.attribute :partition, Integer
base.attribute :current, Integer
end
module ClassMethods
def find_or_create!(attributes)
find_one(attributes) || create!(attributes)
end
end
end
end
end
end
| {
"content_hash": "0231e6a8d1ae2971ccdbc8b68ac41a34",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 55,
"avg_line_length": 22.95,
"alnum_prop": 0.5860566448801743,
"repo_name": "codeclimate/kafka",
"id": "025ecc79f940ae72bf5c14359a57b50ef5de57a3",
"size": "459",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/cc/kafka/offset_storage/minidoc.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "24261"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "746df07828a16161ff7ad2ad9e0d1a9e",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 31,
"avg_line_length": 9.692307692307692,
"alnum_prop": 0.7063492063492064,
"repo_name": "mdoering/backbone",
"id": "0ef7bf8d50e919409b786e344939bf465a5af89d",
"size": "180",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Lycopodiophyta/Lycopodiopsida/Selaginellales/Selaginellaceae/Selaginella/Selaginella buchholzii/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
package org.olat.repository.handlers;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import org.olat.admin.quota.QuotaConstants;
import org.olat.core.commons.modules.bc.vfs.OlatRootFolderImpl;
import org.olat.core.gui.UserRequest;
import org.olat.core.gui.control.Controller;
import org.olat.core.gui.control.WindowControl;
import org.olat.core.gui.control.generic.iframe.DeliveryOptions;
import org.olat.core.gui.control.generic.layout.MainLayoutController;
import org.olat.core.id.Identity;
import org.olat.core.id.OLATResourceable;
import org.olat.core.id.context.BusinessControl;
import org.olat.core.id.context.ContextEntry;
import org.olat.core.logging.AssertException;
import org.olat.core.logging.OLog;
import org.olat.core.logging.Tracing;
import org.olat.core.util.coordinate.LockResult;
import org.olat.core.util.vfs.LocalFolderImpl;
import org.olat.core.util.vfs.Quota;
import org.olat.core.util.vfs.QuotaManager;
import org.olat.core.util.vfs.callbacks.FullAccessWithQuotaCallback;
import org.olat.core.util.vfs.callbacks.VFSSecurityCallback;
import org.olat.fileresource.FileResourceManager;
import org.olat.fileresource.types.ImsCPFileResource;
import org.olat.ims.cp.CPManager;
import org.olat.ims.cp.ui.CPEditMainController;
import org.olat.ims.cp.ui.CPPackageConfig;
import org.olat.ims.cp.ui.CreateNewCPController;
import org.olat.modules.cp.CPUIFactory;
import org.olat.repository.RepositoryEntry;
import org.olat.repository.controllers.IAddController;
import org.olat.repository.controllers.RepositoryAddCallback;
import org.olat.repository.controllers.WizardCloseResourceController;
import org.olat.resource.OLATResource;
import org.olat.resource.accesscontrol.ui.RepositoryMainAccessControllerWrapper;
/**
* Initial Date: Apr 6, 2004
*
* @author Mike Stock
*
* Comment:
*
*/
public class ImsCPHandler extends FileHandler implements RepositoryHandler {
private static final OLog log = Tracing.createLoggerFor(ImsCPHandler.class);
public static final String PROCESS_CREATENEW = "new";
public static final String PROCESS_IMPORT = "add";
private static final boolean LAUNCHEABLE = true;
private static final boolean DOWNLOADEABLE = true;
private static final boolean EDITABLE = true;
private static final boolean WIZARD_SUPPORT = false;
private static final List<String> supportedTypes;
/**
*
*/
public ImsCPHandler() {
//
}
static { // initialize supported types
supportedTypes = new ArrayList<String>(1);
supportedTypes.add(ImsCPFileResource.TYPE_NAME);
}
/**
* @see org.olat.repository.handlers.RepositoryHandler#getSupportedTypes()
*/
public List<String> getSupportedTypes() {
return supportedTypes;
}
/**
* @see org.olat.repository.handlers.RepositoryHandler#supportsLaunch()
*/
public boolean supportsLaunch(RepositoryEntry repoEntry) { return LAUNCHEABLE; }
/**
* @see org.olat.repository.handlers.RepositoryHandler#supportsDownload()
*/
public boolean supportsDownload(RepositoryEntry repoEntry) { return DOWNLOADEABLE; }
/**
* @see org.olat.repository.handlers.RepositoryHandler#supportsEdit()
*/
public boolean supportsEdit(RepositoryEntry repoEntry) { return EDITABLE; }
/**
* @see org.olat.repository.handlers.RepositoryHandler#supportsWizard(org.olat.repository.RepositoryEntry)
*/
public boolean supportsWizard(RepositoryEntry repoEntry) { return WIZARD_SUPPORT; }
/**
* @see org.olat.repository.handlers.RepositoryHandler#getCreateWizardController(org.olat.core.id.OLATResourceable, org.olat.core.gui.UserRequest, org.olat.core.gui.control.WindowControl)
*/
public Controller createWizardController(OLATResourceable res, UserRequest ureq, WindowControl wControl) {
throw new AssertException("Trying to get wizard where no creation wizard is provided for this type.");
}
/**
* @see org.olat.repository.handlers.RepositoryHandler#getLaunchController(org.olat.core.id.OLATResourceable java.lang.String, org.olat.core.gui.UserRequest, org.olat.core.gui.control.WindowControl)
*/
@Override
public MainLayoutController createLaunchController(RepositoryEntry re, UserRequest ureq, WindowControl wControl) {
OLATResource res = re.getOlatResource();
File cpRoot = FileResourceManager.getInstance().unzipFileResource(res);
LocalFolderImpl vfsWrapper = new LocalFolderImpl(cpRoot);
// jump to either the forum or the folder if the business-launch-path says so.
BusinessControl bc = wControl.getBusinessControl();
ContextEntry ce = bc.popLauncherContextEntry();
MainLayoutController layoutCtr;
CPPackageConfig packageConfig = CPManager.getInstance().getCPPackageConfig(res);
DeliveryOptions deliveryOptions = (packageConfig == null ? null : packageConfig.getDeliveryOptions());
if ( ce != null ) { // a context path is left for me
log.debug("businesscontrol (for further jumps) would be:"+bc);
OLATResourceable ores = ce.getOLATResourceable();
log.debug("OLATResourceable=" + ores);
String typeName = ores.getResourceableTypeName();
// typeName format: 'path=/test1/test2/readme.txt'
// First remove prefix 'path='
String path = typeName.substring("path=".length());
if (path.length() > 0) {
log.debug("direct navigation to container-path=" + path);
layoutCtr = CPUIFactory.getInstance().createMainLayoutResourceableListeningWrapperController(res, ureq, wControl, vfsWrapper, true, false, deliveryOptions, path);
} else {
layoutCtr = CPUIFactory.getInstance().createMainLayoutResourceableListeningWrapperController(res, ureq, wControl, vfsWrapper, deliveryOptions);
}
} else {
layoutCtr = CPUIFactory.getInstance().createMainLayoutResourceableListeningWrapperController(res, ureq, wControl, vfsWrapper, deliveryOptions);
}
RepositoryMainAccessControllerWrapper wrapper = new RepositoryMainAccessControllerWrapper(ureq, wControl, re, layoutCtr);
return wrapper;
}
/**
* @see org.olat.repository.handlers.RepositoryHandler#getEditorController(org.olat.core.id.OLATResourceable
* org.olat.core.gui.UserRequest,
* org.olat.core.gui.control.WindowControl)
*/
@Override
public Controller createEditorController(RepositoryEntry re, UserRequest ureq, WindowControl wControl) {
// only unzips, if not already unzipped
OlatRootFolderImpl cpRoot = FileResourceManager.getInstance().unzipContainerResource(re.getOlatResource());
Quota quota = QuotaManager.getInstance().getCustomQuota(cpRoot.getRelPath());
if (quota == null) {
Quota defQuota = QuotaManager.getInstance().getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_REPO);
quota = QuotaManager.getInstance().createQuota(cpRoot.getRelPath(), defQuota.getQuotaKB(), defQuota.getUlLimitKB());
}
VFSSecurityCallback secCallback = new FullAccessWithQuotaCallback(quota);
cpRoot.setLocalSecurityCallback(secCallback);
return new CPEditMainController(ureq, wControl, cpRoot, re.getOlatResource());
}
/**
*
* @see org.olat.repository.handlers.FileHandler#getAddController(org.olat.repository.controllers.RepositoryAddCallback,
* java.lang.Object, org.olat.core.gui.UserRequest,
* org.olat.core.gui.control.WindowControl)
*/
public IAddController createAddController(RepositoryAddCallback callback, Object userObject, UserRequest ureq, WindowControl wControl) {
if (userObject == null || userObject.equals(PROCESS_CREATENEW)) {
return new CreateNewCPController(callback, ureq, wControl);
} else {
return super.createAddController(callback, userObject, ureq, wControl);
}
}
protected String getDeletedFilePrefix() {
return "del_imscp_";
}
/**
*
* @see org.olat.repository.handlers.RepositoryHandler#acquireLock(org.olat.core.id.OLATResourceable, org.olat.core.id.Identity)
*/
public LockResult acquireLock(OLATResourceable ores, Identity identity) {
//nothing to do
return null;
}
/**
*
* @see org.olat.repository.handlers.RepositoryHandler#releaseLock(org.olat.core.util.coordinate.LockResult)
*/
public void releaseLock(LockResult lockResult) {
//nothing to do since nothing locked
}
/**
*
* @see org.olat.repository.handlers.RepositoryHandler#isLocked(org.olat.core.id.OLATResourceable)
*/
public boolean isLocked(OLATResourceable ores) {
return false;
}
public WizardCloseResourceController createCloseResourceController(UserRequest ureq, WindowControl wControl, RepositoryEntry repositoryEntry) {
throw new AssertException("not implemented");
}
}
| {
"content_hash": "abbb5d47bd1ae5ce1972da6bbad4c022",
"timestamp": "",
"source": "github",
"line_count": 215,
"max_line_length": 199,
"avg_line_length": 39.4,
"alnum_prop": 0.7786565930822807,
"repo_name": "stevenhva/InfoLearn_OpenOLAT",
"id": "f10b29b83b043fb3760fc01d78feec605761b9ec",
"size": "9467",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/org/olat/repository/handlers/ImsCPHandler.java",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
package com.ebay.rtran.report.impl
import java.io.ByteArrayOutputStream
import ch.qos.logback.classic.spi.LoggingEvent
import org.scalatest.{FlatSpecLike, Matchers}
class UpgradeSummarySubscriberTest extends FlatSpecLike with Matchers {
"UpgradeSummarySubscriber" should "not accept unexpected events" in {
val outputStream = new ByteArrayOutputStream
val subscriber = new UpgradeSummarySubscriber
subscriber.accept("hahah")
subscriber.dumpTo(outputStream)
outputStream.toByteArray should be (Array.empty[Byte])
val loggingEvent = new LoggingEvent
loggingEvent.setLoggerName("fake")
loggingEvent.setMessage("Some random message")
subscriber.accept(loggingEvent)
subscriber.dumpTo(outputStream)
outputStream.toByteArray should be (Array.empty[Byte])
}
"UpgradeSummarySubscriber" should "accept expected events" in {
val outputStream = new ByteArrayOutputStream
val subscriber = new UpgradeSummarySubscriber
val loggingEvent = new LoggingEvent
loggingEvent.setMessage("Rule some_rule was applied to 3 files")
subscriber.accept(loggingEvent)
subscriber.dumpTo(outputStream)
val result = new String(outputStream.toByteArray)
result should include ("|[some_rule](#some_rule) | impacted 3 file(s) |")
}
}
| {
"content_hash": "fac69319666f347ef7a66760873e4476",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 77,
"avg_line_length": 32.35,
"alnum_prop": 0.7666151468315301,
"repo_name": "keshin/RTran",
"id": "4dc238649807c4c8256958520b3f1b18eb85e06b",
"size": "1906",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "rtran-report/src/test/scala/com/ebay/rtran/report/impl/UpgradeSummarySubscriberTest.scala",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "17789"
},
{
"name": "Scala",
"bytes": "204314"
}
],
"symlink_target": ""
} |
/**
* @fileoverview Debugger data proxy.
*
* @author benvanik@google.com (Ben Vanik)
*/
/**
* Shared dispatch table for debugger events.
* Modern Chromes only allow a single event handler to be registered on
* chrome.debugger, so we have to map it back to the right place here.
* @constructor
*/
var DebuggerDispatchTable = function() {
/**
* Total number of attached debugger instances.
* @type {number}
* @private
*/
this.count_ = 0;
/**
* Registered tabs, mapped by tab ID.
* @type {!Object.<number, !Debugger>}
* @private
*/
this.tabs_ = {};
/**
* Registered event handlers.
* @type {!Object}
* @private
*/
this.eventHandlers_ = {
onEvent: this.onEvent_.bind(this),
onDetach: this.onDetach_.bind(this)
};
};
/**
* Registers a debugger instance.
* @param {number} tabId Tab ID being debugged.
* @param {!Debugger} target Debugger instance to send events to.
*/
DebuggerDispatchTable.prototype.register = function(tabId, target) {
if (this.tabs_[tabId]) {
// Replacing?
this.count_--;
}
this.tabs_[tabId] = target;
this.count_++;
if (this.count_ == 1) {
try {
chrome.debugger.onEvent.addListener(this.eventHandlers_.onEvent);
chrome.debugger.onDetach.addListener(this.eventHandlers_.onDetach);
} catch (e) {
// I'd rather try and fail to get a debugger attached than kill the app.
// Terrible API.
console.log('Unable to add debugger event listeners.');
}
}
};
/**
* Unregisters a debugger instance.
* @param {number} tabId Tab ID being debugged.
*/
DebuggerDispatchTable.prototype.unregister = function(tabId) {
if (!this.tabs_[tabId]) {
return;
}
delete this.tabs_[tabId];
this.count_--;
if (!this.count_) {
chrome.debugger.onEvent.removeListener(this.eventHandlers_.onEvent);
chrome.debugger.onDetach.removeListener(this.eventHandlers_.onDetach);
}
};
/**
* Handles incoming debugger events.
* @param {!{tabId: number}} source Source tab.
* @param {string} method Remote debugger method name.
* @param {!Object} params Parameters.
* @private
*/
DebuggerDispatchTable.prototype.onEvent_ = function(source, method, params) {
var target = this.tabs_[source.tabId];
if (!target) {
return;
}
target.onEvent_(method, params);
};
/**
* Handles incoming debugger detaches.
* @param {!{tabId: number}} source Source tab.
* @private
*/
DebuggerDispatchTable.prototype.onDetach_ = function(source) {
var target = this.tabs_[source.tabId];
if (!target) {
return;
}
target.onDetach_();
};
/**
* Debugger data proxy.
* This connects to a tab and sets up a debug session that is used for reading
* out events from the page.
*
* @param {number} tabId Tab ID.
* @param {!Object} pageOptions Page options.
* @constructor
*/
var Debugger = function(tabId, pageOptions) {
/**
* Target tab ID.
* @type {number}
* @private
*/
this.tabId_ = tabId;
/**
* Target debugee.
* @type {!Object}
* @private
*/
this.debugee_ = {
tabId: this.tabId_
};
/**
* Page options.
* @type {!Object}
* @private
*/
this.pageOptions_ = pageOptions;
/**
* A list of timeline records that have been recorded.
* @type {!Array.<!Array>}
* @private
*/
this.records_ = [];
/**
* Whether this debugger is attached.
* @type {boolean}
* @private
*/
this.attached_ = false;
/**
* Interval ID used for polling memory statistics.
* @type {number|null}
* @private
*/
this.memoryPollIntervalId_ = null;
/**
* The time of the first GC event inside of an event tree.
* Frequently the timeline will send 2-3 GC events with the same time.
* De-dupe those by tracking the first GC and ignoring the others.
* @type {number}
* @private
*/
this.lastGcStartTime_ = 0;
// Register us for dispatch.
Debugger.dispatchTable_.register(this.tabId_, this);
// Attach to the target tab.
try {
chrome.debugger.attach(this.debugee_, '1.0', (function() {
this.attached_ = true;
this.beginListening_();
}).bind(this));
} catch (e) {
// This is likely an exception saying the debugger is already attached,
// as Chrome has started throwing this in some versions. There's seriously
// like 10 different ways they report errors like this and it's different
// in every version. Sigh.
}
};
/**
* Detaches the debugger from the tab.
*/
Debugger.prototype.dispose = function() {
if (this.memoryPollIntervalId_ !== null) {
window.clearInterval(this.memoryPollIntervalId_);
this.memoryPollIntervalId_ = null;
}
if (this.attached_) {
this.attached_ = false;
chrome.debugger.detach(this.debugee_);
}
Debugger.dispatchTable_.unregister(this.tabId_);
this.records_.length = 0;
};
/**
* Shared dispatch table.
* @type {!DebuggerDispatchTable}
* @private
*/
Debugger.dispatchTable_ = new DebuggerDispatchTable();
/**
* Handles incoming debugger detaches.
* @private
*/
Debugger.prototype.onDetach_ = function() {
if (!this.attached_) {
return;
}
this.attached_ = false;
this.dispose();
};
/**
* Begins listening for debugger events.
* @private
*/
Debugger.prototype.beginListening_ = function() {
var timelineEnabled =
this.pageOptions_['wtf.trace.provider.browser.timeline'];
if (timelineEnabled === undefined) {
timelineEnabled = true;
}
if (timelineEnabled) {
chrome.debugger.sendCommand(this.debugee_, 'Timeline.start', {
// Limit call stack depth to keep messages small - if we ever need this
// data this can be increased.
// BUG: values of 0 are ignored:
// https://code.google.com/p/chromium/issues/detail?id=232008
'maxCallStackDepth': 1
});
}
var memoryInfoEnabled =
this.pageOptions_['wtf.trace.provider.browser.memoryInfo'];
if (memoryInfoEnabled) {
this.startMemoryPoll_();
}
};
/**
* Starts polling for memory information.
* @private
*/
Debugger.prototype.startMemoryPoll_ = function() {
function printTree(entry, depth) {
var pad = '';
for (var n = 0; n < depth; n++) {
pad += ' ';
}
console.log(pad + entry.name + ' (' + entry.size + 'b)');
if (entry.children) {
for (var n = 0; n < entry.children.length; n++) {
printTree(entry.children[n], depth + 1);
}
}
}
this.memoryPollIntervalId_ = window.setInterval((function() {
chrome.debugger.sendCommand(this.debugee_,
'Memory.getProcessMemoryDistribution', {
'reportGraph': false
}, function(results) {
if (results && results.distribution) {
printTree(results.distribution, 0);
}
});
}).bind(this), 1000);
};
/**
* A table of record types to functions that convert them into efficient(ish)
* records for storage/transmission.
* @type {!Object.<function(!Object):!Array>}
* @private
*/
Debugger.TIMELINE_DISPATCH_ = (function() {
// The table of available record types can be found here:
// http://trac.webkit.org/browser/trunk/Source/WebCore/inspector/front-end/TimelinePresentationModel.js#L70
/**
* Attempts to get the bounding rectangle from clip points.
* @param {!Array.<number>} clip Clip points.
* @return {Array.<number>} The [x,y,w,h] rect or null invalid.
*/
function getClipRect(clip) {
var minX = Number.MAX_VALUE;
var minY = Number.MAX_VALUE;
var maxX = Number.MIN_VALUE;
var maxY = Number.MIN_VALUE;
for (var i = 0; i < clip.length; i += 2) {
var x = clip[i];
var y = clip[i + 1];
minX = Math.min(minX, x);
minY = Math.min(minY, y);
maxX = Math.max(maxX, x);
maxY = Math.max(maxY, y);
}
if (minX == Number.MAX_VALUE) {
return null;
}
return [minX, minY, maxX - minX, maxY - minY];
};
var dispatch = {};
// GCEvent: garbage collections.
dispatch['GCEvent'] = function(record) {
return [
'GCEvent',
record.startTime,
record.endTime,
record.usedHeapSize,
record.data.usedHeapSizeDelta
];
};
// EvaluateScript: script runtime/parsing/etc.
dispatch['EvaluateScript'] = function(record) {
return [
'EvaluateScript',
record.startTime,
record.endTime,
record.usedHeapSize,
record.usedHeapSizeDelta,
record.data.url,
record.data.lineNumber
];
};
// ParseHTML: parsing of HTML in a page.
dispatch['ParseHTML'] = function(record) {
return [
'ParseHTML',
record.startTime,
record.endTime
];
};
dispatch['MarkDOMContent'] = function(record) {
return [
'MarkDOMContent',
record.startTime,
record.data.isMainFrame
];
};
// ScheduleStyleRecalculation: a style has been invalidated - expect a
// RecalculateStyles.
dispatch['ScheduleStyleRecalculation'] = function(record) {
return [
'ScheduleStyleRecalculation',
record.startTime
];
};
// RecalculateStyles: style recalculation is occurring.
dispatch['RecalculateStyles'] = function(record) {
return [
'RecalculateStyles',
record.startTime,
record.endTime,
record.data.elementCount
];
};
// InvalidateLayout: DOM layout was invalidated - expect a Layout.
dispatch['InvalidateLayout'] = function(record) {
return [
'InvalidateLayout',
record.startTime
];
};
// Layout: DOM layout.
dispatch['Layout'] = function(record) {
var rect = getClipRect(record.data.root);
return [
'Layout',
record.startTime,
record.endTime,
record.data.totalObjects,
record.data.dirtyObjects,
record.data.partialLayout ? 1 : 0,
rect ? rect[0] : 0,
rect ? rect[1] : 0,
rect ? rect[2] : 0,
rect ? rect[3] : 0
];
};
// Paint: DOM element painting.
dispatch['Paint'] = function(record) {
var rect = getClipRect(record.data.clip);
return [
'Paint',
record.startTime,
record.endTime,
rect ? rect[0] : 0,
rect ? rect[1] : 0,
rect ? rect[2] : 0,
rect ? rect[3] : 0
];
};
// CompositeLayers: the compositor ran and composited the page.
dispatch['CompositeLayers'] = function(record) {
return [
'CompositeLayers',
record.startTime,
record.endTime
];
};
// DecodeImage: a compressed image was decoded.
dispatch['DecodeImage'] = function(record) {
return [
'DecodeImage',
record.startTime,
record.endTime,
record.data.imageType
];
};
// ResizeImage: a resized version of a decoded image was required.
dispatch['ResizeImage'] = function(record) {
return [
'ResizeImage',
record.startTime,
record.endTime,
record.data.cached
];
};
// TODO(benvanik): explore adding the other types:
// ResourceSendRequest
// ResourceReceiveResponse
// ResourceFinish
// ResourceReceivedData
// ScrollLayer
// Program (may be good to show as a heatmap?)
return dispatch;
})();
/**
* Handles incoming debugger events.
* @param {string} method Remote debugger method name.
* @param {!Object} params Parameters.
* @private
*/
Debugger.prototype.onEvent_ = function(method, params) {
function logRecord(record, indent) {
indent += ' ';
console.log(indent + record.type);
if (record.children) {
for (var n = 0; n < record.children.length; n++) {
logRecord(record.children[n], indent);
}
}
}
switch (method) {
case 'Timeline.eventRecorded':
var record = params['record'];
this.processTimelineRecord_(record);
//logRecord(record, '');
break;
}
};
/**
* Processes a timeline record and generates event data.
* @param {!Object} record Timeline record.
* @private
*/
Debugger.prototype.processTimelineRecord_ = function(record) {
// Ignore if a duplicate.
if (this.shouldIgnoreTimelineRecord_(record)) {
return;
}
// Handle the record.
var dispatch = Debugger.TIMELINE_DISPATCH_[record.type];
if (dispatch) {
this.records_.push(dispatch(record));
}
// Recursively check children.
if (record.children && record.children.length) {
for (var n = 0; n < record.children.length; n++) {
this.processTimelineRecord_(record.children[n]);
}
}
};
/**
* Checks to see whether a record should be ignored.
* This is used to filter out duplicate events.
* @param {!Object} record Timeline record.
* @return {boolean} True to ignore the record (and children).
* @private
*/
Debugger.prototype.shouldIgnoreTimelineRecord_ = function(record) {
if (record.type == 'GCEvent') {
if (record.startTime == this.lastGcStartTime_) {
return true;
}
this.lastGcStartTime_ = record.startTime;
}
return false;
};
/**
* Gets the list of all records.
* @return {!Array.<!Array>} Records.
*/
Debugger.prototype.getRecords = function() {
return this.records_;
};
/**
* Clears all recorded records.
*/
Debugger.prototype.clearRecords = function() {
this.records_.length = 0;
};
| {
"content_hash": "09f0d58049384835f5a11203cff08725",
"timestamp": "",
"source": "github",
"line_count": 561,
"max_line_length": 109,
"avg_line_length": 23.331550802139038,
"alnum_prop": 0.6317518527007411,
"repo_name": "Shipow/tracing-framework",
"id": "c20399c6030873c421687e0e4fc586ae14dd32e0",
"size": "13255",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "extensions/wtf-injector-chrome/debugger.js",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
package org.hsbp.burnstation3;
import android.os.Handler;
import android.widget.ArrayAdapter;
import java.util.*;
public class PlaylistItem implements Observer, Runnable {
protected final Track track;
protected boolean playing;
protected final Handler handler = new Handler();
protected final ArrayAdapter<?> playlist;
public PlaylistItem(final Track track, final ArrayAdapter<?> playlist) {
this.track = track;
this.playlist = playlist;
track.addObserver(this);
}
public void update(final Observable observable, final Object data) {
handler.post(this);
}
public void run() {
playlist.notifyDataSetChanged();
}
public Track getTrack() {
return track;
}
public void setPlaying(final boolean value) {
if (value != playing) {
playing = value;
handler.post(this);
}
}
@Override
public String toString() {
final int db = track.getDownloadedBytes();
final StringBuilder sb = new StringBuilder();
if (playing) sb.append(track.isReadyToPlay() ? "\u25B6 " : "\u231B ");
sb.append(track.artistName).append(": ").append(track.name);
if (db != Track.FULLY_DOWNLOADED) sb.append(' ').append(
playlist.getContext().getString(R.string.downloaded, db / 1024));
return sb.toString();
}
}
| {
"content_hash": "8d05740bb77e971f45b484f283816d2b",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 81,
"avg_line_length": 29.145833333333332,
"alnum_prop": 0.6311651179413867,
"repo_name": "hsbp/burnstation3",
"id": "02e1e1679fca9abf976543e79d94a2561eafcdd4",
"size": "1399",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/org/hsbp/burnstation3/PlaylistItem.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "137081"
}
],
"symlink_target": ""
} |
/**
Interface for a Currah Speech Synth

@interface
*/
function Speech(){}
/**
what to say
@param {string} - the text to speak
*/
Speech.prototype.say = function(text){};
| {
"content_hash": "4019097c7bd5c8e47470ec2d9b72bb25",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 74,
"avg_line_length": 17.714285714285715,
"alnum_prop": 0.6935483870967742,
"repo_name": "daserge/jsdoc-to-markdown",
"id": "507ed0016433855a3d90f8861bd64a0fd5792de0",
"size": "248",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "example/tags/interface/src.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "7343"
},
{
"name": "JavaScript",
"bytes": "49543"
}
],
"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.10"/>
<title>GBD.Build.Blackjack: D:/SourceControl/GitRepos/GBD.Build.BlackJack/blackjack/cmake/storage/__init__.py File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
$(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">GBD.Build.Blackjack
</div>
<div id="projectbrief">A Module allowing for the automatic generation of CMakeLists.txt files from within python</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.10 -->
<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="pages.html"><span>Related Pages</span></a></li>
<li><a href="namespaces.html"><span>Packages</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File List</span></a></li>
</ul>
</div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('cmake_2storage_2____init_____8py.html','');});
</script>
<div id="doc-content">
<!-- 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="header">
<div class="summary">
<a href="#namespaces">Namespaces</a> </div>
<div class="headertitle">
<div class="title">__init__.py File Reference</div> </div>
</div><!--header-->
<div class="contents">
<p><a href="cmake_2storage_2____init_____8py_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="namespaces"></a>
Namespaces</h2></td></tr>
<tr class="memitem:namespaceblackjack_1_1cmake_1_1storage"><td class="memItemLeft" align="right" valign="top">  </td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceblackjack_1_1cmake_1_1storage.html">blackjack.cmake.storage</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
</table>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_a1f7e6e94f09aed1a9ad88b1d0323359.html">blackjack</a></li><li class="navelem"><a class="el" href="dir_5dbe43c8e59047ed8acc9ef59e456167.html">cmake</a></li><li class="navelem"><a class="el" href="dir_94c568451d7ed2dbefb66a1ecb82c46d.html">storage</a></li><li class="navelem"><a class="el" href="cmake_2storage_2____init_____8py.html">__init__.py</a></li>
<li class="footer">Generated by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.10 </li>
</ul>
</div>
</body>
</html>
| {
"content_hash": "d16b3fde978343cea10429ffe79ddc2d",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 400,
"avg_line_length": 44.10526315789474,
"alnum_prop": 0.6553017388339584,
"repo_name": "grbd/GBD.Build.BlackJack",
"id": "e079eb5f49471fc7768f5ac6e073172739fd9c06",
"size": "5866",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/doxygen/html/cmake_2storage_2____init_____8py.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Python",
"bytes": "248002"
},
{
"name": "Visual Basic",
"bytes": "46489"
}
],
"symlink_target": ""
} |
This repository houses the source code I use to generate [my academic
website](https://www.ldeo.columbia.edu/~shill/). I write the website
as a set of [Emacs org-mode](http://orgmode.org/) files, and then use
org's [publishing](http://orgmode.org/manual/Publishing.html)
capabilities to generate the HTML.
If you're just looking for the website itself, visit it
[here](https://www.ldeo.columbia.edu/~shill/).
Otherwise, see the
[org](https://github.com/spencerahill/my-website/tree/master/org)
subdirectory for the org mode files used to generate the HTML.
It's likely that this won't work on your machine out of the
box...there are some configurations required that live in my `.emacs`
file on my local machine.
Please feel free to copy any part of this repo --- although make sure
to replace my website contents with your own!
| {
"content_hash": "e6f401728971a3705fb01393de518baa",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 69,
"avg_line_length": 43.89473684210526,
"alnum_prop": 0.7637889688249401,
"repo_name": "spencerahill/my-website",
"id": "dd968c6e660de35b95c71a2a4148b28771cf3d77",
"size": "884",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "2561"
},
{
"name": "HTML",
"bytes": "110935"
},
{
"name": "Makefile",
"bytes": "484"
}
],
"symlink_target": ""
} |
#pragma once
#include <aws/devicefarm/DeviceFarm_EXPORTS.h>
#include <aws/devicefarm/model/ProblemDetail.h>
#include <aws/devicefarm/model/Device.h>
#include <aws/devicefarm/model/ExecutionResult.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>
namespace Aws
{
namespace Utils
{
namespace Json
{
class JsonValue;
class JsonView;
} // namespace Json
} // namespace Utils
namespace DeviceFarm
{
namespace Model
{
/**
* <p>Represents a specific warning or failure.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/Problem">AWS
* API Reference</a></p>
*/
class AWS_DEVICEFARM_API Problem
{
public:
Problem();
Problem(Aws::Utils::Json::JsonView jsonValue);
Problem& operator=(Aws::Utils::Json::JsonView jsonValue);
Aws::Utils::Json::JsonValue Jsonize() const;
/**
* <p>Information about the associated run.</p>
*/
inline const ProblemDetail& GetRun() const{ return m_run; }
/**
* <p>Information about the associated run.</p>
*/
inline bool RunHasBeenSet() const { return m_runHasBeenSet; }
/**
* <p>Information about the associated run.</p>
*/
inline void SetRun(const ProblemDetail& value) { m_runHasBeenSet = true; m_run = value; }
/**
* <p>Information about the associated run.</p>
*/
inline void SetRun(ProblemDetail&& value) { m_runHasBeenSet = true; m_run = std::move(value); }
/**
* <p>Information about the associated run.</p>
*/
inline Problem& WithRun(const ProblemDetail& value) { SetRun(value); return *this;}
/**
* <p>Information about the associated run.</p>
*/
inline Problem& WithRun(ProblemDetail&& value) { SetRun(std::move(value)); return *this;}
/**
* <p>Information about the associated job.</p>
*/
inline const ProblemDetail& GetJob() const{ return m_job; }
/**
* <p>Information about the associated job.</p>
*/
inline bool JobHasBeenSet() const { return m_jobHasBeenSet; }
/**
* <p>Information about the associated job.</p>
*/
inline void SetJob(const ProblemDetail& value) { m_jobHasBeenSet = true; m_job = value; }
/**
* <p>Information about the associated job.</p>
*/
inline void SetJob(ProblemDetail&& value) { m_jobHasBeenSet = true; m_job = std::move(value); }
/**
* <p>Information about the associated job.</p>
*/
inline Problem& WithJob(const ProblemDetail& value) { SetJob(value); return *this;}
/**
* <p>Information about the associated job.</p>
*/
inline Problem& WithJob(ProblemDetail&& value) { SetJob(std::move(value)); return *this;}
/**
* <p>Information about the associated suite.</p>
*/
inline const ProblemDetail& GetSuite() const{ return m_suite; }
/**
* <p>Information about the associated suite.</p>
*/
inline bool SuiteHasBeenSet() const { return m_suiteHasBeenSet; }
/**
* <p>Information about the associated suite.</p>
*/
inline void SetSuite(const ProblemDetail& value) { m_suiteHasBeenSet = true; m_suite = value; }
/**
* <p>Information about the associated suite.</p>
*/
inline void SetSuite(ProblemDetail&& value) { m_suiteHasBeenSet = true; m_suite = std::move(value); }
/**
* <p>Information about the associated suite.</p>
*/
inline Problem& WithSuite(const ProblemDetail& value) { SetSuite(value); return *this;}
/**
* <p>Information about the associated suite.</p>
*/
inline Problem& WithSuite(ProblemDetail&& value) { SetSuite(std::move(value)); return *this;}
/**
* <p>Information about the associated test.</p>
*/
inline const ProblemDetail& GetTest() const{ return m_test; }
/**
* <p>Information about the associated test.</p>
*/
inline bool TestHasBeenSet() const { return m_testHasBeenSet; }
/**
* <p>Information about the associated test.</p>
*/
inline void SetTest(const ProblemDetail& value) { m_testHasBeenSet = true; m_test = value; }
/**
* <p>Information about the associated test.</p>
*/
inline void SetTest(ProblemDetail&& value) { m_testHasBeenSet = true; m_test = std::move(value); }
/**
* <p>Information about the associated test.</p>
*/
inline Problem& WithTest(const ProblemDetail& value) { SetTest(value); return *this;}
/**
* <p>Information about the associated test.</p>
*/
inline Problem& WithTest(ProblemDetail&& value) { SetTest(std::move(value)); return *this;}
/**
* <p>Information about the associated device.</p>
*/
inline const Device& GetDevice() const{ return m_device; }
/**
* <p>Information about the associated device.</p>
*/
inline bool DeviceHasBeenSet() const { return m_deviceHasBeenSet; }
/**
* <p>Information about the associated device.</p>
*/
inline void SetDevice(const Device& value) { m_deviceHasBeenSet = true; m_device = value; }
/**
* <p>Information about the associated device.</p>
*/
inline void SetDevice(Device&& value) { m_deviceHasBeenSet = true; m_device = std::move(value); }
/**
* <p>Information about the associated device.</p>
*/
inline Problem& WithDevice(const Device& value) { SetDevice(value); return *this;}
/**
* <p>Information about the associated device.</p>
*/
inline Problem& WithDevice(Device&& value) { SetDevice(std::move(value)); return *this;}
/**
* <p>The problem's result.</p> <p>Allowed values include:</p> <ul> <li>
* <p>PENDING</p> </li> <li> <p>PASSED</p> </li> <li> <p>WARNED</p> </li> <li>
* <p>FAILED</p> </li> <li> <p>SKIPPED</p> </li> <li> <p>ERRORED</p> </li> <li>
* <p>STOPPED</p> </li> </ul>
*/
inline const ExecutionResult& GetResult() const{ return m_result; }
/**
* <p>The problem's result.</p> <p>Allowed values include:</p> <ul> <li>
* <p>PENDING</p> </li> <li> <p>PASSED</p> </li> <li> <p>WARNED</p> </li> <li>
* <p>FAILED</p> </li> <li> <p>SKIPPED</p> </li> <li> <p>ERRORED</p> </li> <li>
* <p>STOPPED</p> </li> </ul>
*/
inline bool ResultHasBeenSet() const { return m_resultHasBeenSet; }
/**
* <p>The problem's result.</p> <p>Allowed values include:</p> <ul> <li>
* <p>PENDING</p> </li> <li> <p>PASSED</p> </li> <li> <p>WARNED</p> </li> <li>
* <p>FAILED</p> </li> <li> <p>SKIPPED</p> </li> <li> <p>ERRORED</p> </li> <li>
* <p>STOPPED</p> </li> </ul>
*/
inline void SetResult(const ExecutionResult& value) { m_resultHasBeenSet = true; m_result = value; }
/**
* <p>The problem's result.</p> <p>Allowed values include:</p> <ul> <li>
* <p>PENDING</p> </li> <li> <p>PASSED</p> </li> <li> <p>WARNED</p> </li> <li>
* <p>FAILED</p> </li> <li> <p>SKIPPED</p> </li> <li> <p>ERRORED</p> </li> <li>
* <p>STOPPED</p> </li> </ul>
*/
inline void SetResult(ExecutionResult&& value) { m_resultHasBeenSet = true; m_result = std::move(value); }
/**
* <p>The problem's result.</p> <p>Allowed values include:</p> <ul> <li>
* <p>PENDING</p> </li> <li> <p>PASSED</p> </li> <li> <p>WARNED</p> </li> <li>
* <p>FAILED</p> </li> <li> <p>SKIPPED</p> </li> <li> <p>ERRORED</p> </li> <li>
* <p>STOPPED</p> </li> </ul>
*/
inline Problem& WithResult(const ExecutionResult& value) { SetResult(value); return *this;}
/**
* <p>The problem's result.</p> <p>Allowed values include:</p> <ul> <li>
* <p>PENDING</p> </li> <li> <p>PASSED</p> </li> <li> <p>WARNED</p> </li> <li>
* <p>FAILED</p> </li> <li> <p>SKIPPED</p> </li> <li> <p>ERRORED</p> </li> <li>
* <p>STOPPED</p> </li> </ul>
*/
inline Problem& WithResult(ExecutionResult&& value) { SetResult(std::move(value)); return *this;}
/**
* <p>A message about the problem's result.</p>
*/
inline const Aws::String& GetMessage() const{ return m_message; }
/**
* <p>A message about the problem's result.</p>
*/
inline bool MessageHasBeenSet() const { return m_messageHasBeenSet; }
/**
* <p>A message about the problem's result.</p>
*/
inline void SetMessage(const Aws::String& value) { m_messageHasBeenSet = true; m_message = value; }
/**
* <p>A message about the problem's result.</p>
*/
inline void SetMessage(Aws::String&& value) { m_messageHasBeenSet = true; m_message = std::move(value); }
/**
* <p>A message about the problem's result.</p>
*/
inline void SetMessage(const char* value) { m_messageHasBeenSet = true; m_message.assign(value); }
/**
* <p>A message about the problem's result.</p>
*/
inline Problem& WithMessage(const Aws::String& value) { SetMessage(value); return *this;}
/**
* <p>A message about the problem's result.</p>
*/
inline Problem& WithMessage(Aws::String&& value) { SetMessage(std::move(value)); return *this;}
/**
* <p>A message about the problem's result.</p>
*/
inline Problem& WithMessage(const char* value) { SetMessage(value); return *this;}
private:
ProblemDetail m_run;
bool m_runHasBeenSet = false;
ProblemDetail m_job;
bool m_jobHasBeenSet = false;
ProblemDetail m_suite;
bool m_suiteHasBeenSet = false;
ProblemDetail m_test;
bool m_testHasBeenSet = false;
Device m_device;
bool m_deviceHasBeenSet = false;
ExecutionResult m_result;
bool m_resultHasBeenSet = false;
Aws::String m_message;
bool m_messageHasBeenSet = false;
};
} // namespace Model
} // namespace DeviceFarm
} // namespace Aws
| {
"content_hash": "dd14b48eb79ed0bff00b566b2950382f",
"timestamp": "",
"source": "github",
"line_count": 310,
"max_line_length": 110,
"avg_line_length": 31.31935483870968,
"alnum_prop": 0.6026367288083222,
"repo_name": "aws/aws-sdk-cpp",
"id": "731665d519bdb46aee94ef867efede7e54c1bf20",
"size": "9828",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "aws-cpp-sdk-devicefarm/include/aws/devicefarm/model/Problem.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "309797"
},
{
"name": "C++",
"bytes": "476866144"
},
{
"name": "CMake",
"bytes": "1245180"
},
{
"name": "Dockerfile",
"bytes": "11688"
},
{
"name": "HTML",
"bytes": "8056"
},
{
"name": "Java",
"bytes": "413602"
},
{
"name": "Python",
"bytes": "79245"
},
{
"name": "Shell",
"bytes": "9246"
}
],
"symlink_target": ""
} |
require 'ebay/types/bid_approval'
module Ebay # :nodoc:
module Types # :nodoc:
# == Attributes
# array_node :live_auction_bids, 'LiveAuctionBid', :class => BidApproval, :default_value => []
class BidApprovalArray
include XML::Mapping
include Initializer
root_element_name 'BidApprovalArray'
array_node :live_auction_bids, 'LiveAuctionBid', :class => BidApproval, :default_value => []
end
end
end
| {
"content_hash": "78d2551ec5995196d4d1670da50e6a21",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 99,
"avg_line_length": 27.75,
"alnum_prop": 0.6666666666666666,
"repo_name": "skiz/ebayapi",
"id": "638d7b2bea66ed7f497c9974f82fabcc3850c32e",
"size": "444",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/ebay/types/bid_approval_array.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "871302"
}
],
"symlink_target": ""
} |
<XamlCompilerSaveState>
<ReferenceAssemblyList>
<LocalAssembly PathName="e:\users\jan\documents\visual studio 2013\projects\vocabularytrainer\vocabularytrainer\vocabularytrainer.windowsphone\obj\debug\intermediatexaml\vocabularytrainer.windowsphone.exe" HashGuid="a6d11364-7a49-aff6-0266-ab8051ff06f9" />
</ReferenceAssemblyList>
</XamlCompilerSaveState>
| {
"content_hash": "885ca3c617f0b373814e109741820316",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 260,
"avg_line_length": 72.6,
"alnum_prop": 0.8429752066115702,
"repo_name": "vocaviking/vocaviking",
"id": "a4c5be17569d63259a1d65b880054d2e2d68fc5c",
"size": "363",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "VocabularyTrainer/VocabularyTrainer.WindowsPhone/obj/Debug/XamlSaveStateFile.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "123818"
}
],
"symlink_target": ""
} |
class FeedbacksController < ApplicationController
before_action :set_feedback, only: [:show, :edit, :update, :destroy]
# GET /feedbacks
# GET /feedbacks.json
def index
@feedbacks = Feedback.all
end
# GET /feedbacks/1
# GET /feedbacks/1.json
def show
end
# GET /feedbacks/new
def new
@feedback = Feedback.new
end
# GET /feedbacks/1/edit
def edit
end
# POST /feedbacks
# POST /feedbacks.json
def create
@feedback = Feedback.new(feedback_params)
respond_to do |format|
if @feedback.save
format.html { redirect_to @feedback, notice: 'Feedback was successfully created.' }
format.json { render action: 'show', status: :created, location: @feedback }
else
format.html { render action: 'new' }
format.json { render json: @feedback.errors, status: :unprocessable_entity }
end
end
end
# PATCH/PUT /feedbacks/1
# PATCH/PUT /feedbacks/1.json
def update
respond_to do |format|
if @feedback.update(feedback_params)
format.html { redirect_to @feedback, notice: 'Feedback was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: 'edit' }
format.json { render json: @feedback.errors, status: :unprocessable_entity }
end
end
end
# DELETE /feedbacks/1
# DELETE /feedbacks/1.json
def destroy
@feedback.destroy
respond_to do |format|
format.html { redirect_to feedbacks_url }
format.json { head :no_content }
end
end
private
# Use callbacks to share common setup or constraints between actions.
def set_feedback
@feedback = Feedback.find(params[:id])
end
# Never trust parameters from the scary internet, only allow the white list through.
def feedback_params
params.require(:feedback).permit(:talk_id, :attender_id, :notes, :rating)
end
end
| {
"content_hash": "3ef45ac1ce265ef5fb0bb0b9fd8b8b6d",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 91,
"avg_line_length": 25.87837837837838,
"alnum_prop": 0.6553524804177546,
"repo_name": "ThoughtworksGGN/feedback-collector",
"id": "cfc75d67adbbfc36bc0b457b41501db515453293",
"size": "1915",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/controllers/feedbacks_controller.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "2291"
},
{
"name": "CoffeeScript",
"bytes": "844"
},
{
"name": "JavaScript",
"bytes": "664"
},
{
"name": "Ruby",
"bytes": "29545"
}
],
"symlink_target": ""
} |
<?php
/*
* This file is part of the Sulu CMS.
*
* (c) MASSIVE ART WebServices GmbH
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Sulu\Bundle\Sales\CoreBundle\Manager;
use Sulu\Component\Security\Authentication\UserInterface;
/**
* Locale manager for retrieving the correct locale from the request.
*/
class LocaleManager
{
/**
* @var string
*/
protected $fallbackLocale;
/**
* @param string $fallbackLocale
*/
function __construct($fallbackLocale)
{
$this->fallbackLocale = $fallbackLocale;
}
/**
* Function returns the locale that should be used by default.
* If request-locale is set, then use this one.
* Else return the locale of the user.
*
* @param null|UserInterface $user
* @param null|string $requestLocale
*
* @return string
*/
public function retrieveLocale(UserInterface $user = null, $requestLocale = null)
{
// Use request locale if defined.
if ($requestLocale && is_string($requestLocale)) {
return $requestLocale;
}
if ($user && $user->getLocale()) {
return $user->getLocale();
}
return $this->fallbackLocale;
}
}
| {
"content_hash": "43bdeb1820ad0c548a71fe9718320497",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 85,
"avg_line_length": 23.392857142857142,
"alnum_prop": 0.6190839694656488,
"repo_name": "sulu-io/sulu-sales",
"id": "16ecb685c5b2426fd4aa8752e216c9eb208b17b9",
"size": "1310",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "src/Sulu/Bundle/Sales/CoreBundle/Manager/LocaleManager.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "43287"
},
{
"name": "HTML",
"bytes": "92370"
},
{
"name": "JavaScript",
"bytes": "240016"
},
{
"name": "PHP",
"bytes": "606547"
},
{
"name": "Shell",
"bytes": "429"
}
],
"symlink_target": ""
} |
// angular
import { ChangeDetectionStrategy } from '@angular/core';
// any operators needed throughout your application
import './operators';
// app
import { AnalyticsService } from '../frameworks/analytics/index';
import { BaseComponent, Config, LogService } from '../frameworks/core/index';
/**
* This class represents the main application component.
*/
@BaseComponent({
moduleId: module.id,
selector: 'sd-app',
templateUrl: 'app.component.html',
changeDetection: ChangeDetectionStrategy.Default // Everything else uses OnPush
})
export class AppComponent {
constructor(public analytics: AnalyticsService, public logger: LogService) {
logger.debug(`Config env: ${Config.ENVIRONMENT().ENV}`);
}
}
| {
"content_hash": "be054738fe4aa64f86efb44fe36b5b1a",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 81,
"avg_line_length": 31.217391304347824,
"alnum_prop": 0.7395543175487466,
"repo_name": "pocmanu/angular2-seed-advanced",
"id": "36ca40c6069bf33160401b6626765e5a3414939f",
"size": "718",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/client/app/components/app.component.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "8632"
},
{
"name": "HTML",
"bytes": "12742"
},
{
"name": "JavaScript",
"bytes": "7937"
},
{
"name": "TypeScript",
"bytes": "146713"
}
],
"symlink_target": ""
} |
package amber
import "errors"
var (
_ Key = (*StrKey)(nil)
)
type StrKey struct {
BaseKey
val string
}
func NewStrKey(master string) *StrKey {
return &StrKey{
*NewBaseKey(master),
"",
}
}
func (sk *StrKey) handle(req *Req, cmd string, args ...interface{}) {
var res Res
switch cmd {
case "get":
res = NewStrRes(sk.StrVal(), nil)
case "set":
err := sk.SetVal(args[0])
res = NewBoolRes(err == nil, err)
default:
res = NewEmptyRes(errors.New(ErrUndefinedKeyCmd))
}
req.res <- res
}
func (sk *StrKey) Val() interface{} {
return sk.val
}
func (sk *StrKey) SetVal(val interface{}) error {
sk.val = val.(string)
return nil
}
func (sk *StrKey) StrVal() string {
return sk.val
}
| {
"content_hash": "270b581492b24af73641c3c212d9da97",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 69,
"avg_line_length": 14.46938775510204,
"alnum_prop": 0.6403385049365303,
"repo_name": "kotfalya/db",
"id": "727510a8257af9a537e558392eb52b3b5f84b738",
"size": "709",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "key_str.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Go",
"bytes": "18530"
}
],
"symlink_target": ""
} |
import {attr} from './attr'
import {closest} from './closest'
export default {
attr,
closest,
get:function(eid){
return document.getElementById(eid);
}
}
| {
"content_hash": "cff04f2f74b7204b6d159637eb01e859",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 38,
"avg_line_length": 17.1,
"alnum_prop": 0.6491228070175439,
"repo_name": "gitwuhao/antd-plus",
"id": "c37af8eec32a6cd7a6be67f3c9db295f759c3ca9",
"size": "171",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/3rd/methods/dom/index.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "65"
},
{
"name": "CSS",
"bytes": "4399"
},
{
"name": "HTML",
"bytes": "1449"
},
{
"name": "JavaScript",
"bytes": "73526"
}
],
"symlink_target": ""
} |
<?php
namespace spec\SevenShores\Hubspot\Endpoints;
use PhpSpec\ObjectBehavior;
use SevenShores\Hubspot\Http\Client;
class BlogAuthorsSpec extends ObjectBehavior
{
public function let(Client $client)
{
$this->beConstructedWith('demo', $client);
}
public function it_is_initializable()
{
$this->shouldHaveType('SevenShores\Hubspot\Endpoints\BlogAuthors');
}
}
| {
"content_hash": "708a5952c03d72860fb59d7b37bae62e",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 75,
"avg_line_length": 21.210526315789473,
"alnum_prop": 0.7096774193548387,
"repo_name": "fungku/hubspot-php",
"id": "7d6b60af0c5b23571fc7c897b8137c37ce4a4405",
"size": "403",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tests/spec/Endpoints/BlogAuthorsSpec.php",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "PHP",
"bytes": "165692"
}
],
"symlink_target": ""
} |
Implement `setenv()` and `unsetenv()` using `getenv()`, `putenv()`, and, where necessary, code that directly modifies `environ`.
Your version of `unsetenv()` should check to see whether there are multiple definitions of an environment variable, and remove them all (which is what the glibc version of `unsetenv()` does).
# Solution
The implementation of `setenv()` is trivial.
The name and the value of the environment variable is put in a string, separated by an equals sign.
This string is then passed to `putenv()`, which will save it in the environment.
The implementation of `unsetenv()` is trickier because it requires modifying `environ` directly.
When one match for an environment variable pair is found, it is moved to the end of the `environ` array until it falls beyond the final `NULL` pointer.
| {
"content_hash": "d86d65f739ccbead059c97bf1c630c9b",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 191,
"avg_line_length": 73.63636363636364,
"alnum_prop": 0.7641975308641975,
"repo_name": "francescomari/tlpi",
"id": "3ad553d93b6afe0f5764d3c5cfc6caf43bb4416d",
"size": "847",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ch06/env/README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "15175"
},
{
"name": "Makefile",
"bytes": "636"
}
],
"symlink_target": ""
} |
var livereload = require('tiny-lr');
function LivereloadServer (options) {
this.server = livereload();
this.port = options.port;
}
LivereloadServer.prototype.start = function() {
var self = this;
this.server.listen(this.port, function() {
console.log('Livereload server on %s', self.port);
});
};
module.exports = LivereloadServer;
| {
"content_hash": "decc3ce5aa69fa343aa2180552e44af2",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 54,
"avg_line_length": 23,
"alnum_prop": 0.6603260869565217,
"repo_name": "eth0lo/slr",
"id": "7cfc831423df995981475b38bb195501466d5018",
"size": "368",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/livereload_server.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Handlebars",
"bytes": "242"
},
{
"name": "JavaScript",
"bytes": "9189"
}
],
"symlink_target": ""
} |
[](https://travis-ci.org/lafarer/ansible-role-do-droplets)
[](https://github.com/lafarer/ansible-role-do-droplets/blob/master/LICENSE)
[](https://galaxy.ansible.com/lafarer/do-droplets/)
# Ansible role: lafarer.do-droplets
Ansible role to create and bootstrap digitalocean droplet(s).
if `do_inventory_file` is set the created droplets are added to the `[digitalocean]` section of the inventory file.
During droplet creation, minimal security update is applied:
* SSH - Key based login, disable root login and change port
* Protect su by limiting access only to droplet admin user
## Requirements
* Ansible 2.2
* Two environment variables can be used, DO_API_KEY and DO_API_TOKEN. They both refer to the v2 token.
## Installation
Using `ansible-galaxy`:
```shell
$ ansible-galaxy install lafarer.do-droplets
```
Using `requirements.yml`:
```yaml
- src: lafarer.do-droplets
```
Using `git`:
```shell
$ git clone https://github.com/lafarer/ansible-role-do-droplets.git lafarer.do-droplets
```
## Role Variables
```yaml
---
# The public SSH keys you want to add to your account.
# do_keys:
# - name: mykey # The name of a SSH key
# pub_key_file: "~/.ssh/id_rsa.pub" # The public SSH key file
do_keys: []
# Droplets to be created
# do_droplets:
# backups_enabled: no # Boolean, enables backups for your droplet.
# image_id: ubuntu-16-04-x64 # This is the slug of the image you would like the droplet created with.
# name: mydroplet # The name of the droplet. Must be unique.
# port: 22 # SSH port
# private_networking: no # Boolean, add an additional, private network interface to droplet for inter-droplet communication.
# region_id: fra1 # This is the slug of the region you would like your server to be created in.
# size_id: 512mb # This is the slug of the size you would like the droplet created with.
# ssh_key_name: mykey # SSH key name (defined in do_keys)
# user: lookup('env', 'USER') # Admin user to create
# virtio: yes # Boolean, turn on virtio driver in droplet for improved network and storage I/O.
# wait: yes # Wait for the droplet to be in state 'running' before returning.
# wait_timeout: 600 # How long before wait gives up, in seconds.
#
do_droplets: []
# Inventory file to update
do_inventory_file:
# Hosts file to update
do_hosts_file: /etc/hosts
```
## Dependencies
## Example Playbook
Create your own Playbook
```yaml
- name: Provision DigitalOcean droplets
hosts: localhost
gather_facts: no
vars:
do_keys:
- name: admin@example.com
pub_key_file: "~/.ssh/id_rsa.pub"
do_droplets:
- name: example.com
port: 4222
user: admin
ssh_key_name: admin@example.com
do_inventory_file: ~/.ansible/hosts
roles:
- lafarer.do-droplets
```
## License
MIT
| {
"content_hash": "c1d6ffb46252df6abf5ad27a4c19e658",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 161,
"avg_line_length": 33.257425742574256,
"alnum_prop": 0.6418576957427806,
"repo_name": "lafarer/ansible-role-do-droplets",
"id": "da9ee57d5f3d4dc2c6ccc9dc3590db1e130c7dc6",
"size": "3359",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Shell",
"bytes": "1442"
}
],
"symlink_target": ""
} |
module MiqReport::Generator::Async
extend ActiveSupport::Concern
module ClassMethods
def async_generate_tables(options = {})
options[:userid] ||= "system"
sync = VMDB::Config.new("vmdb").config[:product][:report_sync]
task = MiqTask.create(:name => "Generate Reports: #{options[:reports].collect(&:name).inspect}")
MiqQueue.put(
:queue_name => "generic",
:role => "reporting",
:class_name => to_s,
:method_name => "_async_generate_tables",
:args => [task.id, options],
:priority => MiqQueue::HIGH_PRIORITY,
:msg_timeout => default_queue_timeout.to_i_with_method
) unless sync # Only queued if sync reporting disabled (default)
AuditEvent.success(:event => "generate_tables", :target_class => base_class.name, :userid => options[:userid], :message => "#{task.name}, successfully initiated")
task.update_status("Queued", "Ok", "Task has been queued")
_async_generate_tables(task.id, options) if sync # Only runs if sync reporting enabled
task.id
end
def _async_generate_tables(taskid, options = {})
task = MiqTask.find_by_id(taskid)
unless task
raise MiqException::Error,
_("Unable to generate report if a task with id [%{number}] is not found!") % {:number => taskid}
end
task.update_status("Active", "Ok", "Generating reports")
reports = options.delete(:reports)
reports.each_with_index do |rpt, index|
rpt.generate_table(options)
pct_complete = reports.length / (index + 1) * 100.0
task.info(_("Generation of report [%{name}] complete") % {:name => rpt.name}, pct_complete)
end
task.task_results = reports
task.save
task.update_status("Finished", "Ok", "Generating reports complete")
end
def _async_generate_table(taskid, rpt, options = {})
rpt._async_generate_table(taskid, options)
end
end
def async_generate_table(options = {})
options[:userid] ||= "system"
sync = VMDB::Config.new("vmdb").config[:product][:report_sync]
task = MiqTask.create(:name => _("Generate Report: '%{name}'") % {:name => name})
unless sync # Only queued if sync reporting disabled (default)
cb = {:class_name => task.class.name, :instance_id => task.id, :method_name => :queue_callback_on_exceptions, :args => ['Finished']}
unless self.new_record?
MiqQueue.put(
:queue_name => "generic",
:role => "reporting",
:class_name => self.class.to_s,
:instance_id => id,
:method_name => "_async_generate_table",
:args => [task.id, options],
:priority => MiqQueue::HIGH_PRIORITY,
:miq_callback => cb,
:msg_timeout => queue_timeout
)
else
MiqQueue.put(
:queue_name => "generic",
:role => "reporting",
:class_name => self.class.to_s,
:method_name => "_async_generate_table",
:args => [task.id, self, options],
:priority => MiqQueue::HIGH_PRIORITY,
:miq_callback => cb,
:msg_timeout => queue_timeout
)
end
end
AuditEvent.success(:event => "generate_table", :target_class => self.class.base_class.name, :target_id => id, :userid => options[:userid], :message => "#{task.name}, successfully initiated")
task.update_status("Queued", "Ok", "Task has been queued")
_async_generate_table(task.id, options) if sync # Only runs if sync reporting enabled
task.id
end
def _async_generate_table(taskid, options = {})
# options = {
# :mode => "adhoc" (default)
# :session_id => 123
# }
task = MiqTask.find_by_id(taskid)
task.update_status("Active", "Ok", "Generating report") if task
audit = {:event => "generate_table", :target_class => self.class.base_class.name, :userid => options[:userid], :target_id => id}
begin
generate_table(options)
options[:mode] ||= "adhoc"
if options[:mode] == "adhoc" || options[:session_id]
userid = "#{options[:userid]}|#{options[:session_id]}|#{options[:mode]}"
options[:report_source] = "Generated by user"
MiqReportResult.purge_for_user(options)
else
userid = options[:userid]
end
task.miq_report_result = build_create_results(options.merge(:userid => userid), taskid)
task.save
task.update_status("Finished", "Ok", "Generating report complete")
rescue Exception => err
_log.log_backtrace(err)
task.error(err.message)
AuditEvent.failure(audit.merge(:message => err.message))
task.state_finished
raise
end
end
end
| {
"content_hash": "c6d47c781f59753b76387b9a0bae5bee",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 194,
"avg_line_length": 41.008620689655174,
"alnum_prop": 0.593651461004835,
"repo_name": "KevinLoiseau/manageiq",
"id": "e2988f0604b2744017f286ef0e34cb70d24256f4",
"size": "4757",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "app/models/miq_report/generator/async.rb",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "2289"
},
{
"name": "CSS",
"bytes": "92091"
},
{
"name": "HTML",
"bytes": "1624415"
},
{
"name": "JavaScript",
"bytes": "965445"
},
{
"name": "Makefile",
"bytes": "827"
},
{
"name": "Perl",
"bytes": "1846"
},
{
"name": "PowerShell",
"bytes": "5869"
},
{
"name": "Ruby",
"bytes": "21922596"
},
{
"name": "Shell",
"bytes": "2605"
}
],
"symlink_target": ""
} |
<?php
namespace dimple\administrator\models;
use Yii;
use dimple\administrator\models\User;
use yii\base\InvalidParamException;
use yii\base\Model;
/**
* Password reset form
*/
class ResetPasswordForm extends Model
{
public $password;
public $confirm_password;
/**
* @var \common\models\User
*/
private $_user;
/**
* Creates a form model given a token.
*
* @param array $config name-value pairs that will be used to initialize the object properties
* @throws \yii\base\InvalidParamException if token is empty or not valid
*/
public function __construct($config = [])
{
parent::__construct($config);
}
/**
* @inheritdoc
*/
public function rules()
{
return [
[['password','confirm_password'], 'required'],
[['password','confirm_password'], 'string', 'min' => 6],
['confirm_password', 'compare', 'compareAttribute' => 'password'],
];
}
/**
* Resets password.
*
* @return boolean if password was reset.
*/
public function resetPassword($user)
{
$user->scenario = 'recovery';
$user->setPassword($this->password);
$user->removePasswordResetToken();
return $user->save();
}
}
| {
"content_hash": "faba3e3caea480c4bca5d8e849b8e982",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 99,
"avg_line_length": 22.413793103448278,
"alnum_prop": 0.583076923076923,
"repo_name": "dimpled/yii2-administrator",
"id": "0e6e90b5fb8cba7b9ead48bcbd0c42569e0fb62c",
"size": "1300",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "models/ResetPasswordForm.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "518967"
}
],
"symlink_target": ""
} |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.pirhotechs.frc2014enigma.subsystems;
import com.pirhotechs.frc2014enigma.RobotMap;
import edu.wpi.first.wpilibj.Relay;
import edu.wpi.first.wpilibj.Solenoid;
import edu.wpi.first.wpilibj.Talon;
import edu.wpi.first.wpilibj.command.Subsystem;
/**
*
* @author Brandyn
*/
public class ForwardLift extends Subsystem {
Solenoid grabberOpen;
Solenoid grabberClose;
Solenoid BallLiftUp;
Solenoid BallLiftDown;
public ForwardLift() {
grabberOpen = new Solenoid(RobotMap.grabberOpenSolenoid);
grabberClose = new Solenoid(RobotMap.grabberCloseSolenoid);
BallLiftUp = new Solenoid(RobotMap.forwardLiftUpSolenoid);
BallLiftDown = new Solenoid(RobotMap.forwardLiftDownSolenoid);
}
public void initDefaultCommand() {
// Set the default command for a subsystem here.
//setDefaultCommand(new MySpecialCommand());
}
public void raiseForwardLift() {
BallLiftUp.set(true);
BallLiftDown.set(false);
}
public void lowerForwardLift() {
BallLiftUp.set(false);
BallLiftDown.set(true);
}
public void stopForwardLift() {
BallLiftUp.set(false);
BallLiftDown.set(false);
}
public void openGrabber() {
grabberOpen.set(true);
grabberClose.set(false);
}
public void closeGrabber() {
grabberOpen.set(false);
grabberClose.set(true);
}
public void stopGrabber() {
grabberOpen.set(false);
grabberClose.set(false);
}
}
| {
"content_hash": "f9c3b5adf88269e380553e1de640f2ca",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 79,
"avg_line_length": 27.661538461538463,
"alnum_prop": 0.6496106785317018,
"repo_name": "pirhotechs/frc2014-enigma",
"id": "4a7d76a4035a6d4710c4d8462c44a520c6ced699",
"size": "1798",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/com/pirhotechs/frc2014enigma/subsystems/ForwardLift.java",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Java",
"bytes": "48181"
}
],
"symlink_target": ""
} |
Template.nav.onRendered(function(){
this.$('.ui.dropdown').dropdown();
});
Template.nav.helpers({
singleProject:function(){
projectId = FlowRouter.getParam('id');
return Projects.findOne(projectId) || {};
},
allProjects:function(){
return Projects.find();
},
sprints:function(){
projectId = FlowRouter.getParam('id');
return Sprints.find({},{projectId:projectId});
}
});
Template.nav.events({
'click #planning':function(e,t){
e.preventDefault();
projectId = FlowRouter.getParam('id');
FlowRouter.go('/project/'+projectId+'/planning');
},
'click .goToSprint':function(e,t){
e.preventDefault();
projectId = FlowRouter.getParam('id');
FlowRouter.go('/project/'+projectId+'/sprint/'+this._id);
}
}); | {
"content_hash": "222b3ff510ad132d6e3bc3540e51b329",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 65,
"avg_line_length": 27.633333333333333,
"alnum_prop": 0.5958986731001207,
"repo_name": "webcrafters/sprint",
"id": "75aeb0255fee8938ef06696971a0506c2a1d72a5",
"size": "829",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "client/nav/nav.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "5851"
},
{
"name": "HTML",
"bytes": "10340"
},
{
"name": "JavaScript",
"bytes": "707852"
}
],
"symlink_target": ""
} |
function Add-TWTodo
{
<#
.SYNOPSIS
Adds a new todo to the list.
.DESCRIPTION
Adds a new todo to the list and then adds a line number to the todo object.
.EXAMPLE
Add-TWTodo -Todo "A new todo"
Adds "A new todo" to the todo list and gives it the next line number
.NOTES
Author: Paul Broadwith (https://pauby.com)
Project: PSTodoWarrior (https://github.com/pauby/pstodowarrior)
.LINK
https://www.github.com/pauby/pstodowarrior/tree/master/docs/add-twtodo.md
#>
[OutputType([PSCustomObject])]
[CmdletBinding()]
Param (
# The todo to add
[Parameter(Mandatory, Position = 0, ValueFromPipeline, ValueFromPipelineByPropertyName)]
[string]
$Todo,
# Path to the todo file.
# Default is TodoTaskFile from the module configuration.
[Parameter(Mandatory, Position = 1)]
[AllowEmptyCollection()]
[System.Collections.ArrayList]
$TodoList
)
Begin {}
Process {
#TODO Look at adding parameters for each component of the Todo - priority, createddate, donedate etc.
# convert the todo text into a TodoTxt object
$obj = $Todo | ConvertTo-TodoTxt
# change the object type and add a line number for the todo
$obj.PSObject.TypeNames.Insert(0, 'TWTodo')
$id = @($TodoList).count + 1
$obj | Add-Member -MemberType NoteProperty -Name 'ID' -Value $id
# add the new TWTodo object to the todo list and export the todos
$null = $TodoList.Add($obj)
# output the new todo
$obj
}
End {
Export-TWTodo -Todo $TodoList
}
} | {
"content_hash": "b7d4859b1458294a5daa512699cfbdea",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 109,
"avg_line_length": 29.68421052631579,
"alnum_prop": 0.6152482269503546,
"repo_name": "pauby/PSTodo",
"id": "8f3b431ba3b2da75367ec7956403c5e4772fab65",
"size": "1694",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "source/Public/Add-TWTodo.ps1",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "PowerShell",
"bytes": "75067"
}
],
"symlink_target": ""
} |
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace WorkflowCore.Persistence.SqlServer.Migrations
{
public partial class WfReference : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "Reference",
schema: "wfc",
table: "Workflow",
maxLength: 200,
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Reference",
schema: "wfc",
table: "Workflow");
}
}
}
| {
"content_hash": "44a39bdb28c0629ec924b30a20fe1c4e",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 71,
"avg_line_length": 27.884615384615383,
"alnum_prop": 0.56,
"repo_name": "danielgerlag/workflow-core",
"id": "285e7d94419d60ba40a5642a243c7953ae1ae9b0",
"size": "727",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/providers/WorkflowCore.Persistence.SqlServer/Migrations/20170722195832_WfReference.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "1108519"
},
{
"name": "Dockerfile",
"bytes": "507"
},
{
"name": "TSQL",
"bytes": "634"
}
],
"symlink_target": ""
} |
const {expect} = require('chai');
describe('bmoor-data.collection.Tagged', function () {
var {Tagged} = require('./Tagged.js');
it('should be defined', function () {
expect(Tagged).to.exist;
});
describe('::choose', function () {
it('should work with tags correctly', function () {
var feed = new Tagged(),
test = {
value: 'YeS'
},
child = feed.choose({
normalizeContext: function () {
return test.value.toLowerCase();
},
normalizeDatum: function (datum) {
return {value: datum.value.toLowerCase()};
},
tests: [
function (datum, ctx) {
return datum.value === ctx;
}
]
});
feed.add({id: 1, foo: 'eins'}, {value: 'yes'});
feed.add({id: 3, foo: 'zwei'}, {value: 'no'});
feed.add({id: 2, foo: 'bar'}, {value: 'no'});
feed.add({id: 4, foo: 'fier'}, {value: 'YES'});
feed.publish();
expect(child.data.length).to.equal(2);
});
});
});
| {
"content_hash": "f9900f6d1c3d6284b0d856142c2b8d9a",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 54,
"avg_line_length": 23.7,
"alnum_prop": 0.5474683544303798,
"repo_name": "b-heilman/bmoor-data",
"id": "41726c626bdb924a8f6ead4ba90f013d663ab3a9",
"size": "948",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "src/collection/Tagged.spec.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "122460"
}
],
"symlink_target": ""
} |
var Class = require('../utils/Class');
var Frame = require('./Frame');
var TextureSource = require('./TextureSource');
/**
* @classdesc
* A Texture consists of a source, usually an Image from the Cache, and a collection of Frames.
* The Frames represent the different areas of the Texture. For example a texture atlas
* may have many Frames, one for each element within the atlas. Where-as a single image would have
* just one frame, that encompasses the whole image.
*
* Textures are managed by the global TextureManager. This is a singleton class that is
* responsible for creating and delivering Textures and their corresponding Frames to Game Objects.
*
* Sprites and other Game Objects get the texture data they need from the TextureManager.
*
* @class Texture
* @memberOf Phaser.Textures
* @constructor
* @since 3.0.0
*
* @param {Phaser.Textures.TextureManager} manager - A reference to the Texture Manager this Texture belongs to.
* @param {string} key - The unique string-based key of this Texture.
* @param {(HTMLImageElement[]|HTMLCanvasElement[])} source - An array of sources that are used to create the texture. Usually Images, but can also be a Canvas.
* @param {number} [width] - The width of the Texture. This is optional and automatically derived from the source images.
* @param {number} [height] - The height of the Texture. This is optional and automatically derived from the source images.
*/
var Texture = new Class({
initialize:
function Texture (manager, key, source, width, height)
{
if (!Array.isArray(source))
{
source = [ source ];
}
/**
* A reference to the Texture Manager this Texture belongs to.
*
* @name Phaser.Textures.Texture#manager
* @type {Phaser.Textures.TextureManager}
* @since 3.0.0
*/
this.manager = manager;
/**
* The unique string-based key of this Texture.
*
* @name Phaser.Textures.Texture#key
* @type {string}
* @since 3.0.0
*/
this.key = key;
/**
* An array of TextureSource instances.
* These are unique to this Texture and contain the actual Image (or Canvas) data.
*
* @name Phaser.Textures.Texture#source
* @type {Phaser.Textures.TextureSource[]}
* @since 3.0.0
*/
this.source = [];
/**
* An array of TextureSource data instances.
* Used to store additional data images, such as normal maps or specular maps.
*
* @name Phaser.Textures.Texture#dataSource
* @type {array}
* @since 3.0.0
*/
this.dataSource = [];
/**
* A key-value object pair associating the unique Frame keys with the Frames objects.
*
* @name Phaser.Textures.Texture#frames
* @type {object}
* @since 3.0.0
*/
this.frames = {};
/**
* Any additional data that was set in the source JSON (if any),
* or any extra data you'd like to store relating to this texture
*
* @name Phaser.Textures.Texture#customData
* @type {object}
* @since 3.0.0
*/
this.customData = {};
/**
* The name of the first frame of the Texture.
*
* @name Phaser.Textures.Texture#firstFrame
* @type {string}
* @since 3.0.0
*/
this.firstFrame = '__BASE';
/**
* The total number of Frames in this Texture.
*
* @name Phaser.Textures.Texture#frameTotal
* @type {integer}
* @default 0
* @since 3.0.0
*/
this.frameTotal = 0;
// Load the Sources
for (var i = 0; i < source.length; i++)
{
this.source.push(new TextureSource(this, source[i], width, height));
}
},
/**
* Adds a new Frame to this Texture.
*
* A Frame is a rectangular region of a TextureSource with a unique index or string-based key.
*
* @method Phaser.Textures.Texture#add
* @since 3.0.0
*
* @param {(integer|string)} name - The name of this Frame. The name is unique within the Texture.
* @param {integer} sourceIndex - The index of the TextureSource that this Frame is a part of.
* @param {number} x - The x coordinate of the top-left of this Frame.
* @param {number} y - The y coordinate of the top-left of this Frame.
* @param {number} width - The width of this Frame.
* @param {number} height - The height of this Frame.
*
* @return {Phaser.Textures.Frame} The Frame that was added to this Texture.
*/
add: function (name, sourceIndex, x, y, width, height)
{
var frame = new Frame(this, name, sourceIndex, x, y, width, height);
this.frames[name] = frame;
// Set the first frame of the Texture (other than __BASE)
// This is used to ensure we don't spam the display with entire
// atlases of sprite sheets, but instead just the first frame of them
// should the dev incorrectly specify the frame index
if (this.frameTotal === 1)
{
this.firstFrame = name;
}
this.frameTotal++;
return frame;
},
/**
* Checks to see if a Frame matching the given key exists within this Texture.
*
* @method Phaser.Textures.Texture#has
* @since 3.0.0
*
* @param {string} name - The key of the Frame to check for.
*
* @return {boolean} True if a Frame with the matching key exists in this Texture.
*/
has: function (name)
{
return (this.frames[name]);
},
/**
* Gets a Frame from this Texture based on either the key or the index of the Frame.
*
* In a Texture Atlas Frames are typically referenced by a key.
* In a Sprite Sheet Frames are referenced by an index.
* Passing no value for the name returns the base texture.
*
* @method Phaser.Textures.Texture#get
* @since 3.0.0
*
* @param {(string|integer)} [name] - The string-based name, or integer based index, of the Frame to get from this Texture.
*
* @return {Phaser.Textures.Frame} The Texture Frame.
*/
get: function (name)
{
// null, undefined, empty string, zero
if (!name)
{
name = this.firstFrame;
}
var frame = this.frames[name];
if (!frame)
{
console.warn('No Texture.frame found with name ' + name);
frame = this.frames[this.firstFrame];
}
return frame;
},
/**
* Takes the given TextureSource and returns the index of it within this Texture.
* If it's not in this Texture, it returns -1.
* Unless this Texture has multiple TextureSources, such as with a multi-atlas, this
* method will always return zero or -1.
*
* @method Phaser.Textures.Texture#getTextureSourceIndex
* @since 3.0.0
*
* @param {Phaser.Textures.TextureSource} source - The TextureSource to check.
*
* @return {integer} The index of the TextureSource within this Texture, or -1 if not in this Texture.
*/
getTextureSourceIndex: function (source)
{
for (var i = 0; i < this.source.length; i++)
{
if (this.source[i] === source)
{
return i;
}
}
return -1;
},
/**
* Returns an array of all the Frames in the given TextureSource.
*
* @method Phaser.Textures.Texture#getFramesFromTextureSource
* @since 3.0.0
*
* @param {integer} sourceIndex - The index of the TextureSource to get the Frames from.
*
* @return {Phaser.Textures.Frame[]} An array of Texture Frames.
*/
getFramesFromTextureSource: function (sourceIndex)
{
var out = [];
for (var frameName in this.frames)
{
if (frameName === '__BASE')
{
continue;
}
var frame = this.frames[frameName];
if (frame.sourceIndex === sourceIndex)
{
out.push(frame.name);
}
}
return out;
},
/**
* Returns an array with all of the names of the Frames in this Texture.
*
* Useful if you want to randomly assign a Frame to a Game Object, as you can
* pick a random element from the returned array.
*
* @method Phaser.Textures.Texture#getFrameNames
* @since 3.0.0
*
* @param {boolean} [includeBase=false] - Include the `__BASE` Frame in the output array?
*
* @return {string[]} An array of all Frame names in this Texture.
*/
getFrameNames: function (includeBase)
{
if (includeBase === undefined) { includeBase = false; }
var out = Object.keys(this.frames);
if (!includeBase)
{
var idx = out.indexOf('__BASE');
if (idx !== -1)
{
out.splice(idx, 1);
}
}
return out;
},
/**
* Given a Frame name, return the source image it uses to render with.
*
* This will return the actual DOM Image or Canvas element.
*
* @method Phaser.Textures.Texture#getSourceImage
* @since 3.0.0
*
* @param {(string|integer)} [name] - The string-based name, or integer based index, of the Frame to get from this Texture.
*
* @return {(HTMLImageElement|HTMLCanvasElement)} The DOM Image or Canvas Element.
*/
getSourceImage: function (name)
{
if (name === undefined || name === null || this.frameTotal === 1)
{
name = '__BASE';
}
var frame = this.frames[name];
if (!frame)
{
console.warn('No Texture.frame found with name ' + name);
return this.frames['__BASE'].source.image;
}
else
{
return frame.source.image;
}
},
/**
* Given a Frame name, return the data source image it uses to render with.
* You can use this to get the normal map for an image for example.
*
* This will return the actual DOM Image.
*
* @method Phaser.Textures.Texture#getDataSourceImage
* @since 3.7.0
*
* @param {(string|integer)} [name] - The string-based name, or integer based index, of the Frame to get from this Texture.
*
* @return {(HTMLImageElement|HTMLCanvasElement)} The DOM Image or Canvas Element.
*/
getDataSourceImage: function (name)
{
if (name === undefined || name === null || this.frameTotal === 1)
{
name = '__BASE';
}
var frame = this.frames[name];
var idx;
if (!frame)
{
console.warn('No Texture.frame found with name ' + name);
idx = this.frames['__BASE'].sourceIndex;
}
else
{
idx = frame.sourceIndex;
}
return this.dataSource[idx].image;
},
/**
* Adds a data source image to this Texture.
*
* An example of a data source image would be a normal map, where all of the Frames for this Texture
* equally apply to the normal map.
*
* @method Phaser.Textures.Texture#setDataSource
* @since 3.0.0
*
* @param {(HTMLImageElement|HTMLCanvasElement)} data - The source image.
*/
setDataSource: function (data)
{
if (!Array.isArray(data))
{
data = [ data ];
}
for (var i = 0; i < data.length; i++)
{
var source = this.source[i];
this.dataSource.push(new TextureSource(this, data[i], source.width, source.height));
}
},
/**
* Sets the Filter Mode for this Texture.
*
* The mode can be either Linear, the default, or Nearest.
*
* For pixel-art you should use Nearest.
*
* The mode applies to the entire Texture, not just a specific Frame of it.
*
* @method Phaser.Textures.Texture#setFilter
* @since 3.0.0
*
* @param {Phaser.Textures.FilterMode} filterMode - The Filter Mode.
*/
setFilter: function (filterMode)
{
var i;
for (i = 0; i < this.source.length; i++)
{
this.source[i].setFilter(filterMode);
}
for (i = 0; i < this.dataSource.length; i++)
{
this.dataSource[i].setFilter(filterMode);
}
},
/**
* Destroys this Texture and releases references to its sources and frames.
*
* @method Phaser.Textures.Texture#destroy
* @since 3.0.0
*/
destroy: function ()
{
var i;
for (i = 0; i < this.source.length; i++)
{
this.source[i].destroy();
}
for (i = 0; i < this.dataSource.length; i++)
{
this.dataSource[i].destroy();
}
for (var frameName in this.frames)
{
var frame = this.frames[frameName];
frame.destroy();
}
this.source = [];
this.dataSource = [];
this.frames = {};
this.manager = null;
}
});
module.exports = Texture;
| {
"content_hash": "e2d713bbd8ad2e553b53d42c5e830881",
"timestamp": "",
"source": "github",
"line_count": 460,
"max_line_length": 160,
"avg_line_length": 30.141304347826086,
"alnum_prop": 0.5451857194374324,
"repo_name": "henriquelalves/phaser-boilerplate",
"id": "a29a5765d8930d51316e45bc4256f665faa34339",
"size": "14069",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "client/node_modules/phaser/src/textures/Texture.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "203"
},
{
"name": "HTML",
"bytes": "1030"
},
{
"name": "JavaScript",
"bytes": "6764"
},
{
"name": "Python",
"bytes": "909"
}
],
"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.10"/>
<title>XLabs: F:/Projects/Xamarin-Forms-Labs/src/Platform/XLabs.Platform.Win32/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
$(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="XLabs_logo.psd"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">XLabs
</div>
<div id="projectbrief">Cross-platform reusable C# libraries</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.10 -->
<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>Packages</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File List</span></a></li>
<li><a href="globals.html"><span>File Members</span></a></li>
</ul>
</div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('_platform_2_x_labs_8_platform_8_win32_2obj_2_debug_2_temporary_generated_file___e7_a71_f73-0_f8_0b1ebaf6c6935ee7c8c25bb2c91e2398.html','');});
</script>
<div id="doc-content">
<!-- 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="header">
<div class="headertitle">
<div class="title">TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs File Reference</div> </div>
</div><!--header-->
<div class="contents">
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_d4ad4d7d60f821f562b2a7ecf26328a2.html">Xamarin-Forms-Labs</a></li><li class="navelem"><a class="el" href="dir_e9192ae7d8f4e8063a65c898ed7ef130.html">src</a></li><li class="navelem"><a class="el" href="dir_eb16ccdc0c65d45d9a9f21ad6d515031.html">Platform</a></li><li class="navelem"><a class="el" href="dir_75b3d7035c70cb91f6d098130ecef5f1.html">XLabs.Platform.Win32</a></li><li class="navelem"><a class="el" href="dir_5bda373854eed772c962fe1260c9bb89.html">obj</a></li><li class="navelem"><a class="el" href="dir_75086485a976b439d6cff74178dcede7.html">Debug</a></li><li class="navelem"><a class="el" href="_platform_2_x_labs_8_platform_8_win32_2obj_2_debug_2_temporary_generated_file___e7_a71_f73-0_f8_0b1ebaf6c6935ee7c8c25bb2c91e2398.html">TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs</a></li>
<li class="footer">Generated by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.10 </li>
</ul>
</div>
</body>
</html>
| {
"content_hash": "6aab5b4627bd48a23ecf92adbf6e83f4",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 859,
"avg_line_length": 47.185483870967744,
"alnum_prop": 0.6694582122714066,
"repo_name": "XLabs/xlabs.github.io",
"id": "d97d90dec58da5c82965219e24960511bb6b95ae",
"size": "5851",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "html/_platform_2_x_labs_8_platform_8_win32_2obj_2_debug_2_temporary_generated_file___e7_a71_f73-0_f8_0b1ebaf6c6935ee7c8c25bb2c91e2398.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "33201"
},
{
"name": "HTML",
"bytes": "25233456"
},
{
"name": "JavaScript",
"bytes": "1159419"
}
],
"symlink_target": ""
} |
extern "C"
{
#endif
int Controller_Init(void);
int Controller_HandleEvent(const SDL_Event *evt);
#ifdef __cplusplus
}
#endif
#endif // SDL_INC_H
| {
"content_hash": "3534f7902a944c3ce6513389db1e46cf",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 49,
"avg_line_length": 11.461538461538462,
"alnum_prop": 0.697986577181208,
"repo_name": "manylegged/outlaws-core",
"id": "22bcb8bc4be1fb6ffc9317087cdfd5458190ec78",
"size": "719",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "os/sdl/sdl_inc.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "35606"
},
{
"name": "C++",
"bytes": "981335"
},
{
"name": "GLSL",
"bytes": "5626"
},
{
"name": "Lua",
"bytes": "13620"
},
{
"name": "Objective-C",
"bytes": "53581"
},
{
"name": "Python",
"bytes": "97938"
},
{
"name": "Shell",
"bytes": "1063"
}
],
"symlink_target": ""
} |
namespace mx
{
namespace core
{
MX_FORWARD_DECLARE_ATTRIBUTES( TupletDotAttributes )
MX_FORWARD_DECLARE_ELEMENT( TupletDot )
inline TupletDotPtr makeTupletDot() { return std::make_shared<TupletDot>(); }
class TupletDot : public ElementInterface
{
public:
TupletDot();
virtual bool hasAttributes() const;
virtual bool hasContents() const;
virtual std::ostream& streamAttributes( std::ostream& os ) const;
virtual std::ostream& streamName( std::ostream& os ) const;
virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const;
TupletDotAttributesPtr getAttributes() const;
void setAttributes( const TupletDotAttributesPtr& attributes );
private:
virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement );
private:
TupletDotAttributesPtr myAttributes;
};
}
}
| {
"content_hash": "bd276cab424b1dcd4f1799755d6e368a",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 119,
"avg_line_length": 33.645161290322584,
"alnum_prop": 0.6251198465963567,
"repo_name": "Webern/MusicXML-Class-Library",
"id": "f8b7ccc749bbfb7bfaaeda41a80bbf44b347d13d",
"size": "1342",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Sourcecode/private/mx/core/elements/TupletDot.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "1796"
},
{
"name": "C++",
"bytes": "8167393"
},
{
"name": "CMake",
"bytes": "2762"
},
{
"name": "HTML",
"bytes": "8450"
},
{
"name": "Objective-C",
"bytes": "1428"
},
{
"name": "Ruby",
"bytes": "141276"
},
{
"name": "Shell",
"bytes": "1997"
}
],
"symlink_target": ""
} |
require_relative 'row_filter'
require_relative 'column_filter'
require_relative 'dsl'
# Operating csv files
module Sycsvpro
# Counter counts values and uses the values as column names and uses the count
# as the column value
class Counter
include Dsl
# infile contains the data that is operated on
attr_reader :infile
# outfile is the file where the result is written to
attr_reader :outfile
# values are assigned to the key columns
attr_reader :key_columns
# key columns headers
attr_reader :key_titles
# filter that is used for rows
attr_reader :row_filter
# filter that is used for columns
attr_reader :col_filter
# values that are assigned to the key column
attr_reader :key_values
# header of the out file
attr_reader :heading
# indicates whether the headline values should be sorted
attr_reader :heading_sort
# Title of the sum row
attr_reader :sum_row_title
# row where to add the sums of the columns
attr_reader :sum_row
# Title of the sum column
attr_reader :sum_col_title
# sums of the column values
attr_reader :sums
# Creates a new counter. Takes as attributes infile, outfile, key, rows, cols, date-format and
# indicator whether to add a sum row
def initialize(options={})
@infile = options[:infile]
@outfile = options[:outfile]
init_key_columns(options[:key])
@row_filter = RowFilter.new(options[:rows], df: options[:df])
@col_filter = ColumnFilter.new(options[:cols], df: options[:df])
@key_values = {}
@heading = []
@heading_sort = options[:sort].nil? ? true : options[:sort]
init_sum_scheme(options[:sum])
@sums = Hash.new(0)
end
# Executes the counter
def execute
process_count
write_result
end
# Processes the counting on the in file
def process_count
File.new(infile).each_with_index do |line, index|
result = col_filter.process(row_filter.process(line.chomp, row: index))
unless result.nil? or result.empty?
key = unstring(line).split(';').values_at(*key_columns)
key_value = key_values[key] || key_values[key] = { name: key,
elements: Hash.new(0),
sum: 0 }
result.chomp.split(';').each do |column|
heading << column if heading.index(column).nil?
key_value[:elements][column] += 1
key_value[:sum] += 1
sums[column] += 1
end
end
end
end
# Writes the count results
def write_result
sum_line = [sum_row_title] + [''] * (key_titles.size - 1)
headline = heading_sort ? heading.sort : original_pivot_sequence_heading
headline << add_sum_col unless sum_col_title.nil?
headline.each do |h|
sum_line << sums[h]
end
row = 0;
File.open(outfile, 'w') do |out|
out.puts sum_line.join(';') if row == sum_row ; row += 1
out.puts (key_titles + headline).join(';')
key_values.each do |k,v|
out.puts sum_line.join(';') if row == sum_row ; row += 1
line = [k]
headline.each do |h|
line << v[:elements][h] unless h == sum_col_title
end
line << v[:sum] unless sum_col_title.nil?
out.puts line.join(';')
end
end
end
private
# Initializes the sum row title an positions as well as the sum column
# title
def init_sum_scheme(sum_scheme)
return if sum_scheme.nil?
re = /(\w+):(\d+)|(\w+)/
sum_scheme.scan(re).each do |part|
if part.compact.size == 2
@sum_row_title = part[0]
@sum_row = part[1].to_i
else
@sum_col_title = part[2]
end
end
end
# Initialize the key columns and headers
def init_key_columns(key_scheme)
@key_titles = []
@key_columns = []
keys = key_scheme.scan(/(\d+):(\w+)/)
keys.each do |key|
@key_titles << key[1]
@key_columns << key[0].to_i
end
end
# Arrange heading in the original sequence regarding conditional column
# filters
def original_pivot_sequence_heading
(heading.sort - col_filter.pivot.keys << col_filter.pivot.keys).flatten
end
# Add a sum column to the end of the heading
def add_sum_col
sums[sum_col_title] = sums.values.inject(:+)
sum_col_title
end
end
end
| {
"content_hash": "d590edd2608bf55af029c6b9edeb4154",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 98,
"avg_line_length": 30.148387096774194,
"alnum_prop": 0.5698694628718168,
"repo_name": "sugaryourcoffee/syc-svpro",
"id": "c7188100a79924f03160b7bbf85f6d3db5cf09fb",
"size": "4673",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/sycsvpro/counter.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Cucumber",
"bytes": "265"
},
{
"name": "Ruby",
"bytes": "219487"
},
{
"name": "TeX",
"bytes": "99"
}
],
"symlink_target": ""
} |
package net.rudp;
/**
* This class specifies the RUDP parameters of a socket.
*
* @author Adrian Granados
* @see net.rudp.ReliableSocket
*/
public class ReliableSocketProfile
{
public final static int MAX_SEND_QUEUE_SIZE = 32;
public final static int MAX_RECV_QUEUE_SIZE = 32;
public final static int MAX_SEGMENT_SIZE = 128;
public final static int MAX_OUTSTANDING_SEGS = 3;
public final static int MAX_RETRANS = 3;
public final static int MAX_CUMULATIVE_ACKS = 3;
public final static int MAX_OUT_OF_SEQUENCE = 3;
public final static int MAX_AUTO_RESET = 3;
public final static int NULL_SEGMENT_TIMEOUT = 2000;
public final static int RETRANSMISSION_TIMEOUT = 600;
public final static int CUMULATIVE_ACK_TIMEOUT = 300;
/**
* Creates a profile with the default RUDP parameter values.
*
* Note: According to the RUDP protocol's draft, the default
* maximum number of retransmissions is 3. However, if packet
* drops are too high, the connection may get stall unless
* the sender continues to retransmit packets that have not been
* unacknowledged. We will use 0 instead, which means unlimited.
*
*/
public ReliableSocketProfile()
{
this(MAX_SEND_QUEUE_SIZE,
MAX_RECV_QUEUE_SIZE,
MAX_SEGMENT_SIZE,
MAX_OUTSTANDING_SEGS,
0/*MAX_RETRANS*/,
MAX_CUMULATIVE_ACKS,
MAX_OUT_OF_SEQUENCE,
MAX_AUTO_RESET,
NULL_SEGMENT_TIMEOUT,
RETRANSMISSION_TIMEOUT,
CUMULATIVE_ACK_TIMEOUT);
}
/**
* Creates an profile with the specified RUDP parameter values.
*
* @param maxSendQueueSize maximum send queue size (packets).
* @param maxRecvQueueSize maximum receive queue size (packets).
* @param maxSegmentSize maximum segment size (octets) (must be at least 22).
* @param maxOutstandingSegs maximum number of outstanding segments.
* @param maxRetrans maximum number of consecutive retransmissions (0 means unlimited).
* @param maxCumulativeAcks maximum number of unacknowledged received segments.
* @param maxOutOfSequence maximum number of out-of-sequence received segments.
* @param maxAutoReset maximum number of consecutive auto resets (not used).
* @param nullSegmentTimeout null segment timeout (ms).
* @param retransmissionTimeout retransmission timeout (ms).
* @param cumulativeAckTimeout cumulative acknowledge timeout (ms).
*/
public ReliableSocketProfile(int maxSendQueueSize,
int maxRecvQueueSize,
int maxSegmentSize,
int maxOutstandingSegs,
int maxRetrans,
int maxCumulativeAcks,
int maxOutOfSequence,
int maxAutoReset,
int nullSegmentTimeout,
int retransmissionTimeout,
int cumulativeAckTimeout)
{
checkValue("maxSendQueueSize", maxSendQueueSize, 1, 255);
checkValue("maxRecvQueueSize", maxRecvQueueSize, 1, 255);
checkValue("maxSegmentSize", maxSegmentSize, 22, 65535);
checkValue("maxOutstandingSegs", maxOutstandingSegs, 1, 255);
checkValue("maxRetrans", maxRetrans, 0, 255);
checkValue("maxCumulativeAcks", maxCumulativeAcks, 0, 255);
checkValue("maxOutOfSequence", maxOutOfSequence, 0, 255);
checkValue("maxAutoReset", maxAutoReset, 0, 255);
checkValue("nullSegmentTimeout", nullSegmentTimeout, 0, 65535);
checkValue("retransmissionTimeout", retransmissionTimeout, 100, 65535);
checkValue("cumulativeAckTimeout", cumulativeAckTimeout, 100, 65535);
_maxSendQueueSize = maxSendQueueSize;
_maxRecvQueueSize = maxRecvQueueSize;
_maxSegmentSize = maxSegmentSize;
_maxOutstandingSegs = maxOutstandingSegs;
_maxRetrans = maxRetrans;
_maxCumulativeAcks = maxCumulativeAcks;
_maxOutOfSequence = maxOutOfSequence;
_maxAutoReset = maxAutoReset;
_nullSegmentTimeout = nullSegmentTimeout;
_retransmissionTimeout = retransmissionTimeout;
_cumulativeAckTimeout = cumulativeAckTimeout;
}
/**
* Returns the maximum send queue size (packets).
*/
public int maxSendQueueSize()
{
return _maxSendQueueSize;
}
/**
* Returns the maximum receive queue size (packets).
*/
public int maxRecvQueueSize()
{
return _maxRecvQueueSize;
}
/**
* Returns the maximum segment size (octets).
*/
public int maxSegmentSize()
{
return _maxSegmentSize;
}
/**
* Returns the maximum number of outstanding segments.
*/
public int maxOutstandingSegs()
{
return _maxOutstandingSegs;
}
/**
* Returns the maximum number of consecutive retransmissions (0 means unlimited).
*/
public int maxRetrans()
{
return _maxRetrans;
}
/**
* Returns the maximum number of unacknowledged received segments.
*/
public int maxCumulativeAcks()
{
return _maxCumulativeAcks;
}
/**
* Returns the maximum number of out-of-sequence received segments.
*/
public int maxOutOfSequence()
{
return _maxOutOfSequence;
}
/**
* Returns the maximum number of consecutive auto resets.
*/
public int maxAutoReset()
{
return _maxAutoReset;
}
/**
* Returns the null segment timeout (ms).
*/
public int nullSegmentTimeout()
{
return _nullSegmentTimeout;
}
/**
* Returns the retransmission timeout (ms).
*/
public int retransmissionTimeout()
{
return _retransmissionTimeout;
}
/**
* Returns the cumulative acknowledge timeout (ms).
*/
public int cumulativeAckTimeout()
{
return _cumulativeAckTimeout;
}
public String toString()
{
StringBuilder sb = new StringBuilder();
sb.append("[");
sb.append(_maxSendQueueSize).append(", ");
sb.append(_maxRecvQueueSize).append(", ");
sb.append(_maxSegmentSize).append(", ");
sb.append(_maxOutstandingSegs).append(", ");
sb.append(_maxRetrans).append(", ");
sb.append(_maxCumulativeAcks).append(", ");
sb.append(_maxOutOfSequence).append(", ");
sb.append(_maxAutoReset).append(", ");
sb.append(_nullSegmentTimeout).append(", ");
sb.append(_retransmissionTimeout).append(", ");
sb.append(_cumulativeAckTimeout);
sb.append("]");
return sb.toString();
}
private void checkValue(String param,
int value,
int minValue,
int maxValue)
{
if (value < minValue || value > maxValue) {
throw new IllegalArgumentException(param);
}
}
private int _maxSendQueueSize;
private int _maxRecvQueueSize;
private int _maxSegmentSize;
private int _maxOutstandingSegs;
private int _maxRetrans;
private int _maxCumulativeAcks;
private int _maxOutOfSequence;
private int _maxAutoReset;
private int _nullSegmentTimeout;
private int _retransmissionTimeout;
private int _cumulativeAckTimeout;
}
| {
"content_hash": "038cb1e9f802567510502dff0f001d75",
"timestamp": "",
"source": "github",
"line_count": 232,
"max_line_length": 102,
"avg_line_length": 33.775862068965516,
"alnum_prop": 0.5958397141398672,
"repo_name": "JianweiWang/rudp-1.2.3",
"id": "9510105ed8d0dc3fc8bd2da2d44bad82c3b1791c",
"size": "9492",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/net/rudp/ReliableSocketProfile.java",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Java",
"bytes": "136394"
}
],
"symlink_target": ""
} |
/* Utility Functions, range and time slider helpers */
| {
"content_hash": "7ef5ac495afb2418659825d28793a65d",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 54,
"avg_line_length": 55,
"alnum_prop": 0.7454545454545455,
"repo_name": "Sotera/track-communities",
"id": "512acb589827102558ff8c748507a91a1a3732c0",
"size": "55",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tangelo_html/js/app/util.sliders.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "4779"
},
{
"name": "HTML",
"bytes": "8062"
},
{
"name": "Java",
"bytes": "44413"
},
{
"name": "JavaScript",
"bytes": "226480"
},
{
"name": "Puppet",
"bytes": "4311"
},
{
"name": "Python",
"bytes": "48710"
},
{
"name": "Ruby",
"bytes": "2567"
},
{
"name": "Shell",
"bytes": "10547"
}
],
"symlink_target": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.